Skip to content
Snippets Groups Projects
Commit 34024d0a authored by Michael DM Dryden's avatar Michael DM Dryden
Browse files

Fixed issue #12. Forgot about how processes work. Added button state changes...

Fixed issue #12. Forgot about how processes work. Added button state changes to exceptions and experiment_done method.
parent 05c8954f
Branches
Tags
No related merge requests found
...@@ -364,26 +364,32 @@ class main: ...@@ -364,26 +364,32 @@ class main:
else: else:
self.statusbar.push(self.error_context_id, "Experiment not yet implemented.") self.statusbar.push(self.error_context_id, "Experiment not yet implemented.")
self.startbutton.set_sensitive(True)
self.stopbutton.set_sensitive(False)
except ValueError: except ValueError:
self.spinner.stop() self.spinner.stop()
self.statusbar.push(self.error_context_id, "Experiment parameters must be integers.") 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: except InputError as e:
self.spinner.stop() self.spinner.stop()
self.statusbar.push(self.error_context_id, e.msg) self.statusbar.push(self.error_context_id, e.msg)
self.startbutton.set_sensitive(True)
self.stopbutton.set_sensitive(False)
except SerialException: except SerialException:
self.spinner.stop() self.spinner.stop()
self.statusbar.push(self.error_context_id, "Could not establish serial connection.") 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: except AssertionError as e:
self.spinner.stop() self.spinner.stop()
self.statusbar.push(self.error_context_id, str(e)) self.statusbar.push(self.error_context_id, str(e))
self.startbutton.set_sensitive(True)
finally: self.stopbutton.set_sensitive(False)
self.startbutton.set_sensitive(False)
self.stopbutton.set_sensitive(True)
def experiment_running(self): def experiment_running(self):
try: try:
...@@ -436,7 +442,9 @@ class main: ...@@ -436,7 +442,9 @@ class main:
self.spinner.stop() self.spinner.stop()
self.startbutton.set_sensitive(True)
self.stopbutton.set_sensitive(False)
def on_pot_stop_clicked(self, data=None): def on_pot_stop_clicked(self, data=None):
if self.recv_p: if self.recv_p:
print "stop" print "stop"
......
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