15 #include <dpsim-models/Attribute.h>
16 #include <dpsim-models/Filesystem.h>
17 #include <dpsim-models/PtrFactory.h>
18 #include <dpsim-models/SimNode.h>
19 #include <dpsim-models/Task.h>
20 #include <dpsim/Definitions.h>
21 #include <dpsim/Scheduler.h>
28 std::ofstream mLogFile;
34 std::map<String, CPS::AttributeBase::Ptr> mAttributes;
36 void logDataLine(Real time, Real data);
37 void logDataLine(Real time,
const Matrix &data);
38 void logDataLine(Real time,
const MatrixComp &data);
41 typedef std::shared_ptr<DataLogger> Ptr;
42 typedef std::vector<DataLogger::Ptr> List;
45 DataLogger(String name, Bool enabled =
true, UInt downsampling = 1);
54 void logPhasorNodeValues(Real time,
const Matrix &data, Int freqNum = 1);
55 void logEMTNodeValues(Real time,
const Matrix &data);
57 void setColumnNames(std::vector<String> names);
60 UInt rowsMax = 0, UInt colsMax = 0);
63 void logAttribute(
const std::vector<String> &name,
66 void log(Real time, Int timeStepCount);
68 CPS::Task::Ptr getTask();
72 Step(
DataLogger &logger) : Task(logger.mName +
".Write"), mLogger(logger) {
73 for (
auto attr : logger.mAttributes) {
74 mAttributeDependencies.push_back(attr.second);
76 mModifiedAttributes.push_back(Scheduler::external);
79 void execute(Real time, Int timeStepCount);
Tasks to be defined by every component.