Skip to content

Commit

Permalink
Do not add the ANALOG:SCALE if USED is empty (comply with Shogun)
Browse files Browse the repository at this point in the history
  • Loading branch information
pariterre committed Jun 28, 2021
1 parent d9b20a2 commit af159be
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<double> 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();
}
Expand Down

0 comments on commit af159be

Please sign in to comment.