From 6f3421c4150e49af026432a2a2be0171d741ad03 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Mon, 4 Sep 2017 20:04:42 -0300 Subject: Some bugfixes --- Project/MainFrame.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'Project/MainFrame.cpp') 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(m_auiNotebook->GetCurrentPage())) { + std::vector plotDataList; + auto elementList = workspace->GetElementList(); + for(auto it = elementList.begin(), itEnd = elementList.end(); it != itEnd; ++it) { + if(PowerElement* powerElement = dynamic_cast(*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) {} -- cgit