Opened 12 years ago
Closed 12 years ago
#2177 closed defect (fixed)
parameter arrays [with enumeration subscript] are not #defined in generated code
Reported by: | Pavol Privitzer | Owned by: | Per Östlund |
---|---|---|---|
Priority: | high | Milestone: | 1.9.0 |
Component: | Backend | Version: | trunk |
Keywords: | Cc: |
Description
The attached model does not compile;
first compilation error is:
TestPosture.c: In function 'eqFunction_7':
TestPosture.c:241: error: '$Ptmodel$PartyFractGz' undeclared (first use in this function)
....
The problem is the parameter array tmodel.artyFractGz does not get its own #define, only its elements do,
so the attempt to reach the array as a whole in the equation (eqFunction_7 generated from resultP = artyFractGz[Status_Posture]; ) fails ..
Attachments (1)
Change History (3)
by , 12 years ago
Attachment: | TestPosture.mo added |
---|
comment:1 by , 12 years ago
comment:2 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed in r16050. Arrays with enumeration dimensions now get #defines for the whole array, and I also fixed some issues in the Model_info.xml so that the variables get the correct names. There are some minor cosmetic issues in OMEdit when plotting variables with enumeration subscripts, see #2188, but that's not really a problem.
I've attached a newer version of the test model with array indexed by Integer together with (renamed) array by an enum.
The arrayByInt is part of the #defines as expected while the arrayByEnum is not (the bug).