Пример #1
0
 def changing_master(self, master_id):
     with watchdogs.WatchdogTimer(1):
         if self.__last_master_id != master_id:
             self.__last_master_id = master_id
             return True
         else:
             return False
Пример #2
0
 def pop_floor_panel_queue(self):
     with watchdogs.WatchdogTimer(1):
         with self.__floor_panel_queue_key:
             if self.__floor_panel_queue:
                 return self.__floor_panel_queue.pop(0)
             else:
                 return (None, None)
Пример #3
0
 def clear_floor_panel(self, orders_up, orders_down):
     with watchdogs.WatchdogTimer(1):
         with self.__floor_panel_key:
             for i in range(0, N_FLOORS):
                 if (orders_up[i] != 0):
                     self.__floor_panel_up[i] = 0
                 if (orders_down[i] != 0):
                     self.__floor_panel_down[i] = 0
Пример #4
0
 def __start(self):
     try:
         with watchdogs.WatchdogTimer(10):
             self.__startup()
             self.__load_elevator_queue()
             self.__thread_run_elevator.daemon = True
             self.__thread_run_elevator.start()
             self.__thread_build_queues.daemon = True
             self.__thread_build_queues.start()
             self.__thread_set_indicators.daemon = True
             self.__thread_set_indicators.start()
     except watchdogs.WatchdogTimer:
         print "watchdog error"
         print "SlaveDriver.__start"
         interrupt_main()
     except StandardError as error:
         print error
         print "SlaveDriver.__start"
         interrupt_main()
Пример #5
0
 def read_position(self):
     with watchdogs.WatchdogTimer(1):
         return self.__position
Пример #6
0
 def queue_elevator_run(self, floor, button):
     with watchdogs.WatchdogTimer(1):
         with self.__elevator_queue_key:
             self.__elevator_queue[floor][button] = 1
Пример #7
0
	def read_saved_master_queue(self):
		with watchdogs.WatchdogTimer(1):
			time.sleep(0.01)
			with self.__master_queue_key:
				return self.__saved_master_queue
Пример #8
0
	def master_queue_elevator_run(self,master_queue):
		with watchdogs.WatchdogTimer(1):
			time.sleep(0.01)
			with self.__master_queue_key:
				self.__master_queue = master_queue[:]
Пример #9
0
 def get_floor_panel(self):
     with watchdogs.WatchdogTimer(1):
         with self.__floor_panel_key:
             return (self.__floor_panel_up[:], self.__floor_panel_down[:])
Пример #10
0
 def read_saved_master_queue(self):
     with watchdogs.WatchdogTimer(1):
         time.sleep(TICK)  #What is this?
         with self.__master_queue_key:
             return self.__saved_master_queue
Пример #11
0
 def master_queue_elevator_run(self, master_queue):
     with watchdogs.WatchdogTimer(1):
         time.sleep(TICK)  #What is this?
         with self.__master_queue_key:
             self.__master_queue = master_queue[:]