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

Method fromTimeSeries

src/model/ScheduleInterval.cpp:70–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68 } // namespace detail
69
70 boost::optional<ScheduleInterval> ScheduleInterval::fromTimeSeries(const openstudio::TimeSeries& timeSeries, Model& model) {
71 boost::optional<ScheduleInterval> result;
72 if (timeSeries.intervalLength()) {
73 result = ScheduleFixedInterval(model);
74 if (!result->setTimeSeries(timeSeries)) {
75 result->remove();
76 return {};
77 }
78 } else {
79 result = ScheduleVariableInterval(model);
80 if (!result->setTimeSeries(timeSeries)) {
81 result->remove();
82 return {};
83 }
84 }
85 return result;
86 }
87
88 openstudio::TimeSeries ScheduleInterval::timeSeries() const {
89 return getImpl<detail::ScheduleInterval_Impl>()->timeSeries();

Callers

nothing calls this directly

Calls 5

ScheduleFixedIntervalFunction · 0.70
ScheduleVariableIntervalFunction · 0.70
intervalLengthMethod · 0.45
setTimeSeriesMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected