mirror of
https://github.com/nqrduck/nqrduck-spectrometer-limenqr.git
synced 2024-11-09 11:10:03 +00:00
Changed to acces via properties.
This commit is contained in:
parent
06685e2b6f
commit
9bb1bf37bb
2 changed files with 53 additions and 7 deletions
|
@ -9,4 +9,4 @@ class LimeNQRController(BaseSpectrometerController):
|
||||||
super().__init__(module)
|
super().__init__(module)
|
||||||
|
|
||||||
def start_measurement(self):
|
def start_measurement(self):
|
||||||
logger.debug("Starting measurement with spectrometer: %s", self._module._model.name)
|
logger.debug("Starting measurement with spectrometer: %s", self.module.model.name)
|
||||||
|
|
|
@ -1,12 +1,55 @@
|
||||||
import logging
|
import logging
|
||||||
from nqrduck.module.module_model import ModuleModel
|
from nqrduck.module.module_model import ModuleModel
|
||||||
|
from nqrduck_spectrometer.base_spectrometer_model import BaseSpectrometerModel
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class LimeNQRModel(ModuleModel):
|
class LimeNQRModel(BaseSpectrometerModel):
|
||||||
|
|
||||||
def __init__(self, module) -> None:
|
def __init__(self, module) -> None:
|
||||||
super().__init__(module)
|
super().__init__(module)
|
||||||
|
self.add_setting("rx_gain", 55, "RX Gain")
|
||||||
|
self.add_setting("tx_gain", 40, "TX Gain")
|
||||||
|
self.add_pulse_parameter_option("tx_pulse", [self.RectPulse, self.SincPulse, self.GaussianPulse])
|
||||||
|
self.add_pulse_parameter_option("rx_readout", [self.RXReadout])
|
||||||
|
self.add_pulse_parameter_option("gate", [self.Gate])
|
||||||
|
|
||||||
|
try:
|
||||||
|
from nqrduck_pulseprogrammer.pulseprogrammer import PulseProgrammer
|
||||||
|
self.pulse_programmer = PulseProgrammer
|
||||||
|
self.pulse_programmer.controller.on_loading(self.pulse_parameter_options)
|
||||||
|
except ImportError:
|
||||||
|
logger.warning("No pulse programmer found.")
|
||||||
|
|
||||||
|
class TXPulse(BaseSpectrometerModel.PulseParameter):
|
||||||
|
def __init__(self, name) -> None:
|
||||||
|
super().__init__(name)
|
||||||
|
self.tx_freq = 0
|
||||||
|
self.tx_phase = 0
|
||||||
|
|
||||||
|
class RectPulse(TXPulse):
|
||||||
|
def __init__(self, name) -> None:
|
||||||
|
super().__init__(name)
|
||||||
|
|
||||||
|
class SincPulse(TXPulse):
|
||||||
|
def __init__(self, name) -> None:
|
||||||
|
super().__init__(name)
|
||||||
|
|
||||||
|
class GaussianPulse(TXPulse):
|
||||||
|
def __init__(self, name) -> None:
|
||||||
|
super().__init__(name)
|
||||||
|
|
||||||
|
class RXReadout(BaseSpectrometerModel.PulseParameter):
|
||||||
|
def __init__(self, name) -> None:
|
||||||
|
super().__init__(name)
|
||||||
|
self.rx_freq = 0
|
||||||
|
self.rx_phase = 0
|
||||||
|
|
||||||
|
class Gate(BaseSpectrometerModel.PulseParameter):
|
||||||
|
def __init__(self, name) -> None:
|
||||||
|
super().__init__(name)
|
||||||
|
self.state = False
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def rx_antenna(self):
|
def rx_antenna(self):
|
||||||
|
@ -56,10 +99,13 @@ class LimeNQRModel(ModuleModel):
|
||||||
def tx_lpfbw(self, value):
|
def tx_lpfbw(self, value):
|
||||||
self._tx_lpfbw = value
|
self._tx_lpfbw = value
|
||||||
|
|
||||||
|
# Pulse params
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def rx_freq(self):
|
def tx_freq(self):
|
||||||
return self._rx_freq
|
return self._tx_freq
|
||||||
|
|
||||||
@rx_freq.setter
|
@tx_freq.setter
|
||||||
def rx_freq(self, value):
|
def tx_freq(self, value):
|
||||||
self._rx_freq = value
|
self._tx_freq = value
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue