diff options
author | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2019-01-22 15:06:09 -0200 |
---|---|---|
committer | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2019-01-22 15:06:09 -0200 |
commit | 59c28b89bb2a4eb05a87bb28154442266c35b17d (patch) | |
tree | ae65a35f314e55d2527e4cdc8196673cac42bf17 /Project/Workspace.cpp | |
parent | 5a06bb4424311cbb728af35fe73d259499d7c9bf (diff) | |
download | PSP.git-59c28b89bb2a4eb05a87bb28154442266c35b17d.tar.gz PSP.git-59c28b89bb2a4eb05a87bb28154442266c35b17d.tar.xz PSP.git-59c28b89bb2a4eb05a87bb28154442266c35b17d.zip |
Some code stability optimization
Diffstat (limited to 'Project/Workspace.cpp')
-rw-r--r-- | Project/Workspace.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Project/Workspace.cpp b/Project/Workspace.cpp index 8a67456..e652f51 100644 --- a/Project/Workspace.cpp +++ b/Project/Workspace.cpp @@ -1429,7 +1429,9 @@ bool Workspace::RunStability() RunPowerFlow(); Electromechanical stability(this, GetElementList(), m_properties->GetSimulationPropertiesData()); + wxStopWatch sw; bool result = stability.RunStabilityCalculation(); + sw.Pause(); if(!result) { wxMessageDialog msgDialog(this, stability.GetErrorMessage(), _("Error"), wxOK | wxCENTRE | wxICON_ERROR); msgDialog.ShowModal(); @@ -1440,8 +1442,11 @@ bool Workspace::RunStability() // Run power flow after stability. RunPowerFlow(); - wxMessageDialog msgDialog(this, _("Do you wish to open the stability graphics?"), _("Question"), - wxYES_NO | wxCENTRE | wxICON_QUESTION); + wxMessageDialog msgDialog( + this, + wxString::Format(_("The program took %ld ms to run this system.\nDo you wish to open the stability graphics?"), + sw.Time()), + _("Question"), wxYES_NO | wxCENTRE | wxICON_QUESTION); if(msgDialog.ShowModal() == wxID_YES) { std::vector<ElementPlotData> plotDataList; for(auto it = m_elementList.begin(), itEnd = m_elementList.end(); it != itEnd; ++it) { @@ -1449,7 +1454,7 @@ bool Workspace::RunStability() ElementPlotData plotData; if(element->GetPlotData(plotData)) plotDataList.push_back(plotData); } - + ElementPlotData plotData; plotData.SetName(_("Simulation parameters")); plotData.SetCurveType(ElementPlotData::CT_TEST); |