DPsim
Loading...
Searching...
No Matches
SignalGenerator.h
Go to the documentation of this file.
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
12
13namespace CPS {
14namespace Signal {
20public:
21 typedef std::shared_ptr<SignalGenerator> Ptr;
22 typedef std::vector<Ptr> List;
23
26
28 Logger::Level logLevel = Logger::Level::off);
29
30 SignalGenerator(String name, Logger::Level logLevel = Logger::Level::off)
31 : SignalGenerator(name, name, logLevel) {
32 SPDLOG_LOGGER_INFO(mSLog, "Create {} {}", type(), name);
33 }
34
36 virtual void step(Real time) = 0;
39};
40} // namespace Signal
41} // namespace CPS
AttributePointer< Attribute< T > > Ptr
Definition Attribute.h:250
String uid()
Returns unique id.
String type()
Get component type (cross-platform)
spdlog::level::level_enum Level
Definition Logger.h:33
std::shared_ptr< SignalGenerator > Ptr
Complex getSignal()
returns current signal value without updating it
SignalGenerator(String uid, String name, Logger::Level logLevel=Logger::Level::off)
const CPS::Attribute< Real >::Ptr mFreq
virtual void step(Real time)=0
updates current signal
SignalGenerator(String name, Logger::Level logLevel=Logger::Level::off)
const CPS::Attribute< Complex >::Ptr mSigOut
SimSignalComp(String uid, String name, Logger::Level logLevel=Logger::Level::off)
Logger::Log mSLog
Component logger.
std::string String
Definition Definitions.h:65
double Real
Definition Definitions.h:62
std::complex< Real > Complex
Definition Definitions.h:63