35#include <wx/filedlg.h>
36#include <wx/filename.h>
62#include <wx/stattext.h>
106 std::shared_ptr<NET_CONTEXT_MENU> netSubMenu = std::make_shared<NET_CONTEXT_MENU>();
107 netSubMenu->SetTool(
this );
110 auto showNetMenuFunc =
113 if( aSelection.Empty() )
116 for(
const EDA_ITEM* item : aSelection )
118 switch( item->Type() )
129 if( !
static_cast<const PCB_SHAPE*
>( item )->IsOnCopperLayer() )
147 menu.
AddMenu( netSubMenu.get(), showNetMenuFunc, 100 );
168 bool* aCourtyardError )
170 auto engine = std::make_unique<DRC_ENGINE>(
m_frame->GetBoard(),
171 &
m_frame->GetBoard()->GetDesignSettings() );
175 engine->InitEngine(
m_frame->GetBoard()->GetDesignRulesPath() );
180 *aCompileError =
true;
184 zone->CacheBoundingBox();
189 zone->CacheBoundingBox();
194 *aCourtyardError =
true;
221 + wxString::Format(
_(
"[netclass %s]" ),
232 std::vector<BOARD_ITEM*> toAdd;
234 for(
int i = 0; i < aCollector.
GetCount(); ++i )
240 group->RunOnChildren(
249 toAdd.push_back( child );
255 if(
pad->HitTest( aPos ) )
256 toAdd.push_back(
pad );
265 aCollector.
Append( item );
267 bool hasPadOrTrack =
false;
269 for(
int i = 0; i < aCollector.
GetCount(); ++i )
271 KICAD_T type = aCollector[i]->Type();
276 hasPadOrTrack =
true;
281 for(
int i = aCollector.
GetCount() - 1; i >= 0; --i )
298 const wxString& aPrompt,
299 const std::vector<KICAD_T>& aTypes,
309 statusPopup.SetText( aPrompt );
312 picker->SetSnapping(
false );
313 picker->ClearHandlers();
315 picker->SetClickHandler(
316 [&](
const VECTOR2D& aPoint ) ->
bool
325 for(
int i = collector.
GetCount() - 1; i >= 0; --i )
339 pickedItem = collector[0];
345 picker->SetMotionHandler(
355 for(
int i = collector.
GetCount() - 1; i >= 0; --i )
368 if( highlightedItem != item )
370 if( highlightedItem && highlightedItem != aLockedHighlight )
373 highlightedItem = item;
375 if( highlightedItem && highlightedItem != aLockedHighlight )
380 picker->SetCancelHandler(
383 if( highlightedItem && highlightedItem != aLockedHighlight )
386 highlightedItem =
nullptr;
391 picker->SetFinalizeHandler(
392 [&](
const int& aFinalState )
394 if( highlightedItem && highlightedItem != aLockedHighlight )
397 highlightedItem =
nullptr;
405 m_frame->GetCanvas()->SetStatusPopup( statusPopup.GetPanel() );
409 while( !done && !pickedItem )
417 picker->ClearHandlers();
418 m_frame->GetCanvas()->SetStatusPopup(
nullptr );
427 r->
Report(
_(
"Report incomplete: could not compile custom design rules." )
428 + wxS(
" " )
429 + wxS(
"<a href='$CUSTOM_RULES'>" ) +
_(
"Show design rules." ) + wxS(
"</a>" ) );
452 wxString layerStr =
_(
"Layer" ) + wxS(
" " ) +
m_frame->GetBoard()->GetLayerName( aLayer );
463class VECTOR_REPORTER :
public REPORTER
468 m_messages.push_back( aText );
472 bool HasMessage()
const override {
return !m_messages.empty(); }
475 std::vector<wxString> m_messages;
485 return wxT(
"<i>" ) +
_(
"undefined" ) + wxT(
"</i>" );
494 return wxT(
"<i>" ) +
_(
"undefined" ) + wxT(
"</i>" );
503 return wxT(
"<i>" ) +
_(
"undefined" ) + wxT(
"</i>" );
537 return wxEmptyString;
545 wxCHECK( drcTool &&
m_frame, );
566 bool compileError =
false;
567 bool courtyardError =
false;
568 std::unique_ptr<DRC_ENGINE> drcEngine =
makeDRCEngine( &compileError, &courtyardError );
573 wxString clearanceStr;
575 switch( aDRCItem->GetErrorCode() )
579 for(
KIID id : aDRCItem->GetIDs() )
588 reportHeader(
_(
"Diff pair uncoupled length resolution for:" ), ac, bc, r );
596 r->
Report( wxString::Format(
_(
"Resolved max uncoupled length: %s." ),
611 r->
Report( wxString::Format(
_(
"Resolved height constraints: min %s; max %s." ),
626 r->
Report( wxString::Format(
_(
"Resolved thickness constraints: min %s; max %s." ),
641 r->
Report( wxString::Format(
_(
"Resolved width constraints: min %s; max %s." ),
656 r->
Report( wxString::Format(
_(
"Resolved angle constraints: min %s; max %s." ),
663 reportHeader(
_(
"Track segment length resolution for:" ), a, r );
671 r->
Report( wxString::Format(
_(
"Resolved segment length constraints: min %s; max %s." ),
678 reportHeader(
_(
"Connection width resolution for:" ), a, b, r );
686 r->
Report( wxString::Format(
_(
"Resolved min connection width: %s." ),
700 r->
Report( wxString::Format(
_(
"Resolved diameter constraints: min %s; max %s." ),
707 reportHeader(
_(
"Via annular width resolution for:" ), a, r );
715 r->
Report( wxString::Format(
_(
"Resolved annular width constraints: min %s; max %s." ),
731 r->
Report( wxString::Format(
_(
"Resolved hole size constraints: min %s; max %s." ),
738 reportHeader(
_(
"Hole clearance resolution for:" ), a, b, r );
746 r->
Report(
_(
"Items belong to the same net. Clearance is 0." ) );
755 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ), clearanceStr ) );
761 reportHeader(
_(
"Physical hole clearance resolution for:" ), a, b, layer, r );
770 r->
Report(
_(
"No 'physical_hole_clearance' constraints defined." ) );
775 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ), clearanceStr ) );
782 reportHeader(
_(
"Hole-to-hole clearance resolution for:" ), a, b, r );
792 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ), clearanceStr ) );
797 reportHeader(
_(
"Edge clearance resolution for:" ), a, b, r );
807 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ), clearanceStr ) );
841 reportHeader(
_(
"Clearance resolution for:" ), a, b, layer, r );
849 r->
Report(
_(
"Items belong to the same net. Clearance is 0." ) );
858 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ), clearanceStr ) );
864 reportHeader(
_(
"Physical clearance resolution for:" ), a, b, layer, r );
873 r->
Report(
_(
"No 'physical_clearance' constraints defined." ) );
878 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ), clearanceStr ) );
890 drcEngine->ProcessAssertions( a, [](
const DRC_CONSTRAINT* c ){}, r );
900 dialog->
Show(
true );
910 wxCHECK( selTool, 0 );
918 if( !
selection.GetItem( 0 )->IsBOARD_ITEM() || !
selection.GetItem( 1 )->IsBOARD_ITEM() )
933 static const std::vector<KICAD_T> clearanceTypes = {
949 _(
"Select first item for clearance resolution..." ),
950 clearanceTypes,
nullptr );
960 _(
"Select second item for clearance resolution..." ),
961 clearanceTypes, firstItem );
968 if( firstItem == secondItem )
970 m_frame->ShowInfoBarError(
_(
"Select two different items for clearance resolution." ) );
982 wxCHECK(
m_frame && aItemA && aItemB, );
993 m_frame->ShowInfoBarError(
_(
"Cannot generate clearance report on empty group." ) );
1006 m_frame->ShowInfoBarError(
_(
"Cannot generate clearance report on empty group." ) );
1016 auto checkFootprint =
1019 PAD* foundPad =
nullptr;
1023 if( !foundPad ||
pad->SameLogicalPadAs( foundPad ) )
1036 a = checkFootprint(
static_cast<FOOTPRINT*
>( a ) );
1039 b = checkFootprint(
static_cast<FOOTPRINT*
>( b ) );
1061 ZONE* zone =
dynamic_cast<ZONE*
>( a );
1068 bool compileError =
false;
1069 bool courtyardError =
false;
1070 std::unique_ptr<DRC_ENGINE> drcEngine =
makeDRCEngine( &compileError, &courtyardError );
1072 if( copperIntersection.any() && zone &&
pad && zone->
GetNetCode() ==
pad->GetNetCode() )
1082 reportHeader(
_(
"Zone connection resolution for:" ), a, b, layer, r );
1084 constraint = drcEngine->EvalZoneConnection(
pad, zone, layer, r );
1090 reportHeader(
_(
"Thermal-relief gap resolution for:" ), a, b, layer, r );
1099 r->
Report( wxString::Format(
_(
"Resolved thermal relief gap: %s." ),
1100 m_frame->StringFromValue( gap,
true ) ) );
1104 reportHeader(
_(
"Thermal-relief spoke width resolution for:" ), a, b, layer, r );
1113 r->
Report( wxString::Format(
_(
"Resolved spoke width: %s." ),
1114 m_frame->StringFromValue( width,
true ) ) );
1118 reportHeader(
_(
"Thermal-relief min spoke count resolution for:" ), a, b, layer, r );
1127 r->
Report( wxString::Format(
_(
"Resolved min spoke count: %d." ),
1130 std::shared_ptr<CONNECTIVITY_DATA> connectivity =
pad->GetBoard()->GetConnectivity();
1136 reportHeader(
_(
"Zone clearance resolution for:" ), a, b, layer, r );
1140 r->
Report( wxString::Format(
_(
"Zone clearance: %s." ),
1150 r->
Report( wxString::Format(
_(
"Overridden by larger physical clearance from %s;"
1156 if( !
pad->FlashLayer( layer ) )
1166 r->
Report( wxString::Format(
_(
"Overridden by larger physical hole clearance "
1167 "from %s; clearance: %s." ),
1177 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1184 reportHeader(
_(
"Zone clearance resolution for:" ), a, b, layer, r );
1190 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1191 m_frame->StringFromValue( 0,
true ) ) );
1196 else if( copperIntersection.any() && !aFP && !bFP )
1200 std::vector<PCB_LAYER_ID> layers;
1202 if( copperIntersection.test( active ) )
1203 layers.push_back( active );
1207 if( layer != active )
1208 layers.push_back( layer );
1213 reportHeader(
_(
"Clearance resolution for:" ), a, b, layer, rep );
1217 rep->Report(
_(
"Items belong to the same net. Min clearance is 0." ) );
1229 if( constraint.
IsNull() )
1231 rep->Report(
_(
"Min clearance is 0." ) );
1235 rep->Report( wxString::Format(
_(
"Resolved clearance: %s; clearance will "
1241 rep->Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1246 if( layers.size() == 1 )
1251 fillReport( layer, r );
1256 auto perLayerMessages = std::make_shared<std::vector<std::vector<wxString>>>();
1257 perLayerMessages->reserve( layers.size() );
1261 VECTOR_REPORTER tmp;
1262 fillReport( layer, &tmp );
1263 perLayerMessages->push_back( std::move( tmp.m_messages ) );
1267 wxBoxSizer* vbox =
new wxBoxSizer( wxVERTICAL );
1269 wxChoice* choice =
new wxChoice( panel, wxID_ANY );
1272 choice->Append(
m_frame->GetBoard()->GetLayerName( layer ) );
1274 choice->SetSelection( 0 );
1277 wxHW_SCROLLBAR_AUTO | wxBORDER_SIMPLE );
1280 wxStaticText* layerLabel =
new wxStaticText( panel, wxID_ANY,
_(
"Layer:" ) );
1282 vbox->Add( layerLabel, 0, wxLEFT | wxRIGHT | wxTOP, 5 );
1283 vbox->Add( choice, 0, wxEXPAND | wxALL, 5 );
1284 vbox->Add( reportBox, 1, wxEXPAND | wxALL, 5 );
1285 panel->SetSizer( vbox );
1288 auto refresh = [reportBox, perLayerMessages](
int sel )
1292 if( sel >= 0 && sel < (
int) perLayerMessages->size() )
1294 for(
const wxString& line : ( *perLayerMessages )[sel] )
1295 reportBox->
Report( line );
1301 choice->Bind( wxEVT_CHOICE,
1302 [
refresh]( wxCommandEvent& evt )
1304 refresh( evt.GetSelection() );
1314 wxString coupledNet;
1323 if( !dpIntersection.test( dpLayer ) && dpIntersection.any() )
1324 dpLayer = dpIntersection.
Seq().front();
1327 reportHeader(
_(
"Diff-pair gap resolution for:" ), ac, bc, dpLayer, r );
1332 r->
Report( wxString::Format(
_(
"Resolved gap constraints: min %s; opt %s; max %s." ),
1340 reportHeader(
_(
"Diff-pair max uncoupled length resolution for:" ), ac, bc, dpLayer, r );
1345 r->
Report(
_(
"No 'diff_pair_uncoupled' constraints defined." ) );
1352 r->
Report( wxString::Format(
_(
"Resolved max uncoupled length: %s." ),
1360 auto isOnCorrespondingLayer=
1372 if( aItem->
IsOnLayer( correspondingMask ) )
1375 if( aItem->
IsTented( correspondingMask ) && aItem->
IsOnLayer( correspondingCopper ) )
1377 *aWarning = wxString::Format(
_(
"Note: %s is tented; clearance will only be "
1378 "applied to holes." ),
1390 if( ( a->
IsOnLayer( layer ) && isOnCorrespondingLayer( b, layer, &warning ) )
1391 || ( b->
IsOnLayer( layer ) && isOnCorrespondingLayer( a, layer, &warning ) ) )
1394 reportHeader(
_(
"Silkscreen clearance resolution for:" ), a, b, layer, r );
1404 if( !warning.IsEmpty() )
1407 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1419 if( aCourtyard && bCourtyard )
1422 reportHeader(
_(
"Courtyard clearance resolution for:" ), a, b, layer, r );
1431 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1441 bool pageAdded =
false;
1457 reportHeader(
_(
"Hole clearance resolution for:" ), a, b, layer, r );
1466 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1486 reportHeader(
_(
"Hole-to-hole clearance resolution for:" ), a, b, r );
1495 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1523 wxString layerName =
m_frame->GetBoard()->GetLayerName( edgeLayer );
1524 r = dialog->
AddHTMLPage( layerName + wxS(
" " ) +
_(
"Clearance" ) );
1525 reportHeader(
_(
"Edge clearance resolution for:" ), a, b, layer, r );
1534 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1550 r->
Report(
_(
"No 'physical_clearance' constraints defined." ) );
1554 LSET reportLayers = layerIntersection;
1555 bool reported =
false;
1561 reportLayers |= edgeInteractingLayers;
1568 reportLayers |= edgeInteractingLayers;
1574 reportHeader(
_(
"Physical clearance resolution for:" ), a, b, layer, r );
1579 if( constraint.
IsNull() )
1582 r->
Report( wxString::Format(
_(
"No 'physical_clearance' constraints in effect on %s." ),
1583 m_frame->GetBoard()->GetLayerName( layer ) ) );
1588 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1599 reportHeader(
_(
"Physical clearance resolution for:" ), a, b, r );
1601 r->
Report(
_(
"Items share no relevant layers. No 'physical_clearance' constraints will "
1619 reportHeader(
_(
"Physical hole clearance resolution for:" ), a, b, layer, r );
1631 r->
Report(
_(
"No 'physical_hole_clearance' constraints defined." ) );
1636 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1644 dialog->
Show(
true );
1650#define EVAL_RULES( constraint, a, b, layer, r ) drcEngine->EvalRules( constraint, a, b, layer, r )
1656 wxCHECK( selTool, 0 );
1667 static const std::vector<KICAD_T> constraintTypes = {
1684 constraintTypes,
nullptr );
1691 m_frame->ShowInfoBarError(
_(
"Select a single item for a constraints resolution report." ) );
1697 wxCHECK( dialog, 0 );
1702 bool compileError =
false;
1703 bool courtyardError =
false;
1704 std::unique_ptr<DRC_ENGINE> drcEngine =
makeDRCEngine( &compileError, &courtyardError );
1711 reportHeader(
_(
"Track width resolution for:" ), item, r );
1719 r->
Report( wxString::Format(
_(
"Resolved width constraints: min %s; opt %s; max %s." ),
1730 reportHeader(
_(
"Via diameter resolution for:" ), item, r );
1739 r->
Report( wxString::Format(
_(
"Resolved diameter constraints: min %s; opt %s; max %s." ),
1747 reportHeader(
_(
"Via annular width resolution for:" ), item, r );
1756 r->
Report( wxString::Format(
_(
"Resolved annular width constraints: min %s; opt %s; max %s." ),
1776 r->
Report( wxString::Format(
_(
"Resolved hole size constraints: min %s; opt %s; max %s." ),
1787 reportHeader(
_(
"Solder mask expansion resolution for:" ), item, r );
1795 r->
Report( wxString::Format(
_(
"Resolved solder mask expansion: %s." ),
1804 reportHeader(
_(
"Solder paste absolute clearance resolution for:" ), item, r );
1812 r->
Report( wxString::Format(
_(
"Resolved solder paste absolute clearance: %s." ),
1815 reportHeader(
_(
"Solder paste relative clearance resolution for:" ), item, r );
1825 r->
Report( wxString::Format(
_(
"Resolved solder paste relative clearance: %s." ),
1834 reportHeader(
_(
"Text height resolution for:" ), item, r );
1842 r->
Report( wxString::Format(
_(
"Resolved height constraints: min %s; opt %s; max %s." ),
1850 reportHeader(
_(
"Text thickness resolution for:" ), item, r );
1858 r->
Report( wxString::Format(
_(
"Resolved thickness constraints: min %s; opt %s; max %s." ),
1874 if( courtyardError )
1877 r->
Report(
_(
"Report may be incomplete: some footprint courtyards are malformed." )
1878 + wxS(
" " )
1879 + wxS(
"<a href='$DRC'>" ) +
_(
"Run DRC for a full analysis." )
1886 r->
Report(
_(
"Item <b>disallowed</b> at current location." ) );
1888 r->
Report(
_(
"Item allowed at current location." ) );
1898 if( courtyardError )
1901 r->
Report(
_(
"Report may be incomplete: some footprint courtyards are malformed." )
1902 + wxS(
" " )
1903 + wxS(
"<a href='$DRC'>" ) +
_(
"Run DRC for a full analysis." )
1907 drcEngine->ProcessAssertions( item, [](
const DRC_CONSTRAINT* c ){}, r );
1911 dialog->
Show(
true );
1922 wxCHECK( selTool, 0 );
1928 for(
int i = aCollector.
GetCount() - 1; i >= 0; --i )
1933 aCollector.
Remove( item );
1940 m_frame->ShowInfoBarError(
_(
"Select a footprint to diff with its library equivalent." ) );
1950 wxFileDialog dlg(
m_frame,
_(
"Choose Board to Compare With" ), wxEmptyString,
1952 wxFD_OPEN | wxFD_FILE_MUST_EXIST );
1954 if( dlg.ShowModal() != wxID_OK )
1957 wxFileName otherFn( dlg.GetPath() );
1958 otherFn.MakeAbsolute();
1960 const wxString otherPath = otherFn.GetFullPath();
1962 wxFileName projectFn = otherFn;
1964 const wxString projectPath = projectFn.GetFullPath();
1966 wxFileName activeProjectFn(
m_frame->Prj().GetProjectFullName() );
1967 activeProjectFn.MakeAbsolute();
1973 if( projectFn.SameAs( activeProjectFn ) )
1976 _(
"Select a board file from another project to compare." ) );
1992 std::vector<std::unique_ptr<BOARD_ITEM>> clones;
1997PCB_DIFF_VIEW buildPcbDiffView(
BOARD* aLive,
BOARD* aOther,
const wxString& aOtherPath )
2002 view.result = differ.Diff();
2006 std::map<KIID, KIGFX::COLOR4D> refOverrides;
2007 std::map<KIID, KIGFX::COLOR4D> compOverrides;
2008 std::map<KIID, KICAD_DIFF::CATEGORY> kiidCategories;
2012 if( !aChange.id.empty() )
2014 const KIID& kiid = aChange.id.back();
2017 switch( aChange.kind )
2021 refOverrides[kiid] = theme.
removed;
2022 compOverrides[kiid] = theme.
removed;
2025 refOverrides[kiid] = theme.
modified;
2026 compOverrides[kiid] = theme.
modified;
2029 refOverrides[kiid] = theme.
conflict;
2030 compOverrides[kiid] = theme.
conflict;
2044 for(
const auto& [kiid, color] : refOverrides )
2051 if(
auto* clone =
dynamic_cast<BOARD_ITEM*
>( found->Clone() ) )
2052 view.clones.emplace_back( clone );
2056 std::vector<KIGFX::VIEW_ITEM*> extraItems;
2058 for(
const auto& clone : view.clones )
2065 extraItems.insert( extraItems.end(), fpItems.begin(), fpItems.end() );
2069 extraItems.push_back( clone.get() );
2073 view.switcher = [other = aOther, color = theme.
modified, overrides = compOverrides,
2074 extras = std::move( extraItems ),
2086 const wxString& aComparisonLabel )
2093 bool projectLoadOk = mgr && mgr->
LoadProject( aProjectPath,
false );
2098 m_frame->ShowInfoBarError( wxString::Format(
_(
"Failed to load project for %s" ), aOtherPath ) );
2102 if( !projectLoadOk && wxFileName( aProjectPath ).FileExists() )
2105 m_frame->ShowInfoBarError( wxString::Format(
_(
"Failed to load project for %s" ), aOtherPath ) );
2117 std::unique_ptr<BOARD> otherBoard;
2125 m_frame->ShowInfoBarError( wxString::Format(
_(
"Failed to load %s: %s" ), aOtherPath, ioe.
What() ) );
2131 m_frame->ShowInfoBarError( wxString::Format(
_(
"Failed to load %s" ), aOtherPath ) );
2138 m_frame->ShowInfoBarError( wxString::Format(
_(
"Failed to load %s" ), aOtherPath ) );
2144 PCB_DIFF_VIEW
view = buildPcbDiffView(
board, otherBoard.get(), aOtherPath );
2146 auto dlgDiff = std::make_unique<DIALOG_KICAD_DIFF>(
m_frame,
board->GetFileName(), aComparisonLabel,
view.result,
2149 dlgDiff->ShowModal();
2155 otherBoard->ClearProject();
2170 if( !liveBoard || liveBoard->
GetFileName().IsEmpty() )
2172 m_frame->ShowInfoBarError(
_(
"Save the board before comparing against local history." ) );
2176 const wxString projectPath =
m_frame->Prj().GetProjectPath();
2179 std::vector<LOCAL_HISTORY_SNAPSHOT_INFO> snapshots = history.
GetSnapshots( projectPath );
2181 if( snapshots.empty() )
2183 m_frame->ShowInfoBarError(
_(
"No local history snapshots for this project." ) );
2189 boardFn.MakeRelativeTo( projectPath );
2190 const wxString relPath = boardFn.GetFullPath( wxPATH_UNIX );
2192 wxFileName projFn(
m_frame->Prj().GetProjectFullName() );
2193 projFn.MakeRelativeTo( projectPath );
2194 const wxString projRel = projFn.GetFullPath( wxPATH_UNIX );
2199 std::vector<LOCAL_HISTORY_SNAPSHOT_INFO> boardSnapshots;
2200 wxString prevFingerprint;
2204 wxString fingerprint = history.
TreeFingerprint( projectPath, s.hash, wxS(
".kicad_pcb" ) );
2206 if( fingerprint.IsEmpty() || fingerprint == prevFingerprint )
2209 prevFingerprint = fingerprint;
2210 boardSnapshots.push_back( s );
2213 if( boardSnapshots.empty() )
2215 m_frame->ShowInfoBarError(
_(
"No local history snapshots change this board." ) );
2219 snapshots = std::move( boardSnapshots );
2223 std::vector<wxString> labels;
2227 wxString summary = s.summary.IsEmpty() ? s.message.BeforeFirst(
'\n' ) : s.summary;
2228 labels.push_back( wxString::Format( wxS(
"%s (%s)" ), summary, s.hash.Left( 8 ) ) );
2232 std::unique_ptr<BOARD> curBoard;
2234 wxString curTempDir;
2236 auto cleanupCurrent = [&]()
2240 curBoard->ClearProject();
2250 if( !curTempDir.IsEmpty() )
2252 wxFileName::Rmdir( curTempDir, wxPATH_RMDIR_RECURSIVE );
2259 auto loadRevision = [&](
int aIndex, std::unique_ptr<BOARD>& aBoard,
PROJECT*& aPrj, wxString& aTempDir ) ->
bool
2261 const wxString hash = snapshots[aIndex].hash;
2263 dirFn.AssignDir( wxFileName::GetTempDir() );
2264 dirFn.AppendDir( wxS(
"kicad-history-" ) + hash.Left( 8 ) );
2265 const wxString tempDir = dirFn.GetPath();
2270 { wxS(
".kicad_pcb" ), wxS(
".kicad_pro" ) } ) )
2272 wxFileName::Rmdir( tempDir, wxPATH_RMDIR_RECURSIVE );
2276 const wxString boardPath = tempDir + wxS(
"/" ) + relPath;
2277 const wxString proPath = tempDir + wxS(
"/" ) + projRel;
2284 wxFileName::Rmdir( tempDir, wxPATH_RMDIR_RECURSIVE );
2291 std::unique_ptr<BOARD> loaded;
2304 wxFileName::Rmdir( tempDir, wxPATH_RMDIR_RECURSIVE );
2311 wxFileName::Rmdir( tempDir, wxPATH_RMDIR_RECURSIVE );
2315 aBoard = std::move( loaded );
2323 auto loadView = [&](
int aIndex, std::unique_ptr<BOARD>& aBoard,
PROJECT*& aPrj, wxString& aTempDir,
2324 PCB_DIFF_VIEW& aView ) ->
bool
2326 if( !loadRevision( aIndex, aBoard, aPrj, aTempDir ) )
2331 aView = buildPcbDiffView( liveBoard, aBoard.get(), aTempDir + wxS(
"/" ) + relPath );
2335 aBoard->ClearProject();
2339 wxFileName::Rmdir( aTempDir, wxPATH_RMDIR_RECURSIVE );
2350 if( !loadView( 0, curBoard, curPrj, curTempDir,
view ) )
2352 m_frame->ShowInfoBarError(
_(
"Could not compare against the selected snapshot." ) );
2358 while(
view.result.Empty() && startIndex + 1 <
static_cast<int>( snapshots.size() ) )
2360 std::unique_ptr<BOARD> nextBoard;
2362 wxString nextTempDir;
2363 PCB_DIFF_VIEW nextView;
2365 if( !loadView( startIndex + 1, nextBoard, nextPrj, nextTempDir, nextView ) )
2369 view = std::move( nextView );
2370 curBoard = std::move( nextBoard );
2372 curTempDir = nextTempDir;
2376 auto dlgDiff = std::make_unique<DIALOG_KICAD_DIFF>(
m_frame, liveBoard->
GetFileName(), labels[startIndex],
2380 dlgDiff->SetRevisionChooser(
2384 std::unique_ptr<BOARD> newBoard;
2386 wxString newTempDir;
2387 PCB_DIFF_VIEW newView;
2389 if( !loadView( aIndex, newBoard, newPrj, newTempDir, newView ) )
2391 m_frame->ShowInfoBarError(
_(
"Could not compare against the selected snapshot." ) );
2395 dlgDiff->Reload( liveBoard->
GetFileName(), labels[aIndex], newView.result,
2396 {}, {}, newView.switcher, {} );
2400 view = std::move( newView );
2401 curBoard = std::move( newBoard );
2403 curTempDir = newTempDir;
2406 dlgDiff->ShowModal();
2422 wxCHECK( selTool, 0 );
2428 m_frame->ShowInfoBarError(
_(
"Select a footprint for a footprint associations report." ) );
2456 r->
Report( wxS(
"<h7>" ) +
_(
"Board vs library diff for:" ) + wxS(
"</h7>" ) );
2458 + wxS(
"<li>" ) +
_(
"Library: " ) +
EscapeHTML( libName ) + wxS(
"</li>" )
2459 + wxS(
"<li>" ) +
_(
"Library item: " ) +
EscapeHTML( fpName ) + wxS(
"</li></ul>" ) );
2468 r->
Report(
_(
"The library is not included in the current configuration." )
2469 + wxS(
"  " )
2470 + wxS(
"<a href='$CONFIG'>" ) +
_(
"Manage Footprint Libraries" )
2474 else if( !adapter->
HasLibrary( libName,
true ) )
2476 r->
Report(
_(
"The library is not enabled in the current configuration." )
2477 + wxS(
"  " )
2478 + wxS(
"<a href='$CONFIG'>" ) +
_(
"Manage Footprint Libraries" )
2484 std::shared_ptr<FOOTPRINT> libFootprint;
2488 libFootprint.reset( adapter->
LoadFootprint( libName, fpName,
true ) );
2496 r->
Report( wxString::Format(
_(
"The library no longer contains the item %s." ),
2502 r->
Report(
_(
"No relevant differences detected." ) );
2518 dialog->
Show(
true );
2524 wxBoxSizer* sizer =
new wxBoxSizer( wxVERTICAL );
2528 sizer->Add( diffWidget, 1, wxEXPAND | wxALL, 5 );
2529 aParentPanel->SetSizer( sizer );
2530 aParentPanel->Layout();
2540 m_frame->m_ProbingSchToPcb =
true;
2547 m_frame->m_ProbingSchToPcb =
false;
2549 bool request3DviewRedraw =
frame()->GetPcbNewSettings()->m_Display.m_Live3DRefresh;
2552 request3DviewRedraw =
false;
2555 if( request3DviewRedraw )
2556 m_frame->Update3DView(
false,
true );
2569 bool enableHighlight =
false;
2574 std::set<int> netcodes;
2579 netcodes.insert( ci->GetNetCode() );
2582 enableHighlight = !netcodes.empty();
2584 if( enableHighlight && netcodes.size() > 1 )
2589 board->ResetNetHighLight();
2591 for(
int multiNet : netcodes )
2592 board->SetHighLightNet( multiNet,
true );
2594 board->HighLightON();
2595 m_toolMgr->GetView()->UpdateAllLayersColor();
2599 else if( enableHighlight )
2601 net = *netcodes.begin();
2626 bool saved =
filter.lockedItems;
2627 filter.lockedItems =
true;
2631 filter.lockedItems = saved;
2639 for(
int i = collector.
GetCount() - 1; i >= 0; i-- )
2641 LSET itemLayers = collector[i]->GetLayerSet();
2644 ( highContrast && !itemLayers.
Contains( contrastLayer ) ) )
2651 enableHighlight = ( collector.
GetCount() > 0 );
2654 if( enableHighlight )
2659 m_frame->SendCrossProbeItem( targetItem );
2667 if( !aUseSelection && net >= 0 && netcodes.size() == 1 && netcodes.contains( net ) && settings->
IsHighlightEnabled() )
2673 wxString sig = netinfo->GetNetChain();
2674 if( !sig.IsEmpty() )
2678 if( n->GetNetChain() == sig )
2683 std::set<int> sigCodes;
2687 if( n->GetNetChain() == sig )
2688 sigCodes.insert( n->GetNetCode() );
2691 m_toolMgr->GetView()->UpdateAllLayersColor();
2695 board2->ResetNetHighLight();
2696 for(
int c : sigCodes )
2697 board2->SetHighLightNet( c,
true );
2698 board2->HighLightON();
2701 pcbSettings->SetHighlightedNetChain( sig );
2711 else if( !aUseSelection && netcodes.size() == 1 && netcodes.contains( net ) )
2718 if( !netcodes.empty() )
2722 m_toolMgr->GetView()->UpdateAllLayersColor();
2726 if( enableHighlight && net >= 0 )
2729 board->SetHighLightNet( net );
2730 board->HighLightON();
2736 std::vector<MSG_PANEL_ITEM> items;
2738 m_frame->SetMsgPanel( items );
2745 board->ResetNetHighLight();
2747 m_frame->SendCrossProbeNetName(
"" );
2758 const std::set<int>& highlighted = settings->GetHighlightNetCodes();
2763 settings->SetHighlight(
true, netcode );
2764 m_toolMgr->GetView()->UpdateAllLayersColor();
2773 wxString sig = net->GetNetChain();
2774 if( !sig.IsEmpty() )
2778 if( n->GetNetChain() == sig )
2780 bool alreadyHighlighted = highlighted.count( netcode );
2781 if( count > 1 && alreadyHighlighted )
2800 std::set<int> temp = highlighted;
2802 m_toolMgr->GetView()->UpdateAllLayersColor();
2810 m_toolMgr->GetView()->UpdateAllLayersColor();
2835 item =
static_cast<BOARD_ITEM*
>( collector[0] );
2843 if(
auto pad =
dynamic_cast<PAD*
>( item ) )
2844 net =
pad->GetNet();
2860 m_toolMgr->GetView()->UpdateAllLayersColor();
2862 pcbSettings->SetHighlightedNetChain( wxString() );
2872 m_toolMgr->GetView()->UpdateAllLayersColor();
2874 pcbSettings->SetHighlightedNetChain( wxString() );
2886 sig = net->GetNetChain();
2892 pcbSettings->SetHighlightedNetChain( sig );
2894 std::set<int> codes;
2895 if( !sig.IsEmpty() )
2899 if( net->GetNetChain() == sig )
2900 codes.insert( net->GetNetCode() );
2905 m_toolMgr->GetView()->UpdateAllLayersColor();
2918 auto ids = aEvent.
Parameter<std::pair<wxString, wxString>>();
2919 KIID oldId( ids.first );
2920 KIID newId( ids.second );
2934 board->ResetNetHighLight();
2938 pcbSettings->SetHighlightedNetChain( wxString() );
2939 m_toolMgr->GetView()->UpdateAllLayersColor();
2941 m_frame->SendCrossProbeNetName(
"" );
2958 [
this](
const VECTOR2D& pt ) ->
bool
2964 EDIT_TOOL::PadFilter );
2971 EDIT_TOOL::FootprintFilter );
2980 for(
PAD*
pad : fp->Pads() )
2990 pad->SetLocalRatsnestVisible( !
pad->GetLocalRatsnestVisible() );
2994 if( !fp->Pads().empty() )
2996 bool enable = !fp->Pads()[0]->GetLocalRatsnestVisible();
2998 for(
PAD* childPad : fp->Pads() )
2999 childPad->SetLocalRatsnestVisible( enable );
3011 [
this](
int aCondition )
3017 for(
PAD*
pad : fp->Pads() )
3041 auto&
selection = selectionTool->GetSelection();
3046 connectivity->ClearLocalRatsnest();
3074 std::vector<BOARD_ITEM*> items;
3077 for( std::size_t i = 0; i < queued_items.size(); ++i )
3079 if( !queued_items[i]->IsBOARD_ITEM() )
3084 wxCHECK2( item,
continue );
3091 items.push_back(
pad );
3098 queued_items.push_back( aItem );
3104 if( boardItem->GetLocalRatsnestVisible() ||
displayOptions().m_ShowModuleRatsnest )
3105 items.push_back( boardItem );
3109 if( items.empty() || std::none_of( items.begin(), items.end(),
3112 return( aItem->Type() == PCB_TRACE_T
3113 || aItem->Type() == PCB_PAD_T
3114 || aItem->Type() == PCB_ARC_T
3115 || aItem->Type() == PCB_ZONE_T
3116 || aItem->Type() == PCB_FOOTPRINT_T
3117 || aItem->Type() == PCB_VIA_T
3118 || aItem->Type() == PCB_SHAPE_T );
3127 connectivity->BlockRatsnestItems( items );
3155 m_toolMgr->GetView()->GetPainter()->GetSettings() );
3160 if( aNetCode <= 0 && !
selection.Empty() )
3166 if( bci->GetNetCode() > 0 )
3179 if( !
m_frame->GetAppearancePanel()->IsTogglingNetclassRatsnestVisibility() )
3181 m_frame->GetCanvas()->RedrawRatsnest();
3182 m_frame->GetCanvas()->Refresh();
3184 m_frame->GetAppearancePanel()->OnNetVisibilityChanged( aNetCode, !aHide );
std::function< void(const VECTOR2I &, GENERAL_COLLECTOR &, PCB_SELECTION_TOOL *)> CLIENT_SELECTION_FILTER
static TOOL_ACTION selectItem
Select an item (specified as the event parameter).
static TOOL_ACTION selectionCursor
Select a single item under the cursor position.
static TOOL_ACTION pickerTool
static TOOL_ACTION selectionClear
Clear the current selection.
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
virtual NETCLASS * GetEffectiveNetClass() const
Return the NETCLASS for this item.
wxString GetNetname() const
NETINFO_ITEM * GetNet() const
Return #NET_INFO object for a given item.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
virtual bool IsConnected() const
Returns information if the object is derived from BOARD_CONNECTED_ITEM.
virtual void Move(const VECTOR2I &aMoveVector)
Move this object.
virtual bool IsOnLayer(PCB_LAYER_ID aLayer) const
Test to see if this object is on the given layer.
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
virtual LSET GetLayerSet() const
Return a std::bitset of all layers on which the item physically resides.
virtual bool IsTented(PCB_LAYER_ID aLayer) const
Checks if the given object is tented (its copper shape is covered by solder mask) on a given side of ...
virtual void RunOnChildren(const std::function< void(BOARD_ITEM *)> &aFunction, RECURSE_MODE aMode) const
Invoke a function on all children.
virtual bool HasDrilledHole() const
virtual bool IsOnCopperLayer() const
virtual bool HasHole() const
static std::unique_ptr< BOARD > Load(const wxString &aFileName, PCB_IO_MGR::PCB_FILE_T aFormat, PROJECT *aProject, const OPTIONS &aOptions)
Information pertinent to a Pcbnew printed circuit board.
const wxString & GetFileName() const
PROJECT * GetProject() const
BOARD_ITEM * ResolveItem(const KIID &aID, bool aAllowNullptrReturn=false) const
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
int GetCount() const
Return the number of objects in the list.
void Remove(int aIndex)
Remove the item at aIndex (first position is 0).
void Append(EDA_ITEM *item)
Add an item to the end of the list.
Dialog to show common board info.
wxPanel * AddBlankPage(const wxString &aTitle)
WX_HTML_REPORT_BOX * AddHTMLPage(const wxString &aTitle)
void SetUserItemID(const KIID &aID)
std::function< void(WIDGET_DIFF_CANVAS &, const KIID_PATH &)> SHEET_SWITCHER
bool Show(bool show) override
ZONE_CONNECTION m_ZoneConnection
static int MatchDpSuffix(const wxString &aNetName, wxString &aComplementNet, wxString &aBaseDpName)
Check if the given net is a diff pair, returning its polarity and complement if so.
std::unordered_set< EDA_ITEM * > & GetItems()
A base class for most all the KiCad significant classes used in schematics and boards.
virtual wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const
Return a user-visible description string of this item.
KICAD_T Type() const
Returns the type of object.
virtual bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const
Test if aPosition is inside or on the boundary of this item.
A general implementation of a COLLECTORS_GUIDE.
void SetIgnoreZoneFills(bool ignore)
void SetPreferredLayer(PCB_LAYER_ID aLayer)
void SetIgnoreNoNets(bool ignore)
Used when the right click button is pressed, or when the select tool is in effect.
void Collect(BOARD_ITEM *aItem, const std::vector< KICAD_T > &aScanList, const VECTOR2I &aRefPos, const COLLECTORS_GUIDE &aGuide)
Scan a BOARD_ITEM using this class's Inspector method, which does the collection.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
virtual const wxString What() const
A composite of Problem() and Where()
Diff two already-parsed BOARDs and produce a DOCUMENT_DIFF.
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
PCB specific render settings.
std::set< int > & GetHiddenNets()
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
const std::set< int > & GetHighlightNetCodes() const
Return the netcode of currently highlighted net.
PCB_LAYER_ID GetPrimaryHighContrastLayer() const
Return the board layer which is in high-contrast mode.
bool IsHighlightEnabled() const
Return current highlight setting.
bool GetHighContrast() const
void SetHighlight(bool aEnabled, int aNetcode=-1, bool aMulti=false)
Turns on/off highlighting.
An interface for classes handling user events controlling the view behavior such as zooming,...
virtual int GetTopLayer() const
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
bool HasLibrary(const wxString &aNickname, bool aCheckEnabled=false) const
Test for the existence of aNickname in the library tables.
A logical library item identifier and consists of various portions much like a URI.
const UTF8 & GetLibItemName() const
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Simple local history manager built on libgit2.
std::vector< LOCAL_HISTORY_SNAPSHOT_INFO > GetSnapshots(const wxString &aProjectPath)
Snapshots (commits) for the project, newest first.
wxString TreeFingerprint(const wxString &aProjectPath, const wxString &aHash, const wxString &aExtension)
Fingerprint of all files ending in aExtension recorded by commit aHash (sorted path:blob pairs).
bool ExtractAllFilesAtCommit(const wxString &aProjectPath, const wxString &aHash, const wxString &aDestDir, const std::vector< wxString > &aExtensions={})
Write files recorded at aHash into aDestDir, recreating the project's relative folder structure.
LSET is a set of PCB_LAYER_IDs.
static const LSET & AllCuMask()
return AllCuMask( MAX_CU_LAYERS );
LSEQ Seq(const LSEQ &aSequence) const
Return an LSEQ from the union of this LSET and a desired sequence.
static LSET AllCuMask(int aCuLayerCount)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
static const LSET & PhysicalLayersMask()
Return a mask holding all layers which are physically realized.
bool Contains(PCB_LAYER_ID aLayer) const
See if the layer set contains a PCB layer.
const wxString GetHumanReadableName() const
Gets the consolidated name of this netclass (which may be an aggregate).
Handle the data for a net.
const wxString & GetNetChain() const
const wxString & GetNetname() const
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Return the information about the NETINFO_ITEM in aList to display in the message panel.
const VECTOR2I & GetDrillSize() const
PAD_ATTRIB GetAttribute() const
static TOOL_ACTION highlightItem
static TOOL_ACTION toggleNetHighlight
static TOOL_ACTION setTerminalPad
static TOOL_ACTION highlightNet
static TOOL_ACTION hideNetInRatsnest
static TOOL_ACTION hideLocalRatsnest
static TOOL_ACTION showNetInRatsnest
static TOOL_ACTION highlightNetChain
static TOOL_ACTION toggleLastNetHighlight
static TOOL_ACTION compareBoardWithHistory
static TOOL_ACTION inspectConstraints
static TOOL_ACTION clearHighlight
static TOOL_ACTION inspectClearance
static TOOL_ACTION updateLocalRatsnest
static TOOL_ACTION compareBoardWithFile
static TOOL_ACTION diffFootprint
static TOOL_ACTION showFootprintAssociations
static TOOL_ACTION highlightNetSelection
static TOOL_ACTION boardStatistics
static TOOL_ACTION localRatsnestTool
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
A set of BOARD_ITEMs (i.e., without duplicates).
PCB_FILE_T
The set of file types that the PCB_IO_MGR knows about, and for which there has been a plugin written,...
static PCB_FILE_T FindPluginTypeFromBoardPath(const wxString &aFileName, int aCtl=0)
Return a plugin type given a path for a board file.
static FOOTPRINT_LIBRARY_ADAPTER * FootprintLibAdapter(PROJECT *aProject)
Container for project specific data.
A pure virtual class used to derive REPORTER objects from.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Report a string with a given severity.
bool LoadProject(const wxString &aFullPath, bool aSetActive=true)
Load a project or sets up a new project with a specified path.
bool IsProjectLoaded(PROJECT *aProject) const
True if aProject is still owned by the manager.
PROJECT * GetProject(const wxString &aFullPath) const
Retrieve a loaded project by name.
bool UnloadProject(PROJECT *aProject, bool aSave=true)
Save, unload and unregister the given PROJECT.
bool IsEmpty() const
Return true if the set is empty (no polygons at all)
wxString StringFromValue(double aValue, bool aAddUnitLabel=false, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
Converts aValue in internal units into a united string.
A slimmed down version of WX_HTML_REPORT_PANEL.
void Clear() override
Delete the stored messages.
REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) override
Report a string with a given severity.
void SetUnits(EDA_UNITS aUnits)
void Flush()
Build the HTML messages page.
Handle a list of polygons defining a copper zone.
std::optional< int > GetLocalClearance() const override
virtual bool IsOnLayer(PCB_LAYER_ID) const override
Test to see if this object is on the given layer.
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
@ DRCE_DRILL_OUT_OF_RANGE
@ DRCE_TRACK_SEGMENT_LENGTH
@ DRCE_DRILLED_HOLES_TOO_CLOSE
@ DRCE_DIFF_PAIR_UNCOUPLED_LENGTH_TOO_LONG
@ DRCE_MICROVIA_DRILL_OUT_OF_RANGE
@ DRCE_LIB_FOOTPRINT_MISMATCH
@ ANNULAR_WIDTH_CONSTRAINT
@ COURTYARD_CLEARANCE_CONSTRAINT
@ VIA_DIAMETER_CONSTRAINT
@ DIFF_PAIR_GAP_CONSTRAINT
@ SILK_CLEARANCE_CONSTRAINT
@ EDGE_CLEARANCE_CONSTRAINT
@ MIN_RESOLVED_SPOKES_CONSTRAINT
@ TRACK_SEGMENT_LENGTH_CONSTRAINT
@ TEXT_THICKNESS_CONSTRAINT
@ PHYSICAL_HOLE_CLEARANCE_CONSTRAINT
@ THERMAL_SPOKE_WIDTH_CONSTRAINT
@ CONNECTION_WIDTH_CONSTRAINT
@ THERMAL_RELIEF_GAP_CONSTRAINT
@ MAX_UNCOUPLED_CONSTRAINT
@ HOLE_CLEARANCE_CONSTRAINT
@ SOLDER_PASTE_ABS_MARGIN_CONSTRAINT
@ SOLDER_MASK_EXPANSION_CONSTRAINT
@ PHYSICAL_CLEARANCE_CONSTRAINT
@ SOLDER_PASTE_REL_MARGIN_CONSTRAINT
@ HOLE_TO_HOLE_CONSTRAINT
#define MALFORMED_COURTYARDS
static const std::string ProjectFileExtension
static wxString PcbFileWildcard()
#define KICTL_KICAD_ONLY
chosen file is from KiCad according to user
bool IsFrontLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a front layer.
bool IsCopperLayer(int aLayerId)
Test whether a layer is a copper layer.
PCB_LAYER_ID
A quick note on layer IDs:
void ConfigurePcbDiffCanvasContext(WIDGET_DIFF_CANVAS &aCanvas, BOARD *aReference, BOARD *aComparison, const KIGFX::COLOR4D &aColor, const std::map< KIID, KIGFX::COLOR4D > &aOverrides, const std::vector< KIGFX::VIEW_ITEM * > &aExtraItems, const std::map< KIID, KICAD_DIFF::CATEGORY > &aCategories)
std::vector< KIGFX::VIEW_ITEM * > CollectFootprintDiffContextItems(FOOTPRINT &aFootprint)
CATEGORY CategoryFor(CHANGE_KIND aKind)
Map a CHANGE_KIND to the visual category it belongs to.
@ TARGET_OVERLAY
Items that may change while the view stays the same (noncached)
@ NPTH
like PAD_PTH, but not plated mechanical use only, no connection allowed
@ SMD
Smd pad, appears on the solder paste layer (default)
Class to handle a set of BOARD_ITEMs.
std::vector< FAB_LAYER_COLOR > dummy
wxString EscapeHTML(const wxString &aString)
Return a new wxString escaped for embedding in HTML.
bool initialize_after_load
The full set of changes between two parsed documents of one type.
std::vector< ITEM_CHANGE > changes
Aggregate of background geometry extracted from one source document.
One change record on a single item.
std::vector< ITEM_CHANGE > children
A filename or source description, a problem input line, a line number, a byte offset,...
This file contains data structures that are saved in the project file or project local settings file ...
wxString result
Test unit parsing edge cases and error handling.
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
@ PCB_GENERATOR_T
class PCB_GENERATOR, generator on a layer
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
@ PCB_ZONE_T
class ZONE, a copper pour area
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
@ PCB_FIELD_T
class PCB_FIELD, text associated with a footprint property
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
@ PCB_PAD_T
class PAD, a pad in a footprint
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
Casted dyn_cast(From aObject)
A lightweight dynamic downcast.
VECTOR2< int32_t > VECTOR2I
VECTOR2< double > VECTOR2D
Definition of file extensions used in Kicad.
@ THERMAL
Use thermal relief for pads.
@ NONE
Pads are not covered.