Ignore:
Timestamp:
2022-06-30T17:33:05+02:00 (23 months ago)
Author:
Per Östlund <perost86@…>
Parents:
4928c1c
git-author:
Per Östlund <perost86@…> (06/29/22 17:06:02)
git-committer:
Per Östlund <perost86@…> (06/30/22 17:33:05)
Message:

Improve extends in getModelInstance

  • Change extends to be an object that contain a class instance instead of being a class instance directly, and add modifiers and annotations from the extends clause to it.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuite/openmodelica/instance-API/GetModelInstanceExtends1.mos

    rda5a55e9 r0c056fda  
    1313  model M
    1414    Real y;
    15     extends A;
     15    extends A(x = 1) annotation(IconMap(extent = {{-100, -100}, {100, 100}}));
    1616    Real z;
    1717  end M;
    1818");
     19getErrorString();
    1920
    2021getModelInstance(M, prettyPrint=true);
     
    2223// Result:
    2324// true
     25// ""
    2426// "{
    2527//   \"name\": \"M\",
     
    2729//   \"extends\": [
    2830//     {
    29 //       \"name\": \"A\",
    30 //       \"restriction\": \"model\",
    31 //       \"components\": [
    32 //         {
    33 //           \"name\": \"x\",
    34 //           \"type\": \"Real\",
    35 //           \"prefixes\": {
     31//       \"modifiers\": {
     32//         \"x\": {
     33//           \"value\": \"1\"
     34//         }
     35//       },
     36//       \"annotation\": {
     37//         \"IconMap\": {
     38//           \"extent\": [
     39//             [
     40//               -100,
     41//               -100
     42//             ],
     43//             [
     44//               100,
     45//               100
     46//             ]
     47//           ]
     48//         }
     49//       },
     50//       \"baseClass\": {
     51//         \"name\": \"A\",
     52//         \"restriction\": \"model\",
     53//         \"components\": [
     54//           {
     55//             \"name\": \"x\",
     56//             \"type\": \"Real\",
     57//             \"value\": {
     58//               \"binding\": 1
     59//             },
     60//             \"prefixes\": {
    3661//
     62//             }
    3763//           }
    38 //         }
    39 //       ]
     64//         ]
     65//       }
    4066//     }
    4167//   ],
Note: See TracChangeset for help on using the changeset viewer.