Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#4045 closed enhancement (fixed)

Better support for naming of dragged component instances

Reported by: casella Owned by: adeas31
Priority: critical Milestone:
Component: OMEdit Version:
Keywords: Cc:

Description

When dragging and dropping a component instance in a model diagram using OMEdit, the instance is named by default with the name of the class with lowercase initial, followed by 1 (or 2, 3, etc. if there are many instances).

In most non-trivial models, this default choice is not really good, because by definition such names are too generic. As a consequence, interpreting the results later on in the simulation results browser becomes difficult, because it is not clear which phyisical object or phenomenon do modelName1, modelName2 and so on actually represent. This is not really a modelling style that the tool should promote. On the contrary, we should encourage the modeller to think carefully about the name that is given to each model. In OO modelling, proper namining is very important if the model has to be understandable later on by 3-rd parties, or even by the same author who created it.

Furthermore, changing the instance name is a bit tricky, as one has to right-click on the dragged component, select "Attributes" (is the component name an attribute?) and finally change the name of the instance to something more appropriate.

My suggestion would be that as the component is released on the diagram, a dialog window pops up asking for the component name. We can keep the current modelNameNN as a default proposed name, that one can simply accept by hitting Return or clicking on the OK button. But I would write a text on the dialog along these lines "Please choose a meaningful name for this component, to improve the readability of simulation results".

I know, this might sound a bit pedantic, but I think tools should also have some didactical value, helping new users doing things right from the start.

Change History (4)

comment:1 Changed 8 years ago by ceraolo

Agree.
Experienced users will save some clicks.
Students and new users will be prompted to avoid the common mistake of leaving in place generic names.
The use of adequate names is a must for any programming, and Modelica, even when used in graphical mode, is not an exception.

comment:2 Changed 8 years ago by adeas31

Done in c6b9df1/OMEdit.
When user drops a component a dialog pops up asking for a component name. OMEdit proposes the same old style component name but user can change it to something meaningful. The dialog also contains a checkbox "Don't show this message again", if checked then the user is not prompted again. The behavior is manageable via OMEdit settings i.e., Tools->Options->Notifications->Always ask for the dragged component name. There might be some users who don't want a prompt every time they drag & drop a component. The prompt is shown by default.

Yes I put changing the component name in Attributes dialog (its better than showing it in Parameters dialog as Dymola does).

comment:3 Changed 8 years ago by casella

  • Resolution set to fixed
  • Status changed from new to closed

Thanks!

comment:4 Changed 7 years ago by sjoelund.se

  • Milestone 1.10.0 deleted

Milestone deleted

Note: See TracTickets for help on using tickets.