Search in sources :

Example 1 with WeekProfile

use of org.opensmartgridplatform.cucumber.platform.smartmetering.support.ws.smartmetering.bundle.activitycalendar.WeekProfile in project open-smart-grid-platform by OSGP.

the class SetActivityCalendarRequestBuilder method getWeekType.

private WeekType getWeekType(final String weekName) {
    final WeekType wt = new WeekType();
    final WeekProfile wp = this.activityCalendar.getWeekProfiles().get(weekName);
    wt.setWeekProfileName(wp.getName());
    wt.setMonday(this.getDayType(wp.getMondayDayId()));
    wt.setTuesday(this.getDayType(wp.getTuesdayDayId()));
    wt.setWednesday(this.getDayType(wp.getWednesdayDayId()));
    wt.setThursday(this.getDayType(wp.getThursdayDayId()));
    wt.setFriday(this.getDayType(wp.getFridayDayId()));
    wt.setSaturday(this.getDayType(wp.getSaturdayDayId()));
    wt.setSunday(this.getDayType(wp.getSundayDayId()));
    return wt;
}
Also used : WeekProfile(org.opensmartgridplatform.cucumber.platform.smartmetering.support.ws.smartmetering.bundle.activitycalendar.WeekProfile) WeekType(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.WeekType)

Example 2 with WeekProfile

use of org.opensmartgridplatform.cucumber.platform.smartmetering.support.ws.smartmetering.bundle.activitycalendar.WeekProfile in project open-smart-grid-platform by OSGP.

the class BundledSetActivityCalendarSteps method theActivityCalendarContainsAWeekProfile.

@Given("^the activity calendar contains a week profile$")
public void theActivityCalendarContainsAWeekProfile(final Map<String, String> parameters) throws Throwable {
    final ActivityCalendar activityCalendar = (ActivityCalendar) ScenarioContext.current().get(PlatformSmartmeteringKeys.ACTIVITY_CALENDAR);
    final String name = parameters.get(PlatformSmartmeteringKeys.WEEK_PROFILE_NAME);
    final int monday = Integer.parseInt(parameters.get(PlatformSmartmeteringKeys.WEEK_PROFILE_MONDAY_DAY_ID));
    final int tuesday = Integer.parseInt(parameters.get(PlatformSmartmeteringKeys.WEEK_PROFILE_TUESDAY_DAY_ID));
    final int wednesday = Integer.parseInt(parameters.get(PlatformSmartmeteringKeys.WEEK_PROFILE_WEDNESDAY_DAY_ID));
    final int thursday = Integer.parseInt(parameters.get(PlatformSmartmeteringKeys.WEEK_PROFILE_THURSDAY_DAY_ID));
    final int friday = Integer.parseInt(parameters.get(PlatformSmartmeteringKeys.WEEK_PROFILE_FRIDAY_DAY_ID));
    final int saturday = Integer.parseInt(parameters.get(PlatformSmartmeteringKeys.WEEK_PROFILE_SATURDAY_DAY_ID));
    final int sunday = Integer.parseInt(parameters.get(PlatformSmartmeteringKeys.WEEK_PROFILE_SUNDAY_DAY_ID));
    final WeekProfile profile = new WeekProfile(name, monday, tuesday, wednesday, thursday, friday, saturday, sunday);
    activityCalendar.getWeekProfiles().put(name, profile);
    ScenarioContext.current().put(PlatformSmartmeteringKeys.ACTIVITY_CALENDAR, activityCalendar);
}
Also used : WeekProfile(org.opensmartgridplatform.cucumber.platform.smartmetering.support.ws.smartmetering.bundle.activitycalendar.WeekProfile) ActivityCalendar(org.opensmartgridplatform.cucumber.platform.smartmetering.support.ws.smartmetering.bundle.activitycalendar.ActivityCalendar) Given(io.cucumber.java.en.Given)

Aggregations

WeekProfile (org.opensmartgridplatform.cucumber.platform.smartmetering.support.ws.smartmetering.bundle.activitycalendar.WeekProfile)2 Given (io.cucumber.java.en.Given)1 WeekType (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.WeekType)1 ActivityCalendar (org.opensmartgridplatform.cucumber.platform.smartmetering.support.ws.smartmetering.bundle.activitycalendar.ActivityCalendar)1