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

Method startDate

src/model/ScheduleRule.cpp:167–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165 }
166
167 boost::optional<openstudio::Date> ScheduleRule_Impl::startDate() const {
168 boost::optional<openstudio::Date> result;
169 boost::optional<std::string> dateSpecificationType = this->getString(OS_Schedule_RuleFields::DateSpecificationType, true);
170 OS_ASSERT(dateSpecificationType);
171 if (istringEqual("DateRange", *dateSpecificationType)) {
172 boost::optional<int> startMonth = this->getInt(OS_Schedule_RuleFields::StartMonth, true);
173 OS_ASSERT(startMonth);
174 boost::optional<int> startDay = this->getInt(OS_Schedule_RuleFields::StartDay, true);
175 OS_ASSERT(startDay);
176 YearDescription yd = this->model().getUniqueModelObject<model::YearDescription>();
177 result = yd.makeDate(MonthOfYear(*startMonth), *startDay);
178 }
179
180 return result;
181 }
182
183 boost::optional<openstudio::Date> ScheduleRule_Impl::endDate() const {
184 boost::optional<openstudio::Date> result;

Callers 2

containsDateMethod · 0.95
containsDatesMethod · 0.95

Calls 6

istringEqualFunction · 0.85
MonthOfYearClass · 0.70
getStringMethod · 0.45
getIntMethod · 0.45
modelMethod · 0.45
makeDateMethod · 0.45

Tested by

no test coverage detected