UI updates
This commit is contained in:
@@ -66,6 +66,9 @@ PREPROCESS_ASSET_SPECS = {
|
||||
PREPROCESS_ASSET_KEYS = tuple(PREPROCESS_ASSET_SPECS.keys())
|
||||
S21_PREPROCESS_ASSET_KEYS = ("s21_calibration", "s21_reference")
|
||||
S11_PREPROCESS_ASSET_KEYS = ("s11_open", "s11_short", "s11_load", "s11_reference")
|
||||
S11_PREPROCESS_CALIBRATION_KEYS = ("s11_open", "s11_short", "s11_load")
|
||||
VISIBLE_PREPROCESS_ASSET_KEYS = S21_PREPROCESS_ASSET_KEYS
|
||||
REQUIRED_PREPROCESS_ASSET_KEYS = S21_PREPROCESS_ASSET_KEYS
|
||||
|
||||
|
||||
def preprocess_asset_model(config: RunConfigModel, key: str) -> PreprocessAssetModel:
|
||||
@@ -93,3 +96,25 @@ def preprocess_asset_display_name(key: str) -> str:
|
||||
def preprocess_asset_channel(key: str) -> str:
|
||||
"""Return associated trace channel for preprocess asset."""
|
||||
return PREPROCESS_ASSET_SPECS[key].channel
|
||||
|
||||
|
||||
def preprocess_asset_set_name(config: RunConfigModel, key: str) -> str:
|
||||
"""Return normalized selected set name for one preprocess asset."""
|
||||
return str(preprocess_asset_model(config, key).set_name).strip()
|
||||
|
||||
|
||||
def runtime_preprocess_asset_keys(config: RunConfigModel) -> tuple[str, ...]:
|
||||
"""Return preprocess assets that should be exported and validated for runtime."""
|
||||
enabled_keys = list(REQUIRED_PREPROCESS_ASSET_KEYS)
|
||||
|
||||
has_full_s11_calibration = all(
|
||||
preprocess_asset_set_name(config, key)
|
||||
for key in S11_PREPROCESS_CALIBRATION_KEYS
|
||||
)
|
||||
if not has_full_s11_calibration:
|
||||
return tuple(enabled_keys)
|
||||
|
||||
enabled_keys.extend(S11_PREPROCESS_CALIBRATION_KEYS)
|
||||
if preprocess_asset_set_name(config, "s11_reference"):
|
||||
enabled_keys.append("s11_reference")
|
||||
return tuple(enabled_keys)
|
||||
|
||||
Reference in New Issue
Block a user