DPsim
SimSignalComp.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/Task.h>
12 #include <dpsim-models/TopologicalSignalComp.h>
13 
14 namespace CPS {
18 public:
19  enum Behaviour { Initialization, Simulation };
20 
21 protected:
24  Bool mBehaviour = Behaviour::Simulation;
25 
26 public:
27  typedef std::shared_ptr<SimSignalComp> Ptr;
28  typedef std::vector<Ptr> List;
29 
31  SimSignalComp(String uid, String name,
32  Logger::Level logLevel = Logger::Level::off)
33  : TopologicalSignalComp(uid, name, logLevel) {}
35  SimSignalComp(String name, Logger::Level logLevel = Logger::Level::off)
36  : SimSignalComp(name, name, logLevel) {}
38  virtual ~SimSignalComp() {}
39 
41  virtual void initialize(Real timeStep) {}
43  virtual void initialize(Real omega, Real timeStep) { initialize(timeStep); }
45  virtual Task::List getTasks() { return Task::List(); }
47  void setBehaviour(Behaviour behaviour) { mBehaviour = behaviour; }
48 };
49 } // namespace CPS
String uid()
Returns unique id.
void setBehaviour(Behaviour behaviour)
Set behavior of component, e.g. initialization.
Definition: SimSignalComp.h:47