Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
a3f215a
Add to idd.
joseph-robertson Jul 19, 2022
a4d8d98
Stub model tests.
joseph-robertson Jul 19, 2022
7efe6b7
Update model resource files.
joseph-robertson Jul 19, 2022
c5039ae
Stub source files.
joseph-robertson Jul 19, 2022
1163bfd
Add temp fixmes to ft.
joseph-robertson Jul 19, 2022
3ab7e77
Formatting.
joseph-robertson Jul 19, 2022
11ec776
Update eplus resource files.
joseph-robertson Jul 19, 2022
b2fa8b5
Stub ft and rt tests.
joseph-robertson Jul 19, 2022
a5f59b2
Stub new ft and rt source files.
joseph-robertson Jul 19, 2022
a7d1d14
Formatting.
joseph-robertson Jul 19, 2022
6d92dd8
Fix typos in cmakelists.
joseph-robertson Jul 19, 2022
2f69289
Typo in rt.
joseph-robertson Jul 19, 2022
b66131b
Typo is model impl hpp.
joseph-robertson Jul 19, 2022
a19066c
Fill out methods.
joseph-robertson Jul 19, 2022
65d9718
Missing iddfactory include.
joseph-robertson Jul 19, 2022
98becd0
Fill out model tests.
joseph-robertson Jul 21, 2022
37498f0
Fill out ft.
joseph-robertson Jul 21, 2022
5290659
Fill out rt.
joseph-robertson Jul 21, 2022
c1ee298
Fill out ft and rt tests.
joseph-robertson Jul 21, 2022
15d0dc5
Typos in rt tests.
joseph-robertson Jul 21, 2022
591518e
Update ft for default output control.
joseph-robertson Jul 21, 2022
bbede6e
Fix syntax.
joseph-robertson Jul 21, 2022
5cedc7e
More ft fixes.
joseph-robertson Jul 21, 2022
40905e2
Include typo.
joseph-robertson Jul 21, 2022
45e81e4
Pass model into createStandardOutputRequests.
joseph-robertson Jul 21, 2022
591bf84
Update ft hpp.
joseph-robertson Jul 21, 2022
3c33c84
Typo in modelsimulation.
joseph-robertson Jul 22, 2022
252d99d
Merge branch 'develop' into output-control
joseph-robertson Jul 25, 2022
d2f82e3
Respond to review.
joseph-robertson Jul 25, 2022
dc3b8e5
Missing arg in ft create method.
joseph-robertson Jul 25, 2022
1fe21a8
Update model test.
joseph-robertson Jul 25, 2022
499f716
Improve ft tests for various scenarios.
joseph-robertson Jul 25, 2022
1d4df04
Typo in ft test.
joseph-robertson Jul 25, 2022
b3e1bb8
Try not returning default.
joseph-robertson Jul 26, 2022
ea82c4a
Include asserts in ctors.
joseph-robertson Jul 26, 2022
979cc26
fixup unit tests
jmarrec Jul 26, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions resources/model/OpenStudio.idd
Original file line number Diff line number Diff line change
Expand Up @@ -34180,6 +34180,38 @@ OS:OutputControl:ReportingTolerances,
\minimum 0
\maximum 10

OS:OutputControl:Table:Style,
\memo default style for the OutputControl:Table:Style is comma -- this works well for
\memo importing into spreadsheet programs such as Excel(tm) but not so well for word
\memo processing programs -- there tab may be a better choice. fixed puts spaces between
\memo the "columns". HTML produces tables in HTML. XML produces an XML file.
\memo note - if no OutputControl:Table:Style is included, the defaults are comma and None.
\unique-object
A1, \field Handle
\type handle
\required-field
A2, \field Column Separator
\type choice
\key Comma
\key Tab
\key Fixed
\key HTML
\key XML
\key CommaAndHTML
\key CommaAndXML
\key TabAndHTML
\key XMLandHTML
\key All
\required-field
A3; \field Unit Conversion
\type choice
\key None
\key JtoKWH
\key JtoMJ
\key JtoGJ
\key InchPound
\required-field

OS:Output:Meter,
\memo each OS:Output:Meter command picks meters to be put onto the standard output file (.eso) and
\memo meter file (.mtr). Not all meters are reported in every simulation. A list of
Expand Down Expand Up @@ -34605,6 +34637,29 @@ OS:Output:JSON,
\key No
\required-field

OS:Output:SQLite,
\memo Output from EnergyPlus can be written to an SQLite format file.
\unique-object
A1, \field Handle
\type handle
\required-field
A2, \field Option Type
\type choice
\key Simple
\key SimpleAndTabular
\required-field
A3; \field Unit Conversion for Tabular Data
\type choice
\note Unit conversion option used when writing SQLite Tabular Data
\note This option applies to TabularData and TabularDatawithString in the SQLite file
\key UseOutputControlTableStyle
\key None
\key JtoKWH
\key JtoMJ
\key JtoGJ
\key InchPound
\required-field

OS:Output:EnergyManagementSystem,
\memo This object is used to control the output produced by the Energy Management System
\unique-object
Expand Down
8 changes: 8 additions & 0 deletions src/energyplus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,14 @@ set(${target_name}_src
ForwardTranslator/ForwardTranslateOutsideSurfaceConvectionAlgorithm.cpp
ForwardTranslator/ForwardTranslateOutputControlFiles.cpp
ForwardTranslator/ForwardTranslateOutputControlReportingTolerances.cpp
ForwardTranslator/ForwardTranslateOutputControlTableStyle.cpp
ForwardTranslator/ForwardTranslateOutputMeter.cpp
ForwardTranslator/ForwardTranslateOutputVariable.cpp
ForwardTranslator/ForwardTranslateOutputDebuggingData.cpp
ForwardTranslator/ForwardTranslateOutputDiagnostics.cpp
ForwardTranslator/ForwardTranslateOutputEnergyManagementSystem.cpp
ForwardTranslator/ForwardTranslateOutputJSON.cpp
ForwardTranslator/ForwardTranslateOutputSQLite.cpp
ForwardTranslator/ForwardTranslateOutputEnvironmentalImpactFactors.cpp
ForwardTranslator/ForwardTranslateEnvironmentalImpactFactors.cpp
ForwardTranslator/ForwardTranslateFuelFactors.cpp
Expand Down Expand Up @@ -527,10 +529,13 @@ set(${target_name}_src
ReverseTranslator/ReverseTranslateMeterCustomDecrement.cpp
ReverseTranslator/ReverseTranslateOtherEquipment.cpp
ReverseTranslator/ReverseTranslateOutputControlFiles.cpp
ReverseTranslator/ReverseTranslateOutputControlReportingTolerances.cpp
ReverseTranslator/ReverseTranslateOutputControlTableStyle.cpp
ReverseTranslator/ReverseTranslateOutputDebuggingData.cpp
ReverseTranslator/ReverseTranslateOutputDiagnostics.cpp
ReverseTranslator/ReverseTranslateOutputEnergyManagementSystem.cpp
ReverseTranslator/ReverseTranslateOutputJSON.cpp
ReverseTranslator/ReverseTranslateOutputSQLite.cpp
ReverseTranslator/ReverseTranslateOutputEnvironmentalImpactFactors.cpp
ReverseTranslator/ReverseTranslateEnvironmentalImpactFactors.cpp
ReverseTranslator/ReverseTranslateFuelFactors.cpp
Expand Down Expand Up @@ -712,9 +717,12 @@ set(${target_name}_test_src
Test/MaterialPropertyPhaseChangeHysteresis_GTest.cpp
Test/Meter_GTest.cpp
Test/OutputControlFiles_GTest.cpp
Test/OutputControlReportingTolerances_GTest.cpp
Test/OutputControlTableStyle_GTest.cpp
Test/OutputDebuggingData_GTest.cpp
Test/OutputDiagnostics_GTest.cpp
Test/OutputJSON_GTest.cpp
Test/OutputSQLite_GTest.cpp
Test/OutputEnvironmentalImpactFactors_GTest.cpp
Test/OutputTableSummaryReports_GTest.cpp
Test/People_GTest.cpp
Expand Down
38 changes: 28 additions & 10 deletions src/energyplus/ForwardTranslator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@
#include "../model/SpaceInfiltrationFlowCoefficient_Impl.hpp"
#include "../model/ElectricEquipmentITEAirCooled.hpp"
#include "../model/ElectricEquipmentITEAirCooled_Impl.hpp"
#include "../model/OutputControlTableStyle.hpp"
#include "../model/OutputControlTableStyle_Impl.hpp"
#include "../model/OutputSQLite.hpp"
#include "../model/OutputSQLite_Impl.hpp"

#include "../utilities/idf/Workspace.hpp"
#include "../utilities/idf/IdfExtensibleGroup.hpp"
Expand Down Expand Up @@ -678,7 +682,7 @@ namespace energyplus {

if (fullModelTranslation) {
// add output requests
this->createStandardOutputRequests();
this->createStandardOutputRequests(model);
}

Workspace workspace(StrictnessLevel::Minimal, IddFileType::EnergyPlus);
Expand Down Expand Up @@ -2299,6 +2303,11 @@ namespace energyplus {
retVal = translateOutputControlReportingTolerances(outputControlReportingTolerances);
break;
}
case openstudio::IddObjectType::OS_OutputControl_Table_Style: {
model::OutputControlTableStyle outputControlTableStyle = modelObject.cast<OutputControlTableStyle>();
retVal = translateOutputControlTableStyle(outputControlTableStyle);
break;
}
case openstudio::IddObjectType::OS_Output_DebuggingData: {
auto mo = modelObject.cast<OutputDebuggingData>();
retVal = translateOutputDebuggingData(mo);
Expand All @@ -2314,6 +2323,11 @@ namespace energyplus {
retVal = translateOutputJSON(mo);
break;
}
case openstudio::IddObjectType::OS_Output_SQLite: {
auto mo = modelObject.cast<OutputSQLite>();
retVal = translateOutputSQLite(mo);
break;
}
case openstudio::IddObjectType::OS_Output_EnvironmentalImpactFactors: {
auto mo = modelObject.cast<OutputEnvironmentalImpactFactors>();
retVal = translateOutputEnvironmentalImpactFactors(mo);
Expand Down Expand Up @@ -3288,9 +3302,11 @@ namespace energyplus {
result.push_back(IddObjectType::OS_ZoneCapacitanceMultiplier_ResearchSpecial);
result.push_back(IddObjectType::OS_OutputControl_Files);
result.push_back(IddObjectType::OS_OutputControl_ReportingTolerances);
result.push_back(IddObjectType::OS_OutputControl_Table_Style);
result.push_back(IddObjectType::OS_Output_DebuggingData);
result.push_back(IddObjectType::OS_Output_Diagnostics);
result.push_back(IddObjectType::OS_Output_JSON);
result.push_back(IddObjectType::OS_Output_SQLite);

// Note: we just always translate Output:EnvironmentalImpactFactors, and in there (it exists), then trigger translatation of the two others
result.push_back(IddObjectType::OS_Output_EnvironmentalImpactFactors);
Expand Down Expand Up @@ -4373,13 +4389,14 @@ namespace energyplus {
}
}

void ForwardTranslator::createStandardOutputRequests() {
void ForwardTranslator::createStandardOutputRequests(const model::Model& model) {
if (!m_excludeHTMLOutputReport) {
IdfObject tableStyle(IddObjectType::OutputControl_Table_Style);
m_idfObjects.push_back(tableStyle);
tableStyle.setString(OutputControl_Table_StyleFields::ColumnSeparator, "HTML");
if (m_ipTabularOutput) {
tableStyle.setString(OutputControl_Table_StyleFields::UnitConversion, "InchPound");
if (!model.getOptionalUniqueModelObject<model::OutputControlTableStyle>()) {
IdfObject& tableStyle = m_idfObjects.emplace_back(IddObjectType::OutputControl_Table_Style);
tableStyle.setString(OutputControl_Table_StyleFields::ColumnSeparator, "HTML");
if (m_ipTabularOutput) {
tableStyle.setString(OutputControl_Table_StyleFields::UnitConversion, "InchPound");
}
}
}

Expand All @@ -4391,9 +4408,10 @@ namespace energyplus {
}

if (!m_excludeSQliteOutputReport) {
IdfObject sqliteOutput(IddObjectType::Output_SQLite);
sqliteOutput.setString(Output_SQLiteFields::OptionType, "SimpleAndTabular");
m_idfObjects.push_back(sqliteOutput);
if (!model.getOptionalUniqueModelObject<model::OutputSQLite>()) {
IdfObject& sqliteOutput = m_idfObjects.emplace_back(IddObjectType::Output_SQLite);
sqliteOutput.setString(Output_SQLiteFields::OptionType, "SimpleAndTabular");
}
}

// ensure at least one life cycle cost exists to prevent crash in E+ 8
Expand Down
8 changes: 7 additions & 1 deletion src/energyplus/ForwardTranslator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,11 @@ namespace model {
class OutsideSurfaceConvectionAlgorithm;
class OutputControlFiles;
class OutputControlReportingTolerances;
class OutputControlTableStyle;
class OutputDebuggingData;
class OutputDiagnostics;
class OutputJSON;
class OutputSQLite;
class OutputEnvironmentalImpactFactors;
class EnvironmentalImpactFactors;
class FuelFactors;
Expand Down Expand Up @@ -1136,12 +1138,16 @@ namespace energyplus {

boost::optional<IdfObject> translateOutputControlReportingTolerances(model::OutputControlReportingTolerances& modelObject);

boost::optional<IdfObject> translateOutputControlTableStyle(model::OutputControlTableStyle& modelObject);

boost::optional<IdfObject> translateOutputDebuggingData(model::OutputDebuggingData& modelObject);

boost::optional<IdfObject> translateOutputDiagnostics(model::OutputDiagnostics& modelObject);

boost::optional<IdfObject> translateOutputJSON(model::OutputJSON& modelObject);

boost::optional<IdfObject> translateOutputSQLite(model::OutputSQLite& modelObject);

boost::optional<IdfObject> translateOutputEnvironmentalImpactFactors(model::OutputEnvironmentalImpactFactors& modelObject);

boost::optional<IdfObject> translateEnvironmentalImpactFactors(model::EnvironmentalImpactFactors& modelObject);
Expand Down Expand Up @@ -1573,7 +1579,7 @@ namespace energyplus {
// This should be used by the various translateUnitaryFoo methods.
void fixSPMsForUnitarySystem(const model::HVACComponent& unitary, const std::string& fanInletNodeName, const std::string& FanOutletNodeName);

void createStandardOutputRequests();
void createStandardOutputRequests(const model::Model& model);

std::string stripOS2(const std::string& s);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ namespace openstudio {
namespace energyplus {

boost::optional<IdfObject> ForwardTranslator::translateOutputControlFiles(OutputControlFiles& modelObject) {
IdfObject idfObject(openstudio::IddObjectType::OutputControl_Files);
m_idfObjects.push_back(idfObject);

IdfObject idfObject = createAndRegisterIdfObject(openstudio::IddObjectType::OutputControl_Files, modelObject);

if (modelObject.outputCSV()) {
idfObject.setString(OutputControl_FilesFields::OutputCSV, "Yes");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,8 @@ namespace openstudio {
namespace energyplus {

boost::optional<IdfObject> ForwardTranslator::translateOutputControlReportingTolerances(OutputControlReportingTolerances& modelObject) {
IdfObject idfObject(openstudio::IddObjectType::OutputControl_ReportingTolerances);

m_idfObjects.push_back(idfObject);

OptionalString s = modelObject.name();
if (s) {
idfObject.setName(*s);
}
IdfObject idfObject = createAndRegisterIdfObject(openstudio::IddObjectType::OutputControl_ReportingTolerances, modelObject);

boost::optional<double> value;

Expand All @@ -63,7 +57,7 @@ namespace energyplus {
idfObject.setDouble(OutputControl_ReportingTolerancesFields::ToleranceforTimeHeatingSetpointNotMet, value.get());
}

return boost::optional<IdfObject>(idfObject);
return idfObject;
}

} // namespace energyplus
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/***********************************************************************************************************************
* OpenStudio(R), Copyright (c) 2008-2022, Alliance for Sustainable Energy, LLC, and other contributors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* (1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following
* disclaimer.
*
* (2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the distribution.
*
* (3) Neither the name of the copyright holder nor the names of any contributors may be used to endorse or promote products
* derived from this software without specific prior written permission from the respective party.
*
* (4) Other than as required in clauses (1) and (2), distributions in any form of modifications or other derivative works
* may not use the "OpenStudio" trademark, "OS", "os", or any other confusingly similar designation without specific prior
* written permission from Alliance for Sustainable Energy, LLC.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE UNITED STATES GOVERNMENT, OR THE UNITED
* STATES DEPARTMENT OF ENERGY, NOR ANY OF THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
***********************************************************************************************************************/

#include "../ForwardTranslator.hpp"
#include "../../model/Model.hpp"
#include "../../model/OutputControlTableStyle.hpp"
#include <utilities/idd/OutputControl_Table_Style_FieldEnums.hxx>
#include "../../utilities/idd/IddEnums.hpp"
#include <utilities/idd/IddEnums.hxx>
#include <utilities/idd/IddFactory.hxx>

using namespace openstudio::model;

using namespace std;

namespace openstudio {

namespace energyplus {

boost::optional<IdfObject> ForwardTranslator::translateOutputControlTableStyle(OutputControlTableStyle& modelObject) {

IdfObject idfObject = createAndRegisterIdfObject(openstudio::IddObjectType::OutputControl_Table_Style, modelObject);

idfObject.setString(OutputControl_Table_StyleFields::ColumnSeparator, modelObject.columnSeparator());

idfObject.setString(OutputControl_Table_StyleFields::UnitConversion, modelObject.unitConversion());

return idfObject;
}

} // namespace energyplus

} // namespace openstudio
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ namespace openstudio {
namespace energyplus {

boost::optional<IdfObject> ForwardTranslator::translateOutputDebuggingData(model::OutputDebuggingData& modelObject) {
IdfObject idfObject(openstudio::IddObjectType::Output_DebuggingData);
m_idfObjects.push_back(idfObject);

IdfObject idfObject = createAndRegisterIdfObject(openstudio::IddObjectType::Output_DebuggingData, modelObject);

// Report Debugging Data
if (modelObject.reportDebuggingData()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ namespace energyplus {
return boost::none;
}

IdfObject idfObject(openstudio::IddObjectType::Output_Diagnostics);
m_idfObjects.push_back(idfObject);
IdfObject idfObject = createAndRegisterIdfObject(openstudio::IddObjectType::Output_Diagnostics, modelObject);

for (const std::string& key : modelObject.keys()) {
IdfExtensibleGroup eg = idfObject.pushExtensibleGroup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,8 @@ namespace energyplus {
boost::optional<IdfObject> ForwardTranslator::translateOutputEnergyManagementSystem(OutputEnergyManagementSystem& modelObject) {
boost::optional<std::string> s;

IdfObject idfObject(openstudio::IddObjectType::Output_EnergyManagementSystem);
m_idfObjects.push_back(idfObject);
//Name
s = modelObject.name();
if (s) {
idfObject.setName(*s);
}
IdfObject idfObject = createAndRegisterIdfObject(openstudio::IddObjectType::Output_EnergyManagementSystem, modelObject);

s = modelObject.actuatorAvailabilityDictionaryReporting();
if (s) {
idfObject.setString(Output_EnergyManagementSystemFields::ActuatorAvailabilityDictionaryReporting, s.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ namespace energyplus {
}

// It doesn't have a name
IdfObject idfObject(openstudio::IddObjectType::Output_EnvironmentalImpactFactors);
m_idfObjects.push_back(idfObject);
IdfObject idfObject = createAndRegisterIdfObject(openstudio::IddObjectType::Output_EnvironmentalImpactFactors, modelObject);

idfObject.setString(Output_EnvironmentalImpactFactorsFields::ReportingFrequency, modelObject.reportingFrequency());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ namespace energyplus {

boost::optional<IdfObject> ForwardTranslator::translateOutputJSON(model::OutputJSON& modelObject) {

IdfObject idfObject(openstudio::IddObjectType::Output_JSON);
m_idfObjects.push_back(idfObject);
IdfObject idfObject = createAndRegisterIdfObject(openstudio::IddObjectType::Output_JSON, modelObject);

// Option Type: Required String
std::string optionType = modelObject.optionType();
Expand Down
Loading