def make_corner_widgets(self): # make a spindle-at-speed green LED self.w.led = LED() self.w.led.setProperty('is_spindle_at_speed_status',True) self.w.led.setProperty('color',QColor(0,255,0,255)) self.w.led.hal_init(HAL_NAME = 'spindle_is_at_speed') # make a spindle speed bar self.w.rpm_bar = QtWidgets.QProgressBar() self.w.rpm_bar.setRange(0, INFO.MAX_SPINDLE_SPEED) # containers w = QtWidgets.QWidget() w.setContentsMargins(0,0,0,6) w.setMinimumHeight(40) hbox = QtWidgets.QHBoxLayout() hbox.addWidget(self.w.rpm_bar) hbox.addWidget(self.w.led) w.setLayout(hbox) # add those to the corner of the right tab widget self.w.rightTab.setCornerWidget(w) # add tool number status to left tab corner self.w.tool_stat = TOOLSTAT() self.w.tool_stat.setProperty('tool_number_status', True) self.w.tool_stat.setProperty('textTemplate', 'Tool %d') self.w.tool_stat.hal_init() self.w.tool_stat.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter) self.w.tool_stat.setFixedWidth(60) self.w.leftTab.setCornerWidget(self.w.tool_stat)
def make_corner_widgets(self): # add spindle speed bar to tab corner self.w.rpm_bar = QtWidgets.QProgressBar() self.w.rpm_bar.setRange(0, INFO.MAX_SPINDLE_SPEED) self.w.rightTab.setCornerWidget(self.w.rpm_bar) # add tool number status to tab corner self.w.tool_stat = TOOLSTAT() self.w.tool_stat.setProperty('tool_number_status', True) self.w.tool_stat.setProperty('textTemplate', 'Tool %d') self.w.tool_stat._hal_init() self.w.tool_stat.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter) self.w.tool_stat.setFixedWidth(60) self.w.leftTab.setCornerWidget(self.w.tool_stat)