KiCad PCB EDA Suite
Loading...
Searching...
No Matches
odb_netlist.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 * Author: SYSUEric <[email protected]>.
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#ifndef _ODB_NETLIST_H_
22#define _ODB_NETLIST_H_
23
24#include <wx/string.h>
25
26// Structure for holding the ODB net point record.
28{
29 bool smd;
30 bool hole;
31 bool is_via;
33 std::string refdes;
36 std::string side; // B: Both, T: Top, D: Down
37
38 // All these in PCB units, will be output in decimils
41 // Width and height of non-drilled pads (only when radius = 0).
42 int x_size; // Width
43 int y_size; // Height
44 // int rotation;
45
46 std::string epoint; // e: net end point, m: net mid point
47
48 int soldermask; // !< e — Solder mask exposed point. soldermask = 0
49 // !< c — Solder mask covered point. = 3
50 // !< p — Solder mask covered point on top side of product model. = 1
51 // !< s — Solder mask covered point on bottom side of product model. = 2
52};
53
54
55class BOARD;
56class PCB_IO_ODBPP;
57struct ODB_FORMAT;
59{
60public:
61 ODB_NET_LIST( BOARD* aBoard, PCB_IO_ODBPP* aPlugin ) : m_board( aBoard ), m_plugin( aPlugin ) {}
62
63 virtual ~ODB_NET_LIST() {}
64
65 void Write( std::ostream& aStream, const ODB_FORMAT& aFormat );
66
67private:
70 std::string ComputeViaAccessSide( BOARD* aBoard, int top_layer, int bottom_layer );
71
72 void InitNetPoints( std::map<size_t, std::vector<ODB_NET_RECORD>>& aRecords );
74 void WriteNetPointRecords( std::map<size_t, std::vector<ODB_NET_RECORD>>& aRecords,
75 std::ostream& aStream,
76 const ODB_FORMAT& aFormat );
77};
78
79#endif // _ODB_NETLIST_H_
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:410
BOARD * m_board
Definition odb_netlist.h:68
std::string ComputeViaAccessSide(BOARD *aBoard, int top_layer, int bottom_layer)
void WriteNetPointRecords(std::map< size_t, std::vector< ODB_NET_RECORD > > &aRecords, std::ostream &aStream, const ODB_FORMAT &aFormat)
Writes a list of records to the given output stream.
PCB_IO_ODBPP * m_plugin
Definition odb_netlist.h:69
ODB_NET_LIST(BOARD *aBoard, PCB_IO_ODBPP *aPlugin)
Definition odb_netlist.h:61
void Write(std::ostream &aStream, const ODB_FORMAT &aFormat)
virtual ~ODB_NET_LIST()
Definition odb_netlist.h:63
void InitNetPoints(std::map< size_t, std::vector< ODB_NET_RECORD > > &aRecords)
std::string side
Definition odb_netlist.h:36
std::string epoint
Definition odb_netlist.h:46
std::string refdes
Definition odb_netlist.h:33