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;
}
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);
}
Aggregations