def _hal_init(self): _HalWidgetBase._hal_init(self) self.hal_pin = self.hal.newpin(self.hal_name, hal.HAL_FLOAT, hal.HAL_IN) self.hal_pin.connect('value-changed', lambda p: self.set_value(p.value)) self.hal_pin.connect('value-changed', lambda s: self.emit('hal-pin-changed', s))
def _hal_init(self): if (self.has_hal_pins): _HalWidgetBase._hal_init(self) self.set_active(False) if (self.button_halio_pin): self.button_pin = self.hal.newpin(self.hal_name+'-button', hal.HAL_BIT, hal.HAL_IO) self.button_pin.connect('value-changed', self.button_pin_update) else: self.button_pin = self.hal.newpin(self.hal_name+'-button', hal.HAL_BIT, hal.HAL_OUT) self.button_pin_not = self.hal.newpin(self.hal_name+'-button-not', hal.HAL_BIT, hal.HAL_OUT) if (self.create_enable_pin): self.enable_pin = self.hal.newpin(self.hal_name+'-enable', hal.HAL_BIT, hal.HAL_IN) self.enable_pin.connect('value-changed', self.enable_pin_update) self.light_pin = self.hal.newpin(self.hal_name+'-light', hal.HAL_BIT, hal.HAL_IN) self.light_pin.connect('value-changed', self.light_pin_update)
def _hal_init(self): _HalWidgetBase._hal_init(self) self.hal_pin = self.hal.newpin(self.hal_name, hal.HAL_FLOAT, hal.HAL_IN)
def _hal_init(self): _HalWidgetBase._hal_init(self) self.hal_pin = self.hal.newpin(self.hal_name, hal.HAL_FLOAT, hal.HAL_IN) self.hal_pin.connect("value-changed", lambda p: self.set_value(p.value)) self.hal_pin.connect("value-changed", lambda s: self.emit("hal-pin-changed", s))