KiCad PCB EDA Suite
Loading...
Searching...
No Matches
board_statistics_report.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 The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef PCBNEW_BOARD_STATISTICS_REPORT_H
21#define PCBNEW_BOARD_STATISTICS_REPORT_H
22
23#include <board_statistics.h>
24#include <units_provider.h>
25
26#include <vector>
27
28class BOARD;
29enum class VIATYPE : int;
30
37
39{
40 BOARD_STATISTICS_FP_ENTRY( int aMask, int aValue, const wxString& aTitle ) :
41 attributeMask( aMask ),
42 attributeValue( aValue ),
43 title( aTitle )
44 {
45 }
46
49 wxString title;
50 int frontCount = 0;
51 int backCount = 0;
52};
53
54template <typename T>
56{
57 BOARD_STATISTICS_INFO_ENTRY( T aAttribute, const wxString& aTitle ) :
58 attribute( aAttribute ),
59 title( aTitle )
60 {
61 }
62
64 wxString title;
65 int quantity = 0;
66};
67
69{
71
72 void ResetCounts();
73
77 double boardArea;
84
85 std::vector<BOARD_STATISTICS_FP_ENTRY> footprintEntries;
86 std::vector<BOARD_STATISTICS_INFO_ENTRY<PAD_ATTRIB>> padEntries;
87 std::vector<BOARD_STATISTICS_INFO_ENTRY<PAD_PROP>> padPropertyEntries;
88 std::vector<BOARD_STATISTICS_INFO_ENTRY<VIATYPE>> viaEntries;
89 std::vector<DRILL_LINE_ITEM> drillEntries;
90};
91
93
94void ComputeBoardStatistics( BOARD* aBoard, const BOARD_STATISTICS_OPTIONS& aOptions, BOARD_STATISTICS_DATA& aData );
95
96wxString FormatBoardStatisticsReport( const BOARD_STATISTICS_DATA& aData, BOARD* aBoard,
97 const UNITS_PROVIDER& aUnitsProvider, const wxString& aProjectName,
98 const wxString& aBoardName );
99
100wxString FormatBoardStatisticsJson( const BOARD_STATISTICS_DATA& aData, BOARD* aBoard,
101 const UNITS_PROVIDER& aUnitsProvider, const wxString& aProjectName,
102 const wxString& aBoardName );
103
104#endif
wxString FormatBoardStatisticsJson(const BOARD_STATISTICS_DATA &aData, BOARD *aBoard, const UNITS_PROVIDER &aUnitsProvider, const wxString &aProjectName, const wxString &aBoardName)
void ComputeBoardStatistics(BOARD *aBoard, const BOARD_STATISTICS_OPTIONS &aOptions, BOARD_STATISTICS_DATA &aData)
wxString FormatBoardStatisticsReport(const BOARD_STATISTICS_DATA &aData, BOARD *aBoard, const UNITS_PROVIDER &aUnitsProvider, const wxString &aProjectName, const wxString &aBoardName)
void InitializeBoardStatisticsData(BOARD_STATISTICS_DATA &aData)
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:322
VIATYPE
Definition pcb_track.h:67
std::vector< BOARD_STATISTICS_INFO_ENTRY< PAD_ATTRIB > > padEntries
std::vector< BOARD_STATISTICS_FP_ENTRY > footprintEntries
std::vector< BOARD_STATISTICS_INFO_ENTRY< VIATYPE > > viaEntries
std::vector< BOARD_STATISTICS_INFO_ENTRY< PAD_PROP > > padPropertyEntries
std::vector< DRILL_LINE_ITEM > drillEntries
int attributeMask
int attributeValue
int backCount
BOARD_STATISTICS_FP_ENTRY(int aMask, int aValue, const wxString &aTitle)
int frontCount
wxString title
int quantity
BOARD_STATISTICS_INFO_ENTRY(T aAttribute, const wxString &aTitle)
wxString title
T attribute