summaryrefslogtreecommitdiffstats
path: root/Project/Inductor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Project/Inductor.cpp')
-rw-r--r--Project/Inductor.cpp6
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;
}