asiQuitSimulator
asiQuitSimulator(o_session[?modeg_mode] ) =>g_status/nil
This function quits the simulator run process based on the ipc signal being sent to the specified process. By default, the direct integration code sends a hard-kill signal to the simulator process. To change this option and send a soft-kill signal, the ?mode option should be set to true and overloaded for yourSimulator session. This method is called by the environment, therefore, you should not call it directly from the interface. This method can be re-defined for the interface. Use, callNextMethod in its definition.
The function asiQuitSimulator is called internally via asiInterruptSim. To send a hard or soft interrupt signal, asiInterruptSim should be overloaded for your simulator class. This is illustrated in the example. In case you are not concerned with the hard kill scenario, it is recommended that you do not overload asiInterruptSim or asiQuitSimulator methods and use the default behavior.
Arguments
Value Returned
Examples
The following examples show how to overload the asiInterruptSim function and use asiQuitSimulator to quit the simulator run process based on the ipc signal:
-
Hard-kill signal (default, for
asiAnalog_session)
In this case, you are not concerned with theipchard kill signal being sent to your simulator’s session. There is no need to overload asiQuitSimulator. Instead, use the callNextMethod(), which will serve your purpose:defmethod( asiInterruptSim ((session yourSimulator_session)) println( "yourSimulator: session hard killed .\n" ) println( "yourSimulator: simulation is stopped by user.\n" ) println( "yourSimulator: simulation results may not be complete.\n" ) asiSetWasInterrupted( session t ) asiQuitSimulator( session)
)
When you need to have a soft-kill signal sent to your simulator’s session, you need to overload asiQuitSimulator method with ?mode set tot, as follows:defmethod( asiInterruptSim ((session yourSimulator_session)) <insert code you need> println( "yourSimulator: session soft killed .\n" ) println( "yourSimulator: simulation is stopped by user.\n" ) println( "yourSimulator: simulation results may not be complete.\n" ) asiSetWasInterrupted( session t ) asiQuitSimulator( session ?mode t ) <insert code you need>
Return to top