diff --git a/dstatInterface/interface_test.py b/dstatInterface/interface_test.py index 4dd0ab9eec5d19c23e8b9eb4fcbbc90a1e23646c..e2cf81f23810f06159d4d3def5bd176b83b5494f 100644 --- a/dstatInterface/interface_test.py +++ b/dstatInterface/interface_test.py @@ -364,26 +364,32 @@ class main: else: self.statusbar.push(self.error_context_id, "Experiment not yet implemented.") + self.startbutton.set_sensitive(True) + self.stopbutton.set_sensitive(False) except ValueError: self.spinner.stop() self.statusbar.push(self.error_context_id, "Experiment parameters must be integers.") + self.startbutton.set_sensitive(True) + self.stopbutton.set_sensitive(False) except InputError as e: self.spinner.stop() self.statusbar.push(self.error_context_id, e.msg) + self.startbutton.set_sensitive(True) + self.stopbutton.set_sensitive(False) except SerialException: self.spinner.stop() self.statusbar.push(self.error_context_id, "Could not establish serial connection.") + self.startbutton.set_sensitive(True) + self.stopbutton.set_sensitive(False) except AssertionError as e: self.spinner.stop() self.statusbar.push(self.error_context_id, str(e)) - - finally: - self.startbutton.set_sensitive(False) - self.stopbutton.set_sensitive(True) + self.startbutton.set_sensitive(True) + self.stopbutton.set_sensitive(False) def experiment_running(self): try: @@ -436,7 +442,9 @@ class main: self.spinner.stop() - + self.startbutton.set_sensitive(True) + self.stopbutton.set_sensitive(False) + def on_pot_stop_clicked(self, data=None): if self.recv_p: print "stop"