35#include <wx/filedlg.h>
36#include <wx/filename.h>
64#include <wx/stattext.h>
108 std::shared_ptr<NET_CONTEXT_MENU> netSubMenu = std::make_shared<NET_CONTEXT_MENU>();
109 netSubMenu->SetTool(
this );
112 auto showNetMenuFunc =
115 if( aSelection.Empty() )
118 for(
const EDA_ITEM* item : aSelection )
120 switch( item->Type() )
131 if( !
static_cast<const PCB_SHAPE*
>( item )->IsOnCopperLayer() )
149 menu.
AddMenu( netSubMenu.get(), showNetMenuFunc, 100 );
170 bool* aCourtyardError )
172 auto engine = std::make_unique<DRC_ENGINE>(
m_frame->GetBoard(),
173 &
m_frame->GetBoard()->GetDesignSettings() );
177 engine->InitEngine(
m_frame->GetBoard()->GetDesignRulesPath() );
182 *aCompileError =
true;
186 zone->CacheBoundingBox();
191 zone->CacheBoundingBox();
196 *aCourtyardError =
true;
208 const PAD&
pad =
static_cast<const PAD&
>( aItem );
226 + wxString::Format(
_(
"[netclass %s]" ),
237 std::vector<BOARD_ITEM*> toAdd;
239 for(
int i = 0; i < aCollector.
GetCount(); ++i )
245 group->RunOnChildren(
254 toAdd.push_back( child );
260 if(
pad->HitTest( aPos ) )
261 toAdd.push_back(
pad );
270 aCollector.
Append( item );
272 bool hasPadOrTrack =
false;
274 for(
int i = 0; i < aCollector.
GetCount(); ++i )
276 KICAD_T type = aCollector[i]->Type();
281 hasPadOrTrack =
true;
286 for(
int i = aCollector.
GetCount() - 1; i >= 0; --i )
303 const wxString& aPrompt,
304 const std::vector<KICAD_T>& aTypes,
314 statusPopup.SetText( aPrompt );
317 picker->SetSnapping(
false );
318 picker->ClearHandlers();
320 picker->SetClickHandler(
321 [&](
const VECTOR2D& aPoint ) ->
bool
330 for(
int i = collector.
GetCount() - 1; i >= 0; --i )
344 pickedItem = collector[0];
350 picker->SetMotionHandler(
360 for(
int i = collector.
GetCount() - 1; i >= 0; --i )
373 if( highlightedItem != item )
375 if( highlightedItem && highlightedItem != aLockedHighlight )
378 highlightedItem = item;
380 if( highlightedItem && highlightedItem != aLockedHighlight )
385 picker->SetCancelHandler(
388 if( highlightedItem && highlightedItem != aLockedHighlight )
391 highlightedItem =
nullptr;
396 picker->SetFinalizeHandler(
397 [&](
const int& aFinalState )
399 if( highlightedItem && highlightedItem != aLockedHighlight )
402 highlightedItem =
nullptr;
410 m_frame->GetCanvas()->SetStatusPopup( statusPopup.GetPanel() );
414 while( !done && !pickedItem )
422 picker->ClearHandlers();
423 m_frame->GetCanvas()->SetStatusPopup(
nullptr );
432 r->
Report(
_(
"Report incomplete: could not compile custom design rules." )
433 + wxS(
" " )
434 + wxS(
"<a href='$CUSTOM_RULES'>" ) +
_(
"Show design rules." ) + wxS(
"</a>" ) );
457 wxString layerStr =
_(
"Layer" ) + wxS(
" " ) +
m_frame->GetBoard()->GetLayerName( aLayer );
468class VECTOR_REPORTER :
public REPORTER
473 m_messages.push_back( aText );
477 bool HasMessage()
const override {
return !m_messages.empty(); }
480 std::vector<wxString> m_messages;
490 return wxT(
"<i>" ) +
_(
"undefined" ) + wxT(
"</i>" );
499 return wxT(
"<i>" ) +
_(
"undefined" ) + wxT(
"</i>" );
508 return wxT(
"<i>" ) +
_(
"undefined" ) + wxT(
"</i>" );
542 return wxEmptyString;
550 wxCHECK( drcTool &&
m_frame, );
571 bool compileError =
false;
572 bool courtyardError =
false;
573 std::unique_ptr<DRC_ENGINE> drcEngine =
makeDRCEngine( &compileError, &courtyardError );
580 if( candidate->GetRCItem() == aDRCItem )
597 LSET violationLayers;
602 layer = principalLayer;
608 wxString clearanceStr;
610 switch( aDRCItem->GetErrorCode() )
614 for(
KIID id : aDRCItem->GetIDs() )
623 reportHeader(
_(
"Diff pair uncoupled length resolution for:" ), ac, bc, r );
631 r->
Report( wxString::Format(
_(
"Resolved max uncoupled length: %s." ),
646 r->
Report( wxString::Format(
_(
"Resolved height constraints: min %s; max %s." ),
661 r->
Report( wxString::Format(
_(
"Resolved line width constraints: min %s; max %s." ),
675 r->
Report( wxString::Format(
_(
"Resolved width constraints: min %s; max %s." ),
690 r->
Report( wxString::Format(
_(
"Resolved angle constraints: min %s; max %s." ),
697 reportHeader(
_(
"Track segment length resolution for:" ), a, r );
705 r->
Report( wxString::Format(
_(
"Resolved segment length constraints: min %s; max %s." ),
712 reportHeader(
_(
"Connection width resolution for:" ), a, b, r );
720 r->
Report( wxString::Format(
_(
"Resolved min connection width: %s." ),
734 r->
Report( wxString::Format(
_(
"Resolved diameter constraints: min %s; max %s." ),
741 reportHeader(
_(
"Via annular width resolution for:" ), a, r );
749 r->
Report( wxString::Format(
_(
"Resolved annular width constraints: min %s; max %s." ),
766 r->
Report( wxString::Format(
_(
"Resolved hole size constraints: min %s; max %s." ),
773 reportHeader(
_(
"Hole clearance resolution for:" ), a, b, r );
781 r->
Report(
_(
"Items belong to the same net. Clearance is 0." ) );
790 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ), clearanceStr ) );
796 reportHeader(
_(
"Physical hole clearance resolution for:" ), a, b, layer, r );
805 r->
Report(
_(
"No 'physical_hole_clearance' constraints defined." ) );
810 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ), clearanceStr ) );
817 reportHeader(
_(
"Hole-to-hole clearance resolution for:" ), a, b, r );
827 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ), clearanceStr ) );
832 reportHeader(
_(
"Edge clearance resolution for:" ), a, b, r );
843 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ), clearanceStr ) );
849 reportHeader(
_(
"Clearance resolution for:" ), a, b, layer, r );
857 r->
Report(
_(
"Items belong to the same net. Clearance is 0." ) );
866 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ), clearanceStr ) );
872 reportHeader(
_(
"Physical clearance resolution for:" ), a, b, layer, r );
881 r->
Report(
_(
"No 'physical_clearance' constraints defined." ) );
886 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ), clearanceStr ) );
898 drcEngine->ProcessAssertions( a, [](
const DRC_CONSTRAINT* c ){}, r );
908 dialog->
Show(
true );
918 wxCHECK( selTool, 0 );
926 if( !
selection.GetItem( 0 )->IsBOARD_ITEM() || !
selection.GetItem( 1 )->IsBOARD_ITEM() )
941 static const std::vector<KICAD_T> clearanceTypes = {
957 _(
"Select first item for clearance resolution..." ),
958 clearanceTypes,
nullptr );
968 _(
"Select second item for clearance resolution..." ),
969 clearanceTypes, firstItem );
976 if( firstItem == secondItem )
978 m_frame->ShowInfoBarError(
_(
"Select two different items for clearance resolution." ) );
990 wxCHECK(
m_frame && aItemA && aItemB, );
1001 m_frame->ShowInfoBarError(
_(
"Cannot generate clearance report on empty group." ) );
1014 m_frame->ShowInfoBarError(
_(
"Cannot generate clearance report on empty group." ) );
1024 const auto checkFootprint =
1027 const PAD* foundPad =
nullptr;
1031 if( !foundPad ||
pad->SameLogicalPadAs( foundPad ) )
1044 a = checkFootprint(
static_cast<const FOOTPRINT*
>( a ) );
1047 b = checkFootprint(
static_cast<const FOOTPRINT*
>( b ) );
1072 const ZONE* zone =
dynamic_cast<const ZONE*
>( a );
1073 const PAD*
pad =
dynamic_cast<const PAD*
>( b );
1077 bool compileError =
false;
1078 bool courtyardError =
false;
1079 std::unique_ptr<DRC_ENGINE> drcEngine =
makeDRCEngine( &compileError, &courtyardError );
1081 if( copperIntersection.any() && zone &&
pad && zone->
GetNetCode() ==
pad->GetNetCode() )
1091 reportHeader(
_(
"Zone connection resolution for:" ), a, b, layer, r );
1093 constraint = drcEngine->EvalZoneConnection(
pad, zone, layer, r );
1099 reportHeader(
_(
"Thermal-relief gap resolution for:" ), a, b, layer, r );
1108 r->
Report( wxString::Format(
_(
"Resolved thermal relief gap: %s." ),
1109 m_frame->StringFromValue( gap,
true ) ) );
1113 reportHeader(
_(
"Thermal-relief spoke width resolution for:" ), a, b, layer, r );
1122 r->
Report( wxString::Format(
_(
"Resolved spoke width: %s." ),
1123 m_frame->StringFromValue( width,
true ) ) );
1127 reportHeader(
_(
"Thermal-relief min spoke count resolution for:" ), a, b, layer, r );
1136 r->
Report( wxString::Format(
_(
"Resolved min spoke count: %d." ),
1139 std::shared_ptr<CONNECTIVITY_DATA> connectivity =
pad->GetBoard()->GetConnectivity();
1145 reportHeader(
_(
"Zone clearance resolution for:" ), a, b, layer, r );
1149 r->
Report( wxString::Format(
_(
"Zone clearance: %s." ),
1159 r->
Report( wxString::Format(
_(
"Overridden by larger physical clearance from %s;"
1165 if( !
pad->FlashLayer( layer ) )
1175 r->
Report( wxString::Format(
_(
"Overridden by larger physical hole clearance "
1176 "from %s; clearance: %s." ),
1186 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1193 reportHeader(
_(
"Zone clearance resolution for:" ), a, b, layer, r );
1199 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1200 m_frame->StringFromValue( 0,
true ) ) );
1205 else if( copperIntersection.any() && !aFP && !bFP )
1209 std::vector<PCB_LAYER_ID> layers;
1211 if( copperIntersection.test( active ) )
1212 layers.push_back( active );
1216 if( layer != active )
1217 layers.push_back( layer );
1223 reportHeader(
_(
"Clearance resolution for:" ), a, b, layer, rep );
1227 rep->Report(
_(
"Items belong to the same net. Min clearance is 0." ) );
1239 if( constraint.
IsNull() )
1241 rep->Report(
_(
"Min clearance is 0." ) );
1245 rep->Report( wxString::Format(
_(
"Resolved clearance: %s; clearance will "
1251 rep->Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1256 if( layers.size() == 1 )
1261 fillReport( layer, r );
1266 auto perLayerMessages = std::make_shared<std::vector<std::vector<wxString>>>();
1267 perLayerMessages->reserve( layers.size() );
1271 VECTOR_REPORTER tmp;
1272 fillReport( layer, &tmp );
1273 perLayerMessages->push_back( std::move( tmp.m_messages ) );
1277 wxBoxSizer* vbox =
new wxBoxSizer( wxVERTICAL );
1279 wxChoice* choice =
new wxChoice( panel, wxID_ANY );
1282 choice->Append(
m_frame->GetBoard()->GetLayerName( layer ) );
1284 choice->SetSelection( 0 );
1288 wxHW_SCROLLBAR_AUTO | wxBORDER_SIMPLE );
1291 wxStaticText* layerLabel =
new wxStaticText( panel, wxID_ANY,
_(
"Layer:" ) );
1293 vbox->Add( layerLabel, 0, wxLEFT | wxRIGHT | wxTOP, 5 );
1294 vbox->Add( choice, 0, wxEXPAND | wxALL, 5 );
1295 vbox->Add( reportBox, 1, wxEXPAND | wxALL, 5 );
1296 panel->SetSizer( vbox );
1300 [reportBox, perLayerMessages](
int sel )
1304 if( sel >= 0 && sel < (
int) perLayerMessages->size() )
1306 for(
const wxString& line : ( *perLayerMessages )[sel] )
1307 reportBox->
Report( line );
1313 choice->Bind( wxEVT_CHOICE,
1314 [
refresh]( wxCommandEvent& evt )
1316 refresh( evt.GetSelection() );
1326 wxString coupledNet;
1335 if( !dpIntersection.test( dpLayer ) && dpIntersection.any() )
1336 dpLayer = dpIntersection.
Seq().front();
1339 reportHeader(
_(
"Diff-pair gap resolution for:" ), ac, bc, dpLayer, r );
1344 r->
Report( wxString::Format(
_(
"Resolved gap constraints: min %s; opt %s; max %s." ),
1352 reportHeader(
_(
"Diff-pair max uncoupled length resolution for:" ), ac, bc, dpLayer, r );
1357 r->
Report(
_(
"No 'diff_pair_uncoupled' constraints defined." ) );
1364 r->
Report( wxString::Format(
_(
"Resolved max uncoupled length: %s." ),
1372 const auto isOnCorrespondingLayer=
1384 if( aItem.
IsOnLayer( correspondingMask ) )
1387 if( aItem.
IsTented( correspondingMask ) && aItem.
IsOnLayer( correspondingCopper ) )
1389 *aWarning = wxString::Format(
_(
"Note: %s is tented; clearance will only be "
1390 "applied to holes." ),
1402 if( ( a->
IsOnLayer( layer ) && isOnCorrespondingLayer( *b, layer, &warning ) )
1403 || ( b->
IsOnLayer( layer ) && isOnCorrespondingLayer( *a, layer, &warning ) ) )
1406 reportHeader(
_(
"Silkscreen clearance resolution for:" ), a, b, layer, r );
1416 if( !warning.IsEmpty() )
1419 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1431 if( aCourtyard && bCourtyard )
1434 reportHeader(
_(
"Courtyard clearance resolution for:" ), a, b, layer, r );
1443 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1453 bool pageAdded =
false;
1469 reportHeader(
_(
"Hole clearance resolution for:" ), a, b, layer, r );
1478 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1498 reportHeader(
_(
"Hole-to-hole clearance resolution for:" ), a, b, r );
1507 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1535 wxString layerName =
m_frame->GetBoard()->GetLayerName( edgeLayer );
1536 r = dialog->
AddHTMLPage( layerName + wxS(
" " ) +
_(
"Clearance" ) );
1537 reportHeader(
_(
"Edge clearance resolution for:" ), a, b, layer, r );
1546 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1562 r->
Report(
_(
"No 'physical_clearance' constraints defined." ) );
1566 LSET reportLayers = layerIntersection;
1567 bool reported =
false;
1573 reportLayers |= edgeInteractingLayers;
1580 reportLayers |= edgeInteractingLayers;
1586 reportHeader(
_(
"Physical clearance resolution for:" ), a, b, layer, r );
1591 if( constraint.
IsNull() )
1594 r->
Report( wxString::Format(
_(
"No 'physical_clearance' constraints in effect on %s." ),
1595 m_frame->GetBoard()->GetLayerName( layer ) ) );
1600 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1611 reportHeader(
_(
"Physical clearance resolution for:" ), a, b, r );
1613 r->
Report(
_(
"Items share no relevant layers. No 'physical_clearance' constraints will "
1631 reportHeader(
_(
"Physical hole clearance resolution for:" ), a, b, layer, r );
1643 r->
Report(
_(
"No 'physical_hole_clearance' constraints defined." ) );
1648 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1656 dialog->
Show(
true );
1662#define EVAL_RULES( constraint, a, b, layer, r ) drcEngine->EvalRules( constraint, a, b, layer, r )
1668 wxCHECK( selTool, 0 );
1679 static const std::vector<KICAD_T> constraintTypes = {
1696 constraintTypes,
nullptr );
1703 m_frame->ShowInfoBarError(
_(
"Select a single item for a constraints resolution report." ) );
1709 wxCHECK( dialog, 0 );
1714 bool compileError =
false;
1715 bool courtyardError =
false;
1716 std::unique_ptr<DRC_ENGINE> drcEngine =
makeDRCEngine( &compileError, &courtyardError );
1723 reportHeader(
_(
"Track width resolution for:" ), item, r );
1731 r->
Report( wxString::Format(
_(
"Resolved width constraints: min %s; opt %s; max %s." ),
1742 reportHeader(
_(
"Via diameter resolution for:" ), item, r );
1751 r->
Report( wxString::Format(
_(
"Resolved diameter constraints: min %s; opt %s; max %s." ),
1759 reportHeader(
_(
"Via annular width resolution for:" ), item, r );
1768 r->
Report( wxString::Format(
_(
"Resolved annular width constraints: min %s; opt %s; max %s." ),
1788 r->
Report( wxString::Format(
_(
"Resolved hole size constraints: min %s; opt %s; max %s." ),
1799 reportHeader(
_(
"Solder mask expansion resolution for:" ), item, r );
1807 r->
Report( wxString::Format(
_(
"Resolved solder mask expansion: %s." ),
1816 reportHeader(
_(
"Solder paste absolute clearance resolution for:" ), item, r );
1824 r->
Report( wxString::Format(
_(
"Resolved solder paste absolute clearance: %s." ),
1827 reportHeader(
_(
"Solder paste relative clearance resolution for:" ), item, r );
1837 r->
Report( wxString::Format(
_(
"Resolved solder paste relative clearance: %s." ),
1846 reportHeader(
_(
"Text height resolution for:" ), item, r );
1854 r->
Report( wxString::Format(
_(
"Resolved height constraints: min %s; opt %s; max %s." ),
1862 reportHeader(
_(
"Text thickness resolution for:" ), item, r );
1870 r->
Report( wxString::Format(
_(
"Resolved thickness constraints: min %s; opt %s; max %s." ),
1886 if( courtyardError )
1889 r->
Report(
_(
"Report may be incomplete: some footprint courtyards are malformed." )
1890 + wxS(
" " )
1891 + wxS(
"<a href='$DRC'>" ) +
_(
"Run DRC for a full analysis." )
1898 r->
Report(
_(
"Item <b>disallowed</b> at current location." ) );
1900 r->
Report(
_(
"Item allowed at current location." ) );
1910 if( courtyardError )
1913 r->
Report(
_(
"Report may be incomplete: some footprint courtyards are malformed." )
1914 + wxS(
" " )
1915 + wxS(
"<a href='$DRC'>" ) +
_(
"Run DRC for a full analysis." )
1919 drcEngine->ProcessAssertions( item, [](
const DRC_CONSTRAINT* c ){}, r );
1923 dialog->
Show(
true );
1934 wxCHECK( selTool, 0 );
1940 for(
int i = aCollector.
GetCount() - 1; i >= 0; --i )
1945 aCollector.
Remove( item );
1952 m_frame->ShowInfoBarError(
_(
"Select a footprint to diff with its library equivalent." ) );
1962 wxFileDialog dlg(
m_frame,
_(
"Choose Board to Compare With" ), wxEmptyString,
1964 wxFD_OPEN | wxFD_FILE_MUST_EXIST );
1966 if( dlg.ShowModal() != wxID_OK )
1969 wxFileName otherFn( dlg.GetPath() );
1970 otherFn.MakeAbsolute();
1972 const wxString otherPath = otherFn.GetFullPath();
1974 wxFileName projectFn = otherFn;
1976 const wxString projectPath = projectFn.GetFullPath();
1978 wxFileName activeProjectFn(
m_frame->Prj().GetProjectFullName() );
1979 activeProjectFn.MakeAbsolute();
1985 if( projectFn.SameAs( activeProjectFn ) )
1988 _(
"Select a board file from another project to compare." ) );
2006 std::vector<std::unique_ptr<BOARD_ITEM>> clones;
2012struct HISTORY_REVISION
2014 explicit HISTORY_REVISION( SETTINGS_MANAGER* aMgr ) :
2022 view = PCB_DIFF_VIEW();
2026 board->ClearProject();
2031 if( prj && mgr->IsProjectLoaded( prj ) )
2032 mgr->UnloadProject( prj,
false );
2034 if( !tempDir.IsEmpty() )
2035 wxFileName::Rmdir( tempDir, wxPATH_RMDIR_RECURSIVE );
2038 SETTINGS_MANAGER* mgr;
2039 std::unique_ptr<BOARD> board;
2046PCB_DIFF_VIEW buildPcbDiffView(
BOARD* aLive,
BOARD* aOther,
const wxString& aOtherPath )
2051 view.result = differ.Diff();
2059 std::map<KIID, KIGFX::COLOR4D> refOverrides;
2060 std::map<KIID, KIGFX::COLOR4D> compOverrides;
2061 std::map<KIID, KICAD_DIFF::CATEGORY> kiidCategories;
2066 if( !aChange.id.empty() )
2068 const KIID& kiid = aChange.id.back();
2071 switch( aChange.kind )
2075 refOverrides[kiid] = theme.
removed;
2076 compOverrides[kiid] = theme.
removed;
2079 refOverrides[kiid] = theme.
modified;
2080 compOverrides[kiid] = theme.
modified;
2083 refOverrides[kiid] = theme.
conflict;
2084 compOverrides[kiid] = theme.
conflict;
2098 for(
const auto& [kiid, color] : refOverrides )
2106 view.clones.emplace_back( clone );
2110 std::vector<KIGFX::VIEW_ITEM*> extraItems;
2112 for(
const std::unique_ptr<BOARD_ITEM>& clone : view.clones )
2119 extraItems.insert( extraItems.end(), fpItems.begin(), fpItems.end() );
2123 extraItems.push_back( clone.get() );
2128 [other = aOther, color = theme.
modified, overrides = compOverrides, extras = std::move( extraItems ),
2141 const wxString& aComparisonLabel )
2148 bool projectLoadOk = mgr && mgr->
LoadProject( aProjectPath,
false );
2153 m_frame->ShowInfoBarError( wxString::Format(
_(
"Failed to load project for %s" ), aOtherPath ) );
2157 if( !projectLoadOk && wxFileName( aProjectPath ).FileExists() )
2160 m_frame->ShowInfoBarError( wxString::Format(
_(
"Failed to load project for %s" ), aOtherPath ) );
2172 std::unique_ptr<BOARD> otherBoard;
2180 m_frame->ShowInfoBarError( wxString::Format(
_(
"Failed to load %s: %s" ), aOtherPath, ioe.
What() ) );
2186 m_frame->ShowInfoBarError( wxString::Format(
_(
"Failed to load %s" ), aOtherPath ) );
2193 m_frame->ShowInfoBarError( wxString::Format(
_(
"Failed to load %s" ), aOtherPath ) );
2199 PCB_DIFF_VIEW
view = buildPcbDiffView(
board, otherBoard.get(), aOtherPath );
2201 auto dlgDiff = std::make_unique<DIALOG_KICAD_DIFF>(
m_frame,
board->GetFileName(), aComparisonLabel,
view.result,
2202 view.referenceGeometry,
view.comparisonGeometry,
2204 dlgDiff->ShowModal();
2210 otherBoard->ClearProject();
2225 if( !liveBoard || liveBoard->
GetFileName().IsEmpty() )
2227 m_frame->ShowInfoBarError(
_(
"Save the board before comparing against local history." ) );
2231 const wxString projectPath =
m_frame->Prj().GetProjectPath();
2234 std::vector<LOCAL_HISTORY_SNAPSHOT_INFO> snapshots = history.
GetSnapshots( projectPath );
2236 if( snapshots.empty() )
2238 m_frame->ShowInfoBarError(
_(
"No local history snapshots for this project." ) );
2244 boardFn.MakeRelativeTo( projectPath );
2245 const wxString relPath = boardFn.GetFullPath( wxPATH_UNIX );
2247 wxFileName projFn(
m_frame->Prj().GetProjectFullName() );
2248 projFn.MakeRelativeTo( projectPath );
2249 const wxString projRel = projFn.GetFullPath( wxPATH_UNIX );
2254 std::vector<LOCAL_HISTORY_SNAPSHOT_INFO> boardSnapshots;
2255 wxString prevFingerprint;
2259 wxString fingerprint = history.
TreeFingerprint( projectPath, s.hash, wxS(
".kicad_pcb" ) );
2261 if( fingerprint.IsEmpty() || fingerprint == prevFingerprint )
2264 prevFingerprint = fingerprint;
2265 boardSnapshots.push_back( s );
2268 if( boardSnapshots.empty() )
2270 m_frame->ShowInfoBarError(
_(
"No local history snapshots change this board." ) );
2274 snapshots = std::move( boardSnapshots );
2278 std::vector<wxString> labels;
2282 wxString summary = s.summary.IsEmpty() ? s.message.BeforeFirst(
'\n' ) : s.summary;
2283 labels.push_back( wxString::Format( wxS(
"%s (%s)" ), summary, s.hash.Left( 8 ) ) );
2289 [&](
int aIndex, std::unique_ptr<BOARD>& aBoard,
PROJECT*& aPrj, wxString& aTempDir ) ->
bool
2291 const wxString hash = snapshots[aIndex].hash;
2293 dirFn.AssignDir( wxFileName::GetTempDir() );
2295 dirFn.AppendDir( wxS(
"kicad-history-" ) +
KIID().AsString() );
2296 const wxString tempDir = dirFn.GetPath();
2302 { wxS(
".kicad_pcb" ), wxS(
".kicad_pro" ),
2303 wxS(
".kicad_dru" ), wxS(
"fp-lib-table" ),
2304 wxS(
"sym-lib-table" ) } ) )
2306 wxFileName::Rmdir( tempDir, wxPATH_RMDIR_RECURSIVE );
2310 const wxString boardPath = tempDir + wxS(
"/" ) + relPath;
2311 const wxString proPath = tempDir + wxS(
"/" ) + projRel;
2318 wxFileName::Rmdir( tempDir, wxPATH_RMDIR_RECURSIVE );
2325 std::unique_ptr<BOARD> loaded;
2338 wxFileName::Rmdir( tempDir, wxPATH_RMDIR_RECURSIVE );
2345 wxFileName::Rmdir( tempDir, wxPATH_RMDIR_RECURSIVE );
2349 aBoard = std::move( loaded );
2358 [&](
int aIndex ) -> std::unique_ptr<HISTORY_REVISION>
2360 auto revision = std::make_unique<HISTORY_REVISION>( mgr );
2362 if( !loadRevision( aIndex, revision->board, revision->prj, revision->tempDir ) )
2368 revision->board->SetProject( revision->prj );
2369 revision->view = buildPcbDiffView( liveBoard, revision->board.get(),
2370 revision->tempDir + wxS(
"/" ) + relPath );
2380 std::unique_ptr<HISTORY_REVISION> shown = loadView( 0 );
2385 m_frame->ShowInfoBarError(
_(
"Could not compare against the selected snapshot." ) );
2391 while( shown->view.result.Empty() && startIndex + 1 <
static_cast<int>( snapshots.size() ) )
2393 std::unique_ptr<HISTORY_REVISION>
next = loadView( startIndex + 1 );
2398 shown = std::move(
next );
2403 std::vector<std::unique_ptr<HISTORY_REVISION>> revisions;
2404 revisions.push_back( std::move( shown ) );
2406 int shownIndex = startIndex;
2407 const PCB_DIFF_VIEW&
view = revisions.back()->view;
2409 auto dlgDiff = std::make_unique<DIALOG_KICAD_DIFF>(
m_frame, liveBoard->
GetFileName(), labels[startIndex],
2410 view.result,
view.referenceGeometry,
2411 view.comparisonGeometry,
view.switcher );
2413 dlgDiff->SetRevisionChooser(
2417 if( aIndex == shownIndex )
2420 std::unique_ptr<HISTORY_REVISION>
next = loadView( aIndex );
2424 m_frame->ShowInfoBarError(
_(
"Could not compare against the selected snapshot." ) );
2429 revisions.push_back( std::move(
next ) );
2430 const PCB_DIFF_VIEW& nextView = revisions.back()->view;
2434 dlgDiff->Reload( liveBoard->
GetFileName(), labels[aIndex], nextView.result,
2435 nextView.referenceGeometry, nextView.comparisonGeometry, nextView.switcher,
2440 m_frame->ShowInfoBarError(
_(
"Could not compare against the selected snapshot." ) );
2441 dlgDiff->EndModal( wxID_CANCEL );
2446 revisions.erase( revisions.begin(), revisions.end() - 1 );
2447 shownIndex = aIndex;
2450 dlgDiff->ShowModal();
2464 wxCHECK( selTool, 0 );
2470 m_frame->ShowInfoBarError(
_(
"Select a footprint for a footprint associations report." ) );
2498 r->
Report( wxS(
"<h7>" ) +
_(
"Board vs library diff for:" ) + wxS(
"</h7>" ) );
2500 + wxS(
"<li>" ) +
_(
"Library: " ) +
EscapeHTML( libName ) + wxS(
"</li>" )
2501 + wxS(
"<li>" ) +
_(
"Library item: " ) +
EscapeHTML( fpName ) + wxS(
"</li></ul>" ) );
2510 r->
Report(
_(
"The library is not included in the current configuration." )
2511 + wxS(
"  " )
2512 + wxS(
"<a href='$CONFIG'>" ) +
_(
"Manage Footprint Libraries" )
2516 else if( !adapter->
HasLibrary( libName,
true ) )
2518 r->
Report(
_(
"The library is not enabled in the current configuration." )
2519 + wxS(
"  " )
2520 + wxS(
"<a href='$CONFIG'>" ) +
_(
"Manage Footprint Libraries" )
2526 std::shared_ptr<FOOTPRINT> libFootprint;
2530 libFootprint.reset( adapter->
LoadFootprint( libName, fpName,
true ) );
2538 r->
Report( wxString::Format(
_(
"The library no longer contains the item %s." ),
2544 r->
Report(
_(
"No relevant differences detected." ) );
2560 dialog->
Show(
true );
2566 wxBoxSizer* sizer =
new wxBoxSizer( wxVERTICAL );
2570 sizer->Add( diffWidget, 1, wxEXPAND | wxALL, 5 );
2571 aParentPanel->SetSizer( sizer );
2572 aParentPanel->Layout();
2582 m_frame->m_ProbingSchToPcb =
true;
2589 m_frame->m_ProbingSchToPcb =
false;
2591 bool request3DviewRedraw =
frame()->GetPcbNewSettings()->m_Display.m_Live3DRefresh;
2594 request3DviewRedraw =
false;
2597 if( request3DviewRedraw )
2598 m_frame->Update3DView(
false,
true );
2611 bool enableHighlight =
false;
2616 std::set<int> netcodes;
2621 netcodes.insert( ci->GetNetCode() );
2624 enableHighlight = !netcodes.empty();
2626 if( enableHighlight && netcodes.size() > 1 )
2631 board->ResetNetHighLight();
2633 for(
int multiNet : netcodes )
2634 board->SetHighLightNet( multiNet,
true );
2636 board->HighLightON();
2637 m_toolMgr->GetView()->UpdateAllLayersColor();
2641 else if( enableHighlight )
2643 net = *netcodes.begin();
2668 bool saved =
filter.lockedItems;
2669 filter.lockedItems =
true;
2673 filter.lockedItems = saved;
2681 for(
int i = collector.
GetCount() - 1; i >= 0; i-- )
2683 LSET itemLayers = collector[i]->GetLayerSet();
2686 ( highContrast && !itemLayers.
Contains( contrastLayer ) ) )
2693 enableHighlight = ( collector.
GetCount() > 0 );
2696 if( enableHighlight )
2701 m_frame->SendCrossProbeItem( targetItem );
2709 if( !aUseSelection && net >= 0 && netcodes.size() == 1 && netcodes.contains( net ) && settings->
IsHighlightEnabled() )
2715 wxString sig = netinfo->GetNetChain();
2716 if( !sig.IsEmpty() )
2722 if( n->GetNetChain() == sig )
2728 std::set<int> sigCodes;
2733 if( n->GetNetChain() == sig )
2734 sigCodes.insert( n->GetNetCode() );
2738 m_toolMgr->GetView()->UpdateAllLayersColor();
2743 pcbSettings->SetHighlightedNetChain( sig );
2745 board2->ResetNetHighLight();
2747 for(
int c : sigCodes )
2748 board2->SetHighLightNet( c,
true );
2750 board2->HighLightON();
2760 else if( !aUseSelection && netcodes.size() == 1 && netcodes.contains( net ) )
2767 if( !netcodes.empty() )
2777 const bool retained =
view->GetGAL()->HasRetainedScene();
2790 const bool switchedNet = wasEnabled && enableHighlight;
2792 if( retained && ( switchedNet || pcbSettings->HasCanvasFadedLayers() ) )
2796 view->UpdateLayersColor(
false,
2797 [pcbSettings](
int aLayer )
2799 return !pcbSettings->IsCanvasFadedLayer( aLayer );
2807 view->UpdateAllLayersColor();
2814 pcbSettings->SetHighlightedNetChain( wxEmptyString );
2817 if( enableHighlight && net >= 0 )
2820 board->SetHighLightNet( net );
2821 board->HighLightON();
2827 std::vector<MSG_PANEL_ITEM> items;
2829 m_frame->SetMsgPanel( items );
2836 board->ResetNetHighLight();
2838 m_frame->SendCrossProbeNetName(
"" );
2849 const std::set<int>& highlighted = settings->GetHighlightNetCodes();
2854 settings->SetHighlight(
true, netcode );
2855 m_toolMgr->GetView()->UpdateAllLayersColor();
2864 wxString sig = net->GetNetChain();
2865 if( !sig.IsEmpty() )
2869 if( n->GetNetChain() == sig )
2871 bool alreadyHighlighted = highlighted.count( netcode );
2872 if( count > 1 && alreadyHighlighted )
2891 std::set<int> temp = highlighted;
2893 m_toolMgr->GetView()->UpdateAllLayersColor();
2901 m_toolMgr->GetView()->UpdateAllLayersColor();
2926 item = collector[0];
2935 if(
PAD*
pad =
dynamic_cast<PAD*
>( item ) )
2936 net =
pad->GetNet();
2952 pcbSettings->SetHighlightedNetChain( wxEmptyString );
2956 m_toolMgr->GetView()->UpdateAllLayersColor();
2959 pcbSettings->SetHighlightedNetChain( wxString() );
2971 pcbSettings->SetHighlightedNetChain( wxEmptyString );
2975 m_toolMgr->GetView()->UpdateAllLayersColor();
2978 pcbSettings->SetHighlightedNetChain( wxString() );
2992 sig = net->GetNetChain();
2999 pcbSettings->SetHighlightedNetChain( sig );
3001 std::set<int> codes;
3003 if( !sig.IsEmpty() )
3007 if( net->GetNetChain() == sig )
3008 codes.insert( net->GetNetCode() );
3013 m_toolMgr->GetView()->UpdateAllLayersColor();
3026 std::pair<wxString, wxString> ids = aEvent.
Parameter<std::pair<wxString, wxString>>();
3027 KIID oldId( ids.first );
3028 KIID newId( ids.second );
3042 board->ResetNetHighLight();
3047 pcbSettings->SetHighlightedNetChain( wxString() );
3049 m_toolMgr->GetView()->UpdateAllLayersColor();
3051 m_frame->SendCrossProbeNetName(
"" );
3068 [
this](
const VECTOR2D& pt ) ->
bool
3074 EDIT_TOOL::PadFilter );
3081 EDIT_TOOL::FootprintFilter );
3090 for(
PAD*
pad : fp->Pads() )
3100 pad->SetLocalRatsnestVisible( !
pad->GetLocalRatsnestVisible() );
3104 if( !fp->Pads().empty() )
3106 bool enable = !fp->Pads()[0]->GetLocalRatsnestVisible();
3108 for(
PAD* childPad : fp->Pads() )
3109 childPad->SetLocalRatsnestVisible( enable );
3121 [
this](
int aCondition )
3127 for(
PAD*
pad : fp->Pads() )
3152 std::shared_ptr<CONNECTIVITY_DATA> connectivity =
getModel<BOARD>()->GetConnectivity();
3156 connectivity->ClearLocalRatsnest();
3184 std::vector<BOARD_ITEM*> items;
3187 for( std::size_t i = 0; i < queued_items.size(); ++i )
3189 if( !queued_items[i]->IsBOARD_ITEM() )
3194 wxCHECK2( item,
continue );
3201 items.push_back(
pad );
3208 queued_items.push_back( aItem );
3214 if( boardItem->GetLocalRatsnestVisible() ||
displayOptions().m_ShowModuleRatsnest )
3215 items.push_back( boardItem );
3219 if( items.empty() || std::none_of( items.begin(), items.end(),
3222 return( aItem->Type() == PCB_TRACE_T
3223 || aItem->Type() == PCB_PAD_T
3224 || aItem->Type() == PCB_ARC_T
3225 || aItem->Type() == PCB_ZONE_T
3226 || aItem->Type() == PCB_FOOTPRINT_T
3227 || aItem->Type() == PCB_VIA_T
3228 || aItem->Type() == PCB_SHAPE_T );
3237 connectivity->BlockRatsnestItems( items );
3265 m_toolMgr->GetView()->GetPainter()->GetSettings() );
3270 if( aNetCode <= 0 && !
selection.Empty() )
3276 if( bci->GetNetCode() > 0 )
3289 if( !
m_frame->GetAppearancePanel()->IsTogglingNetclassRatsnestVisibility() )
3291 m_frame->GetCanvas()->RedrawRatsnest();
3292 m_frame->GetCanvas()->Refresh();
3294 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 NETINFO_ITEM object for a given item.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual bool IsConnected() const
Returns information if the object is derived from BOARD_CONNECTED_ITEM.
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
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
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.
static void GetViolationLayers(BOARD *aBoard, const std::shared_ptr< RC_ITEM > &aItem, PCB_MARKER *aMarker, PCB_LAYER_ID &aPrincipalLayer, LSET &aViolationLayers)
Work out which layer to focus on and which layers a violation involves.
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,...
An abstract base class for deriving all objects that can be added to a VIEW.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
virtual int GetTopLayer() const
PAINTER * GetPainter() const
Return the painter object used by the view for drawing VIEW_ITEM objects.
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.
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.
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 LoadProject(const wxString &aFullPath, bool aSetActive=true, bool aOverrideLock=false)
Load a project or sets up a new project with a specified path.
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.
@ 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
@ 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
@ 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
#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)
BOARD_ITEM * FindPcbDiffItem(const BOARD *aBoard, const KIID &aId)
Resolve an actual UUID or a footprint field's diff ID on a board.
DOCUMENT_GEOMETRY ExtractBoardGeometry(const BOARD &aBoard, const KIGFX::COLOR4D &aColor)
Extract a coarse outline of a BOARD into a DOCUMENT_GEOMETRY for use as background context in DIFF_SC...
std::vector< KIGFX::VIEW_ITEM * > CollectFootprintDiffContextItems(FOOTPRINT &aFootprint)
CATEGORY CategoryFor(CHANGE_KIND aKind)
Map a CHANGE_KIND to the visual category it belongs to.
@ COLOR
Color has changed.
@ 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
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
Diff colors with defaults for light backgrounds.
KIGFX::COLOR4D reference
Default color for source-document context geometry.
KIGFX::COLOR4D comparison
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.