Opened 8 years ago

Closed 5 years ago

#4240 closed defect (fixed)

Duplicate of model fails

Reported by: Christian Kral <dr.christian.kral@…> Owned by: perost
Priority: high Milestone: 2.0.0
Component: Interactive Environment Version:
Keywords: Cc: adeas31

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

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 Changed 8 years ago by Christian Kral <dr.christian.kral@…>

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

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.

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

Requested log file

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

Attached the requested log file, compressed as ZIP

comment:5 follow-up: Changed 8 years ago by adeas31

  • Cc perost added

Can you run the attached script and post the output?

Per, copyClass is failing without setting any error message.

Changed 8 years ago by adeas31

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

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

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 Changed 8 years ago by Christian Kral <dr.christian.kral@…>

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}
\"\"
"

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

OMShell output

comment:9 Changed 8 years ago by adeas31

  • Cc adeas31 added; perost removed
  • Component changed from OMEdit to Interactive Environment
  • Owner changed from adeas31 to perost
  • Status changed from new to assigned

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

comment:10 Changed 6 years ago by casella

  • Milestone changed from Future to 2.0.0

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

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

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

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

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

I suppose this ticket is resolved now.

Note: See TracTickets for help on using tickets.