All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.powsybl.cgmes.conversion.export.elements.EquivalentInjectionEq Maven / Gradle / Ivy

There is a newer version: 6.6.0
Show newest version
/**
 * Copyright (c) 2021, RTE (http://www.rte-france.com)
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */
package com.powsybl.cgmes.conversion.export.elements;

import com.powsybl.cgmes.conversion.export.CgmesExportContext;
import com.powsybl.cgmes.conversion.export.CgmesExportUtil;
import com.powsybl.cgmes.model.CgmesNames;

import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;

/**
 * @author Marcos de Miguel {@literal }
 */
public final class EquivalentInjectionEq {

    private static final String EQ_EQUIVALENTINJECTION_REGULATIONCAPABILITY = "EquivalentInjection.regulationCapability";
    private static final String EQ_EQUIVALENTINJECTION_MINP = "EquivalentInjection.minP";
    private static final String EQ_EQUIVALENTINJECTION_MAXP = "EquivalentInjection.maxP";
    private static final String EQ_EQUIVALENTINJECTION_MINQ = "EquivalentInjection.minQ";
    private static final String EQ_EQUIVALENTINJECTION_MAXQ = "EquivalentInjection.maxQ";

    public static void write(String id, String name, boolean regulationCapability, double minP, double maxP, double minQ, double maxQ,
                             String baseVoltageId, String cimNamespace, XMLStreamWriter writer, CgmesExportContext context) throws XMLStreamException {
        CgmesExportUtil.writeStartIdName(CgmesNames.EQUIVALENT_INJECTION, id, name, cimNamespace, writer, context);
        writer.writeStartElement(cimNamespace, EQ_EQUIVALENTINJECTION_REGULATIONCAPABILITY);
        writer.writeCharacters(CgmesExportUtil.format(regulationCapability));
        writer.writeEndElement();
        writer.writeStartElement(cimNamespace, EQ_EQUIVALENTINJECTION_MINP);
        writer.writeCharacters(CgmesExportUtil.format(minP));
        writer.writeEndElement();
        writer.writeStartElement(cimNamespace, EQ_EQUIVALENTINJECTION_MAXP);
        writer.writeCharacters(CgmesExportUtil.format(maxP));
        writer.writeEndElement();
        writer.writeStartElement(cimNamespace, EQ_EQUIVALENTINJECTION_MINQ);
        writer.writeCharacters(CgmesExportUtil.format(minQ));
        writer.writeEndElement();
        writer.writeStartElement(cimNamespace, EQ_EQUIVALENTINJECTION_MAXQ);
        writer.writeCharacters(CgmesExportUtil.format(maxQ));
        writer.writeEndElement();
        CgmesExportUtil.writeReference("ConductingEquipment.BaseVoltage", baseVoltageId, cimNamespace, writer, context);
        writer.writeEndElement();
    }

    private EquivalentInjectionEq() {
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy