Esempio n. 1
0
    def __init__(self, steps=5, *args, **kwargs):
        super(PowerBar, self).__init__(*args, **kwargs)

        layout = QtImport.QVBoxLayout()
        self._bar = _Bar(steps)
        layout.addWidget(self._bar)

        # Create the QDial widget and set up defaults.
        # - we provide accessors on this class to override.
        self._dial = QtImport.QDial()
        self._dial.setNotchesVisible(True)
        self._dial.setWrapping(False)
        self._dial.valueChanged.connect(self._bar._trigger_refresh)
        self._dial.valueChanged.connect(self.slot_value_changed)

        # Take feedback from click events on the meter.
        self._bar.clickedValue.connect(self._dial.setValue)

        layout.addWidget(self._dial)
        self.setLayout(layout)
Esempio n. 2
0
    def __init__(self, tag_dict):
        """
        tag_dict:
        { 
            "tag1" : value1
            "tag2" : value2
        }
        tag1/value1 
        """
        super().__init__()

        #print(f"######### DialWithTags: {tag_dict}")
        self.tags = dict(tag_dict)
        self.layout = QtImport.QVBoxLayout()
        self.layout.setContentsMargins(32, 32, 32, 32)
        self.dial = QtImport.QDial()
        self.dial.setMinimum(1)
        self.dial.setMaximum(len(self.tags))
        self.dial.setSingleStep(1)
        self.dial.setNotchesVisible(True)
        self.layout.addWidget(self.dial)
        self.setLayout(self.layout)