summaryrefslogtreecommitdiffstats
path: root/Project/Load.cpp
diff options
context:
space:
mode:
authorThales1330 <thaleslima.ufu@gmail.com>2017-01-06 20:49:28 -0200
committerThales1330 <thaleslima.ufu@gmail.com>2017-01-06 20:49:28 -0200
commit2cd589742c6a4fd289d2f0696d844ccf18b917cb (patch)
tree42a64542d07a4997be5e216ffd54a27e39f76b56 /Project/Load.cpp
parent6a268dba6da88e0a371ce6358e4f43b0c3d08d7d (diff)
downloadPSP.git-2cd589742c6a4fd289d2f0696d844ccf18b917cb.tar.gz
PSP.git-2cd589742c6a4fd289d2f0696d844ccf18b917cb.tar.xz
PSP.git-2cd589742c6a4fd289d2f0696d844ccf18b917cb.zip
Several bugfixes on power elements
Diffstat (limited to 'Project/Load.cpp')
-rw-r--r--Project/Load.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Project/Load.cpp b/Project/Load.cpp
index 5eda960..3cce7a1 100644
--- a/Project/Load.cpp
+++ b/Project/Load.cpp
@@ -189,6 +189,10 @@ wxString Load::GetTipText() const
// TODO: Avoid power calculation.
double activePower = m_electricalData.activePower;
double reactivePower = m_electricalData.reactivePower;
+ if(!m_online) {
+ activePower = 0.0;
+ reactivePower = 0.0;
+ }
if(m_online && m_electricalData.loadType == CONST_IMPEDANCE) {
std::complex<double> v = static_cast<Bus*>(m_parentList[0])->GetEletricalData().voltage;
reactivePower *= std::pow(std::abs(v), 2);