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();
127 aRecords[
pad->GetNetCode()].push_back( net_point );
138 if( ( top_layer ==
F_Cu ) && ( bottom_layer ==
B_Cu ) )
142 if( top_layer ==
F_Cu )
146 if( bottom_layer ==
B_Cu )
155 std::map<
size_t, std::vector<ODB_NET_RECORD>>& aRecords )
158 for(
auto track : aBoard->
Tracks() )
165 via->LayerPair( &top_layer, &bottom_layer );
170 if( net_point.
side !=
"I" )
173 net_point.
smd =
false;
174 net_point.
hole =
true;
202 aRecords[net->
GetNetCode()].push_back( net_point );
210 std::ostream& aStream )
212 aStream <<
"H optimize n staggered n" << std::endl;
214 for(
const auto& [key, vec] : aRecords )
219 aStream <<
"#" << std::endl <<
"#Netlist points" << std::endl <<
"#" << std::endl;
221 for(
const auto& [key, vec] : aRecords )
223 for(
const auto& net_point : vec )
225 aStream << key <<
" ";
233 <<
ODB::Data2String( net_point.y_location ) <<
" " << net_point.side <<
" ";
235 if( !net_point.hole )
241 if( net_point.soldermask == 3 )
243 else if( net_point.soldermask == 2 )
245 else if( net_point.soldermask == 1 )
247 else if( net_point.soldermask == 0 )
250 aStream << net_point.epoint <<
" " << exp;
253 aStream <<
" staggered 0 0 0";
255 if( net_point.is_via )
258 aStream << std::endl;
266 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)
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)
@ 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.