@Override public void serialize(SubjectInfoExtension extension, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { jsonGenerator.writeStartObject(); jsonGenerator.writeFieldName("countries"); jsonGenerator.writeStartArray(); for (Country country : extension.getCountries()) { jsonGenerator.writeString(country.name()); } jsonGenerator.writeEndArray(); jsonGenerator.writeFieldName("nominalVoltages"); jsonGenerator.writeStartArray(); for (double nominalVoltage : extension.getNominalVoltages()) { jsonGenerator.writeNumber(nominalVoltage); } jsonGenerator.writeEndArray(); jsonGenerator.writeEndObject(); }
private MLCell injectionCountriesAsMLChar(List<StochasticVariable> stochasticVariables) { int colsSize = stochasticVariables.size() * 2; MLCell injectionsCountries = new MLCell("nat_ID", new int[]{1, colsSize}); int i = 0; for (StochasticVariable injection : stochasticVariables) { injectionsCountries.set(new MLChar("", injection.getCountry().name()), 0, i); i++; injectionsCountries.set(new MLChar("", injection.getCountry().name()), 0, i); // twice, for P and Q i++; } return injectionsCountries; }
private EsgNode createNode(String busId, VoltageLevel vl, double v, double angle, boolean slackBus) { return createNode(busId, vl.getSubstation().getCountry().name(), vl.getNominalV(), v, angle, slackBus); }
if (countryListView != null) { for (int i : countryListView.getCheckModel().getCheckedIndices()) { countriesNode.add(countryListView.getCheckModel().getItem(i).name());
private static Consumer<? super LimitViolation> writeLinePreContingencyViolations(Network network, TableFormatter formatter, boolean writeName) { return violation -> { try { formatter.writeEmptyCell() .writeCell(writeName ? violation.getSubjectName() : violation.getSubjectId()) .writeCell(LimitViolationHelper.getVoltageLevelId(violation, network, writeName)) .writeCell(LimitViolationHelper.getCountry(violation, network).name()) .writeCell((int) LimitViolationHelper.getNominalVoltage(violation, network)) .writeCell(violation.getLimitType().name()) .writeCell(getViolationName(violation)) .writeCell(violation.getValue()) .writeCell(getViolationLimit(violation)) .writeCell(getAbsValueLimit(violation)) .writeCell(getViolationRate(violation)); } catch (IOException e) { throw new UncheckedIOException(e); } }; }
private static Consumer<? super LimitViolation> writeLineLimitsViolations(Network network, TableFormatter formatter, boolean writeName) { return violation -> { try { formatter.writeCell(writeName ? violation.getSubjectName() : violation.getSubjectId()) .writeCell(LimitViolationHelper.getVoltageLevelId(violation, network, writeName)) .writeCell(LimitViolationHelper.getCountry(violation, network).name()) .writeCell((int) LimitViolationHelper.getNominalVoltage(violation, network)) .writeCell(violation.getLimitType().name()) .writeCell(getViolationName(violation)) .writeCell(violation.getValue()) .writeCell(getViolationLimit(violation)) .writeCell(getAbsValueLimit(violation)) .writeCell(getViolationRate(violation)); } catch (IOException e) { throw new UncheckedIOException(e); } }; }
.writeCell(violation.getValue()) .writeCell(violation.getLimit()) .writeCell(LimitViolationHelper.getCountry(violation, basecase).name()) .writeCell(LimitViolationHelper.getNominalVoltage(violation, basecase)); if (violation.getSide() != null) {
private static Consumer<? super LimitViolation> writeLimitViolation(Network network, TableFormatter formatter, boolean writeName) { return violation -> { try { formatter.writeEmptyCell() .writeEmptyCell() .writeEmptyCell() .writeCell(writeName ? violation.getSubjectName() : violation.getSubjectId()) .writeCell(LimitViolationHelper.getVoltageLevelId(violation, network, writeName)) .writeCell(LimitViolationHelper.getCountry(violation, network).name()) .writeCell((int) LimitViolationHelper.getNominalVoltage(violation, network)) .writeCell(violation.getLimitType().name()) .writeCell(getViolationName(violation)) .writeCell(violation.getValue()) .writeCell(getViolationLimit(violation)) .writeCell(getAbsValueLimit(violation)) .writeCell(getViolationRate(violation)); } catch (IOException e) { throw new UncheckedIOException(e); } }; }
loads.setField("V", v, 0, i); MLChar country = new MLChar("", loadData.getCountry().name()); loads.setField("nation", country, 0, i);
generators.setField("dispacc", dispacc, 0, i); MLChar country = new MLChar("", generatorData.getCountry().name()); generators.setField("nation", country, 0, i);