def __init__(self, **kwargs): self._running = threading.Event() self._stopped = threading.Event() self._current_freq = None self._progress = 0. ckwargs = kwargs.get('config') if not ckwargs: ckwargs = db_store.get_scan_config() if not ckwargs: ckwargs = {} self.config = ScanConfig(ckwargs) self.device_config = self.config.device self.sampling_config = self.config.sampling if 'spectrum' in kwargs: self.spectrum = Spectrum.from_json(kwargs['spectrum']) else: self.spectrum = Spectrum() self.spectrum.scan_config = self.config if not kwargs.get('__from_json__'): self.sample_collection = SampleCollection(scanner=self)
def _deserialize(self, **kwargs): spdata = kwargs.get('spectrum_data') self.spectrum = Spectrum.from_json(spdata)