def _setup_ui(self): layout = QHBoxLayout(self) self.setLayout(layout) layout.setSpacing(20) ag1 = ApolloGroup(self, "STOP CONDITIONS") layout.addWidget(ag1) for label, name in STOP_CONDS.items(): w = ApolloLabeledIndicatorSwitch(self, label, QColor(255, 120, 0), labelwidth=38, lines=2, callback=self._set_stop_conds, direct_connect=False) ag1.addWidget(w) self._stop_inds[name] = w.indicator self._stop_switches[name] = w.switch ag2 = ApolloGroup(self, "S SELECT") self._s1 = ApolloLabeledRSwitch(self, "S1", lines=2) self._s1.switch.setChecked(True) self._s1.switch.toggled.connect(self._set_stop_conds) ag2.addSpacing(5) ag2.addWidget(self._s1) ag2.addSpacing(10) self._s2 = ApolloLabeledRSwitch(self, "S2", lines=2) ag2.addWidget(self._s2) ag2.addSpacing(5) layout.addWidget(ag2) ag2.group()
def _setup_ui(self): layout = QVBoxLayout(self) self.setLayout(layout) layout.setMargin(10) layout.setSpacing(20) ww = QWidget(self) wwf = QHBoxLayout(ww) wwf.setMargin(0) wwf.setSpacing(20) ww.setLayout(wwf) ag1 = ApolloGroup(self, "WRITE W", nframes=2) for label, mode in WRITE_W_POSITIONS.items(): w = ApolloLabeledRSwitch(ag1, label, labelwidth=20) w.switch.pressed.connect(lambda m=mode: self._update_mode(m)) if label == 'ALL': w.switch.setChecked(True) ag1.addWidget(w, 0) ag1.framelayouts[0].addStretch() else: ag1.addWidget(w, 1) ag1.group() wwf.addWidget(ag1) wwf.addStretch(100) ag0 = ApolloGroup(self, "S SELECT") self._s1 = ApolloLabeledRSwitch(self, "S1") self._s1.switch.setChecked(True) self._s1.switch.toggled.connect(lambda s: self._send_mode(s)) ag0.addSpacing(5) ag0.addWidget(self._s1) ag0.addSpacing(10) self._s2 = ApolloLabeledRSwitch(self, "S2") ag0.addWidget(self._s2) ag0.addSpacing(5) ag0.group() wwf.addWidget(ag0) layout.addWidget(ww) ag2 = ApolloGroup(self, "TIME PULSES", nframes=2) self._add_switches(ag2, TIME_SWITCHES, self._time_switches, self._send_times) layout.addWidget(ag2) ag3 = ApolloGroup(self, "CONTROL PULSES", nframes=2) self._add_switches(ag3, PULSE_SWITCHES, self._pulse_switches, self._send_pulses) layout.addWidget(ag3) layout.addStretch(1000)
def _setup_ui(self): layout = QVBoxLayout(self) self.setLayout(layout) layout.setSpacing(20) ag = ApolloGroup(self, "FIXED MEMORY", nframes=3) layout.addWidget(ag) for bank in range(0o44): row = int(bank / 18) sw = ApolloLabeledSwitch(self, f"{bank:o}", labelwidth=16) ag.addWidget(sw, row) sw.switch.stateChanged.connect( lambda state, bank=bank: self._update_crs_bank(bank)) self._bank_switches.append(sw.switch) aux_switch = ApolloLabeledSwitch(self, "\n44-77", lines=2, labelwidth=36) self._aux_switch = aux_switch.switch ag.addWidget(aux_switch, 2) ag.addSpacing(30, 2) b1 = ApolloLabeledButton(self, '\nALL', lines=2, callback=lambda: self._set_all(True)) b2 = ApolloLabeledButton(self, '\nNONE', lines=2, callback=lambda: self._set_all(False)) ag.addWidget(b1, 2) ag.addWidget(b2, 2) # ag.addSpacing(30, 2) # cb1 = ApolloLabeledRSwitch(self, "\nSIM", lines=2, labelwidth=30) # cb2 = ApolloLabeledRSwitch(self, "\nAGC", lines=2, labelwidth=30) # cb2.switch.setChecked(True) # self._agc_sel = cb2.switch # group = QButtonGroup(self) # group.addButton(cb1.switch) # group.addButton(cb2.switch) # ag.addWidget(cb1, 2) # ag.addWidget(cb2, 2) ag.addStretch(2) b3 = ApolloLabeledButton(self, "LOAD\nSIM", lines=2, callback=self._load_rope) b4 = ApolloLabeledButton(self, "DUMP\nAGC", lines=2, callback=self._dump_rope) ag.addWidget(b3, 2) ag.addWidget(b4, 2)