Added measurement class, changed signal type.

This commit is contained in:
jupfi 2023-07-17 11:29:36 +02:00
parent 0e755a6cc5
commit f0933c7705
4 changed files with 41 additions and 1 deletions

View file

@ -35,6 +35,7 @@ class BaseSpectrometerModel(ModuleModel):
def get_setting(self):
return float(self.value)
class PulseParameter:
def __init__(self, name):

View file

@ -40,7 +40,7 @@ class SpectrometerController(ModuleController):
self._module.view.create_menu_entry()
def process_signals(self, key: str, value: str):
def process_signals(self, key: str, value: None):
if key == "start_measurement":
self.on_measurement_start()

View file

@ -0,0 +1,39 @@
class Measurement():
"""This class defines how measurement data should look.
It includes pulse parameters necessary for further signal processing.
Every spectrometer should adhere to this data structure in order to be compatible with the rest of the nqrduck.
"""
def __init__(self, tdx, tdy, target_frequency) -> None:
self.tdx = tdx
self.tdy = tdy
self.target_frequency = target_frequency
# Measurement data
@property
def tdx(self):
"""Time axis for the x axis of the measurement data."""
return self._tdx
@tdx.setter
def tdx(self, value):
self._tdx = value
@property
def tdy(self):
"""Time axis for the y axis of the measurement data."""
return self._tdy
@tdy.setter
def tdy(self, value):
self._tdy = value
# Pulse parameters
@property
def target_frequency(self):
"""Target frequency of the measurement."""
return self._target_frequency
@target_frequency.setter
def target_frequency(self, value):
self._target_frequency = value