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 );
1214 reportHeader(
_(
"Clearance resolution for:" ), a, b, layer, rep );
1218 rep->Report(
_(
"Items belong to the same net. Min clearance is 0." ) );
1230 if( constraint.
IsNull() )
1232 rep->Report(
_(
"Min clearance is 0." ) );
1236 rep->Report( wxString::Format(
_(
"Resolved clearance: %s; clearance will "
1242 rep->Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1247 if( layers.size() == 1 )
1252 fillReport( layer, r );
1257 auto perLayerMessages = std::make_shared<std::vector<std::vector<wxString>>>();
1258 perLayerMessages->reserve( layers.size() );
1262 VECTOR_REPORTER tmp;
1263 fillReport( layer, &tmp );
1264 perLayerMessages->push_back( std::move( tmp.m_messages ) );
1268 wxBoxSizer* vbox =
new wxBoxSizer( wxVERTICAL );
1270 wxChoice* choice =
new wxChoice( panel, wxID_ANY );
1273 choice->Append(
m_frame->GetBoard()->GetLayerName( layer ) );
1275 choice->SetSelection( 0 );
1279 wxHW_SCROLLBAR_AUTO | wxBORDER_SIMPLE );
1282 wxStaticText* layerLabel =
new wxStaticText( panel, wxID_ANY,
_(
"Layer:" ) );
1284 vbox->Add( layerLabel, 0, wxLEFT | wxRIGHT | wxTOP, 5 );
1285 vbox->Add( choice, 0, wxEXPAND | wxALL, 5 );
1286 vbox->Add( reportBox, 1, wxEXPAND | wxALL, 5 );
1287 panel->SetSizer( vbox );
1291 [reportBox, perLayerMessages](
int sel )
1295 if( sel >= 0 && sel < (
int) perLayerMessages->size() )
1297 for(
const wxString& line : ( *perLayerMessages )[sel] )
1298 reportBox->
Report( line );
1304 choice->Bind( wxEVT_CHOICE,
1305 [
refresh]( wxCommandEvent& evt )
1307 refresh( evt.GetSelection() );
1317 wxString coupledNet;
1326 if( !dpIntersection.test( dpLayer ) && dpIntersection.any() )
1327 dpLayer = dpIntersection.
Seq().front();
1330 reportHeader(
_(
"Diff-pair gap resolution for:" ), ac, bc, dpLayer, r );
1335 r->
Report( wxString::Format(
_(
"Resolved gap constraints: min %s; opt %s; max %s." ),
1343 reportHeader(
_(
"Diff-pair max uncoupled length resolution for:" ), ac, bc, dpLayer, r );
1348 r->
Report(
_(
"No 'diff_pair_uncoupled' constraints defined." ) );
1355 r->
Report( wxString::Format(
_(
"Resolved max uncoupled length: %s." ),
1363 auto isOnCorrespondingLayer=
1375 if( aItem->
IsOnLayer( correspondingMask ) )
1378 if( aItem->
IsTented( correspondingMask ) && aItem->
IsOnLayer( correspondingCopper ) )
1380 *aWarning = wxString::Format(
_(
"Note: %s is tented; clearance will only be "
1381 "applied to holes." ),
1393 if( ( a->
IsOnLayer( layer ) && isOnCorrespondingLayer( b, layer, &warning ) )
1394 || ( b->
IsOnLayer( layer ) && isOnCorrespondingLayer( a, layer, &warning ) ) )
1397 reportHeader(
_(
"Silkscreen clearance resolution for:" ), a, b, layer, r );
1407 if( !warning.IsEmpty() )
1410 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1422 if( aCourtyard && bCourtyard )
1425 reportHeader(
_(
"Courtyard clearance resolution for:" ), a, b, layer, r );
1434 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1444 bool pageAdded =
false;
1460 reportHeader(
_(
"Hole clearance resolution for:" ), a, b, layer, r );
1469 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1489 reportHeader(
_(
"Hole-to-hole clearance resolution for:" ), a, b, r );
1498 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1526 wxString layerName =
m_frame->GetBoard()->GetLayerName( edgeLayer );
1527 r = dialog->
AddHTMLPage( layerName + wxS(
" " ) +
_(
"Clearance" ) );
1528 reportHeader(
_(
"Edge clearance resolution for:" ), a, b, layer, r );
1537 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1553 r->
Report(
_(
"No 'physical_clearance' constraints defined." ) );
1557 LSET reportLayers = layerIntersection;
1558 bool reported =
false;
1564 reportLayers |= edgeInteractingLayers;
1571 reportLayers |= edgeInteractingLayers;
1577 reportHeader(
_(
"Physical clearance resolution for:" ), a, b, layer, r );
1582 if( constraint.
IsNull() )
1585 r->
Report( wxString::Format(
_(
"No 'physical_clearance' constraints in effect on %s." ),
1586 m_frame->GetBoard()->GetLayerName( layer ) ) );
1591 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1602 reportHeader(
_(
"Physical clearance resolution for:" ), a, b, r );
1604 r->
Report(
_(
"Items share no relevant layers. No 'physical_clearance' constraints will "
1622 reportHeader(
_(
"Physical hole clearance resolution for:" ), a, b, layer, r );
1634 r->
Report(
_(
"No 'physical_hole_clearance' constraints defined." ) );
1639 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1647 dialog->
Show(
true );
1653#define EVAL_RULES( constraint, a, b, layer, r ) drcEngine->EvalRules( constraint, a, b, layer, r )
1659 wxCHECK( selTool, 0 );
1670 static const std::vector<KICAD_T> constraintTypes = {
1687 constraintTypes,
nullptr );
1694 m_frame->ShowInfoBarError(
_(
"Select a single item for a constraints resolution report." ) );
1700 wxCHECK( dialog, 0 );
1705 bool compileError =
false;
1706 bool courtyardError =
false;
1707 std::unique_ptr<DRC_ENGINE> drcEngine =
makeDRCEngine( &compileError, &courtyardError );
1714 reportHeader(
_(
"Track width resolution for:" ), item, r );
1722 r->
Report( wxString::Format(
_(
"Resolved width constraints: min %s; opt %s; max %s." ),
1733 reportHeader(
_(
"Via diameter resolution for:" ), item, r );
1742 r->
Report( wxString::Format(
_(
"Resolved diameter constraints: min %s; opt %s; max %s." ),
1750 reportHeader(
_(
"Via annular width resolution for:" ), item, r );
1759 r->
Report( wxString::Format(
_(
"Resolved annular width constraints: min %s; opt %s; max %s." ),
1779 r->
Report( wxString::Format(
_(
"Resolved hole size constraints: min %s; opt %s; max %s." ),
1790 reportHeader(
_(
"Solder mask expansion resolution for:" ), item, r );
1798 r->
Report( wxString::Format(
_(
"Resolved solder mask expansion: %s." ),
1807 reportHeader(
_(
"Solder paste absolute clearance resolution for:" ), item, r );
1815 r->
Report( wxString::Format(
_(
"Resolved solder paste absolute clearance: %s." ),
1818 reportHeader(
_(
"Solder paste relative clearance resolution for:" ), item, r );
1828 r->
Report( wxString::Format(
_(
"Resolved solder paste relative clearance: %s." ),
1837 reportHeader(
_(
"Text height resolution for:" ), item, r );
1845 r->
Report( wxString::Format(
_(
"Resolved height constraints: min %s; opt %s; max %s." ),
1853 reportHeader(
_(
"Text thickness resolution for:" ), item, r );
1861 r->
Report( wxString::Format(
_(
"Resolved thickness constraints: min %s; opt %s; max %s." ),
1877 if( courtyardError )
1880 r->
Report(
_(
"Report may be incomplete: some footprint courtyards are malformed." )
1881 + wxS(
" " )
1882 + wxS(
"<a href='$DRC'>" ) +
_(
"Run DRC for a full analysis." )
1889 r->
Report(
_(
"Item <b>disallowed</b> at current location." ) );
1891 r->
Report(
_(
"Item allowed at current location." ) );
1901 if( courtyardError )
1904 r->
Report(
_(
"Report may be incomplete: some footprint courtyards are malformed." )
1905 + wxS(
" " )
1906 + wxS(
"<a href='$DRC'>" ) +
_(
"Run DRC for a full analysis." )
1910 drcEngine->ProcessAssertions( item, [](
const DRC_CONSTRAINT* c ){}, r );
1914 dialog->
Show(
true );
1925 wxCHECK( selTool, 0 );
1931 for(
int i = aCollector.
GetCount() - 1; i >= 0; --i )
1936 aCollector.
Remove( item );
1943 m_frame->ShowInfoBarError(
_(
"Select a footprint to diff with its library equivalent." ) );
1953 wxFileDialog dlg(
m_frame,
_(
"Choose Board to Compare With" ), wxEmptyString,
1955 wxFD_OPEN | wxFD_FILE_MUST_EXIST );
1957 if( dlg.ShowModal() != wxID_OK )
1960 wxFileName otherFn( dlg.GetPath() );
1961 otherFn.MakeAbsolute();
1963 const wxString otherPath = otherFn.GetFullPath();
1965 wxFileName projectFn = otherFn;
1967 const wxString projectPath = projectFn.GetFullPath();
1969 wxFileName activeProjectFn(
m_frame->Prj().GetProjectFullName() );
1970 activeProjectFn.MakeAbsolute();
1976 if( projectFn.SameAs( activeProjectFn ) )
1979 _(
"Select a board file from another project to compare." ) );
1995 std::vector<std::unique_ptr<BOARD_ITEM>> clones;
2000PCB_DIFF_VIEW buildPcbDiffView(
BOARD* aLive,
BOARD* aOther,
const wxString& aOtherPath )
2005 view.result = differ.Diff();
2009 std::map<KIID, KIGFX::COLOR4D> refOverrides;
2010 std::map<KIID, KIGFX::COLOR4D> compOverrides;
2011 std::map<KIID, KICAD_DIFF::CATEGORY> kiidCategories;
2016 if( !aChange.id.empty() )
2018 const KIID& kiid = aChange.id.back();
2021 switch( aChange.kind )
2025 refOverrides[kiid] = theme.
removed;
2026 compOverrides[kiid] = theme.
removed;
2029 refOverrides[kiid] = theme.
modified;
2030 compOverrides[kiid] = theme.
modified;
2033 refOverrides[kiid] = theme.
conflict;
2034 compOverrides[kiid] = theme.
conflict;
2048 for(
const auto& [kiid, color] : refOverrides )
2056 view.clones.emplace_back( clone );
2060 std::vector<KIGFX::VIEW_ITEM*> extraItems;
2062 for(
const std::unique_ptr<BOARD_ITEM>& clone : view.clones )
2069 extraItems.insert( extraItems.end(), fpItems.begin(), fpItems.end() );
2073 extraItems.push_back( clone.get() );
2078 [other = aOther, color = theme.
modified, overrides = compOverrides, extras = std::move( extraItems ),
2091 const wxString& aComparisonLabel )
2098 bool projectLoadOk = mgr && mgr->
LoadProject( aProjectPath,
false );
2103 m_frame->ShowInfoBarError( wxString::Format(
_(
"Failed to load project for %s" ), aOtherPath ) );
2107 if( !projectLoadOk && wxFileName( aProjectPath ).FileExists() )
2110 m_frame->ShowInfoBarError( wxString::Format(
_(
"Failed to load project for %s" ), aOtherPath ) );
2122 std::unique_ptr<BOARD> otherBoard;
2130 m_frame->ShowInfoBarError( wxString::Format(
_(
"Failed to load %s: %s" ), aOtherPath, ioe.
What() ) );
2136 m_frame->ShowInfoBarError( wxString::Format(
_(
"Failed to load %s" ), aOtherPath ) );
2143 m_frame->ShowInfoBarError( wxString::Format(
_(
"Failed to load %s" ), aOtherPath ) );
2149 PCB_DIFF_VIEW
view = buildPcbDiffView(
board, otherBoard.get(), aOtherPath );
2151 auto dlgDiff = std::make_unique<DIALOG_KICAD_DIFF>(
m_frame,
board->GetFileName(), aComparisonLabel,
view.result,
2154 dlgDiff->ShowModal();
2160 otherBoard->ClearProject();
2175 if( !liveBoard || liveBoard->
GetFileName().IsEmpty() )
2177 m_frame->ShowInfoBarError(
_(
"Save the board before comparing against local history." ) );
2181 const wxString projectPath =
m_frame->Prj().GetProjectPath();
2184 std::vector<LOCAL_HISTORY_SNAPSHOT_INFO> snapshots = history.
GetSnapshots( projectPath );
2186 if( snapshots.empty() )
2188 m_frame->ShowInfoBarError(
_(
"No local history snapshots for this project." ) );
2194 boardFn.MakeRelativeTo( projectPath );
2195 const wxString relPath = boardFn.GetFullPath( wxPATH_UNIX );
2197 wxFileName projFn(
m_frame->Prj().GetProjectFullName() );
2198 projFn.MakeRelativeTo( projectPath );
2199 const wxString projRel = projFn.GetFullPath( wxPATH_UNIX );
2204 std::vector<LOCAL_HISTORY_SNAPSHOT_INFO> boardSnapshots;
2205 wxString prevFingerprint;
2209 wxString fingerprint = history.
TreeFingerprint( projectPath, s.hash, wxS(
".kicad_pcb" ) );
2211 if( fingerprint.IsEmpty() || fingerprint == prevFingerprint )
2214 prevFingerprint = fingerprint;
2215 boardSnapshots.push_back( s );
2218 if( boardSnapshots.empty() )
2220 m_frame->ShowInfoBarError(
_(
"No local history snapshots change this board." ) );
2224 snapshots = std::move( boardSnapshots );
2228 std::vector<wxString> labels;
2232 wxString summary = s.summary.IsEmpty() ? s.message.BeforeFirst(
'\n' ) : s.summary;
2233 labels.push_back( wxString::Format( wxS(
"%s (%s)" ), summary, s.hash.Left( 8 ) ) );
2237 std::unique_ptr<BOARD> curBoard;
2239 wxString curTempDir;
2241 auto cleanupCurrent =
2246 curBoard->ClearProject();
2256 if( !curTempDir.IsEmpty() )
2258 wxFileName::Rmdir( curTempDir, wxPATH_RMDIR_RECURSIVE );
2266 [&](
int aIndex, std::unique_ptr<BOARD>& aBoard,
PROJECT*& aPrj, wxString& aTempDir ) ->
bool
2268 const wxString hash = snapshots[aIndex].hash;
2270 dirFn.AssignDir( wxFileName::GetTempDir() );
2271 dirFn.AppendDir( wxS(
"kicad-history-" ) + hash.Left( 8 ) );
2272 const wxString tempDir = dirFn.GetPath();
2277 { wxS(
".kicad_pcb" ), wxS(
".kicad_pro" ) } ) )
2279 wxFileName::Rmdir( tempDir, wxPATH_RMDIR_RECURSIVE );
2283 const wxString boardPath = tempDir + wxS(
"/" ) + relPath;
2284 const wxString proPath = tempDir + wxS(
"/" ) + projRel;
2291 wxFileName::Rmdir( tempDir, wxPATH_RMDIR_RECURSIVE );
2298 std::unique_ptr<BOARD> loaded;
2311 wxFileName::Rmdir( tempDir, wxPATH_RMDIR_RECURSIVE );
2318 wxFileName::Rmdir( tempDir, wxPATH_RMDIR_RECURSIVE );
2322 aBoard = std::move( loaded );
2331 [&](
int aIndex, std::unique_ptr<BOARD>& aBoard,
PROJECT*& aPrj, wxString& aTempDir,
2332 PCB_DIFF_VIEW& aView ) ->
bool
2334 if( !loadRevision( aIndex, aBoard, aPrj, aTempDir ) )
2339 aView = buildPcbDiffView( liveBoard, aBoard.get(), aTempDir + wxS(
"/" ) + relPath );
2343 aBoard->ClearProject();
2347 wxFileName::Rmdir( aTempDir, wxPATH_RMDIR_RECURSIVE );
2358 if( !loadView( 0, curBoard, curPrj, curTempDir,
view ) )
2360 m_frame->ShowInfoBarError(
_(
"Could not compare against the selected snapshot." ) );
2366 while(
view.result.Empty() && startIndex + 1 <
static_cast<int>( snapshots.size() ) )
2368 std::unique_ptr<BOARD> nextBoard;
2370 wxString nextTempDir;
2371 PCB_DIFF_VIEW nextView;
2373 if( !loadView( startIndex + 1, nextBoard, nextPrj, nextTempDir, nextView ) )
2377 view = std::move( nextView );
2378 curBoard = std::move( nextBoard );
2380 curTempDir = nextTempDir;
2384 auto dlgDiff = std::make_unique<DIALOG_KICAD_DIFF>(
m_frame, liveBoard->
GetFileName(), labels[startIndex],
2388 dlgDiff->SetRevisionChooser(
2392 std::unique_ptr<BOARD> newBoard;
2394 wxString newTempDir;
2395 PCB_DIFF_VIEW newView;
2397 if( !loadView( aIndex, newBoard, newPrj, newTempDir, newView ) )
2399 m_frame->ShowInfoBarError(
_(
"Could not compare against the selected snapshot." ) );
2403 dlgDiff->Reload( liveBoard->
GetFileName(), labels[aIndex], newView.result,
2404 {}, {}, newView.switcher, {} );
2408 view = std::move( newView );
2409 curBoard = std::move( newBoard );
2411 curTempDir = newTempDir;
2414 dlgDiff->ShowModal();
2430 wxCHECK( selTool, 0 );
2436 m_frame->ShowInfoBarError(
_(
"Select a footprint for a footprint associations report." ) );
2464 r->
Report( wxS(
"<h7>" ) +
_(
"Board vs library diff for:" ) + wxS(
"</h7>" ) );
2466 + wxS(
"<li>" ) +
_(
"Library: " ) +
EscapeHTML( libName ) + wxS(
"</li>" )
2467 + wxS(
"<li>" ) +
_(
"Library item: " ) +
EscapeHTML( fpName ) + wxS(
"</li></ul>" ) );
2476 r->
Report(
_(
"The library is not included in the current configuration." )
2477 + wxS(
"  " )
2478 + wxS(
"<a href='$CONFIG'>" ) +
_(
"Manage Footprint Libraries" )
2482 else if( !adapter->
HasLibrary( libName,
true ) )
2484 r->
Report(
_(
"The library is not enabled in the current configuration." )
2485 + wxS(
"  " )
2486 + wxS(
"<a href='$CONFIG'>" ) +
_(
"Manage Footprint Libraries" )
2492 std::shared_ptr<FOOTPRINT> libFootprint;
2496 libFootprint.reset( adapter->
LoadFootprint( libName, fpName,
true ) );
2504 r->
Report( wxString::Format(
_(
"The library no longer contains the item %s." ),
2510 r->
Report(
_(
"No relevant differences detected." ) );
2526 dialog->
Show(
true );
2532 wxBoxSizer* sizer =
new wxBoxSizer( wxVERTICAL );
2536 sizer->Add( diffWidget, 1, wxEXPAND | wxALL, 5 );
2537 aParentPanel->SetSizer( sizer );
2538 aParentPanel->Layout();
2548 m_frame->m_ProbingSchToPcb =
true;
2555 m_frame->m_ProbingSchToPcb =
false;
2557 bool request3DviewRedraw =
frame()->GetPcbNewSettings()->m_Display.m_Live3DRefresh;
2560 request3DviewRedraw =
false;
2563 if( request3DviewRedraw )
2564 m_frame->Update3DView(
false,
true );
2577 bool enableHighlight =
false;
2582 std::set<int> netcodes;
2587 netcodes.insert( ci->GetNetCode() );
2590 enableHighlight = !netcodes.empty();
2592 if( enableHighlight && netcodes.size() > 1 )
2597 board->ResetNetHighLight();
2599 for(
int multiNet : netcodes )
2600 board->SetHighLightNet( multiNet,
true );
2602 board->HighLightON();
2603 m_toolMgr->GetView()->UpdateAllLayersColor();
2607 else if( enableHighlight )
2609 net = *netcodes.begin();
2634 bool saved =
filter.lockedItems;
2635 filter.lockedItems =
true;
2639 filter.lockedItems = saved;
2647 for(
int i = collector.
GetCount() - 1; i >= 0; i-- )
2649 LSET itemLayers = collector[i]->GetLayerSet();
2652 ( highContrast && !itemLayers.
Contains( contrastLayer ) ) )
2659 enableHighlight = ( collector.
GetCount() > 0 );
2662 if( enableHighlight )
2667 m_frame->SendCrossProbeItem( targetItem );
2675 if( !aUseSelection && net >= 0 && netcodes.size() == 1 && netcodes.contains( net ) && settings->
IsHighlightEnabled() )
2681 wxString sig = netinfo->GetNetChain();
2682 if( !sig.IsEmpty() )
2686 if( n->GetNetChain() == sig )
2691 std::set<int> sigCodes;
2695 if( n->GetNetChain() == sig )
2696 sigCodes.insert( n->GetNetCode() );
2699 m_toolMgr->GetView()->UpdateAllLayersColor();
2703 board2->ResetNetHighLight();
2704 for(
int c : sigCodes )
2705 board2->SetHighLightNet( c,
true );
2706 board2->HighLightON();
2709 pcbSettings->SetHighlightedNetChain( sig );
2719 else if( !aUseSelection && netcodes.size() == 1 && netcodes.contains( net ) )
2726 if( !netcodes.empty() )
2730 m_toolMgr->GetView()->UpdateAllLayersColor();
2734 if( enableHighlight && net >= 0 )
2737 board->SetHighLightNet( net );
2738 board->HighLightON();
2744 std::vector<MSG_PANEL_ITEM> items;
2746 m_frame->SetMsgPanel( items );
2753 board->ResetNetHighLight();
2755 m_frame->SendCrossProbeNetName(
"" );
2766 const std::set<int>& highlighted = settings->GetHighlightNetCodes();
2771 settings->SetHighlight(
true, netcode );
2772 m_toolMgr->GetView()->UpdateAllLayersColor();
2781 wxString sig = net->GetNetChain();
2782 if( !sig.IsEmpty() )
2786 if( n->GetNetChain() == sig )
2788 bool alreadyHighlighted = highlighted.count( netcode );
2789 if( count > 1 && alreadyHighlighted )
2808 std::set<int> temp = highlighted;
2810 m_toolMgr->GetView()->UpdateAllLayersColor();
2818 m_toolMgr->GetView()->UpdateAllLayersColor();
2843 item = collector[0];
2852 if(
PAD*
pad =
dynamic_cast<PAD*
>( item ) )
2853 net =
pad->GetNet();
2869 m_toolMgr->GetView()->UpdateAllLayersColor();
2872 pcbSettings->SetHighlightedNetChain( wxString() );
2884 m_toolMgr->GetView()->UpdateAllLayersColor();
2887 pcbSettings->SetHighlightedNetChain( wxString() );
2901 sig = net->GetNetChain();
2908 pcbSettings->SetHighlightedNetChain( sig );
2910 std::set<int> codes;
2912 if( !sig.IsEmpty() )
2916 if( net->GetNetChain() == sig )
2917 codes.insert( net->GetNetCode() );
2922 m_toolMgr->GetView()->UpdateAllLayersColor();
2935 std::pair<wxString, wxString> ids = aEvent.
Parameter<std::pair<wxString, wxString>>();
2936 KIID oldId( ids.first );
2937 KIID newId( ids.second );
2951 board->ResetNetHighLight();
2956 pcbSettings->SetHighlightedNetChain( wxString() );
2958 m_toolMgr->GetView()->UpdateAllLayersColor();
2960 m_frame->SendCrossProbeNetName(
"" );
2977 [
this](
const VECTOR2D& pt ) ->
bool
2983 EDIT_TOOL::PadFilter );
2990 EDIT_TOOL::FootprintFilter );
2999 for(
PAD*
pad : fp->Pads() )
3009 pad->SetLocalRatsnestVisible( !
pad->GetLocalRatsnestVisible() );
3013 if( !fp->Pads().empty() )
3015 bool enable = !fp->Pads()[0]->GetLocalRatsnestVisible();
3017 for(
PAD* childPad : fp->Pads() )
3018 childPad->SetLocalRatsnestVisible( enable );
3030 [
this](
int aCondition )
3036 for(
PAD*
pad : fp->Pads() )
3061 std::shared_ptr<CONNECTIVITY_DATA> connectivity =
getModel<BOARD>()->GetConnectivity();
3065 connectivity->ClearLocalRatsnest();
3093 std::vector<BOARD_ITEM*> items;
3096 for( std::size_t i = 0; i < queued_items.size(); ++i )
3098 if( !queued_items[i]->IsBOARD_ITEM() )
3103 wxCHECK2( item,
continue );
3110 items.push_back(
pad );
3117 queued_items.push_back( aItem );
3123 if( boardItem->GetLocalRatsnestVisible() ||
displayOptions().m_ShowModuleRatsnest )
3124 items.push_back( boardItem );
3128 if( items.empty() || std::none_of( items.begin(), items.end(),
3131 return( aItem->Type() == PCB_TRACE_T
3132 || aItem->Type() == PCB_PAD_T
3133 || aItem->Type() == PCB_ARC_T
3134 || aItem->Type() == PCB_ZONE_T
3135 || aItem->Type() == PCB_FOOTPRINT_T
3136 || aItem->Type() == PCB_VIA_T
3137 || aItem->Type() == PCB_SHAPE_T );
3146 connectivity->BlockRatsnestItems( items );
3174 m_toolMgr->GetView()->GetPainter()->GetSettings() );
3179 if( aNetCode <= 0 && !
selection.Empty() )
3185 if( bci->GetNetCode() > 0 )
3198 if( !
m_frame->GetAppearancePanel()->IsTogglingNetclassRatsnestVisibility() )
3200 m_frame->GetCanvas()->RedrawRatsnest();
3201 m_frame->GetCanvas()->Refresh();
3203 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.
PAD_ATTRIB GetAttribute() const
VECTOR2I GetDrillSize() 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_DP_UNCOUPLED_LENGTH_TOO_LONG
@ DRCE_DRILL_OUT_OF_RANGE
@ DRCE_TRACK_SEGMENT_LENGTH
@ DRCE_DRILLED_HOLES_TOO_CLOSE
@ 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.