Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#5723 closed enhancement (fixed)

[OMEdit] Do not allow the simulation window to be closed if the simulation is still running

Reported by: adrpo Owned by: adeas31
Priority: normal Milestone: 1.16.0
Component: OMEdit Version:
Keywords: Cc:

Description (last modified by adrpo)

For simulations is would be good not to be able to close the simulation window (btw, how do you get it back if you closed it?).

Especially for simulations that give some asserts at initialization but then continue is hard for the user to tell if the simulation failed or is actually continuing. The user closes the window, does some model modification and then recompiles one would get a "permision denied" when the gcc linker ld tries to write the executable again. OMEdit knows that the exe is still running, it should not let the user recompile the model.

Change History (9)

comment:1 Changed 4 years ago by adrpo

  • Description modified (diff)

comment:2 Changed 4 years ago by adeas31

  • Description modified (diff)
  • Milestone changed from Future to 1.16.0
  • Status changed from new to accepted

comment:3 Changed 4 years ago by adrpo

  • Description modified (diff)
  • Milestone changed from 1.16.0 to Future
  • Priority changed from high to normal
  • Type changed from defect to enhancement

comment:4 Changed 4 years ago by adrpo

  • Milestone changed from Future to 1.16.0

comment:5 Changed 4 years ago by casella

I understand you mean that you should only be allowed to cancel the simulation with the button (which sends a terminate signal to the executable), but not by closing the window with the window close button, right?

Can't we just interpret also that action as "close the window and terminate the simulation"?

comment:6 Changed 4 years ago by adeas31

Both solutions are possible. We can disable (not sure if the top right cross button can be disabled but for sure we can drop the event) closing the window if simulation is running OR cancel the simulation if users closes the window.

For simulations is would be good not to be able to close the simulation window (btw, how do you get it back if you closed it?).

They are placed in Simulation Setup->Archived Simulations.

comment:7 Changed 4 years ago by adeas31

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

Done in 5727cb1/OpenModelica.

The user can't close the simulation output window while the model is compiling or simulating.

comment:8 Changed 4 years ago by casella

Just a comment. I am fine with this feature in principle. However, there are cases where the simulation gets stuck (i.e. because of chattering, or simply because it just takes forever to reach stopTime for any reason and you want to stop it). In these cases, we need a way to eventually stop the simulation and get rid of this window witout the need to kill the OMEdit process or to reboot the computer.

This is a MWE of such a situation

model Chattering
  Real x(start = 1, fixed = true);
equation
  der(x) = noEvent(if x > 0 then -1 else 1);
annotation(experiment(StopTime = 2));
end Chattering;

I just tried it with the latest nightly, and indeed I can stop the simulation by clicking on the Cancel Simulation button. I get this error message

Process crashed
Simulation process failed. Exited with code 62097.

which is not particularly nice, I would have preferred something more polite like

Simulation process terminated by the user at time = 0.5

but this is another story, I'll open a ticket about that.

The question is: are we reasonably sure that the Cancel Simulation button sends a powerful enough termination signal to the simulation executable, so that it basically always works?

comment:9 Changed 4 years ago by adeas31

See #5926 for more further details.

Note: See TracTickets for help on using tickets.