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

Class FeatScan

lantz/ui/blocks/featscan.py:19–50  ·  view source on GitHub ↗

A backend to scan a feat for a given instrument.

Source from the content-addressed store, hash-verified

17
18
19class FeatScan(Scan):
20 """A backend to scan a feat for a given instrument.
21 """
22
23 #: Signal emitted before starting a new iteration
24 #: Parameters: loop counter, step value, overrun
25 iteration = QtCore.Signal(int, int, bool)
26
27 #: Signal emitted when the loop finished.
28 #: The parameter is used to inform if the loop was canceled.
29 loop_done = QtCore.Signal(bool)
30
31 instrument = InstrumentSlot
32
33 #: Name of the scanned feat
34 #: :type: str
35
36 def __init__(self, feat_name, *args, **kwargs):
37 super().__init__(*args, **kwargs)
38 self.feat_name = feat_name
39
40 def _pre_body(self, counter, new_value, overrun):
41 setattr(self.instrument, self.feat_name, new_value)
42
43 @property
44 def feat_units(self):
45 """Units of the scanned feat.
46 """
47 target = self.instrument
48 feat_name = self.feat_name
49 feat = target.feats[feat_name]
50 return str(feat.units)
51
52
53class FeatScanUi(ScanUi):

Callers 1

featscan.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected