MCPcopy Create free account
hub / github.com/LabPy/lantz / on_start_stop_clicked

Method on_start_stop_clicked

lantz/ui/blocks/loop.py:153–173  ·  view source on GitHub ↗
(self, value=None)

Source from the content-addressed store, hash-verified

151 self.request_stop.connect(self.backend.stop)
152
153 def on_start_stop_clicked(self, value=None):
154 if self.backend._active:
155 self.widget.start_stop.setText('...')
156 self.widget.start_stop.setEnabled(False)
157 self.request_stop.emit()
158 return
159
160 self.widget.start_stop.setText('Stop')
161 self.widget.start_stop.setChecked(True)
162
163 mode = self.widget.mode.currentIndex()
164 interval, iterations, duration = [getattr(self.widget, name).value()
165 for name in 'interval iterations duration'.split()]
166 if mode == StopMode.Continuous:
167 self.request_start.emit(None, interval, 0, 0)
168 elif mode == StopMode.Iterations:
169 self.request_start.emit(None, interval, iterations, 0)
170 elif mode == StopMode.Duration:
171 self.request_start.emit(None, interval, 0, duration)
172 elif mode == StopMode.IterationsTimeOut:
173 self.request_start.emit(None, interval, iterations, duration)
174
175 def recalculate(self, *args):
176 mode = self.widget.mode.currentIndex()

Callers

nothing calls this directly

Calls 2

emitMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected