src/model/ModelExtensibleGroup.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*********************************************************************************************************************** | ||
| 2 | * OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC. | ||
| 3 | * See also https://openstudio.net/license | ||
| 4 | ***********************************************************************************************************************/ | ||
| 5 | |||
| 6 | #include "ModelExtensibleGroup.hpp" | ||
| 7 | #include "ModelObject_Impl.hpp" | ||
| 8 | |||
| 9 | #include "ScheduleTypeRegistry.hpp" | ||
| 10 | #include "Schedule.hpp" | ||
| 11 | #include "ScheduleTypeLimits.hpp" | ||
| 12 | |||
| 13 | #include "../utilities/core/Logger.hpp" | ||
| 14 | |||
| 15 | namespace openstudio { | ||
| 16 | namespace model { | ||
| 17 | |||
| 18 | 6 | bool ModelExtensibleGroup::setSchedule(unsigned index, const std::string& className, const std::string& scheduleDisplayName, Schedule& schedule) { | |
| 19 | 6 | bool result = checkOrAssignScheduleTypeLimits(className, scheduleDisplayName, schedule); | |
| 20 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 6 times.
|
6 | if (!result) { |
| 21 | ✗ | if (boost::optional<ScheduleTypeLimits> scheduleTypeLimits = schedule.scheduleTypeLimits()) { | |
| 22 | ✗ | LOG(Warn, "For object of type " << className << " cannot set Schedule " << scheduleDisplayName << "=" << schedule.nameString() | |
| 23 | << " because it has an incompatible ScheduleTypeLimits (" << scheduleTypeLimits->nameString() << ")"); | ||
| 24 | ✗ | } | |
| 25 | ✗ | return result; | |
| 26 | } | ||
| 27 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
6 | return setPointer(index, schedule.handle()); |
| 28 | } | ||
| 29 | |||
| 30 | // PROTECTED | ||
| 31 | |||
| 32 | /// @cond | ||
| 33 | 329893 | ModelExtensibleGroup::ModelExtensibleGroup(std::shared_ptr<detail::ModelObject_Impl> impl, unsigned index) | |
| 34 |
1/1✓ Branch 2 taken 329893 times.
|
329893 | : WorkspaceExtensibleGroup(impl, index) {} |
| 35 | /// @endcond | ||
| 36 | |||
| 37 | } // namespace model | ||
| 38 | } // namespace openstudio | ||
| 39 |