38#include <wx/filedlg.h>
49 if( !aLayerMask.any() )
53 if( aLayerMask[
F_Cu] && aLayerMask[
B_Cu] )
57 if( aLayerMask[
F_Cu] )
61 if( aLayerMask[
B_Cu] )
71 std::map<
size_t, std::vector<ODB_NET_RECORD>>& aRecords )
77 for(
PAD*
pad : footprint->Pads() )
83 if( !net_point.
side.empty() && net_point.
side !=
"I" )
85 if(
pad->GetNetCode() == 0 )
90 net_point.
refdes = footprint->GetReference();
92 net_point.
hole =
pad->HasHole();
99 net_point.
smd =
pad->GetAttribute() == PAD_ATTRIB::SMD
100 ||
pad->GetAttribute() == PAD_ATTRIB::CONN;
102 net_point.
mechanical = (
pad->GetAttribute() == PAD_ATTRIB::NPTH );
130 aRecords[
pad->GetNetCode()].push_back( net_point );
141 if( ( top_layer ==
F_Cu ) && ( bottom_layer ==
B_Cu ) )
145 if( top_layer ==
F_Cu )
149 if( bottom_layer ==
B_Cu )
158 std::map<
size_t, std::vector<ODB_NET_RECORD>>& aRecords )
163 for(
auto track : aBoard->
Tracks() )
170 via->LayerPair( &top_layer, &bottom_layer );
175 if( net_point.
side !=
"I" )
178 net_point.
smd =
false;
179 net_point.
hole =
true;
207 aRecords[net->
GetNetCode()].push_back( net_point );
215 std::ostream& aStream )
217 aStream <<
"H optimize n staggered n" << std::endl;
219 for(
const auto& [key, vec] : aRecords )
224 aStream <<
"#" << std::endl <<
"#Netlist points" << std::endl <<
"#" << std::endl;
226 for(
const auto& [key, vec] : aRecords )
228 for(
const auto& net_point : vec )
230 aStream << key <<
" ";
238 <<
ODB::Data2String( net_point.y_location ) <<
" " << net_point.side <<
" ";
240 if( !net_point.hole )
246 if( net_point.soldermask == 3 )
248 else if( net_point.soldermask == 2 )
250 else if( net_point.soldermask == 1 )
252 else if( net_point.soldermask == 0 )
255 aStream << net_point.epoint <<
" " << exp;
258 aStream <<
" staggered 0 0 0";
260 if( net_point.is_via )
263 aStream << std::endl;
271 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()
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)
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
Definition of file extensions used in Kicad.