Open the shutter an then for each amplitude: - scan the amplitude of the function generator. - sleeps .3 seconds. - measures the trace of the oscilloscope. - yields amplitude, data for each amplitude. Finally, close the shutter. :param amplitudes: it
(self, amplitudes)
| 113 | new_data = QtCore.Signal(object, object) |
| 114 | |
| 115 | def scan_amplitude(self, amplitudes): |
| 116 | """Open the shutter an then for each amplitude: |
| 117 | - scan the amplitude of the function generator. |
| 118 | - sleeps .3 seconds. |
| 119 | - measures the trace of the oscilloscope. |
| 120 | - yields amplitude, data for each amplitude. |
| 121 | |
| 122 | Finally, close the shutter. |
| 123 | |
| 124 | :param amplitudes: iterable of amplitudes. |
| 125 | """ |
| 126 | self.shutter.opened = True |
| 127 | |
| 128 | # We use the embedded app to perform the actual operation. |
| 129 | # Notice that we have not explicitly instantiated the AmplitudeScanner |
| 130 | # nor provided the instruments. Lantz has done this in the back |
| 131 | # connecting InstrumentsSlots by name. |
| 132 | # i.e. self.osci is self.scanner.osci |
| 133 | for amplitude, data in self.scanner.scan_amplitude(amplitudes): |
| 134 | self.new_data.emit(amplitude, data) |
| 135 | yield amplitude, data |
| 136 | |
| 137 | self.shutter.opened = False |
| 138 | |
| 139 | def _scan_amplitude(self, amplitudes): |
| 140 | """Because scan_amplitude is a generator, this helper functions is used |
no test coverage detected