You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the function unpackModblock of server/src/parser/modification.ts we have:
if(declaration?.modification){mods=getModificationList(declaration.modificationasmj.ClassMod,basePath,value,);// TODO: getModificationList should handle redeclares but it is not// correctly unpacking nested modifiers - this is a bug// kludge: remove nested modifiersmods.forEach((m)=>(m.mods=[]));console.log(mods);}
There are 2 potential issues with this.
One affects the existing configuration workflow. If a choice includes class modifications, those modifications will be voided. This can lead to a parameter dialog that does not align with the Modelica implementation for such a choice.
The other affects the backward translation from the UI schema to Modelica. Since the choice modifications are not stored in templates.json there is no means to generate correct Modelica code from the user selections.
This issue is potentially of high impact since it may call for revising the UI schema, or at least the data stored in templates.json.
Additionally, choices may include constraining-clause which is also to be taken into account.
TODO list with this ticket:
Investigate the existing behavior for non-trivial choices annotations with redeclare, class modifications, replaceable and constraining clauses.
Refactor the function unpackModblock so that it can handle such constructs in alignment with MLS.
Implement the required changes to templates.json and to the UI schema to support backward translation to Modelica, given user selections that include complex choices annotations.
Example of choices annotation not properly handled:
choice(
redeclarereplaceable Buildings.Templates.Components.Coils.WaterBasedHeating coiHeaPre(
redeclarefinalpackage MediumHeaWat=MediumHeaWat,
redeclarefinal Buildings.Templates.Components.Valves.TwoWayModulating val)
"Hot water coil with two-way valve"),
The text was updated successfully, but these errors were encountered:
In the function
unpackModblock
ofserver/src/parser/modification.ts
we have:There are 2 potential issues with this.
templates.json
there is no means to generate correct Modelica code from the user selections.This issue is potentially of high impact since it may call for revising the UI schema, or at least the data stored in
templates.json
.Additionally, choices may include constraining-clause which is also to be taken into account.
TODO list with this ticket:
unpackModblock
so that it can handle such constructs in alignment with MLS.templates.json
and to the UI schema to support backward translation to Modelica, given user selections that include complex choices annotations.Example of choices annotation not properly handled:
The text was updated successfully, but these errors were encountered: