コード例 #1
0
	def __init__(self, irrDevice):
		self._irrDevice = None
		self._noPreviewTexture = None
		self._threads = None
		self._threadCommands = None
		self._loadedTextures = None
		
		# TextureLoadedDelegate(SceneNode node, Texture texture, Dimension2Di sourceDimension)
		self.OnTextureLoaded, self._FireTextureLoaded= pyevent.make_event()
		
		self._irrDevice = irrDevice
		self._threadCommands = Queue[ThreadCommand]()
		self._loadedTextures = List[str]()
		# generate "no preview" texture
		h = 256
		i = irrDevice.DriverNoCheck.CreateImage(ColorFormat.A8R8G8B8, Dimension2Di(h))
		i.Fill(Color(0x112233))
		for a in xrange(0,h,1):
			i.SetPixel(a, 0, Color(0x557799))
			i.SetPixel(a, h - 1, Color(0x557799))
			i.SetPixel(0, a, Color(0x557799))
			i.SetPixel(h - 1, a, Color(0x557799))
			if a > 16 and a < h - 16:
				i.SetPixel(a, a, Color(0x557799))
				i.SetPixel(h - a - 1, a, Color(0x557799))
		irrDevice.Lock()
		self._noPreviewTexture = irrDevice.Driver.AddTexture("NoPreviewTexture", i)
		irrDevice.Unlock()
		i.Drop()
コード例 #2
0
    def __init__(self, ser):
        """ser should be an open SerialPort"""
        ser.ReadTimeout = 100
        self.ser = ser

        self.ser.DataReceived += self.got_data_oem

        self.on_response, self._response_caller = pyevent.make_event()
        #self.on_response += self.print_response

        #for send_safe
        self.retries = 5

        #queue to store incoming data
        self.incoming = ""
コード例 #3
0
 def __init__(self):
     self.PropertyChanged, self._propertyChangedCaller = pyevent.make_event()
コード例 #4
0
 def __init__(self):
     self.PropertyChanged, self._propertyChangedCaller = pyevent.make_event()