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 (C) 2024 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 along
18 * with this program. If not, see <http://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;
32 wxString netname;
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;
57{
58public:
59 ODB_NET_LIST( BOARD* aBoard ) : m_board( aBoard ) {}
60
61 virtual ~ODB_NET_LIST() {}
62
63 void Write( std::ostream& aStream );
64
65private:
67 std::string ComputePadAccessSide( BOARD* aBoard, LSET aLayerMask );
68 std::string ComputeViaAccessSide( BOARD* aBoard, int top_layer, int bottom_layer );
69
70 void InitPadNetPoints( BOARD* aBoard, std::map<size_t, std::vector<ODB_NET_RECORD>>& aRecords );
71 void InitViaNetPoints( BOARD* aBoard, std::map<size_t, std::vector<ODB_NET_RECORD>>& aRecords );
73 void WriteNetPointRecords( std::map<size_t, std::vector<ODB_NET_RECORD>>& aRecords,
74 std::ostream& aStream );
75};
76
77#endif // _ODB_NETLIST_H_
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:290
LSET is a set of PCB_LAYER_IDs.
Definition: lset.h:36
BOARD * m_board
Definition: odb_netlist.h:66
void WriteNetPointRecords(std::map< size_t, std::vector< ODB_NET_RECORD > > &aRecords, std::ostream &aStream)
Writes a list of records to the given output stream.
ODB_NET_LIST(BOARD *aBoard)
Definition: odb_netlist.h:59
void InitViaNetPoints(BOARD *aBoard, std::map< size_t, std::vector< ODB_NET_RECORD > > &aRecords)
std::string ComputeViaAccessSide(BOARD *aBoard, int top_layer, int bottom_layer)
void Write(std::ostream &aStream)
void InitPadNetPoints(BOARD *aBoard, std::map< size_t, std::vector< ODB_NET_RECORD > > &aRecords)
Definition: odb_netlist.cpp:77
std::string ComputePadAccessSide(BOARD *aBoard, LSET aLayerMask)
Definition: odb_netlist.cpp:45
virtual ~ODB_NET_LIST()
Definition: odb_netlist.h:61
std::string side
Definition: odb_netlist.h:36
std::string epoint
Definition: odb_netlist.h:46
wxString netname
Definition: odb_netlist.h:32
std::string refdes
Definition: odb_netlist.h:33