Skip to content
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

parsing logical expression #203

Open
JayHuLBL opened this issue Jan 24, 2023 · 0 comments · May be fixed by #204
Open

parsing logical expression #203

JayHuLBL opened this issue Jan 24, 2023 · 0 comments · May be fixed by #204
Assignees

Comments

@JayHuLBL
Copy link
Contributor

In Buildings library, class Buildings.Controls.OBC.ASHRAE.G36.VentilationZones.ASHRAE62_1.Setpoints, the enable condition in

  parameter Boolean have_typTerUni=false
    "True: the zone has typical terminal units and CO2 sensor"
    annotation(Dialog(enable=have_CO2Sen and not have_SZVAV and not have_parFanPowUni));

will be parsed as:

"element_modification": {
    "name": "enable",
    "modification": {
        "equal": true,
        "expression": {
            "simple_expression": "have_CO2Sen and not have_SZVAV and not have_typTerUni"
         }
    }
}

The expected output is

"element_modification": {
  "name": "enable",
  "modification": {
    "equal": true,
    "expression": {
      "simple_expression": {
        "logical_expression": {
          "logical_or": [
            {
              "logical_and": [
                {
                  "arithmetic_expressions": [
                    {
                      "name": "have_CO2Sen"
                    }
                  ]
                },
                {
                  "not": true,
                  "arithmetic_expressions": [
                    {
                      "name": "have_SZVAV"
                    }
                  ]
                },
                {
                  "not": true,
                  "arithmetic_expressions": [
                    {
                      "name": "have_parFanPowUni"
                    }
                  ]
                }
              ]
            }
          ]
        }
      }
    }
  }
}
@JayHuLBL JayHuLBL self-assigned this Jan 24, 2023
@JayHuLBL JayHuLBL linked a pull request Jan 24, 2023 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant