From e92386621f8116acdacac8aeb25ebb8f51b458f3 Mon Sep 17 00:00:00 2001
From: Monika Sharma
Date: Thu, 11 Sep 2014 16:45:25 -0600
Subject: [PATCH 01/71] Version 0 for command line interface, Sep 11, 2014
---
src/EnergyPlus/InputProcessor.cc | 57 +-
src/EnergyPlus/InputProcessor.hh | 12 +-
src/EnergyPlus/OutputReportTabular.cc | 12 +-
src/EnergyPlus/OutputReportTabular.hh | 9 +-
src/EnergyPlus/SimulationManager.cc | 18 +-
src/EnergyPlus/SimulationManager.hh | 5 +-
src/EnergyPlus/ThermalComfort.cc | 15 +-
src/EnergyPlus/UtilityRoutines.cc | 9 +-
src/EnergyPlus/WeatherManager.cc | 11 +-
src/EnergyPlus/ezOptionParser.hpp | 2171 +++++++++++++++++++++++++
src/EnergyPlus/main.cc | 303 +++-
src/EnergyPlus/main.hh | 1 +
12 files changed, 2546 insertions(+), 77 deletions(-)
create mode 100755 src/EnergyPlus/ezOptionParser.hpp
diff --git a/src/EnergyPlus/InputProcessor.cc b/src/EnergyPlus/InputProcessor.cc
index 9b4a3f5a5ce..e31134a70bd 100644
--- a/src/EnergyPlus/InputProcessor.cc
+++ b/src/EnergyPlus/InputProcessor.cc
@@ -14,6 +14,9 @@
#include
#include
+//Standard C++ library
+#include
+
namespace EnergyPlus {
namespace InputProcessor {
@@ -45,6 +48,7 @@ namespace InputProcessor {
// USE STATEMENTS:
// Use statements for data only modules
// Using/Aliasing
+
using namespace DataPrecisionGlobals;
using namespace DataStringGlobals;
using DataGlobals::MaxNameLength;
@@ -59,7 +63,8 @@ namespace InputProcessor {
using DataSystemVariables::SortedIDD;
using DataSystemVariables::iASCII_CR;
using DataSystemVariables::iUnicode_end;
-
+
+
// Use statements for access to subroutines in other modules
// Data
@@ -85,6 +90,8 @@ namespace InputProcessor {
Real64 const DefAutoCalculateValue( AutoCalculate );
static gio::Fmt const fmtLD( "*" );
static gio::Fmt const fmtA( "(A)" );
+ std::string inputFileName;
+ std::string inputEnergyFile;
// DERIVED TYPE DEFINITIONS
@@ -163,6 +170,19 @@ namespace InputProcessor {
FArray1D< LineDefinition > IDFRecords; // All the objects read from the IDF
FArray1D< SecretObjects > RepObjects; // Secret Objects that could replace old ones
+ std::string assign(std::string& _FileName){
+ std::cout<<"====================================================================== \n";
+ std::cout<<"== Module 'Input Processor'::Name of the input file = "<<_FileName<> InputLine;
endcol = len( InputLine );
if ( endcol > 0 ) {
if ( int( InputLine[ endcol - 1 ] ) == iUnicode_end ) {
- ShowSevereError( "ProcessInput: \"Energy+.idd\" appears to be a Unicode or binary file." );
+ ShowSevereError( "ProcessInput: " + inputEnergyFile + " appears to be a Unicode or binary file." );
ShowContinueError( "...This file cannot be read by this program. Please save as PC or Unix file and try again" );
ShowFatalError( "Program terminates due to previous condition." );
}
@@ -280,7 +300,7 @@ namespace InputProcessor {
NumLines = 0;
DoingInputProcessing = true;
- gio::write( EchoInputFile, fmtLD ) << " Processing Data Dictionary (Energy+.idd) File -- Start";
+ gio::write( EchoInputFile, fmtLD ) << " Processing Data Dictionary ("+inputEnergyFile+") File -- Start";
DisplayString( "Processing Data Dictionary" );
ProcessingIDD = true;
@@ -310,7 +330,7 @@ namespace InputProcessor {
}
ProcessingIDD = false;
- gio::write( EchoInputFile, fmtLD ) << " Processing Data Dictionary (Energy+.idd) File -- Complete";
+ gio::write( EchoInputFile, fmtLD ) << " Processing Data Dictionary ("+inputEnergyFile+") File -- Complete";
gio::write( EchoInputFile, fmtLD ) << " Maximum number of Alpha Args=" << MaxAlphaArgsFound;
gio::write( EchoInputFile, fmtLD ) << " Maximum number of Numeric Args=" << MaxNumericArgsFound;
@@ -320,25 +340,25 @@ namespace InputProcessor {
gio::write( EchoInputFile, fmtLD ) << " Total Number of Numeric Fields=" << NumNumericArgsFound;
gio::write( EchoInputFile, fmtLD ) << " Total Number of Fields=" << NumAlphaArgsFound + NumNumericArgsFound;
- gio::write( EchoInputFile, fmtLD ) << " Processing Input Data File (in.idf) -- Start";
+ gio::write( EchoInputFile, fmtLD ) << " Processing Input Data File (inputFileName) -- Start";
- { IOFlags flags; gio::inquire( "in.idf", flags ); FileExists = flags.exists(); }
+ { IOFlags flags; gio::inquire( inputFileName, flags ); FileExists = flags.exists(); }
if ( ! FileExists ) {
- DisplayString( "Missing " + CurrentWorkingFolder + "in.idf" );
- ShowFatalError( "ProcessInput: in.idf missing. Program terminates." );
+ DisplayString( "Missing " + CurrentWorkingFolder + inputFileName );
+ ShowFatalError( "ProcessInput: " + inputFileName + " missing. Program terminates." );
}
IDFFile = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "READ" ); gio::open( IDFFile, "in.idf", flags ); read_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "READ" ); gio::open( IDFFile, inputFileName, flags ); read_stat = flags.ios(); }
if ( read_stat != 0 ) {
- DisplayString( "Could not open (read) in.idf." );
+ DisplayString( "Could not open (read)" + inputFileName );
ShowFatalError( "ProcessInput: Could not open file \"in.idf\" for input (read)." );
}
gio::read( IDFFile, fmtA ) >> InputLine;
endcol = len( InputLine );
if ( endcol > 0 ) {
if ( int( InputLine[ endcol - 1 ] ) == iUnicode_end ) {
- ShowSevereError( "ProcessInput: \"in.idf\" appears to be a Unicode or binary file." );
+ ShowSevereError( "ProcessInput: " + inputFileName +" appears to be a Unicode or binary file." );
ShowContinueError( "...This file cannot be read by this program. Please save as PC or Unix file and try again" );
ShowFatalError( "Program terminates due to previous condition." );
}
@@ -6153,7 +6173,7 @@ namespace InputProcessor {
// NOTICE
- // Copyright © 1996-2014 The Board of Trustees of the University of Illinois
+ // Copyright � 1996-2014 The Board of Trustees of the University of Illinois
// and The Regents of the University of California through Ernest Orlando Lawrence
// Berkeley National Laboratory. All rights reserved.
@@ -6177,3 +6197,4 @@ namespace InputProcessor {
} // InputProcessor
} // EnergyPlus
+
diff --git a/src/EnergyPlus/InputProcessor.hh b/src/EnergyPlus/InputProcessor.hh
index 858183c1902..fa87882eb93 100644
--- a/src/EnergyPlus/InputProcessor.hh
+++ b/src/EnergyPlus/InputProcessor.hh
@@ -89,7 +89,9 @@ namespace InputProcessor {
extern std::string CurrentFieldName; // Current Field Name (IDD)
extern FArray1D_string ObsoleteObjectsRepNames; // Array of Replacement names for Obsolete objects
extern std::string ReplacementName;
-
+ extern std::string inputFileName;
+ extern std::string inputEnergyFile;
+
//Logical Variables for Module
extern bool OverallErrorFlag; // If errors found during parse of IDF, will fatal at end
extern bool EchoInputLine; // Usually True, if the IDD is backspaced, then is set to false, then back to true
@@ -407,9 +409,11 @@ namespace InputProcessor {
extern LineDefinition LineItem; // Description of current record
extern FArray1D< LineDefinition > IDFRecords; // All the objects read from the IDF
extern FArray1D< SecretObjects > RepObjects; // Secret Objects that could replace old ones
-
+
// Functions
-
+ std::string assign(std::string& _FileName);
+ std::string assignEFile(std::string& _EFileName);
+
void
ProcessInput();
@@ -867,7 +871,7 @@ namespace InputProcessor {
// NOTICE
- // Copyright © 1996-2014 The Board of Trustees of the University of Illinois
+ // Copyright � 1996-2014 The Board of Trustees of the University of Illinois
// and The Regents of the University of California through Ernest Orlando Lawrence
// Berkeley National Laboratory. All rights reserved.
diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc
index b4ca6d906ba..fc663f71c86 100644
--- a/src/EnergyPlus/OutputReportTabular.cc
+++ b/src/EnergyPlus/OutputReportTabular.cc
@@ -406,7 +406,13 @@ namespace OutputReportTabular {
static gio::Fmt const fmtA( "(A)" );
// Functions
-
+ std::string outputFile;
+ std::string assignOFile(std::string& _OFileName){
+ std::cout<<"== Module 'Output report tabular'::Name of the output file = "<<_OFileName< UnitConv;
// Functions
-
+
void
UpdateTabularReports( int const IndexTypeKey ); // What kind of data to update (Zone, HVAC)
@@ -736,6 +740,7 @@ namespace OutputReportTabular {
//======================================================================================================================
//======================================================================================================================
+
void
GetInputTabularMonthly();
@@ -1063,7 +1068,7 @@ namespace OutputReportTabular {
// NOTICE
- // Copyright © 1996-2014 The Board of Trustees of the University of Illinois
+ // Copyright � 1996-2014 The Board of Trustees of the University of Illinois
// and The Regents of the University of
// Berkeley National Laboratory. All rights reserved.
diff --git a/src/EnergyPlus/SimulationManager.cc b/src/EnergyPlus/SimulationManager.cc
index 3011e78e12a..4262bdbc81d 100644
--- a/src/EnergyPlus/SimulationManager.cc
+++ b/src/EnergyPlus/SimulationManager.cc
@@ -149,6 +149,14 @@ namespace SimulationManager {
// MODULE SUBROUTINES:
// Functions
+ std::string inputWeatherFile;
+
+ std::string assignWFile(std::string& _WFileName){
+ std::cout<<"====================================================================== \n";
+ std::cout<<"== Module 'Manage Simulation'::Name of the weather file = "<<_WFileName<
#include
#include
+#include
#include
namespace EnergyPlus {
@@ -2467,7 +2468,7 @@ namespace ThermalComfort {
if ( initiate && weathersimulation ) {
{ IOFlags flags; gio::inquire( "in.stat", flags ); statFileExists = flags.exists(); }
- { IOFlags flags; gio::inquire( "in.epw", flags ); epwFileExists = flags.exists(); }
+ { IOFlags flags; gio::inquire( SimulationManager::inputWeatherFile, flags ); epwFileExists = flags.exists(); }
readStat = 0;
if ( statFileExists ) {
statFile = GetNewUnitNumber();
@@ -2492,9 +2493,9 @@ namespace ThermalComfort {
useStatData = true;
} else if ( epwFileExists ) {
epwFile = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "READ" ); gio::open( epwFile, "in.epw", flags ); readStat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "READ" ); gio::open( epwFile, SimulationManager::inputWeatherFile, flags ); readStat = flags.ios(); }
if ( readStat != 0 ) {
- ShowFatalError( "CalcThermalComfortAdaptiveASH55: Could not open file \"in.epw\" for input (read)." );
+ ShowFatalError( "CalcThermalComfortAdaptiveASH55: Could not open file " +SimulationManager::inputWeatherFile+ " for input (read)." );
}
for ( i = 1; i <= 9; ++i ) { // Headers
{ IOFlags flags; gio::read( epwFile, fmtA, flags ); readStat = flags.ios(); }
@@ -2718,13 +2719,13 @@ namespace ThermalComfort {
}
if ( initiate && weathersimulation ) {
- { IOFlags flags; gio::inquire( "in.epw", flags ); epwFileExists = flags.exists(); }
+ { IOFlags flags; gio::inquire( SimulationManager::inputWeatherFile, flags ); epwFileExists = flags.exists(); }
readStat = 0;
if ( epwFileExists ) {
epwFile = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "READ" ); gio::open( epwFile, "in.epw", flags ); readStat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "READ" ); gio::open( epwFile, SimulationManager::inputWeatherFile, flags ); readStat = flags.ios(); }
if ( readStat != 0 ) {
- ShowFatalError( "CalcThermalComfortAdaptiveCEN15251: Could not open file \"in.epw\" for input (read)." );
+ ShowFatalError( "CalcThermalComfortAdaptiveCEN15251: Could not open file "+SimulationManager::inputWeatherFile+" for input (read)." );
}
for ( i = 1; i <= 9; ++i ) { // Headers
{ IOFlags flags; gio::read( epwFile, fmtA, flags ); readStat = flags.ios(); }
@@ -2928,7 +2929,7 @@ namespace ThermalComfort {
// NOTICE
- // Copyright © 1996-2014 The Board of Trustees of the University of Illinois
+ // Copyright � 1996-2014 The Board of Trustees of the University of Illinois
// and The Regents of the University of California through Ernest Orlando Lawrence
// Berkeley National Laboratory. All rights reserved.
diff --git a/src/EnergyPlus/UtilityRoutines.cc b/src/EnergyPlus/UtilityRoutines.cc
index 80d45d785fb..0578cb2993c 100644
--- a/src/EnergyPlus/UtilityRoutines.cc
+++ b/src/EnergyPlus/UtilityRoutines.cc
@@ -27,6 +27,7 @@
#include
#include
#include
+#include //Added to pass inputEnergyFile (MS)
#include
#include
#include
@@ -166,12 +167,12 @@ AbortEnergyPlus(
strip( NumSevereDuringSizing );
if ( NoIDD ) {
- DisplayString( "No EnergyPlus Data Dictionary (Energy+.idd) was found. It is possible " );
+ DisplayString( "No EnergyPlus Data Dictionary (" +InputProcessor::inputEnergyFile+") was found. It is possible " );
DisplayString( "you \"double-clicked\"EnergyPlus.exe rather than using one of the methods" );
DisplayString( "to run Energyplus as found in the GettingStarted document in the" );
DisplayString( "documentation folder. Using EP-Launch may be best -- " );
DisplayString( "it provides extra help for new users." );
- ShowMessage( "No EnergyPlus Data Dictionary (Energy+.idd) was found. It is possible you \"double-clicked\" EnergyPlus.exe " );
+ ShowMessage( "No EnergyPlus Data Dictionary (" +InputProcessor::inputEnergyFile+") was found. It is possible you \"double-clicked\" EnergyPlus.exe " );
ShowMessage( "rather than using one of the methods to run Energyplus as found in the GettingStarted document" );
ShowMessage( "in the documentation folder. Using EP-Launch may be best -- it provides extra help for new users." );
{ IOFlags flags; flags.ADVANCE( "NO" ); gio::write( OutFmt, flags ); }
@@ -829,7 +830,7 @@ ShowFatalError(
ShowErrorMessage( " ** Fatal ** " + ErrorMessage, OutUnit1, OutUnit2 );
DisplayString( "**FATAL:" + ErrorMessage );
if ( has( ErrorMessage, "in.idf missing" ) ) NoIdf = true;
- if ( has( ErrorMessage, "Energy+.idd missing" ) ) NoIDD = true;
+ if ( has( ErrorMessage, InputProcessor::inputEnergyFile +" missing" ) ) NoIDD = true;
ShowErrorMessage( " ...Summary of Errors that led to program termination:", OutUnit1, OutUnit2 );
ShowErrorMessage( " ..... Reference severe error count=" + RoundSigDigits( TotalSevereErrors ), OutUnit1, OutUnit2 );
ShowErrorMessage( " ..... Last severe error=" + LastSevereError, OutUnit1, OutUnit2 );
@@ -1785,7 +1786,7 @@ ShowRecurringErrors()
}
// NOTICE
-// Copyright © 1996-2014 The Board of Trustees of the University of Illinois
+// Copyright � 1996-2014 The Board of Trustees of the University of Illinois
// and The Regents of the University of California through Ernest Orlando Lawrence
// Berkeley National Laboratory. All rights reserved.
// Portions of the EnergyPlus software package have been developed and copyrighted
diff --git a/src/EnergyPlus/WeatherManager.cc b/src/EnergyPlus/WeatherManager.cc
index 1e444a4a45d..613283b54d3 100644
--- a/src/EnergyPlus/WeatherManager.cc
+++ b/src/EnergyPlus/WeatherManager.cc
@@ -25,6 +25,7 @@
#include
#include
#include
+#include
#include
#include
@@ -4389,7 +4390,7 @@ Label903: ;
// FLOW:
- { IOFlags flags; gio::inquire( "in.epw", flags ); WeatherFileExists = flags.exists(); }
+ { IOFlags flags; gio::inquire( SimulationManager::inputWeatherFile, flags ); WeatherFileExists = flags.exists(); }
if ( WeatherFileExists ) {
OpenEPlusWeatherFile( ErrorsFound, true );
@@ -4442,11 +4443,11 @@ Label903: ;
bool EPWOpen;
int unitnumber;
- { IOFlags flags; gio::inquire( "in.epw", flags ); unitnumber = flags.unit(); EPWOpen = flags.open(); }
+ { IOFlags flags; gio::inquire( SimulationManager::inputWeatherFile, flags ); unitnumber = flags.unit(); EPWOpen = flags.open(); }
if ( EPWOpen ) gio::close( unitnumber );
WeatherFileUnitNumber = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "read" ); gio::open( WeatherFileUnitNumber, "in.epw", flags ); if ( flags.err() ) goto Label9999; }
+ { IOFlags flags; flags.ACTION( "read" ); gio::open( WeatherFileUnitNumber, SimulationManager::inputWeatherFile, flags ); if ( flags.err() ) goto Label9999; }
if ( ProcessHeader ) {
// Read in Header Information
@@ -4530,7 +4531,7 @@ Label9999: ;
// Make sure it's open
- { IOFlags flags; gio::inquire( "in.epw", flags ); unitnumber = flags.unit(); EPWOpen = flags.open(); }
+ { IOFlags flags; gio::inquire( SimulationManager::inputWeatherFile, flags ); unitnumber = flags.unit(); EPWOpen = flags.open(); }
if ( EPWOpen ) gio::close( unitnumber );
}
@@ -9466,7 +9467,7 @@ Label9998: ;
// NOTICE
- // Copyright © 1996-2014 The Board of Trustees of the University of Illinois
+ // Copyright � 1996-2014 The Board of Trustees of the University of Illinois
// and The Regents of the University of California through Ernest Orlando Lawrence
// Berkeley National Laboratory. All rights reserved.
diff --git a/src/EnergyPlus/ezOptionParser.hpp b/src/EnergyPlus/ezOptionParser.hpp
new file mode 100755
index 00000000000..2593fdefc4c
--- /dev/null
+++ b/src/EnergyPlus/ezOptionParser.hpp
@@ -0,0 +1,2171 @@
+/*
+This file is part of ezOptionParser. See MIT-LICENSE.
+
+Copyright (C) 2011,2012,2014 Remik Ziemlinski
+
+CHANGELOG
+
+v0.0.0 20110505 rsz Created.
+v0.1.0 20111006 rsz Added validator.
+v0.1.1 20111012 rsz Fixed validation of ulonglong.
+v0.1.2 20111126 rsz Allow flag names start with alphanumeric (previously, flag had to start with alpha).
+v0.1.3 20120108 rsz Created work-around for unique id generation with IDGenerator that avoids retarded c++ translation unit linker errors with single-header static variables. Forced inline on all methods to please retard compiler and avoid multiple def errors.
+v0.1.4 20120629 Enforced MIT license on all files.
+v0.2.0 20121120 Added parseIndex to OptionGroup.
+v0.2.1 20130506 Allow disabling doublespace of OPTIONS usage descriptions.
+v0.2.2 20140504 Jose Santiago added compiler warning fixes.
+ Bruce Shankle added a crash fix in description printing.
+*/
+#ifndef EZ_OPTION_PARSER_H
+#define EZ_OPTION_PARSER_H
+
+#include
+#include
+#include
+#include
";
} else if ( TableStyle( iStyle ) == tableStyleXML ) {
DisplayString( "Writing tabular output file results using XML format." );
- { IOFlags flags; flags.ACTION( "WRITE" ); gio::open( curFH, "eplustbl.xml", flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "WRITE" ); gio::open( curFH, outputXmlFile, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( "OpenOutputTabularFile: Could not open file \"eplustbl.xml\" for output (write)." );
+ ShowFatalError( "OpenOutputTabularFile: Could not open file "+outputXmlFile+" for output (write)." );
}
gio::write( curFH, fmtA ) << "";
gio::write( curFH, fmtA ) << "";
@@ -3199,9 +3225,9 @@ namespace OutputReportTabular {
gio::write( curFH );
} else {
DisplayString( "Writing tabular output file results using text format." );
- { IOFlags flags; flags.ACTION( "write" ); gio::open( curFH, "eplustbl.txt", flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( curFH, outputTxtFile, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( "OpenOutputTabularFile: Could not open file \"eplustbl.txt\" for output (write)." );
+ ShowFatalError( "OpenOutputTabularFile: Could not open file "+outputTxtFile+" for output (write)." );
}
gio::write( curFH, fmtA ) << "Program Version: " + VerString;
gio::write( curFH, fmtA ) << "Tabular Output Report in Format: " + curDel + "Fixed";
@@ -4809,6 +4835,7 @@ namespace OutputReportTabular {
// report is added it can be added to the list here.
// Locals
+
int EchoInputFile; // found unit number for 'eplusout.audit'
FillWeatherPredefinedEntries();
@@ -4831,7 +4858,7 @@ namespace OutputReportTabular {
WriteTimeBinTables();
}
}
- EchoInputFile = FindUnitNumber( "eplusout.audit" );
+ EchoInputFile = FindUnitNumber( CommandLineInterface::outputAuditFile );
gio::write( EchoInputFile, fmtLD ) << "MonthlyInputCount=" << MonthlyInputCount;
gio::write( EchoInputFile, fmtLD ) << "sizeMonthlyInput=" << sizeMonthlyInput;
gio::write( EchoInputFile, fmtLD ) << "MonthlyFieldSetInputCount=" << MonthlyFieldSetInputCount;
diff --git a/src/EnergyPlus/OutputReportTabular.hh b/src/EnergyPlus/OutputReportTabular.hh
index 788673281fb..4139d973907 100644
--- a/src/EnergyPlus/OutputReportTabular.hh
+++ b/src/EnergyPlus/OutputReportTabular.hh
@@ -22,6 +22,10 @@ namespace OutputReportTabular {
extern std::string outputFile;
std::string assignOFile(std::string& _OFileName);
+ std::string assignHtmFile(std::string& _HtmFileName);
+ std::string assignTabFile(std::string& _TabFileName);
+ std::string assignTxtFile(std::string& _TxtFileName);
+ std::string assignXmlFile(std::string& _XmlFileName);
// Using/Aliasing
diff --git a/src/EnergyPlus/OutputReports.cc b/src/EnergyPlus/OutputReports.cc
index eaf4d324fe0..ee292db3800 100644
--- a/src/EnergyPlus/OutputReports.cc
+++ b/src/EnergyPlus/OutputReports.cc
@@ -9,12 +9,14 @@
#include
// EnergyPlus Headers
+#include
#include
#include
#include
#include
#include
#include
+#include
#include
#include
#include
@@ -25,8 +27,15 @@
namespace EnergyPlus {
+using namespace CommandLineInterface;
static gio::Fmt const fmtLD( "*" );
+std::string assignDxfFile(std::string& _DxfFileName){
+ DisplayString("== Module 'Output Reports'::Name of the output (dxf) file = " + _DxfFileName + "\n");
+ DisplayString("====================================================================== \n\n");
+ return _DxfFileName;
+ }
+
void
ReportSurfaces()
{
@@ -420,9 +429,9 @@ DXFOut(
}
unit = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); gio::open( unit, "eplusout.dxf", flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( unit, outputDxfFile, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( "DXFOut: Could not open file \"eplusout.dxf\" for output (write)." );
+ ShowFatalError( "DXFOut: Could not open file "+outputDxfFile+" for output (write)." );
}
gio::write( unit, Format_702 ); // Start of Entities section
@@ -913,9 +922,9 @@ DXFOutLines( std::string const & ColorScheme )
}
unit = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); gio::open( unit, "eplusout.dxf", flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( unit, outputDxfFile, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( "DXFOutLines: Could not open file \"eplusout.dxf\" for output (write)." );
+ ShowFatalError( "DXFOutLines: Could not open file "+outputDxfFile+" for output (write)." );
}
gio::write( unit, Format_702 ); // Start of Entities section
@@ -1340,9 +1349,9 @@ DXFOutWireFrame( std::string const & ColorScheme )
}
unit = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); gio::open( unit, "eplusout.dxf", flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( unit, outputDxfFile, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( "DXFOutWireFrame: Could not open file \"eplusout.dxf\" for output (write)." );
+ ShowFatalError( "DXFOutWireFrame: Could not open file "+outputDxfFile+" for output (write)." );
}
gio::write( unit, Format_702 ); // Start of Entities section
diff --git a/src/EnergyPlus/OutputReports.hh b/src/EnergyPlus/OutputReports.hh
index 3aedd06b25a..23260c02612 100644
--- a/src/EnergyPlus/OutputReports.hh
+++ b/src/EnergyPlus/OutputReports.hh
@@ -9,6 +9,8 @@
namespace EnergyPlus {
+std::string assignDxfFile(std::string& _DxfFileName);
+
void
ReportSurfaces();
diff --git a/src/EnergyPlus/Psychrometrics.cc b/src/EnergyPlus/Psychrometrics.cc
index a5a32b1eaf1..57dc0803960 100644
--- a/src/EnergyPlus/Psychrometrics.cc
+++ b/src/EnergyPlus/Psychrometrics.cc
@@ -9,6 +9,7 @@
#include
// EnergyPlus Headers
+#include
#include
#include
#include
@@ -50,6 +51,7 @@ namespace Psychrometrics {
// more research on hfg calc
// Using/Aliasing
+ using namespace CommandLineInterface;
using namespace DataPrecisionGlobals;
#ifdef EP_psych_errors
using namespace DataGlobals;
@@ -220,7 +222,7 @@ namespace Psychrometrics {
Real64 AverageIterations;
std::string istring;
- EchoInputFile = FindUnitNumber( "eplusout.audit" );
+ EchoInputFile = FindUnitNumber( CommandLineInterface::outputAuditFile );
if ( EchoInputFile == 0 ) return;
if ( any_gt( NumTimesCalled, 0 ) ) {
gio::write( EchoInputFile, fmtA ) << "RoutineName,#times Called,Avg Iterations";
diff --git a/src/EnergyPlus/ScheduleManager.cc b/src/EnergyPlus/ScheduleManager.cc
index 3a6dc18ecf1..7d540cc6c81 100644
--- a/src/EnergyPlus/ScheduleManager.cc
+++ b/src/EnergyPlus/ScheduleManager.cc
@@ -5,6 +5,7 @@
#include
// EnergyPlus Headers
+#include
#include
#include
#include
@@ -46,6 +47,7 @@ namespace ScheduleManager {
// OTHER NOTES:
// Using/Aliasing
+ using namespace CommandLineInterface;
using namespace DataPrecisionGlobals;
using DataGlobals::HourOfDay;
using DataGlobals::OutputFileInits;
@@ -472,7 +474,7 @@ namespace ScheduleManager {
Schedule( 0 ).ScheduleTypePtr = 0;
Schedule( 0 ).WeekSchedulePointer = 0;
- UnitNumber = FindUnitNumber( "eplusout.audit" );
+ UnitNumber = FindUnitNumber( CommandLineInterface::outputAuditFile );
gio::write( UnitNumber, fmtLD ) << " Processing Schedule Input -- Start";
//!! Get Schedule Types
diff --git a/src/EnergyPlus/SimulationManager.cc b/src/EnergyPlus/SimulationManager.cc
index 4262bdbc81d..ec1781063c0 100644
--- a/src/EnergyPlus/SimulationManager.cc
+++ b/src/EnergyPlus/SimulationManager.cc
@@ -11,6 +11,7 @@
#include
// EnergyPlus Headers
+#include
#include
#include
#include
@@ -119,6 +120,8 @@ namespace SimulationManager {
// and internal Evolutionary Engineering documentation.
// Using/Aliasing
+
+ using namespace CommandLineInterface;
using namespace DataPrecisionGlobals;
using namespace DataGlobals;
using namespace DataSizing;
@@ -152,12 +155,36 @@ namespace SimulationManager {
std::string inputWeatherFile;
std::string assignWFile(std::string& _WFileName){
- std::cout<<"====================================================================== \n";
- std::cout<<"== Module 'Manage Simulation'::Name of the weather file = "<<_WFileName<
// EnergyPlus Headers
+#include
#include
#include
#include
@@ -80,6 +81,7 @@ namespace SolarShading {
// na
// Using/Aliasing
+ using namespace CommandLineInterface;
using namespace DataPrecisionGlobals;
using namespace DataGlobals;
using namespace DataEnvironment;
@@ -208,6 +210,12 @@ namespace SolarShading {
// Functions
+ std::string assignShdFile(std::string& _ShdFileName){
+ DisplayString("== Module 'Solar shading'::Name of the output (shd) file = " +_ShdFileName+ "\n");
+ DisplayString("====================================================================== \n\n");
+ return _ShdFileName;
+ }
+
void
InitSolarCalculations()
{
diff --git a/src/EnergyPlus/SolarShading.hh b/src/EnergyPlus/SolarShading.hh
index cc047ea23a1..4c8bb0a829c 100644
--- a/src/EnergyPlus/SolarShading.hh
+++ b/src/EnergyPlus/SolarShading.hh
@@ -120,6 +120,7 @@ namespace SolarShading {
extern FArray1D< Real64 > YTEMP1; // Temporary 'Y' values for HC vertices of the overlap
extern int maxNumberOfFigures;
+ std::string assignShdFile(std::string& _ShdFileName);
// SUBROUTINE SPECIFICATIONS FOR MODULE SolarShading
// Types
diff --git a/src/EnergyPlus/UtilityRoutines.cc b/src/EnergyPlus/UtilityRoutines.cc
index 0578cb2993c..1d63905f4c2 100644
--- a/src/EnergyPlus/UtilityRoutines.cc
+++ b/src/EnergyPlus/UtilityRoutines.cc
@@ -14,6 +14,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -39,6 +40,20 @@
namespace EnergyPlus {
+// Functions
+ std::string assignEndFile(std::string& _EndFileName){
+ DisplayString("== Module 'Utility Routines'::Name of the output (end) file = " + _EndFileName + "\n");
+ DisplayString("====================================================================== \n\n");
+ return _EndFileName;
+ }
+
+ std::string assignErrFile(std::string& _ErrFileName){
+ DisplayString("== Module 'Utility Routines'::Name of the output (err) file = " + _ErrFileName + "\n");
+ DisplayString("====================================================================== \n\n");
+ return _ErrFileName;
+ }
+
+
void
AbortEnergyPlus(
bool const NoIdf, // Set to true when "noidf" was found
@@ -64,6 +79,7 @@ AbortEnergyPlus(
// na
// Using/Aliasing
+ using namespace CommandLineInterface;
using namespace DataPrecisionGlobals;
using namespace DataSystemVariables;
using namespace DataTimings;
@@ -212,9 +228,9 @@ AbortEnergyPlus(
ShowMessage( "EnergyPlus Terminated--Fatal Error Detected. " + NumWarnings + " Warning; " + NumSevere + " Severe Errors; Elapsed Time=" + Elapsed );
DisplayString( "EnergyPlus Run Time=" + Elapsed );
tempfl = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); gio::open( tempfl, "eplusout.end", flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( tempfl, CommandLineInterface::outputEndFile, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- DisplayString( "AbortEnergyPlus: Could not open file \"eplusout.end\" for output (write)." );
+ DisplayString( "AbortEnergyPlus: Could not open file "+ CommandLineInterface::outputEndFile +" for output (write)." );
}
gio::write( tempfl, fmtLD ) << "EnergyPlus Terminated--Fatal Error Detected. " + NumWarnings + " Warning; " + NumSevere + " Severe Errors; Elapsed Time=" + Elapsed;
@@ -444,9 +460,9 @@ EndEnergyPlus()
ShowMessage( "EnergyPlus Completed Successfully-- " + NumWarnings + " Warning; " + NumSevere + " Severe Errors; Elapsed Time=" + Elapsed );
DisplayString( "EnergyPlus Run Time=" + Elapsed );
tempfl = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); gio::open( tempfl, "eplusout.end", flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( tempfl, CommandLineInterface::outputEndFile, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- DisplayString( "EndEnergyPlus: Could not open file \"eplusout.end\" for output (write)." );
+ DisplayString( "EndEnergyPlus: Could not open file " + CommandLineInterface::outputEndFile + " for output (write)." );
}
gio::write( tempfl, fmtA ) << "EnergyPlus Completed Successfully-- " + NumWarnings + " Warning; " + NumSevere + " Severe Errors; Elapsed Time=" + Elapsed;
gio::close( tempfl );
@@ -1597,10 +1613,10 @@ ShowErrorMessage(
if ( TotalErrors == 0 && ! ErrFileOpened ) {
StandardErrorOutput = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); gio::open( StandardErrorOutput, "eplusout.err", flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( StandardErrorOutput, CommandLineInterface::outputErrFile, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
DisplayString( "Trying to display error: \"" + ErrorMessage + "\"" );
- ShowFatalError( "ShowErrorMessage: Could not open file \"eplusout.err\" for output (write)." );
+ ShowFatalError( "ShowErrorMessage: Could not open file "+CommandLineInterface::outputErrFile+" for output (write)." );
}
gio::write( StandardErrorOutput, fmtA ) << "Program Version," + VerString + ',' + IDDVerString;
ErrFileOpened = true;
diff --git a/src/EnergyPlus/UtilityRoutines.hh b/src/EnergyPlus/UtilityRoutines.hh
index 33d62a4c0f7..2fe1cf28c01 100644
--- a/src/EnergyPlus/UtilityRoutines.hh
+++ b/src/EnergyPlus/UtilityRoutines.hh
@@ -9,6 +9,9 @@
namespace EnergyPlus {
+std::string assignEndFile(std::string& _EndFileName);
+std::string assignErrFile(std::string& _ErrFileName);
+
void
AbortEnergyPlus(
bool const NoIdf, // Set to true when "noidf" was found
diff --git a/src/EnergyPlus/main.cc b/src/EnergyPlus/main.cc
index 61d4e59eb7e..7b85cb1eae1 100644
--- a/src/EnergyPlus/main.cc
+++ b/src/EnergyPlus/main.cc
@@ -215,7 +215,7 @@ main(int argc, const char * argv[])
using FluidProperties::ReportOrphanFluids;
using Psychrometrics::ShowPsychrometricSummary;
// CLI module
- using namespace options;
+ using namespace CommandLineInterface;
int status = 0;
status = ProcessArgs(argc, argv);
@@ -335,12 +335,12 @@ main(int argc, const char * argv[])
get_environment_variable( TraceHVACControllerEnvVar, cEnvValue );
if ( ! cEnvValue.empty() ) TraceHVACControllerEnvFlag = env_var_on( cEnvValue ); // Yes or True
- { IOFlags flags; gio::inquire( "eplusout.end", flags ); FileExists = flags.exists(); }
+ { IOFlags flags; gio::inquire( outputEndFile, flags ); FileExists = flags.exists(); }
if ( FileExists ) {
LFN = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "read" ); gio::open( LFN, "eplusout.end", flags ); iostatus = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "read" ); gio::open( LFN, outputEndFile, flags ); iostatus = flags.ios(); }
if ( iostatus != 0 ) {
- ShowFatalError( "EnergyPlus: Could not open file \"eplusout.end\" for input (read)." );
+ ShowFatalError( "EnergyPlus: Could not open file "+ outputEndFile +" for input (read)." );
}
{ IOFlags flags; flags.DISPOSE( "delete" ); gio::close( LFN, flags ); }
}
diff --git a/third_party/CLI/ezOptionParser.hpp b/third_party/CLI/ezOptionParser.hpp
index e76d606caca..b7a93def6e0 100644
--- a/third_party/CLI/ezOptionParser.hpp
+++ b/third_party/CLI/ezOptionParser.hpp
@@ -1963,7 +1963,7 @@ bool ezOptionParser::gotRequired(std::vector & badOptions) {
for(i=0; i < (long int)groups.size(); ++i) {
OptionGroup *g = groups[i];
// Simple case when required but user never set it.
- if (g->isRequired && (!g->isSet)) {
+ if (g->isRequired && (!g->isSet)) {
badOptions.push_back(*g->flags[0]);
continue;
}
From 29a732af248c0fe4f6119b9c5e709d1f9563f349 Mon Sep 17 00:00:00 2001
From: Monika Sharma
Date: Fri, 19 Sep 2014 10:20:13 -0600
Subject: [PATCH 08/71] Typo fixed
---
src/EnergyPlus/SolarShading.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc
index 65e14acd25e..db2e4a85f0a 100644
--- a/src/EnergyPlus/SolarShading.cc
+++ b/src/EnergyPlus/SolarShading.cc
@@ -262,9 +262,9 @@ namespace SolarShading {
if ( BeginSimFlag ) {
OutputFileShading = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); gio::open( OutputFileShading, "eplusout.shd", flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( OutputFileShading, outputShdFile, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( "InitSolarCalculations: Could not open file \"eplustbl.shd\" for output (write)." );
+ ShowFatalError( "InitSolarCalculations: Could not open file "+outputShdFile+" for output (write)." );
}
if ( GetInputFlag ) {
From 53e0a0361c97407923bc14450181d5f708c7a4a4 Mon Sep 17 00:00:00 2001
From: Monika Sharma
Date: Fri, 19 Sep 2014 11:48:26 -0600
Subject: [PATCH 09/71] Output files will be names without extension idf and
epw
---
src/EnergyPlus/CommandLineInterface.cc | 50 ++++++++++++++++----------
src/EnergyPlus/OutputReportTabular.cc | 20 +++++------
2 files changed, 42 insertions(+), 28 deletions(-)
diff --git a/src/EnergyPlus/CommandLineInterface.cc b/src/EnergyPlus/CommandLineInterface.cc
index f9b287f892f..7155d4447f1 100644
--- a/src/EnergyPlus/CommandLineInterface.cc
+++ b/src/EnergyPlus/CommandLineInterface.cc
@@ -1,3 +1,5 @@
+//Standard C++ library
+#include
// CLI Headers
#include
@@ -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;
}
@@ -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;
diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc
index 0da7a6dc2aa..127b98f5a61 100644
--- a/src/EnergyPlus/OutputReportTabular.cc
+++ b/src/EnergyPlus/OutputReportTabular.cc
@@ -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<
Date: Fri, 19 Sep 2014 18:00:17 -0600
Subject: [PATCH 10/71] Clean up Command Line Interface to have minimal changes
in other files.
---
src/EnergyPlus/CommandLineInterface.cc | 419 +++++++++----------------
src/EnergyPlus/CommandLineInterface.hh | 4 +
src/EnergyPlus/DataSystemVariables.cc | 2 +-
src/EnergyPlus/InputProcessor.cc | 39 +--
src/EnergyPlus/InputProcessor.hh | 13 +-
src/EnergyPlus/OutputProcessor.cc | 23 +-
src/EnergyPlus/OutputProcessor.hh | 4 -
src/EnergyPlus/OutputReportTabular.cc | 37 +--
src/EnergyPlus/OutputReportTabular.hh | 13 +-
src/EnergyPlus/OutputReports.cc | 7 -
src/EnergyPlus/OutputReports.hh | 2 -
src/EnergyPlus/Psychrometrics.cc | 2 +-
src/EnergyPlus/ScheduleManager.cc | 2 +-
src/EnergyPlus/SimulationManager.cc | 46 +--
src/EnergyPlus/SimulationManager.hh | 9 +-
src/EnergyPlus/SolarShading.cc | 6 -
src/EnergyPlus/SolarShading.hh | 1 -
src/EnergyPlus/ThermalComfort.cc | 17 +-
src/EnergyPlus/UtilityRoutines.cc | 38 +--
src/EnergyPlus/UtilityRoutines.hh | 3 -
src/EnergyPlus/WeatherManager.cc | 13 +-
src/EnergyPlus/main.cc | 7 +-
src/EnergyPlus/main.hh | 1 -
23 files changed, 203 insertions(+), 505 deletions(-)
diff --git a/src/EnergyPlus/CommandLineInterface.cc b/src/EnergyPlus/CommandLineInterface.cc
index 7155d4447f1..555216d2c64 100644
--- a/src/EnergyPlus/CommandLineInterface.cc
+++ b/src/EnergyPlus/CommandLineInterface.cc
@@ -1,9 +1,10 @@
//Standard C++ library
#include
+#include
+#include
// CLI Headers
#include
-#include
// Project headers
#include
@@ -17,298 +18,160 @@
#include
#include
#include
-using namespace ez;
namespace EnergyPlus{
namespace CommandLineInterface{
-using namespace DataStringGlobals;
-using namespace InputProcessor;
-using namespace SimulationManager;
-using namespace OutputReportTabular;
-using namespace OutputProcessor;
-using namespace SolarShading;
-
-std::string outputAuditFile;
-std::string outputBndFile;
-std::string outputDxfFile;
-std::string outputEioFile;
-std::string outputEndFile;
-std::string outputErrFile;
-std::string outputEsoFile;
-std::string outputMtdFile;
-std::string outputMddFile;
-std::string outputMtrFile;
-std::string outputRddFile;
-std::string outputShdFile;
-std::string outputHtmFile;
-std::string outputTabFile;
-std::string outputTxtFile;
-std::string outputXmlFile;
-
-void Usage(ezOptionParser& opt) {
- std::string usage;
- opt.getUsage(usage);
- DisplayString(usage);
-};
-
-int
-ProcessArgs(int argc, const char * argv[])
-{
- std::istream* instream;
- std::string input_filename;
- std::string input_weatherFile;
- std::string input_energyFile;
-
- std::ifstream input;
- std::ifstream input1;
- std::ifstream input2;
-
-
- ezOptionParser opt;
-
- opt.overview = "*******************************************\n";
- opt.overview += "Copyright (C) 1996-2014 \n"; // Add owners of copyright?
- opt.overview += "Web: www.energyplus.gov\n";
- opt.overview += VerString;
- opt.overview += "\n*******************************************\n";
- opt.syntax = "./EnergyPlus -i InputFile.idf -e Energy+.idd -w WeatherFile.epw -o OutFile.csv";
-
- opt.add("", 0, 1, 0, "Usage information displayed on top", "-h", "--help");
-
- opt.add("", 0, 1, 0, "Options to get version control", "-v", "--version");
-
- opt.add("in.idf", 0, 1, 0, "Input file to process", "-i", "--input");
-
- opt.add("in.epw", 0, 1, 0, "Input weather file to process", "-w", "--weather");
-
- opt.add("Energy+.idd", 0, 1, 0, "Input energy file to process", "-e", "--energy");
-
- opt.add("eplustbl.csv", 0, 0, 0, "Output file", "-o", "--output");
-
- std::string usage;
- opt.parse(argc, argv);
-
- if (opt.isSet("-h")) {
- opt.getUsage(usage);
- DisplayString(usage);
- return 1;
+ using namespace DataStringGlobals;
+ using namespace InputProcessor;
+ using namespace SimulationManager;
+ using namespace OutputReportTabular;
+ using namespace OutputProcessor;
+ using namespace SolarShading;
+ using namespace ez;
+
+ std::string outputAuditFile;
+ std::string outputBndFile;
+ std::string outputDxfFile;
+ std::string outputEioFile;
+ std::string outputEndFile;
+ std::string outputErrFile;
+ std::string outputEsoFile;
+ std::string outputMtdFile;
+ std::string outputMddFile;
+ std::string outputMtrFile;
+ std::string outputRddFile;
+ std::string outputShdFile;
+ std::string outputCsvFile;
+ std::string outputHtmFile;
+ std::string outputTabFile;
+ std::string outputTxtFile;
+ std::string outputXmlFile;
+ std::string inputFileName;
+ std::string inputEnergyFile;
+ std::string inputWeatherFile;
+
+ int
+ ProcessArgs(int argc, const char * argv[])
+ {
+ ezOptionParser opt;
+
+ opt.overview = VerString;
+ opt.example = "EnergyPlus -i InputFile.idf -e Energy+.idd -w WeatherFile.epw -o";
+
+ opt.syntax = "EnergyPlus [options]";
+
+ opt.add("", 0, 0, 0, "Display this message", "-h", "--help");
+
+ opt.add("", 0, 0, 0, "Print version invormation", "-v", "--version");
+
+ opt.add("in.idf", 0, 1, 0, "Input Definition File (IDF) file path (default \".\\in.idf\")", "-i", "--idf");
+
+ opt.add("in.epw", 0, 1, 0, "EnergyPlus Weather (EPW) file path (default \".\\in.epw\")", "-w", "--weather");
+
+ opt.add("Energy+.idd", 0, 1, 0, "Input Data Dictionary (IDD) file path (default \".\\Energy+.idd\")", "-e", "--idd");
+
+ opt.add("", 0, 0, 0, "Rename output files to using the IDF and EPW file names", "-o", "--output");
+
+ // Parse arguments
+ opt.parse(argc, argv);
+
+ // print arguments parsed (useful for debugging)
+ /*
+ std::string pretty;
+
+ opt.prettyPrint(pretty);
+
+ std::cout << pretty << std::endl;
+ */
+
+ std::string usage;
+ opt.getUsage(usage);
+
+ // Handle bad options
+ std::vector badOptions;
+
+ if(!opt.gotExpected(badOptions)) {
+ for(int i=0; i < badOptions.size(); ++i) {
+ DisplayString("ERROR: Unexpected number of arguments for option " + badOptions[i] + "\n");
+ }
+ DisplayString(usage);
+ exit(EXIT_FAILURE);
}
- if (opt.isSet("-v")) {
- DisplayString(VerString);
- return 1;
- }
-
- Usage(opt); //Ugly at the moment
-
- std::vector badOptions;
- if(!opt.gotExpected(badOptions)) {
- for(int i=0; i < badOptions.size(); ++i)
- DisplayString("ERROR: Got unexpected number of arguments for option " + badOptions[i] + ".\n\n");
- DisplayString("Usage information displayed above. \n");
- return 1;
- }
-
- if(!opt.isSet("-h") && !opt.isSet("-v") && !opt.isSet("-i") && !opt.isSet("-o") && !opt.isSet("-w") && !opt.isSet("-e")){
- DisplayString("Invalid option used. Exiting...\n");
- return 1;
- }
-
- if(!opt.gotRequired(badOptions)) {
- for(int i=0; i < badOptions.size(); ++i)
- std::cerr << "ERROR: Missing required option " << badOptions[i] << ".\n\n";
- Usage(opt);
- return 1;
- }
-
-
- if (opt.isSet("-i")) {
- opt.get("-i")->getString(input_filename);
- input.open( input_filename.c_str() );
- instream = &input;
- DisplayString("\n\n====================================================================== \n");
- DisplayString("-- Input file request by the user = " + input_filename);
- if (!input) {
- DisplayString("\n -X- Error opening input file = " + input_filename + " -X- \n");
- DisplayString(" -X- Exiting -X- \n") ;
- return -1;
- }
- }
-
- if (opt.isSet("-w")) {
- opt.get("-w")->getString(input_weatherFile);
- input1.open( input_weatherFile.c_str() );
- instream = &input1;
- DisplayString("====================================================================== \n");
- DisplayString("-- Weather file requested by the user = " + input_weatherFile + "\n");
- if (!input1) {
- DisplayString("\n -X- Error opening weather file = " + input_weatherFile + " -X- \n");
- DisplayString(" -X- Exiting -X- \n");
- return -1;
- }
- }
-
- if (opt.isSet("-e")) {
- opt.get("-e")->getString(input_energyFile);
- input2.open( input_energyFile.c_str() );
- instream = &input2;
- DisplayString("====================================================================== \n");
- DisplayString("-- Energy file requested by the user = " + input_energyFile + "\n");
- DisplayString("====================================================================== ");
- if (!input2) {
- DisplayString("\n -X- Error opening energy file = " + input_energyFile + " -X- \n");
- DisplayString(" -X- Exiting -X- \n");
- return -1;
- }
- }
-
- if(input_filename.empty())
- input_filename = "in.idf";
-
- inputFileName = assign(input_filename);
-
- if(input_weatherFile.empty())
- input_weatherFile = "in.epw";
-
- inputWeatherFile = assignWFile(input_weatherFile);
-
- if(input_energyFile.empty())
- input_energyFile = "Energy+.idd";
-
- inputEnergyFile = assignEFile(input_energyFile);
-
- 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;
- output.open( output_File.c_str() );
- DisplayString("====================================================================== \n");
- DisplayString("-- Output to be stored in file = " + output_File + "\n");
- DisplayString("====================================================================== ");
- if (!output) {
- DisplayString("\n -X- Error opening output file = " + output_File + " -X- \n");
- DisplayString(" -X- Exiting -X- \n");
- return -1;
- }
- }
-
- if(output_File.empty())
- output_File = "eplustbl.csv";
-
- outputFile = assignOFile(output_File);
-
- if(output_AuditFile.empty())
- output_AuditFile = "eplusout.audit";
-
- outputAuditFile = assignAuditFile(output_AuditFile);
-
- if(output_BndFile.empty())
- output_BndFile = "eplusout.bnd";
-
- outputBndFile = assignBndFile(output_BndFile);
-
- if(output_DxfFile.empty())
- output_DxfFile = "eplusout.dxf";
-
- outputDxfFile = assignDxfFile(output_DxfFile);
-
- if(output_EioFile.empty())
- output_EioFile = "eplusout.eio";
-
- outputEioFile = assignEioFile(output_EioFile);
-
- if(output_EndFile.empty())
- output_EndFile = "eplusout.end";
-
- outputEndFile = assignEndFile(output_EndFile);
-
- if(output_ErrFile.empty())
- output_ErrFile = "eplusout.err";
-
- outputErrFile = assignErrFile(output_ErrFile);
-
- if(output_EsoFile.empty())
- output_EsoFile = "eplusout.eso";
-
- outputEsoFile = assignEsoFile(output_EsoFile);
-
- if(output_MtdFile.empty())
- output_MtdFile = "eplusout.mtd";
-
- outputMtdFile = assignMtdFile(output_MtdFile);
-
- if(output_MddFile.empty())
- output_MddFile = "eplusout.mdd";
-
- outputMddFile = assignMddFile(output_MddFile);
-
- if(output_MtrFile.empty())
- output_MtrFile = "eplusout.mtr";
-
- outputMtrFile = assignMtrFile(output_MtrFile);
-
- if(output_RddFile.empty())
- output_RddFile = "eplusout.rdd";
-
- outputRddFile = assignRddFile(output_RddFile);
-
- if(output_ShdFile.empty())
- output_ShdFile = "eplusout.shd";
-
- outputShdFile = assignShdFile(output_ShdFile);
+ if(opt.firstArgs.size() > 1 || opt.unknownArgs.size() > 0 || opt.lastArgs.size() > 0){
+ for(int i=1; i < opt.firstArgs.size(); ++i) {
+ std::string arg(opt.firstArgs[i]->c_str());
+ DisplayString("ERROR: Invalid option: " + arg + "\n");
+ }
+ for(int i=0; i < opt.unknownArgs.size(); ++i) {
+ std::string arg(opt.unknownArgs[i]->c_str());
+ DisplayString("ERROR: Invalid option: " + arg + "\n");
+ }
+ for(int i=0; i < opt.lastArgs.size(); ++i) {
+ std::string arg(opt.lastArgs[i]->c_str());
+ DisplayString("ERROR: Invalid option: " + arg + "\n");
+ }
+ DisplayString(usage);
+ exit(EXIT_FAILURE);
+ }
- if(output_HtmFile.empty())
- output_HtmFile = "eplustbl.htm";
+ if(!opt.gotRequired(badOptions)) {
+ for(int i=0; i < badOptions.size(); ++i) {
+ DisplayString("ERROR: Missing required option " + badOptions[i] + "\n");
+ }
+ DisplayString(usage);
+ exit(EXIT_FAILURE);
+ }
- outputHtmFile = assignHtmFile(output_HtmFile);
+ // Process arguments
+ if (opt.isSet("-h")) {
+ DisplayString(usage);
+ exit(EXIT_SUCCESS);
+ }
- if(output_TabFile.empty())
- output_TabFile = "eplustbl.tab";
+ if (opt.isSet("-v")) {
+ DisplayString(VerString);
+ exit(EXIT_SUCCESS);
+ }
- outputTabFile = assignTabFile(output_TabFile);
+ opt.get("-i")->getString(inputFileName);
- if(output_TxtFile.empty())
- output_TxtFile = "eplustbl.txt";
+ opt.get("-w")->getString(inputWeatherFile);
- outputTxtFile = assignTxtFile(output_TxtFile);
+ opt.get("-e")->getString(inputEnergyFile);
- if(output_XmlFile.empty())
- output_XmlFile = "eplustbl.xml";
+ std::string outputFilePrefix;
- outputXmlFile = assignXmlFile(output_XmlFile);
+ if (opt.isSet("-o")) {
+ outputFilePrefix =
+ inputFileName.substr(0, inputFileName.size()-4) + "_" +
+ inputWeatherFile.substr(0, inputWeatherFile.size()-4) + "_";
+ }
+ else {
+ outputFilePrefix = "eplus";
+ }
- return 0;
- /////////////////////////////////////////////////////
-}
+ outputAuditFile = outputFilePrefix + "out.audit";
+ outputBndFile = outputFilePrefix + "out.bnd";
+ outputDxfFile = outputFilePrefix + "out.dxf";
+ outputEioFile = outputFilePrefix + "out.eio";
+ outputEndFile = outputFilePrefix + "out.end";
+ outputErrFile = outputFilePrefix + "out.err";
+ outputEsoFile = outputFilePrefix + "out.eso";
+ outputMtdFile = outputFilePrefix + "out.mtd";
+ outputMddFile = outputFilePrefix + "out.mdd";
+ outputMtrFile = outputFilePrefix + "out.mtr";
+ outputRddFile = outputFilePrefix + "out.rdd";
+ outputShdFile = outputFilePrefix + "out.shd";
+ outputCsvFile = outputFilePrefix + "tbl.csv";
+ outputHtmFile = outputFilePrefix + "tbl.htm";
+ outputTabFile = outputFilePrefix + "tbl.tab";
+ outputTxtFile = outputFilePrefix + "tbl.txt";
+ outputXmlFile = outputFilePrefix + "tbl.xml";
+
+ return 0;
+ }
} //namespace options
} //EnergyPlus namespace
diff --git a/src/EnergyPlus/CommandLineInterface.hh b/src/EnergyPlus/CommandLineInterface.hh
index e55e69bfba3..40012bb235d 100644
--- a/src/EnergyPlus/CommandLineInterface.hh
+++ b/src/EnergyPlus/CommandLineInterface.hh
@@ -18,10 +18,14 @@ namespace CommandLineInterface {
extern std::string outputMtrFile;
extern std::string outputRddFile;
extern std::string outputShdFile;
+ extern std::string outputCsvFile;
extern std::string outputHtmFile;
extern std::string outputTabFile;
extern std::string outputTxtFile;
extern std::string outputXmlFile;
+ extern std::string inputFileName;
+ extern std::string inputEnergyFile;
+ extern std::string inputWeatherFile;
// Process command line arguments
int
diff --git a/src/EnergyPlus/DataSystemVariables.cc b/src/EnergyPlus/DataSystemVariables.cc
index d09ddb280a1..632e67e01ee 100644
--- a/src/EnergyPlus/DataSystemVariables.cc
+++ b/src/EnergyPlus/DataSystemVariables.cc
@@ -187,7 +187,7 @@ namespace DataSystemVariables {
std::string::size_type pos;
if ( firstTime ) {
- EchoInputFile = FindUnitNumber( CommandLineInterface::outputAuditFile );
+ EchoInputFile = FindUnitNumber( outputAuditFile );
get_environment_variable( cInputPath1, envinputpath1 );
if ( envinputpath1 != blank ) {
pos = index( envinputpath1, pathChar, true ); // look backwards for pathChar
diff --git a/src/EnergyPlus/InputProcessor.cc b/src/EnergyPlus/InputProcessor.cc
index bfe15e02f7e..cbbb3dbe94a 100644
--- a/src/EnergyPlus/InputProcessor.cc
+++ b/src/EnergyPlus/InputProcessor.cc
@@ -15,9 +15,6 @@
#include
#include
-//Standard C++ library
-#include
-
namespace EnergyPlus {
namespace InputProcessor {
@@ -65,8 +62,7 @@ namespace InputProcessor {
using DataSystemVariables::SortedIDD;
using DataSystemVariables::iASCII_CR;
using DataSystemVariables::iUnicode_end;
-
-
+
// Use statements for access to subroutines in other modules
// Data
@@ -92,8 +88,6 @@ namespace InputProcessor {
Real64 const DefAutoCalculateValue( AutoCalculate );
static gio::Fmt const fmtLD( "*" );
static gio::Fmt const fmtA( "(A)" );
- std::string inputFileName;
- std::string inputEnergyFile;
// DERIVED TYPE DEFINITIONS
@@ -172,25 +166,6 @@ namespace InputProcessor {
FArray1D< LineDefinition > IDFRecords; // All the objects read from the IDF
FArray1D< SecretObjects > RepObjects; // Secret Objects that could replace old ones
- std::string assign(std::string& _FileName){
- DisplayString("====================================================================== \n");
- DisplayString("== Module 'Input Processor'::Name of the input file = " + _FileName + "\n");
- return _FileName;
- }
-
- std::string assignEFile(std::string& _EFileName){
- DisplayString("== Module 'Input Processor'::Name of the energy file = " + _EFileName + "\n");
- DisplayString("====================================================================== \n\n");
- return _EFileName;
- }
-
- std::string assignAuditFile(std::string& _AuditFileName){
- DisplayString("== Module 'Input Processor'::Name of the output (audit) file = " +_AuditFileName+ "\n");
- DisplayString("====================================================================== \n\n");
- return _AuditFileName;
- }
-
-
// MODULE SUBROUTINES:
//*************************************************************************
@@ -252,14 +227,14 @@ namespace InputProcessor {
int endcol;
int write_stat;
int read_stat;
-
+
InitSecretObjects();
EchoInputFile = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); gio::open( EchoInputFile, CommandLineInterface::outputAuditFile, flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( EchoInputFile, outputAuditFile, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- DisplayString( "Could not open (write) "+ CommandLineInterface::outputAuditFile + " ." );
- ShowFatalError( "ProcessInput: Could not open file " + CommandLineInterface::outputAuditFile + " for output (write)." );
+ DisplayString( "Could not open (write) "+ outputAuditFile + " ." );
+ ShowFatalError( "ProcessInput: Could not open file " + outputAuditFile + " for output (write)." );
}
{ IOFlags flags; gio::inquire( "eplusout.iperr", flags ); FileExists = flags.exists(); }
@@ -275,7 +250,7 @@ namespace InputProcessor {
{ IOFlags flags; flags.ACTION( "write" ); gio::open( CacheIPErrorFile, "eplusout.iperr", flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
DisplayString( "Could not open (write) eplusout.iperr." );
- ShowFatalError( "ProcessInput: Could not open file " + CommandLineInterface::outputAuditFile + " for output (write)." );
+ ShowFatalError( "ProcessInput: Could not open file " + outputAuditFile + " for output (write)." );
}
// FullName from StringGlobals is used to build file name with Path
@@ -652,7 +627,7 @@ namespace InputProcessor {
ErrorsFound = true;
}
} else {
- ShowSevereError( "IP: Blank Sections not allowed. Review " + CommandLineInterface::outputAuditFile + " file.", EchoInputFile );
+ ShowSevereError( "IP: Blank Sections not allowed. Review " + outputAuditFile + " file.", EchoInputFile );
errFlag = true;
ErrorsFound = true;
}
diff --git a/src/EnergyPlus/InputProcessor.hh b/src/EnergyPlus/InputProcessor.hh
index e90121b44b9..858183c1902 100644
--- a/src/EnergyPlus/InputProcessor.hh
+++ b/src/EnergyPlus/InputProcessor.hh
@@ -89,9 +89,7 @@ namespace InputProcessor {
extern std::string CurrentFieldName; // Current Field Name (IDD)
extern FArray1D_string ObsoleteObjectsRepNames; // Array of Replacement names for Obsolete objects
extern std::string ReplacementName;
- extern std::string inputFileName;
- extern std::string inputEnergyFile;
-
+
//Logical Variables for Module
extern bool OverallErrorFlag; // If errors found during parse of IDF, will fatal at end
extern bool EchoInputLine; // Usually True, if the IDD is backspaced, then is set to false, then back to true
@@ -409,12 +407,9 @@ namespace InputProcessor {
extern LineDefinition LineItem; // Description of current record
extern FArray1D< LineDefinition > IDFRecords; // All the objects read from the IDF
extern FArray1D< SecretObjects > RepObjects; // Secret Objects that could replace old ones
-
+
// Functions
- std::string assign(std::string& _FileName);
- std::string assignEFile(std::string& _EFileName);
- std::string assignAuditFile(std::string& _AuditFileName);
-
+
void
ProcessInput();
@@ -872,7 +867,7 @@ namespace InputProcessor {
// NOTICE
- // Copyright � 1996-2014 The Board of Trustees of the University of Illinois
+ // Copyright © 1996-2014 The Board of Trustees of the University of Illinois
// and The Regents of the University of California through Ernest Orlando Lawrence
// Berkeley National Laboratory. All rights reserved.
diff --git a/src/EnergyPlus/OutputProcessor.cc b/src/EnergyPlus/OutputProcessor.cc
index 80fb3d3d0fd..d7de5116592 100644
--- a/src/EnergyPlus/OutputProcessor.cc
+++ b/src/EnergyPlus/OutputProcessor.cc
@@ -21,7 +21,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -243,25 +242,7 @@ namespace OutputProcessor {
// UpdateDataandReport
// UpdateMeterReporting
- // Function
-
- std::string assignMtdFile(std::string& _MtdFileName){
- DisplayString("== Module 'Output Processor'::Name of the output (mtd) file = " +_MtdFileName+ "\n");
- DisplayString("====================================================================== \n\n");
- return _MtdFileName;
- }
-
- std::string assignMddFile(std::string& _MddFileName){
- DisplayString("== Module 'Output Processor'::Name of the output (mdd) file = " +_MddFileName+ "\n");
- DisplayString("====================================================================== \n\n");
- return _MddFileName;
- }
-
- std::string assignRddFile(std::string& _RddFileName){
- DisplayString("== Module 'Output Processor'::Name of the output (rdd) file = " +_RddFileName+ "\n");
- DisplayString("====================================================================== \n\n");
- return _RddFileName;
- }
+ // Functions
void
InitializeOutput()
@@ -8500,7 +8481,7 @@ AddToOutputVariableList(
}
// NOTICE
-// Copyright � 1996-2014 The Board of Trustees of the University of Illinois
+// Copyright © 1996-2014 The Board of Trustees of the University of Illinois
// and The Regents of the University of California through Ernest Orlando Lawrence
// Berkeley National Laboratory. All rights reserved.
// Portions of the EnergyPlus software package have been developed and copyrighted
diff --git a/src/EnergyPlus/OutputProcessor.hh b/src/EnergyPlus/OutputProcessor.hh
index 860e1ff6091..98abe4518fe 100644
--- a/src/EnergyPlus/OutputProcessor.hh
+++ b/src/EnergyPlus/OutputProcessor.hh
@@ -138,10 +138,6 @@ namespace OutputProcessor {
extern int MaxNumSubcategories;
- std::string assignMtdFile(std::string& _MtdFileName);
- std::string assignMddFile(std::string& _MddFileName);
- std::string assignRddFile(std::string& _RddFileName);
-
// All routines should be listed here whether private or not
//PUBLIC ReallocateTVar
//PUBLIC SetReportNow
diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc
index 127b98f5a61..6e3b76aab58 100644
--- a/src/EnergyPlus/OutputReportTabular.cc
+++ b/src/EnergyPlus/OutputReportTabular.cc
@@ -408,36 +408,6 @@ namespace OutputReportTabular {
static gio::Fmt const fmtA( "(A)" );
// Functions
- std::string outputFile;
- std::string assignOFile(std::string& _OFileName){
- DisplayString("== Module 'Output report tabular'::Name of the output file = "+_OFileName+ "\n");
- DisplayString("====================================================================== \n\n");
- return _OFileName;
- }
-
- std::string assignHtmFile(std::string& _HtmFileName){
- DisplayString("== Module 'Output Report Tabular'::Name of the output (htm) file = " +_HtmFileName+ "\n");
- DisplayString("====================================================================== \n\n");
- return _HtmFileName;
- }
-
- std::string assignTabFile(std::string& _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;
- }
-
- std::string assignXmlFile(std::string& _XmlFileName){
- DisplayString("== Module 'Output Report Tabular'::Name of the output (xml) file = " +_XmlFileName+ "\n");
- DisplayString("====================================================================== \n\n");
- return _XmlFileName;
- }
void
UpdateTabularReports( int const IndexTypeKey ) // What kind of data to update (Zone, HVAC)
@@ -3141,9 +3111,9 @@ namespace OutputReportTabular {
curDel = del( iStyle );
if ( TableStyle( iStyle ) == tableStyleComma ) {
DisplayString( "Writing tabular output file results using comma format." );
- { IOFlags flags; flags.ACTION( "WRITE" ); gio::open( curFH, outputFile, flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "WRITE" ); gio::open( curFH, outputCsvFile, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( "OpenOutputTabularFile: Could not open file (" + outputFile + ") for output (write)." );
+ ShowFatalError( "OpenOutputTabularFile: Could not open file (" + outputCsvFile + ") for output (write)." );
}
gio::write( curFH, fmtA ) << "Program Version:" + curDel + VerString;
gio::write( curFH, fmtLD ) << "Tabular Output Report in Format: " + curDel + "Comma";
@@ -4835,7 +4805,6 @@ namespace OutputReportTabular {
// report is added it can be added to the list here.
// Locals
-
int EchoInputFile; // found unit number for 'eplusout.audit'
FillWeatherPredefinedEntries();
@@ -4858,7 +4827,7 @@ namespace OutputReportTabular {
WriteTimeBinTables();
}
}
- EchoInputFile = FindUnitNumber( CommandLineInterface::outputAuditFile );
+ EchoInputFile = FindUnitNumber( outputAuditFile );
gio::write( EchoInputFile, fmtLD ) << "MonthlyInputCount=" << MonthlyInputCount;
gio::write( EchoInputFile, fmtLD ) << "sizeMonthlyInput=" << sizeMonthlyInput;
gio::write( EchoInputFile, fmtLD ) << "MonthlyFieldSetInputCount=" << MonthlyFieldSetInputCount;
diff --git a/src/EnergyPlus/OutputReportTabular.hh b/src/EnergyPlus/OutputReportTabular.hh
index 4139d973907..56419be37b7 100644
--- a/src/EnergyPlus/OutputReportTabular.hh
+++ b/src/EnergyPlus/OutputReportTabular.hh
@@ -20,13 +20,6 @@ namespace EnergyPlus {
namespace OutputReportTabular {
- extern std::string outputFile;
- std::string assignOFile(std::string& _OFileName);
- std::string assignHtmFile(std::string& _HtmFileName);
- std::string assignTabFile(std::string& _TabFileName);
- std::string assignTxtFile(std::string& _TxtFileName);
- std::string assignXmlFile(std::string& _XmlFileName);
-
// Using/Aliasing
// Data
@@ -297,7 +290,6 @@ namespace OutputReportTabular {
extern std::string activeReportName;
extern std::string activeForName;
extern std::string prevReportName;
-
// SUBROUTINE SPECIFICATIONS FOR MODULE PrimaryPlantLoops
//PRIVATE DateToStr
@@ -732,7 +724,7 @@ namespace OutputReportTabular {
extern FArray1D< UnitConvType > UnitConv;
// Functions
-
+
void
UpdateTabularReports( int const IndexTypeKey ); // What kind of data to update (Zone, HVAC)
@@ -744,7 +736,6 @@ namespace OutputReportTabular {
//======================================================================================================================
//======================================================================================================================
-
void
GetInputTabularMonthly();
@@ -1072,7 +1063,7 @@ namespace OutputReportTabular {
// NOTICE
- // Copyright � 1996-2014 The Board of Trustees of the University of Illinois
+ // Copyright © 1996-2014 The Board of Trustees of the University of Illinois
// and The Regents of the University of
// Berkeley National Laboratory. All rights reserved.
diff --git a/src/EnergyPlus/OutputReports.cc b/src/EnergyPlus/OutputReports.cc
index ee292db3800..e464458b5f9 100644
--- a/src/EnergyPlus/OutputReports.cc
+++ b/src/EnergyPlus/OutputReports.cc
@@ -16,7 +16,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -30,12 +29,6 @@ namespace EnergyPlus {
using namespace CommandLineInterface;
static gio::Fmt const fmtLD( "*" );
-std::string assignDxfFile(std::string& _DxfFileName){
- DisplayString("== Module 'Output Reports'::Name of the output (dxf) file = " + _DxfFileName + "\n");
- DisplayString("====================================================================== \n\n");
- return _DxfFileName;
- }
-
void
ReportSurfaces()
{
diff --git a/src/EnergyPlus/OutputReports.hh b/src/EnergyPlus/OutputReports.hh
index 23260c02612..3aedd06b25a 100644
--- a/src/EnergyPlus/OutputReports.hh
+++ b/src/EnergyPlus/OutputReports.hh
@@ -9,8 +9,6 @@
namespace EnergyPlus {
-std::string assignDxfFile(std::string& _DxfFileName);
-
void
ReportSurfaces();
diff --git a/src/EnergyPlus/Psychrometrics.cc b/src/EnergyPlus/Psychrometrics.cc
index 57dc0803960..3cc7094ccb6 100644
--- a/src/EnergyPlus/Psychrometrics.cc
+++ b/src/EnergyPlus/Psychrometrics.cc
@@ -222,7 +222,7 @@ namespace Psychrometrics {
Real64 AverageIterations;
std::string istring;
- EchoInputFile = FindUnitNumber( CommandLineInterface::outputAuditFile );
+ EchoInputFile = FindUnitNumber( outputAuditFile );
if ( EchoInputFile == 0 ) return;
if ( any_gt( NumTimesCalled, 0 ) ) {
gio::write( EchoInputFile, fmtA ) << "RoutineName,#times Called,Avg Iterations";
diff --git a/src/EnergyPlus/ScheduleManager.cc b/src/EnergyPlus/ScheduleManager.cc
index 7d540cc6c81..b6c455f3693 100644
--- a/src/EnergyPlus/ScheduleManager.cc
+++ b/src/EnergyPlus/ScheduleManager.cc
@@ -474,7 +474,7 @@ namespace ScheduleManager {
Schedule( 0 ).ScheduleTypePtr = 0;
Schedule( 0 ).WeekSchedulePointer = 0;
- UnitNumber = FindUnitNumber( CommandLineInterface::outputAuditFile );
+ UnitNumber = FindUnitNumber( outputAuditFile );
gio::write( UnitNumber, fmtLD ) << " Processing Schedule Input -- Start";
//!! Get Schedule Types
diff --git a/src/EnergyPlus/SimulationManager.cc b/src/EnergyPlus/SimulationManager.cc
index ec1781063c0..e2cd8952ca4 100644
--- a/src/EnergyPlus/SimulationManager.cc
+++ b/src/EnergyPlus/SimulationManager.cc
@@ -152,38 +152,6 @@ namespace SimulationManager {
// MODULE SUBROUTINES:
// Functions
- std::string inputWeatherFile;
-
- std::string assignWFile(std::string& _WFileName){
- DisplayString("====================================================================== \n");
- DisplayString("== Module 'Manage Simulation'::Name of the weather file = " + _WFileName +"\n");
- DisplayString("====================================================================== \n");
- return _WFileName;
- }
-
- std::string assignBndFile(std::string& _BndFileName){
- DisplayString("== Module 'Manage Simulation'::Name of the output (bnd) file = " + _BndFileName +"\n");
- DisplayString("====================================================================== \n\n");
- return _BndFileName;
- }
-
- std::string assignEioFile(std::string& _EioFileName){
- DisplayString("== Module 'Manage Simulation'::Name of the output (eio) file = " + _EioFileName +"\n");
- DisplayString("====================================================================== \n\n");
- return _EioFileName;
- }
-
- std::string assignEsoFile(std::string& _EsoFileName){
- DisplayString("== Module 'Manage Simulation'::Name of the output (eso) file = " + _EsoFileName +"\n");
- DisplayString("====================================================================== \n\n");
- return _EsoFileName;
- }
-
- std::string assignMtrFile(std::string& _MtrFileName){
- DisplayString("== Module 'Manage Simulation'::Name of the output (mtr) file = " + _MtrFileName +"\n");
- DisplayString("====================================================================== \n\n");
- return _MtrFileName;
- }
void
ManageSimulation()
@@ -285,8 +253,7 @@ namespace SimulationManager {
// CHARACTER(len=70) :: tdstring
// CHARACTER(len=138) :: tdstringlong
-
-
+
int EnvCount;
// Formats
@@ -468,8 +435,7 @@ namespace SimulationManager {
if ( WarmupFlag ) {
++NumOfWarmupDays;
cWarmupDay = TrimSigDigits( NumOfWarmupDays );
- // DisplayString( "Warming up {" + cWarmupDay + '}' );
- DisplayString( "Warming up {"+cWarmupDay+"}" );
+ DisplayString( "Warming up {" + cWarmupDay + '}' );
} else if ( DayOfSim == 1 ) {
DisplayString( "Starting Simulation at " + CurMnDy + " for " + EnvironmentName );
gio::write( OutputFileInits, Format_700 ) << NumOfWarmupDays;
@@ -1241,9 +1207,9 @@ namespace SimulationManager {
// FLOW:
OutputFileStandard = GetNewUnitNumber();
StdOutputRecordCount = 0;
- { IOFlags flags; flags.ACTION( "write" ); flags.STATUS( "UNKNOWN" ); gio::open( OutputFileStandard, CommandLineInterface::outputEsoFile, flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); flags.STATUS( "UNKNOWN" ); gio::open( OutputFileStandard, outputEsoFile, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( "OpenOutputFiles: Could not open file "+CommandLineInterface::outputEsoFile+" for output (write)." );
+ ShowFatalError( "OpenOutputFiles: Could not open file "+outputEsoFile+" for output (write)." );
}
gio::write( OutputFileStandard, fmtA ) << "Program Version," + VerString;
@@ -1348,7 +1314,7 @@ namespace SimulationManager {
std::string cepEnvSetThreads;
std::string cIDFSetThreads;
- EchoInputFile = FindUnitNumber( CommandLineInterface::outputAuditFile );
+ EchoInputFile = FindUnitNumber( outputAuditFile );
// Record some items on the audit file
gio::write( EchoInputFile, fmtLD ) << "NumOfRVariable=" << NumOfRVariable_Setup;
gio::write( EchoInputFile, fmtLD ) << "NumOfRVariable(Total)=" << NumTotalRVariable;
@@ -2821,7 +2787,7 @@ Resimulate(
}
// NOTICE
-// Copyright � 1996-2014 The Board of Trustees of the University of Illinois
+// Copyright © 1996-2014 The Board of Trustees of the University of Illinois
// and The Regents of the University of California through Ernest Orlando Lawrence
// Berkeley National Laboratory. All rights reserved.
// Portions of the EnergyPlus software package have been developed and copyrighted
diff --git a/src/EnergyPlus/SimulationManager.hh b/src/EnergyPlus/SimulationManager.hh
index e01a513abc4..9f003d86177 100644
--- a/src/EnergyPlus/SimulationManager.hh
+++ b/src/EnergyPlus/SimulationManager.hh
@@ -31,17 +31,10 @@ namespace SimulationManager {
// MODULE VARIABLE DECLARATIONS:
extern bool RunPeriodsInInput;
extern bool RunControlInInput;
- extern std::string inputWeatherFile;
// SUBROUTINE SPECIFICATIONS FOR MODULE SimulationManager
// Functions
-
- std::string assignWFile(std::string& _WFileName);
- std::string assignBndFile(std::string& _BndFileName);
- std::string assignEioFile(std::string& _EioFileName);
- std::string assignEsoFile(std::string& _EsoFileName);
- std::string assignMtrFile(std::string& _MtrFileName);
void
ManageSimulation();
@@ -97,7 +90,7 @@ Resimulate(
);
// NOTICE
-// Copyright � 1996-2014 The Board of Trustees of the University of Illinois
+// Copyright © 1996-2014 The Board of Trustees of the University of Illinois
// and The Regents of the University of California through Ernest Orlando Lawrence
// Berkeley National Laboratory. All rights reserved.
// Portions of the EnergyPlus software package have been developed and copyrighted
diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc
index db2e4a85f0a..853dba9738e 100644
--- a/src/EnergyPlus/SolarShading.cc
+++ b/src/EnergyPlus/SolarShading.cc
@@ -210,12 +210,6 @@ namespace SolarShading {
// Functions
- std::string assignShdFile(std::string& _ShdFileName){
- DisplayString("== Module 'Solar shading'::Name of the output (shd) file = " +_ShdFileName+ "\n");
- DisplayString("====================================================================== \n\n");
- return _ShdFileName;
- }
-
void
InitSolarCalculations()
{
diff --git a/src/EnergyPlus/SolarShading.hh b/src/EnergyPlus/SolarShading.hh
index 4c8bb0a829c..cc047ea23a1 100644
--- a/src/EnergyPlus/SolarShading.hh
+++ b/src/EnergyPlus/SolarShading.hh
@@ -120,7 +120,6 @@ namespace SolarShading {
extern FArray1D< Real64 > YTEMP1; // Temporary 'Y' values for HC vertices of the overlap
extern int maxNumberOfFigures;
- std::string assignShdFile(std::string& _ShdFileName);
// SUBROUTINE SPECIFICATIONS FOR MODULE SolarShading
// Types
diff --git a/src/EnergyPlus/ThermalComfort.cc b/src/EnergyPlus/ThermalComfort.cc
index bc655d354c5..0497cce79df 100644
--- a/src/EnergyPlus/ThermalComfort.cc
+++ b/src/EnergyPlus/ThermalComfort.cc
@@ -10,6 +10,7 @@
#include
// EnergyPlus Headers
+#include
#include
#include
#include
@@ -28,7 +29,6 @@
#include
#include
#include
-#include
#include
namespace EnergyPlus {
@@ -59,6 +59,7 @@ namespace ThermalComfort {
// USE STATEMENTS:
// Use statements for data only modules
// Using/Aliasing
+ using namespace CommandLineInterface;
using namespace DataPrecisionGlobals;
using namespace DataGlobals;
using DataHeatBalance::MRT;
@@ -2468,7 +2469,7 @@ namespace ThermalComfort {
if ( initiate && weathersimulation ) {
{ IOFlags flags; gio::inquire( "in.stat", flags ); statFileExists = flags.exists(); }
- { IOFlags flags; gio::inquire( SimulationManager::inputWeatherFile, flags ); epwFileExists = flags.exists(); }
+ { IOFlags flags; gio::inquire( inputWeatherFile, flags ); epwFileExists = flags.exists(); }
readStat = 0;
if ( statFileExists ) {
statFile = GetNewUnitNumber();
@@ -2493,9 +2494,9 @@ namespace ThermalComfort {
useStatData = true;
} else if ( epwFileExists ) {
epwFile = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "READ" ); gio::open( epwFile, SimulationManager::inputWeatherFile, flags ); readStat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "READ" ); gio::open( epwFile, inputWeatherFile, flags ); readStat = flags.ios(); }
if ( readStat != 0 ) {
- ShowFatalError( "CalcThermalComfortAdaptiveASH55: Could not open file " +SimulationManager::inputWeatherFile+ " for input (read)." );
+ ShowFatalError( "CalcThermalComfortAdaptiveASH55: Could not open file " + inputWeatherFile+ " for input (read)." );
}
for ( i = 1; i <= 9; ++i ) { // Headers
{ IOFlags flags; gio::read( epwFile, fmtA, flags ); readStat = flags.ios(); }
@@ -2719,13 +2720,13 @@ namespace ThermalComfort {
}
if ( initiate && weathersimulation ) {
- { IOFlags flags; gio::inquire( SimulationManager::inputWeatherFile, flags ); epwFileExists = flags.exists(); }
+ { IOFlags flags; gio::inquire( inputWeatherFile, flags ); epwFileExists = flags.exists(); }
readStat = 0;
if ( epwFileExists ) {
epwFile = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "READ" ); gio::open( epwFile, SimulationManager::inputWeatherFile, flags ); readStat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "READ" ); gio::open( epwFile, inputWeatherFile, flags ); readStat = flags.ios(); }
if ( readStat != 0 ) {
- ShowFatalError( "CalcThermalComfortAdaptiveCEN15251: Could not open file "+SimulationManager::inputWeatherFile+" for input (read)." );
+ ShowFatalError( "CalcThermalComfortAdaptiveCEN15251: Could not open file "+inputWeatherFile+" for input (read)." );
}
for ( i = 1; i <= 9; ++i ) { // Headers
{ IOFlags flags; gio::read( epwFile, fmtA, flags ); readStat = flags.ios(); }
@@ -2929,7 +2930,7 @@ namespace ThermalComfort {
// NOTICE
- // Copyright � 1996-2014 The Board of Trustees of the University of Illinois
+ // Copyright © 1996-2014 The Board of Trustees of the University of Illinois
// and The Regents of the University of California through Ernest Orlando Lawrence
// Berkeley National Laboratory. All rights reserved.
diff --git a/src/EnergyPlus/UtilityRoutines.cc b/src/EnergyPlus/UtilityRoutines.cc
index 1d63905f4c2..97836ad6789 100644
--- a/src/EnergyPlus/UtilityRoutines.cc
+++ b/src/EnergyPlus/UtilityRoutines.cc
@@ -28,7 +28,6 @@
#include
#include
#include
-#include //Added to pass inputEnergyFile (MS)
#include
#include
#include
@@ -40,20 +39,6 @@
namespace EnergyPlus {
-// Functions
- std::string assignEndFile(std::string& _EndFileName){
- DisplayString("== Module 'Utility Routines'::Name of the output (end) file = " + _EndFileName + "\n");
- DisplayString("====================================================================== \n\n");
- return _EndFileName;
- }
-
- std::string assignErrFile(std::string& _ErrFileName){
- DisplayString("== Module 'Utility Routines'::Name of the output (err) file = " + _ErrFileName + "\n");
- DisplayString("====================================================================== \n\n");
- return _ErrFileName;
- }
-
-
void
AbortEnergyPlus(
bool const NoIdf, // Set to true when "noidf" was found
@@ -183,12 +168,12 @@ AbortEnergyPlus(
strip( NumSevereDuringSizing );
if ( NoIDD ) {
- DisplayString( "No EnergyPlus Data Dictionary (" +InputProcessor::inputEnergyFile+") was found. It is possible " );
+ DisplayString( "No EnergyPlus Data Dictionary (" + inputEnergyFile+") was found. It is possible " );
DisplayString( "you \"double-clicked\"EnergyPlus.exe rather than using one of the methods" );
DisplayString( "to run Energyplus as found in the GettingStarted document in the" );
DisplayString( "documentation folder. Using EP-Launch may be best -- " );
DisplayString( "it provides extra help for new users." );
- ShowMessage( "No EnergyPlus Data Dictionary (" +InputProcessor::inputEnergyFile+") was found. It is possible you \"double-clicked\" EnergyPlus.exe " );
+ ShowMessage( "No EnergyPlus Data Dictionary (" + inputEnergyFile+") was found. It is possible you \"double-clicked\" EnergyPlus.exe " );
ShowMessage( "rather than using one of the methods to run Energyplus as found in the GettingStarted document" );
ShowMessage( "in the documentation folder. Using EP-Launch may be best -- it provides extra help for new users." );
{ IOFlags flags; flags.ADVANCE( "NO" ); gio::write( OutFmt, flags ); }
@@ -228,9 +213,9 @@ AbortEnergyPlus(
ShowMessage( "EnergyPlus Terminated--Fatal Error Detected. " + NumWarnings + " Warning; " + NumSevere + " Severe Errors; Elapsed Time=" + Elapsed );
DisplayString( "EnergyPlus Run Time=" + Elapsed );
tempfl = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); gio::open( tempfl, CommandLineInterface::outputEndFile, flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( tempfl, outputEndFile, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- DisplayString( "AbortEnergyPlus: Could not open file "+ CommandLineInterface::outputEndFile +" for output (write)." );
+ DisplayString( "AbortEnergyPlus: Could not open file "+ outputEndFile +" for output (write)." );
}
gio::write( tempfl, fmtLD ) << "EnergyPlus Terminated--Fatal Error Detected. " + NumWarnings + " Warning; " + NumSevere + " Severe Errors; Elapsed Time=" + Elapsed;
@@ -383,6 +368,7 @@ EndEnergyPlus()
// na
// Using/Aliasing
+ using namespace CommandLineInterface;
using namespace DataPrecisionGlobals;
using namespace DataSystemVariables;
using namespace DataTimings;
@@ -460,9 +446,9 @@ EndEnergyPlus()
ShowMessage( "EnergyPlus Completed Successfully-- " + NumWarnings + " Warning; " + NumSevere + " Severe Errors; Elapsed Time=" + Elapsed );
DisplayString( "EnergyPlus Run Time=" + Elapsed );
tempfl = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); gio::open( tempfl, CommandLineInterface::outputEndFile, flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( tempfl, outputEndFile, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- DisplayString( "EndEnergyPlus: Could not open file " + CommandLineInterface::outputEndFile + " for output (write)." );
+ DisplayString( "EndEnergyPlus: Could not open file " + outputEndFile + " for output (write)." );
}
gio::write( tempfl, fmtA ) << "EnergyPlus Completed Successfully-- " + NumWarnings + " Warning; " + NumSevere + " Severe Errors; Elapsed Time=" + Elapsed;
gio::close( tempfl );
@@ -825,6 +811,7 @@ ShowFatalError(
// na
// Using/Aliasing
+ using namespace CommandLineInterface;
using namespace DataErrorTracking;
using General::RoundSigDigits;
@@ -846,7 +833,7 @@ ShowFatalError(
ShowErrorMessage( " ** Fatal ** " + ErrorMessage, OutUnit1, OutUnit2 );
DisplayString( "**FATAL:" + ErrorMessage );
if ( has( ErrorMessage, "in.idf missing" ) ) NoIdf = true;
- if ( has( ErrorMessage, InputProcessor::inputEnergyFile +" missing" ) ) NoIDD = true;
+ if ( has( ErrorMessage, inputEnergyFile +" missing" ) ) NoIDD = true;
ShowErrorMessage( " ...Summary of Errors that led to program termination:", OutUnit1, OutUnit2 );
ShowErrorMessage( " ..... Reference severe error count=" + RoundSigDigits( TotalSevereErrors ), OutUnit1, OutUnit2 );
ShowErrorMessage( " ..... Last severe error=" + LastSevereError, OutUnit1, OutUnit2 );
@@ -1587,6 +1574,7 @@ ShowErrorMessage(
// na
// Using/Aliasing
+ using namespace CommandLineInterface;
using DataStringGlobals::VerString;
using DataStringGlobals::IDDVerString;
using DataGlobals::DoingInputProcessing;
@@ -1613,10 +1601,10 @@ ShowErrorMessage(
if ( TotalErrors == 0 && ! ErrFileOpened ) {
StandardErrorOutput = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); gio::open( StandardErrorOutput, CommandLineInterface::outputErrFile, flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( StandardErrorOutput, outputErrFile, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
DisplayString( "Trying to display error: \"" + ErrorMessage + "\"" );
- ShowFatalError( "ShowErrorMessage: Could not open file "+CommandLineInterface::outputErrFile+" for output (write)." );
+ ShowFatalError( "ShowErrorMessage: Could not open file "+outputErrFile+" for output (write)." );
}
gio::write( StandardErrorOutput, fmtA ) << "Program Version," + VerString + ',' + IDDVerString;
ErrFileOpened = true;
@@ -1802,7 +1790,7 @@ ShowRecurringErrors()
}
// NOTICE
-// Copyright � 1996-2014 The Board of Trustees of the University of Illinois
+// Copyright © 1996-2014 The Board of Trustees of the University of Illinois
// and The Regents of the University of California through Ernest Orlando Lawrence
// Berkeley National Laboratory. All rights reserved.
// Portions of the EnergyPlus software package have been developed and copyrighted
diff --git a/src/EnergyPlus/UtilityRoutines.hh b/src/EnergyPlus/UtilityRoutines.hh
index 2fe1cf28c01..33d62a4c0f7 100644
--- a/src/EnergyPlus/UtilityRoutines.hh
+++ b/src/EnergyPlus/UtilityRoutines.hh
@@ -9,9 +9,6 @@
namespace EnergyPlus {
-std::string assignEndFile(std::string& _EndFileName);
-std::string assignErrFile(std::string& _ErrFileName);
-
void
AbortEnergyPlus(
bool const NoIdf, // Set to true when "noidf" was found
diff --git a/src/EnergyPlus/WeatherManager.cc b/src/EnergyPlus/WeatherManager.cc
index 613283b54d3..be13c5469de 100644
--- a/src/EnergyPlus/WeatherManager.cc
+++ b/src/EnergyPlus/WeatherManager.cc
@@ -10,6 +10,7 @@
#include
// EnergyPlus Headers
+#include
#include
#include
#include
@@ -25,7 +26,6 @@
#include
#include
#include
-#include
#include
#include
@@ -57,6 +57,7 @@ namespace WeatherManager {
// USE STATEMENTS:
// Use statements for data only modules
// Using/Aliasing
+ using namespace CommandLineInterface;
using namespace DataPrecisionGlobals;
using namespace DataGlobals;
using namespace DataEnvironment;
@@ -4390,7 +4391,7 @@ Label903: ;
// FLOW:
- { IOFlags flags; gio::inquire( SimulationManager::inputWeatherFile, flags ); WeatherFileExists = flags.exists(); }
+ { IOFlags flags; gio::inquire( inputWeatherFile, flags ); WeatherFileExists = flags.exists(); }
if ( WeatherFileExists ) {
OpenEPlusWeatherFile( ErrorsFound, true );
@@ -4443,11 +4444,11 @@ Label903: ;
bool EPWOpen;
int unitnumber;
- { IOFlags flags; gio::inquire( SimulationManager::inputWeatherFile, flags ); unitnumber = flags.unit(); EPWOpen = flags.open(); }
+ { IOFlags flags; gio::inquire( inputWeatherFile, flags ); unitnumber = flags.unit(); EPWOpen = flags.open(); }
if ( EPWOpen ) gio::close( unitnumber );
WeatherFileUnitNumber = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "read" ); gio::open( WeatherFileUnitNumber, SimulationManager::inputWeatherFile, flags ); if ( flags.err() ) goto Label9999; }
+ { IOFlags flags; flags.ACTION( "read" ); gio::open( WeatherFileUnitNumber, inputWeatherFile, flags ); if ( flags.err() ) goto Label9999; }
if ( ProcessHeader ) {
// Read in Header Information
@@ -4531,7 +4532,7 @@ Label9999: ;
// Make sure it's open
- { IOFlags flags; gio::inquire( SimulationManager::inputWeatherFile, flags ); unitnumber = flags.unit(); EPWOpen = flags.open(); }
+ { IOFlags flags; gio::inquire( inputWeatherFile, flags ); unitnumber = flags.unit(); EPWOpen = flags.open(); }
if ( EPWOpen ) gio::close( unitnumber );
}
@@ -9467,7 +9468,7 @@ Label9998: ;
// NOTICE
- // Copyright � 1996-2014 The Board of Trustees of the University of Illinois
+ // Copyright © 1996-2014 The Board of Trustees of the University of Illinois
// and The Regents of the University of California through Ernest Orlando Lawrence
// Berkeley National Laboratory. All rights reserved.
diff --git a/src/EnergyPlus/main.cc b/src/EnergyPlus/main.cc
index 7b85cb1eae1..26db437a8b0 100644
--- a/src/EnergyPlus/main.cc
+++ b/src/EnergyPlus/main.cc
@@ -217,12 +217,7 @@ main(int argc, const char * argv[])
// CLI module
using namespace CommandLineInterface;
- int status = 0;
- status = ProcessArgs(argc, argv);
- if(status == 1 || status == -1)
- return 0;
- //ProcessArgs(argc, argv);
-
+ ProcessArgs(argc, argv);
// Enable floating point exceptions
#ifndef NDEBUG
diff --git a/src/EnergyPlus/main.hh b/src/EnergyPlus/main.hh
index d3e620cb497..49c180de3c7 100644
--- a/src/EnergyPlus/main.hh
+++ b/src/EnergyPlus/main.hh
@@ -1,7 +1,6 @@
#ifndef main_hh_INCLUDED
#define main_hh_INCLUDED
-using namespace std;
// C++ Headers
#include
From b01fc9552833a2348ca0312ef823bc832dbc7748 Mon Sep 17 00:00:00 2001
From: Monika Sharma
Date: Thu, 25 Sep 2014 11:23:58 -0600
Subject: [PATCH 11/71] All output files are a string now + replaced error
messages in CommandLineInterface with ShowFatalError
---
src/EnergyPlus/AirflowNetworkSolver.cc | 6 +-
src/EnergyPlus/CommandLineInterface.cc | 168 +++++++++++++-------
src/EnergyPlus/CommandLineInterface.hh | 63 +++++---
src/EnergyPlus/DataStringGlobals.cc | 2 +-
src/EnergyPlus/DataStringGlobals.hh | 2 +-
src/EnergyPlus/DataSystemVariables.cc | 2 +-
src/EnergyPlus/DaylightingManager.cc | 36 +++--
src/EnergyPlus/EMSManager.cc | 6 +-
src/EnergyPlus/HeatBalanceSurfaceManager.cc | 6 +-
src/EnergyPlus/InputProcessor.cc | 46 +++---
src/EnergyPlus/OutputProcessor.cc | 40 ++---
src/EnergyPlus/OutputReportTabular.cc | 28 ++--
src/EnergyPlus/OutputReports.cc | 24 +--
src/EnergyPlus/ScheduleManager.cc | 2 +-
src/EnergyPlus/SimulationManager.cc | 20 +--
src/EnergyPlus/SizingManager.cc | 26 +--
src/EnergyPlus/SolarShading.cc | 4 +-
src/EnergyPlus/TARCOGOutput.cc | 6 +-
src/EnergyPlus/ThermalComfort.cc | 18 +--
src/EnergyPlus/UtilityRoutines.cc | 22 +--
src/EnergyPlus/WeatherManager.cc | 8 +-
src/EnergyPlus/WindTurbine.cc | 14 +-
src/EnergyPlus/WindowManager.cc | 4 +-
src/EnergyPlus/main.cc | 20 +--
24 files changed, 329 insertions(+), 244 deletions(-)
diff --git a/src/EnergyPlus/AirflowNetworkSolver.cc b/src/EnergyPlus/AirflowNetworkSolver.cc
index a4ff5aaac2d..b70be9a08cf 100644
--- a/src/EnergyPlus/AirflowNetworkSolver.cc
+++ b/src/EnergyPlus/AirflowNetworkSolver.cc
@@ -9,6 +9,7 @@
// EnergyPlus Headers
#include
+#include
#include
#include
#include
@@ -54,6 +55,7 @@ namespace AirflowNetworkSolver {
// USE STATEMENTS:
// Using/Aliasing
+ using namespace CommandLineInterface;
using namespace DataPrecisionGlobals;
using DataGlobals::Pi;
using DataGlobals::DegToRadians;
@@ -217,7 +219,7 @@ namespace AirflowNetworkSolver {
LIST = 0;
if ( LIST >= 1 ) {
Unit21 = GetNewUnitNumber();
- gio::open( Unit21, "eplusADS.out" );
+ gio::open( Unit21, outputAdsFileName );
}
for ( n = 1; n <= NetworkNumOfNodes; ++n ) {
@@ -242,7 +244,7 @@ namespace AirflowNetworkSolver {
// Write an ouput file used for AIRNET input
if ( LIST >= 5 ) {
Unit11 = GetNewUnitNumber();
- gio::open( Unit11, "eplusADS.inp" );
+ gio::open( Unit11, eplusADSFileName );
for ( i = 1; i <= NetworkNumOfNodes; ++i ) {
gio::write( Unit11, Format_901 ) << i << AirflowNetworkNodeData( i ).NodeTypeNum << AirflowNetworkNodeData( i ).NodeHeight << TZ( i ) << PZ( i );
}
diff --git a/src/EnergyPlus/CommandLineInterface.cc b/src/EnergyPlus/CommandLineInterface.cc
index 555216d2c64..e0f721aab8e 100644
--- a/src/EnergyPlus/CommandLineInterface.cc
+++ b/src/EnergyPlus/CommandLineInterface.cc
@@ -31,26 +31,49 @@ namespace CommandLineInterface{
using namespace SolarShading;
using namespace ez;
- std::string outputAuditFile;
- std::string outputBndFile;
- std::string outputDxfFile;
- std::string outputEioFile;
- std::string outputEndFile;
- std::string outputErrFile;
- std::string outputEsoFile;
- std::string outputMtdFile;
- std::string outputMddFile;
- std::string outputMtrFile;
- std::string outputRddFile;
- std::string outputShdFile;
- std::string outputCsvFile;
- std::string outputHtmFile;
- std::string outputTabFile;
- std::string outputTxtFile;
- std::string outputXmlFile;
- std::string inputFileName;
- std::string inputEnergyFile;
- std::string inputWeatherFile;
+ std::string outputAuditFileName;
+ std::string outputBndFileName;
+ std::string outputDxfFileName;
+ std::string outputEioFileName;
+ std::string outputEndFileName;
+ std::string outputErrFileName;
+ std::string outputEsoFileName;
+ std::string outputMtdFileName;
+ std::string outputMddFileName;
+ std::string outputMtrFileName;
+ std::string outputRddFileName;
+ std::string outputShdFileName;
+ std::string outputTblCsvFileName;
+ std::string outputTblHtmFileName;
+ std::string outputTblTabFileName;
+ std::string outputTblTxtFileName;
+ std::string outputTblXmlFileName;
+ std::string inputIdfFileName;
+ std::string inputIddFileName;
+ std::string inputWeatherFileName;
+ std::string outputAdsFileName;
+ std::string outputDfsFileName;
+ std::string outputDelightFileName;
+ std::string outputMapTabFileName;
+ std::string outputMapCsvFileName;
+ std::string outputMapTxtFileName;
+ std::string outputEddFileName;
+ std::string outputIperrFileName;
+ std::string outputDbgFileName;
+ std::string outputSlnFileName;
+ std::string outputSciFileName;
+ std::string outputWrlFileName;
+ std::string outputZszCsvFileName;
+ std::string outputZszTabFileName;
+ std::string outputZszTxtFileName;
+ std::string outputSszCsvFileName;
+ std::string outputSszTabFileName;
+ std::string outputSszTxtFileName;
+ std::string outputScreenCsvFileName;
+ std::string EnergyPlusIniFileName;
+ std::string inStatFileName;
+ std::string TarcogIterationsFileName;
+ std::string eplusADSFileName;
int
ProcessArgs(int argc, const char * argv[])
@@ -89,12 +112,70 @@ namespace CommandLineInterface{
std::string usage;
opt.getUsage(usage);
+ opt.get("-i")->getString(inputIdfFileName);
+
+ opt.get("-w")->getString(inputWeatherFileName);
+
+ opt.get("-e")->getString(inputIddFileName);
+
+ std::string outputFilePrefix;
+
+ if (opt.isSet("-o")) {
+ outputFilePrefix = inputIdfFileName.substr(0, inputIdfFileName.size()-4) + "_" +
+ inputWeatherFileName.substr(0, inputWeatherFileName.size()-4) + "_";
+ }
+ else {
+ outputFilePrefix = "eplus";
+ }
+
+ outputAuditFileName = outputFilePrefix + "out.audit";
+ outputBndFileName = outputFilePrefix + "out.bnd";
+ outputDxfFileName = outputFilePrefix + "out.dxf";
+ outputEioFileName = outputFilePrefix + "out.eio";
+ outputEndFileName = outputFilePrefix + "out.end";
+ outputErrFileName = outputFilePrefix + "out.err";
+ outputEsoFileName = outputFilePrefix + "out.eso";
+ outputMtdFileName = outputFilePrefix + "out.mtd";
+ outputMddFileName = outputFilePrefix + "out.mdd";
+ outputMtrFileName = outputFilePrefix + "out.mtr";
+ outputRddFileName = outputFilePrefix + "out.rdd";
+ outputShdFileName = outputFilePrefix + "out.shd";
+ outputTblCsvFileName = outputFilePrefix + "tbl.csv";
+ outputTblHtmFileName = outputFilePrefix + "tbl.htm";
+ outputTblTabFileName = outputFilePrefix + "tbl.tab";
+ outputTblTxtFileName = outputFilePrefix + "tbl.txt";
+ outputTblXmlFileName = outputFilePrefix + "tbl.xml";
+ outputAdsFileName = outputFilePrefix + "ADS.out";
+ outputDfsFileName = outputFilePrefix + "out.dfs";
+ outputDelightFileName = outputFilePrefix + "out.delightdfdmp";
+ outputMapTabFileName = outputFilePrefix + "map.tab";
+ outputMapCsvFileName = outputFilePrefix + "map.csv";
+ outputMapTxtFileName = outputFilePrefix + "map.txt";
+ outputEddFileName = outputFilePrefix + "out.edd";
+ outputIperrFileName = outputFilePrefix + "out.iperr";
+ outputDbgFileName = outputFilePrefix + "out.dbg";
+ outputSlnFileName = outputFilePrefix + "out.sln";
+ outputSciFileName = outputFilePrefix + "out.sci";
+ outputWrlFileName = outputFilePrefix + "out.wrl";
+ outputZszCsvFileName = outputFilePrefix + "zsz.csv";
+ outputZszTabFileName = outputFilePrefix + "zsz.tab";
+ outputZszTxtFileName = outputFilePrefix + "zsz.txt";
+ outputSszCsvFileName = outputFilePrefix + "ssz.csv";
+ outputSszTabFileName = outputFilePrefix + "ssz.tab";
+ outputSszTxtFileName = outputFilePrefix + "ssz.txt";
+ outputScreenCsvFileName = outputFilePrefix + "screen.csv";
+ EnergyPlusIniFileName = "Energy+.ini";
+ inStatFileName = "in.stat";
+ TarcogIterationsFileName = "TarcogIterations.dbg";
+ eplusADSFileName = "eplusADS.inp";
+
+
// Handle bad options
std::vector badOptions;
if(!opt.gotExpected(badOptions)) {
for(int i=0; i < badOptions.size(); ++i) {
- DisplayString("ERROR: Unexpected number of arguments for option " + badOptions[i] + "\n");
+ ShowFatalError("ERROR: Unexpected number of arguments for option " + badOptions[i] + "\n");
}
DisplayString(usage);
exit(EXIT_FAILURE);
@@ -103,15 +184,15 @@ namespace CommandLineInterface{
if(opt.firstArgs.size() > 1 || opt.unknownArgs.size() > 0 || opt.lastArgs.size() > 0){
for(int i=1; i < opt.firstArgs.size(); ++i) {
std::string arg(opt.firstArgs[i]->c_str());
- DisplayString("ERROR: Invalid option: " + arg + "\n");
+ ShowFatalError("ERROR: Invalid option first arg: " + arg + "\n");
}
for(int i=0; i < opt.unknownArgs.size(); ++i) {
std::string arg(opt.unknownArgs[i]->c_str());
- DisplayString("ERROR: Invalid option: " + arg + "\n");
+ ShowFatalError("ERROR: Invalid option unknown arg: " + arg + "\n");
}
for(int i=0; i < opt.lastArgs.size(); ++i) {
std::string arg(opt.lastArgs[i]->c_str());
- DisplayString("ERROR: Invalid option: " + arg + "\n");
+ ShowFatalError("ERROR: Invalid option last arg: " + arg + "\n");
}
DisplayString(usage);
exit(EXIT_FAILURE);
@@ -119,13 +200,13 @@ namespace CommandLineInterface{
if(!opt.gotRequired(badOptions)) {
for(int i=0; i < badOptions.size(); ++i) {
- DisplayString("ERROR: Missing required option " + badOptions[i] + "\n");
+ ShowFatalError("ERROR: Missing required option " + badOptions[i] + "\n");
}
DisplayString(usage);
exit(EXIT_FAILURE);
}
- // Process arguments
+ // Process standard arguments
if (opt.isSet("-h")) {
DisplayString(usage);
exit(EXIT_SUCCESS);
@@ -136,41 +217,6 @@ namespace CommandLineInterface{
exit(EXIT_SUCCESS);
}
- opt.get("-i")->getString(inputFileName);
-
- opt.get("-w")->getString(inputWeatherFile);
-
- opt.get("-e")->getString(inputEnergyFile);
-
- std::string outputFilePrefix;
-
- if (opt.isSet("-o")) {
- outputFilePrefix =
- inputFileName.substr(0, inputFileName.size()-4) + "_" +
- inputWeatherFile.substr(0, inputWeatherFile.size()-4) + "_";
- }
- else {
- outputFilePrefix = "eplus";
- }
-
- outputAuditFile = outputFilePrefix + "out.audit";
- outputBndFile = outputFilePrefix + "out.bnd";
- outputDxfFile = outputFilePrefix + "out.dxf";
- outputEioFile = outputFilePrefix + "out.eio";
- outputEndFile = outputFilePrefix + "out.end";
- outputErrFile = outputFilePrefix + "out.err";
- outputEsoFile = outputFilePrefix + "out.eso";
- outputMtdFile = outputFilePrefix + "out.mtd";
- outputMddFile = outputFilePrefix + "out.mdd";
- outputMtrFile = outputFilePrefix + "out.mtr";
- outputRddFile = outputFilePrefix + "out.rdd";
- outputShdFile = outputFilePrefix + "out.shd";
- outputCsvFile = outputFilePrefix + "tbl.csv";
- outputHtmFile = outputFilePrefix + "tbl.htm";
- outputTabFile = outputFilePrefix + "tbl.tab";
- outputTxtFile = outputFilePrefix + "tbl.txt";
- outputXmlFile = outputFilePrefix + "tbl.xml";
-
return 0;
}
} //namespace options
diff --git a/src/EnergyPlus/CommandLineInterface.hh b/src/EnergyPlus/CommandLineInterface.hh
index 40012bb235d..91d905b9035 100644
--- a/src/EnergyPlus/CommandLineInterface.hh
+++ b/src/EnergyPlus/CommandLineInterface.hh
@@ -6,26 +6,49 @@ namespace EnergyPlus{
namespace CommandLineInterface {
- extern std::string outputAuditFile;
- extern std::string outputBndFile;
- extern std::string outputDxfFile;
- extern std::string outputEioFile;
- extern std::string outputEndFile;
- extern std::string outputErrFile;
- extern std::string outputEsoFile;
- extern std::string outputMtdFile;
- extern std::string outputMddFile;
- extern std::string outputMtrFile;
- extern std::string outputRddFile;
- extern std::string outputShdFile;
- extern std::string outputCsvFile;
- extern std::string outputHtmFile;
- extern std::string outputTabFile;
- extern std::string outputTxtFile;
- extern std::string outputXmlFile;
- extern std::string inputFileName;
- extern std::string inputEnergyFile;
- extern std::string inputWeatherFile;
+ extern std::string outputAuditFileName;
+ extern std::string outputBndFileName;
+ extern std::string outputDxfFileName;
+ extern std::string outputEioFileName;
+ extern std::string outputEndFileName;
+ extern std::string outputErrFileName;
+ extern std::string outputEsoFileName;
+ extern std::string outputMtdFileName;
+ extern std::string outputMddFileName;
+ extern std::string outputMtrFileName;
+ extern std::string outputRddFileName;
+ extern std::string outputShdFileName;
+ extern std::string outputTblCsvFileName;
+ extern std::string outputTblHtmFileName;
+ extern std::string outputTblTabFileName;
+ extern std::string outputTblTxtFileName;
+ extern std::string outputTblXmlFileName;
+ extern std::string inputIdfFileName;
+ extern std::string inputIddFileName;
+ extern std::string inputWeatherFileName;
+ extern std::string outputAdsFileName;
+ extern std::string outputDfsFileName;
+ extern std::string outputDelightFileName;
+ extern std::string outputMapTabFileName;
+ extern std::string outputMapCsvFileName;
+ extern std::string outputMapTxtFileName;
+ extern std::string outputEddFileName;
+ extern std::string outputIperrFileName;
+ extern std::string outputDbgFileName;
+ extern std::string outputSlnFileName;
+ extern std::string outputSciFileName;
+ extern std::string outputWrlFileName;
+ extern std::string outputZszCsvFileName;
+ extern std::string outputZszTabFileName;
+ extern std::string outputZszTxtFileName;
+ extern std::string outputSszCsvFileName;
+ extern std::string outputSszTabFileName;
+ extern std::string outputSszTxtFileName;
+ extern std::string outputScreenCsvFileName;
+ extern std::string EnergyPlusIniFileName;
+ extern std::string inStatFileName;
+ extern std::string TarcogIterationsFileName;
+ extern std::string eplusADSFileName;
// Process command line arguments
int
diff --git a/src/EnergyPlus/DataStringGlobals.cc b/src/EnergyPlus/DataStringGlobals.cc
index 8cc9f5d04a3..9e90ab221f3 100644
--- a/src/EnergyPlus/DataStringGlobals.cc
+++ b/src/EnergyPlus/DataStringGlobals.cc
@@ -67,7 +67,7 @@ namespace DataStringGlobals {
// na
// MODULE VARIABLE DECLARATIONS:
- std::string ProgramPath; // Path for Program from Energy+.ini
+ std::string ProgramPath; // Path for Program from EnergyPlusIniFileName
std::string CurrentWorkingFolder; // Current working directory for run
std::string FullName; // Full name of file to open, including path
std::string IDDVerString; // Version information from the IDD (line 1)
diff --git a/src/EnergyPlus/DataStringGlobals.hh b/src/EnergyPlus/DataStringGlobals.hh
index 59d61e49f08..58fbef6d49d 100644
--- a/src/EnergyPlus/DataStringGlobals.hh
+++ b/src/EnergyPlus/DataStringGlobals.hh
@@ -35,7 +35,7 @@ namespace DataStringGlobals {
// na
// MODULE VARIABLE DECLARATIONS:
- extern std::string ProgramPath; // Path for Program from Energy+.ini
+ extern std::string ProgramPath; // Path for Program from EnergyPlusIniFileName
extern std::string CurrentWorkingFolder; // Current working directory for run
extern std::string FullName; // Full name of file to open, including path
extern std::string IDDVerString; // Version information from the IDD (line 1)
diff --git a/src/EnergyPlus/DataSystemVariables.cc b/src/EnergyPlus/DataSystemVariables.cc
index 632e67e01ee..e641c1a5b74 100644
--- a/src/EnergyPlus/DataSystemVariables.cc
+++ b/src/EnergyPlus/DataSystemVariables.cc
@@ -187,7 +187,7 @@ namespace DataSystemVariables {
std::string::size_type pos;
if ( firstTime ) {
- EchoInputFile = FindUnitNumber( outputAuditFile );
+ EchoInputFile = FindUnitNumber( outputAuditFileName );
get_environment_variable( cInputPath1, envinputpath1 );
if ( envinputpath1 != blank ) {
pos = index( envinputpath1, pathChar, true ); // look backwards for pathChar
diff --git a/src/EnergyPlus/DaylightingManager.cc b/src/EnergyPlus/DaylightingManager.cc
index f8ffb92fc7c..81a1a73ce5f 100644
--- a/src/EnergyPlus/DaylightingManager.cc
+++ b/src/EnergyPlus/DaylightingManager.cc
@@ -12,6 +12,7 @@
#include
// EnergyPlus Headers
+#include
#include
#include
#include
@@ -91,6 +92,7 @@ namespace DaylightingManager {
// DLUMEF DayltgLuminousEfficacy WeatherManager WeatherManager
// Using/Aliasing
+ using namespace CommandLineInterface;
using namespace DataPrecisionGlobals;
using namespace DataGlobals;
using namespace DataHeatBalance;
@@ -684,9 +686,9 @@ namespace DaylightingManager {
// open a new file eplusout.dfs for saving the daylight factors
if ( CreateDFSReportFile ) {
OutputFileDFS = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); gio::open( OutputFileDFS, "eplusout.dfs", flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( OutputFileDFS, outputDfsFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( "CalcDayltgCoefficients: Could not open file \"eplusout.dfs\" for output (write)." );
+ ShowFatalError( "CalcDayltgCoefficients: Could not open file "+outputDfsFileName+" for output (write)." );
} else {
gio::write( OutputFileDFS, fmtA ) << "This file contains daylight factors for all exterior windows of daylight zones.";
gio::write( OutputFileDFS, fmtA ) << "If only one reference point the last 4 columns in the data will be zero.";
@@ -4048,7 +4050,7 @@ namespace DaylightingManager {
int TotDaylightingDElight; // Total Daylighting:DElight inputs
Real64 dLatitude; // double for argument passing
int iErrorFlag; // Error Flag for warning/errors returned from DElight
- int iDElightErrorFile; // Unit number for reading DElight Error File (eplusout.delightdfdmp)
+ int iDElightErrorFile; // Unit number for reading DElight Error File (eplusout.delightdfdmp or outputDelightFile)
int iReadStatus; // Error File Read Status
std::string cErrorLine; // Each DElight Error line can be up to 210 characters long
std::string cErrorMsg; // Each DElight Error Message can be up to 200 characters long
@@ -4190,7 +4192,7 @@ namespace DaylightingManager {
if ( iErrorFlag != 0 ) {
// Open DElight Daylight Factors Error File for reading
iDElightErrorFile = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "READWRITE" ); gio::open( iDElightErrorFile, "eplusout.delightdfdmp", flags ); }
+ { IOFlags flags; flags.ACTION( "READWRITE" ); gio::open( iDElightErrorFile, outputDelightFileName, flags ); }
// Sequentially read lines in DElight Daylight Factors Error File
// and process them using standard EPlus warning/error handling calls
@@ -4231,7 +4233,7 @@ namespace DaylightingManager {
} else {
// Open, Close, and Delete DElight Daylight Factors Error File for reading
iDElightErrorFile = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "READWRITE" ); gio::open( iDElightErrorFile, "eplusout.delightdfdmp", flags ); }
+ { IOFlags flags; flags.ACTION( "READWRITE" ); gio::open( iDElightErrorFile, outputDelightFileName, flags ); }
{ IOFlags flags; flags.DISPOSE( "DELETE" ); gio::close( iDElightErrorFile, flags ); }
}
SetupDElightOutput4EPlus();
@@ -9324,13 +9326,13 @@ namespace DaylightingManager {
IllumMap( MapNum ).UnitNo = GetNewUnitNumber();
MapNoString = RoundSigDigits( MapNum );
if ( MapColSep == CharTab ) {
- { IOFlags flags; flags.ACTION( "readwrite" ); flags.STATUS( "UNKNOWN" ); gio::open( IllumMap( MapNum ).UnitNo, "eplusmap.tab" + MapNoString, flags ); if ( flags.err() ) goto Label901; }
+ { IOFlags flags; flags.ACTION( "readwrite" ); flags.STATUS( "UNKNOWN" ); gio::open( IllumMap( MapNum ).UnitNo, outputMapTabFileName + MapNoString, flags ); if ( flags.err() ) goto Label901; }
CommaDelimited = false;
} else if ( MapColSep == CharComma ) {
- { IOFlags flags; flags.ACTION( "readwrite" ); flags.STATUS( "UNKNOWN" ); gio::open( IllumMap( MapNum ).UnitNo, "eplusmap.csv" + MapNoString, flags ); if ( flags.err() ) goto Label902; }
+ { IOFlags flags; flags.ACTION( "readwrite" ); flags.STATUS( "UNKNOWN" ); gio::open( IllumMap( MapNum ).UnitNo, outputMapCsvFileName + MapNoString, flags ); if ( flags.err() ) goto Label902; }
CommaDelimited = true;
} else {
- { IOFlags flags; flags.ACTION( "readwrite" ); flags.STATUS( "UNKNOWN" ); gio::open( IllumMap( MapNum ).UnitNo, "eplusmap.txt" + MapNoString, flags ); if ( flags.err() ) goto Label903; }
+ { IOFlags flags; flags.ACTION( "readwrite" ); flags.STATUS( "UNKNOWN" ); gio::open( IllumMap( MapNum ).UnitNo, outputMapTxtFileName + MapNoString, flags ); if ( flags.err() ) goto Label903; }
CommaDelimited = false;
}
@@ -9436,15 +9438,15 @@ namespace DaylightingManager {
return;
Label901: ;
- ShowFatalError( "ReportIllumMap: Could not open file \"eplusmap.tab" + MapNoString + "\" for output (write)." );
+ ShowFatalError( "ReportIllumMap: Could not open file "+ outputMapTabFileName + MapNoString + "\" for output (write)." );
return;
Label902: ;
- ShowFatalError( "ReportIllumMap: Could not open file \"eplusmap.csv" + MapNoString + "\" for output (write)." );
+ ShowFatalError( "ReportIllumMap: Could not open file "+ outputMapCsvFileName + MapNoString + "\" for output (write)." );
return;
Label903: ;
- ShowFatalError( "ReportIllumMap: Could not open file \"eplusmap.txt" + MapNoString + "\" for output (write)." );
+ ShowFatalError( "ReportIllumMap: Could not open file "+ outputMapTxtFileName + MapNoString + "\" for output (write)." );
}
@@ -9500,11 +9502,11 @@ Label903: ;
// Write map header
if ( MapColSep == CharTab ) {
- { IOFlags flags; flags.ACTION( "write" ); flags.STATUS( "UNKNOWN" ); gio::open( MapOutputFile, "eplusmap.tab", flags ); if ( flags.err() ) goto Label901; }
+ { IOFlags flags; flags.ACTION( "write" ); flags.STATUS( "UNKNOWN" ); gio::open( MapOutputFile, outputMapTabFileName, flags ); if ( flags.err() ) goto Label901; }
} else if ( MapColSep == CharComma ) {
- { IOFlags flags; flags.ACTION( "write" ); flags.STATUS( "UNKNOWN" ); gio::open( MapOutputFile, "eplusmap.csv", flags ); if ( flags.err() ) goto Label902; }
+ { IOFlags flags; flags.ACTION( "write" ); flags.STATUS( "UNKNOWN" ); gio::open( MapOutputFile, outputMapCsvFileName, flags ); if ( flags.err() ) goto Label902; }
} else {
- { IOFlags flags; flags.ACTION( "write" ); flags.STATUS( "UNKNOWN" ); gio::open( MapOutputFile, "eplusmap.txt", flags ); if ( flags.err() ) goto Label903; }
+ { IOFlags flags; flags.ACTION( "write" ); flags.STATUS( "UNKNOWN" ); gio::open( MapOutputFile, outputMapTxtFileName, flags ); if ( flags.err() ) goto Label903; }
}
for ( MapNum = 1; MapNum <= TotIllumMaps; ++MapNum ) {
@@ -9540,15 +9542,15 @@ Label903: ;
return;
Label901: ;
- ShowFatalError( "CloseReportIllumMaps: Could not open file \"eplusmap.tab\" for output (write)." );
+ ShowFatalError( "CloseReportIllumMaps: Could not open file "+outputMapTabFileName+" for output (write)." );
return;
Label902: ;
- ShowFatalError( "CloseReportIllumMaps: Could not open file \"eplusmap.csv\" for output (write)." );
+ ShowFatalError( "CloseReportIllumMaps: Could not open file "+outputMapCsvFileName+" for output (write)." );
return;
Label903: ;
- ShowFatalError( "CloseReportIllumMaps: Could not open file \"eplusmap.txt\" for output (write)." );
+ ShowFatalError( "CloseReportIllumMaps: Could not open file "+outputMapTxtFileName+" for output (write)." );
}
diff --git a/src/EnergyPlus/EMSManager.cc b/src/EnergyPlus/EMSManager.cc
index 993aad2b499..e96e78e0200 100644
--- a/src/EnergyPlus/EMSManager.cc
+++ b/src/EnergyPlus/EMSManager.cc
@@ -9,6 +9,7 @@
// EnergyPlus Headers
#include
+#include
#include
#include
#include
@@ -46,6 +47,7 @@ namespace EMSManager {
// METHODOLOGY EMPLOYED:
// Using/Aliasing
+ using namespace CommandLineInterface;
using namespace DataPrecisionGlobals;
using namespace DataRuntimeLanguage;
@@ -189,9 +191,9 @@ namespace EMSManager {
if ( OutputEDDFile ) {
// open up output file for EMS EDD file EMS Data and Debug
OutputEMSFileUnitNum = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); gio::open( OutputEMSFileUnitNum, "eplusout.edd", flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( OutputEMSFileUnitNum, outputEddFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( "CheckIFAnyEMS: Could not open file \"eplusout.edd\" for output (write)." );
+ ShowFatalError( "CheckIFAnyEMS: Could not open file "+ outputEddFileName +" for output (write)." );
}
}
} else {
diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc
index ba8580ba5ea..04eb777b8c8 100644
--- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc
+++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc
@@ -13,6 +13,7 @@
// EnergyPlus Headers
#include
+#include
#include
#include
#include
@@ -96,6 +97,7 @@ namespace HeatBalanceSurfaceManager {
// USE STATEMENTS:
// Use statements for data only modules
// Using/Aliasing
+ using namespace CommandLineInterface;
using namespace DataPrecisionGlobals;
using namespace DataGlobals;
using namespace DataEnvironment;
@@ -492,7 +494,7 @@ namespace HeatBalanceSurfaceManager {
// Open DElight Electric Lighting Error File for reading
iDElightErrorFile = GetNewUnitNumber();
// RJH 2008-03-07: open file with READWRITE
- { IOFlags flags; flags.ACTION( "READWRITE" ); gio::open( iDElightErrorFile, "eplusout.delighteldmp", flags ); iwriteStatus = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "READWRITE" ); gio::open( iDElightErrorFile, outputDelightFileName, flags ); iwriteStatus = flags.ios(); }
if ( iwriteStatus == 0 ) {
elOpened = true;
} else {
@@ -536,7 +538,7 @@ namespace HeatBalanceSurfaceManager {
// extract reference point illuminance values from DElight Electric Lighting dump file for reporting
// Open DElight Electric Lighting Dump File for reading
iDElightErrorFile = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "READWRITE" ); gio::open( iDElightErrorFile, "eplusout.delighteldmp", flags ); iwriteStatus = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "READWRITE" ); gio::open( iDElightErrorFile, outputDelightFileName, flags ); iwriteStatus = flags.ios(); }
// IF (iwriteStatus /= 0) THEN
// CALL ShowFatalError('InitSurfaceHeatBalance: Could not open file "eplusout.delighteldmp" for output (readwrite).')
// ENDIF
diff --git a/src/EnergyPlus/InputProcessor.cc b/src/EnergyPlus/InputProcessor.cc
index cbbb3dbe94a..2d7c2c081ec 100644
--- a/src/EnergyPlus/InputProcessor.cc
+++ b/src/EnergyPlus/InputProcessor.cc
@@ -231,50 +231,50 @@ namespace InputProcessor {
InitSecretObjects();
EchoInputFile = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); gio::open( EchoInputFile, outputAuditFile, flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( EchoInputFile, outputAuditFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- DisplayString( "Could not open (write) "+ outputAuditFile + " ." );
- ShowFatalError( "ProcessInput: Could not open file " + outputAuditFile + " for output (write)." );
+ DisplayString( "Could not open (write) "+ outputAuditFileName + " ." );
+ ShowFatalError( "ProcessInput: Could not open file " + outputAuditFileName + " for output (write)." );
}
{ IOFlags flags; gio::inquire( "eplusout.iperr", flags ); FileExists = flags.exists(); }
if ( FileExists ) {
CacheIPErrorFile = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "read" ); gio::open( CacheIPErrorFile, "eplusout.iperr", flags ); read_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "read" ); gio::open( CacheIPErrorFile, outputIperrFileName, flags ); read_stat = flags.ios(); }
if ( read_stat != 0 ) {
- ShowFatalError( "EnergyPlus: Could not open file \"eplusout.iperr\" for input (read)." );
+ ShowFatalError( "EnergyPlus: Could not open file "+outputIperrFileName+" for input (read)." );
}
{ IOFlags flags; flags.DISPOSE( "delete" ); gio::close( CacheIPErrorFile, flags ); }
}
CacheIPErrorFile = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); gio::open( CacheIPErrorFile, "eplusout.iperr", flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( CacheIPErrorFile, outputIperrFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- DisplayString( "Could not open (write) eplusout.iperr." );
- ShowFatalError( "ProcessInput: Could not open file " + outputAuditFile + " for output (write)." );
+ DisplayString( "Could not open (write) "+outputIperrFileName );
+ ShowFatalError( "ProcessInput: Could not open file " + outputAuditFileName + " for output (write)." );
}
// FullName from StringGlobals is used to build file name with Path
if ( len( ProgramPath ) == 0 ) {
- FullName = inputEnergyFile;
+ FullName = inputIddFileName;
} else {
- FullName = ProgramPath + inputEnergyFile;
+ FullName = ProgramPath + inputIddFileName;
}
{ IOFlags flags; gio::inquire( FullName, flags ); FileExists = flags.exists(); }
if ( ! FileExists ) {
DisplayString( "Missing " + FullName );
- ShowFatalError( "ProcessInput: " + inputEnergyFile + " missing. Program terminates. Fullname = " + FullName );
+ ShowFatalError( "ProcessInput: " + inputIddFileName + " missing. Program terminates. Fullname = " + FullName );
}
IDDFile = GetNewUnitNumber();
{ IOFlags flags; flags.ACTION( "read" ); gio::open( IDDFile, FullName, flags ); read_stat = flags.ios(); }
if ( read_stat != 0 ) {
- DisplayString( "Could not open (read) " + inputEnergyFile );
- ShowFatalError( "ProcessInput: Could not open file " + inputEnergyFile + " for input (read)." );
+ DisplayString( "Could not open (read) " + inputIddFileName );
+ ShowFatalError( "ProcessInput: Could not open file " + inputIddFileName + " for input (read)." );
}
gio::read( IDDFile, fmtA ) >> InputLine;
endcol = len( InputLine );
if ( endcol > 0 ) {
if ( int( InputLine[ endcol - 1 ] ) == iUnicode_end ) {
- ShowSevereError( "ProcessInput: " + inputEnergyFile + " appears to be a Unicode or binary file." );
+ ShowSevereError( "ProcessInput: " + inputIddFileName + " appears to be a Unicode or binary file." );
ShowContinueError( "...This file cannot be read by this program. Please save as PC or Unix file and try again" );
ShowFatalError( "Program terminates due to previous condition." );
}
@@ -283,7 +283,7 @@ namespace InputProcessor {
NumLines = 0;
DoingInputProcessing = true;
- gio::write( EchoInputFile, fmtLD ) << " Processing Data Dictionary ("+inputEnergyFile+") File -- Start";
+ gio::write( EchoInputFile, fmtLD ) << " Processing Data Dictionary ("+inputIddFileName+") File -- Start";
DisplayString( "Processing Data Dictionary" );
ProcessingIDD = true;
@@ -313,7 +313,7 @@ namespace InputProcessor {
}
ProcessingIDD = false;
- gio::write( EchoInputFile, fmtLD ) << " Processing Data Dictionary ("+inputEnergyFile+") File -- Complete";
+ gio::write( EchoInputFile, fmtLD ) << " Processing Data Dictionary ("+inputIddFileName+") File -- Complete";
gio::write( EchoInputFile, fmtLD ) << " Maximum number of Alpha Args=" << MaxAlphaArgsFound;
gio::write( EchoInputFile, fmtLD ) << " Maximum number of Numeric Args=" << MaxNumericArgsFound;
@@ -325,23 +325,23 @@ namespace InputProcessor {
gio::write( EchoInputFile, fmtLD ) << " Processing Input Data File (inputFileName) -- Start";
- { IOFlags flags; gio::inquire( inputFileName, flags ); FileExists = flags.exists(); }
+ { IOFlags flags; gio::inquire( inputIdfFileName, flags ); FileExists = flags.exists(); }
if ( ! FileExists ) {
- DisplayString( "Missing " + CurrentWorkingFolder + inputFileName );
- ShowFatalError( "ProcessInput: " + inputFileName + " missing. Program terminates." );
+ DisplayString( "Missing " + CurrentWorkingFolder + inputIdfFileName );
+ ShowFatalError( "ProcessInput: " + inputIdfFileName + " missing. Program terminates." );
}
IDFFile = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "READ" ); gio::open( IDFFile, inputFileName, flags ); read_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "READ" ); gio::open( IDFFile, inputIdfFileName, flags ); read_stat = flags.ios(); }
if ( read_stat != 0 ) {
- DisplayString( "Could not open (read)" + inputFileName );
+ DisplayString( "Could not open (read)" + inputIdfFileName );
ShowFatalError( "ProcessInput: Could not open file \"in.idf\" for input (read)." );
}
gio::read( IDFFile, fmtA ) >> InputLine;
endcol = len( InputLine );
if ( endcol > 0 ) {
if ( int( InputLine[ endcol - 1 ] ) == iUnicode_end ) {
- ShowSevereError( "ProcessInput: " + inputFileName +" appears to be a Unicode or binary file." );
+ ShowSevereError( "ProcessInput: " + inputIdfFileName +" appears to be a Unicode or binary file." );
ShowContinueError( "...This file cannot be read by this program. Please save as PC or Unix file and try again" );
ShowFatalError( "Program terminates due to previous condition." );
}
@@ -627,7 +627,7 @@ namespace InputProcessor {
ErrorsFound = true;
}
} else {
- ShowSevereError( "IP: Blank Sections not allowed. Review " + outputAuditFile + " file.", EchoInputFile );
+ ShowSevereError( "IP: Blank Sections not allowed. Review " + outputAuditFileName + " file.", EchoInputFile );
errFlag = true;
ErrorsFound = true;
}
diff --git a/src/EnergyPlus/OutputProcessor.cc b/src/EnergyPlus/OutputProcessor.cc
index d7de5116592..6469c0bf150 100644
--- a/src/EnergyPlus/OutputProcessor.cc
+++ b/src/EnergyPlus/OutputProcessor.cc
@@ -1581,9 +1581,9 @@ namespace OutputProcessor {
int write_stat;
OutputFileMeterDetails = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); gio::open( OutputFileMeterDetails, outputMtdFile, flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( OutputFileMeterDetails, outputMtdFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( "InitializeMeters: Could not open file "+outputMtdFile+" for output (write)." );
+ ShowFatalError( "InitializeMeters: Could not open file "+outputMtdFileName+" for output (write)." );
}
}
@@ -6694,7 +6694,7 @@ SetInitialMeterReportingAndOutputNames(
if ( ! CumulativeIndicator ) {
if ( MeterFileOnlyIndicator ) {
if ( EnergyMeters( WhichMeter ).RptTS ) {
- ShowWarningError( "Output:Meter:MeterFileOnly requested for \"" + EnergyMeters( WhichMeter ).Name + "\" (TimeStep), " "already on \"Output:Meter\". Will report to both " + outputEsoFile + " and " +outputMtrFile );
+ ShowWarningError( "Output:Meter:MeterFileOnly requested for \"" + EnergyMeters( WhichMeter ).Name + "\" (TimeStep), " "already on \"Output:Meter\". Will report to both " + outputEsoFileName + " and " +outputMtrFileName );
}
}
if ( ! EnergyMeters( WhichMeter ).RptTS ) {
@@ -6707,7 +6707,7 @@ SetInitialMeterReportingAndOutputNames(
} else {
if ( MeterFileOnlyIndicator ) {
if ( EnergyMeters( WhichMeter ).RptAccTS ) {
- ShowWarningError( "Output:Meter:MeterFileOnly requested for \"Cumulative " + EnergyMeters( WhichMeter ).Name + "\" (TimeStep), " "already on \"Output:Meter\". Will report to both "+outputEsoFile+ " and " +outputMtrFile );
+ ShowWarningError( "Output:Meter:MeterFileOnly requested for \"Cumulative " + EnergyMeters( WhichMeter ).Name + "\" (TimeStep), " "already on \"Output:Meter\". Will report to both "+outputEsoFileName+ " and " +outputMtrFileName );
}
}
if ( ! EnergyMeters( WhichMeter ).RptAccTS ) {
@@ -6722,7 +6722,7 @@ SetInitialMeterReportingAndOutputNames(
if ( ! CumulativeIndicator ) {
if ( MeterFileOnlyIndicator ) {
if ( EnergyMeters( WhichMeter ).RptHR ) {
- ShowWarningError( "Output:Meter:MeterFileOnly requested for \"" + EnergyMeters( WhichMeter ).Name + "\" (Hourly), " "already on \"Output:Meter\". Will report to both " + outputEsoFile + " and " +outputMtrFile );
+ ShowWarningError( "Output:Meter:MeterFileOnly requested for \"" + EnergyMeters( WhichMeter ).Name + "\" (Hourly), " "already on \"Output:Meter\". Will report to both " + outputEsoFileName + " and " +outputMtrFileName );
}
}
if ( ! EnergyMeters( WhichMeter ).RptHR ) {
@@ -6736,7 +6736,7 @@ SetInitialMeterReportingAndOutputNames(
} else {
if ( MeterFileOnlyIndicator ) {
if ( EnergyMeters( WhichMeter ).RptAccHR ) {
- ShowWarningError( "Output:Meter:MeterFileOnly requested for \"Cumulative " + EnergyMeters( WhichMeter ).Name + "\" (Hourly), " "already on \"Output:Meter\". Will report to both " + outputEsoFile + " and " +outputMtrFile );
+ ShowWarningError( "Output:Meter:MeterFileOnly requested for \"Cumulative " + EnergyMeters( WhichMeter ).Name + "\" (Hourly), " "already on \"Output:Meter\". Will report to both " + outputEsoFileName + " and " +outputMtrFileName );
}
}
if ( ! EnergyMeters( WhichMeter ).RptAccHR ) {
@@ -6752,7 +6752,7 @@ SetInitialMeterReportingAndOutputNames(
if ( ! CumulativeIndicator ) {
if ( MeterFileOnlyIndicator ) {
if ( EnergyMeters( WhichMeter ).RptDY ) {
- ShowWarningError( "Output:Meter:MeterFileOnly requested for \"" + EnergyMeters( WhichMeter ).Name + "\" (Daily), " "already on \"Output:Meter\". Will report to both " +outputEsoFile+ " and " +outputMtrFile );
+ ShowWarningError( "Output:Meter:MeterFileOnly requested for \"" + EnergyMeters( WhichMeter ).Name + "\" (Daily), " "already on \"Output:Meter\". Will report to both " +outputEsoFileName+ " and " +outputMtrFileName );
}
}
if ( ! EnergyMeters( WhichMeter ).RptDY ) {
@@ -6766,7 +6766,7 @@ SetInitialMeterReportingAndOutputNames(
} else {
if ( MeterFileOnlyIndicator ) {
if ( EnergyMeters( WhichMeter ).RptAccDY ) {
- ShowWarningError( "Output:Meter:MeterFileOnly requested for \"Cumulative " + EnergyMeters( WhichMeter ).Name + "\" (Hourly), " "already on \"Output:Meter\". Will report to both "+outputEsoFile+ " and " +outputMtrFile );
+ ShowWarningError( "Output:Meter:MeterFileOnly requested for \"Cumulative " + EnergyMeters( WhichMeter ).Name + "\" (Hourly), " "already on \"Output:Meter\". Will report to both "+outputEsoFileName+ " and " +outputMtrFileName );
}
}
if ( ! EnergyMeters( WhichMeter ).RptAccDY ) {
@@ -6782,7 +6782,7 @@ SetInitialMeterReportingAndOutputNames(
if ( ! CumulativeIndicator ) {
if ( MeterFileOnlyIndicator ) {
if ( EnergyMeters( WhichMeter ).RptMN ) {
- ShowWarningError( "Output:Meter:MeterFileOnly requested for \"" + EnergyMeters( WhichMeter ).Name + "\" (Monthly), " "already on \"Output:Meter\". Will report to both "+outputEsoFile+ " and " +outputMtrFile );
+ ShowWarningError( "Output:Meter:MeterFileOnly requested for \"" + EnergyMeters( WhichMeter ).Name + "\" (Monthly), " "already on \"Output:Meter\". Will report to both "+outputEsoFileName+ " and " +outputMtrFileName );
}
}
if ( ! EnergyMeters( WhichMeter ).RptMN ) {
@@ -6796,7 +6796,7 @@ SetInitialMeterReportingAndOutputNames(
} else {
if ( MeterFileOnlyIndicator ) {
if ( EnergyMeters( WhichMeter ).RptAccMN ) {
- ShowWarningError( "Output:Meter:MeterFileOnly requested for \"Cumulative " + EnergyMeters( WhichMeter ).Name + "\" (Monthly), " "already on \"Output:Meter\". Will report to both "+outputEsoFile+ " and " +outputMtrFile );
+ ShowWarningError( "Output:Meter:MeterFileOnly requested for \"Cumulative " + EnergyMeters( WhichMeter ).Name + "\" (Monthly), " "already on \"Output:Meter\". Will report to both "+outputEsoFileName+ " and " +outputMtrFileName );
}
}
if ( ! EnergyMeters( WhichMeter ).RptAccMN ) {
@@ -6812,7 +6812,7 @@ SetInitialMeterReportingAndOutputNames(
if ( ! CumulativeIndicator ) {
if ( MeterFileOnlyIndicator ) {
if ( EnergyMeters( WhichMeter ).RptSM ) {
- ShowWarningError( "Output:Meter:MeterFileOnly requested for \"" + EnergyMeters( WhichMeter ).Name + "\" (RunPeriod), " "already on \"Output:Meter\". Will report to both "+outputEsoFile+" and " +outputMtrFile );
+ ShowWarningError( "Output:Meter:MeterFileOnly requested for \"" + EnergyMeters( WhichMeter ).Name + "\" (RunPeriod), " "already on \"Output:Meter\". Will report to both "+outputEsoFileName+" and " +outputMtrFileName );
}
}
if ( ! EnergyMeters( WhichMeter ).RptSM ) {
@@ -6826,7 +6826,7 @@ SetInitialMeterReportingAndOutputNames(
} else {
if ( MeterFileOnlyIndicator ) {
if ( EnergyMeters( WhichMeter ).RptAccSM ) {
- ShowWarningError( "Output:Meter:MeterFileOnly requested for \"Cumulative " + EnergyMeters( WhichMeter ).Name + "\" (RunPeriod), " "already on \"Output:Meter\". Will report to both "+outputEsoFile+" and " +outputMtrFile );
+ ShowWarningError( "Output:Meter:MeterFileOnly requested for \"Cumulative " + EnergyMeters( WhichMeter ).Name + "\" (RunPeriod), " "already on \"Output:Meter\". Will report to both "+outputEsoFileName+" and " +outputMtrFileName );
}
}
if ( ! EnergyMeters( WhichMeter ).RptAccSM ) {
@@ -8259,31 +8259,31 @@ ProduceRDDMDD()
if ( ProduceReportVDD == ReportVDD_Yes ) {
OutputFileRVDD = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); gio::open( OutputFileRVDD, outputRddFile, flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( OutputFileRVDD, outputRddFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( "ProduceRDDMDD: Could not open file "+outputRddFile+" for output (write)." );
+ ShowFatalError( "ProduceRDDMDD: Could not open file "+outputRddFileName+" for output (write)." );
}
gio::write( OutputFileRVDD, fmtA ) << "Program Version," + VerString + ',' + IDDVerString;
gio::write( OutputFileRVDD, fmtA ) << "Var Type (reported time step),Var Report Type,Variable Name [Units]";
OutputFileMVDD = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); gio::open( OutputFileMVDD, outputMddFile, flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( OutputFileMVDD, outputMddFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( "ProduceRDDMDD: Could not open file "+outputMddFile+" for output (write)." );
+ ShowFatalError( "ProduceRDDMDD: Could not open file "+outputMddFileName+" for output (write)." );
}
gio::write( OutputFileMVDD, fmtA ) << "Program Version," + VerString + ',' + IDDVerString;
gio::write( OutputFileMVDD, fmtA ) << "Var Type (reported time step),Var Report Type,Variable Name [Units]";
} else if ( ProduceReportVDD == ReportVDD_IDF ) {
OutputFileRVDD = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); gio::open( OutputFileRVDD, outputRddFile, flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( OutputFileRVDD, outputRddFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( "ProduceRDDMDD: Could not open file "+outputRddFile+" for output (write)." );
+ ShowFatalError( "ProduceRDDMDD: Could not open file "+outputRddFileName+" for output (write)." );
}
gio::write( OutputFileRVDD, fmtA ) << "! Program Version," + VerString + ',' + IDDVerString;
gio::write( OutputFileRVDD, fmtA ) << "! Output:Variable Objects (applicable to this run)";
OutputFileMVDD = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); gio::open( OutputFileMVDD, outputMddFile, flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( OutputFileMVDD, outputMddFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( "ProduceRDDMDD: Could not open file "+outputMddFile+" for output (write)." );
+ ShowFatalError( "ProduceRDDMDD: Could not open file "+outputMddFileName+" for output (write)." );
}
gio::write( OutputFileMVDD, fmtA ) << "! Program Version," + VerString + ',' + IDDVerString;
gio::write( OutputFileMVDD, fmtA ) << "! Output:Meter Objects (applicable to this run)";
diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc
index 6e3b76aab58..775acf1257e 100644
--- a/src/EnergyPlus/OutputReportTabular.cc
+++ b/src/EnergyPlus/OutputReportTabular.cc
@@ -3111,9 +3111,9 @@ namespace OutputReportTabular {
curDel = del( iStyle );
if ( TableStyle( iStyle ) == tableStyleComma ) {
DisplayString( "Writing tabular output file results using comma format." );
- { IOFlags flags; flags.ACTION( "WRITE" ); gio::open( curFH, outputCsvFile, flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "WRITE" ); gio::open( curFH, outputTblCsvFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( "OpenOutputTabularFile: Could not open file (" + outputCsvFile + ") for output (write)." );
+ ShowFatalError( "OpenOutputTabularFile: Could not open file (" + outputTblCsvFileName + ") for output (write)." );
}
gio::write( curFH, fmtA ) << "Program Version:" + curDel + VerString;
gio::write( curFH, fmtLD ) << "Tabular Output Report in Format: " + curDel + "Comma";
@@ -3127,9 +3127,9 @@ namespace OutputReportTabular {
gio::write( curFH, fmtA ) << "";
} else if ( TableStyle( iStyle ) == tableStyleTab ) {
DisplayString( "Writing tabular output file results using tab format." );
- { IOFlags flags; flags.ACTION( "WRITE" ); gio::open( curFH, outputTabFile, flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "WRITE" ); gio::open( curFH, outputTblTabFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( "OpenOutputTabularFile: Could not open file "+outputTabFile+" for output (write)." );
+ ShowFatalError( "OpenOutputTabularFile: Could not open file "+outputTblTabFileName+" for output (write)." );
}
gio::write( curFH, fmtA ) << "Program Version" + curDel + VerString;
gio::write( curFH, fmtA ) << "Tabular Output Report in Format: " + curDel + "Tab";
@@ -3143,9 +3143,9 @@ namespace OutputReportTabular {
gio::write( curFH, fmtA ) << "";
} else if ( TableStyle( iStyle ) == tableStyleHTML ) {
DisplayString( "Writing tabular output file results using HTML format." );
- { IOFlags flags; flags.ACTION( "WRITE" ); gio::open( curFH, outputHtmFile, flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "WRITE" ); gio::open( curFH, outputTblHtmFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( "OpenOutputTabularFile: Could not open file "+outputHtmFile+" for output (write)." );
+ ShowFatalError( "OpenOutputTabularFile: Could not open file "+outputTblHtmFileName+" for output (write)." );
}
gio::write( curFH, fmtA ) << "";
gio::write( curFH, fmtA ) << "";
@@ -3174,9 +3174,9 @@ namespace OutputReportTabular {
gio::write( curFH, TimeStampFmt2 ) << " " << td( 5 ) << ":" << td( 6 ) << ":" << td( 7 ) << "";
} else if ( TableStyle( iStyle ) == tableStyleXML ) {
DisplayString( "Writing tabular output file results using XML format." );
- { IOFlags flags; flags.ACTION( "WRITE" ); gio::open( curFH, outputXmlFile, flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "WRITE" ); gio::open( curFH, outputTblXmlFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( "OpenOutputTabularFile: Could not open file "+outputXmlFile+" for output (write)." );
+ ShowFatalError( "OpenOutputTabularFile: Could not open file "+outputTblXmlFileName+" for output (write)." );
}
gio::write( curFH, fmtA ) << "";
gio::write( curFH, fmtA ) << "";
@@ -3195,9 +3195,9 @@ namespace OutputReportTabular {
gio::write( curFH );
} else {
DisplayString( "Writing tabular output file results using text format." );
- { IOFlags flags; flags.ACTION( "write" ); gio::open( curFH, outputTxtFile, flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( curFH, outputTblTxtFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( "OpenOutputTabularFile: Could not open file "+outputTxtFile+" for output (write)." );
+ ShowFatalError( "OpenOutputTabularFile: Could not open file "+outputTblTxtFileName+" for output (write)." );
}
gio::write( curFH, fmtA ) << "Program Version: " + VerString;
gio::write( curFH, fmtA ) << "Tabular Output Report in Format: " + curDel + "Fixed";
@@ -4827,7 +4827,7 @@ namespace OutputReportTabular {
WriteTimeBinTables();
}
}
- EchoInputFile = FindUnitNumber( outputAuditFile );
+ EchoInputFile = FindUnitNumber( outputAuditFileName );
gio::write( EchoInputFile, fmtLD ) << "MonthlyInputCount=" << MonthlyInputCount;
gio::write( EchoInputFile, fmtLD ) << "sizeMonthlyInput=" << sizeMonthlyInput;
gio::write( EchoInputFile, fmtLD ) << "MonthlyFieldSetInputCount=" << MonthlyFieldSetInputCount;
@@ -4943,7 +4943,7 @@ namespace OutputReportTabular {
bool coolingDesignlinepassed;
bool desConditionlinepassed;
- { IOFlags flags; gio::inquire( "in.stat", flags ); fileExists = flags.exists(); }
+ { IOFlags flags; gio::inquire( inStatFileName, flags ); fileExists = flags.exists(); }
readStat = 0;
isASHRAE = false;
iscalc = false;
@@ -4956,9 +4956,9 @@ namespace OutputReportTabular {
lineTypeinterim = 0;
if ( fileExists ) {
statFile = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "READ" ); gio::open( statFile, "in.stat", flags ); readStat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "READ" ); gio::open( statFile, inStatFileName, flags ); readStat = flags.ios(); }
if ( readStat != 0 ) {
- ShowFatalError( "FillWeatherPredefinedEntries: Could not open file \"in.stat\" for input (read)." );
+ ShowFatalError( "FillWeatherPredefinedEntries: Could not open file "+inStatFileName+" for input (read)." );
}
IOFlags flags;
while ( readStat == 0 ) { //end of file, or error
diff --git a/src/EnergyPlus/OutputReports.cc b/src/EnergyPlus/OutputReports.cc
index e464458b5f9..9ffa038255d 100644
--- a/src/EnergyPlus/OutputReports.cc
+++ b/src/EnergyPlus/OutputReports.cc
@@ -232,9 +232,9 @@ LinesOut( std::string const & option )
optiondone = true;
unit = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); gio::open( unit, "eplusout.sln", flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( unit, outputSlnFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( "LinesOut: Could not open file \"eplusout.sln\" for output (write)." );
+ ShowFatalError( "LinesOut: Could not open file "+ outputSlnFileName +" for output (write)." );
}
if ( option != "IDF" ) {
@@ -422,9 +422,9 @@ DXFOut(
}
unit = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); gio::open( unit, outputDxfFile, flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( unit, outputDxfFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( "DXFOut: Could not open file "+outputDxfFile+" for output (write)." );
+ ShowFatalError( "DXFOut: Could not open file "+outputDxfFileName+" for output (write)." );
}
gio::write( unit, Format_702 ); // Start of Entities section
@@ -915,9 +915,9 @@ DXFOutLines( std::string const & ColorScheme )
}
unit = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); gio::open( unit, outputDxfFile, flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( unit, outputDxfFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( "DXFOutLines: Could not open file "+outputDxfFile+" for output (write)." );
+ ShowFatalError( "DXFOutLines: Could not open file "+outputDxfFileName+" for output (write)." );
}
gio::write( unit, Format_702 ); // Start of Entities section
@@ -1342,9 +1342,9 @@ DXFOutWireFrame( std::string const & ColorScheme )
}
unit = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); gio::open( unit, outputDxfFile, flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( unit, outputDxfFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( "DXFOutWireFrame: Could not open file "+outputDxfFile+" for output (write)." );
+ ShowFatalError( "DXFOutWireFrame: Could not open file "+outputDxfFileName+" for output (write)." );
}
gio::write( unit, Format_702 ); // Start of Entities section
@@ -2118,9 +2118,9 @@ CostInfoOut()
unit = GetNewUnitNumber();
// .sci = surface cost info
- { IOFlags flags; flags.ACTION( "write" ); gio::open( unit, "eplusout.sci", flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( unit, outputSciFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( "CostInfoOut: Could not open file \"eplusout.sci\" for output (write)." );
+ ShowFatalError( "CostInfoOut: Could not open file "+outputSciFileName+" for output (write)." );
}
gio::write( unit, fmtLD ) << TotSurfaces << int( count( uniqueSurf ) );
gio::write( unit, fmtLD ) << "data for surfaces useful for cost information";
@@ -2247,9 +2247,9 @@ VRMLOut(
}
unit = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); gio::open( unit, "eplusout.wrl", flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( unit, outputWrlFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( "VRMLOut: Could not open file \"eplusout.wrl\" for output (write)." );
+ ShowFatalError( "VRMLOut: Could not open file "+ outputWrlFileName +" for output (write)." );
}
gio::write( unit, Format_702 ); // Beginning
diff --git a/src/EnergyPlus/ScheduleManager.cc b/src/EnergyPlus/ScheduleManager.cc
index b6c455f3693..f76d255b4d6 100644
--- a/src/EnergyPlus/ScheduleManager.cc
+++ b/src/EnergyPlus/ScheduleManager.cc
@@ -474,7 +474,7 @@ namespace ScheduleManager {
Schedule( 0 ).ScheduleTypePtr = 0;
Schedule( 0 ).WeekSchedulePointer = 0;
- UnitNumber = FindUnitNumber( outputAuditFile );
+ UnitNumber = FindUnitNumber( outputAuditFileName );
gio::write( UnitNumber, fmtLD ) << " Processing Schedule Input -- Start";
//!! Get Schedule Types
diff --git a/src/EnergyPlus/SimulationManager.cc b/src/EnergyPlus/SimulationManager.cc
index e2cd8952ca4..d4669e317e3 100644
--- a/src/EnergyPlus/SimulationManager.cc
+++ b/src/EnergyPlus/SimulationManager.cc
@@ -1044,7 +1044,7 @@ namespace SimulationManager {
NumDesignDays = GetNumObjectsFound( "SizingPeriod:DesignDay" );
NumRunPeriodDesign = GetNumObjectsFound( "SizingPeriod:WeatherFileDays" ) + GetNumObjectsFound( "SizingPeriod:WeatherFileConditionType" );
NumSizingDays = NumDesignDays + NumRunPeriodDesign;
- { IOFlags flags; gio::inquire( inputWeatherFile, flags ); WeatherFileAttached = flags.exists(); }
+ { IOFlags flags; gio::inquire( inputWeatherFileName, flags ); WeatherFileAttached = flags.exists(); }
if ( RunControlInInput ) {
if ( DoZoneSizing ) {
@@ -1207,34 +1207,34 @@ namespace SimulationManager {
// FLOW:
OutputFileStandard = GetNewUnitNumber();
StdOutputRecordCount = 0;
- { IOFlags flags; flags.ACTION( "write" ); flags.STATUS( "UNKNOWN" ); gio::open( OutputFileStandard, outputEsoFile, flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); flags.STATUS( "UNKNOWN" ); gio::open( OutputFileStandard, outputEsoFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( "OpenOutputFiles: Could not open file "+outputEsoFile+" for output (write)." );
+ ShowFatalError( "OpenOutputFiles: Could not open file "+outputEsoFileName+" for output (write)." );
}
gio::write( OutputFileStandard, fmtA ) << "Program Version," + VerString;
// Open the Initialization Output File
OutputFileInits = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); flags.STATUS( "UNKNOWN" ); gio::open( OutputFileInits, outputEioFile, flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); flags.STATUS( "UNKNOWN" ); gio::open( OutputFileInits, outputEioFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( "OpenOutputFiles: Could not open file "+outputEioFile+" for output (write)." );
+ ShowFatalError( "OpenOutputFiles: Could not open file "+outputEioFileName+" for output (write)." );
}
gio::write( OutputFileInits, fmtA ) << "Program Version," + VerString;
// Open the Meters Output File
OutputFileMeters = GetNewUnitNumber();
StdMeterRecordCount = 0;
- { IOFlags flags; flags.ACTION( "write" ); flags.STATUS( "UNKNOWN" ); gio::open( OutputFileMeters, outputMtrFile, flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); flags.STATUS( "UNKNOWN" ); gio::open( OutputFileMeters, outputMtrFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( "OpenOutputFiles: Could not open file "+outputMtrFile+" for output (write)." );
+ ShowFatalError( "OpenOutputFiles: Could not open file "+outputMtrFileName+" for output (write)." );
}
gio::write( OutputFileMeters, fmtA ) << "Program Version," + VerString;
// Open the Branch-Node Details Output File
OutputFileBNDetails = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); flags.STATUS( "UNKNOWN" ); gio::open( OutputFileBNDetails, outputBndFile, flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); flags.STATUS( "UNKNOWN" ); gio::open( OutputFileBNDetails, outputBndFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( "OpenOutputFiles: Could not open file "+outputBndFile+" for output (write)." );
+ ShowFatalError( "OpenOutputFiles: Could not open file "+outputBndFileName+" for output (write)." );
}
gio::write( OutputFileBNDetails, fmtA ) << "Program Version," + VerString;
@@ -1314,7 +1314,7 @@ namespace SimulationManager {
std::string cepEnvSetThreads;
std::string cIDFSetThreads;
- EchoInputFile = FindUnitNumber( outputAuditFile );
+ EchoInputFile = FindUnitNumber( outputAuditFileName );
// Record some items on the audit file
gio::write( EchoInputFile, fmtLD ) << "NumOfRVariable=" << NumOfRVariable_Setup;
gio::write( EchoInputFile, fmtLD ) << "NumOfRVariable(Total)=" << NumTotalRVariable;
diff --git a/src/EnergyPlus/SizingManager.cc b/src/EnergyPlus/SizingManager.cc
index 4c1abe69122..d2419e0f6ce 100644
--- a/src/EnergyPlus/SizingManager.cc
+++ b/src/EnergyPlus/SizingManager.cc
@@ -8,6 +8,7 @@
#include
// EnergyPlus Headers
+#include
#include
#include
#include
@@ -54,6 +55,7 @@ namespace SizingManager {
// OTHER NOTES: none
// Using/Aliasing
+ using namespace CommandLineInterface;
using namespace DataPrecisionGlobals;
using namespace DataGlobals;
using namespace HeatBalanceManager;
@@ -221,19 +223,19 @@ namespace SizingManager {
Available = true;
OutputFileZoneSizing = GetNewUnitNumber();
if ( SizingFileColSep == CharComma ) {
- { IOFlags flags; flags.ACTION( "write" ); gio::open( OutputFileZoneSizing, "epluszsz.csv", flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( OutputFileZoneSizing, outputZszCsvFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( RoutineName + "Could not open file \"epluszsz.csv\" for output (write)." );
+ ShowFatalError( RoutineName + "Could not open file "+ outputZszCsvFileName +" for output (write)." );
}
} else if ( SizingFileColSep == CharTab ) {
- { IOFlags flags; flags.ACTION( "write" ); gio::open( OutputFileZoneSizing, "epluszsz.tab", flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( OutputFileZoneSizing, outputZszTabFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( RoutineName + "Could not open file \"epluszsz.tab\" for output (write)." );
+ ShowFatalError( RoutineName + "Could not open file "+outputZszTabFileName+" for output (write)." );
}
} else {
- { IOFlags flags; flags.ACTION( "write" ); gio::open( OutputFileZoneSizing, "epluszsz.txt", flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( OutputFileZoneSizing, outputZszTxtFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( RoutineName + "Could not open file \"epluszsz.txt\" for output (write)." );
+ ShowFatalError( RoutineName + "Could not open file "+ outputZszTxtFileName +" for output (write)." );
}
}
@@ -433,19 +435,19 @@ namespace SizingManager {
Available = true;
OutputFileSysSizing = GetNewUnitNumber();
if ( SizingFileColSep == CharComma ) {
- { IOFlags flags; flags.ACTION( "write" ); gio::open( OutputFileSysSizing, "eplusssz.csv", flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( OutputFileSysSizing, outputSszCsvFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( RoutineName + "Could not open file \"eplusssz.csv\" for output (write)." );
+ ShowFatalError( RoutineName + "Could not open file "+ outputSszCsvFileName +" for output (write)." );
}
} else if ( SizingFileColSep == CharTab ) {
- { IOFlags flags; flags.ACTION( "write" ); gio::open( OutputFileSysSizing, "eplusssz.tab", flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( OutputFileSysSizing, outputSszTabFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( RoutineName + "Could not open file \"eplusssz.tab\" for output (write)." );
+ ShowFatalError( RoutineName + "Could not open file "+ outputSszTabFileName +" for output (write)." );
}
} else {
- { IOFlags flags; flags.ACTION( "write" ); gio::open( OutputFileSysSizing, "eplusssz.txt", flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( OutputFileSysSizing, outputSszTxtFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( RoutineName + "Could not open file \"eplusssz.txt\" for output (write)." );
+ ShowFatalError( RoutineName + "Could not open file "+outputSszTxtFileName+ " for output (write)." );
}
}
SimAir = true;
diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc
index 853dba9738e..843289d4454 100644
--- a/src/EnergyPlus/SolarShading.cc
+++ b/src/EnergyPlus/SolarShading.cc
@@ -256,9 +256,9 @@ namespace SolarShading {
if ( BeginSimFlag ) {
OutputFileShading = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); gio::open( OutputFileShading, outputShdFile, flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( OutputFileShading, outputShdFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- ShowFatalError( "InitSolarCalculations: Could not open file "+outputShdFile+" for output (write)." );
+ ShowFatalError( "InitSolarCalculations: Could not open file "+outputShdFileName+" for output (write)." );
}
if ( GetInputFlag ) {
diff --git a/src/EnergyPlus/TARCOGOutput.cc b/src/EnergyPlus/TARCOGOutput.cc
index 4b0cb5dbc3f..27cd1fa9daf 100644
--- a/src/EnergyPlus/TARCOGOutput.cc
+++ b/src/EnergyPlus/TARCOGOutput.cc
@@ -8,6 +8,7 @@
// EnergyPlus Headers
#include
+#include
#include
#include
#include
@@ -43,6 +44,7 @@ namespace TARCOGOutput {
// USE STATEMENTS:
// Using/Aliasing
+ using namespace CommandLineInterface;
using namespace DataPrecisionGlobals;
using namespace TARCOGCommon;
using namespace TARCOGGassesParams;
@@ -1528,11 +1530,11 @@ namespace TARCOGOutput {
TarcogIterationsFileNumber = GetNewUnitNumber();
// open(newunit=TarcogIterationsFileNumber, file=TRIM(DBGD)//'TarcogIterations.dbg', status='unknown', position='APPEND', &
// form='formatted', iostat=nperr)
- { IOFlags flags; flags.FORM( "formatted" ); flags.STATUS( "unknown" ); flags.POSITION( "APPEND" ); gio::open( TarcogIterationsFileNumber, DBGD + "TarcogIterations.dbg", flags ); nperr = flags.ios(); }
+ { IOFlags flags; flags.FORM( "formatted" ); flags.STATUS( "unknown" ); flags.POSITION( "APPEND" ); gio::open( TarcogIterationsFileNumber, DBGD + TarcogIterationsFileName, flags ); nperr = flags.ios(); }
// if (nperr.ne.0) open(newunit=TarcogIterationsFileNumber, file='TarcogIterations.dbg',status='unknown', position='APPEND', &
// & form='formatted', iostat=nperr)
- if ( nperr != 0 ) { IOFlags flags; flags.FORM( "formatted" ); flags.STATUS( "unknown" ); flags.POSITION( "APPEND" ); gio::open( TarcogIterationsFileNumber, "TarcogIterations.dbg", flags ); nperr = flags.ios(); }
+ if ( nperr != 0 ) { IOFlags flags; flags.FORM( "formatted" ); flags.STATUS( "unknown" ); flags.POSITION( "APPEND" ); gio::open( TarcogIterationsFileNumber, TarcogIterationsFileName, flags ); nperr = flags.ios(); }
IterationCSVFileNumber = GetNewUnitNumber();
// open(newunit=IterationCSVFileNumber, file=TRIM(DBGD)//TRIM(IterationCSVName), status='unknown', position='APPEND', &
diff --git a/src/EnergyPlus/ThermalComfort.cc b/src/EnergyPlus/ThermalComfort.cc
index 0497cce79df..67698a6edea 100644
--- a/src/EnergyPlus/ThermalComfort.cc
+++ b/src/EnergyPlus/ThermalComfort.cc
@@ -2468,14 +2468,14 @@ namespace ThermalComfort {
}
if ( initiate && weathersimulation ) {
- { IOFlags flags; gio::inquire( "in.stat", flags ); statFileExists = flags.exists(); }
- { IOFlags flags; gio::inquire( inputWeatherFile, flags ); epwFileExists = flags.exists(); }
+ { IOFlags flags; gio::inquire( inStatFileName, flags ); statFileExists = flags.exists(); }
+ { IOFlags flags; gio::inquire( inputWeatherFileName, flags ); epwFileExists = flags.exists(); }
readStat = 0;
if ( statFileExists ) {
statFile = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "READ" ); gio::open( statFile, "in.stat", flags ); readStat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "READ" ); gio::open( statFile, inStatFileName, flags ); readStat = flags.ios(); }
if ( readStat != 0 ) {
- ShowFatalError( "CalcThermalComfortAdaptiveASH55: Could not open file \"in.stat\" for input (read)." );
+ ShowFatalError( "CalcThermalComfortAdaptiveASH55: Could not open file "+inStatFileName+" for input (read)." );
}
while ( readStat == 0 ) {
{ IOFlags flags; gio::read( statFile, fmtA, flags ) >> lineIn; readStat = flags.ios(); }
@@ -2494,9 +2494,9 @@ namespace ThermalComfort {
useStatData = true;
} else if ( epwFileExists ) {
epwFile = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "READ" ); gio::open( epwFile, inputWeatherFile, flags ); readStat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "READ" ); gio::open( epwFile, inputWeatherFileName, flags ); readStat = flags.ios(); }
if ( readStat != 0 ) {
- ShowFatalError( "CalcThermalComfortAdaptiveASH55: Could not open file " + inputWeatherFile+ " for input (read)." );
+ ShowFatalError( "CalcThermalComfortAdaptiveASH55: Could not open file " + inputWeatherFileName+ " for input (read)." );
}
for ( i = 1; i <= 9; ++i ) { // Headers
{ IOFlags flags; gio::read( epwFile, fmtA, flags ); readStat = flags.ios(); }
@@ -2720,13 +2720,13 @@ namespace ThermalComfort {
}
if ( initiate && weathersimulation ) {
- { IOFlags flags; gio::inquire( inputWeatherFile, flags ); epwFileExists = flags.exists(); }
+ { IOFlags flags; gio::inquire( inputWeatherFileName, flags ); epwFileExists = flags.exists(); }
readStat = 0;
if ( epwFileExists ) {
epwFile = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "READ" ); gio::open( epwFile, inputWeatherFile, flags ); readStat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "READ" ); gio::open( epwFile, inputWeatherFileName, flags ); readStat = flags.ios(); }
if ( readStat != 0 ) {
- ShowFatalError( "CalcThermalComfortAdaptiveCEN15251: Could not open file "+inputWeatherFile+" for input (read)." );
+ ShowFatalError( "CalcThermalComfortAdaptiveCEN15251: Could not open file "+inputWeatherFileName+" for input (read)." );
}
for ( i = 1; i <= 9; ++i ) { // Headers
{ IOFlags flags; gio::read( epwFile, fmtA, flags ); readStat = flags.ios(); }
diff --git a/src/EnergyPlus/UtilityRoutines.cc b/src/EnergyPlus/UtilityRoutines.cc
index 97836ad6789..a5c136bf30d 100644
--- a/src/EnergyPlus/UtilityRoutines.cc
+++ b/src/EnergyPlus/UtilityRoutines.cc
@@ -168,12 +168,12 @@ AbortEnergyPlus(
strip( NumSevereDuringSizing );
if ( NoIDD ) {
- DisplayString( "No EnergyPlus Data Dictionary (" + inputEnergyFile+") was found. It is possible " );
+ DisplayString( "No EnergyPlus Data Dictionary (" + inputIddFileName+") was found. It is possible " );
DisplayString( "you \"double-clicked\"EnergyPlus.exe rather than using one of the methods" );
DisplayString( "to run Energyplus as found in the GettingStarted document in the" );
DisplayString( "documentation folder. Using EP-Launch may be best -- " );
DisplayString( "it provides extra help for new users." );
- ShowMessage( "No EnergyPlus Data Dictionary (" + inputEnergyFile+") was found. It is possible you \"double-clicked\" EnergyPlus.exe " );
+ ShowMessage( "No EnergyPlus Data Dictionary (" + inputIddFileName+") was found. It is possible you \"double-clicked\" EnergyPlus.exe " );
ShowMessage( "rather than using one of the methods to run Energyplus as found in the GettingStarted document" );
ShowMessage( "in the documentation folder. Using EP-Launch may be best -- it provides extra help for new users." );
{ IOFlags flags; flags.ADVANCE( "NO" ); gio::write( OutFmt, flags ); }
@@ -213,9 +213,9 @@ AbortEnergyPlus(
ShowMessage( "EnergyPlus Terminated--Fatal Error Detected. " + NumWarnings + " Warning; " + NumSevere + " Severe Errors; Elapsed Time=" + Elapsed );
DisplayString( "EnergyPlus Run Time=" + Elapsed );
tempfl = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); gio::open( tempfl, outputEndFile, flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( tempfl, outputEndFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- DisplayString( "AbortEnergyPlus: Could not open file "+ outputEndFile +" for output (write)." );
+ DisplayString( "AbortEnergyPlus: Could not open file "+ outputEndFileName +" for output (write)." );
}
gio::write( tempfl, fmtLD ) << "EnergyPlus Terminated--Fatal Error Detected. " + NumWarnings + " Warning; " + NumSevere + " Severe Errors; Elapsed Time=" + Elapsed;
@@ -446,9 +446,9 @@ EndEnergyPlus()
ShowMessage( "EnergyPlus Completed Successfully-- " + NumWarnings + " Warning; " + NumSevere + " Severe Errors; Elapsed Time=" + Elapsed );
DisplayString( "EnergyPlus Run Time=" + Elapsed );
tempfl = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); gio::open( tempfl, outputEndFile, flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( tempfl, outputEndFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
- DisplayString( "EndEnergyPlus: Could not open file " + outputEndFile + " for output (write)." );
+ DisplayString( "EndEnergyPlus: Could not open file " + outputEndFileName + " for output (write)." );
}
gio::write( tempfl, fmtA ) << "EnergyPlus Completed Successfully-- " + NumWarnings + " Warning; " + NumSevere + " Severe Errors; Elapsed Time=" + Elapsed;
gio::close( tempfl );
@@ -832,8 +832,9 @@ ShowFatalError(
ShowErrorMessage( " ** Fatal ** " + ErrorMessage, OutUnit1, OutUnit2 );
DisplayString( "**FATAL:" + ErrorMessage );
- if ( has( ErrorMessage, "in.idf missing" ) ) NoIdf = true;
- if ( has( ErrorMessage, inputEnergyFile +" missing" ) ) NoIDD = true;
+
+ if ( has( ErrorMessage, inputIdfFileName +" missing" ) ) NoIdf = true;
+ if ( has( ErrorMessage, inputIddFileName +" missing" ) ) NoIDD = true;
ShowErrorMessage( " ...Summary of Errors that led to program termination:", OutUnit1, OutUnit2 );
ShowErrorMessage( " ..... Reference severe error count=" + RoundSigDigits( TotalSevereErrors ), OutUnit1, OutUnit2 );
ShowErrorMessage( " ..... Last severe error=" + LastSevereError, OutUnit1, OutUnit2 );
@@ -1586,7 +1587,6 @@ ShowErrorMessage(
// SUBROUTINE PARAMETER DEFINITIONS:
static gio::Fmt const ErrorFormat( "(2X,A)" );
static gio::Fmt const fmtA( "(A)" );
-
// INTERFACE BLOCK SPECIFICATIONS
// na
@@ -1601,10 +1601,10 @@ ShowErrorMessage(
if ( TotalErrors == 0 && ! ErrFileOpened ) {
StandardErrorOutput = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); gio::open( StandardErrorOutput, outputErrFile, flags ); write_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( StandardErrorOutput, outputErrFileName, flags ); write_stat = flags.ios(); }
if ( write_stat != 0 ) {
DisplayString( "Trying to display error: \"" + ErrorMessage + "\"" );
- ShowFatalError( "ShowErrorMessage: Could not open file "+outputErrFile+" for output (write)." );
+ ShowFatalError( "ShowErrorMessage: Could not open file "+outputErrFileName+" for output (write)." );
}
gio::write( StandardErrorOutput, fmtA ) << "Program Version," + VerString + ',' + IDDVerString;
ErrFileOpened = true;
diff --git a/src/EnergyPlus/WeatherManager.cc b/src/EnergyPlus/WeatherManager.cc
index be13c5469de..f5f0496f78a 100644
--- a/src/EnergyPlus/WeatherManager.cc
+++ b/src/EnergyPlus/WeatherManager.cc
@@ -4391,7 +4391,7 @@ Label903: ;
// FLOW:
- { IOFlags flags; gio::inquire( inputWeatherFile, flags ); WeatherFileExists = flags.exists(); }
+ { IOFlags flags; gio::inquire( inputWeatherFileName, flags ); WeatherFileExists = flags.exists(); }
if ( WeatherFileExists ) {
OpenEPlusWeatherFile( ErrorsFound, true );
@@ -4444,11 +4444,11 @@ Label903: ;
bool EPWOpen;
int unitnumber;
- { IOFlags flags; gio::inquire( inputWeatherFile, flags ); unitnumber = flags.unit(); EPWOpen = flags.open(); }
+ { IOFlags flags; gio::inquire( inputWeatherFileName, flags ); unitnumber = flags.unit(); EPWOpen = flags.open(); }
if ( EPWOpen ) gio::close( unitnumber );
WeatherFileUnitNumber = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "read" ); gio::open( WeatherFileUnitNumber, inputWeatherFile, flags ); if ( flags.err() ) goto Label9999; }
+ { IOFlags flags; flags.ACTION( "read" ); gio::open( WeatherFileUnitNumber, inputWeatherFileName, flags ); if ( flags.err() ) goto Label9999; }
if ( ProcessHeader ) {
// Read in Header Information
@@ -4532,7 +4532,7 @@ Label9999: ;
// Make sure it's open
- { IOFlags flags; gio::inquire( inputWeatherFile, flags ); unitnumber = flags.unit(); EPWOpen = flags.open(); }
+ { IOFlags flags; gio::inquire( inputWeatherFileName, flags ); unitnumber = flags.unit(); EPWOpen = flags.open(); }
if ( EPWOpen ) gio::close( unitnumber );
}
diff --git a/src/EnergyPlus/WindTurbine.cc b/src/EnergyPlus/WindTurbine.cc
index 8cee95020d7..1aa15648a3f 100644
--- a/src/EnergyPlus/WindTurbine.cc
+++ b/src/EnergyPlus/WindTurbine.cc
@@ -9,6 +9,7 @@
// EnergyPlus Headers
#include
+#include
#include
#include
#include
@@ -50,6 +51,7 @@ namespace WindTurbine {
// OTHER NOTES: none
// Using/Aliasing
+ using namespace CommandLineInterface;
using namespace DataPrecisionGlobals;
using namespace DataGenerators;
using DataGlobals::Pi;
@@ -617,7 +619,7 @@ namespace WindTurbine {
std::string::size_type lnPtr; // scan pointer for Line input
int mon; // loop counter
bool wsStatFound; // logical noting that wind stats were found
- bool fileExists; // true if in.stat file exists
+ bool fileExists; // true if inStatFileName file exists
bool warningShown; // true if the <365 warning has already been shown
std::string lineIn;
FArray1D< Real64 > MonthWS( 12 );
@@ -627,13 +629,13 @@ namespace WindTurbine {
// Estimate average annual wind speed once
if ( MyOneTimeFlag ) {
wsStatFound = false;
- { IOFlags flags; gio::inquire( "in.stat", flags ); fileExists = flags.exists(); }
+ { IOFlags flags; gio::inquire( inStatFileName, flags ); fileExists = flags.exists(); }
if ( fileExists ) {
statFile = GetNewUnitNumber();
ReadStatus = 0;
- { IOFlags flags; flags.ACTION( "READ" ); gio::open( statFile, "in.stat", flags ); ReadStatus = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "READ" ); gio::open( statFile, inStatFileName, flags ); ReadStatus = flags.ios(); }
if ( ReadStatus != 0 ) {
- ShowFatalError( "InitWindTurbine: Could not open file \"in.stat\" for input (read)." );
+ ShowFatalError( "InitWindTurbine: Could not open file "+inStatFileName+" for input (read)." );
}
while ( ReadStatus == 0 ) { //end of file
{ IOFlags flags; gio::read( statFile, fmtA, flags ) >> lineIn; ReadStatus = flags.ios(); }
@@ -660,14 +662,14 @@ namespace WindTurbine {
}
} else { // blank field
if ( ! warningShown ) {
- ShowWarningError( "InitWindTurbine: read from in.stat file shows <365 days in weather file. " "Annual average wind speed used will be inaccurate." );
+ ShowWarningError( "InitWindTurbine: read from "+ inStatFileName +" file shows <365 days in weather file. " "Annual average wind speed used will be inaccurate." );
lineIn.erase( 0, lnPtr + 1 );
warningShown = true;
}
}
} else { // two tabs in succession
if ( ! warningShown ) {
- ShowWarningError( "InitWindTurbine: read from in.stat file shows <365 days in weather file. " "Annual average wind speed used will be inaccurate." );
+ ShowWarningError( "InitWindTurbine: read from "+ inStatFileName +" file shows <365 days in weather file. " "Annual average wind speed used will be inaccurate." );
lineIn.erase( 0, lnPtr + 1 );
warningShown = true;
}
diff --git a/src/EnergyPlus/WindowManager.cc b/src/EnergyPlus/WindowManager.cc
index e5fb3979a36..8e90a89bfa3 100644
--- a/src/EnergyPlus/WindowManager.cc
+++ b/src/EnergyPlus/WindowManager.cc
@@ -9,6 +9,7 @@
#include
// EnergyPlus Headers
+#include
#include
#include
#include
@@ -69,6 +70,7 @@ namespace WindowManager {
// for DOE-2, Lawrence Berkeley National Laboratory, Jan. 1996.
// Using/Aliasing
+ using namespace CommandLineInterface;
using namespace DataPrecisionGlobals;
using namespace DataEnvironment;
using namespace DataHeatBalance;
@@ -7692,7 +7694,7 @@ namespace WindowManager {
if ( PrintTransMap ) {
ScreenTransUnitNo = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); flags.STATUS( "unknown" ); gio::open( ScreenTransUnitNo, "eplusscreen.csv", flags ); if ( flags.err() ) goto Label99999; }
+ { IOFlags flags; flags.ACTION( "write" ); flags.STATUS( "unknown" ); gio::open( ScreenTransUnitNo, outputScreenCsvFileName, flags ); if ( flags.err() ) goto Label99999; }
// WRITE(ScreenTransUnitNo,*)' '
for ( ScreenNum = 1; ScreenNum <= NumSurfaceScreens; ++ScreenNum ) {
MatNum = SurfaceScreens( ScreenNum ).MaterialNumber;
diff --git a/src/EnergyPlus/main.cc b/src/EnergyPlus/main.cc
index 26db437a8b0..99fcf78a273 100644
--- a/src/EnergyPlus/main.cc
+++ b/src/EnergyPlus/main.cc
@@ -330,22 +330,22 @@ main(int argc, const char * argv[])
get_environment_variable( TraceHVACControllerEnvVar, cEnvValue );
if ( ! cEnvValue.empty() ) TraceHVACControllerEnvFlag = env_var_on( cEnvValue ); // Yes or True
- { IOFlags flags; gio::inquire( outputEndFile, flags ); FileExists = flags.exists(); }
+ { IOFlags flags; gio::inquire( outputEndFileName, flags ); FileExists = flags.exists(); }
if ( FileExists ) {
LFN = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "read" ); gio::open( LFN, outputEndFile, flags ); iostatus = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "read" ); gio::open( LFN, outputEndFileName, flags ); iostatus = flags.ios(); }
if ( iostatus != 0 ) {
- ShowFatalError( "EnergyPlus: Could not open file "+ outputEndFile +" for input (read)." );
+ ShowFatalError( "EnergyPlus: Could not open file "+ outputEndFileName +" for input (read)." );
}
{ IOFlags flags; flags.DISPOSE( "delete" ); gio::close( LFN, flags ); }
}
- { IOFlags flags; gio::inquire( "Energy+.ini", flags ); EPlusINI = flags.exists(); }
+ { IOFlags flags; gio::inquire( EnergyPlusIniFileName, flags ); EPlusINI = flags.exists(); }
if ( EPlusINI ) {
LFN = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "read" ); gio::open( LFN, "Energy+.ini", flags ); iostatus = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "read" ); gio::open( LFN, EnergyPlusIniFileName, flags ); iostatus = flags.ios(); }
if ( iostatus != 0 ) {
- ShowFatalError( "EnergyPlus: Could not open file \"Energy+.ini\" for input (read)." );
+ ShowFatalError( "EnergyPlus: Could not open file "+EnergyPlusIniFileName+" for input (read)." );
}
{ IOFlags flags; gio::inquire( LFN, flags ); CurrentWorkingFolder = flags.name(); }
// Relying on compiler to supply full path name here
@@ -360,12 +360,12 @@ main(int argc, const char * argv[])
gio::close( LFN );
} else {
- DisplayString( "Missing Energy+.ini" );
+ DisplayString( "Missing " +EnergyPlusIniFileName );
ProgramPath = "";
LFN = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); gio::open( LFN, "Energy+.ini", flags ); iostatus = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( LFN, EnergyPlusIniFileName, flags ); iostatus = flags.ios(); }
if ( iostatus != 0 ) {
- ShowFatalError( "EnergyPlus: Could not open file \"Energy+.ini\" for output (write)." );
+ ShowFatalError( "EnergyPlus: Could not open file "+EnergyPlusIniFileName+" for output (write)." );
}
// Relying on compiler to supply full path name here
{ IOFlags flags; gio::inquire( LFN, flags ); CurrentWorkingFolder = flags.name(); }
@@ -384,7 +384,7 @@ main(int argc, const char * argv[])
DisplayString( VerString );
OutputFileDebug = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "write" ); gio::open( OutputFileDebug, "eplusout.dbg", flags ); iostatus = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "write" ); gio::open( OutputFileDebug, outputDbgFileName, flags ); iostatus = flags.ios(); }
if ( iostatus != 0 ) {
ShowFatalError( "EnergyPlus: Could not open file \"eplusout.dbg\" for output (write)." );
}
From 393070e09c6294794862510f5127c4112fc07db5 Mon Sep 17 00:00:00 2001
From: nealkruis
Date: Fri, 26 Sep 2014 12:32:01 -0600
Subject: [PATCH 12/71] Minor clean up.
---
src/EnergyPlus/CommandLineInterface.cc | 8 ++++----
src/EnergyPlus/DataStringGlobals.cc | 2 +-
src/EnergyPlus/DataStringGlobals.hh | 2 +-
src/EnergyPlus/DaylightingManager.cc | 2 +-
src/EnergyPlus/WindTurbine.cc | 2 +-
5 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/EnergyPlus/CommandLineInterface.cc b/src/EnergyPlus/CommandLineInterface.cc
index e0f721aab8e..560f6bc1da9 100644
--- a/src/EnergyPlus/CommandLineInterface.cc
+++ b/src/EnergyPlus/CommandLineInterface.cc
@@ -123,10 +123,10 @@ namespace CommandLineInterface{
if (opt.isSet("-o")) {
outputFilePrefix = inputIdfFileName.substr(0, inputIdfFileName.size()-4) + "_" +
inputWeatherFileName.substr(0, inputWeatherFileName.size()-4) + "_";
- }
- else {
- outputFilePrefix = "eplus";
- }
+ }
+ else {
+ outputFilePrefix = "eplus";
+ }
outputAuditFileName = outputFilePrefix + "out.audit";
outputBndFileName = outputFilePrefix + "out.bnd";
diff --git a/src/EnergyPlus/DataStringGlobals.cc b/src/EnergyPlus/DataStringGlobals.cc
index 9e90ab221f3..216a490f90a 100644
--- a/src/EnergyPlus/DataStringGlobals.cc
+++ b/src/EnergyPlus/DataStringGlobals.cc
@@ -67,7 +67,7 @@ namespace DataStringGlobals {
// na
// MODULE VARIABLE DECLARATIONS:
- std::string ProgramPath; // Path for Program from EnergyPlusIniFileName
+ std::string ProgramPath; // Path for Program from INI file
std::string CurrentWorkingFolder; // Current working directory for run
std::string FullName; // Full name of file to open, including path
std::string IDDVerString; // Version information from the IDD (line 1)
diff --git a/src/EnergyPlus/DataStringGlobals.hh b/src/EnergyPlus/DataStringGlobals.hh
index 58fbef6d49d..6bca0573731 100644
--- a/src/EnergyPlus/DataStringGlobals.hh
+++ b/src/EnergyPlus/DataStringGlobals.hh
@@ -35,7 +35,7 @@ namespace DataStringGlobals {
// na
// MODULE VARIABLE DECLARATIONS:
- extern std::string ProgramPath; // Path for Program from EnergyPlusIniFileName
+ extern std::string ProgramPath; // Path for Program from INI file
extern std::string CurrentWorkingFolder; // Current working directory for run
extern std::string FullName; // Full name of file to open, including path
extern std::string IDDVerString; // Version information from the IDD (line 1)
diff --git a/src/EnergyPlus/DaylightingManager.cc b/src/EnergyPlus/DaylightingManager.cc
index 81a1a73ce5f..db1718f893c 100644
--- a/src/EnergyPlus/DaylightingManager.cc
+++ b/src/EnergyPlus/DaylightingManager.cc
@@ -4050,7 +4050,7 @@ namespace DaylightingManager {
int TotDaylightingDElight; // Total Daylighting:DElight inputs
Real64 dLatitude; // double for argument passing
int iErrorFlag; // Error Flag for warning/errors returned from DElight
- int iDElightErrorFile; // Unit number for reading DElight Error File (eplusout.delightdfdmp or outputDelightFile)
+ int iDElightErrorFile; // Unit number for reading DElight Error File
int iReadStatus; // Error File Read Status
std::string cErrorLine; // Each DElight Error line can be up to 210 characters long
std::string cErrorMsg; // Each DElight Error Message can be up to 200 characters long
diff --git a/src/EnergyPlus/WindTurbine.cc b/src/EnergyPlus/WindTurbine.cc
index 1aa15648a3f..dfa3ea0f332 100644
--- a/src/EnergyPlus/WindTurbine.cc
+++ b/src/EnergyPlus/WindTurbine.cc
@@ -619,7 +619,7 @@ namespace WindTurbine {
std::string::size_type lnPtr; // scan pointer for Line input
int mon; // loop counter
bool wsStatFound; // logical noting that wind stats were found
- bool fileExists; // true if inStatFileName file exists
+ bool fileExists; // true if Stat file exists
bool warningShown; // true if the <365 warning has already been shown
std::string lineIn;
FArray1D< Real64 > MonthWS( 12 );
From f2faabe2406a98367af2fe4c8dabb83624970a10 Mon Sep 17 00:00:00 2001
From: Monika Sharma
Date: Fri, 26 Sep 2014 14:26:42 -0600
Subject: [PATCH 13/71] File system handler in place
---
src/EnergyPlus/CommandLineInterface.cc | 67 ++++++++++++++++++--------
1 file changed, 46 insertions(+), 21 deletions(-)
diff --git a/src/EnergyPlus/CommandLineInterface.cc b/src/EnergyPlus/CommandLineInterface.cc
index e0f721aab8e..c8d42842fd0 100644
--- a/src/EnergyPlus/CommandLineInterface.cc
+++ b/src/EnergyPlus/CommandLineInterface.cc
@@ -2,9 +2,14 @@
#include
#include
#include
+#include
+#include
+#include
+#include
// CLI Headers
#include
+//#include
// Project headers
#include
@@ -75,6 +80,22 @@ namespace CommandLineInterface{
std::string TarcogIterationsFileName;
std::string eplusADSFileName;
+ std::string
+ returnFileName( std::string const& filename )
+ {
+ return {std::find_if(filename.rbegin(), filename.rend(), [](char c) { return c == pathChar; }).base(),
+ filename.end()-4};
+ }
+
+ std::string
+ returnDirPathName( std::string const& filename )
+ {
+ std::string::const_reverse_iterator pivot = std::find( filename.rbegin(), filename.rend(), pathChar );
+ return pivot == filename.rend()
+ ? filename
+ : std::string( filename.begin(), pivot.base() - 1 );
+ }
+
int
ProcessArgs(int argc, const char * argv[])
{
@@ -87,7 +108,7 @@ namespace CommandLineInterface{
opt.add("", 0, 0, 0, "Display this message", "-h", "--help");
- opt.add("", 0, 0, 0, "Print version invormation", "-v", "--version");
+ opt.add("", 0, 0, 0, "Print version information", "-v", "--version");
opt.add("in.idf", 0, 1, 0, "Input Definition File (IDF) file path (default \".\\in.idf\")", "-i", "--idf");
@@ -101,32 +122,35 @@ namespace CommandLineInterface{
opt.parse(argc, argv);
// print arguments parsed (useful for debugging)
- /*
- std::string pretty;
+ /*std::string pretty;
opt.prettyPrint(pretty);
+ std::cout << pretty << std::endl;*/
- std::cout << pretty << std::endl;
- */
-
- std::string usage;
+ std::string usage, idfFileNameOnly, idfDirPathName;
+ std::string weatherFileNameOnly, weatherDirPathName;
opt.getUsage(usage);
+ std::string outputFilePrefix;
+
opt.get("-i")->getString(inputIdfFileName);
opt.get("-w")->getString(inputWeatherFileName);
opt.get("-e")->getString(inputIddFileName);
- std::string outputFilePrefix;
+ idfFileNameOnly = returnFileName(inputIdfFileName);
+ idfDirPathName = returnDirPathName(inputIdfFileName);
- if (opt.isSet("-o")) {
- outputFilePrefix = inputIdfFileName.substr(0, inputIdfFileName.size()-4) + "_" +
- inputWeatherFileName.substr(0, inputWeatherFileName.size()-4) + "_";
- }
- else {
- outputFilePrefix = "eplus";
- }
+ weatherFileNameOnly = returnFileName(inputWeatherFileName);
+ weatherDirPathName = returnDirPathName(inputWeatherFileName);
+
+ // std::cout<<"\n Name of the file = "< badOptions;
-
if(!opt.gotExpected(badOptions)) {
for(int i=0; i < badOptions.size(); ++i) {
- ShowFatalError("ERROR: Unexpected number of arguments for option " + badOptions[i] + "\n");
+ ShowFatalError("ERROR: Unexpected number of arguments for option " + badOptions[i] + "\n");
}
DisplayString(usage);
exit(EXIT_FAILURE);
@@ -217,7 +239,10 @@ namespace CommandLineInterface{
exit(EXIT_SUCCESS);
}
+
return 0;
}
-} //namespace options
+ } //namespace options
} //EnergyPlus namespace
+
+
From 4341dbf923f5e2a6eead94b90acbaa035b45ab99 Mon Sep 17 00:00:00 2001
From: Monika Sharma
Date: Thu, 2 Oct 2014 12:57:12 -0600
Subject: [PATCH 14/71] Flag to run ReadVARS + file system library is in place
---
src/EnergyPlus/CommandLineInterface.cc | 119 ++++++++++++++++++++-----
src/EnergyPlus/CommandLineInterface.hh | 5 ++
src/EnergyPlus/main.cc | 43 +++++++++
3 files changed, 145 insertions(+), 22 deletions(-)
diff --git a/src/EnergyPlus/CommandLineInterface.cc b/src/EnergyPlus/CommandLineInterface.cc
index c8d42842fd0..b9eae85bf79 100644
--- a/src/EnergyPlus/CommandLineInterface.cc
+++ b/src/EnergyPlus/CommandLineInterface.cc
@@ -1,4 +1,6 @@
//Standard C++ library
+#include
+#include
#include
#include
#include
@@ -6,6 +8,8 @@
#include
#include
#include
+#include
+#include
// CLI Headers
#include
@@ -79,12 +83,21 @@ namespace CommandLineInterface{
std::string inStatFileName;
std::string TarcogIterationsFileName;
std::string eplusADSFileName;
+ std::string outputFilePrefix;
+ bool readVarsValue;
+ bool outputValue;
+
+ void myterminate () {
+ std::cerr << "terminate handler called\n";
+ abort(); // forces abnormal termination
+ }
std::string
returnFileName( std::string const& filename )
{
- return {std::find_if(filename.rbegin(), filename.rend(), [](char c) { return c == pathChar; }).base(),
- filename.end()-4};
+ return {std::find_if(filename.rbegin(), filename.rend(),
+ [](char c) { return c == pathChar; }).base(),
+ filename.end()};
}
std::string
@@ -96,9 +109,26 @@ namespace CommandLineInterface{
: std::string( filename.begin(), pivot.base() - 1 );
}
+ std::string
+ returnFileExtension(const std::string& filename){
+ std::string ext = "";
+
+ for(int i=0; igetString(inputIdfFileName);
+ opt.get("-i")->getString(inputIdfFileName);
opt.get("-w")->getString(inputWeatherFileName);
opt.get("-e")->getString(inputIddFileName);
- idfFileNameOnly = returnFileName(inputIdfFileName);
+ idfFileNameWextn = returnFileName(inputIdfFileName);
+
+ std::string idfFileNameOnly = idfFileNameWextn.substr(0,idfFileNameWextn.size()-4);
+
+ std::cout<<"File name only = "< badOptions;
if(!opt.gotExpected(badOptions)) {
for(int i=0; i < badOptions.size(); ++i) {
- ShowFatalError("ERROR: Unexpected number of arguments for option " + badOptions[i] + "\n");
+ ShowFatalError("ERROR: Unexpected number of arguments for option " + badOptions[i] + "\n");
}
DisplayString(usage);
exit(EXIT_FAILURE);
}
+ if(!opt.gotRequired(badOptions)) {
+ DisplayString(usage);
+ for(int i=0; i < badOptions.size(); ++i) {
+ ShowFatalError("ERROR: Missing required option " + badOptions[i] + "\n");
+ }
+
+ exit(EXIT_FAILURE);
+ }
+
if(opt.firstArgs.size() > 1 || opt.unknownArgs.size() > 0 || opt.lastArgs.size() > 0){
for(int i=1; i < opt.firstArgs.size(); ++i) {
std::string arg(opt.firstArgs[i]->c_str());
@@ -220,14 +274,6 @@ namespace CommandLineInterface{
exit(EXIT_FAILURE);
}
- if(!opt.gotRequired(badOptions)) {
- for(int i=0; i < badOptions.size(); ++i) {
- ShowFatalError("ERROR: Missing required option " + badOptions[i] + "\n");
- }
- DisplayString(usage);
- exit(EXIT_FAILURE);
- }
-
// Process standard arguments
if (opt.isSet("-h")) {
DisplayString(usage);
@@ -239,6 +285,35 @@ namespace CommandLineInterface{
exit(EXIT_SUCCESS);
}
+ struct stat st;
+ if(stat(idfDirPathName.c_str(),&st) == 0)
+ DisplayString(idfDirPathName + " is a valid (idf) directory.\n");
+ else {
+ ShowFatalError(idfDirPathName + " is not a valid (idf) directory. \n");
+ exit(EXIT_FAILURE);
+ }
+
+ std::string extIdfFileName = returnFileExtension(inputIdfFileName);
+ if(extIdfFileName == "")
+ DisplayString("no file extension in " + idfFileNameOnly + " \n");
+ else
+ DisplayString("Name of the extension = "+ extIdfFileName + " \n");
+
+ std::string extEpwfFileName = returnFileExtension(inputWeatherFileName);
+ if(extEpwfFileName == "")
+ DisplayString("no file extension in " + extEpwfFileName + " \n");
+ else
+ DisplayString("Name of the extension = "+ extEpwfFileName + " \n");
+
+ if (extIdfFileName != "idf"){
+ ShowFatalError("ERROR: Only idf files are allowed with [option] '-i' \n");
+ exit(EXIT_FAILURE);
+ }
+
+ if (opt.isSet("-w") && extEpwfFileName != "epw"){
+ ShowFatalError("ERROR: Only epw files are allowed with [option] '-w' \n");
+ exit(EXIT_FAILURE);
+ }
return 0;
}
diff --git a/src/EnergyPlus/CommandLineInterface.hh b/src/EnergyPlus/CommandLineInterface.hh
index 91d905b9035..565bd876ef0 100644
--- a/src/EnergyPlus/CommandLineInterface.hh
+++ b/src/EnergyPlus/CommandLineInterface.hh
@@ -49,6 +49,11 @@ namespace CommandLineInterface {
extern std::string inStatFileName;
extern std::string TarcogIterationsFileName;
extern std::string eplusADSFileName;
+ extern std::string weatherFileNameOnly;
+ extern std::string idfFileNameOnly;
+ extern std::string outputFilePrefix;
+ extern bool readVarsValue;
+ extern bool outputValue;
// Process command line arguments
int
diff --git a/src/EnergyPlus/main.cc b/src/EnergyPlus/main.cc
index 99fcf78a273..86769f81522 100644
--- a/src/EnergyPlus/main.cc
+++ b/src/EnergyPlus/main.cc
@@ -5,6 +5,12 @@
#endif
#endif
+//Standard C++ library
+#include
+#include
+#include
+// CLI Headers
+
// ObjexxFCL Headers
#include
#include
@@ -406,6 +412,43 @@ main(int argc, const char * argv[])
ReportOrphanFluids();
ReportOrphanSchedules();
+ std::ofstream ifile;
+ std::ofstream nfile;
+
+ if(outputValue) {
+ std::string esoFileName = outputFilePrefix + "out.eso";
+ std::string csvFileName = outputFilePrefix + "out.csv";
+ ifile.open("eplusout.rvi");
+ ifile <
Date: Thu, 2 Oct 2014 15:58:40 -0600
Subject: [PATCH 15/71] Flag for ReadVARS + file handler + directory for output
files in place
---
src/EnergyPlus/CommandLineInterface.cc | 56 ++++++++++++++++++++------
src/EnergyPlus/CommandLineInterface.hh | 2 +-
src/EnergyPlus/main.cc | 48 ++++++++++------------
3 files changed, 66 insertions(+), 40 deletions(-)
diff --git a/src/EnergyPlus/CommandLineInterface.cc b/src/EnergyPlus/CommandLineInterface.cc
index b9eae85bf79..3a9d4048c71 100644
--- a/src/EnergyPlus/CommandLineInterface.cc
+++ b/src/EnergyPlus/CommandLineInterface.cc
@@ -9,7 +9,6 @@
#include
#include
#include
-#include
// CLI Headers
#include
@@ -84,8 +83,8 @@ namespace CommandLineInterface{
std::string TarcogIterationsFileName;
std::string eplusADSFileName;
std::string outputFilePrefix;
+ std::string dirPathName;
bool readVarsValue;
- bool outputValue;
void myterminate () {
std::cerr << "terminate handler called\n";
@@ -125,6 +124,36 @@ namespace CommandLineInterface{
}
+ bool mkpath( std::string path )
+ {
+ bool bSuccess = false;
+ int nRC = ::mkdir( path.c_str(), 0775 );
+ if( nRC == -1 )
+ {
+ switch( errno )
+ {
+ case ENOENT:
+ //parent didn't exist, try to create it
+ if( mkpath( path.substr(0, path.find_last_of('/')) ) )
+ //Now, try to create again.
+ bSuccess = 0 == ::mkdir( path.c_str(), 0775 );
+ else
+ bSuccess = false;
+ break;
+ case EEXIST:
+ //Done!
+ bSuccess = true;
+ break;
+ default:
+ bSuccess = false;
+ break;
+ }
+ }
+ else
+ bSuccess = true;
+ return bSuccess;
+ }
+
int
ProcessArgs(int argc, const char * argv[])
{
@@ -132,7 +161,7 @@ namespace CommandLineInterface{
ezOptionParser opt;
opt.overview = VerString;
- opt.example = "EnergyPlus -i InputFile.idf -e Energy+.idd -w WeatherFile.epw -o";
+ opt.example = "EnergyPlus -i InputFile.idf -e Energy+.idd -w WeatherFile.epw -d DirPathName -o -r ";
opt.syntax = "EnergyPlus [options]";
@@ -150,6 +179,8 @@ namespace CommandLineInterface{
opt.add("", 0, 0, 0, "Option to run readVARS", "-r", "--readVARS");
+ opt.add("", 0, 1, 0, "Output directory pathname (default \".\\pwd\")", "-d", "--dirname");
+
// Parse arguments
opt.parse(argc, argv);
@@ -170,11 +201,15 @@ namespace CommandLineInterface{
opt.get("-e")->getString(inputIddFileName);
+ opt.get("-d")->getString(dirPathName);
+ std::cout<<"Directory pathname = "<
Date: Thu, 2 Oct 2014 16:12:33 -0600
Subject: [PATCH 16/71] Segfault error fixed
---
src/EnergyPlus/CommandLineInterface.cc | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/src/EnergyPlus/CommandLineInterface.cc b/src/EnergyPlus/CommandLineInterface.cc
index 3a9d4048c71..5814fa4e473 100644
--- a/src/EnergyPlus/CommandLineInterface.cc
+++ b/src/EnergyPlus/CommandLineInterface.cc
@@ -86,11 +86,6 @@ namespace CommandLineInterface{
std::string dirPathName;
bool readVarsValue;
- void myterminate () {
- std::cerr << "terminate handler called\n";
- abort(); // forces abnormal termination
- }
-
std::string
returnFileName( std::string const& filename )
{
@@ -202,9 +197,9 @@ namespace CommandLineInterface{
opt.get("-e")->getString(inputIddFileName);
opt.get("-d")->getString(dirPathName);
- std::cout<<"Directory pathname = "<
Date: Thu, 2 Oct 2014 16:16:24 -0600
Subject: [PATCH 17/71] Directory pathname check removed
---
src/EnergyPlus/CommandLineInterface.cc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/EnergyPlus/CommandLineInterface.cc b/src/EnergyPlus/CommandLineInterface.cc
index 5814fa4e473..faeb453260b 100644
--- a/src/EnergyPlus/CommandLineInterface.cc
+++ b/src/EnergyPlus/CommandLineInterface.cc
@@ -197,7 +197,7 @@ namespace CommandLineInterface{
opt.get("-e")->getString(inputIddFileName);
opt.get("-d")->getString(dirPathName);
- // std::cout<<"Directory pathname = "<
Date: Thu, 2 Oct 2014 16:21:35 -0600
Subject: [PATCH 18/71] Directory pathname check removed
---
src/EnergyPlus/CommandLineInterface.cc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/EnergyPlus/CommandLineInterface.cc b/src/EnergyPlus/CommandLineInterface.cc
index faeb453260b..d3d0db408a8 100644
--- a/src/EnergyPlus/CommandLineInterface.cc
+++ b/src/EnergyPlus/CommandLineInterface.cc
@@ -197,7 +197,7 @@ namespace CommandLineInterface{
opt.get("-e")->getString(inputIddFileName);
opt.get("-d")->getString(dirPathName);
- std::cout<<"Directory pathname = "<
Date: Thu, 2 Oct 2014 16:23:47 -0600
Subject: [PATCH 19/71] Directory pathname check removed
---
src/EnergyPlus/CommandLineInterface.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/EnergyPlus/CommandLineInterface.cc b/src/EnergyPlus/CommandLineInterface.cc
index d3d0db408a8..5deba70b0ce 100644
--- a/src/EnergyPlus/CommandLineInterface.cc
+++ b/src/EnergyPlus/CommandLineInterface.cc
@@ -326,10 +326,10 @@ namespace CommandLineInterface{
DisplayString("Name of the extension = "+ extIdfFileName + " \n");*/
std::string extEpwfFileName = returnFileExtension(inputWeatherFileName);
- if(extEpwfFileName == "")
+ /*if(extEpwfFileName == "")
DisplayString("no file extension in " + extEpwfFileName + " \n");
else
- DisplayString("Name of the extension = "+ extEpwfFileName + " \n");
+ DisplayString("Name of the extension = "+ extEpwfFileName + " \n");*/
if (extIdfFileName != "idf"){
ShowFatalError("ERROR: Only idf files are allowed with [option] '-i' \n");
From f4663d549cf71ebf617c1f7b1cfa3252b6f4c1ce Mon Sep 17 00:00:00 2001
From: nealkruis
Date: Fri, 3 Oct 2014 16:36:54 -0600
Subject: [PATCH 20/71] Change executable to lowercase to comply with standard
command line conventions.
---
cmake/ProjectMacros.cmake | 4 ++--
src/EnergyPlus/CMakeLists.txt | 17 +++++++++++------
tst/EnergyPlus/unit/CMakeLists.txt | 4 ++--
3 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/cmake/ProjectMacros.cmake b/cmake/ProjectMacros.cmake
index 656c84ec360..86abb692a0c 100644
--- a/cmake/ProjectMacros.cmake
+++ b/cmake/ProjectMacros.cmake
@@ -128,7 +128,7 @@ function( ADD_SIMULATION_TEST )
add_test(NAME "integration.${IDF_NAME}" COMMAND ${CMAKE_COMMAND}
-DSOURCE_DIR=${CMAKE_SOURCE_DIR}
-DBINARY_DIR=${CMAKE_BINARY_DIR}
- -DENERGYPLUS_EXE=$
+ -DENERGYPLUS_EXE=$
#-DEXPANDOBJECTS_EXE=$
-DIDF_FILE=${ADD_SIM_TEST_IDF_FILE}
-DEPW_FILE=${ADD_SIM_TEST_EPW_FILE}
@@ -140,7 +140,7 @@ function( ADD_SIMULATION_TEST )
add_test(NAME "integration.${IDF_NAME}" COMMAND ${CMAKE_COMMAND}
-DSOURCE_DIR=${CMAKE_SOURCE_DIR}
-DBINARY_DIR=${CMAKE_BINARY_DIR}
- -DENERGYPLUS_EXE=$
+ -DENERGYPLUS_EXE=$
-DIDF_FILE=${ADD_SIM_TEST_IDF_FILE}
-DEPW_FILE=${ADD_SIM_TEST_EPW_FILE}
-DANNUAL_SIMULATION=${ANNUAL_SIMULATION}
diff --git a/src/EnergyPlus/CMakeLists.txt b/src/EnergyPlus/CMakeLists.txt
index 194c75f0f4d..04b9092bfe5 100644
--- a/src/EnergyPlus/CMakeLists.txt
+++ b/src/EnergyPlus/CMakeLists.txt
@@ -518,17 +518,22 @@ SET( SRC
ZoneTempPredictorCorrector.hh
)
-ADD_LIBRARY(EnergyPlusLib STATIC ${SRC})
-ADD_EXECUTABLE(EnergyPlus main.cc main.hh)
+ADD_LIBRARY(energypluslib STATIC ${SRC})
+ADD_EXECUTABLE(energyplus main.cc main.hh)
-#TARGET_LINK_LIBRARIES( EnergyPlus DElight )
-TARGET_LINK_LIBRARIES( EnergyPlus EnergyPlusLib objexx sqlite bcvtb epexpat epfmiimport )
+#TARGET_LINK_LIBRARIES( energyplus DElight )
+TARGET_LINK_LIBRARIES( energyplus energypluslib objexx sqlite bcvtb epexpat epfmiimport )
if(CMAKE_HOST_UNIX)
if(NOT APPLE)
- TARGET_LINK_LIBRARIES( EnergyPlus dl )
+ TARGET_LINK_LIBRARIES( energyplus dl )
endif()
endif()
+if(UNIX AND NOT APPLE)
+ ADD_CUSTOM_COMMAND(TARGET energyplus POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E chdir "${CMAKE_BINARY_DIR}/Products/" ln -s "energyplus" "EnergyPlus"
+ )
+endif()
-INSTALL( TARGETS EnergyPlus DESTINATION ./ )
+INSTALL( TARGETS energyplus DESTINATION ./ )
diff --git a/tst/EnergyPlus/unit/CMakeLists.txt b/tst/EnergyPlus/unit/CMakeLists.txt
index fb9819f5704..29e5fb226c3 100644
--- a/tst/EnergyPlus/unit/CMakeLists.txt
+++ b/tst/EnergyPlus/unit/CMakeLists.txt
@@ -13,7 +13,7 @@ set( test_src
)
set( test_dependencies
- EnergyPlusLib
+ energypluslib
objexx
sqlite
bcvtb
@@ -30,4 +30,4 @@ endif()
# Executable name will be EnergyPlus_tests
# Execute EnergyPlus_tests --help for options using gtest runner
# Execute EnergyPlus_tests with no arguments to run all tests
-CREATE_TEST_TARGETS( EnergyPlus "${test_src}" "${test_dependencies}" )
+CREATE_TEST_TARGETS( energyplus "${test_src}" "${test_dependencies}" )
From 8e7cb5428db2a485e53855b3680f9eb761ca3363 Mon Sep 17 00:00:00 2001
From: Monika Sharma
Date: Mon, 6 Oct 2014 14:22:49 -0600
Subject: [PATCH 21/71] Pater's suggestions implemented
---
src/EnergyPlus/CommandLineInterface.cc | 335 +++++++++++++------------
src/EnergyPlus/CommandLineInterface.hh | 3 +
src/EnergyPlus/InputProcessor.cc | 6 +-
src/EnergyPlus/main.cc | 30 +--
4 files changed, 196 insertions(+), 178 deletions(-)
diff --git a/src/EnergyPlus/CommandLineInterface.cc b/src/EnergyPlus/CommandLineInterface.cc
index 5deba70b0ce..650c78358f8 100644
--- a/src/EnergyPlus/CommandLineInterface.cc
+++ b/src/EnergyPlus/CommandLineInterface.cc
@@ -84,7 +84,12 @@ namespace CommandLineInterface{
std::string eplusADSFileName;
std::string outputFilePrefix;
std::string dirPathName;
+ std::string idfFileNameOnly;
+ std::string exePath;
+ std::string prefixOutName;
+
bool readVarsValue;
+ bool prefixValue;
std::string
returnFileName( std::string const& filename )
@@ -118,35 +123,27 @@ namespace CommandLineInterface{
return ext;
}
-
- bool mkpath( std::string path )
+ int
+ mkpath(std::string s,mode_t mode)
{
- bool bSuccess = false;
- int nRC = ::mkdir( path.c_str(), 0775 );
- if( nRC == -1 )
- {
- switch( errno )
- {
- case ENOENT:
- //parent didn't exist, try to create it
- if( mkpath( path.substr(0, path.find_last_of('/')) ) )
- //Now, try to create again.
- bSuccess = 0 == ::mkdir( path.c_str(), 0775 );
- else
- bSuccess = false;
- break;
- case EEXIST:
- //Done!
- bSuccess = true;
- break;
- default:
- bSuccess = false;
- break;
+ size_t pre=0,pos;
+ std::string dir;
+ int mdret;
+
+ if(s[s.size()-1]!=pathChar){
+ // force trailing / so we can handle everything in loop
+ s+=pathChar;
+ }
+
+ while((pos=s.find_first_of(pathChar,pre))!=std::string::npos){
+ dir=s.substr(0,pos++);
+ pre=pos;
+ if(dir.size()==0) continue; // if leading / first time is 0 length
+ if((mdret=mkdir(dir.c_str(),mode)) && errno!=EEXIST){
+ return mdret;
}
}
- else
- bSuccess = true;
- return bSuccess;
+ return mdret;
}
int
@@ -156,25 +153,25 @@ namespace CommandLineInterface{
ezOptionParser opt;
opt.overview = VerString;
- opt.example = "EnergyPlus -i InputFile.idf -e Energy+.idd -w WeatherFile.epw -d DirPathName -o -r ";
+ opt.example = "EnergyPlus -i custom.idd -w weather.epw -d output/ -p prefix -r input.idf";
- opt.syntax = "EnergyPlus [options]";
+ opt.syntax = "EnergyPlus [options] [input file]";
opt.add("", 0, 0, 0, "Display this message", "-h", "--help");
- opt.add("", 0, 0, 0, "Print version information", "-v", "--version");
+ opt.add("", 0, 0, 0, "Display version information", "-v", "--version");
- opt.add("in.idf", 0, 1, 0, "Input Definition File (IDF) file path (default \".\\in.idf\")", "-i", "--idf");
+ opt.add("in.idf", 0, 1, 0, "Input data file path (default in.idf)", "");
- opt.add("in.epw", 0, 1, 0, "EnergyPlus Weather (EPW) file path (default \".\\in.epw\")", "-w", "--weather");
+ opt.add("in.epw", 0, 1, 0, "Weather file path (default in.epw)", "-w", "--weather");
- opt.add("Energy+.idd", 0, 1, 0, "Input Data Dictionary (IDD) file path (default \".\\Energy+.idd\")", "-e", "--idd");
+ opt.add("Energy+.idd", 0, 1, 0, "Input data dictionary path (default Energy+.idd in executable directory)", "-i", "--idd");
- opt.add("", 0, 0, 0, "Rename output files to using the IDF and EPW file names", "-o", "--output");
+ opt.add("", 0, 1, 0, "Prefix for output files (default same as input file name)", "-p", "--prefix");
- opt.add("", 0, 0, 0, "Option to run readVARS", "-r", "--readVARS");
+ opt.add("", 0, 0, 0, "Run ReadVarsESO to generate time-series CSV", "-r", "--readvars");
- opt.add("", 0, 1, 0, "Output directory pathname (default \".\\pwd\")", "-d", "--dirname");
+ opt.add("", 0, 1, 0, "Output directory (default current working directory)", "-d", "--dir");
// Parse arguments
opt.parse(argc, argv);
@@ -190,157 +187,179 @@ namespace CommandLineInterface{
opt.getUsage(usage);
- opt.get("-i")->getString(inputIdfFileName);
+ //To check the path of EnergyPlus
+ char executable_path[100];
+ realpath(argv[0], executable_path);
+ std::string mystring = std::string(executable_path);
+ exePath = returnDirPathName( mystring );
opt.get("-w")->getString(inputWeatherFileName);
- opt.get("-e")->getString(inputIddFileName);
+ opt.get("-i")->getString(inputIddFileName);
opt.get("-d")->getString(dirPathName);
- // std::cout<<"Directory pathname = "< badOptions;
+ if(!opt.gotExpected(badOptions)) {
+ for(int i=0; i < badOptions.size(); ++i) {
+ DisplayString("\nERROR: Unexpected number of arguments for option " + badOptions[i] + "\n");
+ DisplayString(usage);
+ // ShowFatalError("\nERROR: Unexpected number of arguments for option " + badOptions[i] + "\n");
+ }
+ exit(EXIT_FAILURE);
+ }
- if (opt.isSet("-o"))
- // outputFilePrefix = dirPathName + idfFileNameOnly + "_" + weatherFileNameOnly + "_";
- outputFilePrefix = idfFileNameOnly + "_" + weatherFileNameOnly + "_";
- else
- outputFilePrefix = dirPathName + "eplus";
+ if(!opt.gotRequired(badOptions)) {
+ for(int i=0; i < badOptions.size(); ++i) {
+ DisplayString("\nERROR: Missing required option " + badOptions[i] + "\n");
+ DisplayString(usage);
+ // ShowFatalError("\nERROR: Missing required option " + badOptions[i] + "\n");
+ }
+ exit(EXIT_FAILURE);
+ }
readVarsValue = false;
if (opt.isSet("-r")){
readVarsValue = true;
}
- outputAuditFileName = outputFilePrefix + "out.audit";
- outputBndFileName = outputFilePrefix + "out.bnd";
- outputDxfFileName = outputFilePrefix + "out.dxf";
- outputEioFileName = outputFilePrefix + "out.eio";
- outputEndFileName = outputFilePrefix + "out.end";
- outputErrFileName = outputFilePrefix + "out.err";
- outputEsoFileName = outputFilePrefix + "out.eso";
- outputMtdFileName = outputFilePrefix + "out.mtd";
- outputMddFileName = outputFilePrefix + "out.mdd";
- outputMtrFileName = outputFilePrefix + "out.mtr";
- outputRddFileName = outputFilePrefix + "out.rdd";
- outputShdFileName = outputFilePrefix + "out.shd";
- outputTblCsvFileName = outputFilePrefix + "tbl.csv";
- outputTblHtmFileName = outputFilePrefix + "tbl.htm";
- outputTblTabFileName = outputFilePrefix + "tbl.tab";
- outputTblTxtFileName = outputFilePrefix + "tbl.txt";
- outputTblXmlFileName = outputFilePrefix + "tbl.xml";
- outputAdsFileName = outputFilePrefix + "ADS.out";
- outputDfsFileName = outputFilePrefix + "out.dfs";
- outputDelightFileName = outputFilePrefix + "out.delightdfdmp";
- outputMapTabFileName = outputFilePrefix + "map.tab";
- outputMapCsvFileName = outputFilePrefix + "map.csv";
- outputMapTxtFileName = outputFilePrefix + "map.txt";
- outputEddFileName = outputFilePrefix + "out.edd";
- outputIperrFileName = outputFilePrefix + "out.iperr";
- outputDbgFileName = outputFilePrefix + "out.dbg";
- outputSlnFileName = outputFilePrefix + "out.sln";
- outputSciFileName = outputFilePrefix + "out.sci";
- outputWrlFileName = outputFilePrefix + "out.wrl";
- outputZszCsvFileName = outputFilePrefix + "zsz.csv";
- outputZszTabFileName = outputFilePrefix + "zsz.tab";
- outputZszTxtFileName = outputFilePrefix + "zsz.txt";
- outputSszCsvFileName = outputFilePrefix + "ssz.csv";
- outputSszTabFileName = outputFilePrefix + "ssz.tab";
- outputSszTxtFileName = outputFilePrefix + "ssz.txt";
- outputScreenCsvFileName = outputFilePrefix + "screen.csv";
- EnergyPlusIniFileName = "Energy+.ini";
- inStatFileName = "in.stat";
- TarcogIterationsFileName = "TarcogIterations.dbg";
- eplusADSFileName = idfDirPathName+"eplusADS.inp";
-
- // Handle bad options
- std::vector badOptions;
- if(!opt.gotExpected(badOptions)) {
- for(int i=0; i < badOptions.size(); ++i) {
- ShowFatalError("ERROR: Unexpected number of arguments for option " + badOptions[i] + "\n");
- }
+ // Process standard arguments
+ if (opt.isSet("-h")) {
DisplayString(usage);
- exit(EXIT_FAILURE);
- }
+ exit(EXIT_SUCCESS);
+ }
- if(!opt.gotRequired(badOptions)) {
- DisplayString(usage);
- for(int i=0; i < badOptions.size(); ++i) {
- ShowFatalError("ERROR: Missing required option " + badOptions[i] + "\n");
+ if (opt.isSet("-v")) {
+ DisplayString(VerString);
+ exit(EXIT_SUCCESS);
+ }
+
+ if(opt.lastArgs.size() > 0 && opt.lastArgs.size() < 2){
+ for(int i=0; i < opt.lastArgs.size(); ++i) {
+ std::string arg(opt.lastArgs[i]->c_str());
+ inputIdfFileName = arg;
+ DisplayString("Input file to process: " + inputIdfFileName +"\n");
+
+ struct stat s;
+ if( stat(arg.c_str(),&s) != 0 ) {
+ char resolved_path[100];
+ realpath(arg.c_str(), resolved_path);
+ printf("\n%s\n", resolved_path);
+ DisplayString(" is not a valid path. \n" );
+ exit(EXIT_FAILURE);
+ }
+ }
+ }
+
+ if(opt.lastArgs.size() > 1){
+ for(int i=1; i < opt.lastArgs.size(); ++i) {
+ std::string arg(opt.lastArgs[i]->c_str());
+ DisplayString("ERROR: Invalid option last arg: " + arg + "\n");
+ DisplayString(usage);
+ DisplayString("ERROR: Invalid option last arg: " + arg + "\n");
}
+ exit(EXIT_FAILURE);
+ }
+
+ if(inputIdfFileName.empty())
+ inputIdfFileName = "in.idf";
+
+ idfFileNameWextn = returnFileName(inputIdfFileName);
+
+ idfFileNameOnly = idfFileNameWextn.substr(0,idfFileNameWextn.size()-4);
+ idfDirPathName = returnDirPathName(inputIdfFileName);
+
+ opt.get("-p")->getString(prefixOutName);
+ prefixValue = false;
+ if(opt.isSet("-p"))
+ prefixValue = true;
+
+
+ if (opt.isSet("-d") ){
+ struct stat sb = {0};
+
+ if (stat(dirPathName.c_str(), &sb) == -1) {
+ int mkdirretval;
+ mkdirretval=mkpath(dirPathName,0755);
+ }
+
+ if(dirPathName[dirPathName.size()-1]!=pathChar){
+ // force trailing / so we can handle everything in loop
+ dirPathName+=pathChar;
+ }
+
+ if(prefixValue)
+ outputFilePrefix = dirPathName + prefixOutName + "_";
+ else
+ outputFilePrefix = dirPathName + idfFileNameOnly + "_";
+
+ }
+ else
+ outputFilePrefix = "eplus";
+
+ outputAuditFileName = outputFilePrefix + "out.audit";
+ outputBndFileName = outputFilePrefix + "out.bnd";
+ outputDxfFileName = outputFilePrefix + "out.dxf";
+ outputEioFileName = outputFilePrefix + "out.eio";
+ outputEndFileName = outputFilePrefix + "out.end";
+ outputErrFileName = outputFilePrefix + "out.err";
+ outputEsoFileName = outputFilePrefix + "out.eso";
+ outputMtdFileName = outputFilePrefix + "out.mtd";
+ outputMddFileName = outputFilePrefix + "out.mdd";
+ outputMtrFileName = outputFilePrefix + "out.mtr";
+ outputRddFileName = outputFilePrefix + "out.rdd";
+ outputShdFileName = outputFilePrefix + "out.shd";
+ outputTblCsvFileName = outputFilePrefix + "tbl.csv";
+ outputTblHtmFileName = outputFilePrefix + "tbl.htm";
+ outputTblTabFileName = outputFilePrefix + "tbl.tab";
+ outputTblTxtFileName = outputFilePrefix + "tbl.txt";
+ outputTblXmlFileName = outputFilePrefix + "tbl.xml";
+ outputAdsFileName = outputFilePrefix + "ADS.out";
+ outputDfsFileName = outputFilePrefix + "out.dfs";
+ outputDelightFileName = outputFilePrefix + "out.delightdfdmp";
+ outputMapTabFileName = outputFilePrefix + "map.tab";
+ outputMapCsvFileName = outputFilePrefix + "map.csv";
+ outputMapTxtFileName = outputFilePrefix + "map.txt";
+ outputEddFileName = outputFilePrefix + "out.edd";
+ outputIperrFileName = outputFilePrefix + "out.iperr";
+ outputSlnFileName = outputFilePrefix + "out.sln";
+ outputSciFileName = outputFilePrefix + "out.sci";
+ outputWrlFileName = outputFilePrefix + "out.wrl";
+ outputZszCsvFileName = outputFilePrefix + "zsz.csv";
+ outputZszTabFileName = outputFilePrefix + "zsz.tab";
+ outputZszTxtFileName = outputFilePrefix + "zsz.txt";
+ outputSszCsvFileName = outputFilePrefix + "ssz.csv";
+ outputSszTabFileName = outputFilePrefix + "ssz.tab";
+ outputSszTxtFileName = outputFilePrefix + "ssz.txt";
+ outputScreenCsvFileName = outputFilePrefix + "screen.csv";
+ outputDbgFileName = outputFilePrefix + ".dbg";
+ EnergyPlusIniFileName = "Energy+.ini";
+ inStatFileName = "in.stat";
+ TarcogIterationsFileName = "TarcogIterations.dbg";
+ eplusADSFileName = idfDirPathName+"eplusADS.inp";
- exit(EXIT_FAILURE);
- }
- if(opt.firstArgs.size() > 1 || opt.unknownArgs.size() > 0 || opt.lastArgs.size() > 0){
+ // Handle bad options
+ if(opt.firstArgs.size() > 1 || opt.unknownArgs.size() > 0){
for(int i=1; i < opt.firstArgs.size(); ++i) {
std::string arg(opt.firstArgs[i]->c_str());
- ShowFatalError("ERROR: Invalid option first arg: " + arg + "\n");
+ DisplayString("\nERROR: Invalid option first arg: " + arg + "\n");
+ DisplayString(usage);
+ ShowFatalError("\nERROR: Invalid option first arg: " + arg + "\n");
}
for(int i=0; i < opt.unknownArgs.size(); ++i) {
std::string arg(opt.unknownArgs[i]->c_str());
+ DisplayString("ERROR: Invalid option unknown arg: " + arg + "\n");
+ DisplayString(usage);
ShowFatalError("ERROR: Invalid option unknown arg: " + arg + "\n");
}
- for(int i=0; i < opt.lastArgs.size(); ++i) {
- std::string arg(opt.lastArgs[i]->c_str());
- ShowFatalError("ERROR: Invalid option last arg: " + arg + "\n");
- }
- DisplayString(usage);
exit(EXIT_FAILURE);
}
-
- // Process standard arguments
- if (opt.isSet("-h")) {
- DisplayString(usage);
- exit(EXIT_SUCCESS);
- }
-
- if (opt.isSet("-v")) {
- DisplayString(VerString);
- exit(EXIT_SUCCESS);
- }
-
- /* struct stat st;
- if(stat(idfDirPathName.c_str(),&st) == 0)
- DisplayString(idfDirPathName + " is a valid (idf) directory.\n");
- else {
- ShowFatalError(idfDirPathName + " is not a valid (idf) directory. \n");
- exit(EXIT_FAILURE);
- }*/
-
- std::string extIdfFileName = returnFileExtension(inputIdfFileName);
- /* if(extIdfFileName == "")
- DisplayString("no file extension in " + idfFileNameOnly + " \n");
- else
- DisplayString("Name of the extension = "+ extIdfFileName + " \n");*/
-
- std::string extEpwfFileName = returnFileExtension(inputWeatherFileName);
- /*if(extEpwfFileName == "")
- DisplayString("no file extension in " + extEpwfFileName + " \n");
- else
- DisplayString("Name of the extension = "+ extEpwfFileName + " \n");*/
-
- if (extIdfFileName != "idf"){
- ShowFatalError("ERROR: Only idf files are allowed with [option] '-i' \n");
- exit(EXIT_FAILURE);
- }
-
- if (opt.isSet("-w") && extEpwfFileName != "epw"){
- ShowFatalError("ERROR: Only epw files are allowed with [option] '-w' \n");
- exit(EXIT_FAILURE);
- }
-
return 0;
}
} //namespace options
diff --git a/src/EnergyPlus/CommandLineInterface.hh b/src/EnergyPlus/CommandLineInterface.hh
index 73ceee9b464..04977bafa9f 100644
--- a/src/EnergyPlus/CommandLineInterface.hh
+++ b/src/EnergyPlus/CommandLineInterface.hh
@@ -54,6 +54,9 @@ namespace CommandLineInterface {
extern std::string outputFilePrefix;
extern std::string dirPathName;
extern bool readVarsValue;
+ extern bool prefixValue;
+ extern std::string exePath;
+ extern std::string prefixOutName;
// Process command line arguments
int
diff --git a/src/EnergyPlus/InputProcessor.cc b/src/EnergyPlus/InputProcessor.cc
index 2b46fd17adf..8b27f2ad5ee 100644
--- a/src/EnergyPlus/InputProcessor.cc
+++ b/src/EnergyPlus/InputProcessor.cc
@@ -237,7 +237,7 @@ namespace InputProcessor {
ShowFatalError( "ProcessInput: Could not open file " + outputAuditFileName + " for output (write)." );
}
- { IOFlags flags; gio::inquire( "eplusout.iperr", flags ); FileExists = flags.exists(); }
+ { IOFlags flags; gio::inquire( outputIperrFileName, flags ); FileExists = flags.exists(); }
if ( FileExists ) {
CacheIPErrorFile = GetNewUnitNumber();
{ IOFlags flags; flags.ACTION( "read" ); gio::open( CacheIPErrorFile, outputIperrFileName, flags ); read_stat = flags.ios(); }
@@ -335,7 +335,7 @@ namespace InputProcessor {
{ IOFlags flags; flags.ACTION( "READ" ); gio::open( IDFFile, inputIdfFileName, flags ); read_stat = flags.ios(); }
if ( read_stat != 0 ) {
DisplayString( "Could not open (read)" + inputIdfFileName );
- ShowFatalError( "ProcessInput: Could not open file \"in.idf\" for input (read)." );
+ ShowFatalError( "ProcessInput: Could not open file "+ inputIdfFileName +" for input (read)." );
}
gio::read( IDFFile, fmtA ) >> InputLine;
endcol = len( InputLine );
@@ -374,7 +374,7 @@ namespace InputProcessor {
IDFRecordsGotten.allocate( NumIDFRecords );
IDFRecordsGotten = false;
- gio::write( EchoInputFile, fmtLD ) << " Processing Input Data File (in.idf) -- Complete";
+ gio::write( EchoInputFile, fmtLD ) << " Processing Input Data File ("+inputIdfFileName+") -- Complete";
// WRITE(EchoInputFile,*) ' Number of IDF "Lines"=',NumIDFRecords
gio::write( EchoInputFile, fmtLD ) << " Maximum number of Alpha IDF Args=" << MaxAlphaIDFArgsFound;
gio::write( EchoInputFile, fmtLD ) << " Maximum number of Numeric IDF Args=" << MaxNumericIDFArgsFound;
diff --git a/src/EnergyPlus/main.cc b/src/EnergyPlus/main.cc
index a8b530550c6..87958001dff 100644
--- a/src/EnergyPlus/main.cc
+++ b/src/EnergyPlus/main.cc
@@ -367,7 +367,7 @@ main(int argc, const char * argv[])
gio::close( LFN );
} else {
DisplayString( "Missing " +EnergyPlusIniFileName );
- ProgramPath = "";
+ ProgramPath = exePath + pathChar;
LFN = GetNewUnitNumber();
{ IOFlags flags; flags.ACTION( "write" ); gio::open( LFN, EnergyPlusIniFileName, flags ); iostatus = flags.ios(); }
if ( iostatus != 0 ) {
@@ -392,7 +392,7 @@ main(int argc, const char * argv[])
OutputFileDebug = GetNewUnitNumber();
{ IOFlags flags; flags.ACTION( "write" ); gio::open( OutputFileDebug, outputDbgFileName, flags ); iostatus = flags.ios(); }
if ( iostatus != 0 ) {
- ShowFatalError( "EnergyPlus: Could not open file \"eplusout.dbg\" for output (write)." );
+ ShowFatalError( "EnergyPlus: Could not open file "+outputDbgFileName+" for output (write)." );
}
//Call ProcessInput to produce the IDF file which is read by all of the
@@ -417,33 +417,29 @@ main(int argc, const char * argv[])
std::string esoFileName = outputFilePrefix + "out.eso";
std::string csvFileName = outputFilePrefix + "out.csv";
- ifile.open("eplusout.rvi");
+ std::string RVIfile = idfFileNameOnly + ".rvi";
+ ifile.open(RVIfile.c_str());
ifile <
Date: Tue, 7 Oct 2014 14:48:23 -0600
Subject: [PATCH 22/71] Update executable name for USAGE and EXAMPLE.
---
src/EnergyPlus/CommandLineInterface.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/EnergyPlus/CommandLineInterface.cc b/src/EnergyPlus/CommandLineInterface.cc
index 650c78358f8..506dfcb907d 100644
--- a/src/EnergyPlus/CommandLineInterface.cc
+++ b/src/EnergyPlus/CommandLineInterface.cc
@@ -153,9 +153,9 @@ namespace CommandLineInterface{
ezOptionParser opt;
opt.overview = VerString;
- opt.example = "EnergyPlus -i custom.idd -w weather.epw -d output/ -p prefix -r input.idf";
+ opt.example = "energyplus -i custom.idd -w weather.epw -d output/ -p prefix -r input.idf";
- opt.syntax = "EnergyPlus [options] [input file]";
+ opt.syntax = "energyplus [options] [input file]";
opt.add("", 0, 0, 0, "Display this message", "-h", "--help");
From ded88314d9acc6731c1923f9d125ad9254fa50ed Mon Sep 17 00:00:00 2001
From: Monika Sharma
Date: Tue, 7 Oct 2014 15:08:58 -0600
Subject: [PATCH 23/71] precedence for idd implemented
---
src/EnergyPlus/CommandLineInterface.cc | 54 +++++++++++++-------------
src/EnergyPlus/CommandLineInterface.hh | 5 ++-
src/EnergyPlus/InputProcessor.cc | 2 +-
src/EnergyPlus/main.cc | 14 +++----
4 files changed, 37 insertions(+), 38 deletions(-)
diff --git a/src/EnergyPlus/CommandLineInterface.cc b/src/EnergyPlus/CommandLineInterface.cc
index 650c78358f8..3d9e3076554 100644
--- a/src/EnergyPlus/CommandLineInterface.cc
+++ b/src/EnergyPlus/CommandLineInterface.cc
@@ -85,7 +85,7 @@ namespace CommandLineInterface{
std::string outputFilePrefix;
std::string dirPathName;
std::string idfFileNameOnly;
- std::string exePath;
+ std::string exePathName;
std::string prefixOutName;
bool readVarsValue;
@@ -190,8 +190,8 @@ namespace CommandLineInterface{
//To check the path of EnergyPlus
char executable_path[100];
realpath(argv[0], executable_path);
- std::string mystring = std::string(executable_path);
- exePath = returnDirPathName( mystring );
+ std::string exePath = std::string(executable_path);
+ exePathName = returnDirPathName(exePath);
opt.get("-w")->getString(inputWeatherFileName);
@@ -199,29 +199,11 @@ namespace CommandLineInterface{
opt.get("-d")->getString(dirPathName);
- /////////// For weather filename only (incase needed) ///////////////////
+ /////////// For weather filename only (incase needed) ////////////////
//weatherFileNameWextn = returnFileName(inputWeatherFileName);
//weatherDirPathName = returnDirPathName(inputWeatherFileName);
//std::string weatherFileNameOnly = weatherFileNameWextn.substr(0,weatherFileNameWextn.size()-4);
-
- std::vector badOptions;
- if(!opt.gotExpected(badOptions)) {
- for(int i=0; i < badOptions.size(); ++i) {
- DisplayString("\nERROR: Unexpected number of arguments for option " + badOptions[i] + "\n");
- DisplayString(usage);
- // ShowFatalError("\nERROR: Unexpected number of arguments for option " + badOptions[i] + "\n");
- }
- exit(EXIT_FAILURE);
- }
-
- if(!opt.gotRequired(badOptions)) {
- for(int i=0; i < badOptions.size(); ++i) {
- DisplayString("\nERROR: Missing required option " + badOptions[i] + "\n");
- DisplayString(usage);
- // ShowFatalError("\nERROR: Missing required option " + badOptions[i] + "\n");
- }
- exit(EXIT_FAILURE);
- }
+ //////////////////////////////////////////////////////////////////////
readVarsValue = false;
if (opt.isSet("-r")){
@@ -243,14 +225,13 @@ namespace CommandLineInterface{
for(int i=0; i < opt.lastArgs.size(); ++i) {
std::string arg(opt.lastArgs[i]->c_str());
inputIdfFileName = arg;
- DisplayString("Input file to process: " + inputIdfFileName +"\n");
struct stat s;
if( stat(arg.c_str(),&s) != 0 ) {
char resolved_path[100];
realpath(arg.c_str(), resolved_path);
- printf("\n%s\n", resolved_path);
- DisplayString(" is not a valid path. \n" );
+ std::string idfPath = std::string(resolved_path);
+ DisplayString(idfPath +" is not a valid path. \n" );
exit(EXIT_FAILURE);
}
}
@@ -261,7 +242,6 @@ namespace CommandLineInterface{
std::string arg(opt.lastArgs[i]->c_str());
DisplayString("ERROR: Invalid option last arg: " + arg + "\n");
DisplayString(usage);
- DisplayString("ERROR: Invalid option last arg: " + arg + "\n");
}
exit(EXIT_FAILURE);
}
@@ -343,8 +323,26 @@ namespace CommandLineInterface{
TarcogIterationsFileName = "TarcogIterations.dbg";
eplusADSFileName = idfDirPathName+"eplusADS.inp";
+ // Handle bad options
+ std::vector badOptions;
+ if(!opt.gotExpected(badOptions)) {
+ for(int i=0; i < badOptions.size(); ++i) {
+ DisplayString("\nERROR: Unexpected number of arguments for option " + badOptions[i] + "\n");
+ DisplayString(usage);
+ ShowFatalError("\nERROR: Unexpected number of arguments for option " + badOptions[i] + "\n");
+ }
+ exit(EXIT_FAILURE);
+ }
+
+ if(!opt.gotRequired(badOptions)) {
+ for(int i=0; i < badOptions.size(); ++i) {
+ DisplayString("\nERROR: Missing required option " + badOptions[i] + "\n");
+ DisplayString(usage);
+ ShowFatalError("\nERROR: Missing required option " + badOptions[i] + "\n");
+ }
+ exit(EXIT_FAILURE);
+ }
- // Handle bad options
if(opt.firstArgs.size() > 1 || opt.unknownArgs.size() > 0){
for(int i=1; i < opt.firstArgs.size(); ++i) {
std::string arg(opt.firstArgs[i]->c_str());
diff --git a/src/EnergyPlus/CommandLineInterface.hh b/src/EnergyPlus/CommandLineInterface.hh
index 04977bafa9f..008c5d843d3 100644
--- a/src/EnergyPlus/CommandLineInterface.hh
+++ b/src/EnergyPlus/CommandLineInterface.hh
@@ -53,10 +53,11 @@ namespace CommandLineInterface {
extern std::string idfFileNameOnly;
extern std::string outputFilePrefix;
extern std::string dirPathName;
+ extern std::string exePathName;
+ extern std::string prefixOutName;
+
extern bool readVarsValue;
extern bool prefixValue;
- extern std::string exePath;
- extern std::string prefixOutName;
// Process command line arguments
int
diff --git a/src/EnergyPlus/InputProcessor.cc b/src/EnergyPlus/InputProcessor.cc
index 8b27f2ad5ee..29070a063b8 100644
--- a/src/EnergyPlus/InputProcessor.cc
+++ b/src/EnergyPlus/InputProcessor.cc
@@ -265,7 +265,7 @@ namespace InputProcessor {
ShowFatalError( "ProcessInput: " + inputIddFileName + " missing. Program terminates. Fullname = " + FullName );
}
IDDFile = GetNewUnitNumber();
- { IOFlags flags; flags.ACTION( "read" ); gio::open( IDDFile, FullName, flags ); read_stat = flags.ios(); }
+ { IOFlags flags; flags.ACTION( "read" ); gio::open( IDDFile, FullName, flags ); read_stat = flags.ios();}
if ( read_stat != 0 ) {
DisplayString( "Could not open (read) " + inputIddFileName );
ShowFatalError( "ProcessInput: Could not open file " + inputIddFileName + " for input (read)." );
diff --git a/src/EnergyPlus/main.cc b/src/EnergyPlus/main.cc
index 87958001dff..bce7cc065b9 100644
--- a/src/EnergyPlus/main.cc
+++ b/src/EnergyPlus/main.cc
@@ -45,7 +45,7 @@ main(int argc, const char * argv[])
// NOTICE
- // Copyright © 1996-2014 The Board of Trustees of the University of Illinois and The Regents of the
+ // Copyright � 1996-2014 The Board of Trustees of the University of Illinois and The Regents of the
// University of California through Ernest Orlando Lawrence Berkeley National Laboratory. All rights
// reserved.
@@ -120,11 +120,11 @@ main(int argc, const char * argv[])
// (Conjunction Of Multizone Infiltration Specialists) developed by a multinational, multi-institutional
// effort under the auspices of the International Energy Agency's Buildings and Community Systems Agreement
// working group focusing on multizone air flow modeling (Annex 23) and now administered by the Swiss Federal
- // Laboratories for Materials Testing and Research (EMPA), Division 175, Überlandstrasse 129, CH-8600 Dübendorf,
+ // Laboratories for Materials Testing and Research (EMPA), Division 175, �berlandstrasse 129, CH-8600 D�bendorf,
// Switzerland.
// The EnergyPlus v1.2 model for displacement ventilation and cross-ventilation was developed
- // by Guilherme Carrilho da Graça and Paul Linden of the Department of Mechanical and Aerospace
+ // by Guilherme Carrilho da Gra�a and Paul Linden of the Department of Mechanical and Aerospace
// Engineering, University of California, San Diego.
// The EnergyPlus models for UFAD served zones were developed by Anna Liu and Paul Linden at the Department
@@ -366,8 +366,8 @@ main(int argc, const char * argv[])
gio::close( LFN );
} else {
- DisplayString( "Missing " +EnergyPlusIniFileName );
- ProgramPath = exePath + pathChar;
+ DisplayString( "Missing " + EnergyPlusIniFileName );
+ ProgramPath = exePathName + pathChar;
LFN = GetNewUnitNumber();
{ IOFlags flags; flags.ACTION( "write" ); gio::open( LFN, EnergyPlusIniFileName, flags ); iostatus = flags.ios(); }
if ( iostatus != 0 ) {
@@ -432,8 +432,8 @@ main(int argc, const char * argv[])
nfile.close();
std::string ReadVars = "ReadVarsESO";
- std::string Total = "./"+ReadVars+" "+RVIfile+" "+"unlimited";
- std::string Total1 = "./"+ReadVars+" "+MVIfile+" "+"unlimited";
+ std::string Total = "./"+ReadVars+" "+RVIfile+" unlimited";
+ std::string Total1 = "./"+ReadVars+" "+MVIfile+" unlimited";
if(readVarsValue) {
From 006cbc9785117725e9f727cc29c26dbd82774199 Mon Sep 17 00:00:00 2001
From: Monika Sharma
Date: Thu, 9 Oct 2014 17:31:29 -0600
Subject: [PATCH 24/71] Only --weather=filename implemented
---
src/EnergyPlus/CommandLineInterface.cc | 147 +++++++++++++++++++++----
src/EnergyPlus/CommandLineInterface.hh | 3 +
src/EnergyPlus/main.cc | 9 +-
3 files changed, 135 insertions(+), 24 deletions(-)
diff --git a/src/EnergyPlus/CommandLineInterface.cc b/src/EnergyPlus/CommandLineInterface.cc
index 42c885be9a9..b03f9516a69 100644
--- a/src/EnergyPlus/CommandLineInterface.cc
+++ b/src/EnergyPlus/CommandLineInterface.cc
@@ -6,13 +6,10 @@
#include
#include
#include
-#include
#include
-#include
// CLI Headers
#include
-//#include
// Project headers
#include
@@ -87,9 +84,19 @@ namespace CommandLineInterface{
std::string idfFileNameOnly;
std::string exePathName;
std::string prefixOutName;
+ std::string inputIMFFileName;
bool readVarsValue;
bool prefixValue;
+ bool expandObjValue;
+ bool EPMacroValue;
+
+
+ bool fileExist(const std::string& filename)
+ {
+ std::ifstream infile(filename);
+ return infile.good();
+ }
std::string
returnFileName( std::string const& filename )
@@ -113,7 +120,7 @@ namespace CommandLineInterface{
std::string ext = "";
for(int i=0; igetString(inputWeatherFileName);
+ instream = &input;
+ input.open( inputWeatherFileName.c_str() );
opt.get("-i")->getString(inputIddFileName);
opt.get("-d")->getString(dirPathName);
- /////////// For weather filename only (incase needed) ////////////////
+ opt.get("-ep")->getString(inputIMFFileName);
+
+ /////////// For weather filename only (in case needed) ////////////////
//weatherFileNameWextn = returnFileName(inputWeatherFileName);
//weatherDirPathName = returnDirPathName(inputWeatherFileName);
//std::string weatherFileNameOnly = weatherFileNameWextn.substr(0,weatherFileNameWextn.size()-4);
@@ -259,6 +292,13 @@ namespace CommandLineInterface{
if(opt.isSet("-p"))
prefixValue = true;
+ expandObjValue = false;
+ if(opt.isSet("-e"))
+ expandObjValue = true;
+
+ EPMacroValue = false;
+ if(opt.isSet("-ep"))
+ EPMacroValue = true;
if (opt.isSet("-d") ){
struct stat sb = {0};
@@ -327,20 +367,24 @@ namespace CommandLineInterface{
std::vector badOptions;
if(!opt.gotExpected(badOptions)) {
for(int i=0; i < badOptions.size(); ++i) {
+ if(badOptions[i] != "-w"){
DisplayString("\nERROR: Unexpected number of arguments for option " + badOptions[i] + "\n");
DisplayString(usage);
ShowFatalError("\nERROR: Unexpected number of arguments for option " + badOptions[i] + "\n");
+ exit(EXIT_FAILURE);
+ }
}
- exit(EXIT_FAILURE);
}
if(!opt.gotRequired(badOptions)) {
for(int i=0; i < badOptions.size(); ++i) {
+ if(badOptions[i] != "-w"){
DisplayString("\nERROR: Missing required option " + badOptions[i] + "\n");
DisplayString(usage);
ShowFatalError("\nERROR: Missing required option " + badOptions[i] + "\n");
+ exit(EXIT_FAILURE);
+ }
}
- exit(EXIT_FAILURE);
}
if(opt.firstArgs.size() > 1 || opt.unknownArgs.size() > 0){
@@ -358,6 +402,71 @@ namespace CommandLineInterface{
}
exit(EXIT_FAILURE);
}
+
+ /* std::string ExpandObjects = "ExpandObjects";
+ std::string runExpandObjects = "./"+ExpandObjects;
+ if(expandObjValue)
+ system(runExpandObjects.c_str());
+
+ std::string expandIdfFile = "expanded.idf";
+ bool expandIdfFileExist = fileExist(expandIdfFile);
+ if(expandIdfFileExist) {
+ std::string expidfFileName = outputFilePrefix + ".expidf";
+ std::ifstream src(expandIdfFile.c_str());
+ std::ofstream dst(expidfFileName.c_str());
+ dst << src.rdbuf();
+ remove(idfFileNameOnly.c_str());
+ link(expidfFileName.c_str(), idfFileNameOnly.c_str());
+ }
+ else
+ std::cout<<"ExpandObjects file does not exist. \n";
+
+ bool imfFileExist = fileExist(inputIMFFileName);
+ std::string defaultIMFFileName = "in.imf";
+
+ if(imfFileExist)
+ link(inputIMFFileName.c_str(), defaultIMFFileName.c_str());
+
+ std::string outIDFFileName = "out.idf";
+ remove(outIDFFileName.c_str());
+ std::string outAuditFileName = "audit.out";
+ remove(outAuditFileName.c_str());
+ std::string epmdetFileName = outputFilePrefix+".epmdet";
+ remove(epmdetFileName.c_str());
+ std::string epmidfFileName = outputFilePrefix+".epmidf";
+ remove(epmidfFileName.c_str());
+
+ std::string EPMacroexe = "EPMacro";
+ std::string runEPMacro = "./"+EPMacroexe;
+ if(EPMacroValue){
+ system(runEPMacro.c_str());
+ std::cout<<"Running EPMacro...\n";
+
+ bool AuditFileExist = fileExist(outAuditFileName);
+ if(AuditFileExist){
+ std::string epmdetFileName = outputFilePrefix + ".epmdet";
+ std::ifstream src(outAuditFileName.c_str());
+ std::ofstream dst(epmdetFileName.c_str());
+ dst << src.rdbuf();
+ }
+
+ bool outFileExist = fileExist(outIDFFileName);
+ if(outFileExist){
+ std::string epmidfFileName = outputFilePrefix + ".epmidf";
+ std::ifstream src(outIDFFileName.c_str());
+ std::ofstream dst(epmidfFileName.c_str());
+ dst << src.rdbuf();
+ link(epmidfFileName.c_str(), idfFileNameOnly.c_str());
+ DisplayString("Input file: " + inputIMFFileName + "\n");
+ }
+ else{
+ ShowFatalError("EPMacro did not produce "+ outIDFFileName + "with "+ inputIMFFileName +"\n");
+ exit(EXIT_FAILURE);
+ }
+ }*/
+
+
+
return 0;
}
} //namespace options
diff --git a/src/EnergyPlus/CommandLineInterface.hh b/src/EnergyPlus/CommandLineInterface.hh
index 008c5d843d3..939e91522c1 100644
--- a/src/EnergyPlus/CommandLineInterface.hh
+++ b/src/EnergyPlus/CommandLineInterface.hh
@@ -55,9 +55,12 @@ namespace CommandLineInterface {
extern std::string dirPathName;
extern std::string exePathName;
extern std::string prefixOutName;
+ extern std::string inputIMFFileName;
extern bool readVarsValue;
extern bool prefixValue;
+ extern bool expandObjValue;
+ extern bool EPMacroValue;
// Process command line arguments
int
diff --git a/src/EnergyPlus/main.cc b/src/EnergyPlus/main.cc
index bce7cc065b9..f488855b11c 100644
--- a/src/EnergyPlus/main.cc
+++ b/src/EnergyPlus/main.cc
@@ -36,7 +36,6 @@
#include
#include
-
int
main(int argc, const char * argv[])
{
@@ -432,13 +431,13 @@ main(int argc, const char * argv[])
nfile.close();
std::string ReadVars = "ReadVarsESO";
- std::string Total = "./"+ReadVars+" "+RVIfile+" unlimited";
- std::string Total1 = "./"+ReadVars+" "+MVIfile+" unlimited";
+ std::string ReadVarsRVI = "./"+ReadVars+" "+RVIfile+" unlimited";
+ std::string ReadVarsMVI = "./"+ReadVars+" "+MVIfile+" unlimited";
if(readVarsValue) {
- system(Total.c_str());
- system(Total1.c_str());
+ system(ReadVarsRVI.c_str());
+ system(ReadVarsMVI.c_str());
}
EndEnergyPlus();
From 27e7399f10fdb2a32069a2520babff08b471f883 Mon Sep 17 00:00:00 2001
From: Monika Sharma
Date: Fri, 10 Oct 2014 10:30:10 -0600
Subject: [PATCH 25/71] --weather=filename & --idd=filename implemented
---
src/EnergyPlus/CommandLineInterface.cc | 90 ++++++++++++++------------
1 file changed, 47 insertions(+), 43 deletions(-)
diff --git a/src/EnergyPlus/CommandLineInterface.cc b/src/EnergyPlus/CommandLineInterface.cc
index b03f9516a69..a64ccb4b63c 100644
--- a/src/EnergyPlus/CommandLineInterface.cc
+++ b/src/EnergyPlus/CommandLineInterface.cc
@@ -153,27 +153,33 @@ namespace CommandLineInterface{
return mdret;
}
+ std::string EqualsToSpace(std::string text)
+ {
+ std::replace(text.begin(), text.end(), '=', ' ');
+ return text;
+ }
+
int
ProcessArgs(int argc, const char * argv[])
{
-
- std::string weatherEquals;
- std::string weatherLongOption;
- std::ifstream input;
- std::istream* instream;
+ std::ifstream inputW, inputIDD;
+ std::istream* instreamW;
+ std::istream* instreamIDD;
for ( int i = 1; i < argc; ++i ) {
std::string inputArg( argv[ i ] );
- if(inputArg.substr(0,9) == "--weather"){
- weatherLongOption = inputArg.substr(0,9);
- inputWeatherFileName = returnFileExtension(inputArg);
+ if(inputArg.substr(0,10) == "--weather="){
+ std::string weatherLongOption = EqualsToSpace(inputArg.substr(0,10));
argv[i] = weatherLongOption.c_str();
- weatherEquals = weatherLongOption + "=";
+ inputWeatherFileName = returnFileExtension(inputArg);
}
- }
- if(weatherLongOption.empty())
- weatherLongOption = "--weather=";
+ if(inputArg.substr(0,6) == "--idd="){
+ std::string iddLongOption = EqualsToSpace(inputArg.substr(0,6));
+ argv[i] = iddLongOption.c_str();
+ inputIddFileName = returnFileExtension(inputArg);
+ }
+ }
ezOptionParser opt;
@@ -186,12 +192,16 @@ namespace CommandLineInterface{
opt.add("", 0, 0, 0, "Display version information", "-v", "--version");
- opt.add("in.idf", 0, 1, 0, "Input data file path (default in.idf)", "");
+ // opt.add("in.idf", 0, 1, 0, "Input data file path (default in.idf)", "");
+
+ opt.add("in.epw", 0, 1, 0, "Weather file path (default in.epw)", "-w", "--weather");
- opt.add("in.epw", 0, 1, 0, "Weather file path (default in.epw)", "-w", "--weather", "--weather=");
+ opt.add("", 0, 0, 0, "Weather file path", "--weather ");
opt.add("Energy+.idd", 0, 1, 0, "Input data dictionary path (default Energy+.idd in executable directory)", "-i", "--idd");
+ opt.add("", 0, 0, 0, "Input data dictionary path", "--idd ");
+
opt.add("", 0, 1, 0, "Prefix for output files (default same as input file name)", "-p", "--prefix");
opt.add("", 0, 0, 0, "Run ReadVarsESO to generate time-series CSV", "-r", "--readvars");
@@ -221,23 +231,21 @@ namespace CommandLineInterface{
exePathName = returnDirPathName(exePath);
if(inputWeatherFileName.empty())
- inputWeatherFileName = "in.epw";
+ inputWeatherFileName = "in.epw";
+
+ instreamW = &inputW;
+ inputW.open( inputWeatherFileName.c_str() );
- instream = &input;
- input.open( inputWeatherFileName.c_str() );
+ if(inputIddFileName.empty())
+ inputIddFileName = "Energy+.idd";
- opt.get("-i")->getString(inputIddFileName);
+ instreamIDD = &inputIDD;
+ inputIDD.open( inputIddFileName.c_str() );
opt.get("-d")->getString(dirPathName);
opt.get("-ep")->getString(inputIMFFileName);
- /////////// For weather filename only (in case needed) ////////////////
- //weatherFileNameWextn = returnFileName(inputWeatherFileName);
- //weatherDirPathName = returnDirPathName(inputWeatherFileName);
- //std::string weatherFileNameOnly = weatherFileNameWextn.substr(0,weatherFileNameWextn.size()-4);
- //////////////////////////////////////////////////////////////////////
-
readVarsValue = false;
if (opt.isSet("-r")){
readVarsValue = true;
@@ -264,7 +272,7 @@ namespace CommandLineInterface{
char resolved_path[100];
realpath(arg.c_str(), resolved_path);
std::string idfPath = std::string(resolved_path);
- DisplayString(idfPath +" is not a valid path. \n" );
+ DisplayString("ERROR: "+ idfPath +" is not a valid path. \n" );
exit(EXIT_FAILURE);
}
}
@@ -309,7 +317,6 @@ namespace CommandLineInterface{
}
if(dirPathName[dirPathName.size()-1]!=pathChar){
- // force trailing / so we can handle everything in loop
dirPathName+=pathChar;
}
@@ -367,23 +374,19 @@ namespace CommandLineInterface{
std::vector badOptions;
if(!opt.gotExpected(badOptions)) {
for(int i=0; i < badOptions.size(); ++i) {
- if(badOptions[i] != "-w"){
DisplayString("\nERROR: Unexpected number of arguments for option " + badOptions[i] + "\n");
DisplayString(usage);
ShowFatalError("\nERROR: Unexpected number of arguments for option " + badOptions[i] + "\n");
exit(EXIT_FAILURE);
- }
}
}
if(!opt.gotRequired(badOptions)) {
for(int i=0; i < badOptions.size(); ++i) {
- if(badOptions[i] != "-w"){
DisplayString("\nERROR: Missing required option " + badOptions[i] + "\n");
DisplayString(usage);
ShowFatalError("\nERROR: Missing required option " + badOptions[i] + "\n");
exit(EXIT_FAILURE);
- }
}
}
@@ -405,21 +408,22 @@ namespace CommandLineInterface{
/* std::string ExpandObjects = "ExpandObjects";
std::string runExpandObjects = "./"+ExpandObjects;
- if(expandObjValue)
+ if(expandObjValue) {
system(runExpandObjects.c_str());
- std::string expandIdfFile = "expanded.idf";
- bool expandIdfFileExist = fileExist(expandIdfFile);
- if(expandIdfFileExist) {
- std::string expidfFileName = outputFilePrefix + ".expidf";
- std::ifstream src(expandIdfFile.c_str());
- std::ofstream dst(expidfFileName.c_str());
- dst << src.rdbuf();
- remove(idfFileNameOnly.c_str());
- link(expidfFileName.c_str(), idfFileNameOnly.c_str());
- }
- else
- std::cout<<"ExpandObjects file does not exist. \n";
+ std::string expandIdfFile = "expanded.idf";
+ bool expandIdfFileExist = fileExist(expandIdfFile);
+ if(expandIdfFileExist) {
+ std::string expidfFileName = outputFilePrefix + ".expidf";
+ std::ifstream src(expandIdfFile.c_str());
+ std::ofstream dst(expidfFileName.c_str());
+ dst << src.rdbuf();
+ remove(idfFileNameOnly.c_str());
+ link(expidfFileName.c_str(), idfFileNameOnly.c_str());
+ }
+ else
+ std::cout<<"ExpandObjects file does not exist. \n";
+ }
bool imfFileExist = fileExist(inputIMFFileName);
std::string defaultIMFFileName = "in.imf";
From 603950cc18f8e087ede4eb7d49a9227121fbf38a Mon Sep 17 00:00:00 2001
From: Monika Sharma
Date: Fri, 10 Oct 2014 12:40:29 -0600
Subject: [PATCH 26/71] Call to EPMacro preprocessor implemented
---
src/EnergyPlus/CommandLineInterface.cc | 804 ++++++++++++-------------
1 file changed, 400 insertions(+), 404 deletions(-)
diff --git a/src/EnergyPlus/CommandLineInterface.cc b/src/EnergyPlus/CommandLineInterface.cc
index a64ccb4b63c..34c7be784e9 100644
--- a/src/EnergyPlus/CommandLineInterface.cc
+++ b/src/EnergyPlus/CommandLineInterface.cc
@@ -28,452 +28,448 @@ namespace EnergyPlus{
namespace CommandLineInterface{
- using namespace DataStringGlobals;
- using namespace InputProcessor;
- using namespace SimulationManager;
- using namespace OutputReportTabular;
- using namespace OutputProcessor;
- using namespace SolarShading;
- using namespace ez;
-
- std::string outputAuditFileName;
- std::string outputBndFileName;
- std::string outputDxfFileName;
- std::string outputEioFileName;
- std::string outputEndFileName;
- std::string outputErrFileName;
- std::string outputEsoFileName;
- std::string outputMtdFileName;
- std::string outputMddFileName;
- std::string outputMtrFileName;
- std::string outputRddFileName;
- std::string outputShdFileName;
- std::string outputTblCsvFileName;
- std::string outputTblHtmFileName;
- std::string outputTblTabFileName;
- std::string outputTblTxtFileName;
- std::string outputTblXmlFileName;
- std::string inputIdfFileName;
- std::string inputIddFileName;
- std::string inputWeatherFileName;
- std::string outputAdsFileName;
- std::string outputDfsFileName;
- std::string outputDelightFileName;
- std::string outputMapTabFileName;
- std::string outputMapCsvFileName;
- std::string outputMapTxtFileName;
- std::string outputEddFileName;
- std::string outputIperrFileName;
- std::string outputDbgFileName;
- std::string outputSlnFileName;
- std::string outputSciFileName;
- std::string outputWrlFileName;
- std::string outputZszCsvFileName;
- std::string outputZszTabFileName;
- std::string outputZszTxtFileName;
- std::string outputSszCsvFileName;
- std::string outputSszTabFileName;
- std::string outputSszTxtFileName;
- std::string outputScreenCsvFileName;
- std::string EnergyPlusIniFileName;
- std::string inStatFileName;
- std::string TarcogIterationsFileName;
- std::string eplusADSFileName;
- std::string outputFilePrefix;
- std::string dirPathName;
- std::string idfFileNameOnly;
- std::string exePathName;
- std::string prefixOutName;
- std::string inputIMFFileName;
-
- bool readVarsValue;
- bool prefixValue;
- bool expandObjValue;
- bool EPMacroValue;
-
-
- bool fileExist(const std::string& filename)
- {
- std::ifstream infile(filename);
- return infile.good();
- }
-
- std::string
- returnFileName( std::string const& filename )
- {
- return {std::find_if(filename.rbegin(), filename.rend(),
- [](char c) { return c == pathChar; }).base(),
- filename.end()};
- }
-
- std::string
- returnDirPathName( std::string const& filename )
- {
- std::string::const_reverse_iterator pivot = std::find( filename.rbegin(), filename.rend(), pathChar );
- return pivot == filename.rend()
- ? filename
- : std::string( filename.begin(), pivot.base() - 1 );
- }
-
- std::string
- returnFileExtension(const std::string& filename){
- std::string ext = "";
-
- for(int i=0; igetString(dirPathName);
+
+ opt.get("-ep")->getString(inputIMFFileName);
+
+ readVarsValue = false;
+ if (opt.isSet("-r")){
+ readVarsValue = true;
+ }
- opt.add("", 0, 1, 0, "Prefix for output files (default same as input file name)", "-p", "--prefix");
+ // Process standard arguments
+ if (opt.isSet("-h")) {
+ DisplayString(usage);
+ exit(EXIT_SUCCESS);
+ }
- opt.add("", 0, 0, 0, "Run ReadVarsESO to generate time-series CSV", "-r", "--readvars");
+ if (opt.isSet("-v")) {
+ DisplayString(VerString);
+ exit(EXIT_SUCCESS);
+ }
- opt.add("", 0, 0, 0, "Run ExpandObjects", "-e", "--expandObj");
+ if(opt.lastArgs.size() > 0 && opt.lastArgs.size() < 2){
+ for(int i=0; i < opt.lastArgs.size(); ++i) {
+ std::string arg(opt.lastArgs[i]->c_str());
+ inputIdfFileName = arg;
+
+ struct stat s;
+ if( stat(arg.c_str(),&s) != 0 ) {
+ char resolved_path[100];
+ realpath(arg.c_str(), resolved_path);
+ std::string idfPath = std::string(resolved_path);
+ DisplayString("ERROR: "+ idfPath +" is not a valid path. \n" );
+ exit(EXIT_FAILURE);
+ }
+ }
+ }
- opt.add("", 0, 1, 0, "Run EPMacro", "-ep", "--epMacro");
+ if(opt.lastArgs.size() > 1){
+ for(int i=1; i < opt.lastArgs.size(); ++i) {
+ std::string arg(opt.lastArgs[i]->c_str());
+ DisplayString("ERROR: Invalid option last arg: " + arg + "\n");
+ DisplayString(usage);
+ }
+ exit(EXIT_FAILURE);
+ }
- opt.add("", 0, 1, 0, "Output directory (default current working directory)", "-d", "--dir");
+ if(inputIdfFileName.empty())
+ inputIdfFileName = "in.idf";
- // Parse arguments
- opt.parse(argc, argv);
+ idfFileNameWextn = returnFileName(inputIdfFileName);
- // print arguments parsed (useful for debugging)
- //std::string pretty;
- //opt.prettyPrint(pretty);
- //std::cout << pretty << std::endl;
+ idfFileNameOnly = idfFileNameWextn.substr(0,idfFileNameWextn.size()-4);
+ idfDirPathName = returnDirPathName(inputIdfFileName);
- std::string usage, idfFileNameWextn, idfDirPathName;
- std::string weatherFileNameWextn, weatherDirPathName;
- opt.getUsage(usage);
+ opt.get("-p")->getString(prefixOutName);
+ prefixValue = false;
+ if(opt.isSet("-p"))
+ prefixValue = true;
- //To check the path of EnergyPlus
- char executable_path[100];
- realpath(argv[0], executable_path);
- std::string exePath = std::string(executable_path);
- exePathName = returnDirPathName(exePath);
+ expandObjValue = false;
+ if(opt.isSet("-e"))
+ expandObjValue = true;
- if(inputWeatherFileName.empty())
- inputWeatherFileName = "in.epw";
+ EPMacroValue = false;
+ if(opt.isSet("-ep"))
+ EPMacroValue = true;
- instreamW = &inputW;
- inputW.open( inputWeatherFileName.c_str() );
+ if (opt.isSet("-d") ){
+ struct stat sb = {0};
- if(inputIddFileName.empty())
- inputIddFileName = "Energy+.idd";
+ if (stat(dirPathName.c_str(), &sb) == -1) {
+ int mkdirretval;
+ mkdirretval=mkpath(dirPathName,0755);
+ }
- instreamIDD = &inputIDD;
- inputIDD.open( inputIddFileName.c_str() );
+ if(dirPathName[dirPathName.size()-1]!=pathChar){
+ dirPathName+=pathChar;
+ }
- opt.get("-d")->getString(dirPathName);
+ if(prefixValue)
+ outputFilePrefix = dirPathName + prefixOutName + "_";
+ else
+ outputFilePrefix = dirPathName + idfFileNameOnly + "_";
- opt.get("-ep")->getString(inputIMFFileName);
+ }
+ else
+ outputFilePrefix = "eplus";
+
+ outputAuditFileName = outputFilePrefix + "out.audit";
+ outputBndFileName = outputFilePrefix + "out.bnd";
+ outputDxfFileName = outputFilePrefix + "out.dxf";
+ outputEioFileName = outputFilePrefix + "out.eio";
+ outputEndFileName = outputFilePrefix + "out.end";
+ outputErrFileName = outputFilePrefix + "out.err";
+ outputEsoFileName = outputFilePrefix + "out.eso";
+ outputMtdFileName = outputFilePrefix + "out.mtd";
+ outputMddFileName = outputFilePrefix + "out.mdd";
+ outputMtrFileName = outputFilePrefix + "out.mtr";
+ outputRddFileName = outputFilePrefix + "out.rdd";
+ outputShdFileName = outputFilePrefix + "out.shd";
+ outputTblCsvFileName = outputFilePrefix + "tbl.csv";
+ outputTblHtmFileName = outputFilePrefix + "tbl.htm";
+ outputTblTabFileName = outputFilePrefix + "tbl.tab";
+ outputTblTxtFileName = outputFilePrefix + "tbl.txt";
+ outputTblXmlFileName = outputFilePrefix + "tbl.xml";
+ outputAdsFileName = outputFilePrefix + "ADS.out";
+ outputDfsFileName = outputFilePrefix + "out.dfs";
+ outputDelightFileName = outputFilePrefix + "out.delightdfdmp";
+ outputMapTabFileName = outputFilePrefix + "map.tab";
+ outputMapCsvFileName = outputFilePrefix + "map.csv";
+ outputMapTxtFileName = outputFilePrefix + "map.txt";
+ outputEddFileName = outputFilePrefix + "out.edd";
+ outputIperrFileName = outputFilePrefix + "out.iperr";
+ outputSlnFileName = outputFilePrefix + "out.sln";
+ outputSciFileName = outputFilePrefix + "out.sci";
+ outputWrlFileName = outputFilePrefix + "out.wrl";
+ outputZszCsvFileName = outputFilePrefix + "zsz.csv";
+ outputZszTabFileName = outputFilePrefix + "zsz.tab";
+ outputZszTxtFileName = outputFilePrefix + "zsz.txt";
+ outputSszCsvFileName = outputFilePrefix + "ssz.csv";
+ outputSszTabFileName = outputFilePrefix + "ssz.tab";
+ outputSszTxtFileName = outputFilePrefix + "ssz.txt";
+ outputScreenCsvFileName = outputFilePrefix + "screen.csv";
+ outputDbgFileName = outputFilePrefix + ".dbg";
+ EnergyPlusIniFileName = "Energy+.ini";
+ inStatFileName = "in.stat";
+ TarcogIterationsFileName = "TarcogIterations.dbg";
+ eplusADSFileName = idfDirPathName+"eplusADS.inp";
+
+ // Handle bad options
+ std::vector badOptions;
+ if(!opt.gotExpected(badOptions)) {
+ for(int i=0; i < badOptions.size(); ++i) {
+ DisplayString("\nERROR: Unexpected number of arguments for option " + badOptions[i] + "\n");
+ DisplayString(usage);
+ ShowFatalError("\nERROR: Unexpected number of arguments for option " + badOptions[i] + "\n");
+ exit(EXIT_FAILURE);
+ }
+ }
- readVarsValue = false;
- if (opt.isSet("-r")){
- readVarsValue = true;
- }
+ if(!opt.gotRequired(badOptions)) {
+ for(int i=0; i < badOptions.size(); ++i) {
+ DisplayString("\nERROR: Missing required option " + badOptions[i] + "\n");
+ DisplayString(usage);
+ ShowFatalError("\nERROR: Missing required option " + badOptions[i] + "\n");
+ exit(EXIT_FAILURE);
+ }
+ }
- // Process standard arguments
- if (opt.isSet("-h")) {
+ if(opt.firstArgs.size() > 1 || opt.unknownArgs.size() > 0){
+ for(int i=1; i < opt.firstArgs.size(); ++i) {
+ std::string arg(opt.firstArgs[i]->c_str());
+ DisplayString("\nERROR: Invalid option first arg: " + arg + "\n");
+ DisplayString(usage);
+ ShowFatalError("\nERROR: Invalid option first arg: " + arg + "\n");
+ }
+ for(int i=0; i < opt.unknownArgs.size(); ++i) {
+ std::string arg(opt.unknownArgs[i]->c_str());
+ DisplayString("ERROR: Invalid option unknown arg: " + arg + "\n");
DisplayString(usage);
- exit(EXIT_SUCCESS);
- }
-
- if (opt.isSet("-v")) {
- DisplayString(VerString);
- exit(EXIT_SUCCESS);
- }
-
- if(opt.lastArgs.size() > 0 && opt.lastArgs.size() < 2){
- for(int i=0; i < opt.lastArgs.size(); ++i) {
- std::string arg(opt.lastArgs[i]->c_str());
- inputIdfFileName = arg;
-
- struct stat s;
- if( stat(arg.c_str(),&s) != 0 ) {
- char resolved_path[100];
- realpath(arg.c_str(), resolved_path);
- std::string idfPath = std::string(resolved_path);
- DisplayString("ERROR: "+ idfPath +" is not a valid path. \n" );
- exit(EXIT_FAILURE);
- }
- }
- }
-
- if(opt.lastArgs.size() > 1){
- for(int i=1; i < opt.lastArgs.size(); ++i) {
- std::string arg(opt.lastArgs[i]->c_str());
- DisplayString("ERROR: Invalid option last arg: " + arg + "\n");
- DisplayString(usage);
+ ShowFatalError("ERROR: Invalid option unknown arg: " + arg + "\n");
+ }
+ exit(EXIT_FAILURE);
+ }
+
+ /*if(expandObjValue) {
+ std::string runExpandObjects = "./ExpandObjects";
+ system(runExpandObjects.c_str());
+
+ std::string expandIdfFile = "expanded.idf";
+ bool expandIdfFileExist = fileExist(expandIdfFile);
+ if(expandIdfFileExist) {
+ std::string expidfFileName = outputFilePrefix + ".expidf";
+ std::ifstream src(expandIdfFile.c_str());
+ std::ofstream dst(expidfFileName.c_str());
+ dst << src.rdbuf();
+ remove(inputIdfFileName.c_str());
+ symlink(expidfFileName.c_str(), inputIdfFileName.c_str());
+ }
+ //else
+ // DisplayString("ExpandObjects file does not exist. \n");
+ }*/
+
+ if(EPMacroValue){
+ bool imfFileExist = fileExist(inputIMFFileName);
+ std::string defaultIMFFileName = "in.imf";
+
+ if(imfFileExist){
+ symlink(inputIMFFileName.c_str(), defaultIMFFileName.c_str());
+
+ std::string outIDFFileName = "out.idf";
+ remove(outIDFFileName.c_str());
+ std::string outAuditFileName = "audit.out";
+ remove(outAuditFileName.c_str());
+ std::string epmdetFileName = outputFilePrefix+".epmdet";
+ remove(epmdetFileName.c_str());
+ std::string epmidfFileName = outputFilePrefix+".epmidf";
+ remove(epmidfFileName.c_str());
+
+ std::string runEPMacro = "./EPMacro";
+
+ system(runEPMacro.c_str());
+ std::cout<<"Running EPMacro...\n";
+
+ bool AuditFileExist = fileExist(outAuditFileName);
+ if(AuditFileExist){
+ std::string epmdetFileName = outputFilePrefix + ".epmdet";
+ std::ifstream src(outAuditFileName.c_str());
+ std::ofstream dst(epmdetFileName.c_str());
+ dst << src.rdbuf();
}
- exit(EXIT_FAILURE);
- }
-
- if(inputIdfFileName.empty())
- inputIdfFileName = "in.idf";
-
- idfFileNameWextn = returnFileName(inputIdfFileName);
-
- idfFileNameOnly = idfFileNameWextn.substr(0,idfFileNameWextn.size()-4);
- idfDirPathName = returnDirPathName(inputIdfFileName);
-
- opt.get("-p")->getString(prefixOutName);
- prefixValue = false;
- if(opt.isSet("-p"))
- prefixValue = true;
-
- expandObjValue = false;
- if(opt.isSet("-e"))
- expandObjValue = true;
-
- EPMacroValue = false;
- if(opt.isSet("-ep"))
- EPMacroValue = true;
-
- if (opt.isSet("-d") ){
- struct stat sb = {0};
-
- if (stat(dirPathName.c_str(), &sb) == -1) {
- int mkdirretval;
- mkdirretval=mkpath(dirPathName,0755);
- }
-
- if(dirPathName[dirPathName.size()-1]!=pathChar){
- dirPathName+=pathChar;
- }
-
- if(prefixValue)
- outputFilePrefix = dirPathName + prefixOutName + "_";
- else
- outputFilePrefix = dirPathName + idfFileNameOnly + "_";
-
- }
- else
- outputFilePrefix = "eplus";
-
- outputAuditFileName = outputFilePrefix + "out.audit";
- outputBndFileName = outputFilePrefix + "out.bnd";
- outputDxfFileName = outputFilePrefix + "out.dxf";
- outputEioFileName = outputFilePrefix + "out.eio";
- outputEndFileName = outputFilePrefix + "out.end";
- outputErrFileName = outputFilePrefix + "out.err";
- outputEsoFileName = outputFilePrefix + "out.eso";
- outputMtdFileName = outputFilePrefix + "out.mtd";
- outputMddFileName = outputFilePrefix + "out.mdd";
- outputMtrFileName = outputFilePrefix + "out.mtr";
- outputRddFileName = outputFilePrefix + "out.rdd";
- outputShdFileName = outputFilePrefix + "out.shd";
- outputTblCsvFileName = outputFilePrefix + "tbl.csv";
- outputTblHtmFileName = outputFilePrefix + "tbl.htm";
- outputTblTabFileName = outputFilePrefix + "tbl.tab";
- outputTblTxtFileName = outputFilePrefix + "tbl.txt";
- outputTblXmlFileName = outputFilePrefix + "tbl.xml";
- outputAdsFileName = outputFilePrefix + "ADS.out";
- outputDfsFileName = outputFilePrefix + "out.dfs";
- outputDelightFileName = outputFilePrefix + "out.delightdfdmp";
- outputMapTabFileName = outputFilePrefix + "map.tab";
- outputMapCsvFileName = outputFilePrefix + "map.csv";
- outputMapTxtFileName = outputFilePrefix + "map.txt";
- outputEddFileName = outputFilePrefix + "out.edd";
- outputIperrFileName = outputFilePrefix + "out.iperr";
- outputSlnFileName = outputFilePrefix + "out.sln";
- outputSciFileName = outputFilePrefix + "out.sci";
- outputWrlFileName = outputFilePrefix + "out.wrl";
- outputZszCsvFileName = outputFilePrefix + "zsz.csv";
- outputZszTabFileName = outputFilePrefix + "zsz.tab";
- outputZszTxtFileName = outputFilePrefix + "zsz.txt";
- outputSszCsvFileName = outputFilePrefix + "ssz.csv";
- outputSszTabFileName = outputFilePrefix + "ssz.tab";
- outputSszTxtFileName = outputFilePrefix + "ssz.txt";
- outputScreenCsvFileName = outputFilePrefix + "screen.csv";
- outputDbgFileName = outputFilePrefix + ".dbg";
- EnergyPlusIniFileName = "Energy+.ini";
- inStatFileName = "in.stat";
- TarcogIterationsFileName = "TarcogIterations.dbg";
- eplusADSFileName = idfDirPathName+"eplusADS.inp";
-
- // Handle bad options
- std::vector badOptions;
- if(!opt.gotExpected(badOptions)) {
- for(int i=0; i < badOptions.size(); ++i) {
- DisplayString("\nERROR: Unexpected number of arguments for option " + badOptions[i] + "\n");
- DisplayString(usage);
- ShowFatalError("\nERROR: Unexpected number of arguments for option " + badOptions[i] + "\n");
- exit(EXIT_FAILURE);
- }
- }
-
- if(!opt.gotRequired(badOptions)) {
- for(int i=0; i < badOptions.size(); ++i) {
- DisplayString("\nERROR: Missing required option " + badOptions[i] + "\n");
- DisplayString(usage);
- ShowFatalError("\nERROR: Missing required option " + badOptions[i] + "\n");
- exit(EXIT_FAILURE);
- }
- }
-
- if(opt.firstArgs.size() > 1 || opt.unknownArgs.size() > 0){
- for(int i=1; i < opt.firstArgs.size(); ++i) {
- std::string arg(opt.firstArgs[i]->c_str());
- DisplayString("\nERROR: Invalid option first arg: " + arg + "\n");
- DisplayString(usage);
- ShowFatalError("\nERROR: Invalid option first arg: " + arg + "\n");
+
+ bool outFileExist = fileExist(outIDFFileName);
+ if(outFileExist){
+ std::string epmidfFileName = outputFilePrefix + ".epmidf";
+ std::ifstream src(outIDFFileName.c_str());
+ std::ofstream dst(epmidfFileName.c_str());
+ dst << src.rdbuf();
+ symlink(epmidfFileName.c_str(), inputIdfFileName.c_str());
+ DisplayString("Input file: " + inputIMFFileName + "\n");
}
- for(int i=0; i < opt.unknownArgs.size(); ++i) {
- std::string arg(opt.unknownArgs[i]->c_str());
- DisplayString("ERROR: Invalid option unknown arg: " + arg + "\n");
- DisplayString(usage);
- ShowFatalError("ERROR: Invalid option unknown arg: " + arg + "\n");
+ else{
+ ShowFatalError("EPMacro did not produce "+ outIDFFileName + "with "+ inputIMFFileName +"\n");
+ exit(EXIT_FAILURE);
}
- exit(EXIT_FAILURE);
}
-
- /* std::string ExpandObjects = "ExpandObjects";
- std::string runExpandObjects = "./"+ExpandObjects;
- if(expandObjValue) {
- system(runExpandObjects.c_str());
-
- std::string expandIdfFile = "expanded.idf";
- bool expandIdfFileExist = fileExist(expandIdfFile);
- if(expandIdfFileExist) {
- std::string expidfFileName = outputFilePrefix + ".expidf";
- std::ifstream src(expandIdfFile.c_str());
- std::ofstream dst(expidfFileName.c_str());
- dst << src.rdbuf();
- remove(idfFileNameOnly.c_str());
- link(expidfFileName.c_str(), idfFileNameOnly.c_str());
- }
- else
- std::cout<<"ExpandObjects file does not exist. \n";
- }
-
- bool imfFileExist = fileExist(inputIMFFileName);
- std::string defaultIMFFileName = "in.imf";
-
- if(imfFileExist)
- link(inputIMFFileName.c_str(), defaultIMFFileName.c_str());
-
- std::string outIDFFileName = "out.idf";
- remove(outIDFFileName.c_str());
- std::string outAuditFileName = "audit.out";
- remove(outAuditFileName.c_str());
- std::string epmdetFileName = outputFilePrefix+".epmdet";
- remove(epmdetFileName.c_str());
- std::string epmidfFileName = outputFilePrefix+".epmidf";
- remove(epmidfFileName.c_str());
-
- std::string EPMacroexe = "EPMacro";
- std::string runEPMacro = "./"+EPMacroexe;
- if(EPMacroValue){
- system(runEPMacro.c_str());
- std::cout<<"Running EPMacro...\n";
-
- bool AuditFileExist = fileExist(outAuditFileName);
- if(AuditFileExist){
- std::string epmdetFileName = outputFilePrefix + ".epmdet";
- std::ifstream src(outAuditFileName.c_str());
- std::ofstream dst(epmdetFileName.c_str());
- dst << src.rdbuf();
- }
-
- bool outFileExist = fileExist(outIDFFileName);
- if(outFileExist){
- std::string epmidfFileName = outputFilePrefix + ".epmidf";
- std::ifstream src(outIDFFileName.c_str());
- std::ofstream dst(epmidfFileName.c_str());
- dst << src.rdbuf();
- link(epmidfFileName.c_str(), idfFileNameOnly.c_str());
- DisplayString("Input file: " + inputIMFFileName + "\n");
- }
- else{
- ShowFatalError("EPMacro did not produce "+ outIDFFileName + "with "+ inputIMFFileName +"\n");
- exit(EXIT_FAILURE);
- }
- }*/
-
-
-
- return 0;
}
- } //namespace options
+ return 0;
+}
+} //CommandLineInterface namespace
} //EnergyPlus namespace
From 839e54238b949a8f836e135d19aa1d1fad6a5578 Mon Sep 17 00:00:00 2001
From: Monika Sharma
Date: Fri, 10 Oct 2014 16:18:49 -0600
Subject: [PATCH 27/71] ExpandObjects preprocessor implemented
---
src/EnergyPlus/CommandLineInterface.cc | 21 +++++++++------------
src/EnergyPlus/CommandLineInterface.hh | 1 +
src/EnergyPlus/main.cc | 1 +
3 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/src/EnergyPlus/CommandLineInterface.cc b/src/EnergyPlus/CommandLineInterface.cc
index 34c7be784e9..17a4a9339b3 100644
--- a/src/EnergyPlus/CommandLineInterface.cc
+++ b/src/EnergyPlus/CommandLineInterface.cc
@@ -86,10 +86,10 @@ std::string exePathName;
std::string prefixOutName;
std::string inputIMFFileName;
-bool readVarsValue;
-bool prefixValue;
-bool expandObjValue;
-bool EPMacroValue;
+bool readVarsValue(false);
+bool prefixValue(false);
+bool expandObjValue(false);
+bool EPMacroValue(false);
bool fileExist(const std::string& filename)
@@ -191,8 +191,6 @@ ProcessArgs(int argc, const char * argv[])
opt.add("", 0, 0, 0, "Display version information", "-v", "--version");
- // opt.add("in.idf", 0, 1, 0, "Input data file path (default in.idf)", "");
-
opt.add("in.epw", 0, 1, 0, "Weather file path (default in.epw)", "-w", "--weather");
opt.add("", 0, 0, 0, "Weather file path", "--weather ");
@@ -207,6 +205,8 @@ ProcessArgs(int argc, const char * argv[])
opt.add("", 0, 0, 0, "Run ExpandObjects", "-e", "--expandObj");
+ opt.add("", 0, 0, 0, "Force design-day-only simulation", "-dd", "--ddonly");
+
opt.add("", 0, 1, 0, "Run EPMacro", "-ep", "--epMacro");
opt.add("", 0, 1, 0, "Output directory (default current working directory)", "-d", "--dir");
@@ -245,7 +245,6 @@ ProcessArgs(int argc, const char * argv[])
opt.get("-ep")->getString(inputIMFFileName);
- readVarsValue = false;
if (opt.isSet("-r")){
readVarsValue = true;
}
@@ -295,15 +294,13 @@ ProcessArgs(int argc, const char * argv[])
idfDirPathName = returnDirPathName(inputIdfFileName);
opt.get("-p")->getString(prefixOutName);
- prefixValue = false;
+
if(opt.isSet("-p"))
prefixValue = true;
- expandObjValue = false;
if(opt.isSet("-e"))
expandObjValue = true;
- EPMacroValue = false;
if(opt.isSet("-ep"))
EPMacroValue = true;
@@ -405,7 +402,7 @@ ProcessArgs(int argc, const char * argv[])
exit(EXIT_FAILURE);
}
- /*if(expandObjValue) {
+ if(expandObjValue) {
std::string runExpandObjects = "./ExpandObjects";
system(runExpandObjects.c_str());
@@ -421,7 +418,7 @@ ProcessArgs(int argc, const char * argv[])
}
//else
// DisplayString("ExpandObjects file does not exist. \n");
- }*/
+ }
if(EPMacroValue){
bool imfFileExist = fileExist(inputIMFFileName);
diff --git a/src/EnergyPlus/CommandLineInterface.hh b/src/EnergyPlus/CommandLineInterface.hh
index 939e91522c1..341eec3948a 100644
--- a/src/EnergyPlus/CommandLineInterface.hh
+++ b/src/EnergyPlus/CommandLineInterface.hh
@@ -61,6 +61,7 @@ namespace CommandLineInterface {
extern bool prefixValue;
extern bool expandObjValue;
extern bool EPMacroValue;
+ extern bool DDOnlySimulation;
// Process command line arguments
int
diff --git a/src/EnergyPlus/main.cc b/src/EnergyPlus/main.cc
index f488855b11c..622161df54e 100644
--- a/src/EnergyPlus/main.cc
+++ b/src/EnergyPlus/main.cc
@@ -259,6 +259,7 @@ main(int argc, const char * argv[])
#endif
CreateCurrentDateTimeString( CurrentDateTime );
VerString += "," + CurrentDateTime;
+
get_environment_variable( DDOnlyEnvVar, cEnvValue );
DDOnly = env_var_on( cEnvValue ); // Yes or True
From 832a2fa22ce8a927e61952e0da939e8d284f7094 Mon Sep 17 00:00:00 2001
From: Monika Sharma
Date: Fri, 10 Oct 2014 17:17:25 -0600
Subject: [PATCH 28/71] design-day-only & annual-only simulation implemented
---
src/EnergyPlus/CommandLineInterface.cc | 27 +++++++++++++++++++++++---
src/EnergyPlus/CommandLineInterface.hh | 1 +
src/EnergyPlus/main.cc | 4 ++++
3 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/src/EnergyPlus/CommandLineInterface.cc b/src/EnergyPlus/CommandLineInterface.cc
index 17a4a9339b3..cdbb78f72f9 100644
--- a/src/EnergyPlus/CommandLineInterface.cc
+++ b/src/EnergyPlus/CommandLineInterface.cc
@@ -15,6 +15,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -29,6 +30,7 @@ namespace EnergyPlus{
namespace CommandLineInterface{
using namespace DataStringGlobals;
+using namespace DataSystemVariables;
using namespace InputProcessor;
using namespace SimulationManager;
using namespace OutputReportTabular;
@@ -90,7 +92,8 @@ bool readVarsValue(false);
bool prefixValue(false);
bool expandObjValue(false);
bool EPMacroValue(false);
-
+bool DDOnlySimulation(false);
+bool AnnualSimulation(false);
bool fileExist(const std::string& filename)
{
@@ -164,6 +167,8 @@ ProcessArgs(int argc, const char * argv[])
std::ifstream inputW, inputIDD;
std::istream* instreamW;
std::istream* instreamIDD;
+ bool annSimulation;
+ bool ddSimulation;
for ( int i = 1; i < argc; ++i ) {
std::string inputArg( argv[ i ] );
@@ -178,6 +183,12 @@ ProcessArgs(int argc, const char * argv[])
argv[i] = iddLongOption.c_str();
inputIddFileName = returnFileExtension(inputArg);
}
+
+ if(inputArg == "-a")
+ annSimulation = true;
+
+ if(inputArg == "-dd")
+ ddSimulation = true;
}
ezOptionParser opt;
@@ -205,7 +216,9 @@ ProcessArgs(int argc, const char * argv[])
opt.add("", 0, 0, 0, "Run ExpandObjects", "-e", "--expandObj");
- opt.add("", 0, 0, 0, "Force design-day-only simulation", "-dd", "--ddonly");
+ opt.add("", 0, 0, 0, "Force design-day-only simulation", "-dd", "--designday");
+
+ opt.add("", 0, 0, 0, "Force design-day-only simulation", "-a", "--annual");
opt.add("", 0, 1, 0, "Run EPMacro", "-ep", "--epMacro");
@@ -245,8 +258,16 @@ ProcessArgs(int argc, const char * argv[])
opt.get("-ep")->getString(inputIMFFileName);
- if (opt.isSet("-r")){
+ if (opt.isSet("-r"))
readVarsValue = true;
+
+
+ if (opt.isSet("-dd"))
+ DDOnlySimulation = true;
+
+ if(!(annSimulation && ddSimulation)){
+ if (opt.isSet("-a"))
+ AnnualSimulation = true;
}
// Process standard arguments
diff --git a/src/EnergyPlus/CommandLineInterface.hh b/src/EnergyPlus/CommandLineInterface.hh
index 341eec3948a..c33f35a5af6 100644
--- a/src/EnergyPlus/CommandLineInterface.hh
+++ b/src/EnergyPlus/CommandLineInterface.hh
@@ -62,6 +62,7 @@ namespace CommandLineInterface {
extern bool expandObjValue;
extern bool EPMacroValue;
extern bool DDOnlySimulation;
+ extern bool AnnualSimulation;
// Process command line arguments
int
diff --git a/src/EnergyPlus/main.cc b/src/EnergyPlus/main.cc
index 622161df54e..fb70b9471de 100644
--- a/src/EnergyPlus/main.cc
+++ b/src/EnergyPlus/main.cc
@@ -262,12 +262,16 @@ main(int argc, const char * argv[])
get_environment_variable( DDOnlyEnvVar, cEnvValue );
DDOnly = env_var_on( cEnvValue ); // Yes or True
+ if(DDOnlySimulation)
+ DDOnly = true;
get_environment_variable( ReverseDDEnvVar, cEnvValue );
ReverseDD = env_var_on( cEnvValue ); // Yes or True
get_environment_variable( FullAnnualSimulation, cEnvValue );
FullAnnualRun = env_var_on( cEnvValue ); // Yes or True
+ if(AnnualSimulation)
+ FullAnnualRun = true;
get_environment_variable( cDisplayAllWarnings, cEnvValue );
DisplayAllWarnings = env_var_on( cEnvValue ); // Yes or True
From e771111d3fc0f971428ae9d68a6051d9b83ab4c5 Mon Sep 17 00:00:00 2001
From: nealkruis
Date: Mon, 13 Oct 2014 14:20:27 -0600
Subject: [PATCH 29/71] Clean up CLI.
---
src/EnergyPlus/CommandLineInterface.cc | 180 ++++++++++++-------------
src/EnergyPlus/CommandLineInterface.hh | 5 +
src/EnergyPlus/InputProcessor.cc | 4 +-
src/EnergyPlus/main.cc | 50 +++----
4 files changed, 119 insertions(+), 120 deletions(-)
diff --git a/src/EnergyPlus/CommandLineInterface.cc b/src/EnergyPlus/CommandLineInterface.cc
index cdbb78f72f9..be9d043a826 100644
--- a/src/EnergyPlus/CommandLineInterface.cc
+++ b/src/EnergyPlus/CommandLineInterface.cc
@@ -81,6 +81,10 @@ std::string EnergyPlusIniFileName;
std::string inStatFileName;
std::string TarcogIterationsFileName;
std::string eplusADSFileName;
+std::string outputCsvFileName;
+std::string outputMtrCsvFileName;
+std::string outputRvauditFileName;
+
std::string outputFilePrefix;
std::string dirPathName;
std::string idfFileNameOnly;
@@ -94,6 +98,7 @@ bool expandObjValue(false);
bool EPMacroValue(false);
bool DDOnlySimulation(false);
bool AnnualSimulation(false);
+bool iddArgSet(false);
bool fileExist(const std::string& filename)
{
@@ -118,19 +123,17 @@ returnDirPathName( std::string const& filename )
: std::string( filename.begin(), pivot.base() - 1 );
}
+// Not currently used
std::string
returnFileExtension(const std::string& filename){
- std::string ext = "";
+ int extensionPosition = filename.find_last_of(".");
+ return filename.substr(extensionPosition + 1, filename.size() - 1);
+}
- for(int i=0; i arguments;
+ int wildCardPosition = 2;
+
+ for ( int i = 0; i < argc; ++i ) {
+
std::string inputArg( argv[ i ] );
- if(inputArg.substr(0,10) == "--weather="){
- std::string weatherLongOption = EqualsToSpace(inputArg.substr(0,10));
- argv[i] = weatherLongOption.c_str();
- inputWeatherFileName = returnFileExtension(inputArg);
- }
- if(inputArg.substr(0,6) == "--idd="){
- std::string iddLongOption = EqualsToSpace(inputArg.substr(0,6));
- argv[i] = iddLongOption.c_str();
- inputIddFileName = returnFileExtension(inputArg);
- }
+ int beginningPosition = inputArg.find("--");
+ int endingPosition = inputArg.find("=");
- if(inputArg == "-a")
- annSimulation = true;
+ if (beginningPosition == 0 && endingPosition != std::string::npos){
+ arguments.push_back(inputArg.substr(0,endingPosition));
+ arguments.push_back(inputArg.substr(endingPosition + 1,inputArg.size() - 1));
+ }
+ else
+ arguments.push_back(inputArg);
+ }
- if(inputArg == "-dd")
- ddSimulation = true;
+ // convert to vector of C strings for option parser
+ std::vector cStrArgs;
+ cStrArgs.reserve(arguments.size());
+ for (int i = 0; i < arguments.size(); ++i) {
+ cStrArgs.push_back(arguments[i].c_str());
}
ezOptionParser opt;
opt.overview = VerString;
- opt.example = "energyplus -i custom.idd -w weather.epw -d output/ -p prefix -r input.idf";
+ opt.example = "energyplus -i custom.idd -w weather.epw -d output/ -p prefix -r input.idf\n";
opt.syntax = "energyplus [options] [input file]";
@@ -204,28 +209,24 @@ ProcessArgs(int argc, const char * argv[])
opt.add("in.epw", 0, 1, 0, "Weather file path (default in.epw)", "-w", "--weather");
- opt.add("", 0, 0, 0, "Weather file path", "--weather ");
-
opt.add("Energy+.idd", 0, 1, 0, "Input data dictionary path (default Energy+.idd in executable directory)", "-i", "--idd");
- opt.add("", 0, 0, 0, "Input data dictionary path", "--idd ");
-
opt.add("", 0, 1, 0, "Prefix for output files (default same as input file name)", "-p", "--prefix");
opt.add("", 0, 0, 0, "Run ReadVarsESO to generate time-series CSV", "-r", "--readvars");
- opt.add("", 0, 0, 0, "Run ExpandObjects", "-e", "--expandObj");
+ opt.add("", 0, 0, 0, "Run ExpandObjects", "-x", "--expand");
- opt.add("", 0, 0, 0, "Force design-day-only simulation", "-dd", "--designday");
+ opt.add("", 0, 0, 0, "Force design-day-only simulation", "-D", "--designday");
opt.add("", 0, 0, 0, "Force design-day-only simulation", "-a", "--annual");
- opt.add("", 0, 1, 0, "Run EPMacro", "-ep", "--epMacro");
+ opt.add("", 0, 1, 0, "Run EPMacro", "-m", "--epmacro");
opt.add("", 0, 1, 0, "Output directory (default current working directory)", "-d", "--dir");
// Parse arguments
- opt.parse(argc, argv);
+ opt.parse(cStrArgs.size(), &cStrArgs[0]);
// print arguments parsed (useful for debugging)
//std::string pretty;
@@ -239,36 +240,27 @@ ProcessArgs(int argc, const char * argv[])
//To check the path of EnergyPlus
char executable_path[100];
realpath(argv[0], executable_path);
- std::string exePath = std::string(executable_path);
- exePathName = returnDirPathName(exePath);
+ exePathName = returnDirPathName(std::string(executable_path)) + pathChar;
- if(inputWeatherFileName.empty())
- inputWeatherFileName = "in.epw";
+ opt.get("-w")->getString(inputWeatherFileName);
- instreamW = &inputW;
- inputW.open( inputWeatherFileName.c_str() );
+ opt.get("-i")->getString(inputIddFileName);
- if(inputIddFileName.empty())
- inputIddFileName = "Energy+.idd";
-
- instreamIDD = &inputIDD;
- inputIDD.open( inputIddFileName.c_str() );
+ if (opt.isSet("-i"))
+ iddArgSet = true;
+ else
+ inputIddFileName = exePathName + inputIddFileName;
opt.get("-d")->getString(dirPathName);
- opt.get("-ep")->getString(inputIMFFileName);
+ opt.get("-m")->getString(inputIMFFileName);
if (opt.isSet("-r"))
readVarsValue = true;
+ DDOnlySimulation = opt.isSet("-D");
- if (opt.isSet("-dd"))
- DDOnlySimulation = true;
-
- if(!(annSimulation && ddSimulation)){
- if (opt.isSet("-a"))
- AnnualSimulation = true;
- }
+ AnnualSimulation = opt.isSet("-a") && !DDOnlySimulation;
// Process standard arguments
if (opt.isSet("-h")) {
@@ -281,7 +273,7 @@ ProcessArgs(int argc, const char * argv[])
exit(EXIT_SUCCESS);
}
- if(opt.lastArgs.size() > 0 && opt.lastArgs.size() < 2){
+ if(opt.lastArgs.size() == 1){
for(int i=0; i < opt.lastArgs.size(); ++i) {
std::string arg(opt.lastArgs[i]->c_str());
inputIdfFileName = arg;
@@ -291,18 +283,19 @@ ProcessArgs(int argc, const char * argv[])
char resolved_path[100];
realpath(arg.c_str(), resolved_path);
std::string idfPath = std::string(resolved_path);
- DisplayString("ERROR: "+ idfPath +" is not a valid path. \n" );
+ DisplayString("ERROR: "+ idfPath +" is not a valid path.\n" );
exit(EXIT_FAILURE);
}
}
}
if(opt.lastArgs.size() > 1){
- for(int i=1; i < opt.lastArgs.size(); ++i) {
+ DisplayString("ERROR: Multiple input files specified:");
+ for(int i=0; i < opt.lastArgs.size(); ++i) {
std::string arg(opt.lastArgs[i]->c_str());
- DisplayString("ERROR: Invalid option last arg: " + arg + "\n");
- DisplayString(usage);
+ DisplayString(" Input file #" + std::to_string(i+1) + ": " + arg);
}
+ DisplayString(usage);
exit(EXIT_FAILURE);
}
@@ -311,7 +304,7 @@ ProcessArgs(int argc, const char * argv[])
idfFileNameWextn = returnFileName(inputIdfFileName);
- idfFileNameOnly = idfFileNameWextn.substr(0,idfFileNameWextn.size()-4);
+ idfFileNameOnly = removeFileExtension(idfFileNameWextn);
idfDirPathName = returnDirPathName(inputIdfFileName);
opt.get("-p")->getString(prefixOutName);
@@ -319,10 +312,10 @@ ProcessArgs(int argc, const char * argv[])
if(opt.isSet("-p"))
prefixValue = true;
- if(opt.isSet("-e"))
+ if(opt.isSet("-x"))
expandObjValue = true;
- if(opt.isSet("-ep"))
+ if(opt.isSet("-m"))
EPMacroValue = true;
if (opt.isSet("-d") ){
@@ -336,16 +329,16 @@ ProcessArgs(int argc, const char * argv[])
if(dirPathName[dirPathName.size()-1]!=pathChar){
dirPathName+=pathChar;
}
-
- if(prefixValue)
- outputFilePrefix = dirPathName + prefixOutName + "_";
- else
- outputFilePrefix = dirPathName + idfFileNameOnly + "_";
-
}
+
+ if(prefixValue)
+ outputFilePrefix = dirPathName + prefixOutName + "-";
+ else if (argc > 1)
+ outputFilePrefix = dirPathName + idfFileNameOnly + "-";
else
- outputFilePrefix = "eplus";
+ outputFilePrefix = dirPathName + "eplus";
+ // EnergyPlus files
outputAuditFileName = outputFilePrefix + "out.audit";
outputBndFileName = outputFilePrefix + "out.bnd";
outputDxfFileName = outputFilePrefix + "out.dxf";
@@ -387,6 +380,11 @@ ProcessArgs(int argc, const char * argv[])
TarcogIterationsFileName = "TarcogIterations.dbg";
eplusADSFileName = idfDirPathName+"eplusADS.inp";
+ // Readvars files
+ outputCsvFileName = outputFilePrefix + "out.csv";
+ outputMtrCsvFileName = outputFilePrefix + "mtr.csv";
+ outputRvauditFileName = outputFilePrefix + "out.rvaudit";
+
// Handle bad options
std::vector badOptions;
if(!opt.gotExpected(badOptions)) {
@@ -410,37 +408,19 @@ ProcessArgs(int argc, const char * argv[])
if(opt.firstArgs.size() > 1 || opt.unknownArgs.size() > 0){
for(int i=1; i < opt.firstArgs.size(); ++i) {
std::string arg(opt.firstArgs[i]->c_str());
- DisplayString("\nERROR: Invalid option first arg: " + arg + "\n");
+ DisplayString("\nERROR: Invalid option: " + arg + "\n");
DisplayString(usage);
- ShowFatalError("\nERROR: Invalid option first arg: " + arg + "\n");
+ ShowFatalError("\nERROR: Invalid option: " + arg + "\n");
}
for(int i=0; i < opt.unknownArgs.size(); ++i) {
std::string arg(opt.unknownArgs[i]->c_str());
- DisplayString("ERROR: Invalid option unknown arg: " + arg + "\n");
+ DisplayString("ERROR: Invalid option: " + arg + "\n");
DisplayString(usage);
- ShowFatalError("ERROR: Invalid option unknown arg: " + arg + "\n");
+ ShowFatalError("ERROR: Invalid option: " + arg + "\n");
}
exit(EXIT_FAILURE);
}
- if(expandObjValue) {
- std::string runExpandObjects = "./ExpandObjects";
- system(runExpandObjects.c_str());
-
- std::string expandIdfFile = "expanded.idf";
- bool expandIdfFileExist = fileExist(expandIdfFile);
- if(expandIdfFileExist) {
- std::string expidfFileName = outputFilePrefix + ".expidf";
- std::ifstream src(expandIdfFile.c_str());
- std::ofstream dst(expidfFileName.c_str());
- dst << src.rdbuf();
- remove(inputIdfFileName.c_str());
- symlink(expidfFileName.c_str(), inputIdfFileName.c_str());
- }
- //else
- // DisplayString("ExpandObjects file does not exist. \n");
- }
-
if(EPMacroValue){
bool imfFileExist = fileExist(inputIMFFileName);
std::string defaultIMFFileName = "in.imf";
@@ -457,7 +437,7 @@ ProcessArgs(int argc, const char * argv[])
std::string epmidfFileName = outputFilePrefix+".epmidf";
remove(epmidfFileName.c_str());
- std::string runEPMacro = "./EPMacro";
+ std::string runEPMacro = exePathName + "EPMacro";
system(runEPMacro.c_str());
std::cout<<"Running EPMacro...\n";
@@ -485,6 +465,18 @@ ProcessArgs(int argc, const char * argv[])
}
}
}
+
+ if(expandObjValue) {
+ std::string runExpandObjects = exePathName + "ExpandObjects";
+ symlink(inputIdfFileName.c_str(), "in.idf");
+ system(runExpandObjects.c_str());
+ remove("in.idf");
+ remove("expandedidf.err");
+ std::string outputExpidfFileName = outputFilePrefix + "out.expidf";
+ rename("expanded.idf", outputExpidfFileName.c_str());
+ inputIdfFileName = outputExpidfFileName;
+ }
+
return 0;
}
} //CommandLineInterface namespace
diff --git a/src/EnergyPlus/CommandLineInterface.hh b/src/EnergyPlus/CommandLineInterface.hh
index c33f35a5af6..3f80741457e 100644
--- a/src/EnergyPlus/CommandLineInterface.hh
+++ b/src/EnergyPlus/CommandLineInterface.hh
@@ -49,6 +49,10 @@ namespace CommandLineInterface {
extern std::string inStatFileName;
extern std::string TarcogIterationsFileName;
extern std::string eplusADSFileName;
+ extern std::string outputCsvFileName;
+ extern std::string outputMtrCsvFileName;
+ extern std::string outputRvauditFileName;
+
extern std::string weatherFileNameOnly;
extern std::string idfFileNameOnly;
extern std::string outputFilePrefix;
@@ -63,6 +67,7 @@ namespace CommandLineInterface {
extern bool EPMacroValue;
extern bool DDOnlySimulation;
extern bool AnnualSimulation;
+ extern bool iddArgSet;
// Process command line arguments
int
diff --git a/src/EnergyPlus/InputProcessor.cc b/src/EnergyPlus/InputProcessor.cc
index 29070a063b8..4768bff43d4 100644
--- a/src/EnergyPlus/InputProcessor.cc
+++ b/src/EnergyPlus/InputProcessor.cc
@@ -254,10 +254,10 @@ namespace InputProcessor {
}
// FullName from StringGlobals is used to build file name with Path
- if ( len( ProgramPath ) == 0 ) {
+ if ( len( ProgramPath ) == 0 || iddArgSet) {
FullName = inputIddFileName;
} else {
- FullName = ProgramPath + inputIddFileName;
+ FullName = ProgramPath + "Energy+.idd";
}
{ IOFlags flags; gio::inquire( FullName, flags ); FileExists = flags.exists(); }
if ( ! FileExists ) {
diff --git a/src/EnergyPlus/main.cc b/src/EnergyPlus/main.cc
index fb70b9471de..1019d3cda98 100644
--- a/src/EnergyPlus/main.cc
+++ b/src/EnergyPlus/main.cc
@@ -222,8 +222,6 @@ main(int argc, const char * argv[])
// CLI module
using namespace CommandLineInterface;
- ProcessArgs(argc, argv);
-
// Enable floating point exceptions
#ifndef NDEBUG
#ifdef __unix__
@@ -257,6 +255,10 @@ main(int argc, const char * argv[])
#ifdef EP_Detailed_Timings
epStartTime( "EntireRun=" );
#endif
+
+ // Process command line arguments
+ ProcessArgs(argc, argv);
+
CreateCurrentDateTimeString( CurrentDateTime );
VerString += "," + CurrentDateTime;
@@ -371,7 +373,7 @@ main(int argc, const char * argv[])
gio::close( LFN );
} else {
DisplayString( "Missing " + EnergyPlusIniFileName );
- ProgramPath = exePathName + pathChar;
+ ProgramPath = "";
LFN = GetNewUnitNumber();
{ IOFlags flags; flags.ACTION( "write" ); gio::open( LFN, EnergyPlusIniFileName, flags ); iostatus = flags.ios(); }
if ( iostatus != 0 ) {
@@ -416,33 +418,33 @@ main(int argc, const char * argv[])
ReportOrphanFluids();
ReportOrphanSchedules();
- std::ofstream ifile;
- std::ofstream nfile;
-
- std::string esoFileName = outputFilePrefix + "out.eso";
- std::string csvFileName = outputFilePrefix + "out.csv";
- std::string RVIfile = idfFileNameOnly + ".rvi";
- ifile.open(RVIfile.c_str());
- ifile <
Date: Tue, 14 Oct 2014 16:35:07 -0600
Subject: [PATCH 30/71] Finish clean up of CLI.
---
src/EnergyPlus/CommandLineInterface.cc | 145 ++++++++++---------------
src/EnergyPlus/CommandLineInterface.hh | 9 +-
src/EnergyPlus/main.cc | 4 +-
3 files changed, 60 insertions(+), 98 deletions(-)
diff --git a/src/EnergyPlus/CommandLineInterface.cc b/src/EnergyPlus/CommandLineInterface.cc
index be9d043a826..64c223d7901 100644
--- a/src/EnergyPlus/CommandLineInterface.cc
+++ b/src/EnergyPlus/CommandLineInterface.cc
@@ -7,6 +7,7 @@
#include
#include
#include
+#include
// CLI Headers
#include
@@ -85,17 +86,10 @@ std::string outputCsvFileName;
std::string outputMtrCsvFileName;
std::string outputRvauditFileName;
-std::string outputFilePrefix;
-std::string dirPathName;
std::string idfFileNameOnly;
std::string exePathName;
-std::string prefixOutName;
-std::string inputIMFFileName;
-bool readVarsValue(false);
-bool prefixValue(false);
-bool expandObjValue(false);
-bool EPMacroValue(false);
+bool runReadVars(false);
bool DDOnlySimulation(false);
bool AnnualSimulation(false);
bool iddArgSet(false);
@@ -107,20 +101,17 @@ bool fileExist(const std::string& filename)
}
std::string
-returnFileName( std::string const& filename )
+returnFileName( std::string const& filepath )
{
- return {std::find_if(filename.rbegin(), filename.rend(),
- [](char c) { return c == pathChar; }).base(),
- filename.end()};
+ int pathCharPosition = filepath.find_last_of(pathChar);
+ return filepath.substr(pathCharPosition + 1, filepath.size() - 1);
}
std::string
-returnDirPathName( std::string const& filename )
+returnDirPath( std::string const& filepath )
{
- std::string::const_reverse_iterator pivot = std::find( filename.rbegin(), filename.rend(), pathChar );
- return pivot == filename.rend()
- ? filename
- : std::string( filename.begin(), pivot.base() - 1 );
+ int pathCharPosition = filepath.find_last_of(pathChar);
+ return filepath.substr(0, pathCharPosition + 1);
}
// Not currently used
@@ -170,7 +161,7 @@ ProcessArgs(int argc, const char * argv[])
bool annSimulation;
bool ddSimulation;
- // Expand longname options using "=" sign into two arguments
+ // Expand long-name options using "=" sign into two arguments
std::vector arguments;
int wildCardPosition = 2;
@@ -219,9 +210,9 @@ ProcessArgs(int argc, const char * argv[])
opt.add("", 0, 0, 0, "Force design-day-only simulation", "-D", "--designday");
- opt.add("", 0, 0, 0, "Force design-day-only simulation", "-a", "--annual");
+ opt.add("", 0, 0, 0, "Force annual simulation", "-a", "--annual");
- opt.add("", 0, 1, 0, "Run EPMacro", "-m", "--epmacro");
+ opt.add("", 0, 0, 0, "Run EPMacro", "-m", "--epmacro");
opt.add("", 0, 1, 0, "Output directory (default current working directory)", "-d", "--dir");
@@ -233,14 +224,16 @@ ProcessArgs(int argc, const char * argv[])
//opt.prettyPrint(pretty);
//std::cout << pretty << std::endl;
- std::string usage, idfFileNameWextn, idfDirPathName;
- std::string weatherFileNameWextn, weatherDirPathName;
+ std::string usage, idfDirPathName;
opt.getUsage(usage);
//To check the path of EnergyPlus
- char executable_path[100];
- realpath(argv[0], executable_path);
- exePathName = returnDirPathName(std::string(executable_path)) + pathChar;
+ char executableAbsolutePath[1024];
+ char executableRelativePath[1024];
+ uint32_t pathSize = sizeof(executableRelativePath);
+ _NSGetExecutablePath(executableRelativePath, &pathSize);
+ realpath(executableRelativePath, executableAbsolutePath);
+ exePathName = returnDirPath(std::string(executableAbsolutePath));
opt.get("-w")->getString(inputWeatherFileName);
@@ -251,16 +244,15 @@ ProcessArgs(int argc, const char * argv[])
else
inputIddFileName = exePathName + inputIddFileName;
- opt.get("-d")->getString(dirPathName);
+ std::string dirPathName;
- opt.get("-m")->getString(inputIMFFileName);
+ opt.get("-d")->getString(dirPathName);
- if (opt.isSet("-r"))
- readVarsValue = true;
+ runReadVars = opt.isSet("-r");
DDOnlySimulation = opt.isSet("-D");
- AnnualSimulation = opt.isSet("-a") && !DDOnlySimulation;
+ AnnualSimulation = opt.isSet("-a");
// Process standard arguments
if (opt.isSet("-h")) {
@@ -302,21 +294,15 @@ ProcessArgs(int argc, const char * argv[])
if(inputIdfFileName.empty())
inputIdfFileName = "in.idf";
- idfFileNameWextn = returnFileName(inputIdfFileName);
-
- idfFileNameOnly = removeFileExtension(idfFileNameWextn);
- idfDirPathName = returnDirPathName(inputIdfFileName);
+ idfFileNameOnly = removeFileExtension(returnFileName(inputIdfFileName));
+ idfDirPathName = returnDirPath(inputIdfFileName);
- opt.get("-p")->getString(prefixOutName);
+ bool runExpandObjects(false);
+ bool runEPMacro(false);
- if(opt.isSet("-p"))
- prefixValue = true;
+ runExpandObjects = opt.isSet("-x");
- if(opt.isSet("-x"))
- expandObjValue = true;
-
- if(opt.isSet("-m"))
- EPMacroValue = true;
+ runEPMacro = opt.isSet("-m");
if (opt.isSet("-d") ){
struct stat sb = {0};
@@ -331,8 +317,12 @@ ProcessArgs(int argc, const char * argv[])
}
}
- if(prefixValue)
+ std::string outputFilePrefix;
+ if(opt.isSet("-p")) {
+ std::string prefixOutName;
+ opt.get("-p")->getString(prefixOutName);
outputFilePrefix = dirPathName + prefixOutName + "-";
+ }
else if (argc > 1)
outputFilePrefix = dirPathName + idfFileNameOnly + "-";
else
@@ -421,56 +411,35 @@ ProcessArgs(int argc, const char * argv[])
exit(EXIT_FAILURE);
}
- if(EPMacroValue){
- bool imfFileExist = fileExist(inputIMFFileName);
- std::string defaultIMFFileName = "in.imf";
-
- if(imfFileExist){
- symlink(inputIMFFileName.c_str(), defaultIMFFileName.c_str());
-
- std::string outIDFFileName = "out.idf";
- remove(outIDFFileName.c_str());
- std::string outAuditFileName = "audit.out";
- remove(outAuditFileName.c_str());
- std::string epmdetFileName = outputFilePrefix+".epmdet";
- remove(epmdetFileName.c_str());
- std::string epmidfFileName = outputFilePrefix+".epmidf";
- remove(epmidfFileName.c_str());
-
- std::string runEPMacro = exePathName + "EPMacro";
-
- system(runEPMacro.c_str());
- std::cout<<"Running EPMacro...\n";
-
- bool AuditFileExist = fileExist(outAuditFileName);
- if(AuditFileExist){
- std::string epmdetFileName = outputFilePrefix + ".epmdet";
- std::ifstream src(outAuditFileName.c_str());
- std::ofstream dst(epmdetFileName.c_str());
- dst << src.rdbuf();
- }
+ // Error for cases where both design-day and annual simulation switches are set
+ if (DDOnlySimulation && AnnualSimulation) {
+ ShowFatalError("ERROR: Cannot force both design-day and annual simulations. Set either '-D' or '-a', but not both.\n");
+ }
- bool outFileExist = fileExist(outIDFFileName);
- if(outFileExist){
- std::string epmidfFileName = outputFilePrefix + ".epmidf";
- std::ifstream src(outIDFFileName.c_str());
- std::ofstream dst(epmidfFileName.c_str());
- dst << src.rdbuf();
- symlink(epmidfFileName.c_str(), inputIdfFileName.c_str());
- DisplayString("Input file: " + inputIMFFileName + "\n");
- }
- else{
- ShowFatalError("EPMacro did not produce "+ outIDFFileName + "with "+ inputIMFFileName +"\n");
- exit(EXIT_FAILURE);
- }
- }
+ bool inputFileNamedIn = (idfFileNameOnly == "in");
+
+ if(runEPMacro){
+ if (!inputFileNamedIn)
+ symlink(inputIdfFileName.c_str(), "in.imf");
+ std::string runEPMacro = exePathName + "EPMacro";
+ DisplayString("Running EPMacro...");
+ system(runEPMacro.c_str());
+ if (!inputFileNamedIn)
+ remove("in.imf");
+ std::string outputEpmdetFileName = outputFilePrefix + "out.epmdet";
+ rename("audit.out",outputEpmdetFileName.c_str());
+ std::string outputEpmidfFileName = outputFilePrefix + "out.epmidf";
+ rename("out.idf",outputEpmidfFileName.c_str());
+ inputIdfFileName = outputEpmidfFileName;
}
- if(expandObjValue) {
+ if(runExpandObjects) {
std::string runExpandObjects = exePathName + "ExpandObjects";
- symlink(inputIdfFileName.c_str(), "in.idf");
+ if (!inputFileNamedIn)
+ symlink(inputIdfFileName.c_str(), "in.idf");
system(runExpandObjects.c_str());
- remove("in.idf");
+ if (!inputFileNamedIn)
+ remove("in.idf");
remove("expandedidf.err");
std::string outputExpidfFileName = outputFilePrefix + "out.expidf";
rename("expanded.idf", outputExpidfFileName.c_str());
diff --git a/src/EnergyPlus/CommandLineInterface.hh b/src/EnergyPlus/CommandLineInterface.hh
index 3f80741457e..58bf147d613 100644
--- a/src/EnergyPlus/CommandLineInterface.hh
+++ b/src/EnergyPlus/CommandLineInterface.hh
@@ -55,16 +55,9 @@ namespace CommandLineInterface {
extern std::string weatherFileNameOnly;
extern std::string idfFileNameOnly;
- extern std::string outputFilePrefix;
- extern std::string dirPathName;
extern std::string exePathName;
- extern std::string prefixOutName;
- extern std::string inputIMFFileName;
- extern bool readVarsValue;
- extern bool prefixValue;
- extern bool expandObjValue;
- extern bool EPMacroValue;
+ extern bool runReadVars;
extern bool DDOnlySimulation;
extern bool AnnualSimulation;
extern bool iddArgSet;
diff --git a/src/EnergyPlus/main.cc b/src/EnergyPlus/main.cc
index 1019d3cda98..9dca79cf4ff 100644
--- a/src/EnergyPlus/main.cc
+++ b/src/EnergyPlus/main.cc
@@ -418,7 +418,7 @@ main(int argc, const char * argv[])
ReportOrphanFluids();
ReportOrphanSchedules();
- if(readVarsValue) {
+ if(runReadVars) {
std::ofstream ifile;
std::ofstream nfile;
@@ -445,7 +445,7 @@ main(int argc, const char * argv[])
remove(MVIfile.c_str());
rename("readvars.audit", outputRvauditFileName.c_str());
- }
+ }
EndEnergyPlus();
From d0f7906807c1f0976d6fbb1844bb495c7e71bd88 Mon Sep 17 00:00:00 2001
From: nealkruis
Date: Wed, 15 Oct 2014 13:28:11 -0600
Subject: [PATCH 31/71] Fix error statements related to CLI.
---
src/EnergyPlus/CommandLineInterface.cc | 346 ++++++++++++++++++++-----
src/EnergyPlus/CommandLineInterface.hh | 13 +-
src/EnergyPlus/DataStringGlobals.in.cc | 1 -
src/EnergyPlus/HeatBalanceManager.cc | 9 +-
src/EnergyPlus/InputProcessor.cc | 19 +-
src/EnergyPlus/UtilityRoutines.cc | 36 +--
src/EnergyPlus/UtilityRoutines.hh | 5 +-
src/EnergyPlus/main.cc | 248 ++----------------
third_party/CLI/ezOptionParser.hpp | 6 +-
9 files changed, 328 insertions(+), 355 deletions(-)
diff --git a/src/EnergyPlus/CommandLineInterface.cc b/src/EnergyPlus/CommandLineInterface.cc
index 64c223d7901..e7dd2ff4a83 100644
--- a/src/EnergyPlus/CommandLineInterface.cc
+++ b/src/EnergyPlus/CommandLineInterface.cc
@@ -12,11 +12,15 @@
// CLI Headers
#include
+// ObjexxFCL Headers
+#include
+
// Project headers
#include
-#include
+#include
#include
#include
+#include
#include
#include
#include
@@ -30,6 +34,7 @@ namespace EnergyPlus{
namespace CommandLineInterface{
+using namespace DataGlobals;
using namespace DataStringGlobals;
using namespace DataSystemVariables;
using namespace InputProcessor;
@@ -87,14 +92,14 @@ std::string outputMtrCsvFileName;
std::string outputRvauditFileName;
std::string idfFileNameOnly;
-std::string exePathName;
+std::string exeDirectory;
bool runReadVars(false);
bool DDOnlySimulation(false);
bool AnnualSimulation(false);
-bool iddArgSet(false);
-bool fileExist(const std::string& filename)
+bool
+fileExist(const std::string& filename)
{
std::ifstream infile(filename);
return infile.good();
@@ -114,6 +119,25 @@ returnDirPath( std::string const& filepath )
return filepath.substr(0, pathCharPosition + 1);
}
+std::string
+returnAbsolutePath( std::string const& filepath )
+{
+ char absolutePath[1024];
+ realpath(filepath.c_str(), absolutePath);
+ return std::string(absolutePath);
+}
+
+std::string
+returnProgramPath()
+{
+ char executableRelativePath[1024];
+ uint32_t pathSize = sizeof(executableRelativePath);
+ _NSGetExecutablePath(executableRelativePath, &pathSize);
+
+ return std::string(executableRelativePath);
+}
+
+
// Not currently used
std::string
returnFileExtension(const std::string& filename){
@@ -190,63 +214,58 @@ ProcessArgs(int argc, const char * argv[])
ezOptionParser opt;
opt.overview = VerString;
- opt.example = "energyplus -i custom.idd -w weather.epw -d output/ -p prefix -r input.idf\n";
+ opt.example = "energyplus -w weather.epw -o output -r input.idf";
opt.syntax = "energyplus [options] [input file]";
- opt.add("", 0, 0, 0, "Display this message", "-h", "--help");
+ opt.add("", 0, 0, 0, "Force annual simulation", "-a", "--annual");
- opt.add("", 0, 0, 0, "Display version information", "-v", "--version");
+ opt.add("", 0, 0, 0, "Force design-day-only simulation", "-D", "--designday");
- opt.add("in.epw", 0, 1, 0, "Weather file path (default in.epw)", "-w", "--weather");
+ opt.add("", 0, 0, 0, "Display help information", "-h", "--help");
- opt.add("Energy+.idd", 0, 1, 0, "Input data dictionary path (default Energy+.idd in executable directory)", "-i", "--idd");
+ opt.add("Energy+.idd", 0, 1, 0, "Input data dictionary path (default: Energy+.idd in executable directory)", "-i", "--idd");
- opt.add("", 0, 1, 0, "Prefix for output files (default same as input file name)", "-p", "--prefix");
+ opt.add("", 0, 0, 0, "Run EPMacro", "-m", "--epmacro");
- opt.add("", 0, 0, 0, "Run ReadVarsESO to generate time-series CSV", "-r", "--readvars");
+ opt.add("", 0, 1, 0, "Output directory path (default: current working directory)", "-o", "--output-directory");
- opt.add("", 0, 0, 0, "Run ExpandObjects", "-x", "--expand");
+ opt.add("", 0, 1, 0, "Prefix for output file names (default: same as input file name)", "-p", "--output-prefix");
- opt.add("", 0, 0, 0, "Force design-day-only simulation", "-D", "--designday");
+ opt.add("", 0, 0, 0, "Run ReadVarsESO", "-r", "--readvars");
- opt.add("", 0, 0, 0, "Force annual simulation", "-a", "--annual");
+ opt.add("", 0, 0, 0, "Display version information", "-v", "--version");
- opt.add("", 0, 0, 0, "Run EPMacro", "-m", "--epmacro");
+ opt.add("in.epw", 0, 1, 0, "Weather file path (default: in.epw)", "-w", "--weather");
+
+ opt.add("", 0, 0, 0, "Run ExpandObjects", "-x", "--expand");
- opt.add("", 0, 1, 0, "Output directory (default current working directory)", "-d", "--dir");
+ std::string errorFollowUp = "Type 'energyplus --help' for usage.";
// Parse arguments
opt.parse(cStrArgs.size(), &cStrArgs[0]);
// print arguments parsed (useful for debugging)
- //std::string pretty;
- //opt.prettyPrint(pretty);
- //std::cout << pretty << std::endl;
+ /*std::string pretty;
+ opt.prettyPrint(pretty);
+ std::cout << pretty << std::endl;*/
std::string usage, idfDirPathName;
opt.getUsage(usage);
- //To check the path of EnergyPlus
- char executableAbsolutePath[1024];
- char executableRelativePath[1024];
- uint32_t pathSize = sizeof(executableRelativePath);
- _NSGetExecutablePath(executableRelativePath, &pathSize);
- realpath(executableRelativePath, executableAbsolutePath);
- exePathName = returnDirPath(std::string(executableAbsolutePath));
+ // Set path of EnergyPlus program path
+ exeDirectory = returnDirPath(returnAbsolutePath(returnProgramPath()));
opt.get("-w")->getString(inputWeatherFileName);
opt.get("-i")->getString(inputIddFileName);
- if (opt.isSet("-i"))
- iddArgSet = true;
- else
- inputIddFileName = exePathName + inputIddFileName;
+ if (!opt.isSet("-i") && argc > 1)
+ inputIddFileName = exeDirectory + inputIddFileName;
std::string dirPathName;
- opt.get("-d")->getString(dirPathName);
+ opt.get("-o")->getString(dirPathName);
runReadVars = opt.isSet("-r");
@@ -269,17 +288,10 @@ ProcessArgs(int argc, const char * argv[])
for(int i=0; i < opt.lastArgs.size(); ++i) {
std::string arg(opt.lastArgs[i]->c_str());
inputIdfFileName = arg;
-
- struct stat s;
- if( stat(arg.c_str(),&s) != 0 ) {
- char resolved_path[100];
- realpath(arg.c_str(), resolved_path);
- std::string idfPath = std::string(resolved_path);
- DisplayString("ERROR: "+ idfPath +" is not a valid path.\n" );
- exit(EXIT_FAILURE);
- }
}
}
+ if(inputIdfFileName.empty())
+ inputIdfFileName = "in.idf";
if(opt.lastArgs.size() > 1){
DisplayString("ERROR: Multiple input files specified:");
@@ -287,16 +299,20 @@ ProcessArgs(int argc, const char * argv[])
std::string arg(opt.lastArgs[i]->c_str());
DisplayString(" Input file #" + std::to_string(i+1) + ": " + arg);
}
- DisplayString(usage);
+ DisplayString(errorFollowUp);
exit(EXIT_FAILURE);
}
- if(inputIdfFileName.empty())
- inputIdfFileName = "in.idf";
-
+ if(opt.lastArgs.size() == 0 && argc > 0){
+ DisplayString("ERROR: No input file provided.");
+ DisplayString(errorFollowUp);
+ exit(EXIT_FAILURE);
+ }
idfFileNameOnly = removeFileExtension(returnFileName(inputIdfFileName));
idfDirPathName = returnDirPath(inputIdfFileName);
+ std::string weatherFilePathWithoutExtension = removeFileExtension(inputWeatherFileName);
+
bool runExpandObjects(false);
bool runEPMacro(false);
@@ -304,7 +320,7 @@ ProcessArgs(int argc, const char * argv[])
runEPMacro = opt.isSet("-m");
- if (opt.isSet("-d") ){
+ if (opt.isSet("-o") ){
struct stat sb = {0};
if (stat(dirPathName.c_str(), &sb) == -1) {
@@ -364,9 +380,9 @@ ProcessArgs(int argc, const char * argv[])
outputSszTabFileName = outputFilePrefix + "ssz.tab";
outputSszTxtFileName = outputFilePrefix + "ssz.txt";
outputScreenCsvFileName = outputFilePrefix + "screen.csv";
- outputDbgFileName = outputFilePrefix + ".dbg";
+ outputDbgFileName = outputFilePrefix + "out.dbg";
EnergyPlusIniFileName = "Energy+.ini";
- inStatFileName = "in.stat";
+ inStatFileName = weatherFilePathWithoutExtension + ".stat";
TarcogIterationsFileName = "TarcogIterations.dbg";
eplusADSFileName = idfDirPathName+"eplusADS.inp";
@@ -379,49 +395,101 @@ ProcessArgs(int argc, const char * argv[])
std::vector