DPsim
Public Types | Public Member Functions | List of all members
CPS::CSVReader Class Reference

reads load profiles (csv files only) and assign them to the corresponding load object More...

#include <CSVReader.h>

Public Types

enum class  Mode { AUTO , MANUAL }
 
enum class  DataFormat { HHMMSS , SECONDS , HOURS , MINUTES }
 

Public Member Functions

 CSVReader (String name, std::list< fs::path > path, Logger::Level logLevel)
 
 CSVReader (String name, String path, Logger::Level logLevel)
 
 CSVReader (String name, std::list< fs::path > path, std::map< String, String > &assignList, Logger::Level logLevel)
 
 CSVReader (String name, String path, std::map< String, String > &assignList, Logger::Level logLevel)
 
Real time_format_convert (const String &time)
 
void doSkipFirstRow (Bool value=true)
 Skip first row if it has no digits at beginning.
 
MatrixRow csv2Eigen (const String &path)
 
std::vector< PQDatareadLoadProfileDP (fs::path file, Real start_time=-1, Real time_step=1, Real end_time=-1, Real scale_factor=1, CSVReader::DataFormat format=CSVReader::DataFormat::SECONDS)
 
void assignLoadProfileDP (std::vector< std::shared_ptr< CPS::DP::Ph1::AvVoltageSourceInverterDQ >> &loads, Real start_time=-1, Real time_step=1, Real end_time=-1, Real scale_factor=1, CSVReader::Mode mode=CSVReader::Mode::AUTO, CSVReader::DataFormat format=CSVReader::DataFormat::SECONDS)
 
PowerProfile readLoadProfile (fs::path file, Real start_time=-1, Real time_step=1, Real end_time=-1, CSVReader::DataFormat format=CSVReader::DataFormat::SECONDS)
 
std::vector< Real > readPQData (fs::path file, Real start_time=-1, Real time_step=1, Real end_time=-1, CSVReader::DataFormat format=CSVReader::DataFormat::SECONDS)
 
void assignLoadProfile (SystemTopology &sys, Real start_time=-1, Real time_step=1, Real end_time=-1, CSVReader::Mode mode=CSVReader::Mode::AUTO, CSVReader::DataFormat format=CSVReader::DataFormat::SECONDS)
 assign load profile to corresponding load object More...
 
void assignPVGeneration (SystemTopology &sys, Real start_time=-1, Real time_step=1, Real end_time=-1, CSVReader::Mode mode=CSVReader::Mode::AUTO)
 
PQData interpol_linear (std::map< Real, PQData > &data_PQ, Real x)
 interpolation for PQ data points
 
Real interpol_linear (std::map< Real, Real > &data_wf, Real x)
 interpolation for weighting factor data points
 

Detailed Description

reads load profiles (csv files only) and assign them to the corresponding load object

Definition at line 28 of file CSVReader.h.

Member Enumeration Documentation

◆ Mode

enum CPS::CSVReader::Mode
strong

set load profile assigning pattern. AUTO for assigning load profile name (csv file name) to load object with the same name (mName) MANUAL for providing an assign pattern manually. see power flow example: CIM/CIGRE_MV_PowerFlowTest_LoadProfiles.cpp

Definition at line 44 of file CSVReader.h.

Member Function Documentation

◆ assignLoadProfile()

void CSVReader::assignLoadProfile ( CPS::SystemTopology sys,
Real  start_time = -1,
Real  time_step = 1,
Real  end_time = -1,
CSVReader::Mode  mode = CSVReader::Mode::AUTO,
CSVReader::DataFormat  format = CSVReader::DataFormat::SECONDS 
)

assign load profile to corresponding load object

changing file name and load name to upper case for later matching

strip off all non-alphanumeric characters

Definition at line 479 of file CSVReader.cpp.

◆ readLoadProfile()

PowerProfile CSVReader::readLoadProfile ( fs::path  file,
Real  start_time = -1,
Real  time_step = 1,
Real  end_time = -1,
CSVReader::DataFormat  format = CSVReader::DataFormat::SECONDS 
)

TODO : deprecate in the future read in load profile with time stamp format specified

Definition at line 360 of file CSVReader.cpp.

◆ time_format_convert()

CPS::Real CSVReader::time_format_convert ( const String &  time)

convert HH:MM:SS format timestamp into total seconds. e.g.: 00 : 01 : 00 – > 60.

Definition at line 124 of file CSVReader.cpp.


The documentation for this class was generated from the following files: