- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » parameter passing for records does...
parameter passing for records does not work
parameter passing for records does not work
hello again ,
seems that the record issue is not going to stop. here another problem:
the parameter passing for records does not work: if you have a model which contains records or an array of records as parameters and you want to set
them to other values while creating an instance in another model, the new values are not passed!
Code:
package testOM
record GenericData
parameter Integer dataOne = 1;
parameter Integer dataTwo = 1;
end GenericData;
record DataSetOne = GenericData(dataOne = 5, dataTwo = 10);
record DataSetTwo = GenericData(dataOne = 15, dataTwo = 20);
model HasRecordAsParameter
parameter GenericData data;
Integer variable;
equation
variable = data.dataOne;
end HasRecordAsParameter;
model PassesRecordAsParameter
parameter DataSetOne data;
HasRecordAsParameter parameterReceiver(data = data);
Integer variable;
equation
variable = parameterReceiver.variable;
end PassesRecordAsParameter;
model PassesRecordArrayAsParameter
parameter DataSetOne data1;
parameter DataSetTwo data2;
parameter GenericData data[2]={data1,data2};
HasRecordAsParameter parameterReceiver[2](data = data);
Integer variable;
equation
variable = parameterReceiver[1].variable;
end PassesRecordArrayAsParameter;
end testOM;
in the cases above, the "variable" value after simulating is always "1" , although it should be "5".
Is this bug related to one that has already been reported? I will have a look into codeBeamer...hope I will find that...
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » parameter passing for records does...