コード例 #1
0
ファイル: hc2_demo.py プロジェクト: kstaniek/has
 def run(self):
     self.running = 1
     Manager.add_watcher( OnNotification, self)
     Manager.read_config("manager.ini")
     
     #self.thread1 = threading.Thread(target=self.worker_thread)
     #self.thread1.start()
     self.queue_check()
コード例 #2
0
ファイル: event_logger.py プロジェクト: kstaniek/has
            node_location_name = Manager.get_node_location_name( network_id, node_id )
            print("%s" % str(datetime.now()), end="" )
            print(" Node %03s: %s in %s changed %s to %s" % ( node_id, node_name, node_location_name, value_type, value ))
            
        elif notification_type == Notification.Type_NodeQueriesComplete:
            pass
            print("Manager: NodeQueriesComplete %s" % (notification.node_id ))
            


        
if __name__ == "__main__":
    
    initCondition.acquire()
    
    Manager.add_watcher( OnNotification, None)
    Manager.read_config("manager.ini")
    
    print("Condition wait")
    initCondition.wait(60)
    print("Condition relese")
    print("Pending drivers %s:" % Manager.pending_drivers)
    print("Ready drivers %s:" % Manager.ready_drivers)
    initCondition.release()
    if not initFailed:
    
        print("------------------------------------------------------------")
        for node in nodes:
            is_light = Manager.is_node_light(node.network_id, node.node_id)
            is_dead = Manager.is_node_dead(node.network_id, node.node_id)
            node_type = Manager.get_node_type(node.network_id, node.node_id)