From 59c28b89bb2a4eb05a87bb28154442266c35b17d Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Tue, 22 Jan 2019 15:06:09 -0200 Subject: Some code stability optimization --- Project/Workspace.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'Project/Workspace.cpp') 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 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); -- cgit