Opened 6 years ago

Closed 19 months ago

#5045 closed enhancement (fixed)

Allow to check functions (and other types of classes?) in OMEdit

Reported by: Francesco Casella Owned by: Adrian Pop
Priority: high Milestone: 1.22.0
Component: Interactive Environment Version:
Keywords: Cc: albertoleva

Description

If you try to check a function in OMEdit, you get something like

[1] 14:59:48 Translation Error
Cannot instantiate Modelica.Math.isEqual due to
class specialization FUNCTION.

Apparently, the way OMEdit interprets "check" is: instantiate and see what happens, which is OK for models but not for functions.

I guess allowing some form of testing of function code shouldn't be hard - it's just a matter of calling the appropriate front-end stuff. It would also be nice to be allowed to check entire packages, though this probably requires some more work.

Change History (6)

comment:1 by Francesco Casella, 6 years ago

Cc: albertoleva added

comment:2 by Adeel Asghar, 6 years ago

Do you mean allow calling a function? If yes then see #3959.

in reply to:  2 comment:3 by Francesco Casella, 6 years ago

Replying to adeas31:

Do you mean allow calling a function? If yes then see #3959.

Not necessarily. Here, I just want to check that the code is syntactically correct, that all the referenced types and classes do exist, that all the variables are properly declared, that the functions called inside the function do exist and have the right types of input/output arguments, etc.

Currently, the only way to do so is to write a test model that uses the function and simulate it. In fact, building some test models is a good design workflow, but it should be possible to quickly check against syntax errors, mis-typed variables and similar errors just by clicking on the "Check" button.

comment:4 by Adeel Asghar, 6 years ago

Component: OMEditInteractive Environment
Owner: changed from Adeel Asghar to Adrian Pop
Status: newassigned

It was discussed during the developers meeting today that checkModel API should be enhanced for functions to build a test model which calls the function.

comment:5 by Francesco Casella, 6 years ago

Or, alternatively, to run the steps involved in the processing of functions for simulation, stopping short of the actual code generation stage.

comment:6 by Francesco Casella, 19 months ago

Milestone: 2.0.01.22.0
Resolution: fixed
Status: assignedclosed

Fixed in v. 1.22.0 for the case of functions.

For other classes (packages in particular) I guess we need another ticket.

Note: See TracTickets for help on using tickets.