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/IndMotor.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/IndMotor.cpp')
-rw-r--r-- | Project/IndMotor.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Project/IndMotor.cpp b/Project/IndMotor.cpp index 3a6c0fa..8fab5c4 100644 --- a/Project/IndMotor.cpp +++ b/Project/IndMotor.cpp @@ -91,7 +91,9 @@ wxString IndMotor::GetTipText() const { wxString tipText = m_electricalData.name; tipText += "\n"; - tipText += _("\nP = ") + wxString::FromDouble(m_electricalData.activePower, 5); + double activePower = m_electricalData.activePower; + if(!m_online) activePower = 0.0; + tipText += _("\nP = ") + wxString::FromDouble(activePower, 5); switch(m_electricalData.activePowerUnit) { case UNIT_PU: { tipText += _(" p.u."); @@ -108,7 +110,9 @@ wxString IndMotor::GetTipText() const default: break; } - tipText += _("\nQ = ") + wxString::FromDouble(m_electricalData.reactivePower, 5); + double reactivePower = m_electricalData.reactivePower; + if(!m_online) reactivePower = 0.0; + tipText += _("\nQ = ") + wxString::FromDouble(reactivePower, 5); switch(m_electricalData.reactivePowerUnit) { case UNIT_PU: { tipText += _(" p.u."); @@ -125,6 +129,6 @@ wxString IndMotor::GetTipText() const default: break; } - + return tipText; } |