Changeset dfa5c6bb in OpenModelica
- Timestamp:
- 2022-05-16T16:03:11+02:00 (2 years ago)
- Branches:
- maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, maintenance/v1.23, master
- Children:
- 82edd6c, e4b7953
- Parents:
- 2ad1387
- git-author:
- perost <perost86@…> (05/16/22 16:03:11)
- git-committer:
- GitHub <noreply@…> (05/16/22 16:03:11)
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
OMCompiler/Compiler/Script/NFApi.mo
raa8243e0 rdfa5c6bb 1158 1158 if isSome(annOpt) then 1159 1159 SOME(ann) := annOpt; 1160 json := JSON.addPair("annotation", 1161 JSON.makeString(SCodeDump.printModStr(ann.modification)), json); 1160 json := JSON.addPair("annotation", dumpJSONMod(ann.modification), json); 1162 1161 end if; 1163 1162 end dumpJSONAnnotationOpt; … … 1220 1219 end dumpJSONReplaceableElements; 1221 1220 1221 function dumpJSONMod 1222 input SCode.Mod mod; 1223 output JSON json = JSON.emptyObject(); 1224 algorithm 1225 () := match mod 1226 case SCode.Mod.MOD() 1227 algorithm 1228 for sm in mod.subModLst loop 1229 json := JSON.addPair(sm.ident, dumpJSONSubMod(sm), json); 1230 end for; 1231 then 1232 (); 1233 1234 else (); 1235 end match; 1236 end dumpJSONMod; 1237 1238 function dumpJSONSubMod 1239 input SCode.SubMod subMod; 1240 output JSON json = JSON.emptyObject(); 1241 protected 1242 SCode.Mod mod = subMod.mod; 1243 algorithm 1244 () := match mod 1245 case SCode.Mod.MOD() 1246 algorithm 1247 if not listEmpty(mod.subModLst) then 1248 json := JSON.addPair("modifiers", dumpJSONMod(mod), json); 1249 end if; 1250 1251 if isSome(mod.binding) then 1252 json := JSON.addPair("value", 1253 JSON.makeString(Dump.printExpStr(Util.getOption(mod.binding))), json); 1254 end if; 1255 then 1256 (); 1257 1258 else (); 1259 end match; 1260 end dumpJSONSubMod; 1261 1222 1262 annotation(__OpenModelica_Interface="backend"); 1223 1263 end NFApi; -
testsuite/openmodelica/instance-API/GetModelInstanceAnnotation1.mos
raa8243e0 rdfa5c6bb 20 20 // "{ 21 21 // \"name\": \"M\", 22 // \"annotation\": \"(Icon(graphics = {Rectangle(extent = {{-66, 78}, {70, -56}}, lineColor = {28, 108, 200})}), Diagram(graphics = {Ellipse(extent = {{-62, 68}, {56, -60}}, lineColor = {28, 108, 200})}))\", 22 // \"annotation\": { 23 // \"Icon\": { 24 // \"modifiers\": { 25 // \"graphics\": { 26 // \"value\": \"{Rectangle(extent = {{-66, 78}, {70, -56}}, lineColor = {28, 108, 200})}\" 27 // } 28 // } 29 // }, 30 // \"Diagram\": { 31 // \"modifiers\": { 32 // \"graphics\": { 33 // \"value\": \"{Ellipse(extent = {{-62, 68}, {56, -60}}, lineColor = {28, 108, 200})}\" 34 // } 35 // } 36 // } 37 // }, 23 38 // \"connections\": [ 24 39 // -
testsuite/openmodelica/instance-API/GetModelInstanceConnection1.mos
r4cb8721 rdfa5c6bb 90 90 // \"lhs\": \"c1\", 91 91 // \"rhs\": \"c3\", 92 // \"annotation\": \"(Line(points = {{-25, 30}, {10, 30}, {10, -20}, {40, -20}}))\" 92 // \"annotation\": { 93 // \"Line\": { 94 // \"modifiers\": { 95 // \"points\": { 96 // \"value\": \"{{-25, 30}, {10, 30}, {10, -20}, {40, -20}}\" 97 // } 98 // } 99 // } 100 // } 93 101 // }, 94 102 // {
Note: See TracChangeset
for help on using the changeset viewer.