-
Notifications
You must be signed in to change notification settings - Fork 438
Vertical blind warning not reported from material get input function #10743
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,7 +84,7 @@ constexpr std::array<Material::Gas, 10> gases = { | |
|
||
constexpr std::array<std::string_view, (int)EcoRoofCalcMethod::Num> ecoRoofCalcMethodNamesUC = {"SIMPLE", "ADVANCED"}; | ||
|
||
int GetMaterialNum(EnergyPlusData &state, std::string const &matName) | ||
int GetMaterialNum(EnergyPlusData const &state, std::string const &matName) | ||
{ | ||
auto const &s_mat = state.dataMaterial; | ||
auto found = s_mat->materialMap.find(Util::makeUPPER(matName)); | ||
|
@@ -2496,14 +2496,14 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if | |
continue; | ||
} | ||
|
||
auto const &instances = itInstances.value(); | ||
auto itObj = instances.begin(); | ||
auto const &instances2 = itInstances.value(); | ||
auto itObj = instances2.begin(); | ||
// Can't use find here because epJSON keys are not upper-cased | ||
for (; itObj != instances.end(); ++itObj) { | ||
for (; itObj != instances2.end(); ++itObj) { | ||
if (Util::makeUPPER(itObj.key()) == s_ipsc->cAlphaArgs(3)) break; | ||
} | ||
|
||
if (itObj == instances.end()) { | ||
if (itObj == instances2.end()) { | ||
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. [src/EnergyPlus/Material.cc:2499]:(style),[shadowVariable],Local variable 'instances' shadows outer variable |
||
ShowSevereItemNotFound(state, eoh, s_ipsc->cAlphaFieldNames(3), s_ipsc->cAlphaArgs(3)); | ||
ErrorsFound = true; | ||
continue; | ||
|
@@ -2523,15 +2523,15 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if | |
continue; | ||
} | ||
|
||
auto const &instances = itInstances.value(); | ||
auto const &instances3 = itInstances.value(); | ||
|
||
auto itObj = instances.begin(); | ||
auto itObj = instances3.begin(); | ||
// Can't use find here because epJSON keys are not upper-cased | ||
for (; itObj != instances.end(); ++itObj) { | ||
for (; itObj != instances3.end(); ++itObj) { | ||
if (Util::makeUPPER(itObj.key()) == s_ipsc->cAlphaArgs(4)) break; | ||
} | ||
|
||
if (itObj == instances.end()) { | ||
if (itObj == instances3.end()) { | ||
ShowSevereItemNotFound(state, eoh, s_ipsc->cAlphaFieldNames(4), s_ipsc->cAlphaArgs(4)); | ||
ErrorsFound = true; | ||
continue; | ||
|
@@ -2668,45 +2668,12 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if | |
} | ||
|
||
if ((mat->LayerType == TARCOGParams::TARCOGLayerType::VENETBLIND_HORIZ) || | ||
(mat->LayerType == TARCOGParams::TARCOGLayerType::VENETBLIND_HORIZ)) { | ||
if (s_ipsc->rNumericArgs(11) <= 0.0) { | ||
ErrorsFound = true; | ||
ShowSevereCustomMessage( | ||
state, eoh, format("{} must be >0, entered value = {:.2R}", s_ipsc->cNumericFieldNames(11), s_ipsc->rNumericArgs(11))); | ||
} | ||
|
||
if (s_ipsc->rNumericArgs(12) <= 0.0) { | ||
ErrorsFound = true; | ||
ShowSevereCustomMessage( | ||
state, eoh, format("{} must be >0, entered value = {:.2R}", s_ipsc->cNumericFieldNames(12), s_ipsc->rNumericArgs(12))); | ||
} | ||
|
||
if (s_ipsc->rNumericArgs(13) <= 0.0) { | ||
ErrorsFound = true; | ||
ShowSevereCustomMessage( | ||
state, eoh, format("{} must be >0, entered value = {:.2R}", s_ipsc->cNumericFieldNames(13), s_ipsc->rNumericArgs(13))); | ||
} | ||
|
||
if ((s_ipsc->rNumericArgs(14) < -90.0) || (s_ipsc->rNumericArgs(14) > 90.0)) { | ||
ErrorsFound = true; | ||
ShowSevereCustomMessage( | ||
state, | ||
eoh, | ||
format("{} must be >=-90 and <=90, entered value = {:.2R}", s_ipsc->cNumericFieldNames(14), s_ipsc->rNumericArgs(14))); | ||
} | ||
|
||
if (s_ipsc->rNumericArgs(15) <= 0.0) { | ||
ErrorsFound = true; | ||
ShowSevereCustomMessage( | ||
state, eoh, format("{} must be >0, entered value = {:.2R}", s_ipsc->cNumericFieldNames(15), s_ipsc->rNumericArgs(15))); | ||
} | ||
|
||
if ((s_ipsc->rNumericArgs(16) < 0.0) || | ||
((s_ipsc->rNumericArgs(16) > 0.0) && (s_ipsc->rNumericArgs(16) < (s_ipsc->rNumericArgs(11) / 2)))) { | ||
(mat->LayerType == TARCOGParams::TARCOGLayerType::VENETBLIND_VERT)) { | ||
if ((s_ipsc->rNumericArgs(16) > 0.0) && (s_ipsc->rNumericArgs(16) < (s_ipsc->rNumericArgs(11) / 2))) { | ||
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. [src/EnergyPlus/Material.cc:2670]:(style),[duplicateExpression],Same expression on both sides of '||'. These other checks are caught by InputProcessor and are never executed. For example if I make slat thickness < 0 this input processor warning is reported.
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. Yes! There is so much duplicated between the IDD/input processor range checks and then inaccessible checks in the get input routines. I love it. |
||
ErrorsFound = true; | ||
ShowSevereCustomMessage(state, | ||
eoh, | ||
format("{} must be =0 or greater than SlatWidth/2, entered value = {:.2R}", | ||
format("{} must be = 0 or greater than SlatWidth/2, entered value = {:.2R}", | ||
s_ipsc->cNumericFieldNames(16), | ||
s_ipsc->rNumericArgs(16))); | ||
} | ||
|
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.
[src/EnergyPlus/Material.cc:87]:(style),[constParameter],Parameter 'state' can be declared as reference to const