diff options
author | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2017-09-04 20:04:42 -0300 |
---|---|---|
committer | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2017-09-04 20:04:42 -0300 |
commit | 6f3421c4150e49af026432a2a2be0171d741ad03 (patch) | |
tree | 4df26f8c631aeeeed6e5c9e8aab87c4c663bd30f /Project/MainFrame.cpp | |
parent | 516cdb72d3ff99a1ee786d3ea24c9b579272fe76 (diff) | |
download | PSP.git-6f3421c4150e49af026432a2a2be0171d741ad03.tar.gz PSP.git-6f3421c4150e49af026432a2a2be0171d741ad03.tar.xz PSP.git-6f3421c4150e49af026432a2a2be0171d741ad03.zip |
Some bugfixes
Diffstat (limited to 'Project/MainFrame.cpp')
-rw-r--r-- | Project/MainFrame.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/Project/MainFrame.cpp b/Project/MainFrame.cpp index e3d8ca8..6604722 100644 --- a/Project/MainFrame.cpp +++ b/Project/MainFrame.cpp @@ -14,6 +14,7 @@ #include "GeneralPropertiesForm.h" #include "SimulationsSettingsForm.h" #include "PropertiesData.h" +#include "ChartView.h" MainFrame::MainFrame() : MainFrameBase(NULL) {} MainFrame::MainFrame(wxWindow* parent, wxLocale* locale, PropertiesData* initProperties) : MainFrameBase(parent) @@ -137,7 +138,22 @@ void MainFrame::OnNewClick(wxRibbonButtonBarEvent& event) void MainFrame::OnAboutClick(wxRibbonButtonBarEvent& event) {} void MainFrame::OnAddElementDropdown(wxRibbonButtonBarEvent& event) { event.PopupMenu(m_addElementsMenu); } -void MainFrame::OnChartsClick(wxRibbonButtonBarEvent& event) {} +void MainFrame::OnChartsClick(wxRibbonButtonBarEvent& event) +{ + if(Workspace* workspace = dynamic_cast<Workspace*>(m_auiNotebook->GetCurrentPage())) { + std::vector<ElementPlotData> plotDataList; + auto elementList = workspace->GetElementList(); + for(auto it = elementList.begin(), itEnd = elementList.end(); it != itEnd; ++it) { + if(PowerElement* powerElement = dynamic_cast<PowerElement*>(*it)) { + ElementPlotData plotData; + if(powerElement->GetPlotData(plotData)) plotDataList.push_back(plotData); + } + } + ChartView* cView = new ChartView(workspace, plotDataList, workspace->GetStabilityTimeVector()); + cView->Show(); + } +} + void MainFrame::OnCloseClick(wxRibbonButtonBarEvent& event) {} void MainFrame::OnCopyClick(wxRibbonButtonBarEvent& event) {} void MainFrame::OnDataReportClick(wxRibbonButtonBarEvent& event) {} |