How to use the qtpyvcp.hal.COMPONENTS function in qtpyvcp

To help you get started, we’ve selected a few qtpyvcp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kcjengr / qtpyvcp / qtpyvcp / widgets / hal_widgets / hal_lcd.py View on Github external
def initialize(self):
        comp = hal.COMPONENTS['qtpyvcp']
        obj_name = str(self.objectName()).replace('_', '-')

        # add lcd-dro.in HAL pin
        self._in_pin = comp.addPin(obj_name + ".in-f", "float", "in")
        self.setValue(self._in_pin.value)
        self._in_pin.valueChanged.connect(self.setValue)

        # add lcd-dro.in HAL pin
        self._in_pin = comp.addPin(obj_name + ".in-i", "s32", "in")
        self.setValue(self._in_pin.value)
        self._in_pin.valueChanged.connect(self.setValue)
github kcjengr / qtpyvcp / qtpyvcp / widgets / hal_widgets / hal_groupbox.py View on Github external
def initialize(self):
        comp = hal.COMPONENTS['qtpyvcp']
        obj_name = str(self.objectName()).replace('_', '-')

        # add group-box.enable HAL pin
        self._enable_pin = comp.addPin(obj_name + ".enable", "bit", "in")
        self._enable_pin.value = self.isEnabled()
        self._enable_pin.valueChanged.connect(self.setEnabled)

        # add group-box.visible HAL pin
        self._visible_pin = comp.addPin(obj_name + ".visible", "bit", "in")
        self._visible_pin.value = self.isVisible()
        self._visible_pin.valueChanged.connect(self.setVisible)

        if self.isCheckable():
            # add group-box.check HAL pin
            self._check_pin = comp.addPin(obj_name + ".check", "bit", "in")
            self._check_pin.value = self.isChecked()
github kcjengr / qtpyvcp / qtpyvcp / widgets / hal_widgets / hal_s32_dro.py View on Github external
def initialize(self):
        comp = hal.COMPONENTS['qtpyvcp']
        obj_name = str(self.objectName()).replace('_', '-')

        # add s32-dro.enable HAL pin
        self._enable_pin = comp.addPin(obj_name + ".enable", "bit", "in")
        self._enable_pin.value = self.isEnabled()
        self._enable_pin.valueChanged.connect(self.setEnabled)

        # add s32-dro.in HAL pin
        self._in_pin = comp.addPin(obj_name + ".in", "s32", "in")
        self.setValue(self._in_pin.value)
        self._in_pin.valueChanged.connect(self.setValue)
github kcjengr / qtpyvcp / qtpyvcp / widgets / hal_widgets / hal_led.py View on Github external
def initialize(self):
        comp = hal.COMPONENTS['qtpyvcp']
        obj_name = str(self.objectName()).replace('_', '-')

        # add led.on HAL pin
        self._on_pin = comp.addPin(obj_name + ".on", "bit", "in")
        # self._on_pin.value = self.isO()
        self._on_pin.valueChanged.connect(lambda state: self.setState(state))

        # add led.flash HAL pin
        self._flash_pin = comp.addPin(obj_name + ".flash", "bit", "in")
        self._flash_pin.valueChanged.connect(lambda flash: self.setFlashing(flash))

        # add led.flash-rate HAL pin
        self._flash_rate_pin = comp.addPin(obj_name + ".flash-rate", "u32", "in")
        self._flash_rate_pin.valueChanged.connect(lambda rate: self.setFlashRate(rate))
github kcjengr / qtpyvcp / qtpyvcp / widgets / hal_widgets / hal_button.py View on Github external
def initialize(self):
        comp = hal.COMPONENTS['qtpyvcp']
        obj_name = str(self.objectName()).replace('_', '-')

        # add button.enable HAL pin
        self._enable_pin = comp.addPin(obj_name + ".enable", "bit", "in")
        self._enable_pin.value = self.isEnabled()
        self._enable_pin.valueChanged.connect(self.setEnabled)

        # add button.out HAL pin
        self._pressed_pin = comp.addPin(obj_name + ".out", "bit", "out")

        # add checkbox.checked HAL pin
        self._checked_pin = comp.addPin(obj_name + ".checked", "bit", "out")
        self._checked_pin.value = self.isChecked()

        if self._pulse:
            self.pulse_timer = QTimer()
github kcjengr / qtpyvcp / qtpyvcp / widgets / hal_widgets / hal_label.py View on Github external
def initialize(self):
        comp = hal.COMPONENTS['qtpyvcp']
        obj_name = str(self.objectName()).replace('_', '-')

        # add label.enable HAL pin
        self._enable_pin = comp.addPin(obj_name + ".enable", "bit", "in")
        self._enable_pin.value = self.isEnabled()
        self._enable_pin.valueChanged.connect(self.setEnabled)

        # add label.in HAL pin
        self._in_pin = comp.addPin(obj_name + ".in", self._typ, "in")
        self.setValue(self._in_pin.value)
        self._in_pin.valueChanged.connect(self.setValue)
github kcjengr / qtpyvcp / qtpyvcp / widgets / hal_widgets / hal_spinbox.py View on Github external
def initialize(self):
        comp = hal.COMPONENTS['qtpyvcp']
        obj_name = str(self.objectName()).replace('_', '-')

        if self.minimum() < 0:
            pin_typ = 's32'
        else:
            pin_typ = 'u32'

        # add spinbox.enable HAL pin
        self._enabled_pin = comp.addPin(obj_name + ".enable", "bit", "in")
        self._enabled_pin.value = self.isEnabled()
        self._enabled_pin.valueChanged.connect(self.setEnabled)

        # add spinbox.out HAL pin
        self._value_pin = comp.addPin(obj_name + ".out", pin_typ, "out")
        self._value_pin.value = self.value()
github kcjengr / qtpyvcp / qtpyvcp / plugins / exported_hal.py View on Github external
def initialiseFrameworkExposedHalPins(self):
        comp = hal.COMPONENTS['qtpyvcp']
        obj_name = 'feed-override'
        self._feed_override_reset = comp.addPin(obj_name + ".reset", "bit", "in")
        self._feed_override_reset.valueChanged.connect(feed_override.reset)
        obj_name = 'rapid-override'
        self._rapid_override_reset = comp.addPin(obj_name + ".reset", "bit", "in")
        self._rapid_override_reset.valueChanged.connect(rapid_override.reset)
        obj_name = 'spindle-override'
        self._spindle_override_reset = comp.addPin(obj_name + ".reset", "bit", "in")
        self._spindle_override_reset.valueChanged.connect(spindle_override.reset)
github kcjengr / qtpyvcp / qtpyvcp / widgets / hal_widgets / hal_u32_dro.py View on Github external
def initialize(self):
        comp = hal.COMPONENTS['qtpyvcp']
        obj_name = str(self.objectName()).replace('_', '-')

        # add u32-dro.enable HAL pin
        self._enable_pin = comp.addPin(obj_name + ".enable", "bit", "in")
        self._enable_pin.value = self.isEnabled()
        self._enable_pin.valueChanged.connect(self.setEnabled)

        # add u32-dro.in HAL pin
        self._in_pin = comp.addPin(obj_name + ".in", "u32", "in")
        self.setValue(self._in_pin.value)
        self._in_pin.valueChanged.connect(self.setValue)
github kcjengr / qtpyvcp / qtpyvcp / widgets / hal_widgets / hal_slider.py View on Github external
def initialize(self):
        comp = hal.COMPONENTS['qtpyvcp']
        obj_name = str(self.objectName()).replace('_', '-')

        # add slider.enable HAL pin
        self._enable_pin = comp.addPin(obj_name + ".enable", "bit", "in")
        self._enable_pin.value = self.isEnabled()
        self._enable_pin.valueChanged.connect(self.setEnabled)

        # add slider.percent HAL pin
        self._s32_value_pin = comp.addPin(obj_name + ".out-i", "u32", "out")
        self._s32_value_pin.value = self.value()

        # add slider.scale HAL pin
        self._float_value_pin = comp.addPin(obj_name + ".out-f", "float", "out")
        self._float_value_pin.value = self.value() / 100.0