Opened 6 years ago

Closed 6 years ago

#5343 closed defect (fixed)

Duplicate of read only model is also read only (but shouldn't)

Reported by: Christian Kral <dr.christian.kral@…> Owned by: Adeel Asghar
Priority: high Milestone: 1.14.0
Component: OMEdit Version: v1.14.0-dev-nightly
Keywords: Cc: Andrea Bartolini, Martin Sjölund

Description

If I load any system library in OpenModelica, then the library is marked as read only. If I make a copy of any model to be treated as a new separate model, then the model is also marked as read only -- which does not make sense.

Reproducible example:

  • Open Modelica Standard library
  • Double click on Modelica.Blocks.Examples.Filter
  • Right click on Filter and select Duplicate
    Name: Filter
    Path: (blank)
    
  • Change Modelica code in duplicated model
  • A warning appears: Warning: You are changing a read-only class.

If I unload the model an re-open it, the read only warning is not shown any more...

Attachments (2)

FilterReadOnly.png (349.9 KB ) - added by Christian Kral <dr.christian.kral@…> 6 years ago.
Screenshot of read only behavior
script.mos (164 bytes ) - added by Adeel Asghar 6 years ago.

Download all attachments as: .zip

Change History (17)

comment:1 by Francesco Casella, 6 years ago

Milestone: Future1.14.0

It's not critical, but it would be nice to have it fixed in 1.14.0

comment:2 by Adeel Asghar, 6 years ago

I am unable to reproduce this issue.
It works as expected for me.

comment:3 by Francesco Casella, 6 years ago

I am also unable to reproduce the issue with the latest nightly build. @christian, what version of OMEdit are you using?

in reply to:  3 comment:4 by dr, 6 years ago

Replying to casella:

I am also unable to reproduce the issue with the latest nightly build. @christian, what version of OMEdit are you using?

I am using

OMEdit 1.14.0~dev-45-g9f3d0f7
Connected to OpenModelica 1.14.0~dev-285-g270177b
Connected to OMSimulator unknown-linux

on Linux Mint 19.1 64bit XFCE.

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

I actually also tested this issue under Linux Mint 18.3 64bit XFCE. It does not work either on this version of Linux Mint.

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

Attachment: FilterReadOnly.png added

Screenshot of read only behavior

comment:6 by Francesco Casella, 6 years ago

Cc: Andrea Bartolini added

Maybe it' a Linux thing.

@Andrea.Bartolini, can you try this please?

comment:7 by Andrea.bartolini, 6 years ago

I confirm the wrong behavior reported by Christian.
Moreover, if you modify the model (for example adding a parameter) and save it, the modification is saved, in spite of the shown warning.

OMEdit 1.14.0~dev-45-g9f3d0f7
Connected to OpenModelica 1.14.0~dev-285-g270177b
Connected to OMSimulator unknown-linux

Sysop: Linux Ubuntu 16.04

comment:8 by Francesco Casella, 6 years ago

Then, the problem is probably caused by the way Linux handles file properties, which is different from Windows?

by Adeel Asghar, 6 years ago

Attachment: script.mos added

comment:9 by Adeel Asghar, 6 years ago

I can't even reproduce it on Linux.
@Christian and @Andrea.Bartolini can you post the output of the attached script?

comment:10 by Andrea.bartolini, 6 years ago

Here the output of the script on my PC:

andrea@andrea-hp-pavilion-notebook:~/Downloads$ omc script.mos
true
""
true
""
("model","Demonstrates the Continuous.Filter block with various options",false,false,false,"<interactive>",true,169,3,250,13,{},false,false,"","",false,"")
""
andrea@andrea-hp-pavilion-notebook:~/Downloads$

comment:11 by Adeel Asghar, 6 years ago

Cc: Martin Sjölund added

Martin any idea why do we get true for readonly attribute?

comment:12 by Adeel Asghar, 6 years ago

Ahh maybe for you the Modelica.Blocks.Examples.Filter is readonly and then the SOURCEINFO is copied as it is.

comment:13 by Adeel Asghar, 6 years ago

Hopefully 91743ce/OMCompiler fixes this issue.

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

I tested version

OMEdit 1.14.0~dev-47-g29420dd
Connected to OpenModelica 1.14.0~dev-323-g220cd16
Connected to OMSimulator unknown-linux

and the issue does not appear any more. So it seems to be fixed from my point of view.

comment:15 by Francesco Casella, 6 years ago

Resolution: fixed
Status: newclosed

Please reopen if the issue pops up again.

Note: See TracTickets for help on using tickets.