MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / getDefaultSchedule

Method getDefaultSchedule

src/model/SpaceType.cpp:166–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164 }
165
166 boost::optional<Schedule> SpaceType_Impl::getDefaultSchedule(const DefaultScheduleType& defaultScheduleType) const {
167 boost::optional<Schedule> result;
168 boost::optional<DefaultScheduleSet> defaultScheduleSet;
169 boost::optional<Building> building;
170 boost::optional<SpaceType> spaceType;
171
172 // first check this object
173 defaultScheduleSet = this->defaultScheduleSet();
174 if (defaultScheduleSet) {
175 result = defaultScheduleSet->getDefaultSchedule(defaultScheduleType);
176 if (result) {
177 return result;
178 }
179 }
180
181 // then check building
182 building = this->model().building();
183 if (building) {
184 defaultScheduleSet = building->defaultScheduleSet();
185 if (defaultScheduleSet) {
186 result = defaultScheduleSet->getDefaultSchedule(defaultScheduleType);
187 if (result) {
188 return result;
189 }
190 }
191
192 // then check building's space type
193 spaceType = building->spaceType();
194 if (spaceType) {
195 defaultScheduleSet = spaceType->defaultScheduleSet();
196 if (defaultScheduleSet) {
197 result = defaultScheduleSet->getDefaultSchedule(defaultScheduleType);
198 if (result) {
199 return result;
200 }
201 }
202 }
203 }
204
205 return boost::none;
206 }
207
208 bool SpaceType_Impl::setDefaultScheduleSet(const DefaultScheduleSet& defaultScheduleSet) {
209 return setPointer(OS_SpaceTypeFields::DefaultScheduleSetName, defaultScheduleSet.handle());

Callers

nothing calls this directly

Calls 4

defaultScheduleSetMethod · 0.95
buildingMethod · 0.45
modelMethod · 0.45
spaceTypeMethod · 0.45

Tested by

no test coverage detected