diff options
author | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2019-04-26 02:29:47 -0300 |
---|---|---|
committer | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2019-04-26 02:29:47 -0300 |
commit | a40d5a405d60b4e429f6f578dcfe3c33ab5ad81a (patch) | |
tree | 0f88240b49798ce5e3d9b96ca2951145a7978343 /Project/Bus.cpp | |
parent | 4dabf27f998db83e20bc0eca7e18672777f0bf5b (diff) | |
download | PSP.git-a40d5a405d60b4e429f6f578dcfe3c33ab5ad81a.tar.gz PSP.git-a40d5a405d60b4e429f6f578dcfe3c33ab5ad81a.tar.xz PSP.git-a40d5a405d60b4e429f6f578dcfe3c33ab5ad81a.zip |
Frequency response implemented
Need a form
Diffstat (limited to 'Project/Bus.cpp')
-rw-r--r-- | Project/Bus.cpp | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/Project/Bus.cpp b/Project/Bus.cpp index eecc06a..37eac3e 100644 --- a/Project/Bus.cpp +++ b/Project/Bus.cpp @@ -239,23 +239,31 @@ wxString Bus::GetTipText() const } tipText += _("\n\nSsc = ") + wxString::FromDouble(std::abs(m_electricalData.scPower), 5) + _(" p.u."); + tipText += _("\n\nTHD = ") + wxString::FromDouble(std::abs(m_electricalData.thd), 5) + wxT("\%"); return tipText; } -bool Bus::GetPlotData(ElementPlotData& plotData) +bool Bus::GetPlotData(ElementPlotData& plotData, PlotStudy study) { - if(!m_electricalData.plotBus) return false; - plotData.SetName(m_electricalData.name); - plotData.SetCurveType(ElementPlotData::CT_BUS); - - std::vector<double> absVoltage, argVoltage; - for(unsigned int i = 0; i < m_electricalData.stabVoltageVector.size(); ++i) { - absVoltage.push_back(std::abs(m_electricalData.stabVoltageVector[i])); - argVoltage.push_back(wxRadToDeg(std::arg(m_electricalData.stabVoltageVector[i]))); + if(study == STABILITY) { + if(!m_electricalData.plotBus) return false; + plotData.SetName(m_electricalData.name); + plotData.SetCurveType(ElementPlotData::CT_BUS); + + std::vector<double> absVoltage, argVoltage; + for(unsigned int i = 0; i < m_electricalData.stabVoltageVector.size(); ++i) { + absVoltage.push_back(std::abs(m_electricalData.stabVoltageVector[i])); + argVoltage.push_back(wxRadToDeg(std::arg(m_electricalData.stabVoltageVector[i]))); + } + plotData.AddData(absVoltage, _("Voltage")); + plotData.AddData(argVoltage, _("Angle")); + } else if(FREQRESPONSE) { + //if(!m_electricalData.plotBus) return false; + plotData.SetName(m_electricalData.name); + plotData.SetCurveType(ElementPlotData::CT_BUS); + plotData.AddData(m_electricalData.absImpedanceVector, _("Impedance")); } - plotData.AddData(absVoltage, _("Voltage")); - plotData.AddData(argVoltage, _("Angle")); return true; } |