Opened 15 years ago

Closed 3 years ago

Last modified 3 years ago

#1100 closed defect (fixed)

Scalar variables get NON_CONNECTOR instead of NON_FLOW if they are components of a complex variable which is a component of a connector but is not of connector class itself

Reported by: AlexeyLebedev Owned by: AlexeyLebedev
Priority: high Milestone: 1.16.0
Component: *unknown* Version:
Keywords: Cc: AlexeyLebedev

Description

Hello!

I was fixing the bug with scalar connectors getting NON_CONNECTOR instead of NON_FLOW unless they are components of a connector variable for OSMC/MathCore version. But it seems to be a part of a larger bug. Consider the following model:

model Test

record Rec

Real rr;

end Rec;

connector C

Real r;
Rec rec;

end C;

C c;

end Test;

Then c.r gets NON_FLOW, but c.rec.rr gets NON_CONNECTOR. Do I understand correctly that this is also a bug and should be fixed?

(Some comments:

  1. At the moment, if some variable does not have a flow prefix, then OMC bases its decision of whether the variable should get NON_FLOW or NON_CONNECTOR on whether the variable that DIRECTLY contains this one is of connector class. So, c.r is directly contained in c, which is of connector class, so it gets NON_FLOW; but c.rec.rr is directly contained in c.rec, which is of non-connector class, so it gets NON_CONNECTOR. Similarly, if a RealInput variable is directly contained in a non-connector class, it gets NON_CONNECTOR.
  2. This does not really affect the back-end (at least the OSMC trunk one, I'm not certain about OSMC/MathCore), because the connect equations are generated independently of this. Still, this behavior is undesired, as I understand. And it would certainly interfere with separate compilation.
  3. I planned to modify OMC so that it would take into account the "connectorness" of both the class of a variable and the class of the direct container when deciding which Flow attribute to assign to the variable. But it only solves the problem with RealInput-like variables, not the more general problem described here.)

Change History (3)

comment:1 Changed 8 years ago by dietmarw

  • Cc changed from AlexeyLebedev, to AlexeyLebedev
  • Milestone set to Future

comment:2 Changed 3 years ago by perost

  • Component set to *unknown*
  • Resolution set to fixed
  • Status changed from new to closed

This is handled correctly in the new frontend.

comment:3 Changed 3 years ago by casella

  • Milestone changed from Future to 1.16.0
Note: See TracTickets for help on using tickets.