Commit b3675b1f authored by Markus Mirz's avatar Markus Mirz
Browse files

rename SignalComponent class

parent a365fc76
......@@ -30,7 +30,7 @@
namespace CPS {
namespace Signal {
class DecouplingLine :
public SignalComponent,
public SimSignalComp,
public SharedFactory<DecouplingLine> {
protected:
Real mDelay;
......
......@@ -29,7 +29,7 @@
namespace CPS {
namespace Signal {
class DecouplingLineEMT :
public SignalComponent,
public SimSignalComp,
public SharedFactory<DecouplingLineEMT> {
protected:
Real mDelay;
......
......@@ -31,7 +31,7 @@
namespace CPS {
namespace Signal {
class FIRFilter :
public SignalComponent,
public SimSignalComp,
public SharedFactory<FIRFilter> {
protected:
std::vector<Real> mSignal;
......
......@@ -25,7 +25,7 @@
namespace CPS {
/// Base class for all signal type components
/// that have only unidirectional connections
class SignalComponent : public TopologicalSignalComp {
class SimSignalComp : public TopologicalSignalComp {
public:
enum Behaviour { Initialization, Simulation };
protected:
......@@ -33,17 +33,17 @@ namespace CPS {
/// special behavior for components during initialization
Bool mBehaviour = Behaviour::Simulation;
public:
typedef std::shared_ptr<SignalComponent> Ptr;
typedef std::shared_ptr<SimSignalComp> Ptr;
typedef std::vector<Ptr> List;
///
SignalComponent(String uid, String name, Logger::Level logLevel = Logger::Level::off)
SimSignalComp(String uid, String name, Logger::Level logLevel = Logger::Level::off)
: TopologicalSignalComp(uid, name, logLevel) { }
///
SignalComponent(String name, Logger::Level logLevel = Logger::Level::off)
: SignalComponent(name, name, logLevel) { }
SimSignalComp(String name, Logger::Level logLevel = Logger::Level::off)
: SimSignalComp(name, name, logLevel) { }
///
virtual ~SignalComponent() { }
virtual ~SimSignalComp() { }
///
virtual void initialize(Real timeStep) { }
......
......@@ -25,7 +25,7 @@ using namespace CPS::Signal;
DecouplingLine::DecouplingLine(String name, Node<Complex>::Ptr node1, Node<Complex>::Ptr node2,
Real resistance, Real inductance, Real capacitance, Logger::Level logLevel) :
SignalComponent(name, name, logLevel),
SimSignalComp(name, name, logLevel),
mResistance(resistance), mInductance(inductance), mCapacitance(capacitance) {
addAttribute<Matrix>("states", &mStates);
......@@ -55,7 +55,7 @@ DecouplingLine::DecouplingLine(String name, Node<Complex>::Ptr node1, Node<Compl
}
DecouplingLine::DecouplingLine(String name, Logger::Level logLevel) :
SignalComponent(name, name, logLevel) {
SimSignalComp(name, name, logLevel) {
addAttribute<Matrix>("states", &mStates);
addAttribute<Complex>("i_src1", &mSrcCur1Ref, Flags::read);
......
......@@ -24,7 +24,7 @@ using namespace CPS::EMT::Ph1;
using namespace CPS::Signal;
DecouplingLineEMT::DecouplingLineEMT(String name, Logger::Level logLevel) :
SignalComponent(name, name, logLevel) {
SimSignalComp(name, name, logLevel) {
addAttribute<Matrix>("states", &mStates);
addAttribute<Real>("i_src1", &mSrcCur1Ref, Flags::read);
......
......@@ -26,7 +26,7 @@ using namespace CPS;
using namespace CPS::Signal;
FIRFilter::FIRFilter(String uid, String name, Logger::Level logLevel) :
SignalComponent(name, name, logLevel),
SimSignalComp(name, name, logLevel),
mCurrentIdx(0),
mInitSample(0.0) {
......
......@@ -70,7 +70,7 @@ namespace DPsim {
std::vector<Subnet> mSubnets;
std::unordered_map<typename CPS::Node<VarType>::Ptr, Subnet*> mNodeSubnetMap;
typename CPS::PowerComponent<VarType>::List mTearComponents;
CPS::SignalComponent::List mSignalComponents;
CPS::SimSignalComp::List mSimSignalComps;
Matrix mRightSideVector;
Matrix mLeftSideVector;
......
......@@ -69,7 +69,7 @@ namespace DPsim {
///
CPS::MNASwitchInterface::List mSwitches;
///
CPS::SignalComponent::List mSignalComponents;
CPS::SimSignalComp::List mSimSignalComps;
// #### MNA specific attributes ####
/// System matrix A that is modified by matrix stamps
......@@ -110,7 +110,7 @@ namespace DPsim {
void initializeComponents();
/// Initialization of system matrices and source vector
void initializeSystem();
/// Identify Nodes and PowerComponents and SignalComponents
/// Identify Nodes and PowerComponents and SimSignalComps
void identifyTopologyObjects();
/// Assign simulation node index according to index in the vector.
void assignSimNodes();
......
......@@ -83,9 +83,9 @@ void DiakopticsSolver<VarType>::initSubnets(const std::vector<SystemTopology>& s
if (mnaComp)
mSubnets[i].components.push_back(mnaComp);
auto sigComp = std::dynamic_pointer_cast<CPS::SignalComponent>(comp);
auto sigComp = std::dynamic_pointer_cast<CPS::SimSignalComp>(comp);
if (sigComp)
mSignalComponents.push_back(sigComp);
mSimSignalComps.push_back(sigComp);
}
}
......@@ -274,7 +274,7 @@ void DiakopticsSolver<VarType>::initComponents() {
}
}
// Initialize signal components.
for (auto comp : mSignalComponents)
for (auto comp : mSimSignalComps)
comp->initialize(mSystem.mSystemOmega, mTimeStep);
}
......@@ -366,7 +366,7 @@ Task::List DiakopticsSolver<VarType>::getTasks() {
l.push_back(std::make_shared<SolveTask>(*this, net));
}
for (auto comp : mSignalComponents) {
for (auto comp : mSimSignalComps) {
for (auto task : comp->getTasks()) {
l.push_back(task);
}
......
......@@ -87,8 +87,8 @@ void MnaSolver<VarType>::initialize() {
auto powerComp = std::dynamic_pointer_cast<CPS::TopologicalComponent>(comp);
if (powerComp) powerComp->setBehaviour(TopologicalComponent::Behaviour::Simulation);
auto sigComp = std::dynamic_pointer_cast<CPS::SignalComponent>(comp);
if (sigComp) sigComp->setBehaviour(SignalComponent::Behaviour::Simulation);
auto sigComp = std::dynamic_pointer_cast<CPS::SimSignalComp>(comp);
if (sigComp) sigComp->setBehaviour(SimSignalComp::Behaviour::Simulation);
}
// Initialize system matrices and source vector.
......@@ -111,7 +111,7 @@ void MnaSolver<Real>::initializeComponents() {
}
// Initialize signal components.
for (auto comp : mSignalComponents)
for (auto comp : mSimSignalComps)
comp->initialize(mSystem.mSystemOmega, mTimeStep);
// Initialize MNA specific parts of components.
......@@ -138,7 +138,7 @@ void MnaSolver<Complex>::initializeComponents() {
}
// Initialize signal components.
for (auto comp : mSignalComponents)
for (auto comp : mSimSignalComps)
comp->initialize(mSystem.mSystemOmega, mTimeStep);
mSLog->info("-- Initialize MNA properties of components");
......@@ -263,8 +263,8 @@ void MnaSolver<VarType>::identifyTopologyObjects() {
auto mnaComp = std::dynamic_pointer_cast<CPS::MNAInterface>(comp);
if (mnaComp) mMNAComponents.push_back(mnaComp);
auto sigComp = std::dynamic_pointer_cast<CPS::SignalComponent>(comp);
if (sigComp) mSignalComponents.push_back(sigComp);
auto sigComp = std::dynamic_pointer_cast<CPS::SimSignalComp>(comp);
if (sigComp) mSimSignalComps.push_back(sigComp);
}
}
......@@ -397,8 +397,8 @@ void MnaSolver<VarType>::steadyStateInitialization() {
auto powerComp = std::dynamic_pointer_cast<CPS::TopologicalComponent>(comp);
if (powerComp) powerComp->setBehaviour(TopologicalComponent::Behaviour::Initialization);
auto sigComp = std::dynamic_pointer_cast<CPS::SignalComponent>(comp);
if (sigComp) sigComp->setBehaviour(SignalComponent::Behaviour::Initialization);
auto sigComp = std::dynamic_pointer_cast<CPS::SimSignalComp>(comp);
if (sigComp) sigComp->setBehaviour(SimSignalComp::Behaviour::Initialization);
}
initializeSystem();
......@@ -421,7 +421,7 @@ void MnaSolver<VarType>::steadyStateInitialization() {
}
}
// TODO signal components should be moved out of MNA solver
for (auto comp : mSignalComponents) {
for (auto comp : mSimSignalComps) {
for (auto task : comp->getTasks()) {
tasks.push_back(task);
}
......@@ -482,7 +482,7 @@ Task::List MnaSolver<VarType>::getTasks() {
l.push_back(task);
}
// TODO signal components should be moved out of MNA solver
for (auto comp : mSignalComponents) {
for (auto comp : mSimSignalComps) {
for (auto task : comp->getTasks()) {
l.push_back(task);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment