diff options
author | Thales1330 <thaleslima.ufu@gmail.com> | 2017-01-06 20:49:28 -0200 |
---|---|---|
committer | Thales1330 <thaleslima.ufu@gmail.com> | 2017-01-06 20:49:28 -0200 |
commit | 2cd589742c6a4fd289d2f0696d844ccf18b917cb (patch) | |
tree | 42a64542d07a4997be5e216ffd54a27e39f76b56 /Project/Inductor.cpp | |
parent | 6a268dba6da88e0a371ce6358e4f43b0c3d08d7d (diff) | |
download | PSP.git-2cd589742c6a4fd289d2f0696d844ccf18b917cb.tar.gz PSP.git-2cd589742c6a4fd289d2f0696d844ccf18b917cb.tar.xz PSP.git-2cd589742c6a4fd289d2f0696d844ccf18b917cb.zip |
Several bugfixes on power elements
Diffstat (limited to 'Project/Inductor.cpp')
-rw-r--r-- | Project/Inductor.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Project/Inductor.cpp b/Project/Inductor.cpp index 69279df..b9a3da6 100644 --- a/Project/Inductor.cpp +++ b/Project/Inductor.cpp @@ -171,7 +171,9 @@ wxString Inductor::GetTipText() const // TODO: Avoid reactive power calculation. double reactivePower = m_electricalData.reactivePower; - if(m_online) { + if(!m_online) + reactivePower = 0.0; + else { std::complex<double> v = static_cast<Bus*>(m_parentList[0])->GetEletricalData().voltage; reactivePower *= std::pow(std::abs(v), 2); } @@ -193,6 +195,6 @@ wxString Inductor::GetTipText() const default: break; } - + return tipText; } |