From af159be9bd0624acf492aba6ca344e5f687c87eb Mon Sep 17 00:00:00 2001 From: Pariterre Date: Mon, 28 Jun 2021 11:01:58 +0200 Subject: [PATCH] Do not add the ANALOG:SCALE if USED is empty (comply with Shogun) --- src/Parameters.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Parameters.cpp b/src/Parameters.cpp index da53eac7..c437c435 100644 --- a/src/Parameters.cpp +++ b/src/Parameters.cpp @@ -409,7 +409,10 @@ ezc3d::ParametersNS::Parameters::prepareCopyForWriting( // Ensure that the right analog scale is in the file ezc3d::ParametersNS::GroupNS::Parameter analogScaleFactorParam; std::vector analogScaleFactor; - if (params.group("ANALOG").parameter("SCALE").valuesAsDouble().size() > 0) { + if (params.group("ANALOG").parameter("USED").valuesAsInt()[0] == 0){ + analogScaleFactorParam.name("SCALE"); + } + else if (params.group("ANALOG").parameter("SCALE").valuesAsDouble().size() > 0) { analogScaleFactorParam = params.group("ANALOG").parameter("SCALE"); analogScaleFactor = params.group("ANALOG").parameter("SCALE").valuesAsDouble(); }