Skip to content

Commit

Permalink
Fix build error in testscale
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbeattie42 committed Oct 17, 2024
1 parent 2db3c22 commit 41d8dd2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
20 changes: 10 additions & 10 deletions Applications/Scale/test/testScale.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ void scaleGait2354()
std::string setupFilePath;

// Remove old results if any
std::unique_ptr<std::ofstream> file2Remove{IO::OpenOutputFile(setupFilePath+"subject01_scaleSet_applied.xml")};
file2Remove->close();
std::unique_ptr<std::ofstream> file2Remove1{IO::OpenOutputFile(setupFilePath+"subject01_scaleSet_applied.xml")};
file2Remove1->close();
std::unique_ptr<std::ofstream> file2Remove2{IO::OpenOutputFile(setupFilePath+"subject01_simbody.osim")};
file2Remove2->close();

Expand All @@ -192,8 +192,8 @@ void scaleGait2354()
}

// See if we have any issues when calling run() twice.
std::unique_ptr<std::ofstream> file2Remove{IO::OpenOutputFile(setupFilePath+"subject01_scaleSet_applied.xml")};
file2Remove->close();
std::unique_ptr<std::ofstream> file2Remove3{IO::OpenOutputFile(setupFilePath+"subject01_scaleSet_applied.xml")};
file2Remove3->close();

subject->run();
{
Expand All @@ -216,10 +216,10 @@ void scaleGait2354_GUI(bool useMarkerPlacement)
std::string setupFilePath=subject->getPathToSubject();

// Remove old results if any
std::unique_ptr<std::ofstream> file2Remove{IO::OpenOutputFile(setupFilePath+"subject01_scaleSet_applied_GUI.xml")};
file2Remove->close();
std::unique_ptr<std::ofstream> file2Remove2{IO::OpenOutputFile(setupFilePath+"subject01_scaledOnly_GUI.osim")};
file2Remove2->close();
std::unique_ptr<std::ofstream> file2Remove4{IO::OpenOutputFile(setupFilePath+"subject01_scaleSet_applied_GUI.xml")};
file2Remove4->close();
std::unique_ptr<std::ofstream> file2Remove5{IO::OpenOutputFile(setupFilePath+"subject01_scaledOnly_GUI.osim")};
file2Remove5->close();

Model guiModel("gait2354_simbody.osim");

Expand Down Expand Up @@ -265,8 +265,8 @@ void scaleModelWithLigament()
std::string setupFilePath("");

// Remove old model if any
std::unique_ptr<std::ofstream> file2Remove{IO::OpenOutputFile(setupFilePath + "toyLigamentModelScaled.osim")};
file2Remove->close();
std::unique_ptr<std::ofstream> file2Remove6{IO::OpenOutputFile(setupFilePath + "toyLigamentModelScaled.osim")};
file2Remove6->close();

// Construct model and read parameters file
std::unique_ptr<ScaleTool> scaleTool(
Expand Down
3 changes: 2 additions & 1 deletion OpenSim/Common/IO.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 41d8dd2

Please sign in to comment.