Opened 8 years ago

Closed 6 years ago

#4240 closed defect (fixed)

Duplicate of model fails

Reported by: Christian Kral <dr.christian.kral@…> Owned by: Per Östlund
Priority: high Milestone: 2.0.0
Component: Interactive Environment Version:
Keywords: Cc: Adeel Asghar

Description

I discovered a reproducible fault when duplicating a model. Please download the actual version of PhotoVoltaics.mo from https://github.com/christiankral/PhotoVoltaics and make a right click on PhotoVoltaics.Examples.SimpleModuleShadow and pick *Duplicate*. Select the new name SimpleModuleShadow2 and let path empty. Then the error message

Unable to create class SimpleModuleShadow2. 
Please make sure you are not using any OpenModelica Keywords like 
(model, package, record, class etc.)

is triggered.

This issue applies to

OMEdit 1.12.0~dev-154-g354a8d1
Connected to OpenModelica 1.12.0~dev-319-gfacdc24
Linux Mint 18.1 64bit

Attachments (3)

omeditcommunication.zip (282.5 KB ) - added by Christian Kral <dr.christian.kral@…> 8 years ago.
Requested log file
PhotoVoltaics.mos (262 bytes ) - added by Adeel Asghar 8 years ago.
OMShell.png (42.1 KB ) - added by Christian Kral <dr.christian.kral@…> 8 years ago.
OMShell output

Download all attachments as: .zip

Change History (16)

comment:1 by Adeel Asghar, 8 years ago

I tested it with,

OMEdit v1.12.0-dev-161-gdc42c6b (64-bit)
Connected to OpenModelica v1.12.0-dev-190-gcafab43 (64-bit)

and it worked fine.
I guess it is already fixed by this commit 0c832da/OMEdit.

Can you update and try again?

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

I checked with

OMEdit 1.12.0~dev-162-g418a7cd
Connected to OpenModelica 1.12.0~dev-352-g0d2d832
Linux Mint 18.1, 64bit

and the issue still remains...

comment:3 by Adeel Asghar, 8 years ago

I have asked Per to test it and he is also unable to reproduce the issue on his Linux machine. So I need more information. Can you send me the omeditcommunication.log (it's located in your working directory) file?

  • Run OMEdit.
  • Duplicate the class.
  • Quit OMEdit (so that the file is flushed properly).
  • Send the omeditcommunication.log file.

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

Attachment: omeditcommunication.zip added

Requested log file

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

Attached the requested log file, compressed as ZIP

comment:5 by Adeel Asghar, 8 years ago

Cc: Per Östlund added

Can you run the attached script and post the output?

Per, copyClass is failing without setting any error message.

by Adeel Asghar, 8 years ago

Attachment: PhotoVoltaics.mos added

in reply to:  5 comment:6 by Per Östlund, 8 years ago

Replying to adeas31:

Can you run the attached script and post the output?

Per, copyClass is failing without setting any error message.

The output for me is:

true
""
true
""
{PhotoVoltaics,ModelicaServices,Complex,Modelica}
""
true
""
{SimpleModuleShadow2,PhotoVoltaics,ModelicaServices,Complex,Modelica}
""

I.e. it's working fine for me. Same result with omc from a week ago and with current master, and the latest version of PhotoVoltaics from the link in the description.

comment:7 by Adeel Asghar, 8 years ago

Yeah I know. Even I am getting the same output. I want Christian Kral to run this script. Since its failing for him for some reason. Look at his attached omeditcommunication.log.

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

I opened OMShell and started the script and got the following results:

runScript("PhotoVoltaics.mos")
"true
\"\"
true
\"\"
{PhotoVoltaics,ModelicaServices,Complex,Modelica}
\"\"
false
\"\"
{PhotoVoltaics,ModelicaServices,Complex,Modelica}
\"\"
"

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

Attachment: OMShell.png added

OMShell output

comment:9 by Adeel Asghar, 8 years ago

Cc: Adeel Asghar added; Per Östlund removed
Component: OMEditInteractive Environment
Owner: changed from Adeel Asghar to Per Östlund
Status: newassigned

I really don't know why copyClass failing for you.

comment:10 by Francesco Casella, 6 years ago

Milestone: Future2.0.0

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

Suggested by #5346: I tried copying class with

OMEdit 1.14.0~dev-56-ge76522f
Connected to OpenModelica 1.14.0~dev-387-g16b0256
Connected to OMSimulator unknown-linux

on my Linux 19.1 machine and no issues occurred. So the issue seems to be fixed.

Applying runScript("PhotoVoltaics.mos") shows the following result:

>> runScript("PhotoVoltaics.mos")
"true
\"\"
true
\"\"
{PhotoVoltaics,ModelicaServices,Complex,Modelica}
\"\"
true
\"\"
{SimpleModuleShadow2,PhotoVoltaics,ModelicaServices,Complex,Modelica}
\"\"
"}}}

comment:12 by Francesco Casella, 6 years ago

@christian, feel free to close the ticket if you think the issue is resolved :)

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

Resolution: fixed
Status: assignedclosed

I suppose this ticket is resolved now.

Note: See TracTickets for help on using tickets.