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

Method setSchedule

src/model/ModelObject.cpp:627–640  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

625 }
626
627 bool ModelObject_Impl::setSchedule(unsigned index, const std::string& className, const std::string& scheduleDisplayName, Schedule& schedule) {
628 if (schedule.model() != model()) {
629 return false;
630 }
631 bool result = checkOrAssignScheduleTypeLimits(className, scheduleDisplayName, schedule);
632 if (!result) {
633 if (boost::optional<ScheduleTypeLimits> scheduleTypeLimits = schedule.scheduleTypeLimits()) {
634 LOG(Warn, "For " << briefDescription() << " cannot set Schedule " << scheduleDisplayName << "=" << schedule.nameString()
635 << " because it has an incompatible ScheduleTypeLimits");
636 }
637 return result;
638 }
639 return setPointer(index, schedule.handle());
640 }
641
642 boost::optional<ModelObject> ModelObject_Impl::parentAsModelObject() const {
643 boost::optional<ModelObject> result;

Callers

nothing calls this directly

Calls 5

nameStringMethod · 0.80
modelMethod · 0.45
scheduleTypeLimitsMethod · 0.45
handleMethod · 0.45

Tested by

no test coverage detected