DPsim
SP_Ph1_PQNode.cpp
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 #include <dpsim-models/SP/SP_Ph1_PQNode.h>
10 
11 using namespace CPS;
12 
13 SP::Ph1::PQNode::PQNode(String uid, String name, Logger::Level logLevel)
14  : SimPowerComp<Complex>(uid, name, logLevel),
15  mPower(mAttributes->create<Real>("P")),
16  mReactivePower(mAttributes->create<Real>("Q")),
17  mPowerNom(mAttributes->create<Real>("P_nom")),
18  mReactivePowerNom(mAttributes->create<Real>("Q_nom")) {}
19 
20 SP::Ph1::PQNode::PQNode(String uid, String name, Real power,
21  Real reactive_power, Logger::Level logLevel)
22  : PQNode(uid, name, logLevel) {
23 
24  **mPower = power;
25  **mPowerNom = power;
26  **mReactivePower = reactive_power;
27  **mReactivePowerNom = reactive_power;
28 
29  SPDLOG_LOGGER_INFO(mSLog, "Create PQ node for {} P={}, Q={}", name,
30  **mPowerNom, **mReactivePowerNom);
31 }
Base class for all components that are transmitting power.
Definition: SimPowerComp.h:17