18 #include <dpsim-models/DP/DP_Ph1_AvVoltageSourceInverterDQ.h>
19 #include <dpsim-models/DP/DP_Ph1_PQLoadCS.h>
20 #include <dpsim-models/Filesystem.h>
21 #include <dpsim-models/Logger.h>
22 #include <dpsim-models/SP/SP_Ph1_AvVoltageSourceInverterDQ.h>
23 #include <dpsim-models/SP/SP_Ph1_Load.h>
24 #include <dpsim-models/SystemTopology.h>
35 std::list<fs::path> mFileList;
37 std::map<String, String> mAssignPattern;
39 Bool mSkipFirstRow =
true;
44 enum class Mode { AUTO, MANUAL };
52 enum class DataFormat { HHMMSS, SECONDS, HOURS, MINUTES };
55 CSVReader(String name, std::list<fs::path> path, Logger::Level logLevel);
57 CSVReader(String name, String path, Logger::Level logLevel);
59 CSVReader(String name, std::list<fs::path> path,
60 std::map<String, String> &assignList, Logger::Level logLevel);
62 CSVReader(String name, String path, std::map<String, String> &assignList,
63 Logger::Level logLevel);
71 MatrixRow csv2Eigen(
const String &path);
73 std::vector<PQData> readLoadProfileDP(
74 fs::path file, Real start_time = -1, Real time_step = 1,
75 Real end_time = -1, Real scale_factor = 1,
76 CSVReader::DataFormat format = CSVReader::DataFormat::SECONDS);
88 void assignLoadProfileDP(
89 std::vector<std::shared_ptr<CPS::DP::Ph1::AvVoltageSourceInverterDQ>>
91 Real start_time = -1, Real time_step = 1, Real end_time = -1,
93 CSVReader::DataFormat format = CSVReader::DataFormat::SECONDS);
98 fs::path file, Real start_time = -1, Real time_step = 1,
100 CSVReader::DataFormat format = CSVReader::DataFormat::SECONDS);
103 readPQData(fs::path file, Real start_time = -1, Real time_step = 1,
105 CSVReader::DataFormat format = CSVReader::DataFormat::SECONDS);
110 CSVReader::DataFormat format = CSVReader::DataFormat::SECONDS);
112 void assignPVGeneration(
SystemTopology &sys, Real start_time = -1,
113 Real time_step = 1, Real end_time = -1,
127 String
const &get(std::size_t index)
const {
return m_data[index]; }
131 void readNextRow(std::istream &str);
135 std::vector<String> m_data;
146 CSVRow const &operator*()
const {
return m_row; };
148 return ((
this == &rhs) || ((this->m_str == NULL) && (rhs.m_str == NULL)));
reads load profiles (csv files only) and assign them to the corresponding load object
PowerProfile readLoadProfile(fs::path file, Real start_time=-1, Real time_step=1, Real end_time=-1, CSVReader::DataFormat format=CSVReader::DataFormat::SECONDS)
PQData interpol_linear(std::map< Real, PQData > &data_PQ, Real x)
interpolation for PQ data points
void doSkipFirstRow(Bool value=true)
Skip first row if it has no digits at beginning.
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
Real interpol_linear(std::map< Real, Real > &data_wf, Real x)
interpolation for weighting factor data points
Real time_format_convert(const String &time)