Skip to content

Commit

Permalink
name macromolecule
Browse files Browse the repository at this point in the history
  • Loading branch information
shb0527 committed Jul 24, 2024
1 parent 7f4a8a5 commit 7cd544a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 6 deletions.
18 changes: 15 additions & 3 deletions SBOLCanvasFrontend/src/app/glyphInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,21 @@ export class GlyphInfo extends Info {
this.name = partRolePrefix || " "
}

getMacromolecules(){
//??
return macromolecules.NGA || macromolecules.complex || macromolecules.dsNA;
getMacromoleculesName(){
if(this.partType == 'Complex'){
this.name = 'comp';
}else if(this.partType == 'macromolecule'){
this.name = 'prot';
}else if(this.partType == 'dsNA'){
this.name = 'dna';
}else if(this.partType == 'ssNA'){
this.name = 'rna';
}else if(this.partType == 'small_molecule'){
this.name = 'chem';
}else if(this.partType == 'NGA'){
this.name = 'nga';
}

}

makeCopy() {
Expand Down
22 changes: 19 additions & 3 deletions SBOLCanvasFrontend/src/app/info-editor/info-editor.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,29 @@ inputChange(event: any) {
* Updates both the glyph info in the form and in the graph.
* @param glyphInfo
*/
getMacromoleculesName(){

if(this.glyphInfo.partType == 'Complex'){
this.glyphInfo.name = 'comp';
}else if(this.glyphInfo.partType == 'Protein' || this.glyphInfo.partType == 'macromoleule'){
this.glyphInfo.name = 'prot';
}else if(this.glyphInfo.partType == 'dsNA' || this.glyphInfo.partType == 'DNA molecule'){
this.glyphInfo.name = 'dna';
}else if(this.glyphInfo.partType == 'ssNA' || this.glyphInfo.partType == 'RNA molecule'){
this.glyphInfo.name = 'rna';
}else if(this.glyphInfo.partType == 'Small molecule'){
this.glyphInfo.name = 'chem';
}else if(this.glyphInfo.partType == 'NGA'){
this.glyphInfo.name = 'nga';
}

}
glyphInfoUpdated(glyphInfo: GlyphInfo) {

this.glyphInfo = glyphInfo;

if(this.glyphInfo.partType === 'Protein'){
this.glyphInfo.name = this.glyphInfo.getMacromolecules();
}

this.getMacromoleculesName();

this.glyphCtrl = new FormControl( `${this.glyphInfo.displayID}`, Validators.required);

Expand Down

0 comments on commit 7cd544a

Please sign in to comment.