summaryrefslogtreecommitdiffstats
path: root/Project/Capacitor.cpp
diff options
context:
space:
mode:
authorThales1330 <thaleslima.ufu@gmail.com>2017-01-02 19:31:11 -0200
committerThales1330 <thaleslima.ufu@gmail.com>2017-01-02 19:31:11 -0200
commit2c0b51586b3b2243ae0fdcd653139818e4b4e23e (patch)
tree89c1435aac9213230f04b06d4183c94f6ea36663 /Project/Capacitor.cpp
parent7aed88dbcf9d37a1f40c8cad115f055c4d69e7a9 (diff)
downloadPSP.git-2c0b51586b3b2243ae0fdcd653139818e4b4e23e.tar.gz
PSP.git-2c0b51586b3b2243ae0fdcd653139818e4b4e23e.tar.xz
PSP.git-2c0b51586b3b2243ae0fdcd653139818e4b4e23e.zip
Fast data visualization implemented
Diffstat (limited to 'Project/Capacitor.cpp')
-rw-r--r--Project/Capacitor.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/Project/Capacitor.cpp b/Project/Capacitor.cpp
index 7545135..1ec17fc 100644
--- a/Project/Capacitor.cpp
+++ b/Project/Capacitor.cpp
@@ -170,3 +170,35 @@ Element* Capacitor::GetCopy()
*copy = *this;
return copy;
}
+
+wxString Capacitor::GetTipText() const
+{
+ wxString tipText = m_electricalData.name;
+
+ // TODO: Avoid reactive power calculation.
+ double reactivePower = m_electricalData.reactivePower;
+ if(m_online) {
+ std::complex<double> v = ((Bus*)m_parentList[0])->GetEletricalData().voltage;
+ reactivePower *= std::pow(std::abs(v), 2);
+ }
+ tipText += "\n";
+ tipText += _("\nQ = ") + wxString::FromDouble(reactivePower, 5);
+ switch(m_electricalData.reactivePowerUnit) {
+ case UNIT_PU: {
+ tipText += _(" p.u.");
+ } break;
+ case UNIT_VAr: {
+ tipText += _(" VAr");
+ } break;
+ case UNIT_kVAr: {
+ tipText += _(" kVAr");
+ } break;
+ case UNIT_MVAr: {
+ tipText += _(" MVAr");
+ } break;
+ default:
+ break;
+ }
+
+ return tipText;
+}