-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Addresses #4647, wrap the E+ Table:Lookup, Table:IndependentVariableList, and Table:IndependentVariable objects #4652
Merged
Merged
Changes from all commits
Commits
Show all changes
66 commits
Select commit
Hold shift + click to select a range
944dbdb
Updates to idd.
joseph-robertson 079d88e
Deprecate table multivariable lookup.
joseph-robertson 400d3b0
Stub table lookup model files.
joseph-robertson 301a7f0
Stub table lookup ft files.
joseph-robertson 441766e
Formatting.
joseph-robertson c92dfc8
Minor updates.
joseph-robertson ae6b64b
Use modelobjectlists for variablelist.
joseph-robertson cb07c92
Stub table independent variable model files.
joseph-robertson b3f5cfc
Stub table independent variable ft files.
joseph-robertson e70f2e8
Formatting.
joseph-robertson 6d26fcc
Merge branch 'develop' into table-lookup
joseph-robertson 9fa13cd
Progress on model files.
joseph-robertson 632782d
Formatting.
joseph-robertson 1bd7c00
Few updates.
joseph-robertson 9233e3a
Change ind var to resource object.
joseph-robertson 2b501a6
Stub more ft.
joseph-robertson 722eb4f
Stub lookup ctor.
joseph-robertson e146312
Start filling in getters and setters.
joseph-robertson 0fcdbe9
Progress on ft.
joseph-robertson 51d234c
Start filling out model tests for basic function.
joseph-robertson 7a3fc5c
Start filling out ft tests for basic function.
joseph-robertson 4d23c12
Fix in ft test.
joseph-robertson 9afa622
Update model tests.
joseph-robertson 384a988
Fix tests.
joseph-robertson a306bb5
Fix ft test.
joseph-robertson 1450bb3
Updates to ft.
joseph-robertson fef1128
Add methods for extensible groups.
joseph-robertson 228b3f1
Clean up ft.
joseph-robertson 2dd4b56
Hook sources back up in ft.
joseph-robertson c6ab3bf
Merge branch 'develop' into table-lookup
joseph-robertson aab51b4
Add remaining lookup methods.
joseph-robertson a878e52
Update idd and ft replacement.
joseph-robertson bc6822a
Formatting.
joseph-robertson 87b4699
Wrong return types.
joseph-robertson 631ddf3
Actually return in remove methods.
joseph-robertson 432555b
Minor idd updates.
joseph-robertson 6d6cc55
Finish table methods.
joseph-robertson 829b114
Finish ft and replacement.
joseph-robertson c0b94ce
Update model and ft tests.
joseph-robertson 513e531
Fix model and ft tests.
joseph-robertson 8ecd225
Modify TableIndependentVariable
jmarrec 8304c9d
Modify TableLookup
jmarrec dced8f0
add TableLookup::setOutputValues(vector<double>) + adjust gtest
jmarrec eb66a23
add TableIndependentVariable::setValues(vector<double>) + adjust gtest
jmarrec a9d87a7
Add a (failing) Gtest for TableLookup clone & remove (see failing log…
jmarrec 09380da
Small fixup for numVariables / outputVariableNames + break FT tests i…
jmarrec b4255ac
Override TableLookup::clone & remove
jmarrec f5d52a7
Redo the ft, and add a translateTableIndependentVariable to avoid dup…
jmarrec 75a179f
This is actually the grid size (product of UNIQUE count of independen…
jmarrec 78103b1
Extend FT tests
jmarrec f49be26
Add a VT test
jmarrec f796e1c
Add VT for TableMultiVariableLookup to TableLookup
jmarrec db490c5
Port Coil Cooling/Heating Four Pipe Beam to using TableLookup
jmarrec bd9961f
Change tests to use TableLookup too
jmarrec 6d14235
Deprecate the entire TableMultivariableLookup and pragma ignore depre…
jmarrec f3b8016
Port sdd MapHVAC to use TableLookup
jmarrec 9d60fca
Update src/energyplus/ForwardTranslator.cpp
jmarrec 461407e
Forgot to connect TableLookup to TableIndependentVariable
jmarrec 521ee35
For VT, need to match Ctor and initialize Normalization Divisor/Method
jmarrec b79b389
Merge remote-tracking branch 'origin/develop' into table-lookup
jmarrec 1c7521a
Put back old FT for TableMultiVariableLookup (easier to remove than t…
jmarrec 019c0b5
Partially revert 1c7521a7910: swig chokes on the macro
jmarrec 669969a
Write a ReverseTranslator + RT Test for TableLookup
jmarrec 8ce7017
Slightly Adjust FT for TableMultiVariableLookup
jmarrec 45452ea
Tweak getString to use uninitialized empty
jmarrec a8f312b
Merge branch 'develop' into table-lookup
joseph-robertson File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 93 additions & 0 deletions
93
src/energyplus/ForwardTranslator/ForwardTranslateTableIndependentVariable.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
/*********************************************************************************************************************** | ||
* 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/TableIndependentVariable.hpp" | ||
|
||
#include "../../utilities/idf/IdfExtensibleGroup.hpp" | ||
|
||
#include <utilities/idd/Table_IndependentVariable_FieldEnums.hxx> | ||
// #include "../../utilities/idd/IddEnums.hpp" | ||
#include <utilities/idd/IddEnums.hxx> | ||
|
||
using namespace openstudio::model; | ||
|
||
namespace openstudio { | ||
|
||
namespace energyplus { | ||
|
||
boost::optional<IdfObject> ForwardTranslator::translateTableIndependentVariable(model::TableIndependentVariable& modelObject) { | ||
boost::optional<IdfObject> result; | ||
|
||
// Instantiate an IdfObject of the class to store the values | ||
IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::Table_IndependentVariable, modelObject); | ||
|
||
// Interpolation Method: String | ||
idfObject.setString(Table_IndependentVariableFields::InterpolationMethod, modelObject.interpolationMethod()); | ||
|
||
// Extrapolation Method: String | ||
idfObject.setString(Table_IndependentVariableFields::ExtrapolationMethod, modelObject.extrapolationMethod()); | ||
|
||
// Minimum Value: boost::optional<double> | ||
if (boost::optional<double> minimumValue_ = modelObject.minimumValue()) { | ||
idfObject.setDouble(Table_IndependentVariableFields::MinimumValue, minimumValue_.get()); | ||
} | ||
|
||
// Maximum Value: boost::optional<double> | ||
if (boost::optional<double> maximumValue_ = modelObject.maximumValue()) { | ||
idfObject.setDouble(Table_IndependentVariableFields::MaximumValue, maximumValue_.get()); | ||
} | ||
|
||
// Normalization Reference Value: boost::optional<double> | ||
if (boost::optional<double> normalizationReferenceValue_ = modelObject.normalizationReferenceValue()) { | ||
idfObject.setDouble(Table_IndependentVariableFields::NormalizationReferenceValue, normalizationReferenceValue_.get()); | ||
} | ||
|
||
// Unit Type: String | ||
idfObject.setString(Table_IndependentVariableFields::UnitType, modelObject.unitType()); | ||
|
||
// Value | ||
for (const double& value : modelObject.values()) { | ||
IdfExtensibleGroup eg = idfObject.pushExtensibleGroup(); | ||
eg.setDouble(Table_IndependentVariableExtensibleFields::Value, value); | ||
} | ||
Comment on lines
+77
to
+81
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jmarrec Is this still a TODO? |
||
|
||
// External File Name: boost::optional<std::string> | ||
|
||
// External File Column Number: boost::optional<int> | ||
|
||
// External File Starting Row Number: boost::optional<int> | ||
|
||
return idfObject; | ||
} // End of translate function | ||
|
||
} // end namespace energyplus | ||
} // end namespace openstudio |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise, I agree with the rest of the IDD objects. The required-field is used where appropriate 👍