SimApi Control pause

From SIMboxWiki
Jump to navigation Jump to search



Icon attributes.pngstatic bool SimApi::Control::pause()

    Description

    Pauses the simulation.

    Return

    Type: bool   Description: True, if succeeded; otherwise, false;

    Remarks
    

The simulation pause/resume mechanism has a counter. Each call for pause increases the counter and a call for resume decreases the counter. The simulation will resume working only when there were the same of number of resume and pause calls (the pause counter value is 0).


    Code Sample
    

            
//This function pauses the simulation and opens a dialog window and resumes the simulation           
void MyExtension::ShowMyDialog()
{
	SimApi::Control::pause();
        MyDialog dlg;
        dlg.DoModal();
        SimApi::Control::resume();

}


    See Also

     resume

    Related Links

     Simulation Time Overview