Open serial port after calling openmv.init

* Handle the case where init changes the configuration
This commit is contained in:
iabdalkader 2014-11-03 17:00:28 +02:00
parent a9a59070ff
commit 874e4b99bb

View File

@ -192,14 +192,6 @@ class OMVGtk:
sleep(wait)
def connect(self):
try:
# open VCP and configure the terminal
self.serial = serial.Serial(self.config.get("main", "serial_port"), 115200, timeout=0.001)
gobject.gobject.idle_add(omvgtk.update_terminal)
except Exception as e:
self.show_message_dialog(gtk.MESSAGE_ERROR, "Failed to connect to OpenMV\n%s"%e)
return
try:
# init openmv
openmv.init()
@ -211,6 +203,14 @@ class OMVGtk:
self.show_message_dialog(gtk.MESSAGE_ERROR, "Failed to connect to OpenMV\n%s"%e)
return
try:
# open VCP and configure the terminal
self.serial = serial.Serial(self.config.get("main", "serial_port"), 115200, timeout=0.001)
gobject.gobject.idle_add(omvgtk.update_terminal)
except Exception as e:
self.show_message_dialog(gtk.MESSAGE_ERROR, "Failed to connect to OpenMV\n%s"%e)
return
self.connected = True
self._update_title()
self.connect_button.set_sensitive(False)