Exemplo n.º 1
0
 def initSerial(self):
     """ Initialisation de la communication série
     """
     print "initSerial", globdef.COM_PORT, globdef.BAUDRATE
     
     if hasattr(self, 'datagen'):
         self.datagen.Terminer()
         
     if globdef.SOURCE == "Arduino":
         self.datagen = DataGen(baudrate = globdef.BAUDRATE, port = globdef.COM_PORT)
     else:
         self.datagen = AudioData()
     
     
     
     if not hasattr(self.datagen, 'ser') or not self.datagen.ser:
         self.connexionOK = False
         self.statusbar.SetStatusText(u"Echec de connexion !", 2)
     else:
         self.connexionOK = True
         self.statusbar.SetStatusText(u"Connecté sur "+globdef.COM_PORT, 2)
     #  
     # Remise à 0 des données et des tracés
     #
     self.initData()
     for p in range(16):
         self.plot_data[p].set_xdata([0.])
         self.plot_data[p].set_ydata([0.])
     
     self.temps = []
Exemplo n.º 2
0
 def __init__(self):
     wx.Frame.__init__(self, None, -1, self.title)
     
     self.datagen = DataGen()
     self.data = [self.datagen.next()]
     self.paused = False
     
     self.create_menu()
     self.create_status_bar()
     self.create_main_panel()
     
     self.redraw_timer = wx.Timer(self)
     self.Bind(wx.EVT_TIMER, self.on_redraw_timer, self.redraw_timer)        
     self.redraw_timer.Start(REFRESH_INTERVAL_MS)