-
-
Notifications
You must be signed in to change notification settings - Fork 627
Expand file tree
/
Copy pathboard_statistics_report.h
More file actions
108 lines (90 loc) · 3.34 KB
/
board_statistics_report.h
File metadata and controls
108 lines (90 loc) · 3.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PCBNEW_BOARD_STATISTICS_REPORT_H
#define PCBNEW_BOARD_STATISTICS_REPORT_H
#include <board_statistics.h>
#include <units_provider.h>
#include <pcb_track_types.h>
#include <vector>
class BOARD;
struct BOARD_STATISTICS_OPTIONS
{
bool excludeFootprintsWithoutPads = false;
bool subtractHolesFromBoardArea = false;
bool subtractHolesFromCopperAreas = false;
};
struct BOARD_STATISTICS_FP_ENTRY
{
BOARD_STATISTICS_FP_ENTRY( int aMask, int aValue, const wxString& aTitle ) :
attributeMask( aMask ),
attributeValue( aValue ),
title( aTitle )
{
}
int attributeMask;
int attributeValue;
wxString title;
int frontCount = 0;
int backCount = 0;
};
template <typename T>
struct BOARD_STATISTICS_INFO_ENTRY
{
BOARD_STATISTICS_INFO_ENTRY( T aAttribute, const wxString& aTitle ) :
attribute( aAttribute ),
title( aTitle )
{
}
T attribute;
wxString title;
int quantity = 0;
};
struct BOARD_STATISTICS_DATA
{
BOARD_STATISTICS_DATA();
void ResetCounts();
bool hasOutline;
int boardWidth;
int boardHeight;
double boardArea;
double frontCopperArea;
double backCopperArea;
double frontFootprintCourtyardArea;
double backFootprintCourtyardArea;
double frontFootprintDensity;
double backFootprintDensity;
int minClearanceTrackToTrack;
int minTrackWidth;
int minDrillSize;
int boardThickness;
std::vector<BOARD_STATISTICS_FP_ENTRY> footprintEntries;
std::vector<BOARD_STATISTICS_INFO_ENTRY<PAD_ATTRIB>> padEntries;
std::vector<BOARD_STATISTICS_INFO_ENTRY<PAD_PROP>> padPropertyEntries;
std::vector<BOARD_STATISTICS_INFO_ENTRY<VIATYPE>> viaEntries;
std::vector<DRILL_LINE_ITEM> drillEntries;
};
void InitializeBoardStatisticsData( BOARD_STATISTICS_DATA& aData );
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 );
wxString FormatBoardStatisticsJson( const BOARD_STATISTICS_DATA& aData, BOARD* aBoard,
const UNITS_PROVIDER& aUnitsProvider, const wxString& aProjectName,
const wxString& aBoardName );
#endif