mirror of
https://github.com/nqrduck/nqrduck-spectrometer.git
synced 2024-11-09 20:40:02 +00:00
Added measurement class, changed signal type.
This commit is contained in:
parent
0e755a6cc5
commit
f0933c7705
4 changed files with 41 additions and 1 deletions
|
@ -36,6 +36,7 @@ class BaseSpectrometerModel(ModuleModel):
|
||||||
def get_setting(self):
|
def get_setting(self):
|
||||||
return float(self.value)
|
return float(self.value)
|
||||||
|
|
||||||
|
|
||||||
class PulseParameter:
|
class PulseParameter:
|
||||||
def __init__(self, name):
|
def __init__(self, name):
|
||||||
self.name = name
|
self.name = name
|
||||||
|
|
|
@ -40,7 +40,7 @@ class SpectrometerController(ModuleController):
|
||||||
|
|
||||||
self._module.view.create_menu_entry()
|
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":
|
if key == "start_measurement":
|
||||||
self.on_measurement_start()
|
self.on_measurement_start()
|
||||||
|
|
||||||
|
|
39
src/nqrduck_spectrometer/measurement.py
Normal file
39
src/nqrduck_spectrometer/measurement.py
Normal 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
|
Loading…
Reference in a new issue