39#include <wx/filedlg.h>
50 if( !aLayerMask.any() )
54 if( aLayerMask[
F_Cu] && aLayerMask[
B_Cu] )
58 if( aLayerMask[
F_Cu] )
62 if( aLayerMask[
B_Cu] )
72 std::map<
size_t, std::vector<ODB_NET_RECORD>>& aRecords )
78 for(
PAD*
pad : footprint->Pads() )
84 if( !net_point.
side.empty() && net_point.
side !=
"I" )
86 if(
pad->GetNetCode() == 0 )
91 net_point.
refdes = footprint->GetReference();
93 net_point.
hole =
pad->HasHole();
100 net_point.
smd =
pad->GetAttribute() == PAD_ATTRIB::SMD
101 ||
pad->GetAttribute() == PAD_ATTRIB::CONN;
103 net_point.
mechanical = (
pad->GetAttribute() == PAD_ATTRIB::NPTH );
131 aRecords[
pad->GetNetCode()].push_back( net_point );
142 if( ( top_layer ==
F_Cu ) && ( bottom_layer ==
B_Cu ) )
146 if( top_layer ==
F_Cu )
150 if( bottom_layer ==
B_Cu )
159 std::map<
size_t, std::vector<ODB_NET_RECORD>>& aRecords )
164 for(
auto track : aBoard->
Tracks() )
171 via->LayerPair( &top_layer, &bottom_layer );
176 if( net_point.
side !=
"I" )
179 net_point.
smd =
false;
180 net_point.
hole =
true;
208 aRecords[net->
GetNetCode()].push_back( net_point );
216 std::ostream& aStream )
218 aStream <<
"H optimize n staggered n" << std::endl;
220 for(
const auto& [key, vec] : aRecords )
225 aStream <<
"#" << std::endl <<
"#Netlist points" << std::endl <<
"#" << std::endl;
227 for(
const auto& [key, vec] : aRecords )
229 for(
const auto& net_point : vec )
231 aStream << key <<
" ";
239 <<
ODB::Data2String( net_point.y_location ) <<
" " << net_point.side <<
" ";
241 if( !net_point.hole )
247 if( net_point.soldermask == 3 )
249 else if( net_point.soldermask == 2 )
251 else if( net_point.soldermask == 1 )
253 else if( net_point.soldermask == 0 )
256 aStream << net_point.epoint <<
" " << exp;
259 aStream <<
" staggered 0 0 0";
261 if( net_point.is_via )
264 aStream << std::endl;
272 std::map<size_t, std::vector<ODB_NET_RECORD>> net_point_records;
const VECTOR2I & GetAuxOrigin() const
Information pertinent to a Pcbnew printed circuit board.
int GetCopperLayerCount() const
const FOOTPRINTS & Footprints() const
const TRACKS & Tracks() const
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
LSET is a set of PCB_LAYER_IDs.
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Handle the data for a net.
const wxString & GetNetname() const
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.
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)
std::string ComputePadAccessSide(BOARD *aBoard, LSET aLayerMask)
static constexpr PCB_LAYER_ID ALL_LAYERS
! Temporary layer identifier to identify code that is not padstack-aware
This file is part of the common library.
PCB_LAYER_ID
A quick note on layer IDs:
This file contains miscellaneous commonly used macros and functions.
wxString Data2String(double aVal)
wxString GenLegalNetName(const wxString &aStr)
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
Definition of file extensions used in Kicad.