Opened 6 years ago

Last modified 2 years ago

#5346 new defect

Duplicate model function in OMEdit should work without compromises

Reported by: Francesco Casella Owned by: Adeel Asghar
Priority: blocker Milestone: 2.0.0
Component: OMEdit Version:
Keywords: Cc: dr.christian.kral@…, Dietmar Winkler, massimo ceraolo, Per Östlund, Adrian Pop

Description (last modified by Francesco Casella)

A very common model development pattern, particularly among beginners, is to start duplicating existing and working models, possibly putting them in a completely different package, and then applying some changes.

OMEdit currently falls short of providing this basic feature, because the duplicated models are often invalid for various reasons. Expert users can try to fix them manually, but this is not an option for beginners.

I had a discussion at the last Modelica Design meeting with Leo Gall, and basically on of the reasons why he can't start using OMC seriously with his customers is that he cannot follow this pattern. Christian Kral is also suffering with his students, and I guess many others are longing for this feature, even though they don't open tickets.

I think having a decent Duplicate functionality is definitely a must-have for 2.0.0, so I'm opening this combo ticket as a blocker for that release.

Currently open issues on this topic are: #4240, #4536, #4799, #4875, #5191, #5343, #5344, #5393. We should have them all fixed in time for 2.0.0

Of course it would be nice if at least the issues that are easier to fix are done in time for 1.14.0. @adeas31, what do you think?

Change History (23)

comment:1 by massimo ceraolo, 6 years ago

Maybe a cut/copy/paste on the model tree, in Dymola's way, is the most friendly way to manage and move models inside and across packages.

The absence of this feature is the first reason of difficulty for my students when using OMEdit, as Kral's, in addition to ticket #3776, which is somehow related.

If fast promotion of OMEdit usage is concerned, probably the most proper milestone for this ticket is 1.14.0, as the one of #3776. However, since I presume that #3776 is easier to solve, maybe it is correct that that ticket has priority over this one.

comment:2 by Dietmar Winkler, 6 years ago

Just my upvote for this desperately needed feature. Basically OMEdit can not really be used for new users trying to learn from existing working examples by extending them or modifying them because of this. Not unless there is an expert at hand to help fixing broken class references.

comment:3 by Francesco Casella, 6 years ago

Description: modified (diff)

comment:4 by Francesco Casella, 6 years ago

I would add that if we can't fix Duplicate in certain conditions, we should rather disable it than keeping it flawed.

comment:5 by Christian Kral <dr.christian.kral@…>, 6 years ago

I think, that if a new user would not have the Duplicate feature in OMEdit, he would probably copy and paste the text of the model and would end up in the same situation as now. The copied model is not working. I therefore very much support the idea of having this issue fixed.

comment:6 by Adeel Asghar, 6 years ago

I am trying to fix these tickets since few weeks now. I made some positive progress and hopefully will finish it next week. I don't think it will work 100% in regards of preserving the formatting but at least the duplication will work. We can improve the preservation of formatting later.

in reply to:  5 comment:7 by massimo ceraolo, 6 years ago

Version 1, edited 6 years ago by massimo ceraolo (previous) (next) (diff)

in reply to:  6 comment:8 by Francesco Casella, 6 years ago

Replying to adeas31:

I am trying to fix these tickets since few weeks now. I made some positive progress and hopefully will finish it next week. I don't think it will work 100% in regards of preserving the formatting but at least the duplication will work. We can improve the preservation of formatting later.

Sounds like a very good plan :)

comment:9 by Adeel Asghar, 6 years ago

Few of the issues are fixed in ed41047/OMEdit. However, still there are some issues (#4536, #5344) that requires proper refactoring. Per mentioned in ticket:4536#comment:3 that this could be solved with new frontend.

@ChristianKral can you try #4240 again with the latest?

comment:10 by Adeel Asghar, 6 years ago

Cc: Per Östlund Adrian Pop added

comment:11 by Christian Kral <dr.christian.kral@…>, 6 years ago

I tried it again and the issue does not occur any more. I reported this status in #4240.

comment:12 by Dietmar Winkler, 6 years ago

What is the status on this? I've just tested it again with

OMEdit 1.11.0~1-gf048cec
Connected to OpenModelica 1.14.0~dev-5851-ga72ff35

and it still does not update the relative class references after duplication.

comment:13 by Adeel Asghar, 6 years ago

See comment:9. We have to wait for the new frontend.

comment:14 by Dietmar Winkler, 6 years ago

Which means 2.0.0?

comment:15 by Adeel Asghar, 6 years ago

Yes!

comment:16 by Francesco Casella, 6 years ago

See milestone :)

comment:17 by Dietmar Winkler, 6 years ago

mea culpa

comment:18 by anonymous, 5 years ago

Hello, everyone.

I realized that 'Duplicate' feature has bug at latest OMEdit release v1.14.0 and v1.14.1 .
When duplicate some model,
(s.t. MSL's example model Modelica.Mechanics.Translational.Examples.SignConvention)
OMEdit raises error. The error says that name of duplicate target is a modelica's keyword,
despite SignConvention is not a Modelica's keyword!

Should this issue be discussed on this ticket? Or should I create a new ticket?

in reply to:  18 comment:19 by anonymous, 5 years ago

Replying to anonymous:

Hello, everyone.

I realized that 'Duplicate' feature has bug at latest OMEdit release v1.14.0 and v1.14.1 .
When duplicate some model,
(s.t. MSL's example model Modelica.Mechanics.Translational.Examples.SignConvention)
OMEdit raises error. The error says that name of duplicate target is a modelica's keyword,
despite SignConvention is not a Modelica's keyword!

Should this issue be discussed on this ticket? Or should I create a new ticket?

This was solved two days ago. Try the latest nightly.

comment:20 by Francesco Casella, 5 years ago

@adeas31, is this backported to 1.14.1 and 1.15.0?

comment:21 by Adeel Asghar, 5 years ago

Yes the fix is copied.

comment:22 by Francesco Casella, 5 years ago

Good, thanks!

Note: See TracTickets for help on using tickets.