KiCad PCB EDA Suite
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 <jon@craftyjon.com>
5  * Copyright (C) 2020 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 along
18  * with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #include <wx/string.h>
22 
23 class BOARD;
24 class wxWindow;
25 
26 
27 /* Structure for holding the D-356 record fields.
28  * Useful because 356A (when implemented) must be sorted before outputting it */
30 {
31  bool smd;
32  bool hole;
33  wxString netname;
34  wxString refdes;
35  wxString pin;
36  bool midpoint;
37  int drill;
38  bool mechanical;
39  int access; // Access 0 is 'both sides'
41  // All these in PCB units, will be output in decimils
44  int x_size;
45  int y_size;
46  int rotation;
47 };
48 
49 
54 {
55 public:
61  IPC356D_WRITER( BOARD* aPcb, wxWindow* aParent = nullptr ) :
62  m_pcb( aPcb ), m_parent( aParent )
63  {}
64 
65  virtual ~IPC356D_WRITER() {}
66 
71  void Write( const wxString& aFilename );
72 
73 private:
75 
76  wxWindow* m_parent;
77 
79  void write_D356_records( std::vector<D356_RECORD> &aRecords, FILE* aFile );
80 };
wxString pin
Definition: export_d356.h:35
void Write(const wxString &aFilename)
Generates and writes the netlist to a given path.
IPC356D_WRITER(BOARD *aPcb, wxWindow *aParent=nullptr)
Constructs an IPC-356D file writer.
Definition: export_d356.h:61
int x_location
Definition: export_d356.h:42
wxWindow * m_parent
Definition: export_d356.h:76
bool mechanical
Definition: export_d356.h:38
void write_D356_records(std::vector< D356_RECORD > &aRecords, FILE *aFile)
Writes a list of records to the given output stream.
virtual ~IPC356D_WRITER()
Definition: export_d356.h:65
bool midpoint
Definition: export_d356.h:36
Wrapper to expose an API for writing IPC-D356 files.
Definition: export_d356.h:53
wxString refdes
Definition: export_d356.h:34
BOARD * m_pcb
Definition: export_d356.h:74
int soldermask
Definition: export_d356.h:40
wxString netname
Definition: export_d356.h:33
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:180
int y_location
Definition: export_d356.h:43