DPsim
Loading...
Searching...
No Matches
SineWaveGenerator.h
1/* Copyright 2017-2021 Institute for Automation of Complex Power Systems,
2 * EONERC, RWTH Aachen University
3 *
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
7 *********************************************************************************/
8
9#pragma once
10
11#include <dpsim-models/Signal/SignalGenerator.h>
12
13namespace CPS {
14namespace Signal {
19class SineWaveGenerator : public SignalGenerator,
20 public SharedFactory<SineWaveGenerator> {
21private:
23 Attribute<Real>::Ptr mPhase;
24 Attribute<Real>::Ptr mMagnitude;
25
26public:
27 const Attribute<Complex>::Ptr mVoltageRef;
29 SineWaveGenerator(String name, Logger::Level logLevel = Logger::Level::off);
31 void setParameters(Complex initialPhasor, Real frequency = 0.0);
33 void step(Real time);
34};
35} // namespace Signal
36} // namespace CPS
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