-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Parameters which are declared in a base class and which are not modified in derived classes appear after parameters which are declared in derived classes.
This is the opposite of what Modelica tools do.
The reason is that
- on the server side, the inheritance tree of a given class (which is stored under the key
treeListoftemplates.json) is built by appending the variables of the next parent class (https://github.com/lbl-srg/ctrl-flow-dev/blob/main/server/src/parser/parser.ts#L404-L416) and then iterating over all variables to return the class names (https://github.com/lbl-srg/ctrl-flow-dev/blob/main/server/src/parser/template.ts#L128-L141); - on the client side, the parameter assignments are retrieved by iterating over
treeList: https://github.com/lbl-srg/ctrl-flow-dev/blob/main/client/src/interpreter/interpreter.ts#L565-L576
Note that the rationale behind iterating over treeList is to select the latest parameter modification in the inheritance tree, see https://github.com/lbl-srg/ctrl-flow-dev/blob/main/client/src/interpreter/interpreter.ts#L494-L501
Therefore, simply changing the order of treeList is probably not the solution to this issue as it may result in missing parameter overrides.
The current production version doesn't exhibit this issue because the VAV templates don't have exposed parameter declared in base classes and not modified in derived classes.