예제 #1
0
파일: tc.py 프로젝트: unnch/spell-sat
 def __init__(self):
     Interface.__init__(self, "TC")
     Configurable.__init__(self)
     self.__lastStatus = None
     self.__lastElement = None
     self.__useConfig = {}
     LOG("Created")
예제 #2
0
파일: devices.py 프로젝트: jpanikulam/visar
  def __init__(self):
    '''setup the serial device handler. Once this object is created, 
          you must call destroy() before exiting.
       Updates are typles in one of three formats:   
         ('BATTERY',  <battery level>)  # system battery level
         ('SHUTDOWN', None)             # system has recieved a shutdown command
         ('CONTROL', <control update>)  # button press
    '''

    Interface.__init__(self)

    self.kill_flag = False
    self.battery = 100 # current battery level
    self.controls = None # current control state
    self.do_shutdown = True # flag for shutting down unit on destroy()

    # try to open the serial ports and handler threads
    try:
      # serial port uses long reads to block and timeouts to wake back up
      self.pwr_port = serial.Serial(PWR_NAME, timeout=TIMEOUT, writeTimeout=TIMEOUT)
      self.pwr_port.baudrate = BAUD
      thread = threading.Thread(target=self.pwr_thread)
      thread.start()
    except: print 'Could not open power device' 
    
    try:
      # conn port uses a similar structure, timeouts determine how long to block for
      self.con_port = serial.Serial(CON_NAME, timeout=TIMEOUT, writeTimeout=TIMEOUT)
      self.con_port.baudrate = BAUD
      thread = threading.Thread(target=self.con_thread)
      thread.start()
    except: print 'Could not open controller device'
예제 #3
0
파일: tc.py 프로젝트: unnch/spell-sat
 def __init__(self):
     Interface.__init__(self, "TC")
     Configurable.__init__(self)
     self.__lastStatus = None
     self.__lastElement = None
     self.__useConfig = {}
     LOG("Created")
예제 #4
0
 def __init__(self, address, port):
     self.address = address
     self.port = port
     self.marshaller = Marshal()
     Interface.__init__(self)
     self._init_funcs()
     self.req_id = random.randint(1, sys.maxint)
예제 #5
0
 def __init__(self):
     Interface.__init__(self, "RSC")
     Configurable.__init__(self)
     LOG("Created")
     self.toCheck = [ 'TM', 'TC' ]
     self.rscStatus = {}
     self.rscCallbacks = []
예제 #6
0
 def __init__(self, cni, mac, host_ifname, tag):
     self.pid = os.getpid()
     self.container_mac = mac
     self.host_ifname = host_ifname
     self.vlan_tag = tag
     self.vlan_ifname = CniMacVlan._make_vlan_intf_name(tag)
     CniInterface.__init__(self, cni)
     return
예제 #7
0
 def __init__(self, cni, mac, host_ifname, tag):
     self.pid = os.getpid()
     self.container_mac = mac
     self.host_ifname = host_ifname
     self.vlan_tag = tag
     self.vlan_ifname = CniMacVlan._make_vlan_intf_name(tag)
     CniInterface.__init__(self, cni)
     return
예제 #8
0
 def __init__(self):
     Interface.__init__(self)
     Loader.__init__(self)
     Resizer.__init__(self)
     Processor.__init__(self)
     Colorizer.__init__(self)
     Displayer.__init__(self)
     
     getattr(self, self.args.command)()
예제 #9
0
 def __init__(self, host, port, cartes_visibles):
     self.host, self.port = host, port
     Interface.__init__(self, cartes_visibles)
     self.indice=0
     self.indice_bidder=0
     self.connexion= None
     self.chien=[]
     self.connect()
     self.bind('<KeyPress-s>',self.launch)
예제 #10
0
파일: tm.py 프로젝트: Spacecraft-Code/SPELL
 def __init__(self):
     Interface.__init__(self, "TM")
     Configurable.__init__(self)
     self.__tmParameters = {}
     self.__verifiers = []
     self.__verifTable = []
     self.__verifMutex = thread.allocate_lock()
     self.__ctxName = None
     LOG("Created")
예제 #11
0
파일: curses.py 프로젝트: netixx/NetProbes
 def __init__(self, probeIp):
     Interface.__init__(self, probeIp)
     #         Thread.__init__(self)
     #         self.setName("Cli")
     self.isRunning = True
     # wins and boxes
     self.status = None
     self.commandInput = None
     self.text = None
     self.probesPanel = None
예제 #12
0
파일: main.py 프로젝트: mwalawski/Burgers
 def __init__(self):
     Interface.__init__(self)
     self.root = tk.Tk()
     self.root.title(' Food Order')
     self.root.iconbitmap('images/favicon.ico')
     self.root.config(bg='#454c54')
     self.create_top_bar()
     self.create_menu_bar()
     self.create_order_bar()
     self.create_data_bar()
     self.root.mainloop()
예제 #13
0
 def __init__(self, robot_name, bus=BUS):
     Interface.__init__(self)
     IvyInit(robot_name, robot_name + " ready!")
     self.rid = robot_name
     self.bus = bus
     self.running = True
     IvyBindMsg(self.on_speed_cmd, SPEED_REG.format(self.rid))
     IvyBindMsg(self.on_pos_cmd, POS_REG.format(self.rid))
     IvyBindMsg(self.on_pos_orient_cmd, POS_ORIENT_REG.format(self.rid))
     IvyBindMsg(self.on_actuator_cmd, ACTUATOR_CMD)
     IvyBindMsg(self.on_kill_cmd, KILL_CMD.format(self.rid))
예제 #14
0
    def __init__(self):
        Interface.__init__(self)
        eh      = GameEventHandler()
        c       = GameController()
        out     = GameOutput(c)

        c.set_output(out)
        eh.set_controller(c)

        self._set_controller(c)
        self._set_eventhandler(eh)
        self._set_output(out)
예제 #15
0
    def __init__(self):
        """

        """
        Interface.__init__(self)
        eh = InfoEventHandler()
        c = InfoController()
        out = InfoOutput()

        c.set_output(out)
        eh.set_controller(c)

        self._set_controller(c)
        self._set_eventhandler(eh)
        self._set_output(out)
예제 #16
0
    def __init__(self):
        """

        """
        Interface.__init__(self)

        eh = StartMenuEventHandler()
        c = StartMenuController()
        out = StartMenuOutput()

        c.set_output(out)
        eh.set_controller(c)

        self._set_controller(c)
        self._set_eventhandler(eh)
        self._set_output(out)
예제 #17
0
파일: gui.py 프로젝트: nonsns/NetProbes
    def __init__(self, ip):
        Interface.__init__(self, ip)
        self.commandHistory = []
        self.mainWin = Tk()
        self.command = StringVar(self.mainWin)
        self.status = StringVar(self.mainWin, value="Waiting for command ...")
        self.text = StringVar(self.mainWin, value="Enter a command :")
        self.result = None
        self.probesDisplay = None
        self.mainWin.title("Commander for probe with ip : " + ip)
        self.isRunning = True
        self.mainWin.protocol("WM_DELETE_WINDOW", self.quit)

        # define the threads
        self.thProbe = Thread(target=self.updateProbes, name="Probe updater", daemon=True)
        self.thResults = Thread(target=self.updateResults, name="Results Updater", daemon=True)
예제 #18
0
파일: gui.py 프로젝트: netixx/NetProbes
    def __init__(self, ip):
        Interface.__init__(self, ip)
        self.commandHistory = []
        self.mainWin = Tk()
        self.command = StringVar(self.mainWin)
        self.status = StringVar(self.mainWin, value="Waiting for command ...")
        self.text = StringVar(self.mainWin, value="Enter a command :")
        self.result = None
        self.probesDisplay = None
        self.mainWin.title("Commander for probe with ip : " + ip)
        self.isRunning = True
        self.mainWin.protocol("WM_DELETE_WINDOW", self.quit)

        # define the threads
        self.thProbe = Thread(target=self.updateProbes,
                              name="Probe updater",
                              daemon=True)
        self.thResults = Thread(target=self.updateResults,
                                name="Results Updater",
                                daemon=True)
예제 #19
0
    def __init__(self):
        '''setup the serial device handler. Once this object is created, 
          you must call destroy() before exiting.
       Updates are typles in one of three formats:   
         ('BATTERY',  <battery level>)  # system battery level
         ('SHUTDOWN', None)             # system has recieved a shutdown command
         ('CONTROL', <control update>)  # button press
    '''

        Interface.__init__(self)

        self.kill_flag = False
        self.battery = 100  # current battery level
        self.controls = None  # current control state
        self.do_shutdown = True  # flag for shutting down unit on destroy()

        # try to open the serial ports and handler threads
        try:
            # serial port uses long reads to block and timeouts to wake back up
            self.pwr_port = serial.Serial(PWR_NAME,
                                          timeout=TIMEOUT,
                                          writeTimeout=TIMEOUT)
            self.pwr_port.baudrate = BAUD
            thread = threading.Thread(target=self.pwr_thread)
            thread.start()
        except:
            print 'Could not open power device'

        try:
            # conn port uses a similar structure, timeouts determine how long to block for
            self.con_port = serial.Serial(CON_NAME,
                                          timeout=TIMEOUT,
                                          writeTimeout=TIMEOUT)
            self.con_port.baudrate = BAUD
            thread = threading.Thread(target=self.con_thread)
            thread.start()
        except:
            print 'Could not open controller device'
예제 #20
0
 def __init__(self, cni, mac):
     self.host_ifname = CniVEthPair._build_tapname(cni.container_uuid)
     self.container_mac = mac
     self.pid = os.getpid()
     CniInterface.__init__(self, cni)
     return
예제 #21
0
파일: struct.py 프로젝트: chenm001/leap
 def __init__(self, type, name, members):
     Interface.__init__(self, type, name, members)
예제 #22
0
 def __init__(self, object_path):
     Interface.__init__(self, object_path)
     self.dev_iface = dbus.Interface(self.object, DEVICE_IFACE)
예제 #23
0
파일: cli.py 프로젝트: netixx/NetProbes
 def __init__(self, probeIp):
     Interface.__init__(self, probeIp)
     self.prompt = self.PROMPT % (self.targetId, self.targetIp)
     self.isRunning = True
     self.status = None
     self.commandInput = None
예제 #24
0
 def __init__(self):
     Interface.__init__(self, "CONFIG")
     LOG("Created")
예제 #25
0
 def __init__(self):
     Interface.__init__(self, "USR")
     Configurable.__init__(self)
     LOG("Created")
예제 #26
0
 def __init__(self):
     Interface.__init__(self, "RNG")
     Configurable.__init__(self)
     self.__ctxName = None
     LOG("Created")
예제 #27
0
 def __init__(self):
     Interface.__init__(self, "MEM")
     Configurable.__init__(self)
     self.__ctxName = None
     LOG("Created")
예제 #28
0
 def __init__(self):
     Interface.__init__(self, "CONFIG")
     LOG("Created")
예제 #29
0
 def __init__(self, probeIp, command):
     Interface.__init__(self, probeIp)
     self.args = self.parseCommand(command)
     self.out = ""
예제 #30
0
 def __init__(self, cni, mac):
     self.host_ifname = CniVEthPair._build_tapname(cni.container_uuid)
     self.container_mac = mac
     self.pid = os.getpid()
     CniInterface.__init__(self, cni)
     return
 def __init__(self):
     Interface.__init__(self, "USR")
     Configurable.__init__(self)
     LOG("Created")
예제 #32
0
 def __init__(self, object_path):
     Interface.__init__(self, object_path)
     self.dev_iface = dbus.Interface(self.object, DEVICE_IFACE)
예제 #33
0
파일: wireless.py 프로젝트: alexjaw/rnm
 def __init__(self):
     Interface.__init__(self,
                        iface='wlan0')  # in python3 only super.__init__()
     self._hotspots = []
예제 #34
0
 def __init__(self, type, name, members):
     Interface.__init__(self, type, name, members)
예제 #35
0
	def __init__(self,parent=None,name=None,f1=0):
		Interface.__init__(self,parent,name,f1)
		
		self.setInitValues()#set initial values for a session of storyboarding
				
		self.cursor=QCursor(3)#set cursor to the 'HourGlass' symbol
		
		self.shtLen.insert("0")
				
		#when a paint event occurs on the drawing area - 'drawingPaintEvent' repaint it
		self.fmDraw.__class__.paintEvent=self.drawingPaintEvent
				
		self.xoff=self.fmToolBox.width() #Offset of X-axis
		self.yoff=self.MenuBar.height()+self.Toolbar.height() #Offset of Y-axis
		
		
		#create a pixmap on the drawing area
		self.rec=QRect(0,self.fmDraw.y(),self.fmDraw.width(),self.fmDraw.height())
		self.pix=QPixmap(self.rec.size())
		self.pix.fill(self.fmDraw,self.rec.topLeft())
	
		
		#showing all signals connected to the appropriate slots	
				
		#****************************FILE Menu****************************#
		self.connect(self.fileNew,SIGNAL('activated()'),self.newStoryboard)
		self.connect(self.filOpen,SIGNAL('activated()'),self.fileOpen)
		self.connect(self.filSave,SIGNAL('activated()'),self.fileSave)
		self.connect(self.fileSavAs,SIGNAL('activated()'),self.fileSaveAs)	
		self.connect(self.filePrintAction,SIGNAL('activated()'),self.printing)
		self.connect(self.fileExit,SIGNAL('activated()'),self.exitStoryboard)
		#*************************************************************#
		
		
		#****************************VIEW Menu****************************#
		self.connect(self.undo,SIGNAL('activated()'),self.undoDeleteFrame)
		self.connect(self.copy,SIGNAL('activated()'),self.copyFrame)
		self.connect(self.paste,SIGNAL('activated()'),self.pasteFrame)
		self.connect(self.newFrm,SIGNAL('activated()'),self.newFrame)
		self.connect(self.deleteFrame,SIGNAL('activated()'),self.delFrame) 
		self.connect(self.clrScreen,SIGNAL('activated()'),self.clearFrame)
		#*************************************************************#
		
		#****************************HELP Menu****************************#
		self.connect(self.hlpAbtBE,SIGNAL('activated()'),self.helpAbout)
		self.connect(self.hlpAbtQt,SIGNAL('activated()'),self.helpAboutQt)
		#*************************************************************#	
		
		
		#***************************BUTTONS***************************#
		self.connect(self.fstButton,SIGNAL('clicked()'),self.fstFrame)
		self.connect(self.lstButton,SIGNAL('clicked()'),self.lstFrame)
		self.connect(self.preButton,SIGNAL('clicked()'),self.previousFrame)
		self.connect(self.nxtButton,SIGNAL('clicked()'),self.nextFrame)	
		self.connect(self.pbPlay,SIGNAL('clicked()'),self.playStoryboard)
		self.connect(self.pbPause,SIGNAL('clicked()'),self.pauseStoryboard)
		#*************************************************************#	
		
		
		#****************************TOOLS****************************#
		self.connect(self.eraser,SIGNAL('clicked()'),self.setEraser)
		self.connect(self.pen,SIGNAL('clicked()'),self.restorePen)
		self.connect(self.chooseColor,SIGNAL('clicked()'),self.showColor)
		#*************************************************************#	
		
		#***************************PENSIZE***************************#	
		self.connect(self.sizeOne,SIGNAL('clicked()'),self.setOne)
		self.connect(self.sizeTwo,SIGNAL('clicked()'),self.setTwo)
		self.connect(self.sizeThree,SIGNAL('clicked()'),self.setThree)
		self.connect(self.sizeFour,SIGNAL('clicked()'),self.setFour)
		self.connect(self.sizeFive,SIGNAL('clicked()'),self.setFive)
		#*************************************************************#	
		
		
		#*************************ERASERSIZE**************************#	
		self.connect(self.erase1,SIGNAL('clicked()'),self.eraseOne)
		self.connect(self.erase2,SIGNAL('clicked()'),self.eraseTwo)
		self.connect(self.erase3,SIGNAL('clicked()'),self.eraseThree)
		self.connect(self.erase4,SIGNAL('clicked()'),self.eraseFour)
		self.connect(self.erase5,SIGNAL('clicked()'),self.eraseFive)