From 41d8dd2af77918cfb05061bcc541092786679001 Mon Sep 17 00:00:00 2001 From: AlexBeattie42 <30098201+alexbeattie42@users.noreply.github.com> Date: Thu, 17 Oct 2024 09:00:43 +0300 Subject: [PATCH] Fix build error in testscale --- Applications/Scale/test/testScale.cpp | 20 ++++++++++---------- OpenSim/Common/IO.h | 3 ++- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Applications/Scale/test/testScale.cpp b/Applications/Scale/test/testScale.cpp index 75f0d8ea1c..3ea0293a5a 100644 --- a/Applications/Scale/test/testScale.cpp +++ b/Applications/Scale/test/testScale.cpp @@ -169,8 +169,8 @@ void scaleGait2354() std::string setupFilePath; // Remove old results if any - std::unique_ptr file2Remove{IO::OpenOutputFile(setupFilePath+"subject01_scaleSet_applied.xml")}; - file2Remove->close(); + std::unique_ptr file2Remove1{IO::OpenOutputFile(setupFilePath+"subject01_scaleSet_applied.xml")}; + file2Remove1->close(); std::unique_ptr file2Remove2{IO::OpenOutputFile(setupFilePath+"subject01_simbody.osim")}; file2Remove2->close(); @@ -192,8 +192,8 @@ void scaleGait2354() } // See if we have any issues when calling run() twice. - std::unique_ptr file2Remove{IO::OpenOutputFile(setupFilePath+"subject01_scaleSet_applied.xml")}; - file2Remove->close(); + std::unique_ptr file2Remove3{IO::OpenOutputFile(setupFilePath+"subject01_scaleSet_applied.xml")}; + file2Remove3->close(); subject->run(); { @@ -216,10 +216,10 @@ void scaleGait2354_GUI(bool useMarkerPlacement) std::string setupFilePath=subject->getPathToSubject(); // Remove old results if any - std::unique_ptr file2Remove{IO::OpenOutputFile(setupFilePath+"subject01_scaleSet_applied_GUI.xml")}; - file2Remove->close(); - std::unique_ptr file2Remove2{IO::OpenOutputFile(setupFilePath+"subject01_scaledOnly_GUI.osim")}; - file2Remove2->close(); + std::unique_ptr file2Remove4{IO::OpenOutputFile(setupFilePath+"subject01_scaleSet_applied_GUI.xml")}; + file2Remove4->close(); + std::unique_ptr file2Remove5{IO::OpenOutputFile(setupFilePath+"subject01_scaledOnly_GUI.osim")}; + file2Remove5->close(); Model guiModel("gait2354_simbody.osim"); @@ -265,8 +265,8 @@ void scaleModelWithLigament() std::string setupFilePath(""); // Remove old model if any - std::unique_ptr file2Remove{IO::OpenOutputFile(setupFilePath + "toyLigamentModelScaled.osim")}; - file2Remove->close(); + std::unique_ptr file2Remove6{IO::OpenOutputFile(setupFilePath + "toyLigamentModelScaled.osim")}; + file2Remove6->close(); // Construct model and read parameters file std::unique_ptr scaleTool( diff --git a/OpenSim/Common/IO.h b/OpenSim/Common/IO.h index 333fd6ba7c..fd03984cfa 100644 --- a/OpenSim/Common/IO.h +++ b/OpenSim/Common/IO.h @@ -102,10 +102,11 @@ class OSIMCOMMON_API IO { static int ComputeNumberOfSteps(double aTI,double aTF,double aDT); static std::string ReadCharacters(std::istream &aIS,int aNChar); static bool FileExists(const std::string& filePath); -#endif static std::ifstream* OpenInputFile(const std::string &aFileName,std::ios_base::openmode mode=std::ios_base::in); static std::ofstream* OpenOutputFile(const std::string &aFileName,std::ios_base::openmode mode=std::ios_base::out); static double stod(const std::string& __str, std::size_t* __idx = 0); +#endif + // // Directory management static int makeDir(const std::string &aDirName);