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

Method recalculate

lantz/ui/blocks/loop.py:175–181  ·  view source on GitHub ↗
(self, *args)

Source from the content-addressed store, hash-verified

173 self.request_start.emit(None, interval, iterations, duration)
174
175 def recalculate(self, *args):
176 mode = self.widget.mode.currentIndex()
177 if mode == StopMode.Duration:
178 iterations = self.widget.duration.value() / self.widget.interval.value()
179 self.widget.iterations.setValue(math.ceil(iterations))
180 elif mode == StopMode.Iterations:
181 self.widget.duration.setValue(self.widget.iterations.value() * self.widget.interval.value())
182
183 def on_iteration(self, counter, iterations, overrun):
184 pbar = self.widget.progress_bar

Callers 1

on_mode_changedMethod · 0.95

Calls 2

valueMethod · 0.45
setValueMethod · 0.45

Tested by

no test coverage detected