Search in sources :

Example 1 with DayProfile

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

the class SetActivityCalendarRequestBuilder method getDayType.

private DayType getDayType(final int dayId) {
    final DayType dt = new DayType();
    final DayProfile dp = this.activityCalendar.getDayProfiles().get(dayId);
    dt.setDayId(BigInteger.valueOf(dp.getDayId()));
    dt.setDaySchedule(this.getDayProfileActionsType(dp.getDayProfileActions()));
    return dt;
}
Also used : DayType(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.DayType) DayProfile(org.opensmartgridplatform.cucumber.platform.smartmetering.support.ws.smartmetering.bundle.activitycalendar.DayProfile)

Example 2 with DayProfile

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

the class BundledSetActivityCalendarSteps method theActivityCalendarContainsADayProfile.

@Given("^the activity calendar contains a day profile$")
public void theActivityCalendarContainsADayProfile(final Map<String, String> parameters) throws Throwable {
    final ActivityCalendar activityCalendar = (ActivityCalendar) ScenarioContext.current().get(PlatformSmartmeteringKeys.ACTIVITY_CALENDAR);
    final int dayId = Integer.parseInt(parameters.get(PlatformSmartmeteringKeys.DAY_PROFILE_DAY_ID));
    final int actionCount = Integer.parseInt(parameters.get(PlatformSmartmeteringKeys.DAY_PROFILE_ACTION_COUNT));
    final DayProfile profile = new DayProfile(dayId);
    for (int i = 1; i <= actionCount; i++) {
        final String start = SettingsHelper.getStringValue(parameters, PlatformSmartmeteringKeys.DAY_PROFILE_START_TIME, i);
        final int selector = SettingsHelper.getIntegerValue(parameters, PlatformSmartmeteringKeys.DAY_PROFILE_SCRIPT_SELECTOR, i);
        profile.getDayProfileActions().add(new DayProfileAction(start, selector));
    }
    activityCalendar.getDayProfiles().put(dayId, profile);
    ScenarioContext.current().put(PlatformSmartmeteringKeys.ACTIVITY_CALENDAR, activityCalendar);
}
Also used : ActivityCalendar(org.opensmartgridplatform.cucumber.platform.smartmetering.support.ws.smartmetering.bundle.activitycalendar.ActivityCalendar) DayProfile(org.opensmartgridplatform.cucumber.platform.smartmetering.support.ws.smartmetering.bundle.activitycalendar.DayProfile) DayProfileAction(org.opensmartgridplatform.cucumber.platform.smartmetering.support.ws.smartmetering.bundle.activitycalendar.DayProfileAction) Given(io.cucumber.java.en.Given)

Aggregations

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