Opened 9 years ago
Closed 9 years ago
#4165 closed defect (fixed)
C runtime simulation_data.h out of date
| Reported by: | Henning Kiel | Owned by: | Lennart Ochel |
|---|---|---|---|
| Priority: | low | Milestone: | 1.11.0 |
| Component: | Run-time | Version: | v1.11.0 |
| Keywords: | Cc: | Adrian Pop |
Description (last modified by )
The file OMCompiler/SimulationRuntime/c/simulation_data.h has inconsistent dummy values. At least the macro dummyRealAttribute causes lots of warnings (which are suppressed, if no error occurs).
#define omc_dummyVarInfo {-1,-1,"","",omc_dummyFileInfo}
#define omc_dummyEquationInfo {-1,0,"",-1,NULL}
#define omc_dummyFunctionInfo {-1,"",omc_dummyFileInfo}
#define omc_dummyRealAttribute {NULL,NULL,DBL_MAX,-DBL_MAX,0,0,1.0,0,0.0}
[...]
/* Model info structures */
typedef struct VAR_INFO
{
int id;
int inputIndex; /* -1 means not an input */
const char *name;
const char *comment;
FILE_INFO info;
} VAR_INFO;
typedef struct EQUATION_INFO
{
int id;
int profileBlockIndex;
int parent;
int numVar;
const char **vars;
}EQUATION_INFO;
typedef struct FUNCTION_INFO
{
int id;
const char* name;
FILE_INFO info;
}FUNCTION_INFO;
[...]
typedef struct REAL_ATTRIBUTE
{
modelica_string unit; /* = "" */
modelica_string displayUnit; /* = "" */
modelica_real min; /* = -Inf */
modelica_real max; /* = +Inf */
modelica_boolean fixed; /* depends on the type */
modelica_boolean useNominal; /* = false */
modelica_real nominal; /* = 1.0 */
modelica_real start; /* = 0.0 */
}REAL_ATTRIBUTE;
Change History (8)
comment:1 by , 9 years ago
| Cc: | added |
|---|
comment:2 by , 9 years ago
| Description: | modified (diff) |
|---|
comment:3 by , 9 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → accepted |
follow-up: 7 comment:4 by , 9 years ago
omc_dummyRealAttribute should be fixed with OMCompiler#1269.
comment:5 by , 9 years ago
Ohh – I just see that omc_dummyEquationInfo is also wrong. Should we use 0 or -1 as default value for parent?
comment:6 by , 9 years ago
There is also an error with min=DBL_MAX and max=-DBL_MAX (I assume the signs are exchanged)
comment:8 by , 9 years ago
| Resolution: | → fixed |
|---|---|
| Status: | accepted → closed |
Note:
See TracTickets
for help on using tickets.

That's probably my fault. I removed an obsolete attribute from that structure recently.