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 Per Östlund, 12 years ago

Milestone: 1.9.0
Owner: changed from Per Östlund to somebody else
Status: newassigned

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.

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

Owner: changed from somebody else to Adeel Asghar

comment:3 by Adeel Asghar, 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.

in reply to:  3 ; comment:4 by Martin Sjölund, 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

in reply to:  4 ; comment:5 by Adeel Asghar, 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.

in reply to:  5 comment:6 by Martin Sjölund, 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 Per Östlund, 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 Per Östlund, 10 years ago

Priority: highlow

comment:9 by Dietmar Winkler, 9 years ago

Milestone: Future

comment:10 by Martin Sjölund, 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 Adeel Asghar, 7 years ago

Milestone: Future1.13.0
Resolution: fixed
Status: assignedclosed

Done in 99e87f/OMEdit.

Note: See TracTickets for help on using tickets.