def _onSensor(self, event): log.verbose("Sensor event received") for cb in self.callback['sensor']: cb(event) try: for cb in self.sensor[event.index].callback['value']: cb(event) except KeyError: pass
def _onInput(self, event): log.verbose("Input event received") for cb in self.callback['input']: cb(event) try: for cb in self.input[event.index].callback['value']: cb(event) except KeyError: pass
def _genericCB(self, event, type): log.verbose("{} event received".format(type)) for cb in self.callback[type]: cb(event) for dev in self.input.itervalues(): for cb in dev.callback[type]: cb(event) for dev in self.output.itervalues(): for cb in dev.callback[type]: cb(event) for dev in self.sensor.itervalues(): for cb in dev.callback[type]: cb(event)
def _onError(self, event): log.debug(event.description) log.verbose("{} event received".format(type)) for cb in self.callback['error']: cb(event)
def close(self): log.verbose("Closing InterfaceKit") self.ik.closePhidget() log.debug("Interfac kit closed")
def start(self): log.verbose("Opening remote IP") self.ik.openRemoteIP(self.IP, self.port, self.devserial) log.debug("Remote IP opened")