コード例 #1
0
void SchedulesTabController::addSummerProfile(model::ScheduleRuleset & scheduleRuleset, UUID scheduleDayHandle)
{
  boost::optional<model::ScheduleDay> scheduleDay;
  if (!scheduleDayHandle.isNull()){
    boost::optional<model::ScheduleDay> scheduleDayToCopy = scheduleRuleset.model().getModelObject<model::ScheduleDay>(scheduleDayHandle);
    if (scheduleDayToCopy){
      scheduleDay = scheduleDayToCopy->clone().cast<model::ScheduleDay>();
    }
  }
  if (!scheduleDay){
    scheduleDay = model::ScheduleDay(scheduleRuleset.model());
    boost::optional<model::ScheduleTypeLimits> limits = scheduleRuleset.scheduleTypeLimits();
    if (limits) {
      scheduleDay->setScheduleTypeLimits(*limits);
    }
    scheduleDay->addValue(Time(1, 0), defaultStartingValue(*scheduleDay));
  }
  OS_ASSERT(scheduleDay);

  scheduleRuleset.setSummerDesignDaySchedule(*scheduleDay);

  scheduleDay->remove();

  m_schedulesView->showSummerScheduleDay(scheduleRuleset);
}
コード例 #2
0
void SchedulesTabController::addSummerProfile(model::ScheduleRuleset & scheduleRuleset)
{
  model::ScheduleDay scheduleDay(scheduleRuleset.model());

  scheduleDay.addValue(Time(1,0),defaultStartingValue(scheduleDay));

  scheduleRuleset.setSummerDesignDaySchedule(scheduleDay);

  scheduleDay.remove();

  m_schedulesView->showSummerScheduleDay(scheduleRuleset);
}