| 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; |
no test coverage detected