Power System Platform  2026w10a-beta
Loading...
Searching...
No Matches
DataReport.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18#ifndef DATAREPORT_H
19#define DATAREPORT_H
20
21#include "DataReportBase.h"
22
23class Workspace;
25
33class DataReport : public DataReportBase
34{
35 public:
36 enum GridSelection {
37 GRID_ALL = 0,
38 GRID_PF,
39 GRID_PFBUSES,
40 GRID_PFBRANCHES,
41 GRID_FAULT,
42 GRID_FAULTBUSES,
43 GRID_FAULTBRANCHES,
44 GRID_FAULTGENERATORS,
45 GRID_HARMCURRENT,
46 GRID_HARMBUSES,
47 GRID_HARMBRANCHES,
48 };
49
50 DataReport(wxWindow* parent, Workspace* workspace);
51 virtual ~DataReport();
52
53 virtual void SetHeaders();
54 virtual void CreateGrids();
55 virtual void FillValues(GridSelection gridToFill = GRID_ALL);
56 virtual void SetRowsColours(wxGrid* grid, int rowStart = 1, int colStart = 0, int colEndTrim = 0);
57 virtual void GridKeyHandler(wxGrid* grid, wxKeyEvent& event);
58 virtual void UpdateFontSize();
59 virtual void UpdateCurrentGrid();
60
61 protected:
62 virtual void OnMouseWheel(wxMouseEvent& event);
63 virtual void OnTextPrecisionUpdate(wxCommandEvent& event);
64 virtual void OnMainNotebookChanged(wxNotebookEvent& event);
65 virtual void OnFontSizeSelected(wxCommandEvent& event);
66 virtual void OnHarmNotebookChanged(wxNotebookEvent& event);
67 virtual void OnFaultNotebookChanged(wxNotebookEvent& event);
68 virtual void OnPFNotebookChanged(wxNotebookEvent& event);
69 virtual void ClipboardButtonClick(wxCommandEvent& event);
70 virtual void ExportCSVButtonClick(wxCommandEvent& event);
71 virtual void OnHarmBranchesGridChanged(wxGridEvent& event);
72 virtual void OnHarmBusesGridChanged(wxGridEvent& event);
73 virtual void OnHarmCurrentGridChanged(wxGridEvent& event);
74 virtual void OnFaulrGridChanged(wxGridEvent& event);
75 virtual void OnFaultBranchesGridChanged(wxGridEvent& event);
76 virtual void OnFaultBusesGridChanged(wxGridEvent& event);
77 virtual void OnFaultGeneratorsGridChanged(wxGridEvent& event);
78 virtual void OnPFBranchesGridChanged(wxGridEvent& event);
79 virtual void OnPowerFlowGridChanged(wxGridEvent& event);
80 virtual void OnPFBusGridChanged(wxGridEvent& event);
81 virtual void OnGridFaultBranchesKeyDown(wxKeyEvent& event) { GridKeyHandler(m_gridFaultBranches, event); }
82 virtual void OnGridFaultBusesKeyDown(wxKeyEvent& event) { GridKeyHandler(m_gridFaultBuses, event); }
83 virtual void OnGridFaultGeneratorsKeyDown(wxKeyEvent& event) { GridKeyHandler(m_gridFaultGenerators, event); }
84 virtual void OnGridFaultKeyDown(wxKeyEvent& event) { GridKeyHandler(m_gridFault, event); }
85 virtual void OnGridPFBranchesKeyDown(wxKeyEvent& event) { GridKeyHandler(m_gridPFBranches, event); }
86 virtual void OnGridPFBusesKeyDown(wxKeyEvent& event) { GridKeyHandler(m_gridPFBuses, event); }
87 virtual void OnGridPFKeyDown(wxKeyEvent& event) { GridKeyHandler(m_gridPowerFlow, event); }
88 Workspace* m_workspace = nullptr;
89 bool m_changingValues = false;
90
91 wxGrid* m_currentGrid = nullptr;
92 int m_fontSize = 10;
93 int m_precision = 4;
94
95 // Headers choices
96 wxArrayString m_voltageChoices;
97 wxArrayString m_phaseVoltageChoices;
98 wxArrayString m_activePowerChoices;
99 wxArrayString m_reactivePowerChoices;
100 wxArrayString m_resistanceChoices;
101 wxArrayString m_indReactanceChoices;
102 wxArrayString m_capSusceptanceChoices;
103 wxArrayString m_currentChoices;
104
105 // Colors
106 wxColour m_headerColour;
107 wxColour m_offlineColour;
108 wxColour m_oddRowColour;
109 wxColour m_evenRowColour;
110};
111#endif // DATAREPORT_H
Form that shows the results of power flow and fault calculations.
Definition DataReport.h:34
Base class for electrical calculations providing general utility methods.
This class manages the graphical and power elements. It is responsible for handling the user's intera...
Definition Workspace.h:103