Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#3794 closed defect (fixed)

Frontend eats input / output qualifiers

Reported by: Rüdiger Franke Owned by: Adrian Pop
Priority: critical Milestone:
Component: Frontend Version: v1.10.0-dev-nightly
Keywords: Cc:

Description

See the following example:

package HierarchicalConnector
  connector IO
    input Real u;
    output Real y;
  end IO;

  model Test
    IO io;
  equation
    io.y = 2*io.u;
  end Test;

  model Test2
    IO[1] io;
  equation
    io.y = 2*io.u;
  end Test2;
end HierarchicalConnector;

The frontend generates for HierarchicalConnector.Test the correct flat model:

class Test
  input Real io.u;
  output Real io.y;
equation
  io.y = 2.0 * io.u;
end Test;

For HierarchicalConnector.Test2 it generates:

class Test2
  Real io[1].u;
  Real io[1].y;
equation
  io[1].y = io[1].u * 2.0;
end Test2;

The translation fails with:

Too few equations, under-determined system. The model has 1 equation(s) and 2 variable(s).

This is critical for FMI export.

Change History (7)

comment:1 by Adrian Pop, 9 years ago

Owner: changed from somebody to Adrian Pop
Status: newaccepted

This seems to be an scalar vs array issue.

comment:2 by Martin Sjölund, 9 years ago

I'm not totally sure model Test generates the expected results. We only keep input/output on the top-level class, right? If you use model IO, you get the expected results from how the front-end was designed (which is what @rfranke thinks is the wrong result).

comment:3 by Adrian Pop, 9 years ago

IO is a connector so I think is correct what we generate for Test and it should be the same for Test2.

comment:4 by Rüdiger Franke, 9 years ago

Resolution: fixed
Status: acceptedclosed

9d2b906/OMCompiler shall fix this. I'm adding a test too.

comment:5 by Adrian Pop, 9 years ago

I had this fix also but had to go on a car trip for 7 hours and you fixed it in the meantime :)

comment:6 by Rüdiger Franke, 9 years ago

Never mind. There are many more open tickets :-)

comment:7 by Martin Sjölund, 7 years ago

Milestone: 1.10.0

Milestone deleted

Note: See TracTickets for help on using tickets.