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 , 6 years ago
Cc: | added |
---|
follow-up: 3 comment:2 by , 6 years ago
comment:3 by , 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 , 6 years ago
Component: | OMEdit → Interactive Environment |
---|---|
Owner: | changed from | to
Status: | new → assigned |
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 , 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 , 19 months ago
Milestone: | 2.0.0 → 1.22.0 |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Fixed in v. 1.22.0 for the case of functions.
For other classes (packages in particular) I guess we need another ticket.
Do you mean allow calling a function? If yes then see #3959.