-
Notifications
You must be signed in to change notification settings - Fork 193
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
Fix #4911 - Avoid extra warning message in ShadingControl #4914
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -239,42 +239,30 @@ namespace model { | |
} | ||
|
||
bool ShadingControl_Impl::setShadingControlType(const std::string& shadingControlType) { | ||
std::string oldControlType = this->shadingControlType(); | ||
bool result = setString(OS_ShadingControlFields::ShadingControlType, shadingControlType); | ||
const bool result = setString(OS_ShadingControlFields::ShadingControlType, shadingControlType); | ||
if (result) { | ||
if (!ShadingControl_Impl::isControlTypeValueNeedingSetpoint1(shadingControlType)) { | ||
// Not calling reset to avoid double check on whether it's required | ||
// resetSetpoint(); | ||
LOG(Info, | ||
briefDescription() << " Shading Control Type was changed to '" << shadingControlType << " which does not require a Setpoint, reseting"); | ||
bool test = setString(OS_ShadingControlFields::Setpoint, ""); | ||
// Not calling resetSetpoint to avoid double check on whether it's required | ||
LOG(Info, briefDescription() << " Shading Control Type was changed to '" << shadingControlType | ||
<< " which does not require a Setpoint, resetting it."); | ||
const bool test = setString(OS_ShadingControlFields::Setpoint, ""); | ||
OS_ASSERT(test); | ||
} | ||
if (!ShadingControl_Impl::isControlTypeValueNeedingSetpoint2(shadingControlType)) { | ||
// Not calling reset to avoid double check on whether it's required | ||
// resetSetpoint2(); | ||
// Not calling resetSetpoint2 to avoid double check on whether it's required | ||
LOG(Info, briefDescription() << " Shading Control Type was changed to '" << shadingControlType | ||
<< " which does not require a Setpoint2, reseting"); | ||
bool test = setString(OS_ShadingControlFields::Setpoint2, ""); | ||
<< " which does not require a Setpoint2, resetting it."); | ||
const bool test = setString(OS_ShadingControlFields::Setpoint2, ""); | ||
OS_ASSERT(test); | ||
} | ||
if (!ShadingControl_Impl::isControlTypeValueAllowingSchedule(shadingControlType)) { | ||
LOG(Info, | ||
briefDescription() << " Shading Control Type was changed to '" << shadingControlType << " which does not allow a Schedule, reseting"); | ||
LOG(Info, briefDescription() << " Shading Control Type was changed to '" << shadingControlType | ||
<< " which does not allow a Schedule, resetting it."); | ||
bool test = setString(OS_ShadingControlFields::ScheduleName, ""); | ||
OS_ASSERT(test); | ||
test = setString(OS_ShadingControlFields::ShadingControlIsScheduled, "No"); | ||
OS_ASSERT(test); | ||
} | ||
|
||
// TODO: do we want to force remove this stuff like it did resetSetpoint before? Units/quantity might be oranges and apples when switching | ||
// types, but they could be compatible, and it may be very confusing at least for interface users that are playing with a dropdown to see | ||
// schedulesand setpoints disapear | ||
if (!openstudio::istringEqual(oldControlType, shadingControlType)) { | ||
resetSetpoint(); // For backward compatibility | ||
// resetSetpoint2(); | ||
// resetSchedule(); | ||
} | ||
} | ||
return result; | ||
} | ||
|
@@ -406,7 +394,7 @@ namespace model { | |
|
||
void ShadingControl_Impl::resetSetpoint2() { | ||
std::string shadingControlType = this->shadingControlType(); | ||
if (ShadingControl_Impl::isControlTypeValueNeedingSetpoint1(shadingControlType)) { | ||
if (ShadingControl_Impl::isControlTypeValueNeedingSetpoint2(shadingControlType)) { | ||
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. This was a bug found by @brgix |
||
LOG(Warn, | ||
briefDescription() << " has a Shading Control Type '" << shadingControlType << "' which does require a Setpoint2, not resetting it"); | ||
} else { | ||
|
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.
Removing this block that was a TODO and issues an unnecessary Warn