Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#5680 closed defect (fixed)

Dots replaced by __ in text view when creating a model in graph view

Reported by: olivleno Owned by: adrpo
Priority: blocker Milestone: 1.14.0
Component: OMEdit Version: v1.14.0-dev-nightly
Keywords: corrupt modeling Cc:

Description

In the attached model is corrupt by using drag and drop in the graphics view. In the text view all "." are shown as "".

Attachments (5)

test.mo (653 bytes) - added by olivleno 5 years ago.
test2.mo (456 bytes) - added by anonymous 5 years ago.
omeditcommunication.log (3.2 MB) - added by olivleno 5 years ago.
test3.mo (456 bytes) - added by olivleno 5 years ago.
script.mos (346 bytes) - added by adeas31 5 years ago.

Change History (24)

Changed 5 years ago by olivleno

comment:1 Changed 5 years ago by casella

@olivleno, it is not clear to me how did you obtain this model. Do you mean you dragged and dropped from the MSL and got double underscores instead of dots in the class names?

Changed 5 years ago by anonymous

comment:2 follow-up: Changed 5 years ago by anonymous

It sounds rediculous, but in fact it is. I'm very surprised that this kind of fundamental disfunctionality has been put out as "stable" version.

This is what I do:

  1. open OMEdit
  2. create new model named test2
  3. drag an integrator and a first order block in the graphics window
  4. switch to text view
model test2
  Modelica__Blocks__Continuous__Integrator integrator annotation(
    Placement(visible = true, transformation(origin = {-32, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica__Blocks__Continuous__FirstOrder firstOrder annotation(
    Placement(visible = true, transformation(origin = {10, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation

annotation(
    uses(Modelica(version = "3.2.3")));
end test2;

comment:3 in reply to: ↑ 2 Changed 5 years ago by casella

Replying to anonymous:

It sounds ridiculous, but in fact it is. I'm very surprised that this kind of fundamental disfunctionality has been put out as "stable" version.

Well, beta versions are supposed to be stable, unless they aren't, and we fix them asap before the official release. That's what betas are for.

This is what I do:

  1. open OMEdit
  2. create new model named test2
  3. drag an integrator and a first order block in the graphics window
  4. switch to text view
model test2
  Modelica__Blocks__Continuous__Integrator integrator annotation(
    Placement(visible = true, transformation(origin = {-32, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica__Blocks__Continuous__FirstOrder firstOrder annotation(
    Placement(visible = true, transformation(origin = {10, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation

annotation(
    uses(Modelica(version = "3.2.3")));
end test2;

I can't reproduce this behaviour with the latest 1.15.0 nightly under Windows. I'll check with the beta and report.

comment:4 Changed 5 years ago by casella

  • Milestone changed from Future to 1.14.0

I'm now using OpenModelica v1.14.0-dev.beta1 (64-bit) on a Windows 10 pro laptop. I went through your four steps and the result is:

model test2
  Modelica.Blocks.Continuous.Integrator integrator annotation(
    Placement(visible = true, transformation(origin = {-34, 14}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Blocks.Continuous.FirstOrder firstOrder annotation(
    Placement(visible = true, transformation(origin = {44, 12}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation

annotation(
    uses(Modelica(version = "3.2.3")));
end test2;

which looks good to me.

@olivleno, can you please report exactly which version you are using (Help | About OMEdit) on which operating system?

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

comment:5 Changed 5 years ago by casella

@adeas31, any idea why this could happen?

comment:6 Changed 5 years ago by adeas31

I also can't reproduce the issue.
@olivleno can you upload omeditcommunication.log file so we can see what went wrong and when.

comment:7 Changed 5 years ago by anonymous

Connected to OpenModelica v1.14.0-dev.beta1 (64-bit)
Connected to OMSimulator v2.1.0-dev-147-g36ec2c7-mingw
on a Windows 10 laptop.

How do I find or create the communication.log file?

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

It is located in %TEMP%/OpenModelica/OMEdit.

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

Replying to adeas31:

It is located in %TEMP%/OpenModelica/OMEdit.

You should be able to get there with Tools | Open Working directory

comment:10 Changed 5 years ago by olivleno

Thanks for the hint.
It's uploaded now.

comment:11 Changed 5 years ago by adeas31

This is not the relevant log file. It doesn't show the steps you mentioned in comment:2 instead it just shows that you opened test2.mo. Please the do the following,

  • Stop any running instance of OMEdit.
  • Delete the log file.
  • Start OMEdit.
  • Follow the steps mentioned in comment:2.
  • Close OMEdit.
  • Send the log file again.

Changed 5 years ago by olivleno

Changed 5 years ago by olivleno

comment:12 Changed 5 years ago by casella

From line 29870 I read

addComponent(integrator, Modelica.Blocks.Continuous.Integrator,test3,annotate=Placement(visible=true, transformation=transformation(origin={-40,12}, extent={{-10,-10},{10,10}}, rotation=0))) 11:45:05:315
true 11:45:05:315
#s#; 0.000000; 9.187000; 'addComponent(integrator, Modelica.Blocks.Continuous.Integrator,test3,annotate=Placement(visible=true, transformation=transformation(origin={-40,12}, extent={{-10,-10},{10,10}}, rotation=0)))'

getUses(test3) 11:45:05:315
{} 11:45:05:315
#s#; 0.000000; 9.187000; 'getUses(test3)'

errors:=getMessagesStringInternal() 11:45:05:316
{} 11:45:05:393
#s#; 0.077000; 9.264000; 'errors:=getMessagesStringInternal()'

size(errors,1) 11:45:05:393
0 11:45:05:394
#s#; 0.001000; 9.265000; 'size(errors,1)'

addClassAnnotation(test3, annotate=$annotation(uses(Modelica(version="3.2.3")))) 11:45:05:394
true 11:45:05:396
#s#; 0.002000; 9.267000; 'addClassAnnotation(test3, annotate=$annotation(uses(Modelica(version="3.2.3"))))'

listFile(test3,true) 11:45:05:396
"model test3
  Modelica__Blocks__Continuous__Integrator integrator annotation(
    Placement(visible = true, transformation(origin = {-40, 12}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation

  annotation(
    uses(Modelica(version = "3.2.3")));
end test3;" 11:45:05:396
#s#; 0.000000; 9.267000; 'listFile(test3,true)'

That's weird indeed.

comment:13 Changed 5 years ago by adeas31

Yes I saw that already. I am debugging what could be the reason for that. Maybe inside the Compiler some sort of locale aware dot(.) is used OR maybe @olivleno has some specific settings. I can't say what is wrong yet.

@olivleno can you run the attached script from command line and post the output.

Changed 5 years ago by adeas31

comment:14 Changed 5 years ago by adrpo

Found the problem.

When omc is ran with:

  -m, --modelicaOutput       Enables valid modelica output for flat modelica.

It will show paths with __ instead of ..
In your log file you have:

setCommandLineOptions("--matchingAlgorithm=PFPlusExt --indexReductionMethod=dynamicStateSelection -d=initialization,NLSanalyticJacobian,newInst -d=initialization -m") 11:44:33:275

The last one, -m is what generates this issue. If you remove -m all will be well.

We should fix this, it should be activated only when dumping flat Modelica (DAE), not normal Modelica code.

From AbsynDumpTpl.tpl:

template dumpPath(Absyn.Path path)
::=
match path
  case FULLYQUALIFIED(__) then
    '.<%dumpPath(path)%>'
  case QUALIFIED(__) then
    if (Flags.getConfigBool(Flags.MODELICA_OUTPUT)) then
    '<%name%>__<%dumpPath(path)%>'
    else
    '<%name%>.<%dumpPath(path)%>'
  case IDENT(__) then
    '<%name%>'
  else
    errorMsg("SCodeDump.dumpPath: Unknown path.")
end dumpPath;

comment:15 Changed 5 years ago by adrpo

  • Owner changed from adeas31 to adrpo
  • Status changed from new to accepted

comment:16 Changed 5 years ago by adeas31

@olivleno you should remove the -m option. Remove it in OMEdit from Tools->Options->Simulation->Additional Translation Flags:, save and then restart OMEdit.

comment:17 Changed 5 years ago by adrpo

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

comment:18 Changed 5 years ago by casella

Thank you @adrpo!

comment:19 Changed 5 years ago by olivleno

Yes, I can confirm that removing the "-m" option solves the issue.
Thanks for going after this and applying the fix instantly.

Note: See TracTickets for help on using tickets.