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

com.powsybl.metrix.mapping.EquipmentGroupTimeSeriesWriterObserver Maven / Gradle / Ivy

There is a newer version: 2.6.0
Show newest version
/*
 * Copyright (c) 2020, 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.metrix.mapping;

import com.google.common.collect.Range;
import com.powsybl.iidm.network.Network;
import com.powsybl.timeseries.TimeSeriesIndex;

import java.nio.file.Path;
import java.util.Map;

/**
 * @author Marianne Funfrock {@literal }
 */
public class EquipmentGroupTimeSeriesWriterObserver extends EquipmentGroupTimeSeriesMapperObserver {

    private static final String OUTPUT_FILE_NAME = "group_version_";

    private final EquipmentTimeSeriesWriter equipmentTimeSeriesWriter;

    public EquipmentGroupTimeSeriesWriterObserver(Network network, TimeSeriesMappingConfig mappingConfig, int chunkSize, Range pointRange, Path dir) {
        super(network, mappingConfig, chunkSize, pointRange);
        this.equipmentTimeSeriesWriter = new EquipmentTimeSeriesWriter(dir, OUTPUT_FILE_NAME);
    }

    @Override
    public void addTimeSeries(String timeSeriesName, int version, Range pointRange, double[] values, Map tags, TimeSeriesIndex index) {
        equipmentTimeSeriesWriter.addTimeSeries(timeSeriesName, pointRange, values, index);
    }

    @Override
    public void versionEnd(int version) {
        equipmentTimeSeriesWriter.versionEnd(version);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy