9 #include <dpsim-models/Signal/SineWaveGenerator.h>
14 Logger::Level logLevel)
16 mVoltageRef(mAttributes->createDynamic<Complex>(
"V_ref")) {
17 SPDLOG_LOGGER_INFO(
mSLog,
"Create {} {}",
type(), name);
22 **mVoltageRef = initialPhasor;
23 mMagnitude = mVoltageRef->deriveMag();
24 mPhase = mVoltageRef->derivePhase();
26 **mSigOut = initialPhasor;
28 SPDLOG_LOGGER_INFO(mSLog,
30 "Sine wave magnitude: {} [V] \n"
31 "Sine wave initial phase: {} [rad] \n"
32 "Sine wave frequency: {} [Hz] \n",
33 **mMagnitude, **mPhase, **mFreq);
37 **mSigOut = Complex(**mMagnitude * cos(time * 2. * PI * **mFreq + **mPhase),
38 **mMagnitude * sin(time * 2. * PI * **mFreq + **mPhase));
String type()
Get component type (cross-platform)
Model to generate generic signals.
void setParameters(Complex initialPhasor, Real frequency=0.0)
set the source's parameters
SineWaveGenerator(String name, Logger::Level logLevel=Logger::Level::off)
init the identified object
void step(Real time)
implementation of inherited method step to update and return the current signal value
Logger::Log mSLog
Component logger.