58#include <python_scripting.h>
102#include <wx/socket.h>
103#include <wx/wupdlock.h>
127#include "../scripting/python_scripting.h"
129#include <wx/filedlg.h>
131using namespace std::placeholders;
134#define INSPECT_DRC_ERROR_DIALOG_NAME wxT( "InspectDrcErrorDialog" )
135#define INSPECT_CLEARANCE_DIALOG_NAME wxT( "InspectClearanceDialog" )
136#define INSPECT_CONSTRAINTS_DIALOG_NAME wxT( "InspectConstraintsDialog" )
137#define FOOTPRINT_DIFF_DIALOG_NAME wxT( "FootprintDiffDialog" )
203 m_exportNetlistAction(
nullptr ),
204 m_findDialog(
nullptr ),
205 m_inspectDrcErrorDlg(
nullptr ),
206 m_inspectClearanceDlg(
nullptr ),
207 m_inspectConstraintsDlg(
nullptr ),
208 m_footprintDiffDlg(
nullptr ),
209 m_importProperties(
nullptr )
211 m_maximizeByDefault =
true;
212 m_showBorderAndTitleBlock =
true;
213 m_SelTrackWidthBox =
nullptr;
214 m_SelViaSizeBox =
nullptr;
215 m_SelLayerBox =
nullptr;
216 m_show_layer_manager_tools =
true;
217 m_supportsAutoSave =
true;
218 m_probingSchToPcb =
false;
219 m_show_search =
false;
220 m_show_net_inspector =
false;
224 m_ZoneFillsDirty =
true;
226 m_aboutTitle =
_HKI(
"KiCad PCB Editor" );
231 m_exportNetlistAction =
new TOOL_ACTION(
"pcbnew.EditorControl.exportNetlist",
233 _(
"Export netlist used to update schematics" ) );
238 GetGalDisplayOptions(),
242 SetBoard(
new BOARD() );
245 wxIconBundle icon_bundle;
248 icon_bundle.AddIcon( icon );
250 icon_bundle.AddIcon( icon );
252 icon_bundle.AddIcon( icon );
254 icon_bundle.AddIcon( icon );
256 icon_bundle.AddIcon( icon );
258 SetIcons( icon_bundle );
267 GetScreen()->m_Center =
false;
274 ReCreateAuxiliaryToolbar();
276 ReCreateOptToolbar();
280 &PCB_EDIT_FRAME::onPluginAvailabilityChanged,
this );
285 float proportion = GetPcbNewSettings()->m_AuiPanels.properties_splitter;
286 m_propertiesPanel->SetSplitterProportion( proportion );
294 m_auimgr.SetManagedWindow(
this );
298 unsigned int auiFlags = wxAUI_MGR_DEFAULT;
299#if !defined( _WIN32 )
302 auiFlags |= wxAUI_MGR_LIVE_RESIZE;
304 m_auimgr.SetFlags( auiFlags );
307 m_auimgr.AddPane( m_mainToolBar,
EDA_PANE().HToolbar().Name( wxS(
"MainToolbar" ) )
309 m_auimgr.AddPane( m_auxiliaryToolBar,
EDA_PANE().HToolbar().Name( wxS(
"AuxToolbar" ) )
311 m_auimgr.AddPane( m_messagePanel,
EDA_PANE().Messages().Name( wxS(
"MsgPanel" ) )
312 .Bottom().Layer( 6 ) );
315 m_auimgr.AddPane( m_optionsToolBar,
EDA_PANE().VToolbar().Name( wxS(
"OptToolbar" ) )
316 .Left().Layer( 3 ) );
318 m_auimgr.AddPane( m_drawToolBar,
EDA_PANE().VToolbar().Name( wxS(
"ToolsToolbar" ) )
319 .Right().Layer( 3 ) );
321 m_auimgr.AddPane( m_appearancePanel,
EDA_PANE().Name( wxS(
"LayersManager" ) )
323 .Caption(
_(
"Appearance" ) ).PaneBorder(
false )
324 .MinSize( FromDIP( 180 ), -1 ).BestSize( FromDIP( 180 ), -1 ) );
326 m_auimgr.AddPane( m_selectionFilterPanel,
EDA_PANE().Name( wxS(
"SelectionFilter" ) )
327 .Right().Layer( 4 ).Position( 2 )
328 .Caption(
_(
"Selection Filter" ) ).PaneBorder(
false )
329 .MinSize( FromDIP( 180 ), -1 ).BestSize( FromDIP( 180 ), -1 ) );
331 m_auimgr.AddPane( m_propertiesPanel,
EDA_PANE().Name( PropertiesPaneName() )
333 .Caption(
_(
"Properties" ) ).PaneBorder(
false )
334 .MinSize( FromDIP( wxSize( 240, 60 ) ) ).BestSize( FromDIP( wxSize( 300, 200 ) ) ) );
337 m_auimgr.AddPane( GetCanvas(),
EDA_PANE().Canvas().Name( wxS(
"DrawFrame" ) )
340 m_auimgr.AddPane( m_netInspectorPanel,
EDA_PANE()
341 .Name( NetInspectorPanelName() )
343 .Caption(
_(
"Net Inspector" ) )
345 .MinSize( FromDIP( wxSize( 240, 60 ) ) )
346 .BestSize( FromDIP( wxSize( 300, 200 ) ) ) );
348 m_auimgr.AddPane( m_searchPane,
EDA_PANE().Name( SearchPaneName() )
350 .Caption(
_(
"Search" ) ).PaneBorder(
false )
351 .MinSize( FromDIP( wxSize ( 180, 60 ) ) ).BestSize( FromDIP( wxSize ( 180, 100 ) ) )
352 .FloatingSize( FromDIP( wxSize( 480, 200 ) ) )
353 .DestroyOnClose(
false ) );
356 m_auimgr.GetPane(
"LayersManager" ).Show( m_show_layer_manager_tools );
357 m_auimgr.GetPane(
"SelectionFilter" ).Show( m_show_layer_manager_tools );
358 m_auimgr.GetPane( PropertiesPaneName() ).Show( GetPcbNewSettings()->m_AuiPanels.show_properties );
359 m_auimgr.GetPane( NetInspectorPanelName() ).Show( m_show_net_inspector );
360 m_auimgr.GetPane( SearchPaneName() ).Show( m_show_search );
363 m_auimgr.GetPane(
"SelectionFilter" ).dock_proportion = 0;
365 FinishAUIInitialization();
369 if( settings->m_AuiPanels.right_panel_width > 0 )
371 wxAuiPaneInfo& layersManager = m_auimgr.GetPane( wxS(
"LayersManager" ) );
372 SetAuiPaneSize( m_auimgr, layersManager, settings->m_AuiPanels.right_panel_width, -1 );
375 if( settings->m_AuiPanels.properties_panel_width > 0 && m_propertiesPanel )
377 wxAuiPaneInfo& propertiesPanel = m_auimgr.GetPane( PropertiesPaneName() );
379 settings->m_AuiPanels.properties_panel_width, -1 );
382 if( settings->m_AuiPanels.search_panel_height > 0
383 && ( settings->m_AuiPanels.search_panel_dock_direction == wxAUI_DOCK_TOP
384 || settings->m_AuiPanels.search_panel_dock_direction == wxAUI_DOCK_BOTTOM ) )
386 wxAuiPaneInfo& searchPane = m_auimgr.GetPane( SearchPaneName() );
387 searchPane.Direction( settings->m_AuiPanels.search_panel_dock_direction );
388 SetAuiPaneSize( m_auimgr, searchPane, -1, settings->m_AuiPanels.search_panel_height );
390 else if( settings->m_AuiPanels.search_panel_width > 0
391 && ( settings->m_AuiPanels.search_panel_dock_direction == wxAUI_DOCK_LEFT
392 || settings->m_AuiPanels.search_panel_dock_direction == wxAUI_DOCK_RIGHT ) )
394 wxAuiPaneInfo& searchPane = m_auimgr.GetPane( SearchPaneName() );
395 searchPane.Direction( settings->m_AuiPanels.search_panel_dock_direction );
396 SetAuiPaneSize( m_auimgr, searchPane, settings->m_AuiPanels.search_panel_width, -1 );
399 m_appearancePanel->SetTabIndex( settings->m_AuiPanels.appearance_panel_tab );
403 m_layerPairSettings = std::make_unique<LAYER_PAIR_SETTINGS>();
405 m_layerPairSettings->Bind( PCB_LAYER_PAIR_PRESETS_CHANGED, [&]( wxCommandEvent& aEvt )
408 std::span<const LAYER_PAIR_INFO> newPairInfos = m_layerPairSettings->GetLayerPairs();
410 std::vector<LAYER_PAIR_INFO>{ newPairInfos.begin(), newPairInfos.end() };
413 m_layerPairSettings->Bind( PCB_CURRENT_LAYER_PAIR_CHANGED, [&]( wxCommandEvent& aEvt )
415 const LAYER_PAIR& layerPair = m_layerPairSettings->GetCurrentLayerPair();
422 PrepareLayerIndicator();
433 [
this]( wxIdleEvent& aEvent )
435 BOX2D viewport = GetCanvas()->GetView()->GetViewport();
437 if( viewport != m_lastNetnamesViewport )
440 m_lastNetnamesViewport = viewport;
455 m_toolManager->GetTool<
DRC_TOOL>()->GetDRCEngine()->InitEngine( wxFileName() );
462 PythonSyncEnvironmentVariables();
463 PythonSyncProjectName();
469 m_apiHandler = std::make_unique<API_HANDLER_PCB>(
this );
470 Pgm().GetApiServer().RegisterHandler( m_apiHandler.get() );
473 GetCanvas()->SwitchBackend( m_canvasType );
483 if( strK2S.Find( wxT(
"pcbnew.app" ) ) != wxNOT_FOUND )
486 strK2S += wxT(
"../../" );
489 strK2S += wxT(
"Contents/MacOS/" );
492 wxFileName appK2S( strK2S, wxT(
"kicad2step" ) );
495 appK2S.SetExt( wxT(
"exe" ) );
510 m_appearancePanel->OnBoardChanged();
520 UpdateToolbarControlSizes();
525 m_eventCounterTimer =
new wxTimer(
this );
528 [&]( wxTimerEvent& aEvent )
530 GetCanvas()->m_PaintEventCounter->Show();
531 GetCanvas()->m_PaintEventCounter->Reset();
539 m_eventCounterTimer->GetId() );
541 m_eventCounterTimer->Start( 1000 );
548 DragAcceptFiles(
true );
565 Pgm().GetApiServer().DeregisterHandler( m_apiHandler.get() );
567 &PCB_EDIT_FRAME::onPluginAvailabilityChanged,
this );
574 open_dlg->Close(
true );
601 if( aBuildConnectivity )
679 if( screen !=
nullptr )
751 pcbTool->SetIsBoardEditor(
true );
784#define ENABLE( x ) ACTION_CONDITIONS().Enable( x )
785#define CHECK( x ) ACTION_CONDITIONS().Check( x )
822 if( SCRIPTING::IsWxAvailable() )
825 auto enableZoneControlCondition =
833 ENABLE( enableZoneControlCondition )
836 ENABLE( enableZoneControlCondition )
837 .Check( cond.
ZoneDisplayMode( ZONE_DISPLAY_MODE::SHOW_ZONE_OUTLINE ) ) );
839 ENABLE( enableZoneControlCondition )
840 .Check( cond.
ZoneDisplayMode( ZONE_DISPLAY_MODE::SHOW_FRACTURE_BORDERS ) ) );
842 ENABLE( enableZoneControlCondition )
843 .Check( cond.
ZoneDisplayMode( ZONE_DISPLAY_MODE::SHOW_TRIANGULATION ) ) );
847 auto constrainedDrawingModeCond =
853 auto boardFlippedCond =
859 auto layerManagerCond =
865 auto propertiesCond =
871 auto netInspectorCond =
877 auto searchPaneCond =
883 auto highContrastCond =
889 auto globalRatsnestCond =
895 auto curvedRatsnestCond =
901 auto netHighlightCond =
908 auto enableNetHighlightCond =
922 .Enable( enableNetHighlightCond ) );
927 auto isArcKeepCenterMode =
933 auto isArcKeepEndpointMode =
942 auto isHighlightMode =
956 auto isWalkaroundMode =
974 if( bci->GetNetCode() > 0 )
991 static const std::vector<KICAD_T> zoneTypes = {
PCB_ZONE_T };
1013#define CURRENT_TOOL( action ) mgr->SetConditions( action, CHECK( cond.CurrentTool( action ) ) )
1028#define CURRENT_EDIT_TOOL( action ) \
1029 mgr->SetConditions( action, ACTION_CONDITIONS().Check( cond.CurrentTool( action ) ) \
1030 .Enable( isDRCIdle ) )
1070#undef CURRENT_EDIT_TOOL
1079 if( event.GetId() == wxID_EXIT )
1082 if( event.GetId() == wxID_CLOSE ||
Kiface().IsSingle() )
1094 marker->GetRCItem()->SetItems(
GetCanvas()->GetDrawingSheet() );
1096 commit.
Add( marker );
1122 if( zoneFillerTool->
IsBusy() )
1126 if( wxWindow* reporter =
dynamic_cast<wxWindow*
>( zoneFillerTool->
GetProgressReporter() ) )
1127 reporter->ShowWithEffect( wxSHOW_EFFECT_EXPAND );
1132 if(
Kiface().IsSingle() )
1136 if( fpEditor && !fpEditor->Close() )
1141 if( fpViewer && !fpViewer->Close() )
1148 if( chooser && !chooser->Close() )
1155 if( fpEditor && fpEditor->IsCurrentFPFromBoard() )
1157 if( !fpEditor->CanCloseFPFromBoard(
true ) )
1165 wxString msg =
_(
"Save changes to '%s' before closing?" );
1170 return Files_io_from_id( ID_SAVE_BOARD );
1189 GetCanvas()->SetEvtHandlerEnabled(
false );
1200 open_dlg->Close(
true );
1240 if( !fn.IsOk() || !fn.IsDirWritable() )
1241 fn.SetPath( wxFileName::GetTempDir() );
1243 wxLogTrace(
traceAutoSave, wxT(
"Deleting auto save file <" ) + fn.GetFullPath() + wxT(
">" ) );
1246 if( fn.FileExists() && !wxRemoveFile( fn.GetFullPath() ) )
1248 wxLogTrace(
traceAutoSave, wxT(
"The auto save file could not be removed!" ) );
1259 m_auimgr.GetPane( wxS(
"LayersManager" ) ).Show(
false );
1260 m_auimgr.GetPane( wxS(
"TabbedPanel" ) ).Show(
false );
1288 static std::mutex dialogMutex;
1290 std::unique_lock<std::mutex> dialogLock( dialogMutex, std::try_to_lock );
1293 if( !dialogLock.owns_lock() )
1308 if( !aInitialPage.IsEmpty() )
1344 if( ( GetBoard()->GetVisibleLayers() & maskAndPasteLayers ).any() )
1345 flags |= KIGFX::ALL;
1350 if( settings->m_Display.m_TrackClearance == SHOW_WITH_VIA_ALWAYS )
1351 flags |= KIGFX::REPAINT;
1356 if( settings->m_Display.m_PadClearance )
1357 flags |= KIGFX::REPAINT;
1364 text->ClearRenderCache();
1365 text->ClearBoundingBoxCache();
1366 flags |= KIGFX::GEOMETRY | KIGFX::REPAINT;
1477 if( oldLayer == aLayer )
1500 if( item->IsOnLayer( oldLayer ) || item->IsOnLayer( aLayer ) )
1506 PCB_VIA* via = static_cast<PCB_VIA*>( item );
1510 if( via->GetViaType() == VIATYPE::BLIND_BURIED
1511 || via->GetViaType() == VIATYPE::MICROVIA )
1513 return KIGFX::REPAINT;
1516 if(
via->GetRemoveUnconnected() )
1526 PAD* pad = static_cast<PAD*>( item );
1528 if( pad->GetRemoveUnconnected() )
1533 if( GetPcbNewSettings()->m_Display.m_PadClearance )
1538 if( pad->GetAttribute() == PAD_ATTRIB::SMD )
1540 if( ( oldLayer == F_Cu || aLayer == F_Cu ) && pad->IsOnLayer( F_Cu ) )
1541 return KIGFX::REPAINT;
1543 if( ( oldLayer == B_Cu || aLayer == B_Cu ) && pad->IsOnLayer( B_Cu ) )
1544 return KIGFX::REPAINT;
1546 else if( pad->IsOnLayer( oldLayer ) || pad->IsOnLayer( aLayer ) )
1548 return KIGFX::REPAINT;
1554 PCB_TRACK* track = static_cast<PCB_TRACK*>( item );
1558 if( GetPcbNewSettings()->m_Display.m_TrackClearance )
1561 if( track->IsOnLayer( oldLayer ) || track->IsOnLayer( aLayer ) )
1562 return KIGFX::REPAINT;
1569 GetCanvas()->Refresh();
1586 layerEnum.
Map( layer,
GetBoard()->GetLayerName( layer ) );
1606 if( fn.FileExists() && !fn.IsFileWritable() )
1652 SetStatusText( wxEmptyString );
1701 if(
project.m_PcbLastPath[ aType ].IsEmpty() )
1702 return wxEmptyString;
1704 wxFileName absoluteFileName =
project.m_PcbLastPath[ aType ];
1707 absoluteFileName.MakeAbsolute( pcbFileName.GetPath() );
1708 return absoluteFileName.GetFullPath();
1716 wxFileName relativeFileName = aLastPath;
1719 relativeFileName.MakeRelativeTo( pcbFileName.GetPath() );
1721 if( relativeFileName.GetFullPath() !=
project.m_PcbLastPath[ aType ] )
1723 project.m_PcbLastPath[ aType ] = relativeFileName.GetFullPath();
1735 if( !GetTitle().StartsWith( wxT(
"*" ) ) )
1747 connectivity->RecalculateRatsnest(
nullptr );
1750 std::vector<MSG_PANEL_ITEM> msg_list;
1765 bool readOnly =
false;
1766 bool unsaved =
false;
1768 if( fn.IsOk() && fn.FileExists() )
1769 readOnly = !fn.IsFileWritable();
1778 title += fn.GetName();
1781 title += wxS(
" " ) +
_(
"[Read Only]" );
1784 title += wxS(
" " ) +
_(
"[Unsaved]" );
1786 title += wxT(
" \u2014 " ) +
_(
"PCB Editor" );
1821 layerEnum.
Map( layer,
GetBoard()->GetLayerName( layer ) );
1850 wxString findString;
1854 if( selection.
Size() == 1 )
1858 switch( front->
Type() )
1868 if( findString.Contains( wxT(
"\n" ) ) )
1869 findString = findString.Before(
'\n' );
1900 plotSettings.
SetFormat( PLOT_FORMAT::GERBER );
1903 plotSettings.
SetFormat( PLOT_FORMAT::DXF );
1906 plotSettings.
SetFormat( PLOT_FORMAT::HPGL );
1909 plotSettings.
SetFormat( PLOT_FORMAT::PDF );
1912 plotSettings.
SetFormat( PLOT_FORMAT::POST );
1918 wxFAIL_MSG( wxT(
"ToPlotter(): unexpected plot type" ) );
break;
1931 if(
Kiface().IsSingle() )
1943 if( !frame->IsShownOnScreen() )
1945 wxFileName fn(
Prj().GetProjectPath(),
Prj().GetProjectName(),
1950 if( !fn.FileExists() )
1954 if( !fn.FileExists() )
1956 DisplayError(
this,
_(
"The schematic for this board cannot be found." ) );
1965 frame->Show(
true );
1976 const wxString& aAnnotateMessage )
1980 if( standalone == 0 )
1983 "stand-alone mode. In order to create or update PCBs from "
1984 "schematics, you must launch the KiCad project manager and "
1985 "create a project." ) );
1989 if( standalone < 0 )
1994 std::string payload( aAnnotateMessage );
1998 if( payload == aAnnotateMessage )
2016 wxString extra_info = e.
Problem() + wxT(
" : " ) + e.
What() + wxT(
" at " ) + e.
Where();
2019 "report this issue to the KiCad team using the menu "
2020 "Help->Report Bug."), extra_info );
2031 wxFileName schematic(
Prj().GetProjectPath(),
Prj().GetProjectName(),
2034 if( !schematic.FileExists() )
2036 wxFileName legacySchematic(
Prj().GetProjectPath(),
Prj().GetProjectName(),
2039 if( legacySchematic.FileExists() )
2041 schematic = legacySchematic;
2045 msg.Printf(
_(
"Schematic file '%s' not found." ), schematic.GetFullPath() );
2051 if(
Kiface().IsSingle() )
2085 if( !frame->IsShownOnScreen() )
2088 frame->
OpenProjectFiles( std::vector<wxString>( 1, schematic.GetFullPath() ) );
2089 frame->Show(
true );
2094 if( frame->IsIconized() )
2096 frame->Iconize(
false );
2100 frame->Maximize(
false );
2114 for(
const std::pair<const wxString, ENV_VAR_ITEM>& var : vars )
2115 UpdatePythonEnvVar( var.first, var.second.GetValue() );
2119 for(
const std::pair<const wxString, ENV_VAR_ITEM>& var : vars )
2120 wxSetEnv( var.first, var.second.GetValue() );
2138 if( aFootprint ==
nullptr )
2177 fp_editor->Show(
true );
2188 fp_editor->Show(
true );
2204 bool aSelectedMode )
2224 bool aResetText,
bool aResetTextLayers,
bool aResetTextEffects,
2232 if( aResetTextLayers )
2243 if( aResetTextEffects )
2268 std::vector<PCB_TEXT*> candidates;
2275 candidates.push_back( candidate );
2278 if( candidates.size() == 0 )
2281 if( candidates.size() == 1 )
2282 return candidates[0];
2285 std::vector<PCB_TEXT*> candidatesOnSameLayer;
2287 for(
PCB_TEXT* candidate : candidates )
2289 if( candidate->GetLayer() == aRefItem->
GetLayer() )
2290 candidatesOnSameLayer.push_back( candidate );
2293 if( candidatesOnSameLayer.size() == 1 )
2294 return candidatesOnSameLayer[0];
2297 std::vector<PCB_TEXT*> candidatesAtSamePos;
2299 for(
PCB_TEXT* candidate : candidatesOnSameLayer.size() ? candidatesOnSameLayer : candidates )
2302 candidatesAtSamePos.push_back( candidate );
2305 if( candidatesAtSamePos.size() > 0 )
2306 return candidatesAtSamePos[0];
2307 else if( candidatesOnSameLayer.size() > 0 )
2308 return candidatesOnSameLayer[0];
2310 return candidates[0];
2316 bool resetTextLayers,
bool resetTextEffects,
2317 bool resetTextContent,
bool resetFabricationAttrs,
2318 bool reset3DModels,
bool* aUpdated )
2321 bool dummyBool =
false;
2324 aUpdated = &dummyBool;
2349 for(
PAD* newPad : aNew->
Pads() )
2351 PAD* oldPad =
nullptr;
2355 if( newPad->GetNumber().IsEmpty() )
2362 PAD* last_pad =
nullptr;
2379 const_cast<KIID&
>( newPad->m_Uuid ) = oldPad->
m_Uuid;
2385 if( newPad->IsOnCopperLayer() )
2405 processTextItem( *oldTextItem, *newTextItem, resetTextContent, resetTextLayers,
2406 resetTextEffects, aUpdated );
2408 else if( deleteExtraTexts )
2421 resetTextEffects, aUpdated );
2428 resetTextLayers, resetTextEffects, aUpdated );
2434 if( oldField->IsReference() || oldField->IsValue() )
2441 processTextItem( *oldField, *newField, resetTextContent, resetTextLayers,
2442 resetTextEffects, aUpdated );
2444 else if( deleteExtraTexts )
2451 aNew->
Add( newField );
2458 int existingFabAttrs = aExisting->
GetAttributes() & ~FP_ALLOW_SOLDERMASK_BRIDGES;
2459 int libraryFabAttrs = aNew->
GetAttributes() & ~FP_ALLOW_SOLDERMASK_BRIDGES;
2461 if( resetFabricationAttrs )
2465 if( libraryFabAttrs != existingFabAttrs )
2471 aNew->
SetAttributes( existingFabAttrs | solderMaskBridgesFlag );
2478 if( aNew->
Models().size() != aExisting->
Models().size() )
2484 for(
size_t ii = 0; ii < aNew->
Models().size(); ++ii )
2507 aCommit.
Remove( aExisting );
2508 aCommit.
Add( aNew );
2538 wxHyperlinkCtrl* button =
new wxHyperlinkCtrl( infobar, wxID_ANY,
_(
"Edit design rules" ),
2541 button->Bind( wxEVT_COMMAND_HYPERLINK, std::function<
void( wxHyperlinkEvent& aEvent )>(
2542 [&]( wxHyperlinkEvent& aEvent )
2547 infobar->RemoveAllButtons();
2548 infobar->AddButton( button );
2549 infobar->AddCloseButton();
2550 infobar->ShowMessage(
_(
"Could not compile custom design rules." ), wxICON_ERROR,
2558 if( aEnvVarsChanged )
2586 if( zoneFillerTool->
IsBusy() )
2603 wxString wildcard = wxT(
"*.hyp" );
2606 fn.SetExt( wxT(
"hyp") );
2608 wxFileDialog dlg(
this,
_(
"Export Hyperlynx Layout" ), fn.GetPath(), fn.GetFullName(),
2609 wildcard, wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
2611 if( dlg.ShowModal() != wxID_OK )
2617 fn.SetExt( wxT(
"hyp" ) );
2631 return m_auimgr.GetPane( wxS(
"LayersManager" ) ).IsShown();
2649 if( IsShownOnScreen() )
2666 _(
"Violation Report" ) );
2676 _(
"Clearance Report" ) );
2686 _(
"Constraints Report" ) );
2696 _(
"Compare Footprint with Library" ) );
2727void PCB_EDIT_FRAME::onPluginAvailabilityChanged( wxCommandEvent& aEvt )
2729 wxLogTrace(
traceApi,
"PCB frame: EDA_EVT_PLUGIN_AVAILABILITY_CHANGED" );
Class PCBNEW_ACTION_PLUGINS.
const KICOMMON_API wxEventTypeTag< wxCommandEvent > EDA_EVT_PLUGIN_AVAILABILITY_CHANGED
Notifies other parts of KiCad when plugin availability changes.
constexpr EDA_IU_SCALE pcbIUScale
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
constexpr BOX2I BOX2ISafe(const BOX2D &aInput)
static TOOL_ACTION toggleGrid
static TOOL_ACTION millimetersUnits
static TOOL_ACTION unselectAll
static TOOL_ACTION togglePolarCoords
static TOOL_ACTION pluginsReload
static TOOL_ACTION pasteSpecial
static TOOL_ACTION milsUnits
static TOOL_ACTION toggleBoundingBoxes
static TOOL_ACTION showSearch
static TOOL_ACTION duplicate
static TOOL_ACTION inchesUnits
static TOOL_ACTION highContrastMode
static TOOL_ACTION embeddedFiles
static TOOL_ACTION toggleCursorStyle
static TOOL_ACTION measureTool
static TOOL_ACTION doDelete
static TOOL_ACTION selectionTool
static TOOL_ACTION zoomFitScreen
static TOOL_ACTION deleteTool
static TOOL_ACTION zoomTool
static TOOL_ACTION showProperties
static TOOL_ACTION gridSetOrigin
static TOOL_ACTION toggleGridOverrides
static TOOL_ACTION selectAll
Manage TOOL_ACTION objects.
void SetConditions(const TOOL_ACTION &aAction, const ACTION_CONDITIONS &aConditions)
Set the conditions the UI elements for activating a specific tool action should use for determining t...
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
void ApplyLayerPreset(const wxString &aPresetName)
int GetTabIndex() const
Set the current notebook tab.
bool IsLayerOptionsExpanded()
void UpdateDisplayOptions()
Return a list of the layer presets created by the user.
void OnColorThemeChanged()
Respond to change in OS's DarkMode.
bool IsNetOptionsExpanded()
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Handles how to draw a screen (a board, a schematic ...)
bool IsContentModified() const
const wxString & GetPageNumber() const
virtual void Push(const wxString &aMessage=wxEmptyString, int aCommitFlags=0) override
Revert the commit by restoring the modified items state.
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
bool SetNetCode(int aNetCode, bool aNoAssert)
Set net using a net code.
bool GetLocalRatsnestVisible() const
Handle actions specific to the board editor in PcbNew.
Abstract interface for BOARD_ITEMs capable of storing other items inside.
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 void SetLocked(bool aLocked)
PCB_GROUP * GetParentGroup() const
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
VECTOR2I GetFPRelativePosition() const
void SetFPRelativePosition(const VECTOR2I &aPos)
virtual bool IsLocked() const
Information pertinent to a Pcbnew printed circuit board.
LSET GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
bool IsElementVisible(GAL_LAYER_ID aLayer) const
Test whether a given element category is visible.
void RemoveAllListeners()
Remove all listeners.
const PAGE_INFO & GetPageSettings() const
GAL_SET GetVisibleElements() const
Return a set of all the element categories that are visible.
bool BuildConnectivity(PROGRESS_REPORTER *aReporter=nullptr)
Build or rebuild the board connectivity database for the board, especially the list of connected item...
void SynchronizeNetsAndNetClasses(bool aResetTrackAndViaSizes)
Copy NETCLASS info to each NET, based on NET membership in a NETCLASS.
TITLE_BLOCK & GetTitleBlock()
const std::map< wxString, wxString > & GetProperties() const
void SetProject(PROJECT *aProject, bool aReferenceOnly=false)
Link a board to a given project.
const wxString & GetFileName() const
void SetElementVisibility(GAL_LAYER_ID aLayer, bool aNewState)
Change the visibility of an element category.
PROJECT * GetProject() const
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
void UpdateRatsnestExclusions()
Update the visibility flags on the current unconnected ratsnest lines.
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
constexpr BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
void SetColor(int aLayer, const COLOR4D &aColor)
COLOR4D GetColor(int aLayer) const
COMMIT & Remove(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Notify observers that aItem has been removed.
COMMIT & Add(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Notify observers that aItem has been added.
Handle actions that are shared between different applications.
void SetCallback(std::function< void(BOARD_ITEM *)> aCallback)
Function to be called on each found event.
bool Show(bool show=true) override
The Show method is overridden to make the search combobox focused by default.
void Preload(const wxString &aFindString)
void FindNext(bool reverse)
Finds the next item.
A dialog to set the plot options and create plot files in various formats.
void SetSheetPath(const std::string &aSheetPath)
Set the sheet path displayed in the title block.
void SetSheetCount(int aSheetCount)
Changes the sheet-count number displayed in the title block.
void SetPageNumber(const std::string &aPageNumber)
Changes the page number displayed in the title block.
void SetSheetName(const std::string &aSheetName)
Set the sheet name displayed in the title block.
void SetIsFirstPage(bool aIsFirstPage)
Change if this is first page.
void SetFileName(const std::string &aFileName)
Set the file name displayed in the title block.
void ShowChangedLanguage() override
Redraw the menus and what not in current language.
virtual void setupUIConditions()
Setup the UI conditions for the various actions and their controls in this frame.
virtual void ThemeChanged()
Process light/dark theme change.
virtual bool CanAcceptApiCommands()
Checks if this frame is ready to accept API commands.
void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged) override
Notification event that some of the common (suite-wide) settings have changed.
virtual void OnSize(wxSizeEvent &aEvent)
virtual bool canCloseWindow(wxCloseEvent &aCloseEvent)
virtual int GetUndoCommandCount() const
WX_INFOBAR * GetInfoBar()
virtual wxString GetFullScreenDesc() const
void OnSelectGrid(wxCommandEvent &event)
Command event handler for selecting grid sizes.
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
virtual void SwitchCanvas(EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType)
Changes the current rendering backend.
virtual void OnSize(wxSizeEvent &event) override
Recalculate the size of toolbars and display panel when the frame size changes.
virtual void OnSelectZoom(wxCommandEvent &event)
Set the zoom factor when selected by the zoom list box in the main tool bar.
GAL_DISPLAY_OPTIONS_IMPL & GetGalDisplayOptions()
Return a reference to the gal rendering options used by GAL for rendering.
virtual wxString GetScreenDesc() const
static const wxString PropertiesPaneName()
virtual void Zoom_Automatique(bool aWarpPointer)
Redraw the screen with best zoom level and the best centering that shows all the page or the board.
NET_INSPECTOR_PANEL * m_netInspectorPanel
static const wxString NetInspectorPanelName()
SEARCH_PANE * m_searchPane
PROPERTIES_PANEL * m_propertiesPanel
static constexpr GAL_TYPE GAL_FALLBACK
void StopDrawing()
Prevent the GAL canvas from further drawing until it is recreated or StartDrawing() is called.
void ForceRefresh()
Force a redraw.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
KIGFX::GAL * GetGAL() const
Return a pointer to the GAL instance used in the panel.
A base class for most all the KiCad significant classes used in schematics and boards.
KICAD_T Type() const
Returns the type of object.
void ClearFlags(EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
virtual void SetParent(EDA_ITEM *aParent)
Specialization of the wxAuiPaneInfo class for KiCad panels.
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
const EDA_ANGLE & GetTextAngle() const
virtual const wxString & GetText() const
Return the string associated with the text object.
virtual bool IsVisible() const
void SetAttributes(const EDA_TEXT &aSrc, bool aSetPosition=true)
Set the text attributes from another instance.
GR_TEXT_H_ALIGN_T GetHorizJustify() const
virtual void SetVisible(bool aVisible)
GR_TEXT_V_ALIGN_T GetVertJustify() const
virtual void SetText(const wxString &aText)
int GetTextThickness() const
VECTOR2I GetTextSize() const
SELECTION_CONDITION NoActiveTool()
Create a functor testing if there are no tools active in the frame.
SELECTION_CONDITION BoundingBoxes()
SELECTION_CONDITION RedoAvailable()
Create a functor that tests if there are any items in the redo queue.
SELECTION_CONDITION ScriptingConsoleVisible()
Create a functor testing if the python scripting console window is visible.
SELECTION_CONDITION Units(EDA_UNITS aUnit)
Create a functor that tests if the frame has the specified units.
SELECTION_CONDITION GridVisible()
Create a functor testing if the grid is visible in a frame.
SELECTION_CONDITION PolarCoordinates()
Create a functor testing if polar coordinates are current being used.
SELECTION_CONDITION GridOverrides()
Create a functor testing if the grid overrides wires is enabled in a frame.
SELECTION_CONDITION FullscreenCursor()
Create a functor testing if the cursor is full screen in a frame.
ENUM_MAP & Map(T aValue, const wxString &aName)
static ENUM_MAP< T > & Instance()
ENUM_MAP & Undefined(T aValue)
void ReadWindowSettings(WINDOW_SETTINGS &aCfg)
Read GAL config options from application-level config.
bool Contains(GAL_LAYER_ID aPos)
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()
virtual const wxString Problem() const
what was the problem?
virtual const wxString Where() const
where did the Problem() occur?
Read the new s-expression based KiCad netlist format.
virtual void LoadNetlist() override
Load the contents of the netlist file into aNetlist.
APP_SETTINGS_BASE * KifaceSettings() const
A color representation with 4 components: red, green, blue, alpha.
void SetGridColor(const COLOR4D &aGridColor)
Set the grid color.
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const override
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
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.
An abstract base class for deriving all objects that can be added to a VIEW.
bool IsBOARD_ITEM() const
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
BOX2D GetViewport() const
Return the current viewport visible area rectangle.
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
void SetLayerVisible(int aLayer, bool aVisible=true)
Control the visibility of a particular layer.
bool IsMirroredX() const
Return true if view is flipped across the X axis.
void UpdateAllItems(int aUpdateFlags)
Update all items in the view according to the given flags.
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
void MarkTargetDirty(int aTarget)
Set or clear target 'dirty' flag.
void UpdateAllItemsConditionally(int aUpdateFlags, std::function< bool(VIEW_ITEM *)> aCondition)
Update items in the view according to the given flags and condition.
An implementation of class VIEW_CONTROLS for wxWidgets library.
std::unique_ptr< PROF_COUNTER > m_MotionEventCounter
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
virtual bool OpenProjectFiles(const std::vector< wxString > &aFileList, int aCtl=0)
Open a project or set of files given by aFileList.
void OnSockRequestServer(wxSocketEvent &evt)
void OnSockRequest(wxSocketEvent &evt)
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
virtual void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged)
Call CommonSettingsChanged() on all KIWAY_PLAYERs.
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
virtual void ExpressMail(FRAME_T aDestination, MAIL_T aCommand, std::string &aPayload, wxWindow *aSource=nullptr)
Send aPayload to aDestination from aSource.
int SetLayerSelection(int layer)
PCB_LAYER_ID GetLayerA() const
PCB_LAYER_ID GetLayerB() const
const UTF8 & GetLibItemName() const
LSET is a set of PCB_LAYER_IDs.
static LSET AllLayersMask()
LSEQ Seq(const LSEQ &aSequence) const
Return an LSEQ from the union of this LSET and a desired sequence.
static wxString Name(PCB_LAYER_ID aLayerId)
Return the fixed name association with aLayerId.
static const int UNCONNECTED
Constant that holds the "unconnected net" number (typically 0) all items "connected" to this net are ...
Store information read from a netlist along with the flags used to update the NETLIST in the BOARD.
virtual void OnBoardChanged()
Notification from file loader when board changed and connectivity rebuilt.
virtual void OnParentSetupChanged()
Rebuild inspector data if project settings updated.
const wxString & GetPinType() const
const wxString & GetPinFunction() const
bool IsOnCopperLayer() const override
void SetInitialPage(const wxString &aPage, const wxString &aParentPage=wxEmptyString)
Describe the page size and margins of a paper page on which to eventually print or plot.
DISPLAY_OPTIONS m_Display
EDA_ANGLE m_RotationAngle
ARC_EDIT_MODE m_ArcEditMode
Gather all the actions that are shared by tools.
static TOOL_ACTION toggleHV45Mode
static TOOL_ACTION drawRuleArea
static TOOL_ACTION microwaveCreateGap
static TOOL_ACTION drawBezier
static TOOL_ACTION placeText
static TOOL_ACTION pointEditorArcKeepCenter
static TOOL_ACTION drawOrthogonalDimension
static TOOL_ACTION drawRectangle
static TOOL_ACTION padDisplayMode
static TOOL_ACTION placeReferenceImage
static TOOL_ACTION showRatsnest
static TOOL_ACTION showLayersManager
static TOOL_ACTION toggleNetHighlight
static TOOL_ACTION drawCircle
static TOOL_ACTION routeDiffPair
Activation of the Push and Shove router (differential pair mode)
static TOOL_ACTION tuneDiffPair
static TOOL_ACTION layerChanged
static TOOL_ACTION ddAppendBoard
Drag and drop.
static TOOL_ACTION highlightNet
static TOOL_ACTION drawTable
static TOOL_ACTION drawTextBox
static TOOL_ACTION routerHighlightMode
Actions to enable switching modes via hotkey assignments.
static TOOL_ACTION routerWalkaroundMode
static TOOL_ACTION routerShoveMode
static TOOL_ACTION drawZoneCutout
static TOOL_ACTION drawPolygon
static TOOL_ACTION hideNetInRatsnest
static TOOL_ACTION zoneDisplayFilled
static TOOL_ACTION showNetInRatsnest
static TOOL_ACTION drawRadialDimension
static TOOL_ACTION tuneSingleTrack
static TOOL_ACTION viaDisplayMode
static TOOL_ACTION drawLeader
static TOOL_ACTION drillOrigin
static TOOL_ACTION tuneSkew
static TOOL_ACTION trackDisplayMode
static TOOL_ACTION showNetInspector
static TOOL_ACTION microwaveCreateStubArc
static TOOL_ACTION zoneDisplayTriangulated
static TOOL_ACTION ungroup
static TOOL_ACTION selectUnconnected
Select unconnected footprints from ratsnest of selection.
static TOOL_ACTION zoneDisplayFractured
static TOOL_ACTION drawVia
static TOOL_ACTION drawArc
static TOOL_ACTION zoneDuplicate
Duplicate zone onto another layer.
static TOOL_ACTION graphicsOutlines
Display footprint graphics as outlines.
static TOOL_ACTION drawSimilarZone
static TOOL_ACTION pointEditorArcKeepEndpoint
static TOOL_ACTION drawCenterDimension
static TOOL_ACTION selectSameSheet
Select all components on the same sheet as the selected footprint.
static TOOL_ACTION microwaveCreateStub
static TOOL_ACTION selectNet
Select all connections belonging to a single net.
static TOOL_ACTION microwaveCreateLine
static TOOL_ACTION flipBoard
static TOOL_ACTION zoneDisplayOutline
static TOOL_ACTION ratsnestLineMode
static TOOL_ACTION textOutlines
Display texts as lines.
static TOOL_ACTION highlightNetSelection
static TOOL_ACTION microwaveCreateFunctionShape
static TOOL_ACTION zoneMerge
static TOOL_ACTION unlock
static TOOL_ACTION placeFootprint
static TOOL_ACTION routeSingleTrack
Activation of the Push and Shove router.
static TOOL_ACTION createArray
Tool for creating an array of objects.
static TOOL_ACTION deselectNet
Remove all connections belonging to a single net from the active selection.
static TOOL_ACTION showPythonConsole
static TOOL_ACTION drawLine
static TOOL_ACTION localRatsnestTool
static TOOL_ACTION drawAlignedDimension
static TOOL_ACTION drawZone
static TOOL_ACTION selectOnSchematic
Select symbols/pins on schematic corresponding to selected footprints/pads.
Common, abstract interface for edit frames.
COLOR_SETTINGS * GetColorSettings(bool aForceRefresh=false) const override
Helper to retrieve the current color settings.
wxString GetDesignRulesPath()
Return the absolute path to the design rules file for the currently-loaded board.
void doCloseWindow() override
void unitsChangeRefresh() override
Called when when the units setting has changed to allow for any derived classes to handle refreshing ...
virtual void SetBoard(BOARD *aBoard, PROGRESS_REPORTER *aReporter=nullptr) override
Set the #m_Pcb member in such as way as to ensure deleting any previous BOARD.
std::unique_ptr< LAYER_PAIR_SETTINGS > m_layerPairSettings
APPEARANCE_CONTROLS * GetAppearancePanel()
APPEARANCE_CONTROLS * m_appearancePanel
PANEL_SELECTION_FILTER * m_selectionFilterPanel
void ActivateGalCanvas() override
Set the #m_Pcb member in such as way as to ensure deleting any previous BOARD.
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
virtual const PCB_PLOT_PARAMS & GetPlotSettings() const
Return the PCB_PLOT_PARAMS for the BOARD owned by this frame.
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Display options control the way tracks, vias, outlines and other things are shown (for instance solid...
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
PCBNEW_SETTINGS * GetPcbNewSettings() const
virtual PCB_LAYER_ID GetActiveLayer() const
void OnModify() override
Must be called after a change in order to set the "modify" flag and update other data structures and ...
virtual MAGNETIC_SETTINGS * GetMagneticItemsSettings()
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
virtual void SetPageSettings(const PAGE_INFO &aPageSettings) override
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
PCB_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Returns the BOARD_DESIGN_SETTINGS for the open project.
virtual void SetPlotSettings(const PCB_PLOT_PARAMS &aSettings)
void PlaceFootprint(FOOTPRINT *aFootprint, bool aRecreateRatsnest=true)
Places aFootprint at the current cursor position and updates footprint coordinates with the new posit...
virtual void SetActiveLayer(PCB_LAYER_ID aLayer)
virtual void Update3DView(bool aMarkDirty, bool aRefresh, const wxString *aTitle=nullptr)
Update the 3D view, if the viewer is opened by this frame.
Handle actions that are shared between different frames in PcbNew.
double m_ZoneOpacity
Opacity override for filled zone areas.
HIGH_CONTRAST_MODE m_ContrastModeDisplay
How inactive layers are displayed.
void UpdateColors()
Update the color settings in the painter and GAL.
void SetDrawingSheet(DS_PROXY_VIEW_ITEM *aDrawingSheet)
Sets (or updates) drawing-sheet used by the draw panel.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void SyncLayersVisibility(const BOARD *aBoard)
Update "visibility" property of each layer of a given BOARD.
virtual void SetHighContrastLayer(int aLayer) override
SetHighContrastLayer(), with some extra smarts for PCB.
void RedrawRatsnest()
Return the bounding box of the view that should be used if model is not valid.
Group generic conditions for PCB editor states.
SELECTION_CONDITION PadFillDisplay()
Create a functor that tests if the frame fills the pads.
SELECTION_CONDITION TrackFillDisplay()
Create a functor that tests if the frame fills tracks.
SELECTION_CONDITION HasItems()
Create a functor that tests if there are items in the board.
SELECTION_CONDITION GraphicsFillDisplay()
Create a functor that tests if the frame fills graphics items.
SELECTION_CONDITION ZoneDisplayMode(ZONE_DISPLAY_MODE aMode)
Create a functor that tests the current zone display mode in the frame.
SELECTION_CONDITION ViaFillDisplay()
Create a functor that tests if the frame fills vias.
SELECTION_CONDITION Get45degMode()
Create a functor that tests whether only 45 degree lines should be allowed.
SELECTION_CONDITION TextFillDisplay()
Create a functor that tests if the frame fills text items.
The main frame for Pcbnew.
void HardRedraw() override
Rebuild the GAL and redraws the screen.
void OnDisplayOptionsChanged() override
void ShowBoardSetupDialog(const wxString &aInitialPage=wxEmptyString)
void SetLastPath(LAST_PATH_TYPE aType, const wxString &aLastPath)
Set the path of the last file successfully read.
void FindNext(bool reverse=false)
Find the next item using our existing search parameters.
void ResolveDRCExclusions(bool aCreateMarkers)
If aCreateMarkers then create DRC exclusion markers from the serialized data.
void SetBoard(BOARD *aBoard, PROGRESS_REPORTER *aReporter=nullptr) override
Set the #m_Pcb member in such as way as to ensure deleting any previous BOARD.
void SetActiveLayer(PCB_LAYER_ID aLayer) override
Change the currently active layer to aLayer and also update the APPEARANCE_CONTROLS.
void OnModify() override
Must be called after a board change to set the modified flag.
void ThemeChanged() override
Called when light/dark theme is changed.
void setupUIConditions() override
Setup the UI conditions for the various actions and their controls in this frame.
void ReCreateHToolbar() override
void SetElementVisibility(GAL_LAYER_ID aElement, bool aNewState)
Change the visibility of an element category.
DIALOG_BOOK_REPORTER * m_inspectDrcErrorDlg
void OnClearFileHistory(wxCommandEvent &aEvent)
std::unique_ptr< GRID_HELPER > MakeGridHelper() override
virtual ~PCB_EDIT_FRAME()
void SwitchCanvas(EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType) override
Switch currently used canvas (Cairo / OpenGL).
BOARD_ITEM_CONTAINER * GetModel() const override
DIALOG_BOOK_REPORTER * GetInspectDrcErrorDialog()
void OnExportSTEP(wxCommandEvent &event)
Export the current BOARD to a STEP assembly.
void ExchangeFootprint(FOOTPRINT *aExisting, FOOTPRINT *aNew, BOARD_COMMIT &aCommit, bool deleteExtraTexts=true, bool resetTextLayers=true, bool resetTextEffects=true, bool resetFabricationAttrs=true, bool resetTextContent=true, bool reset3DModels=true, bool *aUpdated=nullptr)
Replace aExisting footprint by aNew footprint using the Existing footprint settings (position,...
DIALOG_FIND * m_findDialog
DIALOG_BOOK_REPORTER * m_inspectConstraintsDlg
void SetPageSettings(const PAGE_INFO &aPageSettings) override
bool IsElementVisible(GAL_LAYER_ID aElement) const
Test whether a given element category is visible.
bool CanAcceptApiCommands() override
Checks if this frame is ready to accept API commands.
void UpdateUserInterface()
Update the layer manager and other widgets from the board setup (layer and items visibility,...
void onBoardLoaded()
Update the state of the GUI after a new board is loaded or created.
void SetGridColor(const COLOR4D &aColor) override
void ProjectChanged() override
Notification event that the project has changed.
wxString GetLastPath(LAST_PATH_TYPE aType)
Get the last path for a particular type.
void OnExportIDF3(wxCommandEvent &event)
Export the current BOARD to a IDFv3 board and lib files.
void ShowChangedLanguage() override
Redraw the menus and what not in current language.
void doCloseWindow() override
void ReCreateLayerBox(bool aForceResizeToolbar=true)
Recreate the layer box by clearing the old list and building a new one from the new layer names and c...
void SaveProjectLocalSettings() override
Save changes to the project local settings.
void PythonSyncProjectName()
Synchronize the project name from KiCad's environment into the Python interpreter.
bool m_show_layer_manager_tools
void OnExportVRML(wxCommandEvent &event)
Export the current BOARD to a VRML file.
void ShowFindDialog()
Show the Find dialog.
void onSize(wxSizeEvent &aEvent)
int ShowExchangeFootprintsDialog(FOOTPRINT *aFootprint, bool aUpdateMode, bool aSelectedMode)
int TestStandalone()
Test if standalone mode.
void ShowFootprintPropertiesDialog(FOOTPRINT *aFootprint)
void OnExportHyperlynx(wxCommandEvent &event)
Export the current BOARD to a Hyperlynx HYP file.
bool IsContentModified() const override
Get if the current board has been modified but not saved.
void PythonSyncEnvironmentVariables()
Synchronize the environment variables from KiCad's environment into the Python interpreter.
bool Clear_Pcb(bool doAskAboutUnsavedChanges, bool aFinal=false)
Delete all and reinitialize the current board.
TOOL_ACTION * m_exportNetlistAction
The export board netlist tool action object.
void ReCreateAuxiliaryToolbar() override
bool m_show_net_inspector
bool FetchNetlistFromSchematic(NETLIST &aNetlist, const wxString &aAnnotateMessage)
wxString GetCurrentFileName() const override
Get the full filename + path of the currently opened file in the frame.
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
void ExportSVG(wxCommandEvent &event)
Show the Export to SVG file dialog.
void RecreateCmpFileFromBoard(wxCommandEvent &aEvent)
Recreates a .cmp file from the current loaded board.
DIALOG_BOOK_REPORTER * GetFootprintDiffDialog()
EDA_ANGLE GetRotationAngle() const override
Return the angle used for rotate operations.
COLOR4D GetGridColor() override
void Files_io(wxCommandEvent &event)
Call Files_io_from_id with the wxCommandEvent id.
void UpdateTitle()
Set the main window title bar text.
DIALOG_BOOK_REPORTER * m_footprintDiffDlg
PCB_LAYER_BOX_SELECTOR * m_SelLayerBox
void ExportToGenCAD(wxCommandEvent &event)
Create a file in GenCAD 1.4 format from the current board.
void ActivateGalCanvas() override
Set the #m_Pcb member in such as way as to ensure deleting any previous BOARD.
void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged) override
Called after the preferences dialog is run.
void Process_Special_Functions(wxCommandEvent &event)
SELECTION & GetCurrentSelection() override
Get the current selection from the canvas area.
void OnQuit(wxCommandEvent &event)
void onCloseModelessBookReporterDialogs(wxCommandEvent &aEvent)
bool canCloseWindow(wxCloseEvent &aCloseEvent) override
DIALOG_BOARD_SETUP * m_boardSetupDlg
DIALOG_BOOK_REPORTER * GetInspectClearanceDialog()
wxTimer * m_eventCounterTimer
void Tracks_and_Vias_Size_Event(wxCommandEvent &event)
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
static const wxString SearchPaneName()
DIALOG_BOOK_REPORTER * m_inspectClearanceDlg
void OnFileHistory(wxCommandEvent &event)
void ToPlotter(int aID)
Open a dialog frame to create plot and drill files relative to the current board.
DIALOG_BOOK_REPORTER * GetInspectConstraintsDialog()
A set of BOARD_ITEMs (i.e., without duplicates).
virtual bool RemoveItem(BOARD_ITEM *aItem)
Remove item from group.
virtual bool AddItem(BOARD_ITEM *aItem)
Add item to group.
Net inspection panel for pcbnew.
Parameters and options when plotting/printing a board.
void SetFormat(PLOT_FORMAT aFormat)
Tool that displays edit points allowing to modify items by dragging the points.
PCB_LAYER_ID m_Route_Layer_TOP
PCB_LAYER_ID m_Route_Layer_BOTTOM
static bool HasUnlockedItems(const SELECTION &aSelection)
Test if any selected items are unlocked.
static bool HasLockedItems(const SELECTION &aSelection)
Test if any selected items are locked.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
virtual ENV_VAR_MAP & GetLocalEnvVariables() const
virtual const wxString & GetExecutablePath() const
A progress reporter interface for use in multi-threaded environments.
The backing store for a PROJECT, in JSON format.
std::vector< LAYER_PAIR_INFO > m_LayerPairInfos
List of stored 3D viewports (view matrixes)
The project local settings are things that are attached to a particular project, but also might be pa...
wxString m_ActiveLayerPreset
The name of a LAYER_PRESET that is currently activated (or blank if none)
PCB_LAYER_ID m_ActiveLayer
The current (active) board layer for editing.
virtual PROJECT_LOCAL_SETTINGS & GetLocalSettings() const
void IncrementNetclassesTicker()
virtual PROJECT_FILE & GetProjectFile() const
void IncrementTextVarsTicker()
float SplitterProportion() const
static SELECTION_CONDITION HasTypes(std::vector< KICAD_T > aTypes)
Create a functor that tests if among the selected items there is at least one of a given types.
static bool NotEmpty(const SELECTION &aSelection)
Test if there are any items selected.
static SELECTION_CONDITION MoreThan(int aNumber)
Create a functor that tests if the number of selected items is greater than the value given as parame...
static bool Idle(const SELECTION &aSelection)
Test if there no items selected or being edited.
static SELECTION_CONDITION Count(int aNumber)
Create a functor that tests if the number of selected items is equal to the value given as parameter.
static bool ShowAlways(const SELECTION &aSelection)
The default condition function (always returns true).
static SELECTION_CONDITION OnlyTypes(std::vector< KICAD_T > aTypes)
Create a functor that tests if the selected items are only of given types.
int Size() const
Returns the number of selected parts.
Is a LINE_READER that reads from a multiline 8 bit wide std::string.
A modified version of the wxInfoBar class that allows us to:
void RemoveAllButtons()
Remove all the buttons that have been added by the user.
@ OUTDATED_SAVE
OUTDATED_SAVE Messages that should be cleared on save.
void AddCloseButton(const wxString &aTooltip=_("Hide this message."))
Add the default close button to the infobar on the right side.
void ShowMessage(const wxString &aMessage, int aFlags=wxICON_INFORMATION) override
Show the info bar with the provided message and icon.
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
bool HandleUnsavedChanges(wxWindow *aParent, const wxString &aMessage, const std::function< bool()> &aSaveFunction)
Display a dialog with Save, Cancel and Discard Changes buttons.
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
This file is part of the common library.
#define DIALOG_DRC_WINDOW_NAME
bool InvokeExportSVG(PCB_EDIT_FRAME *aCaller, BOARD *aBoard)
Function InvokeExportSVG shows the Export SVG dialog.
Declaration of the eda_3d_viewer class.
static constexpr EDA_ANGLE ANGLE_90
#define KICAD_DEFAULT_DRAWFRAME_STYLE
#define PCB_EDIT_FRAME_NAME
GERBVIEW_FRAME::OnZipFileHistory GERBVIEW_FRAME::OnSelectHighlightChoice EVT_UPDATE_UI(ID_TOOLBARH_GERBVIEW_SELECT_ACTIVE_LAYER, GERBVIEW_FRAME::OnUpdateLayerSelectBox) void GERBVIEW_FRAME
const wxString EESCHEMA_EXE
bool ExportBoardToHyperlynx(BOARD *aBoard, const wxFileName &aPath)
@ FRAME_FOOTPRINT_CHOOSER
int ExecuteFile(const wxString &aEditorName, const wxString &aFileName, wxProcess *aCallback, bool aFileForKicad)
Call the executable file aEditorName with the parameter aFileName.
bool m_ShowEventCounters
Shows debugging event counters in various places.
static const std::string LegacySchematicFileExtension
static const std::string LegacyPcbFileExtension
static const std::string KiCadSchematicFileExtension
static const std::string AutoSaveFilePrefix
static const std::string KiCadPcbFileExtension
const wxChar *const traceAutoSave
Flag to enable auto save feature debug tracing.
const wxChar *const traceApi
Flag to enable debug output related to the API plugin system.
@ ID_EDA_SOCKET_EVENT_SERV
std::map< wxString, ENV_VAR_ITEM > ENV_VAR_MAP
int GetNetnameLayer(int aLayer)
Returns a netname layer corresponding to the given layer.
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
@ LAYER_ZONES
Control for copper zone opacity/visibility (color ignored)
PCB_LAYER_ID
A quick note on layer IDs:
@ REPAINT
Item needs to be redrawn.
@ ALL
All except INITIAL_ADD.
@ TARGET_NONCACHED
Auxiliary rendering target (noncached)
@ RM_MarkObstacles
Ignore collisions, mark obstacles.
@ RM_Walkaround
Only walk around.
static void processTextItem(const PCB_TEXT &aSrc, PCB_TEXT &aDest, bool aResetText, bool aResetTextLayers, bool aResetTextEffects, bool *aUpdated)
copy text settings from aSrc to aDest
#define FOOTPRINT_DIFF_DIALOG_NAME
static PCB_TEXT * getMatchingTextItem(PCB_TEXT *aRefItem, FOOTPRINT *aFootprint)
EVT_MENU_RANGE(ID_POPUP_PCB_SELECT_WIDTH_START_RANGE, ID_POPUP_PCB_SELECT_WIDTH_END_RANGE, PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event) EVT_UPDATE_UI_RANGE(ID_POPUP_PCB_SELECT_WIDTH1
ID_POPUP_PCB_SELECT_WIDTH8
bool ExportBoardToHyperlynx(BOARD *aBoard, const wxFileName &aPath)
#define INSPECT_CLEARANCE_DIALOG_NAME
PCB_EDIT_FRAME::OnUpdateSelectTrackWidth EVT_UPDATE_UI_RANGE(ID_POPUP_PCB_SELECT_VIASIZE1, ID_POPUP_PCB_SELECT_VIASIZE8, PCB_EDIT_FRAME::OnUpdateSelectViaSize) PCB_EDIT_FRAME
#define INSPECT_DRC_ERROR_DIALOG_NAME
#define INSPECT_CONSTRAINTS_DIALOG_NAME
@ ID_POPUP_PCB_SELECT_WIDTH_START_RANGE
@ ID_POPUP_PCB_SELECT_WIDTH1
@ ID_POPUP_PCB_SELECT_VIASIZE8
@ ID_GEN_EXPORT_FILE_HYPERLYNX
@ ID_IMPORT_NON_KICAD_BOARD
@ ID_MENU_RECOVER_BOARD_AUTOSAVE
@ ID_AUX_TOOLBAR_PCB_VIA_SIZE
@ ID_AUX_TOOLBAR_PCB_SELECT_AUTO_WIDTH
@ ID_MENU_EXPORT_FOOTPRINTS_TO_NEW_LIBRARY
@ ID_POPUP_PCB_SELECT_WIDTH_END_RANGE
@ ID_MENU_EXPORT_FOOTPRINTS_TO_LIBRARY
@ ID_GEN_EXPORT_FILE_VRML
@ ID_POPUP_PCB_SELECT_VIASIZE1
@ ID_GEN_EXPORT_FILE_STEP
@ ID_TOOLBARH_PCB_SELECT_LAYER
@ ID_GEN_EXPORT_FILE_IDF3
@ ID_AUX_TOOLBAR_PCB_TRACK_WIDTH
@ ID_GEN_EXPORT_FILE_GENCADFORMAT
void ScriptingOnDestructPcbEditFrame(PCB_EDIT_FRAME *aPcbEditFrame)
void Refresh()
Update the board display after modifying it by a python script (note: it is automatically called by a...
PGM_BASE & Pgm()
The global Program "get" accessor.
#define PROJECT_VAR_NAME
A variable name whose value holds the current project directory.
LAST_PATH_TYPE
For storing PcbNew MRU paths of various types.
#define CURRENT_TOOL(action)
std::function< bool(const SELECTION &)> SELECTION_CONDITION
Functor type that checks a specific condition for selected items.
KIWAY Kiway(KFCTL_STANDALONE)
wxString UnescapeString(const wxString &aSource)
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
A min-max version of BOX2 for fast intersection checking.
bool Intersects(const BOX2I_MINMAX &aOther) const
constexpr int mmToIU(double mm) const
A filename or source description, a problem input line, a line number, a byte offset,...
float properties_splitter
int properties_panel_width
bool appearance_expand_layer_display
bool appearance_expand_net_display
int search_panel_dock_direction
bool m_DisplayRatsnestLinesCurved
bool m_ShowGlobalRatsnest
wxLogTrace helper definitions.
@ 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_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)
Definition of file extensions used in Kicad.
void SetAuiPaneSize(wxAuiManager &aManager, wxAuiPaneInfo &aPane, int aWidth, int aHeight)
Sets the size of an AUI pane, working around http://trac.wxwidgets.org/ticket/13180.
WX_VIEW_CONTROLS class definition.