Opened 5 years ago

Last modified 18 months ago

#5346 new defect

Duplicate model function in OMEdit should work without compromises

Reported by: casella Owned by: adeas31
Priority: blocker Milestone: 2.0.0
Component: OMEdit Version:
Keywords: Cc: dr.christian.kral@…, dietmarw, ceraolo, perost, adrpo

Description (last modified by 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 Changed 5 years ago by ceraolo

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 Changed 5 years ago by dietmarw

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 Changed 5 years ago by casella

  • Description modified (diff)

comment:4 Changed 5 years ago by casella

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

comment:5 follow-up: Changed 5 years ago by Christian Kral <dr.christian.kral@…>

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 follow-up: Changed 5 years ago by 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.

comment:7 in reply to: ↑ 5 Changed 5 years ago by ceraolo

deleted comment

Last edited 5 years ago by ceraolo (previous) (diff)

comment:8 in reply to: ↑ 6 Changed 5 years ago by casella

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 Changed 5 years ago by adeas31

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 Changed 5 years ago by adeas31

  • Cc perost adrpo added

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

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

comment:12 Changed 5 years ago by dietmarw

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 Changed 5 years ago by adeas31

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

comment:14 Changed 5 years ago by dietmarw

Which means 2.0.0?

comment:15 Changed 5 years ago by adeas31

Yes!

comment:16 Changed 5 years ago by casella

See milestone :)

comment:17 Changed 5 years ago by dietmarw

mea culpa

comment:18 follow-up: Changed 4 years ago by 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?

comment:19 in reply to: ↑ 18 Changed 4 years ago by anonymous

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 Changed 4 years ago by casella

@adeas31, is this backported to 1.14.1 and 1.15.0?

comment:21 Changed 4 years ago by adeas31

Yes the fix is copied.

comment:22 Changed 4 years ago by casella

Good, thanks!

Note: See TracTickets for help on using tickets.