KiCad PCB EDA Suite
Loading...
Searching...
No Matches
export_d356.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) 2020 Jon Evans <[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 modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * 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, see <https://www.gnu.org/licenses/>.
19 */
20
21#include <vector>
22
23#include <wx/string.h>
24
25class BOARD;
26struct FAB_TEST_POINT;
27class wxWindow;
28
29
30/* Structure for holding the D-356 record fields.
31 * Useful because 356A must be sorted by net before outputting it */
33{
34 bool smd = false;
35 bool hole = false;
36 wxString netname;
37 wxString refdes;
38 wxString pin;
39 bool midpoint = false;
40 int drill = 0;
41 bool mechanical = false;
42 int access = 0; // Access 0 is 'both sides'
43 int soldermask = 0;
44 // Physical copper layers (1-based) spanned by a blind/buried via, 0 otherwise
45 int start_layer = 0;
46 int end_layer = 0;
47 // All these in PCB units, will be output in decimils
48 int x_location = 0;
49 int y_location = 0;
50 int x_size = 0;
51 int y_size = 0;
52 int rotation = 0;
53};
54
55
60{
61public:
67 m_pcb( aPcb ),
69 {}
70
71 virtual ~IPC356D_WRITER() {}
72
78 bool Write( const wxString& aFilename );
79
84 void SetDoNotExportUnconnectedPads( bool aDoNotExportUnconnectedPads )
85 {
86 m_doNotExportUnconnectedPads = aDoNotExportUnconnectedPads;
87 }
88
89private:
91
93 void write_D356_records( std::vector<D356_RECORD> &aRecords, FILE* aFile );
94
95 void appendPadRecords( BOARD* aPcb, const std::vector<FAB_TEST_POINT>& aPoints,
96 std::vector<D356_RECORD>& aRecords );
97
99};
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:410
bool m_doNotExportUnconnectedPads
Definition export_d356.h:98
void write_D356_records(std::vector< D356_RECORD > &aRecords, FILE *aFile)
Writes a list of records to the given output stream.
void SetDoNotExportUnconnectedPads(bool aDoNotExportUnconnectedPads)
Sets whether unconnected pads should be exported.
Definition export_d356.h:84
void appendPadRecords(BOARD *aPcb, const std::vector< FAB_TEST_POINT > &aPoints, std::vector< D356_RECORD > &aRecords)
IPC356D_WRITER(BOARD *aPcb)
Constructs an IPC-356D file writer.
Definition export_d356.h:66
bool Write(const wxString &aFilename)
Generates and writes the netlist to a given path.
virtual ~IPC356D_WRITER()
Definition export_d356.h:71
wxString refdes
Definition export_d356.h:37
bool mechanical
Definition export_d356.h:41
wxString pin
Definition export_d356.h:38
wxString netname
Definition export_d356.h:36