The current version of ctrl-flow lacks support for a multi-tier tree structure such as:
System
└── Subsystem
└── ...
└── Template
Building the app with MBL commit 2bfde98b1c in which the following classes are annotated with __ctrlFlow_template yields the following screen in the UI.
Buildings/Templates/Plants (* package.mo)
├── Controls (* package.mo)
│ └── HeatPumps (* package.mo)
│ └── AirToWater.mo (*)
└── HeatPumps (* package.mo)
└── AirToWater.mo (*)
The logic behind the current implementation is to simply display a flat list of all system types, where a new system type is created for each package.mo file annotated with __ctrlFlow_template. Each system type is populated by the set of templates found below, based on their path, regardless of the nesting level, and regardless of potential duplicates.
The order of the system types does not match the one in package.order (or in the package definition file for single-file packages). See the joint issue: lbl-srg/modelica-json#262
This is in stark contrast with the original requirement specification which stated:
- A file explorer with a tree view should reveal the package structure in a left panel.
- Only the classes defined in the package file, or enumerated in the package.order file shall be displayed. And they shall be displayed in the same order as the one specified by those two files.
To provide basic support for nested packages, duplicates will be removed by using the immediate parent package for the system type. From here, we can generate a list of system types, but we still lack support for:
- subtypes,
- ordering the templates according to the
package.order file.
To help the future development of a tree view that allows for multiple levels of hierarchy, a generic tree-like type will already be introduced to store the templates, e.g.:
type TemplateNode = {
description: string;
className: string;
json: Object;
contents?: Array<TemplateNode>;
};
The work on this issue will also improve the routing logic based on the description from https://github.com/lbl-srg/modelica-buildings-templates/blob/master/docs/guide.md?plain=1#L568-L575.
The current version of ctrl-flow lacks support for a multi-tier tree structure such as:
Building the app with MBL commit 2bfde98b1c in which the following classes are annotated with
__ctrlFlow_templateyields the following screen in the UI.The logic behind the current implementation is to simply display a flat list of all system types, where a new system type is created for each
package.mofile annotated with__ctrlFlow_template. Each system type is populated by the set of templates found below, based on their path, regardless of the nesting level, and regardless of potential duplicates.The order of the system types does not match the one in
package.order(or in the package definition file for single-file packages). See the joint issue: lbl-srg/modelica-json#262This is in stark contrast with the original requirement specification which stated:
To provide basic support for nested packages, duplicates will be removed by using the immediate parent package for the system type. From here, we can generate a list of system types, but we still lack support for:
package.orderfile.To help the future development of a tree view that allows for multiple levels of hierarchy, a generic tree-like type will already be introduced to store the templates, e.g.:
The work on this issue will also improve the routing logic based on the description from https://github.com/lbl-srg/modelica-buildings-templates/blob/master/docs/guide.md?plain=1#L568-L575.