| 65 | } |
| 66 | |
| 67 | openstudio::TimeSeries ScheduleFixedInterval_Impl::timeSeries() const { |
| 68 | int year = |
| 69 | 2009; // we need to pass assumed year in here, otherwise it uses YearDescription().assumedYear from Date.cpp which doesn't return the same assumed year (?) |
| 70 | if (boost::optional<YearDescription> yd = this->model().getOptionalUniqueModelObject<YearDescription>()) { |
| 71 | year = yd->assumedYear(); |
| 72 | } |
| 73 | |
| 74 | const Date startDate(openstudio::MonthOfYear(this->startMonth()), this->startDay(), year); |
| 75 | const Time intervalLength(0, 0, this->intervalLength()); |
| 76 | |
| 77 | Vector values(this->numExtensibleGroups()); |
| 78 | unsigned i = 0; |
| 79 | for (const ModelExtensibleGroup& group : castVector<ModelExtensibleGroup>(extensibleGroups())) { |
| 80 | OptionalDouble x = group.getDouble(0); |
| 81 | OS_ASSERT(x); |
| 82 | values[i] = *x; |
| 83 | ++i; |
| 84 | } |
| 85 | |
| 86 | TimeSeries result(startDate, intervalLength, values, ""); |
| 87 | result.setOutOfRangeValue(this->outOfRangeValue()); |
| 88 | |
| 89 | return result; |
| 90 | } |
| 91 | |
| 92 | bool ScheduleFixedInterval_Impl::setTimeSeries(const openstudio::TimeSeries& timeSeries) { |
| 93 | // check the interval |
nothing calls this directly
no test coverage detected