Skip to content

Commit

Permalink
Implement new MultipleSurfaceControlType field in Shading Control
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarrec committed Sep 11, 2020
1 parent 373d248 commit 55d0899
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 1 deletion.
10 changes: 9 additions & 1 deletion resources/model/OpenStudio.idd
Original file line number Diff line number Diff line change
Expand Up @@ -5879,7 +5879,15 @@ OS:ShadingControl,
\note OnIfHighZoneAirTempAndHighSolarOnWindow, and OnIfHighZoneAirTempAndHighHorizontalSolar
\type real
\ip-units unknown
A12; \field Sub Surface Name
A12, \field Multiple Surface Control Type
\type choice
\key Sequential
\key Group
\required-field
\note When Sequential is used the list of fenestration surfaces are controlled individually in the order specified
\note When Group is used the entire list is controlled simultaneously and if glare control is needed the entire
\note group of window shades are deployed together a the same time
A13; \field Sub Surface Name
\required-field
\begin-extensible
\type object-list
Expand Down
29 changes: 29 additions & 0 deletions src/model/ShadingControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,17 @@ namespace detail {
OS_ASSERT(test);
}

std::string ShadingControl_Impl::multipleSurfaceControlType() const
{
boost::optional<std::string> result = getString(OS_ShadingControlFields::MultipleSurfaceControlType, true);
OS_ASSERT(result);
return result.get();
}

bool ShadingControl_Impl::setMultipleSurfaceControlType(const std::string& multipleSurfaceControlType)
{
return setString(OS_ShadingControlFields::MultipleSurfaceControlType, multipleSurfaceControlType);
}

unsigned int ShadingControl_Impl::numberofSubSurfaces() const
{
Expand Down Expand Up @@ -414,6 +424,9 @@ ShadingControl::ShadingControl(const Construction& construction)
bool test = this->setShadingType(position + type);
OS_ASSERT(test);

test = setMultipleSurfaceControlType("Sequential"); // E+ IDD Default
OS_ASSERT(test);

test = this->setPointer(OS_ShadingControlFields::ConstructionwithShadingName, construction.handle());
OS_ASSERT(test);
}
Expand All @@ -439,6 +452,9 @@ ShadingControl::ShadingControl(const ShadingMaterial& shadingMaterial)
bool test = this->setShadingType(type);
OS_ASSERT(test);

test = setMultipleSurfaceControlType("Sequential"); // E+ IDD Default
OS_ASSERT(test);

test = this->setPointer(OS_ShadingControlFields::ShadingDeviceMaterialName, shadingMaterial.handle());
OS_ASSERT(test);
}
Expand Down Expand Up @@ -517,6 +533,19 @@ void ShadingControl::resetSetpoint(){
getImpl<detail::ShadingControl_Impl>()->resetSetpoint();
}

std::string ShadingControl::multipleSurfaceControlType() const {
return getImpl<detail::ShadingControl_Impl>()->multipleSurfaceControlType();
}


bool ShadingControl::setMultipleSurfaceControlType(const std::string& multipleSurfaceControlType){
return getImpl<detail::ShadingControl_Impl>()->setMultipleSurfaceControlType(multipleSurfaceControlType);
}



// Extensible Fields

std::vector<SubSurface> ShadingControl::subSurfaces() const {
return getImpl<detail::ShadingControl_Impl>()->subSurfaces();
}
Expand Down
6 changes: 6 additions & 0 deletions src/model/ShadingControl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ class MODEL_API ShadingControl : public ResourceObject {

static std::vector<std::string> shadingControlTypeValues();

static multipleSurfaceControlTypeValues();

/** @name Getters */
//@{

Expand All @@ -94,6 +96,8 @@ class MODEL_API ShadingControl : public ResourceObject {

bool isSetpointDefaulted() const;

std::string multipleSurfaceControlType() const;

//@}
/** @name Setters */
//@{
Expand All @@ -115,6 +119,8 @@ class MODEL_API ShadingControl : public ResourceObject {

void resetSetpoint();

bool setMultipleSurfaceControlType(const std::string& multipleSurfaceControlType);

//@}
/** @name Other */
//@{
Expand Down
4 changes: 4 additions & 0 deletions src/model/ShadingControl_Impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ namespace detail {

bool isSetpointDefaulted() const;

std::string multipleSurfaceControlType() const;

//@}
/** @name Setters */
//@{
Expand All @@ -110,6 +112,8 @@ namespace detail {

void resetSetpoint();

bool setMultipleSurfaceControlType(const std::string& multipleSurfaceControlType);

//@}
/** @name Other */
//@{
Expand Down

0 comments on commit 55d0899

Please sign in to comment.