#5680 closed defect (fixed)
Dots replaced by __ in text view when creating a model in graph view
Reported by: | Oliver Lenord | Owned by: | Adrian Pop |
---|---|---|---|
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)
Change History (24)
by , 5 years ago
comment:1 by , 5 years ago
by , 5 years ago
follow-up: 3 comment:2 by , 5 years ago
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:
- open OMEdit
- create new model named test2
- drag an integrator and a first order block in the graphics window
- 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 by , 5 years ago
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:
- open OMEdit
- create new model named test2
- drag an integrator and a first order block in the graphics window
- 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 by , 5 years ago
Milestone: | Future → 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?
comment:6 by , 5 years ago
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 by , 5 years ago
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:9 by , 5 years ago
Replying to adeas31:
It is located in
%TEMP%/OpenModelica/OMEdit
.
You should be able to get there with Tools | Open Working directory
comment:11 by , 5 years ago
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.
by , 5 years ago
Attachment: | omeditcommunication.log added |
---|
by , 5 years ago
comment:12 by , 5 years ago
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 by , 5 years ago
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.
by , 5 years ago
Attachment: | script.mos added |
---|
comment:14 by , 5 years ago
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 by , 5 years ago
Owner: | changed from | to
---|---|
Status: | new → accepted |
comment:16 by , 5 years ago
@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 by , 5 years ago
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
Should be fixed by PR:
https://github.com/OpenModelica/OpenModelica/pull/520
comment:19 by , 5 years ago
Yes, I can confirm that removing the "-m" option solves the issue.
Thanks for going after this and applying the fix instantly.
@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?