Opened 18 years ago

Last modified 14 years ago

#91 closed defect (fixed)

Would be nice if 'unknown' attributes could also be written to MOF output

Reported by: filip Owned by: filip
Priority: critical Milestone:
Component: Version:
Keywords: Cc: filip, Adrian Pop

Description

See comments

Change History (6)

comment:1 by filip, 18 years ago

class A

Real x(unit = "m", group = "Operational"); Would be nice if 'unknown'

attributes could also be
written to MOF output

end A;

comment:2 by Peter Aronsson, 18 years ago

This would mean that OpenModelica extends the Modelica language with these
groups. Perhaps this is not so wise. An alternative is to instead use
annotations for such attributes.

comment:3 by filip, 18 years ago

(In reply to comment #1)

This would mean that OpenModelica extends the Modelica language with these
groups. Perhaps this is not so wise. An alternative is to instead use
annotations for such attributes.

The problem is that annotations are dropped when flat modelica is generated,
for instance:

class A

Real x(unit = "m") annotation(group = "Operational");

end A;

Flat modelica output:

fclass A
Real x(unit = "m");
end A;

I am using my own code generator to generate executable code from flat
modelica and would like to be able to pass on additional meta-information
(such as "group") from the original modelica input to my executable models.
Annotations are not an option since these apparently are dropped.

comment:4 by Peter Aronsson, 18 years ago

Then I would propose that annotations are added to the flat definition. I think
that if we start to add non-standard attributes we will finally end up in a
mess, where each user would like to have their own specific attributes.
Annotations were invented exactly for this purpose.

comment:5 by filip, 18 years ago

If annotations could be written to the flat modelica output, that would be
fine with me. PS: Note that I was originally not asking for an extension of
the language or the set of standard attributes, but merely for OMC to pass on
non-standard attributes to flat modelica as-is (without any interpretation
whatsoever).

comment:6 by Per Östlund, 14 years ago

This was solved a while ago in r6074 by adding the +showAnnotations flag which preserves annotations in the flattened Modelica.

Note: See TracTickets for help on using tickets.