Commit c93640df authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Complete reset simulation buttton

parent 65e35694
...@@ -10,6 +10,7 @@ __url__ = "http://taste.tuxfamily.org" ...@@ -10,6 +10,7 @@ __url__ = "http://taste.tuxfamily.org"
# maxime.perrotin@esa.int # maxime.perrotin@esa.int
import os import os
import traceback
import signal import signal
import sys import sys
import platform import platform
...@@ -326,8 +327,9 @@ def gui(): ...@@ -326,8 +327,9 @@ def gui():
sdl.msc_macro_start.connect(msc.start_undo_macro) sdl.msc_macro_start.connect(msc.start_undo_macro)
sdl.msc_macro_stop.connect(msc.stop_undo_macro) sdl.msc_macro_stop.connect(msc.stop_undo_macro)
sdl.allowed_messages.connect(myWidget.allowed_editors) sdl.allowed_messages.connect(myWidget.allowed_editors)
except IOError: except IOError as err:
log.info('SDL viewer not available') log.info('SDL viewer not available - ' + str(err))
log.info(traceback.format_exc())
sdl = None sdl = None
else: else:
sdlButton = toolbar.addAction('SDL') sdlButton = toolbar.addAction('SDL')
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Resource object code # Resource object code
# #
# Created: Thu Jan 22 14:09:27 2015 # Created: Wed Feb 18 11:29:38 2015
# by: The Resource Compiler for PySide (Qt v4.8.6) # by: The Resource Compiler for PySide (Qt v4.8.6)
# #
# WARNING! All changes made in this file will be lost! # WARNING! All changes made in this file will be lost!
......
...@@ -199,9 +199,10 @@ class sdlHandler(QObject): ...@@ -199,9 +199,10 @@ class sdlHandler(QObject):
return False return False
def reset_simulation(self): def reset_simulation(self):
''' Jump to the first step of simulation ''' ''' Jump back to the first step of simulation '''
self.restore_global_state(self.init_state) while self.undo_stack.canUndo():
# TODO: clean log, clean MSC, rewind undo stack self.undo()
self.log_area.clear()
def undo(self): def undo(self):
''' Called when the undo button is pressed ''' ''' Called when the undo button is pressed '''
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment