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;
98 if( !point.m_front && !point.m_back )
101 if( point.m_front && point.m_back )
103 else if( point.m_front )
108 record.
refdes =
pad->GetParentFootprint()->GetReference();
119 record.
x_size =
pad->GetSize( sideLayer ).x;
125 record.
y_size =
pad->GetSize( sideLayer ).y;
128 aRecords[point.m_netCode].push_back( record );
149 std::ostream& aStream,
152 aStream <<
"H optimize n staggered n" << std::endl;
155 for(
const auto& [key, vec] : aRecords )
157 aStream <<
"$" << key <<
" " <<
m_plugin->GetLegalNetName(
static_cast<int>( key ) ) << std::endl;
160 aStream <<
"#" << std::endl <<
"#Netlist points" << std::endl <<
"#" << std::endl;
162 for(
const auto& [key, vec] : aRecords )
164 for(
const auto& net_point : vec )
166 aStream << key <<
" ";
177 if( !net_point.hole )
183 if( net_point.soldermask == 3 )
185 else if( net_point.soldermask == 2 )
187 else if( net_point.soldermask == 1 )
189 else if( net_point.soldermask == 0 )
192 aStream << net_point.epoint <<
" " << exp;
195 aStream <<
" staggered 0 0 0";
197 if( net_point.is_via )
200 if( net_point.testpoint )
203 aStream << std::endl;
211 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
@ 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)