-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing elements when parsing Boolean expressions #255
Comments
The raw-json for the enable annotation of There seems to be several issues.
|
@AntoineGautier Would you please check if the branch issue255_booleanExp fixed the issue? |
The raw-json output is fixed with The json output still bundles some terms of the expression into a string, rather than a recursively parsed object (see below). But this could be addressed in another issue for good separation of concerns. "element_modification": {
"name": "enable",
"modification": {
"equal": true,
"expression": {
"simple_expression": {
"logical_expression": {
"logical_or": [
{
"logical_and": [
{
"arithmetic_expressions": [
{
"name": "(have_pumChiWatPriDed or have_chiWat and typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Headered)"
}
]
},
{
"arithmetic_expressions": [
{
"name": "typDis"
},
{
"name": "Buildings.Templates.Plants.HeatPumps.Types.Distribution.Constant1Variable2"
}
],
"relation_operator": "=="
}
]
}
]
}
}
}
}
} |
Running
node ../modelica-json/app.js -f Buildings/Templates/Plants/HeatPumps/Interfaces/PartialHeatPumpPlant.mo -o json
with
yields the following JSON object for the enable annotation of
typPumChiWatPri_select1
:Several parts of the Boolean expression used in the binding of the enable attribute are missing and the
logical_or
andlogical_and
clauses are not balanced:https://github.com/lbl-srg/modelica-buildings/blob/master/Buildings/Templates/Plants/HeatPumps/Interfaces/PartialHeatPumpPlant.mo#L270-L278
@JayHuLBL Can you look into this?
(This issue is surprising because such expressions are commonly used in MBL templates so I wonder why we did not detect that earlier. This may be a regression.)
[EDIT] This is not a regression: commit a46a361 (used in first release of ctrl-flow) yields the same JSON object for the enable annotation of
typPumChiWatPri_select1
.The text was updated successfully, but these errors were encountered: