From 2cd589742c6a4fd289d2f0696d844ccf18b917cb Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Fri, 6 Jan 2017 20:49:28 -0200 Subject: Several bugfixes on power elements --- Project/Inductor.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Project/Inductor.cpp') 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 v = static_cast(m_parentList[0])->GetEletricalData().voltage; reactivePower *= std::pow(std::abs(v), 2); } @@ -193,6 +195,6 @@ wxString Inductor::GetTipText() const default: break; } - + return tipText; } -- cgit