Opened 12 years ago
Closed 7 years ago
#1858 closed enhancement (fixed)
Better template classes
Reported by: | Per Östlund | Owned by: | Adeel Asghar |
---|---|---|---|
Priority: | low | Milestone: | 1.13.0 |
Component: | OMEdit | Version: | |
Keywords: | Cc: | Per Östlund |
Description
We should change the template classes for new classes in OMEdit to be a bit more user-friendly. E.g. add an empty equation section to models, and an empty algorithm section to functions.
Change History (11)
comment:1 by , 12 years ago
Milestone: | 1.9.0 |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:2 by , 12 years ago
Owner: | changed from | to
---|
follow-up: 4 comment:3 by , 12 years ago
We can add the equation/algorithm within the string that OMEdit routes through OMC and it will work. The problem is the list API which strips out the empty equation/algorithm sections. Create a file with empty sections, load it and then call list on the classes.
I think its not really required. It won't be helpful for users since OMEdit is a graphical editor. This feature is already in MDT and is handy there since MDT is a textual editor.
follow-up: 5 comment:4 by , 12 years ago
Replying to adeas31:
The problem is the list API
No, the problem is you use the list API instead of reading the buffer from file. Using the list API means all error-messages you get from OMC are wrong
follow-up: 6 comment:5 by , 12 years ago
Replying to sjoelund.se:
Replying to adeas31:
The problem is the list API
No, the problem is you use the list API instead of reading the buffer from file. Using the list API means all error-messages you get from OMC are wrong
Yes I use the list API. Since not all models are saved. If you create a new model and you need to show its text then you have to use the list API to get it.
Also, if you have a package and want to show the text of the nested model in it. In this case if I use the file reading stuff then there is a lot file handling stuff required.
comment:6 by , 12 years ago
If you create a new model and you need to show its text then you have to use the list API to get it.
Not if you create your own buffer in OMEdit!
Also, if you have a package and want to show the text of the nested model in it. In this case if I use the file reading stuff then there is a lot file handling stuff required.
Exactly! Go do it ;)
comment:7 by , 12 years ago
OMEdit can ask the compiler for the file information of classes, so that it knows where a class begins and ends. Then it should be fairly trivial to get that part of the file from file or memory. I'm not sure if such an API exists already, but it should be easy to add.
comment:8 by , 10 years ago
Priority: | high → low |
---|
comment:9 by , 9 years ago
Milestone: | → Future |
---|
comment:10 by , 7 years ago
loadString("model M equation algorithm end M;");getErrorString(); list();
Returns:
model M equation algorithm end M;
So Adeel could implement this I guess...
comment:11 by , 7 years ago
Milestone: | Future → 1.13.0 |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Done in 99e87f/OMEdit.
This seemed like an easy thing to fix, but as usual I was wrong. OMEdit creates a string with the class and routes it through OMC which gleefully (I imagine) strips empty equation/algorithm sections.