KiCad PCB EDA Suite
Loading...
Searching...
No Matches
drill_chart_template.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
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#ifndef DRILL_CHART_TEMPLATE_H
21#define DRILL_CHART_TEMPLATE_H
22
23#include <optional>
24#include <vector>
25
27#include <math/vector2d.h>
28#include <wx/string.h>
29
30
46
47
52
53
58{
59 bool m_Plated = true;
60 bool m_NonPlated = true;
61 bool m_Vias = true;
62 bool m_Slots = true;
63 bool m_Backdrills = true;
64 bool m_Castellated = true;
65
66 bool operator==( const DRILL_CHART_FILTER& aOther ) const;
67};
68
69
77{
78public:
80
82
83 void SetName( const wxString& aName ) { m_name = aName; }
84
85 std::vector<GENERATED_TABLE_COLUMN>& Columns() { return m_columns; }
86 const std::vector<GENERATED_TABLE_COLUMN>& Columns() const { return m_columns; }
87
89 void SetUnits( GENERATED_TABLE_UNITS aUnits ) { m_units = aUnits; }
90
91 int GetPrecision() const { return m_precision; }
92 void SetPrecision( int aPrecision ) { m_precision = aPrecision; }
93
94 bool GetShowTotals() const { return m_showTotals; }
95 void SetShowTotals( bool aShow ) { m_showTotals = aShow; }
96
104 bool SaveToFile( const wxString& aPath, wxString* aError ) const;
105 bool LoadFromFile( const wxString& aPath, wxString* aError );
106
107private:
112 wxString m_name;
114
115 std::vector<GENERATED_TABLE_COLUMN> m_columns;
119};
120
121#endif // DRILL_CHART_TEMPLATE_H
bool SaveToFile(const wxString &aPath, wxString *aError) const
Read and write a template as JSON.
void SetName(const wxString &aName)
void SetPrecision(int aPrecision)
wxString m_name
Identify the template file to whoever opens it.
GENERATED_TABLE_UNITS GetUnits() const
void SetShowTotals(bool aShow)
std::vector< GENERATED_TABLE_COLUMN > & Columns()
bool LoadFromFile(const wxString &aPath, wxString *aError)
GENERATED_TABLE_UNITS m_units
std::vector< GENERATED_TABLE_COLUMN > m_columns
static DRILL_CHART_TEMPLATE MakeDefault()
void SetUnits(GENERATED_TABLE_UNITS aUnits)
const std::vector< GENERATED_TABLE_COLUMN > & Columns() const
The columns one generator (the drill chart, a stackup table, ...) can produce, and the units and prec...
A base class for LIB_SYMBOL and SCH_SYMBOL.
Definition symbol.h:60
DRILL_CHART_COLUMN_ID
const GENERATED_TABLE_SCHEMA & DrillChartSchema()
Every column the drill chart schema knows how to build, in the order the schema lists them.
GENERATED_TABLE_UNITS
Which holes a chart reports on.
bool operator==(const DRILL_CHART_FILTER &aOther) const
@ DESCRIPTION
Field Description of part, i.e. "1/4W 1% Metal Film Resistor".