Skip to content

Commit

Permalink
Merge pull request #220 from INTO-CPS-Association/182-error-in-loadin…
Browse files Browse the repository at this point in the history
…g-fmus-with-enumeration-type

182 Error in loading fmus with enumeration type
  • Loading branch information
levisen authored Jul 9, 2023
2 parents decbd95 + a548ab7 commit 7e87917
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/angular2-app/coe/models/Fmu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,12 @@ export class Fmu {
tNode = document.evaluate('String', thisNode, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue as Element;
if (tNode != null) {
type = ScalarVariableType.String;
}
} else {
tNode = document.evaluate('Enumeration', thisNode, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue as Element;
if(tNode != null) {
type = ScalarVariableType.Enumeration;
}
}
}
}
}
Expand Down Expand Up @@ -326,7 +331,7 @@ export class ScalarVariable {
}
}

export enum ScalarVariableType { Real, Bool, Int, String, Unknown }
export enum ScalarVariableType { Real, Bool, Int, String, Enumeration, Unknown }
export function typeToString(type: ScalarVariableType) {
switch (type) {
case ScalarVariableType.Real:
Expand All @@ -337,6 +342,8 @@ export function typeToString(type: ScalarVariableType) {
return "Integer";
case ScalarVariableType.String:
return "String";
case ScalarVariableType.Enumeration:
return "Enumeration";
case ScalarVariableType.Unknown:
return "unknown";
}
Expand Down

0 comments on commit 7e87917

Please sign in to comment.