added s11!
This commit is contained in:
@@ -73,16 +73,31 @@ struct RuntimeConfig {
|
||||
std::string processing_live_config_path = "python_app/runtime/processing_live.json";
|
||||
};
|
||||
|
||||
struct PreprocessAssetConfig {
|
||||
std::string set_name{};
|
||||
std::string bundle_path{};
|
||||
};
|
||||
|
||||
struct S21PreprocessConfig {
|
||||
PreprocessAssetConfig calibration{};
|
||||
PreprocessAssetConfig reference{};
|
||||
};
|
||||
|
||||
struct S11CalibrationPreprocessConfig {
|
||||
PreprocessAssetConfig open{};
|
||||
PreprocessAssetConfig short_standard{};
|
||||
PreprocessAssetConfig load{};
|
||||
};
|
||||
|
||||
struct S11PreprocessConfig {
|
||||
S11CalibrationPreprocessConfig calibration{};
|
||||
PreprocessAssetConfig reference{};
|
||||
};
|
||||
|
||||
struct PreprocessConfig {
|
||||
// Names and bundle paths selected by Python GUI layer.
|
||||
std::string s21_calibration_set{};
|
||||
std::string s21_reference_set{};
|
||||
std::string s21_calibration_bundle_path{};
|
||||
std::string s21_reference_bundle_path{};
|
||||
std::string s11_open_calibration_bundle_path{};
|
||||
std::string s11_short_calibration_bundle_path{};
|
||||
std::string s11_load_calibration_bundle_path{};
|
||||
std::string s11_reference_bundle_path{};
|
||||
// Channel-specific preprocessing assets selected by Python GUI layer.
|
||||
S21PreprocessConfig s21{};
|
||||
S11PreprocessConfig s11{};
|
||||
};
|
||||
|
||||
struct GprTxGeometry {
|
||||
|
||||
@@ -140,6 +140,20 @@ using Json = nlohmann::json;
|
||||
return fallback;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto parse_preprocess_asset(
|
||||
const Json& object,
|
||||
const std::string& key,
|
||||
const std::string& context
|
||||
) -> PreprocessAssetConfig {
|
||||
const auto asset_context = context + "." + key;
|
||||
const auto* asset_obj = as_object(required_field(object, key), asset_context);
|
||||
|
||||
PreprocessAssetConfig asset{};
|
||||
asset.set_name = optional_string(*asset_obj, "set_name", "");
|
||||
asset.bundle_path = optional_string(*asset_obj, "bundle_path", "");
|
||||
return asset;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto parse_driver_mode(const std::string& value) -> DriverMode {
|
||||
if (value == "mock") {
|
||||
return DriverMode::Mock;
|
||||
@@ -438,18 +452,20 @@ auto load_run_config(const std::string& path) -> RunConfig {
|
||||
|
||||
{
|
||||
const auto* preprocess_obj = as_object(required_field(*root_obj, "preprocess"), "preprocess");
|
||||
config.preprocess.s21_calibration_set = optional_string(*preprocess_obj, "s21_calibration_set", "");
|
||||
config.preprocess.s21_reference_set = optional_string(*preprocess_obj, "s21_reference_set", "");
|
||||
config.preprocess.s21_calibration_bundle_path =
|
||||
optional_string(*preprocess_obj, "s21_calibration_bundle_path", "");
|
||||
config.preprocess.s21_reference_bundle_path = optional_string(*preprocess_obj, "s21_reference_bundle_path", "");
|
||||
config.preprocess.s11_open_calibration_bundle_path =
|
||||
optional_string(*preprocess_obj, "s11_open_calibration_bundle_path", "");
|
||||
config.preprocess.s11_short_calibration_bundle_path =
|
||||
optional_string(*preprocess_obj, "s11_short_calibration_bundle_path", "");
|
||||
config.preprocess.s11_load_calibration_bundle_path =
|
||||
optional_string(*preprocess_obj, "s11_load_calibration_bundle_path", "");
|
||||
config.preprocess.s11_reference_bundle_path = optional_string(*preprocess_obj, "s11_reference_bundle_path", "");
|
||||
const auto* s21_obj = as_object(required_field(*preprocess_obj, "s21"), "preprocess.s21");
|
||||
config.preprocess.s21.calibration = parse_preprocess_asset(*s21_obj, "calibration", "preprocess.s21");
|
||||
config.preprocess.s21.reference = parse_preprocess_asset(*s21_obj, "reference", "preprocess.s21");
|
||||
|
||||
const auto* s11_obj = as_object(required_field(*preprocess_obj, "s11"), "preprocess.s11");
|
||||
const auto* s11_calibration_obj =
|
||||
as_object(required_field(*s11_obj, "calibration"), "preprocess.s11.calibration");
|
||||
config.preprocess.s11.calibration.open =
|
||||
parse_preprocess_asset(*s11_calibration_obj, "open", "preprocess.s11.calibration");
|
||||
config.preprocess.s11.calibration.short_standard =
|
||||
parse_preprocess_asset(*s11_calibration_obj, "short", "preprocess.s11.calibration");
|
||||
config.preprocess.s11.calibration.load =
|
||||
parse_preprocess_asset(*s11_calibration_obj, "load", "preprocess.s11.calibration");
|
||||
config.preprocess.s11.reference = parse_preprocess_asset(*s11_obj, "reference", "preprocess.s11");
|
||||
}
|
||||
|
||||
if (const auto* gpr_value = optional_field(*root_obj, "gpr"); gpr_value != nullptr) {
|
||||
|
||||
Reference in New Issue
Block a user