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

com.powsybl.python.dynamic.CurveMappingSupplier Maven / Gradle / Ivy

The newest version!
/**
 * Copyright (c) 2020-2023, 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/.
 * SPDX-License-Identifier: MPL-2.0
 */
package com.powsybl.python.dynamic;

import com.powsybl.commons.report.ReportNode;
import com.powsybl.dynamicsimulation.OutputVariable;
import com.powsybl.dynamicsimulation.OutputVariablesSupplier;
import com.powsybl.dynawo.outputvariables.DynawoOutputVariablesBuilder;
import com.powsybl.iidm.network.Network;

import java.util.Collection;
import java.util.LinkedList;
import java.util.List;

/**
 * @author Nicolas Pierre 
 */
public class CurveMappingSupplier implements OutputVariablesSupplier {

    private final List curves;

    public CurveMappingSupplier() {
        curves = new LinkedList<>();
    }

    public void addCurve(String dynamicId, String variable) {
        curves.addAll(new DynawoOutputVariablesBuilder().dynamicModelId(dynamicId).variable(variable).build());
    }

    public void addCurves(String dynamicId, Collection variablesCol) {
        for (String variable : variablesCol) {
            addCurve(dynamicId, variable);
        }
    }

    @Override
    public List get(Network network, ReportNode reportNode) {
        return get(network);
    }

    @Override
    public List get(Network network) {
        return curves;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy