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 thickness constraints: min %s; max %s." ),
676 r->
Report( wxString::Format(
_(
"Resolved width constraints: min %s; max %s." ),
691 r->
Report( wxString::Format(
_(
"Resolved angle constraints: min %s; max %s." ),
698 reportHeader(
_(
"Track segment length resolution for:" ), a, r );
706 r->
Report( wxString::Format(
_(
"Resolved segment length constraints: min %s; max %s." ),
713 reportHeader(
_(
"Connection width resolution for:" ), a, b, r );
721 r->
Report( wxString::Format(
_(
"Resolved min connection width: %s." ),
735 r->
Report( wxString::Format(
_(
"Resolved diameter constraints: min %s; max %s." ),
742 reportHeader(
_(
"Via annular width resolution for:" ), a, r );
750 r->
Report( wxString::Format(
_(
"Resolved annular width constraints: min %s; max %s." ),
767 r->
Report( wxString::Format(
_(
"Resolved hole size constraints: min %s; max %s." ),
774 reportHeader(
_(
"Hole clearance resolution for:" ), a, b, r );
782 r->
Report(
_(
"Items belong to the same net. Clearance is 0." ) );
791 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ), clearanceStr ) );
797 reportHeader(
_(
"Physical hole clearance resolution for:" ), a, b, layer, r );
806 r->
Report(
_(
"No 'physical_hole_clearance' constraints defined." ) );
811 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ), clearanceStr ) );
818 reportHeader(
_(
"Hole-to-hole clearance resolution for:" ), a, b, r );
828 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ), clearanceStr ) );
833 reportHeader(
_(
"Edge clearance resolution for:" ), a, b, r );
844 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ), clearanceStr ) );
850 reportHeader(
_(
"Clearance resolution for:" ), a, b, layer, r );
858 r->
Report(
_(
"Items belong to the same net. Clearance is 0." ) );
867 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ), clearanceStr ) );
873 reportHeader(
_(
"Physical clearance resolution for:" ), a, b, layer, r );
882 r->
Report(
_(
"No 'physical_clearance' constraints defined." ) );
887 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ), clearanceStr ) );
899 drcEngine->ProcessAssertions( a, [](
const DRC_CONSTRAINT* c ){}, r );
909 dialog->
Show(
true );
919 wxCHECK( selTool, 0 );
927 if( !
selection.GetItem( 0 )->IsBOARD_ITEM() || !
selection.GetItem( 1 )->IsBOARD_ITEM() )
942 static const std::vector<KICAD_T> clearanceTypes = {
958 _(
"Select first item for clearance resolution..." ),
959 clearanceTypes,
nullptr );
969 _(
"Select second item for clearance resolution..." ),
970 clearanceTypes, firstItem );
977 if( firstItem == secondItem )
979 m_frame->ShowInfoBarError(
_(
"Select two different items for clearance resolution." ) );
991 wxCHECK(
m_frame && aItemA && aItemB, );
1002 m_frame->ShowInfoBarError(
_(
"Cannot generate clearance report on empty group." ) );
1015 m_frame->ShowInfoBarError(
_(
"Cannot generate clearance report on empty group." ) );
1025 const auto checkFootprint =
1028 const PAD* foundPad =
nullptr;
1032 if( !foundPad ||
pad->SameLogicalPadAs( foundPad ) )
1045 a = checkFootprint(
static_cast<const FOOTPRINT*
>( a ) );
1048 b = checkFootprint(
static_cast<const FOOTPRINT*
>( b ) );
1073 const ZONE* zone =
dynamic_cast<const ZONE*
>( a );
1074 const PAD*
pad =
dynamic_cast<const PAD*
>( b );
1078 bool compileError =
false;
1079 bool courtyardError =
false;
1080 std::unique_ptr<DRC_ENGINE> drcEngine =
makeDRCEngine( &compileError, &courtyardError );
1082 if( copperIntersection.any() && zone &&
pad && zone->
GetNetCode() ==
pad->GetNetCode() )
1092 reportHeader(
_(
"Zone connection resolution for:" ), a, b, layer, r );
1094 constraint = drcEngine->EvalZoneConnection(
pad, zone, layer, r );
1100 reportHeader(
_(
"Thermal-relief gap resolution for:" ), a, b, layer, r );
1109 r->
Report( wxString::Format(
_(
"Resolved thermal relief gap: %s." ),
1110 m_frame->StringFromValue( gap,
true ) ) );
1114 reportHeader(
_(
"Thermal-relief spoke width resolution for:" ), a, b, layer, r );
1123 r->
Report( wxString::Format(
_(
"Resolved spoke width: %s." ),
1124 m_frame->StringFromValue( width,
true ) ) );
1128 reportHeader(
_(
"Thermal-relief min spoke count resolution for:" ), a, b, layer, r );
1137 r->
Report( wxString::Format(
_(
"Resolved min spoke count: %d." ),
1140 std::shared_ptr<CONNECTIVITY_DATA> connectivity =
pad->GetBoard()->GetConnectivity();
1146 reportHeader(
_(
"Zone clearance resolution for:" ), a, b, layer, r );
1150 r->
Report( wxString::Format(
_(
"Zone clearance: %s." ),
1160 r->
Report( wxString::Format(
_(
"Overridden by larger physical clearance from %s;"
1166 if( !
pad->FlashLayer( layer ) )
1176 r->
Report( wxString::Format(
_(
"Overridden by larger physical hole clearance "
1177 "from %s; clearance: %s." ),
1187 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1194 reportHeader(
_(
"Zone clearance resolution for:" ), a, b, layer, r );
1200 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1201 m_frame->StringFromValue( 0,
true ) ) );
1206 else if( copperIntersection.any() && !aFP && !bFP )
1210 std::vector<PCB_LAYER_ID> layers;
1212 if( copperIntersection.test( active ) )
1213 layers.push_back( active );
1217 if( layer != active )
1218 layers.push_back( layer );
1224 reportHeader(
_(
"Clearance resolution for:" ), a, b, layer, rep );
1228 rep->Report(
_(
"Items belong to the same net. Min clearance is 0." ) );
1240 if( constraint.
IsNull() )
1242 rep->Report(
_(
"Min clearance is 0." ) );
1246 rep->Report( wxString::Format(
_(
"Resolved clearance: %s; clearance will "
1252 rep->Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1257 if( layers.size() == 1 )
1262 fillReport( layer, r );
1267 auto perLayerMessages = std::make_shared<std::vector<std::vector<wxString>>>();
1268 perLayerMessages->reserve( layers.size() );
1272 VECTOR_REPORTER tmp;
1273 fillReport( layer, &tmp );
1274 perLayerMessages->push_back( std::move( tmp.m_messages ) );
1278 wxBoxSizer* vbox =
new wxBoxSizer( wxVERTICAL );
1280 wxChoice* choice =
new wxChoice( panel, wxID_ANY );
1283 choice->Append(
m_frame->GetBoard()->GetLayerName( layer ) );
1285 choice->SetSelection( 0 );
1289 wxHW_SCROLLBAR_AUTO | wxBORDER_SIMPLE );
1292 wxStaticText* layerLabel =
new wxStaticText( panel, wxID_ANY,
_(
"Layer:" ) );
1294 vbox->Add( layerLabel, 0, wxLEFT | wxRIGHT | wxTOP, 5 );
1295 vbox->Add( choice, 0, wxEXPAND | wxALL, 5 );
1296 vbox->Add( reportBox, 1, wxEXPAND | wxALL, 5 );
1297 panel->SetSizer( vbox );
1301 [reportBox, perLayerMessages](
int sel )
1305 if( sel >= 0 && sel < (
int) perLayerMessages->size() )
1307 for(
const wxString& line : ( *perLayerMessages )[sel] )
1308 reportBox->
Report( line );
1314 choice->Bind( wxEVT_CHOICE,
1315 [
refresh]( wxCommandEvent& evt )
1317 refresh( evt.GetSelection() );
1327 wxString coupledNet;
1336 if( !dpIntersection.test( dpLayer ) && dpIntersection.any() )
1337 dpLayer = dpIntersection.
Seq().front();
1340 reportHeader(
_(
"Diff-pair gap resolution for:" ), ac, bc, dpLayer, r );
1345 r->
Report( wxString::Format(
_(
"Resolved gap constraints: min %s; opt %s; max %s." ),
1353 reportHeader(
_(
"Diff-pair max uncoupled length resolution for:" ), ac, bc, dpLayer, r );
1358 r->
Report(
_(
"No 'diff_pair_uncoupled' constraints defined." ) );
1365 r->
Report( wxString::Format(
_(
"Resolved max uncoupled length: %s." ),
1373 const auto isOnCorrespondingLayer=
1385 if( aItem.
IsOnLayer( correspondingMask ) )
1388 if( aItem.
IsTented( correspondingMask ) && aItem.
IsOnLayer( correspondingCopper ) )
1390 *aWarning = wxString::Format(
_(
"Note: %s is tented; clearance will only be "
1391 "applied to holes." ),
1403 if( ( a->
IsOnLayer( layer ) && isOnCorrespondingLayer( *b, layer, &warning ) )
1404 || ( b->
IsOnLayer( layer ) && isOnCorrespondingLayer( *a, layer, &warning ) ) )
1407 reportHeader(
_(
"Silkscreen clearance resolution for:" ), a, b, layer, r );
1417 if( !warning.IsEmpty() )
1420 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1432 if( aCourtyard && bCourtyard )
1435 reportHeader(
_(
"Courtyard clearance resolution for:" ), a, b, layer, r );
1444 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1454 bool pageAdded =
false;
1470 reportHeader(
_(
"Hole clearance resolution for:" ), a, b, layer, r );
1479 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1499 reportHeader(
_(
"Hole-to-hole clearance resolution for:" ), a, b, r );
1508 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1536 wxString layerName =
m_frame->GetBoard()->GetLayerName( edgeLayer );
1537 r = dialog->
AddHTMLPage( layerName + wxS(
" " ) +
_(
"Clearance" ) );
1538 reportHeader(
_(
"Edge clearance resolution for:" ), a, b, layer, r );
1547 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1563 r->
Report(
_(
"No 'physical_clearance' constraints defined." ) );
1567 LSET reportLayers = layerIntersection;
1568 bool reported =
false;
1574 reportLayers |= edgeInteractingLayers;
1581 reportLayers |= edgeInteractingLayers;
1587 reportHeader(
_(
"Physical clearance resolution for:" ), a, b, layer, r );
1592 if( constraint.
IsNull() )
1595 r->
Report( wxString::Format(
_(
"No 'physical_clearance' constraints in effect on %s." ),
1596 m_frame->GetBoard()->GetLayerName( layer ) ) );
1601 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1612 reportHeader(
_(
"Physical clearance resolution for:" ), a, b, r );
1614 r->
Report(
_(
"Items share no relevant layers. No 'physical_clearance' constraints will "
1632 reportHeader(
_(
"Physical hole clearance resolution for:" ), a, b, layer, r );
1644 r->
Report(
_(
"No 'physical_hole_clearance' constraints defined." ) );
1649 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1657 dialog->
Show(
true );
1663#define EVAL_RULES( constraint, a, b, layer, r ) drcEngine->EvalRules( constraint, a, b, layer, r )
1669 wxCHECK( selTool, 0 );
1680 static const std::vector<KICAD_T> constraintTypes = {
1697 constraintTypes,
nullptr );
1704 m_frame->ShowInfoBarError(
_(
"Select a single item for a constraints resolution report." ) );
1710 wxCHECK( dialog, 0 );
1715 bool compileError =
false;
1716 bool courtyardError =
false;
1717 std::unique_ptr<DRC_ENGINE> drcEngine =
makeDRCEngine( &compileError, &courtyardError );
1724 reportHeader(
_(
"Track width resolution for:" ), item, r );
1732 r->
Report( wxString::Format(
_(
"Resolved width constraints: min %s; opt %s; max %s." ),
1743 reportHeader(
_(
"Via diameter resolution for:" ), item, r );
1752 r->
Report( wxString::Format(
_(
"Resolved diameter constraints: min %s; opt %s; max %s." ),
1760 reportHeader(
_(
"Via annular width resolution for:" ), item, r );
1769 r->
Report( wxString::Format(
_(
"Resolved annular width constraints: min %s; opt %s; max %s." ),
1789 r->
Report( wxString::Format(
_(
"Resolved hole size constraints: min %s; opt %s; max %s." ),
1800 reportHeader(
_(
"Solder mask expansion resolution for:" ), item, r );
1808 r->
Report( wxString::Format(
_(
"Resolved solder mask expansion: %s." ),
1817 reportHeader(
_(
"Solder paste absolute clearance resolution for:" ), item, r );
1825 r->
Report( wxString::Format(
_(
"Resolved solder paste absolute clearance: %s." ),
1828 reportHeader(
_(
"Solder paste relative clearance resolution for:" ), item, r );
1838 r->
Report( wxString::Format(
_(
"Resolved solder paste relative clearance: %s." ),
1847 reportHeader(
_(
"Text height resolution for:" ), item, r );
1855 r->
Report( wxString::Format(
_(
"Resolved height constraints: min %s; opt %s; max %s." ),
1863 reportHeader(
_(
"Text thickness resolution for:" ), item, r );
1871 r->
Report( wxString::Format(
_(
"Resolved thickness constraints: min %s; opt %s; max %s." ),
1887 if( courtyardError )
1890 r->
Report(
_(
"Report may be incomplete: some footprint courtyards are malformed." )
1891 + wxS(
" " )
1892 + wxS(
"<a href='$DRC'>" ) +
_(
"Run DRC for a full analysis." )
1899 r->
Report(
_(
"Item <b>disallowed</b> at current location." ) );
1901 r->
Report(
_(
"Item allowed at current location." ) );
1911 if( courtyardError )
1914 r->
Report(
_(
"Report may be incomplete: some footprint courtyards are malformed." )
1915 + wxS(
" " )
1916 + wxS(
"<a href='$DRC'>" ) +
_(
"Run DRC for a full analysis." )
1920 drcEngine->ProcessAssertions( item, [](
const DRC_CONSTRAINT* c ){}, r );
1924 dialog->
Show(
true );
1935 wxCHECK( selTool, 0 );
1941 for(
int i = aCollector.
GetCount() - 1; i >= 0; --i )
1946 aCollector.
Remove( item );
1953 m_frame->ShowInfoBarError(
_(
"Select a footprint to diff with its library equivalent." ) );
1963 wxFileDialog dlg(
m_frame,
_(
"Choose Board to Compare With" ), wxEmptyString,
1965 wxFD_OPEN | wxFD_FILE_MUST_EXIST );
1967 if( dlg.ShowModal() != wxID_OK )
1970 wxFileName otherFn( dlg.GetPath() );
1971 otherFn.MakeAbsolute();
1973 const wxString otherPath = otherFn.GetFullPath();
1975 wxFileName projectFn = otherFn;
1977 const wxString projectPath = projectFn.GetFullPath();
1979 wxFileName activeProjectFn(
m_frame->Prj().GetProjectFullName() );
1980 activeProjectFn.MakeAbsolute();
1986 if( projectFn.SameAs( activeProjectFn ) )
1989 _(
"Select a board file from another project to compare." ) );
2005 std::vector<std::unique_ptr<BOARD_ITEM>> clones;
2010PCB_DIFF_VIEW buildPcbDiffView(
BOARD* aLive,
BOARD* aOther,
const wxString& aOtherPath )
2015 view.result = differ.Diff();
2019 std::map<KIID, KIGFX::COLOR4D> refOverrides;
2020 std::map<KIID, KIGFX::COLOR4D> compOverrides;
2021 std::map<KIID, KICAD_DIFF::CATEGORY> kiidCategories;
2026 if( !aChange.id.empty() )
2028 const KIID& kiid = aChange.id.back();
2031 switch( aChange.kind )
2035 refOverrides[kiid] = theme.
removed;
2036 compOverrides[kiid] = theme.
removed;
2039 refOverrides[kiid] = theme.
modified;
2040 compOverrides[kiid] = theme.
modified;
2043 refOverrides[kiid] = theme.
conflict;
2044 compOverrides[kiid] = theme.
conflict;
2058 for(
const auto& [kiid, color] : refOverrides )
2066 view.clones.emplace_back( clone );
2070 std::vector<KIGFX::VIEW_ITEM*> extraItems;
2072 for(
const std::unique_ptr<BOARD_ITEM>& clone : view.clones )
2079 extraItems.insert( extraItems.end(), fpItems.begin(), fpItems.end() );
2083 extraItems.push_back( clone.get() );
2088 [other = aOther, color = theme.
modified, overrides = compOverrides, extras = std::move( extraItems ),
2101 const wxString& aComparisonLabel )
2108 bool projectLoadOk = mgr && mgr->
LoadProject( aProjectPath,
false );
2113 m_frame->ShowInfoBarError( wxString::Format(
_(
"Failed to load project for %s" ), aOtherPath ) );
2117 if( !projectLoadOk && wxFileName( aProjectPath ).FileExists() )
2120 m_frame->ShowInfoBarError( wxString::Format(
_(
"Failed to load project for %s" ), aOtherPath ) );
2132 std::unique_ptr<BOARD> otherBoard;
2140 m_frame->ShowInfoBarError( wxString::Format(
_(
"Failed to load %s: %s" ), aOtherPath, ioe.
What() ) );
2146 m_frame->ShowInfoBarError( wxString::Format(
_(
"Failed to load %s" ), aOtherPath ) );
2153 m_frame->ShowInfoBarError( wxString::Format(
_(
"Failed to load %s" ), aOtherPath ) );
2159 PCB_DIFF_VIEW
view = buildPcbDiffView(
board, otherBoard.get(), aOtherPath );
2161 auto dlgDiff = std::make_unique<DIALOG_KICAD_DIFF>(
m_frame,
board->GetFileName(), aComparisonLabel,
view.result,
2164 dlgDiff->ShowModal();
2170 otherBoard->ClearProject();
2185 if( !liveBoard || liveBoard->
GetFileName().IsEmpty() )
2187 m_frame->ShowInfoBarError(
_(
"Save the board before comparing against local history." ) );
2191 const wxString projectPath =
m_frame->Prj().GetProjectPath();
2194 std::vector<LOCAL_HISTORY_SNAPSHOT_INFO> snapshots = history.
GetSnapshots( projectPath );
2196 if( snapshots.empty() )
2198 m_frame->ShowInfoBarError(
_(
"No local history snapshots for this project." ) );
2204 boardFn.MakeRelativeTo( projectPath );
2205 const wxString relPath = boardFn.GetFullPath( wxPATH_UNIX );
2207 wxFileName projFn(
m_frame->Prj().GetProjectFullName() );
2208 projFn.MakeRelativeTo( projectPath );
2209 const wxString projRel = projFn.GetFullPath( wxPATH_UNIX );
2214 std::vector<LOCAL_HISTORY_SNAPSHOT_INFO> boardSnapshots;
2215 wxString prevFingerprint;
2219 wxString fingerprint = history.
TreeFingerprint( projectPath, s.hash, wxS(
".kicad_pcb" ) );
2221 if( fingerprint.IsEmpty() || fingerprint == prevFingerprint )
2224 prevFingerprint = fingerprint;
2225 boardSnapshots.push_back( s );
2228 if( boardSnapshots.empty() )
2230 m_frame->ShowInfoBarError(
_(
"No local history snapshots change this board." ) );
2234 snapshots = std::move( boardSnapshots );
2238 std::vector<wxString> labels;
2242 wxString summary = s.summary.IsEmpty() ? s.message.BeforeFirst(
'\n' ) : s.summary;
2243 labels.push_back( wxString::Format( wxS(
"%s (%s)" ), summary, s.hash.Left( 8 ) ) );
2247 std::unique_ptr<BOARD> curBoard;
2249 wxString curTempDir;
2251 auto cleanupCurrent =
2256 curBoard->ClearProject();
2266 if( !curTempDir.IsEmpty() )
2268 wxFileName::Rmdir( curTempDir, wxPATH_RMDIR_RECURSIVE );
2276 [&](
int aIndex, std::unique_ptr<BOARD>& aBoard,
PROJECT*& aPrj, wxString& aTempDir ) ->
bool
2278 const wxString hash = snapshots[aIndex].hash;
2280 dirFn.AssignDir( wxFileName::GetTempDir() );
2281 dirFn.AppendDir( wxS(
"kicad-history-" ) + hash.Left( 8 ) );
2282 const wxString tempDir = dirFn.GetPath();
2287 { wxS(
".kicad_pcb" ), wxS(
".kicad_pro" ) } ) )
2289 wxFileName::Rmdir( tempDir, wxPATH_RMDIR_RECURSIVE );
2293 const wxString boardPath = tempDir + wxS(
"/" ) + relPath;
2294 const wxString proPath = tempDir + wxS(
"/" ) + projRel;
2301 wxFileName::Rmdir( tempDir, wxPATH_RMDIR_RECURSIVE );
2308 std::unique_ptr<BOARD> loaded;
2321 wxFileName::Rmdir( tempDir, wxPATH_RMDIR_RECURSIVE );
2328 wxFileName::Rmdir( tempDir, wxPATH_RMDIR_RECURSIVE );
2332 aBoard = std::move( loaded );
2341 [&](
int aIndex, std::unique_ptr<BOARD>& aBoard,
PROJECT*& aPrj, wxString& aTempDir,
2342 PCB_DIFF_VIEW& aView ) ->
bool
2344 if( !loadRevision( aIndex, aBoard, aPrj, aTempDir ) )
2349 aView = buildPcbDiffView( liveBoard, aBoard.get(), aTempDir + wxS(
"/" ) + relPath );
2353 aBoard->ClearProject();
2357 wxFileName::Rmdir( aTempDir, wxPATH_RMDIR_RECURSIVE );
2368 if( !loadView( 0, curBoard, curPrj, curTempDir,
view ) )
2370 m_frame->ShowInfoBarError(
_(
"Could not compare against the selected snapshot." ) );
2376 while(
view.result.Empty() && startIndex + 1 <
static_cast<int>( snapshots.size() ) )
2378 std::unique_ptr<BOARD> nextBoard;
2380 wxString nextTempDir;
2381 PCB_DIFF_VIEW nextView;
2383 if( !loadView( startIndex + 1, nextBoard, nextPrj, nextTempDir, nextView ) )
2387 view = std::move( nextView );
2388 curBoard = std::move( nextBoard );
2390 curTempDir = nextTempDir;
2394 int shownIndex = startIndex;
2396 auto dlgDiff = std::make_unique<DIALOG_KICAD_DIFF>(
m_frame, liveBoard->
GetFileName(), labels[startIndex],
2400 dlgDiff->SetRevisionChooser(
2404 if( aIndex == shownIndex )
2407 std::unique_ptr<BOARD> newBoard;
2409 wxString newTempDir;
2410 PCB_DIFF_VIEW newView;
2412 if( !loadView( aIndex, newBoard, newPrj, newTempDir, newView ) )
2414 m_frame->ShowInfoBarError(
_(
"Could not compare against the selected snapshot." ) );
2418 dlgDiff->Reload( liveBoard->
GetFileName(), labels[aIndex], newView.result,
2419 {}, {}, newView.switcher, {} );
2423 view = std::move( newView );
2424 curBoard = std::move( newBoard );
2426 curTempDir = newTempDir;
2427 shownIndex = aIndex;
2430 dlgDiff->ShowModal();
2446 wxCHECK( selTool, 0 );
2452 m_frame->ShowInfoBarError(
_(
"Select a footprint for a footprint associations report." ) );
2480 r->
Report( wxS(
"<h7>" ) +
_(
"Board vs library diff for:" ) + wxS(
"</h7>" ) );
2482 + wxS(
"<li>" ) +
_(
"Library: " ) +
EscapeHTML( libName ) + wxS(
"</li>" )
2483 + wxS(
"<li>" ) +
_(
"Library item: " ) +
EscapeHTML( fpName ) + wxS(
"</li></ul>" ) );
2492 r->
Report(
_(
"The library is not included in the current configuration." )
2493 + wxS(
"  " )
2494 + wxS(
"<a href='$CONFIG'>" ) +
_(
"Manage Footprint Libraries" )
2498 else if( !adapter->
HasLibrary( libName,
true ) )
2500 r->
Report(
_(
"The library is not enabled in the current configuration." )
2501 + wxS(
"  " )
2502 + wxS(
"<a href='$CONFIG'>" ) +
_(
"Manage Footprint Libraries" )
2508 std::shared_ptr<FOOTPRINT> libFootprint;
2512 libFootprint.reset( adapter->
LoadFootprint( libName, fpName,
true ) );
2520 r->
Report( wxString::Format(
_(
"The library no longer contains the item %s." ),
2526 r->
Report(
_(
"No relevant differences detected." ) );
2542 dialog->
Show(
true );
2548 wxBoxSizer* sizer =
new wxBoxSizer( wxVERTICAL );
2552 sizer->Add( diffWidget, 1, wxEXPAND | wxALL, 5 );
2553 aParentPanel->SetSizer( sizer );
2554 aParentPanel->Layout();
2564 m_frame->m_ProbingSchToPcb =
true;
2571 m_frame->m_ProbingSchToPcb =
false;
2573 bool request3DviewRedraw =
frame()->GetPcbNewSettings()->m_Display.m_Live3DRefresh;
2576 request3DviewRedraw =
false;
2579 if( request3DviewRedraw )
2580 m_frame->Update3DView(
false,
true );
2593 bool enableHighlight =
false;
2598 std::set<int> netcodes;
2603 netcodes.insert( ci->GetNetCode() );
2606 enableHighlight = !netcodes.empty();
2608 if( enableHighlight && netcodes.size() > 1 )
2613 board->ResetNetHighLight();
2615 for(
int multiNet : netcodes )
2616 board->SetHighLightNet( multiNet,
true );
2618 board->HighLightON();
2619 m_toolMgr->GetView()->UpdateAllLayersColor();
2623 else if( enableHighlight )
2625 net = *netcodes.begin();
2650 bool saved =
filter.lockedItems;
2651 filter.lockedItems =
true;
2655 filter.lockedItems = saved;
2663 for(
int i = collector.
GetCount() - 1; i >= 0; i-- )
2665 LSET itemLayers = collector[i]->GetLayerSet();
2668 ( highContrast && !itemLayers.
Contains( contrastLayer ) ) )
2675 enableHighlight = ( collector.
GetCount() > 0 );
2678 if( enableHighlight )
2683 m_frame->SendCrossProbeItem( targetItem );
2691 if( !aUseSelection && net >= 0 && netcodes.size() == 1 && netcodes.contains( net ) && settings->
IsHighlightEnabled() )
2697 wxString sig = netinfo->GetNetChain();
2698 if( !sig.IsEmpty() )
2704 if( n->GetNetChain() == sig )
2710 std::set<int> sigCodes;
2715 if( n->GetNetChain() == sig )
2716 sigCodes.insert( n->GetNetCode() );
2720 m_toolMgr->GetView()->UpdateAllLayersColor();
2724 board2->ResetNetHighLight();
2726 for(
int c : sigCodes )
2727 board2->SetHighLightNet( c,
true );
2729 board2->HighLightON();
2732 pcbSettings->SetHighlightedNetChain( sig );
2742 else if( !aUseSelection && netcodes.size() == 1 && netcodes.contains( net ) )
2749 if( !netcodes.empty() )
2759 const bool retained =
view->GetGAL()->HasRetainedScene();
2772 const bool switchedNet = wasEnabled && enableHighlight;
2774 if( retained && ( switchedNet || pcbSettings->HasCanvasFadedLayers() ) )
2778 view->UpdateLayersColor(
false,
2779 [pcbSettings](
int aLayer )
2781 return !pcbSettings->IsCanvasFadedLayer( aLayer );
2789 view->UpdateAllLayersColor();
2794 if( enableHighlight && net >= 0 )
2798 board->SetHighLightNet( net );
2799 board->HighLightON();
2805 std::vector<MSG_PANEL_ITEM> items;
2807 m_frame->SetMsgPanel( items );
2815 board->ResetNetHighLight();
2817 m_frame->SendCrossProbeNetName(
"" );
2828 const std::set<int>& highlighted = settings->GetHighlightNetCodes();
2833 settings->SetHighlight(
true, netcode );
2834 m_toolMgr->GetView()->UpdateAllLayersColor();
2843 wxString sig = net->GetNetChain();
2844 if( !sig.IsEmpty() )
2848 if( n->GetNetChain() == sig )
2850 bool alreadyHighlighted = highlighted.count( netcode );
2851 if( count > 1 && alreadyHighlighted )
2870 std::set<int> temp = highlighted;
2872 m_toolMgr->GetView()->UpdateAllLayersColor();
2880 m_toolMgr->GetView()->UpdateAllLayersColor();
2905 item = collector[0];
2914 if(
PAD*
pad =
dynamic_cast<PAD*
>( item ) )
2915 net =
pad->GetNet();
2931 m_toolMgr->GetView()->UpdateAllLayersColor();
2934 pcbSettings->SetHighlightedNetChain( wxString() );
2946 m_toolMgr->GetView()->UpdateAllLayersColor();
2949 pcbSettings->SetHighlightedNetChain( wxString() );
2963 sig = net->GetNetChain();
2970 pcbSettings->SetHighlightedNetChain( sig );
2972 std::set<int> codes;
2974 if( !sig.IsEmpty() )
2978 if( net->GetNetChain() == sig )
2979 codes.insert( net->GetNetCode() );
2984 m_toolMgr->GetView()->UpdateAllLayersColor();
2997 std::pair<wxString, wxString> ids = aEvent.
Parameter<std::pair<wxString, wxString>>();
2998 KIID oldId( ids.first );
2999 KIID newId( ids.second );
3013 board->ResetNetHighLight();
3018 pcbSettings->SetHighlightedNetChain( wxString() );
3020 m_toolMgr->GetView()->UpdateAllLayersColor();
3022 m_frame->SendCrossProbeNetName(
"" );
3039 [
this](
const VECTOR2D& pt ) ->
bool
3045 EDIT_TOOL::PadFilter );
3052 EDIT_TOOL::FootprintFilter );
3061 for(
PAD*
pad : fp->Pads() )
3071 pad->SetLocalRatsnestVisible( !
pad->GetLocalRatsnestVisible() );
3075 if( !fp->Pads().empty() )
3077 bool enable = !fp->Pads()[0]->GetLocalRatsnestVisible();
3079 for(
PAD* childPad : fp->Pads() )
3080 childPad->SetLocalRatsnestVisible( enable );
3092 [
this](
int aCondition )
3098 for(
PAD*
pad : fp->Pads() )
3123 std::shared_ptr<CONNECTIVITY_DATA> connectivity =
getModel<BOARD>()->GetConnectivity();
3127 connectivity->ClearLocalRatsnest();
3155 std::vector<BOARD_ITEM*> items;
3158 for( std::size_t i = 0; i < queued_items.size(); ++i )
3160 if( !queued_items[i]->IsBOARD_ITEM() )
3165 wxCHECK2( item,
continue );
3172 items.push_back(
pad );
3179 queued_items.push_back( aItem );
3185 if( boardItem->GetLocalRatsnestVisible() ||
displayOptions().m_ShowModuleRatsnest )
3186 items.push_back( boardItem );
3190 if( items.empty() || std::none_of( items.begin(), items.end(),
3193 return( aItem->Type() == PCB_TRACE_T
3194 || aItem->Type() == PCB_PAD_T
3195 || aItem->Type() == PCB_ARC_T
3196 || aItem->Type() == PCB_ZONE_T
3197 || aItem->Type() == PCB_FOOTPRINT_T
3198 || aItem->Type() == PCB_VIA_T
3199 || aItem->Type() == PCB_SHAPE_T );
3208 connectivity->BlockRatsnestItems( items );
3236 m_toolMgr->GetView()->GetPainter()->GetSettings() );
3241 if( aNetCode <= 0 && !
selection.Empty() )
3247 if( bci->GetNetCode() > 0 )
3260 if( !
m_frame->GetAppearancePanel()->IsTogglingNetclassRatsnestVisibility() )
3262 m_frame->GetCanvas()->RedrawRatsnest();
3263 m_frame->GetCanvas()->Refresh();
3265 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.
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.
@ 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
@ 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.
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.
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.