- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » OMEdit: how can I use CombiTable2D...
OMEdit: how can I use CombiTable2D with mat-file?
OMEdit: how can I use CombiTable2D with mat-file?
This is probably very stupid, but... despite of had been using Dymola for a few years, I trully do not know how to use CombiTable2D in OMEdit (OpenModelica) to read data from matlab-file.
When I right-click on the component, I see a few parameters. I changed "tableOnFile" from default "false" to "true" (because next to it there is "= true, if table is defined on file or in function usertab"). But what now? I can not edit fields "tableName" or "fileName", they are greyed out with "NoName" values. In "table" field there is "fill(0.0, 0, 2)". I tried to remove this, but when I re-opened component properties again, it was there again.
IIRC, in Dymola all I had to do was right-click on the field, and then select mat-file. How am I suppose to do it in OMEdit/OpenModelica?
Re: OMEdit: how can I use CombiTable2D with mat-file?
You can't do this. The interactive data manipulation is not possible in OMEdit's parameters window yet. You have to set these values in the code manually. Hopefully we will have this feature soon.
Adeel.
- adeas
- 454 Posts
Re: OMEdit: how can I use CombiTable2D with mat-file?
Not sure if we understand each other, but I do not want any interactive data manipulation (they are in my case stored in mat-file, and I do not want to touch them). All I want is to change two text-parameters ("tableName" and "fileName") the same way, as I changed "tableOnFile" from "false" to "true". But this is not possible in diagram-view.
I switched to text-view and could edit it:
Modelica.Blocks.Tables.CombiTable2D combitable2d1(tableOnFile = true, tableName = "mytable", fileName = "D:/myfiles/data.mat")
This change is then reflected back in diagram-view (those two parameters have then new values) but still I can not change these two parameters there. Only in text-view...
Re: OMEdit: how can I use CombiTable2D with mat-file?
By interactive I mean when you select true for "tableOnFile" the fields "tableName" and "fileName" should become active. Similarly when you select false they should become inactive. This is not supported yet.
Of course you will see your changes done in text view but again as I should you can't make fields active/inactive.
Adeel.
- adeas
- 454 Posts
Re: OMEdit: how can I use CombiTable2D with mat-file?
OK, now I understand. I was confused with that "data manipulation".
BTW, would not be easier to have simply all fields active? I mean, so that user could edit all parameters:
tableOnFile
table
tableName
fileName
Then depending on the first parameter "tableOnFile" value (false/true) either "table" would be considered (for numerical input) or "tableName" and "fileName" (for file-input).
Re: OMEdit: how can I use CombiTable2D with mat-file?
Anyhow, does the component work as it should when you set parameters in the text view?
Re: OMEdit: how can I use CombiTable2D with mat-file?
Yes, it should work.
If you are just specifying the fileName then remember that compiler will try to look for the file in its working directory which is normally at %TEMP%/OpenModelica/OMEdit. A more better approach is to use modelica:// uri format.
Adeel.
- adeas
- 454 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » OMEdit: how can I use CombiTable2D...