Opened 11 years ago

Closed 11 years ago

#2666 closed defect (fixed)

Display issues in OMEDIT (r19853)

Reported by: massimo ceraolo Owned by: Adeel Asghar
Priority: normal Milestone: 1.9.1
Component: OMEdit Version: trunk
Keywords: Cc:

Description

Issue 1
It is not rare that OMEdit does not display the name of a block, and instead shows "%name%". For instance this is the case for the provided model:
PowerSystems.Examples.PowerWorld.PowerWorld, block "dispatcher".
Issue 2
When a "RealExpression" block refers to a long expression, maybe it could be shown with ellipsis. Otherwise we get strange results. See for instance the block "frequency" in the provided model:
PowerSystems.Examples.PowerWorld.PowerWorld.

Change History (5)

comment:1 by Adeel Asghar, 11 years ago

Status: newaccepted

For Issue 1,
From Modelica Spec 33,
There are a number of common macros that can be used in the text, and they should be replaced when displaying the text as follows:

  • %par replaced by the value of the parameter par. The intent is that the text is easily readable, thus if par is of an enumeration type, replace %par by the item name, not by the full name. [Example: if par="Modelica.Blocks.Types.Enumeration.Periodic", then %par should be displayed as "Periodic"]
  • %% replaced by %
  • %name replaced by the name of the component (i.e. the identifier for it in in the enclosing class).
  • %class replaced by the name of the class.

So, I am not going to fix it. Change the code from %name% to %name.

I will try to fix Issue 2.

in reply to:  1 comment:2 by Per Östlund, 11 years ago

Replying to adeas31:

So, I am not going to fix it. Change the code from %name% to %name.

Shouldn't %name% be replaced with ComponentName%? %name is still %name, if there's a % after it shouldn't matter. Sure, %name% is probably used incorrectly in the referenced model, but that's another matter.

comment:3 by massimo ceraolo, 11 years ago

Thank you, both, Adeas and Perost.

I did not check the specifications. Just assumed the Power system library, rather recently delivered (and for which a paper was presented at the March Modelica Conference) was correct.

I'm in contact with a couple of the authors of the Power Systems Library. I will tell them about the second % that should not be there.

comment:4 by Adeel Asghar, 11 years ago

I agree with Per. So I have fixed Issue 1. Now OMEdit can gracefully handle %name% starting from r20155.

Note that instead of displaying ComponentName% I changed the code to display only ComponentName. Since the specification doesn't say anything about alone % so I assume any single % should be removed. Because if you want to print a % then you should write %%.

I still recommending fixing the library according to the specification OR ask the Modelica group about how should a single % should be handled.

comment:5 by Adeel Asghar, 11 years ago

Resolution: fixed
Status: acceptedclosed
Note: See TracTickets for help on using tickets.