KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_board_statistics.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2019 Alexander Shuklin, [email protected]
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25
26#ifndef _DIALOG_BOARD_STATISTICS_H
27#define _DIALOG_BOARD_STATISTICS_H
28
29
30#include <board.h>
31#include <footprint.h>
32#include <pcb_track.h>
34#include <board_statistics.h>
35#include <pcb_base_frame.h>
36#include <pcb_edit_frame.h>
37#include <project.h>
38#include <wx/datetime.h>
39
44{
45public:
49 template <typename T>
51 {
52 INFO_LINE_ITEM( T aAttribute, const wxString& aTitle ) :
53 m_Attribute( aAttribute ),
54 m_Title( aTitle ),
55 m_Qty( 0 )
56 {
57 }
58
60 wxString m_Title;
61 int m_Qty;
62 };
63
69 {
70 FP_LINE_ITEM( int aAttributeMask, int aAttributeValue, wxString aTitle ) :
71 m_Attribute_mask( aAttributeMask ),
72 m_Attribute_value( aAttributeValue ),
73 m_Title( aTitle ),
74 m_FrontSideQty( 0 ),
75 m_BackSideQty( 0 )
76 {
77 }
78
81 wxString m_Title;
84 };
85
86
89
91 bool TransferDataToWindow() override;
92
93private:
94
96 void refreshItemsTypes();
97
99 void getDataFromPCB();
100
102 void updateWidgets();
103
105 void updateDrillGrid();
106
108 void printGridToStringAsTable( wxGrid* aGrid, wxString& aStr, bool aUseColLabels,
109 bool aUseFirstColAsLabel );
110
112
113 void checkboxClicked( wxCommandEvent& aEvent ) override;
114
116 void saveReportClicked( wxCommandEvent& aEvent ) override;
117
118 void drillGridSize( wxSizeEvent& aEvent ) override;
119
120 void drillGridSort( wxGridEvent& aEvent );
121
123
133
135
136 std::deque<FP_LINE_ITEM> m_fpTypes;
137 std::deque<INFO_LINE_ITEM<PAD_ATTRIB>> m_padTypes;
138 std::deque<INFO_LINE_ITEM<PAD_PROP>> m_padFabProps;
139 std::deque<INFO_LINE_ITEM<VIATYPE>> m_viaTypes;
140 std::deque<DRILL_LINE_ITEM> m_drillTypes;
141
145};
146
147#endif // __DIALOG_BOARD_STATISTICS_H
DIALOG_BOARD_STATISTICS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Board Statistics"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
void checkboxClicked(wxCommandEvent &aEvent) override
Save board statistics to a file.
void printGridToStringAsTable(wxGrid *aGrid, wxString &aStr, bool aUseColLabels, bool aUseFirstColAsLabel)
std::deque< INFO_LINE_ITEM< PAD_PROP > > m_padFabProps
std::deque< INFO_LINE_ITEM< PAD_ATTRIB > > m_padTypes
std::deque< FP_LINE_ITEM > m_fpTypes
int m_startLayerColInitialSize
Width of the start layer column as calculated by the wxWidgets autosizing algorithm.
void updateWidgets()
Update drills grid.
void saveReportClicked(wxCommandEvent &aEvent) override
void updateDrillGrid()
Print grid to string in tabular format.
~DIALOG_BOARD_STATISTICS()
Get data from the PCB board and print it to dialog.
int m_stopLayerColInitialSize
Width of the stop layer column.
DIALOG_BOARD_STATISTICS(PCB_EDIT_FRAME *aParentFrame)
void drillGridSort(wxGridEvent &aEvent)
void refreshItemsTypes()
< Function to fill up all items types to be shown in the dialog.
void drillGridSize(wxSizeEvent &aEvent) override
bool m_hasOutline
Show if board outline properly defined.
std::deque< DRILL_LINE_ITEM > m_drillTypes
std::deque< INFO_LINE_ITEM< VIATYPE > > m_viaTypes
void getDataFromPCB()
Apply data to dialog widgets.
The main frame for Pcbnew.
FP_LINE_ITEM(int aAttributeMask, int aAttributeValue, wxString aTitle)
INFO_LINE_ITEM(T aAttribute, const wxString &aTitle)