Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revamp the attribute system #62

Merged
merged 219 commits into from
Apr 25, 2022
Merged
Show file tree
Hide file tree
Changes from 211 commits
Commits
Show all changes
219 commits
Select commit Hold shift + click to select a range
023842f
return attribute ptr from creation function
JTS22 Dec 20, 2021
53b2a5a
exclude examples from build
JTS22 Dec 20, 2021
a4a5ff3
exclude realtime examples
JTS22 Dec 20, 2021
90c0ac4
overload dereference operator for attributes
JTS22 Dec 20, 2021
4dca132
remove owner flag by managing a shared ptr instead
JTS22 Dec 20, 2021
802cd04
remove old python interface
JTS22 Dec 20, 2021
b93697d
remove duplicate time_step attribute
JTS22 Dec 21, 2021
7a6d586
simplify attribute class
JTS22 Dec 21, 2021
759b003
experimental: change attribute data model
JTS22 Dec 22, 2021
53c14ec
create minimal skeleton for attribute class
JTS22 Dec 28, 2021
86b32ba
add AttributeUpdateTask
JTS22 Dec 28, 2021
ef76e26
introduce base class for UpdateTasks
JTS22 Dec 28, 2021
770b353
introduce AttributeStatic
JTS22 Dec 28, 2021
4c1a53f
add AttributeDynamic class
JTS22 Dec 28, 2021
f6c2630
add derive member functions
JTS22 Dec 28, 2021
3a06bdb
use C++ 20
JTS22 Dec 28, 2021
8c3de86
fix various compiler errors
JTS22 Dec 28, 2021
ad3f408
allow constructing dynamic and static attributes
JTS22 Dec 28, 2021
99eab2d
add more derive functions
JTS22 Dec 28, 2021
65a121b
add coeff derive function
JTS22 Jan 2, 2022
0d88800
add setReference function for dynamic attributes
JTS22 Jan 2, 2022
1238598
update IdentifiedObject and SimPowerComp
JTS22 Jan 2, 2022
9b5fe9c
use references to data pointers
JTS22 Jan 6, 2022
c568aa7
remove old setAttributeRef methods
JTS22 Jan 6, 2022
ef76d18
rename addAttribute to logAttribute for DataLogger
JTS22 Jan 7, 2022
6127dc8
update logger call in Simulation
JTS22 Jan 7, 2022
81715c1
remove flags and make get always mutable
JTS22 Jan 18, 2022
9005a20
allow attribute construction in initializer list
JTS22 Jan 18, 2022
f26e517
update IdentifiedObject and SimPowerComp
JTS22 Jan 18, 2022
8f5d19a
correct SimPowerComp.h
JTS22 Jan 18, 2022
fafb245
add default attribute values
JTS22 Jan 18, 2022
acf1ce9
split attribute create function by dynamic and static
JTS22 Jan 18, 2022
d35b96b
use call by reference for attribute map
JTS22 Jan 18, 2022
19b6a4e
make get reference mutable
JTS22 Jan 18, 2022
4c253af
mark IdentifiedObject::mName as attribute
JTS22 Jan 20, 2022
9a5256e
mark IdentifiedObject::mUid as attribute
JTS22 Jan 20, 2022
ae72aff
use correct attribute names
JTS22 Jan 20, 2022
1c3f2e5
mark TopologicalComponent::mIntfVoltage as attribute
JTS22 Jan 20, 2022
0a660e8
mark TopologicalComponent::mIntfCurrent as attribute
JTS22 Jan 20, 2022
a9b9979
insert extra bracket pair for attribute matrix accesses
JTS22 Jan 20, 2022
e6d6d78
remove initial value for dynamic attributes
JTS22 Jan 20, 2022
cfe5bb2
mark MNAInterface::mRightVector as attribute
JTS22 Jan 21, 2022
95cdd1d
mark SimNode::mVoltage as attribute
JTS22 Jan 21, 2022
39f9b41
mark TopologicalNode::mInitialVoltage as attribute
JTS22 Jan 21, 2022
2971c08
define Simulation attributes
JTS22 Jan 21, 2022
81ea40d
mark Simulation::mName as attribute
JTS22 Jan 21, 2022
8ab2064
make Simulation attributes public
JTS22 Jan 26, 2022
8fc19f6
mark Simulation::mFinalTime as attribute
JTS22 Jan 26, 2022
3f65040
mark Simulation::mTimeStep as attribute
JTS22 Jan 26, 2022
b081f92
mark Simulation::mSteadyStateInit as attribute
JTS22 Jan 26, 2022
45fd5ee
mark Simulation::mSplitSubnets as attribute
JTS22 Jan 26, 2022
ec7e979
remove unused overruns attribute
JTS22 Jan 26, 2022
0dd722d
mark MNASolver::mLeftSideVector and MNASolver::mLeftSideVectorHarm as…
JTS22 Jan 26, 2022
4e4d65f
correct mUID attribute name
JTS22 Jan 26, 2022
936f300
mark DiakopticsSolver::{mMappedTearCurrents, mOrigLeftSideVector} as …
JTS22 Jan 26, 2022
a95e45c
specify attribute map in constructor
JTS22 Jan 26, 2022
295371c
mark ODEInterface::{mOdePreState, mOdePostState} as attributes
JTS22 Jan 26, 2022
12abf11
mark Ph1_Capacitor::mCapacitance as attribute
JTS22 Feb 1, 2022
0c15889
mark Ph1_Inductor::mInductance as attribute
JTS22 Feb 1, 2022
ec60c43
make inductance attribute public
JTS22 Feb 1, 2022
0643a3a
mark Ph1_Resistor::mResistance as attribute
JTS22 Feb 1, 2022
fbbf274
mark Ph3_Inductor::mInductance as attribute
JTS22 Feb 1, 2022
a40aa43
mark Ph3_Resistor::mResistance as attribute
JTS22 Feb 1, 2022
b7a59d1
mark Ph3_Capacitor::mCapacitance as attribute
JTS22 Feb 1, 2022
b7850ab
mark {DP, EMT}::Ph1::CurrentSource::{mCurrentRef, mSrcFreq} as attrib…
JTS22 Feb 1, 2022
95df1aa
mark DP::Ph1::VoltageSource::{mVoltageRef, mSrcFrequency} as attributes
JTS22 Feb 1, 2022
5dedc60
mark EMT::Ph1::VoltageSource::{mVoltageRef, mSrcFreq} as attributes
JTS22 Feb 1, 2022
e5a9792
mark EMT::Ph3::VoltageSource::{mVoltageRef, mSrcFreq, mSigOut} as att…
JTS22 Feb 1, 2022
8c8dce0
mark DP::Ph3::VoltageSource::mVoltageRef as attribute
JTS22 Feb 2, 2022
c2e7812
mark SP::Ph3::VoltageSource::mVoltageRef as attribute
JTS22 Feb 2, 2022
05cfc50
mark EMT::Ph3::CurrentSource::{mVoltageRef, mSrcFreq, mSigOut} as att…
JTS22 Feb 2, 2022
90c320d
mark SP::Ph1::VoltageSource::{mVoltageRef, mSrcFreq} as attributes
JTS22 Feb 2, 2022
4823780
mark SignalGenerator::{mSigOut, mFreq} as attributes
JTS22 Feb 2, 2022
6d6976a
make SimPowerComp::{mIntfVoltage, mIntfCurrent} public
JTS22 Feb 2, 2022
e8be74b
mark {DP, SP}::Ph1::NetworkInjection::{mVoltageRef,mSrcFreq} as attri…
JTS22 Feb 2, 2022
49f4b5c
mark EMT::Ph3::NetworkInjection::{mVoltageRef, mSrcFreq, mSigOut} as …
JTS22 Feb 2, 2022
1f8e8c4
mark Base::{Ph1,Ph3}::Switch::{mOpenResistance,mClosedResistance,mIsC…
JTS22 Feb 2, 2022
19f803c
update SeriesResistor classes
JTS22 Feb 2, 2022
a3d9ec9
mark Base::Ph1::VoltageSource::{mVoltageRef,mSrcFrequency} as attributes
JTS22 Feb 2, 2022
e473b0b
add FIXME, CHECK and DEPRECATED comments
JTS22 Feb 4, 2022
ec36af0
update attributes for DP::Ph1::AvVoltageSourceInverterDQ
JTS22 Feb 4, 2022
d208a87
update attributes for DP::Ph1::PiLine
JTS22 Feb 4, 2022
8d380be
update attributes for DP::Ph1::PQLoadCS
JTS22 Feb 7, 2022
cf1c667
update attributes for DP::Ph1::ResIndSeries
JTS22 Feb 7, 2022
fd9dae5
update attributes for DP::Ph1::RxLine
JTS22 Feb 7, 2022
ebb1a37
update attributes for DP::Ph1::RXLoad
JTS22 Feb 7, 2022
e5ece28
update attributes for DP::Ph1::SVC
JTS22 Feb 7, 2022
6401c15
update attributes for DP::Ph1::SynchronGeneratorIdeal
JTS22 Feb 7, 2022
ce52877
update attributes for DP::Ph1::SynchronGeneratorTrStab
JTS22 Feb 7, 2022
00be05a
update attributes for DP::Ph1::Transformer
JTS22 Feb 7, 2022
6d384f9
update attributes for DP::Ph1::VoltageSourceRamp
JTS22 Feb 7, 2022
83a6715
update attributes for DP::Ph3::SynchronGeneratorDQ
JTS22 Feb 7, 2022
45e72e5
update attributes for EMT::Ph1::VoltageSourceRamp
JTS22 Feb 7, 2022
cb0f08f
update attributes for EMT::Ph3::AvVoltageSourceInverterDQ
JTS22 Feb 7, 2022
0783104
update attributes for EMT::Ph3::AvVoltSourceInverterStateSpace
JTS22 Feb 7, 2022
3fa5ee4
update attributes for EMT::Ph3::PiLine
JTS22 Feb 7, 2022
63c1430
update attributes for EMT::Ph3::RxLine
JTS22 Feb 7, 2022
ad4045b
update attributes for EMT::Ph3::RXLoad
JTS22 Feb 7, 2022
3fe0cd4
update attributes for EMT::Ph3::SynchronGeneratorDQ
JTS22 Feb 7, 2022
f95061d
mark EMT::Ph3::SynchronGeneratorDQ attributes in subclasses
JTS22 Feb 7, 2022
a9fe239
update attributes for EMT::Ph3::SynchronGeneratorIdeal
JTS22 Feb 8, 2022
b6f643c
mark attributes for DP::Ph1::SynchronGeneratorTrStab
JTS22 Feb 8, 2022
24cc264
update attributes for EMT::Ph3::SynchronGeneratorTrStab
JTS22 Feb 8, 2022
86cf306
update attributes for EMT::Ph3::SynchronGeneratorVBR
JTS22 Feb 8, 2022
078ca33
update attributes for EMT::Ph3::Transformer
JTS22 Feb 8, 2022
c58ba9f
update attributes for SP::Ph1::AvVoltageSourceInverterDQ
JTS22 Feb 8, 2022
c2d51de
update attributes for SP::Ph1::Load
JTS22 Feb 8, 2022
135200b
update attributes for SP::Ph1::NetworkInjection
JTS22 Feb 9, 2022
b4208af
remove incorrect FIXMEs
JTS22 Feb 9, 2022
d1a82e0
update attributes for SP::Ph1::PiLine
JTS22 Feb 9, 2022
3ad6f43
update attributes for SP::Ph1::PQNode
JTS22 Feb 9, 2022
466eed8
update attributes for SP::Ph1::PVNode
JTS22 Feb 9, 2022
ea414ce
update attributes for SP::Ph1::VDNode
JTS22 Feb 9, 2022
24e6160
update attributes for SP::Ph1::RXLine
JTS22 Feb 9, 2022
d1f4676
update attributes for SP::Ph1::Shunt
JTS22 Feb 9, 2022
5d4531a
update attributes for SP::Ph1::SolidStateTransformer
JTS22 Feb 9, 2022
0b560d1
update attributes for SP::Ph1::SynchronGenerator
JTS22 Feb 9, 2022
f81361b
update attributes for SP::Ph1::SynchronGeneratorTrStab
JTS22 Feb 9, 2022
56779a0
update attributes for SP::Ph1::Transformer
JTS22 Feb 9, 2022
0608cb4
mark attributes in Base::SynchronGenerator
JTS22 Feb 9, 2022
1d671c3
add missing parenthesis
JTS22 Feb 9, 2022
cc0246a
update attributes for Signal::DecouplingLine
JTS22 Feb 13, 2022
1261fe4
update attributes for Signal::DecouplingLineEMT
JTS22 Feb 13, 2022
d6d7a0e
update attributes for Signal::FIRFilter
JTS22 Feb 13, 2022
87db077
update attributes for Signal::Integrator
JTS22 Feb 13, 2022
9b664f4
update attributes for Signal::PLL
JTS22 Feb 13, 2022
a99cc89
update attributes for Signal::PowerControllerVSI
JTS22 Feb 13, 2022
b4cd414
make InputRef attributes const
JTS22 Feb 13, 2022
9d3c3f2
mark Base::Transformer::{mRatedPower, mNominalVoltageEnd{1,2}} as att…
JTS22 Feb 13, 2022
834b779
initialize required attributes in sub-classes of Base::SynchronGenerator
JTS22 Feb 13, 2022
90c9e43
mark calls to non-existing parent classes
JTS22 Feb 13, 2022
473be18
use new attribute syntax
JTS22 Feb 13, 2022
e4f09c5
fix compilation errors in Attribute
JTS22 Feb 13, 2022
9389876
deprecate reset methods
JTS22 Feb 13, 2022
6c42142
use attribute member variables for accessing PLL states
JTS22 Feb 13, 2022
0a6fc0e
make right_vector dynamic (for now)
JTS22 Feb 13, 2022
41fe12d
import AttributeList in relevant base classes
JTS22 Feb 13, 2022
490c5c7
more fixes to SynchronGenerator attributes
JTS22 Feb 13, 2022
3ca997d
use more general toString method
JTS22 Feb 13, 2022
2a46aa7
fix small syntax errors
JTS22 Feb 13, 2022
6efc2a7
initialize members in correct order
JTS22 Feb 13, 2022
2e40572
fix various compiler errors
JTS22 Feb 13, 2022
50fe754
fix attribute use in solvers
JTS22 Feb 13, 2022
77abf8a
unify DataLogger::logAttribute methods
JTS22 Feb 16, 2022
04ec119
move isStatic method to AttributeBase
JTS22 Feb 24, 2022
3054678
rework attribute import and export methods
JTS22 Feb 24, 2022
2cb3ffa
specify CPS namespace
JTS22 Feb 24, 2022
5e51fd4
fix initialization order
JTS22 Feb 24, 2022
41c3393
add getDependencies function to dynamic attributes
JTS22 Feb 24, 2022
05316ba
use new dependency funciton in scheduler
JTS22 Feb 24, 2022
b4cc0b4
get dependencies from getter tasks
JTS22 Feb 24, 2022
3ae7566
remove obsolete toString declarations
JTS22 Feb 24, 2022
1ba890e
remove old method bindings
JTS22 Feb 24, 2022
cea8e6f
fix some clang errors
JTS22 Feb 28, 2022
907cbd6
use new attribute system for recent SynGen changes
JTS22 Feb 28, 2022
897087b
remove (nonexistant) submodules
JTS22 Feb 28, 2022
3e77ba4
use updated dpsim-villas version
JTS22 Feb 28, 2022
8bfbe69
add attributes to the python interface
JTS22 Feb 28, 2022
877e9d2
use dynamic_cast for attributes
JTS22 Feb 28, 2022
05edb38
introduce compatibility method for logging from python
JTS22 Feb 28, 2022
e7d3e6a
create mLeftSideVector attributes before their first use
JTS22 Feb 28, 2022
7c21180
use pointers for AttributeUpdateTasks
JTS22 Feb 28, 2022
a617534
check for the "external" (nullptr) attribute
JTS22 Feb 28, 2022
de11173
fix left vector attribute access
JTS22 Mar 1, 2022
bc5b372
add attribute dependencies recursively
JTS22 Mar 1, 2022
5c44b80
modify issue comment severity
JTS22 Mar 1, 2022
305657b
remove concepts to use cpp17
JTS22 Mar 9, 2022
e3b8b76
fix / mark some clang errors
JTS22 Mar 9, 2022
c7a6323
increase cppcheck std
JTS22 Mar 9, 2022
a395161
correct index expression
JTS22 Mar 9, 2022
84abf95
correct base_Voltage attribute name
JTS22 Mar 11, 2022
e75fee1
set mVoltageRef to dynamic
JTS22 Mar 11, 2022
6c4a819
set mSrcFreq to dynamic
JTS22 Mar 11, 2022
f607470
mark attributes in logger calls
JTS22 Mar 11, 2022
7e48317
re-enable examples
JTS22 Mar 11, 2022
cddb08b
replace old attribute getters
JTS22 Mar 11, 2022
77a57f2
add logger compatiblity method
JTS22 Mar 11, 2022
7fc5310
use new method name
JTS22 Mar 11, 2022
d6c4566
mark attributes in matrix initialization
JTS22 Mar 11, 2022
20f0368
add logger compatibility method for python
JTS22 Mar 12, 2022
20640c6
fix some syngen attributes
JTS22 Mar 12, 2022
314a25a
Simplify SineWaveGenerator
JTS22 Mar 14, 2022
84e286c
fix more attribute markings
JTS22 Mar 14, 2022
c3f4bb6
add more missing stars
JTS22 Mar 14, 2022
68823e4
restructure Attribute::toString methods
JTS22 Mar 14, 2022
6cd4938
expand logger method to include max rows/columns
JTS22 Mar 14, 2022
74e2085
add missing generator attributes
JTS22 Mar 14, 2022
c188e4b
mark attributes in logger calls
JTS22 Mar 15, 2022
579b855
fix name and uid initializers
JTS22 Mar 15, 2022
46f3a2c
add vnom attribute required by PFSolver
JTS22 Mar 15, 2022
ca4e488
rewrite attribute dependency algorithm
JTS22 Mar 16, 2022
bc69c89
mark capacitance attribute
JTS22 Mar 16, 2022
2de29da
mark all attributes in the new VBR SynGen models
JTS22 Mar 20, 2022
d23ee52
change logger method name
JTS22 Mar 20, 2022
fe03e38
re-enable all examples
JTS22 Mar 20, 2022
5fcd6e4
initialize Transformer base attributes
JTS22 Mar 20, 2022
9de86c3
mark mIdq and mVdq as attributes
JTS22 Mar 21, 2022
c97d107
correct variable name
JTS22 Mar 21, 2022
530bf34
replace special Eigen Matrix type
JTS22 Mar 23, 2022
72cabbb
initialize new matrix attributes
JTS22 Mar 23, 2022
eb5cc17
rename validation notebook
JTS22 Mar 30, 2022
ccb22ea
mark mNomVoltage attribute in logger call
JTS22 Mar 31, 2022
bcc2166
mark mIsClosed attribute in ternary expressions
JTS22 Mar 31, 2022
6ea70bb
add custom AttributePointer class
JTS22 Apr 1, 2022
639d01a
add more compatibility methods
JTS22 Apr 1, 2022
3b62ab9
use std pointers with dynamic_pointer_cast
JTS22 Apr 1, 2022
0da10d8
fix missing attribute markings
JTS22 Apr 1, 2022
1e8c339
use getPtr for dynamic_pointer_cast
JTS22 Apr 4, 2022
2e0b50f
force explicit comparisons for attribute pointers
JTS22 Apr 4, 2022
4709e55
add AttributeCmp as comparator for Attribute sets
JTS22 Apr 4, 2022
62f202b
add comments to all attribute classes
JTS22 Apr 4, 2022
d66d04a
delete duplicate files
JTS22 Apr 17, 2022
9b03c83
reenable compiler warnings as errors
JTS22 Apr 22, 2022
774e236
clarify deprecation comment on logger function
JTS22 Apr 22, 2022
92daacd
change attribute method calls in python examples
JTS22 Apr 22, 2022
9454e12
update to new version of dpsim-villas
JTS22 Apr 22, 2022
5133289
expose the entire attribute system to python
JTS22 Apr 24, 2022
d00d178
update notebook to use the new attribute system
JTS22 Apr 24, 2022
0465804
fix file paths in notebook
JTS22 Apr 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/build_test_linux_fedora.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ jobs:
id: cppcheck
run: |
set -o pipefail
cppcheck --max-configs=32 -j 32 --inline-suppr --error-exitcode=1 -q --enable=warning,performance,portability,information,missingInclude --std=c++11 -I Include/ -I models/Include/ Source/ models/Source/ 2>&1 | tee cppcheck-output.log
cppcheck --max-configs=32 -j 32 --inline-suppr --error-exitcode=1 -q --enable=warning,performance,portability,information,missingInclude --std=c++17 -I Include/ -I models/Include/ Source/ models/Source/ 2>&1 | tee cppcheck-output.log
continue-on-error: true

- name: Print cppcheck errors
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ if(MSVC)
else()
check_cxx_compiler_flag("-Wall -Werror" CXX_SUPPORTS_WERROR)
if(CXX_SUPPORTS_WERROR)
set(DPSIM_CXX_FLAGS -Wall -Werror)
m-mirz marked this conversation as resolved.
Show resolved Hide resolved
set(DPSIM_CXX_FLAGS -Wall)
endif()
endif()

Expand Down
2 changes: 1 addition & 1 deletion Examples/Cxx/CIM/CIGRE_MV_PowerFlowTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ int main(int argc, char** argv){
auto logger = DPsim::DataLogger::make(simName);
for (auto node : system.mNodes)
{
logger->addAttribute(node->name() + ".V", node->attribute("v"));
logger->logAttribute(node->name() + ".V", node->attribute("v"));
}

Simulation sim(simName, Logger::Level::info);
Expand Down
26 changes: 13 additions & 13 deletions Examples/Cxx/CIM/CIGRE_MV_PowerFlowTest_LoadProfiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ int main(int argc, char** argv){
auto logger = DPsim::DataLogger::make(simName);
for (auto node : system.mNodes)
{
logger->addAttribute(node->name(), node->attribute("v"));
logger->logAttribute(node->name(), node->attribute("v"));
std::list<std::shared_ptr<CPS::SP::Ph1::PiLine>> lines;
for (auto comp : system.mComponentsAtNode[node]) {
if (std::shared_ptr<CPS::SP::Ph1::PiLine> line =
Expand All @@ -89,16 +89,16 @@ int main(int argc, char** argv){
String p_branch = (node->name() == line->node(0)->name()) ? ("p_branch") : ("p_branch_1");
String q_branch = (node->name() == line->node(0)->name()) ? ("q_branch") : ("q_branch_1");

logger->addAttribute(line->name() + "." + node->name() + ".I", line->attribute<Complex>(current));
logger->addAttribute(line->name() + "." + node->name() + ".P", line->attribute<Real>(p_branch));
logger->addAttribute(line->name() + "." + node->name() + ".Q", line->attribute<Real>(q_branch));
logger->logAttribute(line->name() + "." + node->name() + ".I", line->attribute<Complex>(current));
logger->logAttribute(line->name() + "." + node->name() + ".P", line->attribute<Real>(p_branch));
logger->logAttribute(line->name() + "." + node->name() + ".Q", line->attribute<Real>(q_branch));
lines.push_back(line);
}
else if (std::shared_ptr<CPS::SP::Ph1::NetworkInjection> extnet =
std::dynamic_pointer_cast<CPS::SP::Ph1::NetworkInjection>(comp))
{
logger->addAttribute(node->name() + ".Pinj", extnet->attribute<Real>("p_inj"));
logger->addAttribute(node->name() + ".Qinj", extnet->attribute<Real>("q_inj"));
logger->logAttribute(node->name() + ".Pinj", extnet->attribute<Real>("p_inj"));
logger->logAttribute(node->name() + ".Qinj", extnet->attribute<Real>("q_inj"));
}
else if (std::shared_ptr<CPS::SP::Ph1::Transformer> trafo =
std::dynamic_pointer_cast<CPS::SP::Ph1::Transformer>(comp))
Expand All @@ -107,26 +107,26 @@ int main(int argc, char** argv){
String p_branch = (node->name() == trafo->node(0)->name()) ? ("p_branch") : ("p_branch_1");
String q_branch = (node->name() == trafo->node(0)->name()) ? ("q_branch") : ("q_branch_1");

logger->addAttribute(trafo->name() + "." + node->name() + ".I", trafo->attribute<Complex>(current));
logger->addAttribute(trafo->name() + "." + node->name() + ".P", trafo->attribute<Real>(p_branch));
logger->addAttribute(trafo->name() + "." + node->name() + ".Q", trafo->attribute<Real>(q_branch));
logger->logAttribute(trafo->name() + "." + node->name() + ".I", trafo->attribute<Complex>(current));
logger->logAttribute(trafo->name() + "." + node->name() + ".P", trafo->attribute<Real>(p_branch));
logger->logAttribute(trafo->name() + "." + node->name() + ".Q", trafo->attribute<Real>(q_branch));

}
}
// get nodal injection from specific line or transformer
// (the first line obj connected to the node or, if none, the first trafo)
if (!lines.empty()) {
logger->addAttribute(node->name() + ".Pinj", lines.front()->attribute<Real>("p_inj"));
logger->addAttribute(node->name() + ".Qinj", lines.front()->attribute<Real>("q_inj"));
logger->logAttribute(node->name() + ".Pinj", lines.front()->attribute<Real>("p_inj"));
logger->logAttribute(node->name() + ".Qinj", lines.front()->attribute<Real>("q_inj"));
}
else
{
for (auto comp : system.mComponentsAtNode[node]) {
if (std::shared_ptr<CPS::SP::Ph1::Transformer> trafo =
std::dynamic_pointer_cast<CPS::SP::Ph1::Transformer>(comp))
{
logger->addAttribute(node->name() + ".Pinj", trafo->attribute<Real>("p_inj"));
logger->addAttribute(node->name() + ".Qinj", trafo->attribute<Real>("q_inj"));
logger->logAttribute(node->name() + ".Pinj", trafo->attribute<Real>("p_inj"));
logger->logAttribute(node->name() + ".Qinj", trafo->attribute<Real>("q_inj"));
break;
}

Expand Down
8 changes: 4 additions & 4 deletions Examples/Cxx/CIM/DP_CIGRE_MV_withDG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ int main(int argc, char** argv){
auto loggerPF = DPsim::DataLogger::make(simNamePF);
for (auto node : systemPF.mNodes)
{
loggerPF->addAttribute(node->name() + ".V", node->attribute("v"));
loggerPF->logAttribute(node->name() + ".V", node->attribute("v"));
}

// run powerflow
Expand Down Expand Up @@ -86,19 +86,19 @@ int main(int argc, char** argv){
// log node voltages
for (auto node : systemDP.mNodes)
{
logger->addAttribute(node->name() + ".V", node->attribute("v"));
logger->logAttribute(node->name() + ".V", node->attribute("v"));
}

// log line currents
for (auto comp : systemDP.mComponents) {
if (dynamic_pointer_cast<CPS::DP::Ph1::PiLine>(comp))
logger->addAttribute(comp->name() + ".I", comp->attribute("i_intf"));
logger->logAttribute(comp->name() + ".I", comp->attribute("i_intf"));
}

// log load currents
for (auto comp : systemDP.mComponents) {
if (dynamic_pointer_cast<CPS::DP::Ph1::RXLoad>(comp))
logger->addAttribute(comp->name() + ".I", comp->attribute("i_intf"));
logger->logAttribute(comp->name() + ".I", comp->attribute("i_intf"));
}

// log output of PV connected at N11
Expand Down
8 changes: 4 additions & 4 deletions Examples/Cxx/CIM/DP_CIGRE_MV_withDG_withLoadStep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ int main(int argc, char** argv){
// define logging
auto loggerPF = DPsim::DataLogger::make(simNamePF);
for (auto node : systemPF.mNodes) {
loggerPF->addAttribute(node->name() + ".V", node->attribute("v"));
loggerPF->logAttribute(node->name() + ".V", node->attribute("v"));
}

// run powerflow
Expand Down Expand Up @@ -82,19 +82,19 @@ int main(int argc, char** argv){
// log node voltages
for (auto node : systemDP.mNodes)
{
logger->addAttribute(node->name() + ".V", node->attribute("v"));
logger->logAttribute(node->name() + ".V", node->attribute("v"));
}

// log line currents
for (auto comp : systemDP.mComponents) {
if (dynamic_pointer_cast<CPS::DP::Ph1::PiLine>(comp))
logger->addAttribute(comp->name() + ".I", comp->attribute("i_intf"));
logger->logAttribute(comp->name() + ".I", comp->attribute("i_intf"));
}

// log load currents
for (auto comp : systemDP.mComponents) {
if (dynamic_pointer_cast<CPS::DP::Ph1::RXLoad>(comp))
logger->addAttribute(comp->name() + ".I", comp->attribute("i_intf"));
logger->logAttribute(comp->name() + ".I", comp->attribute("i_intf"));
}

// log output of PV connected at N11
Expand Down
8 changes: 4 additions & 4 deletions Examples/Cxx/CIM/DP_CIGRE_MV_withoutDG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ int main(int argc, char** argv){
auto loggerPF = DPsim::DataLogger::make(simNamePF);
for (auto node : systemPF.mNodes)
{
loggerPF->addAttribute(node->name() + ".V", node->attribute("v"));
loggerPF->logAttribute(node->name() + ".V", node->attribute("v"));
}
Simulation simPF(simNamePF, Logger::Level::debug);
simPF.setSystem(systemPF);
Expand All @@ -78,19 +78,19 @@ int main(int argc, char** argv){
// log node voltages
for (auto node : systemDP.mNodes)
{
logger->addAttribute(node->name() + ".V", node->attribute("v"));
logger->logAttribute(node->name() + ".V", node->attribute("v"));
}

// log line currents
for (auto comp : systemDP.mComponents) {
if (dynamic_pointer_cast<CPS::DP::Ph1::PiLine>(comp))
logger->addAttribute(comp->name() + ".I", comp->attribute("i_intf"));
logger->logAttribute(comp->name() + ".I", comp->attribute("i_intf"));
}

// log load currents
for (auto comp : systemDP.mComponents) {
if (dynamic_pointer_cast<CPS::DP::Ph1::RXLoad>(comp))
logger->addAttribute(comp->name() + ".I", comp->attribute("i_intf"));
logger->logAttribute(comp->name() + ".I", comp->attribute("i_intf"));
}

Simulation sim(simName, Logger::Level::debug);
Expand Down
22 changes: 11 additions & 11 deletions Examples/Cxx/CIM/DP_WSCC-9bus_IdealVS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ int main(int argc, char *argv[]) {
auto loggerPF = DPsim::DataLogger::make(simNamePF);
for (auto node : systemPF.mNodes)
{
loggerPF->addAttribute(node->name() + ".V", node->attribute("v"));
loggerPF->logAttribute(node->name() + ".V", node->attribute("v"));
}

// run powerflow
Expand All @@ -76,20 +76,20 @@ int main(int argc, char *argv[]) {

// Logging
auto logger = DataLogger::make(simName);
logger->addAttribute("v1", sys.node<SimNode>("BUS1")->attribute("v"));
logger->addAttribute("v2", sys.node<SimNode>("BUS2")->attribute("v"));
logger->addAttribute("v3", sys.node<SimNode>("BUS3")->attribute("v"));
logger->addAttribute("v4", sys.node<SimNode>("BUS4")->attribute("v"));
logger->addAttribute("v5", sys.node<SimNode>("BUS5")->attribute("v"));
logger->addAttribute("v6", sys.node<SimNode>("BUS6")->attribute("v"));
logger->addAttribute("v7", sys.node<SimNode>("BUS7")->attribute("v"));
logger->addAttribute("v8", sys.node<SimNode>("BUS8")->attribute("v"));
logger->addAttribute("v9", sys.node<SimNode>("BUS9")->attribute("v"));
logger->logAttribute("v1", sys.node<SimNode>("BUS1")->attribute("v"));
logger->logAttribute("v2", sys.node<SimNode>("BUS2")->attribute("v"));
logger->logAttribute("v3", sys.node<SimNode>("BUS3")->attribute("v"));
logger->logAttribute("v4", sys.node<SimNode>("BUS4")->attribute("v"));
logger->logAttribute("v5", sys.node<SimNode>("BUS5")->attribute("v"));
logger->logAttribute("v6", sys.node<SimNode>("BUS6")->attribute("v"));
logger->logAttribute("v7", sys.node<SimNode>("BUS7")->attribute("v"));
logger->logAttribute("v8", sys.node<SimNode>("BUS8")->attribute("v"));
logger->logAttribute("v9", sys.node<SimNode>("BUS9")->attribute("v"));

// log generator's current
for (auto comp : sys.mComponents) {
if (std::dynamic_pointer_cast<CPS::DP::Ph1::SynchronGeneratorIdeal>(comp))
logger->addAttribute(comp->name() + ".I", comp->attribute("i_intf"));
logger->logAttribute(comp->name() + ".I", comp->attribute("i_intf"));
}

Simulation sim(simName, Logger::Level::info);
Expand Down
8 changes: 4 additions & 4 deletions Examples/Cxx/CIM/EMT_CIGRE_MV_withDG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ int main(int argc, char** argv){
auto loggerPF = DPsim::DataLogger::make(simNamePF);
for (auto node : systemPF.mNodes)
{
loggerPF->addAttribute(node->name() + ".V", node->attribute("v"));
loggerPF->logAttribute(node->name() + ".V", node->attribute("v"));
}

// run powerflow
Expand All @@ -82,18 +82,18 @@ int main(int argc, char** argv){

// log node voltages
for (auto node : systemEMT.mNodes)
logger->addAttribute(node->name() + ".V", node->attribute("v"));
logger->logAttribute(node->name() + ".V", node->attribute("v"));

// log line currents
for (auto comp : systemEMT.mComponents) {
if (dynamic_pointer_cast<CPS::EMT::Ph3::PiLine>(comp))
logger->addAttribute(comp->name() + ".I", comp->attribute("i_intf"));
logger->logAttribute(comp->name() + ".I", comp->attribute("i_intf"));
}

// log load currents
for (auto comp : systemEMT.mComponents) {
if (dynamic_pointer_cast<CPS::EMT::Ph3::RXLoad>(comp))
logger->addAttribute(comp->name() + ".I", comp->attribute("i_intf"));
logger->logAttribute(comp->name() + ".I", comp->attribute("i_intf"));
}

// log output of PV connected at N11
Expand Down
8 changes: 4 additions & 4 deletions Examples/Cxx/CIM/EMT_CIGRE_MV_withDG_withLoadStep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ int main(int argc, char** argv){
auto loggerPF = DPsim::DataLogger::make(simNamePF);
for (auto node : systemPF.mNodes)
{
loggerPF->addAttribute(node->name() + ".V", node->attribute("v"));
loggerPF->logAttribute(node->name() + ".V", node->attribute("v"));
}

// run powerflow
Expand All @@ -82,18 +82,18 @@ int main(int argc, char** argv){

// log node voltages
for (auto node : systemEMT.mNodes)
logger->addAttribute(node->name() + ".V", node->attribute("v"));
logger->logAttribute(node->name() + ".V", node->attribute("v"));

// log line currents
for (auto comp : systemEMT.mComponents) {
if (dynamic_pointer_cast<CPS::EMT::Ph3::PiLine>(comp))
logger->addAttribute(comp->name() + ".I", comp->attribute("i_intf"));
logger->logAttribute(comp->name() + ".I", comp->attribute("i_intf"));
}

// log load currents
for (auto comp : systemEMT.mComponents) {
if (dynamic_pointer_cast<CPS::EMT::Ph3::RXLoad>(comp))
logger->addAttribute(comp->name() + ".I", comp->attribute("i_intf"));
logger->logAttribute(comp->name() + ".I", comp->attribute("i_intf"));
}

// log output of PV connected at N11
Expand Down
8 changes: 4 additions & 4 deletions Examples/Cxx/CIM/EMT_CIGRE_MV_withoutDG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ int main(int argc, char** argv){
auto loggerPF = DPsim::DataLogger::make(simNamePF);
for (auto node : systemPF.mNodes)
{
loggerPF->addAttribute(node->name() + ".V", node->attribute("v"));
loggerPF->logAttribute(node->name() + ".V", node->attribute("v"));
}
Simulation simPF(simNamePF, Logger::Level::debug);
simPF.setSystem(systemPF);
Expand All @@ -75,18 +75,18 @@ int main(int argc, char** argv){

// log node voltages
for (auto node : systemEMT.mNodes)
logger->addAttribute(node->name() + ".V", node->attribute("v"));
logger->logAttribute(node->name() + ".V", node->attribute("v"));

// log line currents
for (auto comp : systemEMT.mComponents) {
if (dynamic_pointer_cast<CPS::EMT::Ph3::PiLine>(comp))
logger->addAttribute(comp->name() + ".I", comp->attribute("i_intf"));
logger->logAttribute(comp->name() + ".I", comp->attribute("i_intf"));
}

// log load currents
for (auto comp : systemEMT.mComponents) {
if (dynamic_pointer_cast<CPS::EMT::Ph3::RXLoad>(comp))
logger->addAttribute(comp->name() + ".I", comp->attribute("i_intf"));
logger->logAttribute(comp->name() + ".I", comp->attribute("i_intf"));
}

Simulation sim(simName, Logger::Level::debug);
Expand Down
22 changes: 11 additions & 11 deletions Examples/Cxx/CIM/EMT_WSCC-9bus_FullOrderSG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ int main(int argc, char *argv[]) {
auto loggerPF = DPsim::DataLogger::make(simNamePF);
for (auto node : systemPF.mNodes)
{
loggerPF->addAttribute(node->name() + ".V", node->attribute("v"));
loggerPF->logAttribute(node->name() + ".V", node->attribute("v"));
}

// run powerflow
Expand Down Expand Up @@ -83,20 +83,20 @@ int main(int argc, char *argv[]) {

// Logging
auto logger = DataLogger::make(simName);
logger->addAttribute("v1", sys.node<SimNode>("BUS1")->attribute("v"));
logger->addAttribute("v2", sys.node<SimNode>("BUS2")->attribute("v"));
logger->addAttribute("v3", sys.node<SimNode>("BUS3")->attribute("v"));
logger->addAttribute("v4", sys.node<SimNode>("BUS4")->attribute("v"));
logger->addAttribute("v5", sys.node<SimNode>("BUS5")->attribute("v"));
logger->addAttribute("v6", sys.node<SimNode>("BUS6")->attribute("v"));
logger->addAttribute("v7", sys.node<SimNode>("BUS7")->attribute("v"));
logger->addAttribute("v8", sys.node<SimNode>("BUS8")->attribute("v"));
logger->addAttribute("v9", sys.node<SimNode>("BUS9")->attribute("v"));
logger->logAttribute("v1", sys.node<SimNode>("BUS1")->attribute("v"));
logger->logAttribute("v2", sys.node<SimNode>("BUS2")->attribute("v"));
logger->logAttribute("v3", sys.node<SimNode>("BUS3")->attribute("v"));
logger->logAttribute("v4", sys.node<SimNode>("BUS4")->attribute("v"));
logger->logAttribute("v5", sys.node<SimNode>("BUS5")->attribute("v"));
logger->logAttribute("v6", sys.node<SimNode>("BUS6")->attribute("v"));
logger->logAttribute("v7", sys.node<SimNode>("BUS7")->attribute("v"));
logger->logAttribute("v8", sys.node<SimNode>("BUS8")->attribute("v"));
logger->logAttribute("v9", sys.node<SimNode>("BUS9")->attribute("v"));

// log generator's current
for (auto comp : sys.mComponents) {
if (std::dynamic_pointer_cast<CPS::EMT::Ph3::SynchronGeneratorDQTrapez>(comp))
logger->addAttribute(comp->name() + ".I", comp->attribute("i_intf"));
logger->logAttribute(comp->name() + ".I", comp->attribute("i_intf"));
}

Simulation sim(simName, Logger::Level::info);
Expand Down
Loading