Opened 10 years ago

Closed 10 years ago

Last modified 7 years ago

#2872 closed enhancement (fixed)

OMEdit - better omeditcommands.log

Reported by: Adrian Pop Owned by: Adeel Asghar
Priority: high Milestone: 1.9.4
Component: OMEdit Version: trunk
Keywords: Cc:

Description

I would be really cool to be able to run omeditcommands.log by just renaming
it to .mos. Currently is not possible because you have a lot of text around
the commands you sent to omc and the answer from OMC.

getNthConnection(Modelica.Fluid.Examples.Tanks.ThreeTanks, 5) 15:58:36:932
{pipe2.port_b,tank2.ports[1], ""} 15:58:36:932
Elapsed Time :: 0 secs

getClassRestriction(Modelica.Fluid.Pipes.StaticPipe) 15:58:36:933
"model" 15:58:36:933
Elapsed Time :: 0 secs

existClass(Modelica.Fluid.Pipes.StaticPipe) 15:58:36:933
true 15:58:36:934
Elapsed Time :: 0.001 secs

getClassRestriction(Modelica.Fluid.Vessels.OpenTank) 15:58:36:934
"model" 15:58:36:934
Elapsed Time :: 0 secs

I suggest outputting the command you send to omc followed by "; // " then the time. Also the answer you get from OMC should be in comments:

/*
OMC answered: ....
*/

This way you can run an omeditcomands.log with OMC and debug way easier.
Alternatively you could generate an extra file with just the commands you
sent to omc followed by ";" named omeditcommands.mos

Change History (11)

comment:1 by Adrian Pop, 10 years ago

Currently I need to copy the commands by hand in another file or remove the extra text and that's just crazy time consuming :)

comment:2 by Adeel Asghar, 10 years ago

A new file omeditcommands.mos will be created from r22655.

comment:3 by Adeel Asghar, 10 years ago

Do you want me to add getErrorString(); after every command?

comment:4 by Adrian Pop, 10 years ago

Yes please, but on the same line:

commandToOMC; getErrorString();

That would be perfect.

comment:5 by Adeel Asghar, 10 years ago

Resolution: fixed
Status: newclosed

Done in r22658.

Btw the omeditcommands.log file name is changed to omeditcommunication.log.

comment:6 by Adrian Pop, 10 years ago

Thanks!

comment:7 by Adrian Pop, 10 years ago

Just one minor issue, when you're creating a class you do:

existClass(FluidProblems); getErrorString();
model FluidProblems end FluidProblems;; getErrorString();

Note that you have two semicolons ;; one after the
other which makes the omeditcommands.mos script invalid.
Maybe you should check if there is already a ; don't
add another one.

comment:8 by Adrian Pop, 10 years ago

Actually when you're sending strings to OMC in the script you need to use loadString
as model F end F; directly in the script does not work. So it should be:

existClass(FluidProblems); getErrorString();
loadString("model FluidProblems end FluidProblems;"); getErrorString();

in the omeditcommands.mos script to make it usable.

comment:9 by Adeel Asghar, 10 years ago

Done in r23175.

comment:10 by Dietmar Winkler, 9 years ago

Milestone: Futurepre1.9.4

It doesn't make sense to keep closed ticket in the "Future" milestone that were simply forgotten to assign to the correct milestone in the past.

comment:11 by Martin Sjölund, 7 years ago

Milestone: pre1.9.41.9.4

Removing the pre1.9.4 milestone in favor of 1.9.4.

Note: See TracTickets for help on using tickets.