43 if( ( top_layer ==
F_Cu ) && ( bottom_layer ==
B_Cu ) )
47 if( top_layer ==
F_Cu )
51 if( bottom_layer ==
B_Cu )
65 record.
is_via = point.m_via !=
nullptr;
69 record.
epoint = point.m_netEnd ?
"e" :
"m";
71 if( point.m_frontMask )
74 if( point.m_backMask )
80 via->LayerPair( &
top, &bottom );
96 const PAD*
pad = point.m_pad;
101 if( !point.m_front && !point.m_back )
104 if( point.m_front && point.m_back )
106 else if( point.m_front )
111 record.
refdes =
pad->GetParentFootprint()->GetReference();
124 record.
x_size =
pad->GetSize( sideLayer ).x;
130 record.
y_size =
pad->GetSize( sideLayer ).y;
133 aRecords[point.m_netCode].push_back( record );
154 std::ostream& aStream,
157 aStream <<
"H optimize n staggered n" << std::endl;
160 for(
const auto& [key, vec] : aRecords )
162 aStream <<
"$" << key <<
" " <<
m_plugin->GetLegalNetName(
static_cast<int>( key ) ) << std::endl;
165 aStream <<
"#" << std::endl <<
"#Netlist points" << std::endl <<
"#" << std::endl;
167 for(
const auto& [key, vec] : aRecords )
169 for(
const auto& net_point : vec )
171 aStream << key <<
" ";
182 if( !net_point.hole )
188 if( net_point.soldermask == 3 )
190 else if( net_point.soldermask == 2 )
192 else if( net_point.soldermask == 1 )
194 else if( net_point.soldermask == 0 )
197 aStream << net_point.epoint <<
" " << exp;
200 aStream <<
" staggered 0 0 0";
202 if( net_point.is_via )
205 if( net_point.testpoint )
208 aStream << std::endl;
216 std::map<size_t, std::vector<ODB_NET_RECORD>> net_point_records;
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)
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:
wxString Data2String(const ODB_FORMAT &aFormat, double aVal)
static std::string_view SideToString(ODB_NET_RECORD::SIDE aSide)
static ODB_NET_RECORD::SIDE ComputeViaAccessSide(int top_layer, int bottom_layer)
@ NPTH
like PAD_PTH, but not plated mechanical use only, no connection allowed
@ NON_COMPONENT
Pad with no hole that does not connect to a physical component, but rather provides a connection poin...
@ 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...
SIDE
Possible values for the "side" of an ODB net point.
KIBIS top(path, &reporter)