Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dump conditional components in getModelInstance (#9322)
- Loading branch information
Showing
4 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -308,7 +308,7 @@ | |
"$ref": "#/definitions/annotation" | ||
} | ||
}, | ||
"required": ["name", "type"] | ||
"required": ["name"] | ||
} | ||
] | ||
}, | ||
|
35 changes: 35 additions & 0 deletions
35
testsuite/openmodelica/instance-API/GetModelInstanceConditional1.mos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// name: GetModelInstanceConditional1 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
// | ||
|
||
loadString(" | ||
model M | ||
parameter Real x if false; | ||
end M; | ||
"); | ||
|
||
getModelInstance(M, prettyPrint=true); | ||
|
||
// Result: | ||
// true | ||
// "{ | ||
// \"name\": \"M\", | ||
// \"restriction\": \"model\", | ||
// \"components\": [ | ||
// { | ||
// \"name\": \"x\", | ||
// \"condition\": false, | ||
// \"prefixes\": { | ||
// \"variability\": \"parameter\" | ||
// } | ||
// } | ||
// ], | ||
// \"source\": { | ||
// \"filename\": \"<interactive>\", | ||
// \"location\": \"2:3-4:8\" | ||
// } | ||
// }" | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters