37#include <wx/filedlg.h>
48 if( !aLayerMask.any() )
52 if( aLayerMask[
F_Cu] && aLayerMask[
B_Cu] )
56 if( aLayerMask[
F_Cu] )
60 if( aLayerMask[
B_Cu] )
70 std::map<
size_t, std::vector<ODB_NET_RECORD>>& aRecords )
74 for(
PAD*
pad : footprint->Pads() )
80 if( !net_point.
side.empty() && net_point.
side !=
"I" )
82 if(
pad->GetNetCode() == 0 )
87 net_point.
refdes = footprint->GetReference();
89 net_point.
hole =
pad->HasHole();
125 net_point.
x_size =
pad->GetSize( sideLayer ).x;
131 net_point.
y_size =
pad->GetSize( sideLayer ).y;
133 aRecords[
pad->GetNetCode()].push_back( net_point );
144 if( ( top_layer ==
F_Cu ) && ( bottom_layer ==
B_Cu ) )
148 if( top_layer ==
F_Cu )
152 if( bottom_layer ==
B_Cu )
161 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;
Information pertinent to a Pcbnew printed circuit board.
int GetCopperLayerCount() const
const FOOTPRINTS & Footprints() const
const TRACKS & Tracks() const
LSET is a set of PCB_LAYER_IDs.
static const LSET & AllCuMask()
return AllCuMask( MAX_CU_LAYERS );
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)
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)
@ NPTH
like PAD_PTH, but not plated mechanical use only, no connection allowed
@ SMD
Smd pad, appears on the solder paste layer (default)
@ CONN
Like smd, does not appear on the solder paste layer (default) Note: also has a special attribute in G...
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
VECTOR2< int32_t > VECTOR2I
Definition of file extensions used in Kicad.