Updated simple window

* Fix problem of thread-safe
   Added condition into other functions if simulation runs
* Changed simple boolean to Event object
* Changed called of endSimulation, now with event on Event object