Added calibration settings
This commit is contained in:
parent
0b5a94be4c
commit
28358f5385
@ -51,6 +51,7 @@ class Qty:
|
||||
level_ref_name: str
|
||||
level_ref_value: str
|
||||
|
||||
|
||||
class SIQtys:
|
||||
N = Qty(name='Number',
|
||||
unit_name='No unit / full scale',
|
||||
@ -95,6 +96,36 @@ class SIQtys:
|
||||
def getCurrent(cb):
|
||||
return SIQtys.types[cb.currentIndex()]
|
||||
|
||||
@dataclass
|
||||
class CalSetting:
|
||||
name: str
|
||||
cal_value: float
|
||||
qty: Qty
|
||||
|
||||
class CalibrationSettings:
|
||||
one = CalSetting('94 dB SPL', 1.0, SIQtys.AP)
|
||||
two = CalSetting('114 dB SPL', 10.0, SIQtys.AP)
|
||||
|
||||
types = (one, two)
|
||||
default = one
|
||||
default_index = 0
|
||||
|
||||
@staticmethod
|
||||
def fillComboBox(cb):
|
||||
"""
|
||||
Fill FreqWeightings to a combobox
|
||||
|
||||
Args:
|
||||
cb: QComboBox to fill
|
||||
"""
|
||||
cb.clear()
|
||||
for ty in CalibrationSettings.types:
|
||||
cb.addItem(f'{ty.name}')
|
||||
cb.setCurrentIndex(CalibrationSettings.default_index)
|
||||
|
||||
@staticmethod
|
||||
def getCurrent(cb):
|
||||
return CalibrationSettings.types[cb.currentIndex()]
|
||||
|
||||
lasp_appdir = appdirs.user_data_dir('Lasp', 'ASCEE')
|
||||
|
||||
@ -106,6 +137,7 @@ if not os.path.exists(lasp_appdir):
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
|
||||
class Shelve:
|
||||
def load(self, key, default_value):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user