Ejemplo n.º 1
0
 def __init__(self, com):
     Thread.__init__(self)
     self.msg = Frame()
     self.com = com
     self.count = 0
     Websock.send_deco(Listen.deco)
     Websock.send_pos_unk(Listen.unk)
     Websock.send_get_deco(False)
Ejemplo n.º 2
0
 def update_DB(self):
     if self.pixels.get('default'):  #Remove the fake pixel
         self.pixels.pop('default')
     #Updates the server dictionnaries
     Websock.send_pixels(self.pixels)
     Websock.send_pos_unk({})
     Websock.send_deco(self.deco)
     Websock.send_get_deco()
     #Update DB
     if (
             self.params['mode'] == 'ama' or self.params['mode'] == 'skip'
     ):  # in case of initial addressing, the previous configuration is first deleted.
         SchedulerState.drop_dic()
         print_flush("Database cleaned")
     while (len(self.pixels) !=
            0):  #Pixels are then added one by one to the database
         (mac, ((x, y), ind)) = self.pixels.popitem()
         SchedulerState.add_cell(x, y, mac, ind)
     print_flush("Database updated")