Skip to content

Commit

Permalink
Output files will be names without extension idf and epw
Browse files Browse the repository at this point in the history
  • Loading branch information
Monika Sharma committed Sep 19, 2014
1 parent 29a732a commit 53e0a03
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 28 deletions.
50 changes: 32 additions & 18 deletions src/EnergyPlus/CommandLineInterface.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//Standard C++ library
#include <iostream>

// CLI Headers
#include <ezOptionParser.hpp>
Expand Down Expand Up @@ -110,7 +112,7 @@ ProcessArgs(int argc, const char * argv[])
}

if(!opt.isSet("-h") && !opt.isSet("-v") && !opt.isSet("-i") && !opt.isSet("-o") && !opt.isSet("-w") && !opt.isSet("-e")){
std::cout<<"Invalid option used. Exiting...\n";
DisplayString("Invalid option used. Exiting...\n");
return 1;
}

Expand Down Expand Up @@ -177,23 +179,35 @@ ProcessArgs(int argc, const char * argv[])

inputEnergyFile = assignEFile(input_energyFile);

std::string output_File = input_filename+"_"+input_weatherFile+".csv";
std::string output_AuditFile = input_filename+"_"+input_weatherFile+".audit";
std::string output_BndFile = input_filename+"_"+input_weatherFile+".bnd";
std::string output_DxfFile = input_filename+"_"+input_weatherFile+".dxf";
std::string output_EioFile = input_filename+"_"+input_weatherFile+".eio";
std::string output_EndFile = input_filename+"_"+input_weatherFile+".end";
std::string output_ErrFile = input_filename+"_"+input_weatherFile+".err";
std::string output_EsoFile = input_filename+"_"+input_weatherFile+".eso";
std::string output_MtdFile = input_filename+"_"+input_weatherFile+".mtd";
std::string output_MddFile = input_filename+"_"+input_weatherFile+".mdd";
std::string output_MtrFile = input_filename+"_"+input_weatherFile+".mtr";
std::string output_RddFile = input_filename+"_"+input_weatherFile+".rdd";
std::string output_ShdFile = input_filename+"_"+input_weatherFile+".shd";
std::string output_HtmFile = input_filename+"_"+input_weatherFile+".htm";
std::string output_TabFile = input_filename+"_"+input_weatherFile+".tab";
std::string output_TxtFile = input_filename+"_"+input_weatherFile+".txt";
std::string output_XmlFile = input_filename+"_"+input_weatherFile+".xml";
std::string s = inputFileName;
std::string ss = inputWeatherFile;
std::string delim = ".";

auto start = 0U;

DisplayString("Name of the input file without extension = " + s.substr(start, s.size()-4) + "\n");
DisplayString("Name of the input weather file without extension = " + ss.substr(start, ss.size()-4) + "\n");

std::string fileName_input = s.substr(start, s.size()-4);
std::string fileName_weather = ss.substr(start, ss.size()-4);

std::string output_File = fileName_input+"_"+fileName_weather+".csv";
std::string output_AuditFile = fileName_input+"_"+fileName_weather+".audit";
std::string output_BndFile = fileName_input+"_"+fileName_weather+".bnd";
std::string output_DxfFile = fileName_input+"_"+fileName_weather+".dxf";
std::string output_EioFile = fileName_input+"_"+fileName_weather+".eio";
std::string output_EndFile = fileName_input+"_"+fileName_weather+".end";
std::string output_ErrFile = fileName_input+"_"+fileName_weather+".err";
std::string output_EsoFile = fileName_input+"_"+fileName_weather+".eso";
std::string output_MtdFile = fileName_input+"_"+fileName_weather+".mtd";
std::string output_MddFile = fileName_input+"_"+fileName_weather+".mdd";
std::string output_MtrFile = fileName_input+"_"+fileName_weather+".mtr";
std::string output_RddFile = fileName_input+"_"+fileName_weather+".rdd";
std::string output_ShdFile = fileName_input+"_"+fileName_weather+".shd";
std::string output_HtmFile = fileName_input+"_"+fileName_weather+".htm";
std::string output_TabFile = fileName_input+"_"+fileName_weather+".tab";
std::string output_TxtFile = fileName_input+"_"+fileName_weather+".txt";
std::string output_XmlFile = fileName_input+"_"+fileName_weather+".xml";

if (opt.isSet("-o")) {
std::ofstream output;
Expand Down
20 changes: 10 additions & 10 deletions src/EnergyPlus/OutputReportTabular.cc
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,8 @@ namespace OutputReportTabular {
// Functions
std::string outputFile;
std::string assignOFile(std::string& _OFileName){
std::cout<<"== Module 'Output report tabular'::Name of the output file = "<<_OFileName<<std::endl;
std::cout<<"====================================================================== \n\n";
DisplayString("== Module 'Output report tabular'::Name of the output file = "+_OFileName+ "\n");
DisplayString("====================================================================== \n\n");
return _OFileName;
}

Expand All @@ -422,16 +422,16 @@ namespace OutputReportTabular {
}

std::string assignTabFile(std::string& _TabFileName){
DisplayString("== Module 'Output Report Tabular'::Name of the output (tab) file = " +_TabFileName+ "\n");
DisplayString("====================================================================== \n\n");
return _TabFileName;
}
DisplayString("== Module 'Output Report Tabular'::Name of the output (tab) file = " +_TabFileName+ "\n");
DisplayString("====================================================================== \n\n");
return _TabFileName;
}

std::string assignTxtFile(std::string& _TxtFileName){
DisplayString("== Module 'Output Report Tabular'::Name of the output (txt) file = " +_TxtFileName+ "\n");
DisplayString("====================================================================== \n\n");
return _TxtFileName;
}
DisplayString("== Module 'Output Report Tabular'::Name of the output (txt) file = " +_TxtFileName+ "\n");
DisplayString("====================================================================== \n\n");
return _TxtFileName;
}

std::string assignXmlFile(std::string& _XmlFileName){
DisplayString("== Module 'Output Report Tabular'::Name of the output (xml) file = " +_XmlFileName+ "\n");
Expand Down

4 comments on commit 53e0a03

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1277852-CommandLineInterface (monika0603) - i386-Windows-7-VisualStudio-12: Tests Failed

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1277852-CommandLineInterface (monika0603) - x86_64-Linux-Ubuntu-14.04-gcc-4.8: Tests Failed

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1277852-CommandLineInterface (monika0603) - x86_64-Linux-Ubuntu-14.04-cppcheck-1.61: OK (0 of 0 tests passed)

Build Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1277852-CommandLineInterface (monika0603) - Win64-Windows-7-VisualStudio-12: Tests Failed

Build Badge Test Badge

Please sign in to comment.