the following model 'Checkimport1' simulates in openmodelica old frontend and not in new frontend
package DatabaseA
package Data//Database
model DataStructure //properties
parameter Integer A;
parameter String B;
parameter Real C;
parameter Real D[3];
end DataStructure;
model Comp1//values for properties
extends DataStructure(A = 1, B = "Comp1", C = 10, D={0.1,1,-1});
end Comp1;
model Comp2//values for properties
extends DataStructure(A = 2, B = "Comp2", C = 20, D={0.2,2,-2});
end Comp2;
model Comp3//values for properties
extends DataStructure(A = 3, B = "Comp3", C = 30, D={0.3,3,-3});
end Comp3;
end Data;
model Checkimport1
import DatabaseA.Data.*;
parameter Comp1 AB;
parameter Comp3 AC;
parameter DataStructure List[:] = {AB,AC};
end Checkimport1;
end DatabaseA;
openmodelica 1.22.1 version. 'Checkimport1' simulates with old frontend and new frontend reports error
Component 'List' may not have a binding equation due to class specialization 'model'
The answer by @Prims is a good step, but it should be improved even further to be correct Modelica by also changing
Comp1andComp3to berecord:The reason is that a
modelcannot beparameter(this also applies toDataStructureitself) https://specification.modelica.org/master/class-predefined-types-and-declarations.html#prefix-rulesNote that
Comp2inheriting from arecordcould technically be amodelsince it is not used - but I opted for consistency, https://specification.modelica.org/master/inheritance-modification-and-redeclaration.html#restrictions-on-the-kind-of-base-class