39#include <wx/filedlg.h>
51 if( ( top_layer ==
F_Cu ) && ( bottom_layer ==
B_Cu ) )
55 if( top_layer ==
F_Cu )
59 if( bottom_layer ==
B_Cu )
73 record.
is_via = point.m_via !=
nullptr;
77 record.
epoint = point.m_netEnd ?
"e" :
"m";
79 if( point.m_frontMask )
82 if( point.m_backMask )
88 via->LayerPair( &
top, &bottom );
91 if( record.
side ==
"I" )
104 const PAD*
pad = point.m_pad;
106 if( !point.m_front && !point.m_back )
109 record.
side = point.m_front && point.m_back ?
"B" : point.m_front ?
"T" :
"D";
110 record.
refdes =
pad->GetParentFootprint()->GetReference();
120 record.
x_size =
pad->GetSize( sideLayer ).x;
126 record.
y_size =
pad->GetSize( sideLayer ).y;
129 aRecords[point.m_netCode].push_back( record );
135 std::ostream& aStream,
138 aStream <<
"H optimize n staggered n" << std::endl;
141 for(
const auto& [key, vec] : aRecords )
143 aStream <<
"$" << key <<
" " <<
m_plugin->GetLegalNetName(
static_cast<int>( key ) ) << std::endl;
146 aStream <<
"#" << std::endl <<
"#Netlist points" << std::endl <<
"#" << std::endl;
148 for(
const auto& [key, vec] : aRecords )
150 for(
const auto& net_point : vec )
152 aStream << key <<
" ";
161 << net_point.side <<
" ";
163 if( !net_point.hole )
169 if( net_point.soldermask == 3 )
171 else if( net_point.soldermask == 2 )
173 else if( net_point.soldermask == 1 )
175 else if( net_point.soldermask == 0 )
178 aStream << net_point.epoint <<
" " << exp;
181 aStream <<
" staggered 0 0 0";
183 if( net_point.is_via )
186 if( net_point.testpoint )
189 aStream << std::endl;
197 std::map<size_t, std::vector<ODB_NET_RECORD>> net_point_records;
Information pertinent to a Pcbnew printed circuit board.
std::string ComputeViaAccessSide(BOARD *aBoard, int top_layer, int bottom_layer)
void WriteNetPointRecords(std::map< size_t, std::vector< ODB_NET_RECORD > > &aRecords, std::ostream &aStream, const ODB_FORMAT &aFormat)
Writes a list of records to the given output stream.
void Write(std::ostream &aStream, const ODB_FORMAT &aFormat)
void InitNetPoints(std::map< size_t, std::vector< ODB_NET_RECORD > > &aRecords)
This file is part of the common library.
FAB_PAD_ROLE GetFabPadRole(const PAD &aPad)
Explicit fabrication properties take precedence over the unnumbered NPTH fallback.
std::vector< FAB_TEST_POINT > FabTestPoints(const BOARD &aBoard)
The caller must build board connectivity before enumerating net endpoints.
PCB_LAYER_ID
A quick note on layer IDs:
This file contains miscellaneous commonly used macros and functions.
wxString Data2String(const ODB_FORMAT &aFormat, double aVal)
@ 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...
KIBIS top(path, &reporter)
Definition of file extensions used in Kicad.