KiCad PCB EDA Suite
pcb_edit_frame.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <[email protected]>
6 * Copyright (C) 2013 Wayne Stambaugh <[email protected]>
7 * Copyright (C) 2013-2022 KiCad Developers, see AUTHORS.txt for contributors.
8 *
9 * This program is free software: you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation, either version 3 of the License, or (at your
12 * option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program. If not, see <http://www.gnu.org/licenses/>.
21 */
22
23#include <advanced_config.h>
24#include <kiface_base.h>
25#include <kiway.h>
26#include <pgm_base.h>
27#include <pcb_edit_frame.h>
29#include <fp_lib_table.h>
30#include <bitmaps.h>
31#include <confirm.h>
32#include <trace_helpers.h>
33#include <pcbnew_id.h>
34#include <pcbnew_settings.h>
37#include <dialog_plot.h>
38#include <dialog_find.h>
41#include <dialog_board_setup.h>
42#include <invoke_pcb_dialog.h>
43#include <board.h>
44#include <pcb_group.h>
46#include <footprint.h>
50#include <pcb_draw_panel_gal.h>
51#include <functional>
52#include <pcb_painter.h>
55#include <python_scripting.h>
58#include <tool/tool_manager.h>
60#include <tool/action_toolbar.h>
61#include <tool/common_control.h>
62#include <tool/common_tools.h>
63#include <tool/selection.h>
64#include <tool/zoom_tool.h>
68#include <tools/edit_tool.h>
69#include <tools/group_tool.h>
70#include <tools/drc_tool.h>
72#include <tools/convert_tool.h>
73#include <tools/drawing_tool.h>
74#include <tools/pcb_control.h>
81#include <tools/pad_tool.h>
86#include <tools/pcb_actions.h>
87#include <router/router_tool.h>
91#include <gestfich.h>
92#include <executable_names.h>
94#include <wx/socket.h>
95#include <wx/wupdlock.h>
96#include <dialog_drc.h> // for DIALOG_DRC_WINDOW_NAME definition
100#include <widgets/wx_infobar.h>
103#include <widgets/wx_aui_utils.h>
104#include <kiplatform/app.h>
105#include <profile.h>
108
109#include <action_plugin.h>
110#include "../scripting/python_scripting.h"
111
112#include <wx/filedlg.h>
113
114using namespace std::placeholders;
115
116
117BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
120
121
124
125 EVT_SIZE( PCB_EDIT_FRAME::OnSize )
126
128
129 // Menu Files:
131
135
141
144
147
148 EVT_MENU( wxID_EXIT, PCB_EDIT_FRAME::OnQuit )
149 EVT_MENU( wxID_CLOSE, PCB_EDIT_FRAME::OnQuit )
150
151 // menu Config
153
154 // menu Postprocess
156
157 // Horizontal toolbar
163
164 // Tracks and vias sizes general options
166 PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event )
167
168 // User interface update event handlers.
174 PCB_EDIT_FRAME::OnUpdateSelectTrackWidth )
176 PCB_EDIT_FRAME::OnUpdateSelectViaSize )
177 // Drop files event
178 EVT_DROP_FILES( PCB_EDIT_FRAME::OnDropFiles )
179END_EVENT_TABLE()
180
181
182PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
183 PCB_BASE_EDIT_FRAME( aKiway, aParent, FRAME_PCB_EDITOR, _( "PCB Editor" ),
184 wxDefaultPosition, wxDefaultSize, KICAD_DEFAULT_DRAWFRAME_STYLE,
186 m_exportNetlistAction( nullptr ), m_findDialog( nullptr )
187{
188 m_maximizeByDefault = true;
189 m_showBorderAndTitleBlock = true; // true to display sheet references
190 m_SelTrackWidthBox = nullptr;
191 m_SelViaSizeBox = nullptr;
192 m_SelLayerBox = nullptr;
193 m_show_layer_manager_tools = true;
194 m_supportsAutoSave = true;
195 m_probingSchToPcb = false;
196 m_show_properties = true;
197 m_show_search = false;
198
199 // We don't know what state board was in when it was last saved, so we have to
200 // assume dirty
201 m_ZoneFillsDirty = true;
202
203 m_aboutTitle = _HKI( "KiCad PCB Editor" );
204
205 // Must be created before the menus are created.
206 if( ADVANCED_CFG::GetCfg().m_ShowPcbnewExportNetlist )
207 m_exportNetlistAction = new TOOL_ACTION( "pcbnew.EditorControl.exportNetlist",
208 AS_GLOBAL, 0, "", _( "Netlist..." ),
209 _( "Export netlist used to update schematics" ) );
210
211 // Create GAL canvas
212 auto canvas = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), m_frameSize,
213 GetGalDisplayOptions(),
215
216 SetCanvas( canvas );
217 SetBoard( new BOARD() );
218
219 wxIcon icon;
220 wxIconBundle icon_bundle;
221
222 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_pcbnew ) );
223 icon_bundle.AddIcon( icon );
224 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_pcbnew_32 ) );
225 icon_bundle.AddIcon( icon );
226 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_pcbnew_16 ) );
227 icon_bundle.AddIcon( icon );
228
229 SetIcons( icon_bundle );
230
231 // LoadSettings() *after* creating m_LayersManager, because LoadSettings()
232 // initialize parameters in m_LayersManager
233 LoadSettings( config() );
234
235 SetScreen( new PCB_SCREEN( GetPageSettings().GetSizeIU( pcbIUScale.IU_PER_MILS ) ) );
236
237 // PCB drawings start in the upper left corner.
238 GetScreen()->m_Center = false;
239
240 setupTools();
241 setupUIConditions();
242
243 ReCreateMenuBar();
244 ReCreateHToolbar();
245 ReCreateAuxiliaryToolbar();
246 ReCreateVToolbar();
247 ReCreateOptToolbar();
248
249
250 m_propertiesPanel = new PCB_PROPERTIES_PANEL( this, this );
251
252 float proportion = GetPcbNewSettings()->m_AuiPanels.properties_splitter_proportion;
253 m_propertiesPanel->SetSplitterProportion( proportion );
254
255 m_selectionFilterPanel = new PANEL_SELECTION_FILTER( this );
256
257 m_appearancePanel = new APPEARANCE_CONTROLS( this, GetCanvas() );
258 m_searchPane = new PCB_SEARCH_PANE( this );
259
260 m_auimgr.SetManagedWindow( this );
261
262 CreateInfoBar();
263
264 unsigned int auiFlags = wxAUI_MGR_DEFAULT;
265#if !defined( _WIN32 )
266 // Windows cannot redraw the UI fast enough during a live resize and may lead to all kinds
267 // of graphical glitches.
268 auiFlags |= wxAUI_MGR_LIVE_RESIZE;
269#endif
270 m_auimgr.SetFlags( auiFlags );
271
272 // Rows; layers 4 - 6
273 m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( wxS( "MainToolbar" ) )
274 .Top().Layer( 6 ) );
275 m_auimgr.AddPane( m_auxiliaryToolBar, EDA_PANE().HToolbar().Name( wxS( "AuxToolbar" ) )
276 .Top().Layer( 5 ) );
277 m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( wxS( "MsgPanel" ) )
278 .Bottom().Layer( 6 ) );
279
280 // Columns; layers 1 - 3
281 m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( wxS( "OptToolbar" ) )
282 .Left().Layer( 3 ) );
283
284 m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( wxS( "ToolsToolbar" ) )
285 .Right().Layer( 3 ) );
286
287 m_auimgr.AddPane( m_appearancePanel, EDA_PANE().Name( wxS( "LayersManager" ) )
288 .Right().Layer( 4 )
289 .Caption( _( "Appearance" ) ).PaneBorder( false )
290 .MinSize( 180, -1 ).BestSize( 180, -1 ) );
291
292 m_auimgr.AddPane( m_selectionFilterPanel, EDA_PANE().Name( wxS( "SelectionFilter" ) )
293 .Right().Layer( 4 ).Position( 2 )
294 .Caption( _( "Selection Filter" ) ).PaneBorder( false )
295 .MinSize( 180, -1 ).BestSize( 180, -1 ) );
296
297 m_auimgr.AddPane( m_propertiesPanel, EDA_PANE().Name( wxS( "PropertiesManager" ) )
298 .Left().Layer( 5 ).Caption( _( "Properties" ) )
299 .PaneBorder( false ).MinSize( 240, -1 ).BestSize( 300, -1 ) );
300
301 // Center
302 m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( wxS( "DrawFrame" ) )
303 .Center() );
304
305
306 m_auimgr.AddPane( m_searchPane, EDA_PANE()
307 .Name( SearchPaneName() )
308 .Bottom()
309 .Caption( _( "Search" ) )
310 .PaneBorder( false )
311 .MinSize( 180, -1 )
312 .BestSize( 180, -1 )
313 .FloatingSize( 480, 200 )
314 .CloseButton( true )
315 .DestroyOnClose( false ) );
316
317
318 m_auimgr.GetPane( "LayersManager" ).Show( m_show_layer_manager_tools );
319 m_auimgr.GetPane( "SelectionFilter" ).Show( m_show_layer_manager_tools );
320 m_auimgr.GetPane( "PropertiesManager" ).Show( m_show_properties );
321
322 m_auimgr.GetPane( SearchPaneName() ).Show( m_show_search );
323
324 // The selection filter doesn't need to grow in the vertical direction when docked
325 m_auimgr.GetPane( "SelectionFilter" ).dock_proportion = 0;
326
327 FinishAUIInitialization();
328
329 if( PCBNEW_SETTINGS* settings = dynamic_cast<PCBNEW_SETTINGS*>( config() ) )
330 {
331 if( settings->m_AuiPanels.right_panel_width > 0 )
332 {
333 wxAuiPaneInfo& layersManager = m_auimgr.GetPane( wxS( "LayersManager" ) );
334 SetAuiPaneSize( m_auimgr, layersManager, settings->m_AuiPanels.right_panel_width, -1 );
335 }
336
337 if( settings->m_AuiPanels.properties_panel_width > 0 && m_propertiesPanel )
338 {
339 wxAuiPaneInfo& propertiesPanel = m_auimgr.GetPane( wxS( "PropertiesManager" ) );
340 SetAuiPaneSize( m_auimgr, propertiesPanel,
341 settings->m_AuiPanels.properties_panel_width, -1 );
342 }
343
344 if( settings->m_AuiPanels.search_panel_height > 0 )
345 {
346 wxAuiPaneInfo& searchPane = m_auimgr.GetPane( SearchPaneName() );
347 SetAuiPaneSize( m_auimgr, searchPane, -1, settings->m_AuiPanels.search_panel_height );
348 }
349
350 m_appearancePanel->SetTabIndex( settings->m_AuiPanels.appearance_panel_tab );
351 }
352
353 GetToolManager()->RunAction( ACTIONS::zoomFitScreen, false );
354
355 // This is used temporarily to fix a client size issue on GTK that causes zoom to fit
356 // to calculate the wrong zoom size. See PCB_EDIT_FRAME::onSize().
357 Bind( wxEVT_SIZE, &PCB_EDIT_FRAME::onSize, this );
358
359 // Redraw netnames (so that they fall within the current viewport) after the viewport
360 // has stopped changing. Redrawing them without the timer moves them smoothly with scrolling,
361 // making it look like the tracks are being dragged -- which we don't want.
362 m_redrawNetnamesTimer.SetOwner( this );
363 Connect( wxEVT_TIMER, wxTimerEventHandler( PCB_EDIT_FRAME::redrawNetnames ), nullptr, this );
364
365 Bind( wxEVT_IDLE,
366 [this]( wxIdleEvent& aEvent )
367 {
368 if( GetCanvas()->GetView()->GetViewport() != m_lastViewport )
369 {
370 m_lastViewport = GetCanvas()->GetView()->GetViewport();
371 m_redrawNetnamesTimer.StartOnce( 500 );
372 }
373
374 // Do not forget to pass the Idle event to other clients:
375 aEvent.Skip();
376 } );
377
378 resolveCanvasType();
379
380 setupUnits( config() );
381
382 // Ensure the Python interpreter is up to date with its environment variables
383 PythonSyncEnvironmentVariables();
384 PythonSyncProjectName();
385
386 // Sync action plugins in case they changed since the last time the frame opened
387 GetToolManager()->RunAction( PCB_ACTIONS::pluginsReload, true );
388
389 GetCanvas()->SwitchBackend( m_canvasType );
390 ActivateGalCanvas();
391
392 // Default shutdown reason until a file is loaded
393 KIPLATFORM::APP::SetShutdownBlockReason( this, _( "New PCB file is unsaved" ) );
394
395 // disable Export STEP item if kicad2step does not exist
396 wxString strK2S = Pgm().GetExecutablePath();
397
398#ifdef __WXMAC__
399 if( strK2S.Find( wxT( "pcbnew.app" ) ) != wxNOT_FOUND )
400 {
401 // On macOS, we have standalone applications inside the main bundle, so we handle that here:
402 strK2S += wxT( "../../" );
403 }
404
405 strK2S += wxT( "Contents/MacOS/" );
406#endif
407
408 wxFileName appK2S( strK2S, wxT( "kicad2step" ) );
409
410 #ifdef _WIN32
411 appK2S.SetExt( wxT( "exe" ) );
412 #endif
413
414 // Ensure the window is on top
415 Raise();
416
417// if( !appK2S.FileExists() )
418 // GetMenuBar()->FindItem( ID_GEN_EXPORT_FILE_STEP )->Enable( false );
419
420 // AUI doesn't refresh properly on wxMac after changes in eb7dc6dd, so force it to
421#ifdef __WXMAC__
422 if( Kiface().IsSingle() )
423 {
424 CallAfter( [&]()
425 {
426 m_appearancePanel->OnBoardChanged();
427 } );
428 }
429#endif
430
431 // Register a call to update the toolbar sizes. It can't be done immediately because
432 // it seems to require some sizes calculated that aren't yet (at least on GTK).
433 CallAfter( [&]()
434 {
435 // Ensure the controls on the toolbars all are correctly sized
436 UpdateToolbarControlSizes();
437 } );
438
440 {
441 m_eventCounterTimer = new wxTimer( this );
442
443 Bind( wxEVT_TIMER,
444 [&]( wxTimerEvent& aEvent )
445 {
446 GetCanvas()->m_PaintEventCounter->Show();
447 GetCanvas()->m_PaintEventCounter->Reset();
448
450 static_cast<KIGFX::WX_VIEW_CONTROLS*>( GetCanvas()->GetViewControls() );
451 vc->m_MotionEventCounter->Show();
452 vc->m_MotionEventCounter->Reset();
453
454 },
455 m_eventCounterTimer->GetId() );
456
457 m_eventCounterTimer->Start( 1000 );
458 }
459
460 m_acceptedExts.emplace( KiCadPcbFileExtension, &PCB_ACTIONS::ddAppendBoard );
461 m_acceptedExts.emplace( LegacyPcbFileExtension, &PCB_ACTIONS::ddAppendBoard );
462 DragAcceptFiles( true );
463}
464
465
467{
468 if( ADVANCED_CFG::GetCfg().m_ShowEventCounters )
469 {
470 // Stop the timer during destruction early to avoid potential event race conditions (that do happen on windows)
471 m_eventCounterTimer->Stop();
472 delete m_eventCounterTimer;
473 }
474
475 // Close modeless dialogs
476 wxWindow* open_dlg = wxWindow::FindWindowByName( DIALOG_DRC_WINDOW_NAME );
477
478 if( open_dlg )
479 open_dlg->Close( true );
480
481 // Shutdown all running tools
482 if( m_toolManager )
484
485 if( GetBoard() )
487
489 delete m_appearancePanel;
491 delete m_propertiesPanel;
492}
493
494
495void PCB_EDIT_FRAME::SetBoard( BOARD* aBoard, bool aBuildConnectivity,
496 PROGRESS_REPORTER* aReporter )
497{
498 if( m_pcb )
500
501 PCB_BASE_EDIT_FRAME::SetBoard( aBoard, aReporter );
502
503 aBoard->SetProject( &Prj() );
504
505 if( aBuildConnectivity )
506 aBoard->BuildConnectivity();
507
508 // reload the drawing-sheet
509 SetPageSettings( aBoard->GetPageSettings() );
510}
511
512
514{
515 return m_pcb;
516}
517
518
519void PCB_EDIT_FRAME::redrawNetnames( wxTimerEvent& aEvent )
520{
521 bool needs_refresh = false;
522
523 // Don't stomp on the auto-save timer event.
524 if( aEvent.GetId() == ID_AUTO_SAVE_TIMER )
525 {
526 aEvent.Skip();
527 return;
528 }
529
530 PCBNEW_SETTINGS* cfg = dynamic_cast<PCBNEW_SETTINGS*>( Kiface().KifaceSettings() );
531
532 if( !cfg || cfg->m_Display.m_NetNames < 2 )
533 return;
534
535 KIGFX::VIEW* view = GetCanvas()->GetView();
536 double scale = view->GetScale();
537
538 for( PCB_TRACK* track : GetBoard()->Tracks() )
539 {
540 double lod = track->ViewGetLOD( GetNetnameLayer( track->GetLayer() ), view );
541
542 if( lod < scale )
543 continue;
544
545 if( lod != track->GetCachedLOD() || scale != track->GetCachedScale() )
546 {
547 view->Update( track, KIGFX::REPAINT );
548 needs_refresh = true;
549 track->SetCachedLOD( lod );
550 track->SetCachedScale( scale );
551 }
552 }
553
554 if( needs_refresh )
555 GetCanvas()->Refresh();
556}
557
558
559void PCB_EDIT_FRAME::SetPageSettings( const PAGE_INFO& aPageSettings )
560{
561 PCB_BASE_FRAME::SetPageSettings( aPageSettings );
562
563 // Prepare drawing-sheet template
566 m_pcb->GetProject(),
568 &m_pcb->GetProperties() );
569
570 drawingSheet->SetSheetName( std::string( GetScreenDesc().mb_str() ) );
571
572 // A board is not like a schematic having a main page and sub sheets.
573 // So for the drawing sheet, use only the first page option to display items
574 drawingSheet->SetIsFirstPage( true );
575
576 BASE_SCREEN* screen = GetScreen();
577
578 if( screen != nullptr )
579 {
580 drawingSheet->SetPageNumber(TO_UTF8( screen->GetPageNumber() ) );
581 drawingSheet->SetSheetCount( screen->GetPageCount() );
582 }
583
584 if( BOARD* board = GetBoard() )
585 drawingSheet->SetFileName( TO_UTF8( board->GetFileName() ) );
586
587 // PCB_DRAW_PANEL_GAL takes ownership of the drawing-sheet
588 GetCanvas()->SetDrawingSheet( drawingSheet );
589}
590
591
593{
594 return GetScreen() && GetScreen()->IsContentModified();
595}
596
597
599{
600 return m_toolManager->GetTool<PCB_SELECTION_TOOL>()->GetSelection();
601}
602
603
605{
606 // Create the manager and dispatcher & route draw panel events to the dispatcher
609 GetCanvas()->GetViewControls(), config(), this );
610 m_actions = new PCB_ACTIONS();
612
613 // Register tools
642
643 for( TOOL_BASE* tool : m_toolManager->Tools() )
644 {
645 if( PCB_TOOL_BASE* pcbTool = dynamic_cast<PCB_TOOL_BASE*>( tool ) )
646 pcbTool->SetIsBoardEditor( true );
647 }
648
649 // Run the selection tool, it is supposed to be always active
650 m_toolManager->InvokeTool( "pcbnew.InteractiveSelection" );
651}
652
653
655{
657
659 PCB_EDITOR_CONDITIONS cond( this );
660
661 wxASSERT( mgr );
662
663#define ENABLE( x ) ACTION_CONDITIONS().Enable( x )
664#define CHECK( x ) ACTION_CONDITIONS().Check( x )
665
669
676
677 mgr->SetConditions( ACTIONS::cut, ENABLE( cond.HasItems() ) );
678 mgr->SetConditions( ACTIONS::copy, ENABLE( cond.HasItems() ) );
686
691
697
698 if( SCRIPTING::IsWxAvailable() )
700
701 auto enableZoneControlConition =
702 [this] ( const SELECTION& )
703 {
706 };
707
709 ENABLE( enableZoneControlConition )
712 ENABLE( enableZoneControlConition )
715 ENABLE( enableZoneControlConition )
718 ENABLE( enableZoneControlConition )
720
722
723 auto constrainedDrawingModeCond =
724 [this]( const SELECTION& )
725 {
727 };
728
729 auto enableBoardSetupCondition =
730 [this] ( const SELECTION& )
731 {
732 if( DRC_TOOL* tool = m_toolManager->GetTool<DRC_TOOL>() )
733 return !tool->IsDRCDialogShown();
734
735 return true;
736 };
737
738 auto boardFlippedCond =
739 [this]( const SELECTION& )
740 {
741 return GetCanvas()->GetView()->IsMirroredX();
742 };
743
744 auto layerManagerCond =
745 [this] ( const SELECTION& )
746 {
747 return LayerManagerShown();
748 };
749
750 auto propertiesCond =
751 [this] ( const SELECTION& )
752 {
753 return PropertiesShown();
754 };
755
756 auto searchPaneCond =
757 [this] ( const SELECTION& )
758 {
759 return m_auimgr.GetPane( SearchPaneName() ).IsShown();
760 };
761
762 auto highContrastCond =
763 [this] ( const SELECTION& )
764 {
766 };
767
768 auto globalRatsnestCond =
769 [this] (const SELECTION& )
770 {
772 };
773
774 auto curvedRatsnestCond =
775 [this] (const SELECTION& )
776 {
778 };
779
780 auto netHighlightCond =
781 [this]( const SELECTION& )
782 {
784 return !settings->GetHighlightNetCodes().empty();
785 };
786
787 auto enableNetHighlightCond =
788 [this]( const SELECTION& )
789 {
791 return tool->IsNetHighlightSet();
792 };
793
794 mgr->SetConditions( PCB_ACTIONS::toggleHV45Mode, CHECK( constrainedDrawingModeCond ) );
795 mgr->SetConditions( ACTIONS::highContrastMode, CHECK( highContrastCond ) );
796 mgr->SetConditions( PCB_ACTIONS::flipBoard, CHECK( boardFlippedCond ) );
797 mgr->SetConditions( PCB_ACTIONS::showLayersManager, CHECK( layerManagerCond ) );
798 mgr->SetConditions( PCB_ACTIONS::showRatsnest, CHECK( globalRatsnestCond ) );
799 mgr->SetConditions( PCB_ACTIONS::ratsnestLineMode, CHECK( curvedRatsnestCond ) );
800 mgr->SetConditions( PCB_ACTIONS::toggleNetHighlight, CHECK( netHighlightCond )
801 .Enable( enableNetHighlightCond ) );
802 mgr->SetConditions( PCB_ACTIONS::boardSetup, ENABLE( enableBoardSetupCondition ) );
803 mgr->SetConditions( PCB_ACTIONS::showProperties, CHECK( propertiesCond ) );
804 mgr->SetConditions( PCB_ACTIONS::showSearch, CHECK( searchPaneCond ) );
805
806 auto isArcKeepCenterMode = [this]( const SELECTION& )
807 {
809 };
810
811 auto isArcKeepEndpointMode = [this]( const SELECTION& )
812 {
815 };
816
817 mgr->SetConditions( PCB_ACTIONS::pointEditorArcKeepCenter, CHECK( isArcKeepCenterMode ) );
818 mgr->SetConditions( PCB_ACTIONS::pointEditorArcKeepEndpoint, CHECK( isArcKeepEndpointMode ) );
819
820 auto isHighlightMode =
821 [this]( const SELECTION& )
822 {
824 return tool->GetRouterMode() == PNS::RM_MarkObstacles;
825 };
826
827 auto isShoveMode =
828 [this]( const SELECTION& )
829 {
831 return tool->GetRouterMode() == PNS::RM_Shove;
832 };
833
834 auto isWalkaroundMode =
835 [this]( const SELECTION& )
836 {
838 return tool->GetRouterMode() == PNS::RM_Walkaround;
839 };
840
841 mgr->SetConditions( PCB_ACTIONS::routerHighlightMode, CHECK( isHighlightMode ) );
842 mgr->SetConditions( PCB_ACTIONS::routerShoveMode, CHECK( isShoveMode ) );
843 mgr->SetConditions( PCB_ACTIONS::routerWalkaroundMode, CHECK( isWalkaroundMode ) );
844
845 auto haveNetCond =
846 [] ( const SELECTION& aSel )
847 {
848 for( EDA_ITEM* item : aSel )
849 {
850 if( BOARD_CONNECTED_ITEM* bci = dynamic_cast<BOARD_CONNECTED_ITEM*>( item ) )
851 {
852 if( bci->GetNetCode() > 0 )
853 return true;
854 }
855 }
856
857 return false;
858 };
859
864
875
876
879
882
883 mgr->SetConditions( PCB_ACTIONS::zoneDuplicate, ENABLE( singleZoneCond ) );
884 mgr->SetConditions( PCB_ACTIONS::drawZoneCutout, ENABLE( singleZoneCond ) );
885 mgr->SetConditions( PCB_ACTIONS::drawSimilarZone, ENABLE( singleZoneCond ) );
886 mgr->SetConditions( PCB_ACTIONS::zoneMerge, ENABLE( zoneMergeCond ) );
889
891
892#define CURRENT_TOOL( action ) mgr->SetConditions( action, CHECK( cond.CurrentTool( action ) ) )
893
894 // These tools can be used at any time to inspect the board
899
900
901 auto isDrcRunning =
902 [this] ( const SELECTION& )
903 {
905 return !tool->IsDRCRunning();
906 };
907
908#define CURRENT_EDIT_TOOL( action ) mgr->SetConditions( action, ACTION_CONDITIONS().Check( cond.CurrentTool( action ) ).Enable( isDrcRunning ) )
909
910 // These tools edit the board, so they must be disabled during some operations
936
942
943#undef CURRENT_TOOL
944#undef CURRENT_EDIT_TOOL
945#undef ENABLE
946#undef CHECK
947}
948
949
950void PCB_EDIT_FRAME::OnQuit( wxCommandEvent& event )
951{
952 if( event.GetId() == wxID_EXIT )
953 Kiway().OnKiCadExit();
954
955 if( event.GetId() == wxID_CLOSE || Kiface().IsSingle() )
956 Close( false );
957}
958
959
961{
963 bds.m_DrcExclusions.clear();
964
965 for( PCB_MARKER* marker : GetBoard()->Markers() )
966 {
967 if( marker->IsExcluded() )
968 bds.m_DrcExclusions.insert( marker->Serialize() );
969 }
970}
971
972
974{
975 BOARD_COMMIT commit( this );
976
977 for( PCB_MARKER* marker : GetBoard()->ResolveDRCExclusions() )
978 {
979 if( marker->GetMarkerType() == MARKER_BASE::MARKER_DRAWING_SHEET )
980 marker->GetRCItem()->SetItems( GetCanvas()->GetDrawingSheet() );
981
982 commit.Add( marker );
983 }
984
985 commit.Push( wxEmptyString, SKIP_UNDO | SKIP_SET_DIRTY );
986
987 for( PCB_MARKER* marker : GetBoard()->Markers() )
988 {
989 if( marker->GetSeverity() == RPT_SEVERITY_EXCLUSION )
990 {
991 GetCanvas()->GetView()->Remove( marker );
992 GetCanvas()->GetView()->Add( marker );
993 }
994 }
995
997}
998
999
1000bool PCB_EDIT_FRAME::canCloseWindow( wxCloseEvent& aEvent )
1001{
1002 // Shutdown blocks must be determined and vetoed as early as possible
1003 if( KIPLATFORM::APP::SupportsShutdownBlockReason() && aEvent.GetId() == wxEVT_QUERY_END_SESSION
1004 && IsContentModified() )
1005 {
1006 return false;
1007 }
1008
1010
1011 if( zoneFillerTool->IsBusy() )
1012 {
1013 wxBell();
1014
1015 if( wxWindow* reporter = dynamic_cast<wxWindow*>( zoneFillerTool->GetProgressReporter() ) )
1016 reporter->ShowWithEffect( wxSHOW_EFFECT_EXPAND );
1017
1018 return false;
1019 }
1020
1021 if( Kiface().IsSingle() )
1022 {
1023 auto* fpEditor = (FOOTPRINT_EDIT_FRAME*) Kiway().Player( FRAME_FOOTPRINT_EDITOR, false );
1024
1025 if( fpEditor && !fpEditor->Close() ) // Can close footprint editor?
1026 return false;
1027
1028 auto* fpViewer = (FOOTPRINT_VIEWER_FRAME*) Kiway().Player( FRAME_FOOTPRINT_VIEWER, false );
1029
1030 if( fpViewer && !fpViewer->Close() ) // Can close footprint viewer?
1031 return false;
1032
1034
1035 if( fpViewer && !fpViewer->Close() ) // Can close modal footprint viewer?
1036 return false;
1037 }
1038 else
1039 {
1040 auto* fpEditor = (FOOTPRINT_EDIT_FRAME*) Kiway().Player( FRAME_FOOTPRINT_EDITOR, false );
1041
1042 if( fpEditor && fpEditor->IsCurrentFPFromBoard() )
1043 {
1044 if( !fpEditor->CanCloseFPFromBoard( true ) )
1045 return false;
1046 }
1047 }
1048
1049 if( IsContentModified() )
1050 {
1051 wxFileName fileName = GetBoard()->GetFileName();
1052 wxString msg = _( "Save changes to '%s' before closing?" );
1053
1054 if( !HandleUnsavedChanges( this, wxString::Format( msg, fileName.GetFullName() ),
1055 [&]() -> bool
1056 {
1057 return Files_io_from_id( ID_SAVE_BOARD );
1058 } ) )
1059 {
1060 return false;
1061 }
1062 }
1063
1064 // Close modeless dialogs. They're trouble when they get destroyed after the frame and/or
1065 // board.
1066 wxWindow* open_dlg = wxWindow::FindWindowByName( DIALOG_DRC_WINDOW_NAME );
1067
1068 if( open_dlg )
1069 open_dlg->Close( true );
1070
1071 return PCB_BASE_EDIT_FRAME::canCloseWindow( aEvent );
1072}
1073
1074
1076{
1077 // On Windows 7 / 32 bits, on OpenGL mode only, Pcbnew crashes
1078 // when closing this frame if a footprint was selected, and the footprint editor called
1079 // to edit this footprint, and when closing pcbnew if this footprint is still selected
1080 // See https://bugs.launchpad.net/kicad/+bug/1655858
1081 // I think this is certainly a OpenGL event fired after frame deletion, so this workaround
1082 // avoid the crash (JPC)
1083 GetCanvas()->SetEvtHandlerEnabled( false );
1084
1086
1087 // Delete the auto save file if it exists.
1088 wxFileName fn = GetBoard()->GetFileName();
1089
1090 // Auto save file name is the normal file name prefixed with 'GetAutoSaveFilePrefix()'.
1091 fn.SetName( GetAutoSaveFilePrefix() + fn.GetName() );
1092
1093 // When the auto save feature does not have write access to the board file path, it falls
1094 // back to a platform specific user temporary file path.
1095 if( !fn.IsOk() || !fn.IsDirWritable() )
1096 fn.SetPath( wxFileName::GetTempDir() );
1097
1098 wxLogTrace( traceAutoSave, wxT( "Deleting auto save file <" ) + fn.GetFullPath() + wxT( ">" ) );
1099
1100 // Remove the auto save file on a normal close of Pcbnew.
1101 if( fn.FileExists() && !wxRemoveFile( fn.GetFullPath() ) )
1102 wxLogTrace( traceAutoSave, wxT( "The auto save file could not be removed!" ) );
1103
1104 // Make sure local settings are persisted
1106
1107 // Do not show the layer manager during closing to avoid flicker
1108 // on some platforms (Windows) that generate useless redraw of items in
1109 // the Layer Manager
1111 {
1112 m_auimgr.GetPane( wxS( "LayersManager" ) ).Show( false );
1113 m_auimgr.GetPane( wxS( "TabbedPanel" ) ).Show( false );
1114 }
1115
1116 // Unlink the old project if needed
1118
1119 // Delete board structs and undo/redo lists, to avoid crash on exit
1120 // when deleting some structs (mainly in undo/redo lists) too late
1121 Clear_Pcb( false, true );
1122
1123 // do not show the window because ScreenPcb will be deleted and we do not
1124 // want any paint event
1125 Show( false );
1126
1128}
1129
1130
1132{
1135 GetCanvas()->Refresh();
1136}
1137
1138
1139void PCB_EDIT_FRAME::ShowBoardSetupDialog( const wxString& aInitialPage )
1140{
1141 // Make sure everything's up-to-date
1143
1144 DIALOG_BOARD_SETUP dlg( this );
1145
1146 if( !aInitialPage.IsEmpty() )
1147 dlg.SetInitialPage( aInitialPage, wxEmptyString );
1148
1149 if( dlg.ShowQuasiModal() == wxID_OK )
1150 {
1153
1154 Kiway().CommonSettingsChanged( false, true );
1155
1156 PCBNEW_SETTINGS* settings = GetPcbNewSettings();
1157 static LSET maskAndPasteLayers = LSET( 4, F_Mask, F_Paste, B_Mask, B_Paste );
1158
1160 [&]( KIGFX::VIEW_ITEM* aItem ) -> int
1161 {
1162 if( dynamic_cast<PCB_TRACK*>( aItem ) )
1163 {
1165 return KIGFX::REPAINT;
1166 }
1167 else if( dynamic_cast<PAD*>( aItem ) )
1168 {
1169 if( settings->m_Display.m_PadClearance )
1170 return KIGFX::REPAINT;
1171
1172 // Note: KIGFX::REPAINT isn't enough for things that go from invisible
1173 // to visible as they won't be found in the view layer's itemset for
1174 // re-painting.
1175 if( ( GetBoard()->GetVisibleLayers() & maskAndPasteLayers ).any() )
1176 return KIGFX::ALL;
1177 }
1178
1179 EDA_TEXT* text = dynamic_cast<EDA_TEXT*>( aItem );
1180
1181 if( text && text->HasTextVars() )
1182 {
1183 text->ClearRenderCache();
1184 text->ClearBoundingBoxCache();
1186 }
1187
1188 return 0;
1189 } );
1190
1191 GetCanvas()->Refresh();
1192
1196
1197 //this event causes the routing tool to reload its design rules information
1199 toolEvent.SetHasPosition( false );
1200 m_toolManager->ProcessEvent( toolEvent );
1201 }
1202
1203 GetCanvas()->SetFocus();
1204}
1205
1206
1208{
1210
1211 PCBNEW_SETTINGS* cfg = dynamic_cast<PCBNEW_SETTINGS*>( aCfg );
1212 wxASSERT( cfg );
1213
1214 if( cfg )
1215 {
1219 }
1220}
1221
1222
1224{
1226
1227 PCBNEW_SETTINGS* cfg = dynamic_cast<PCBNEW_SETTINGS*>( aCfg );
1228 wxASSERT( cfg );
1229
1230 if( cfg )
1231 {
1235
1236 if( m_propertiesPanel )
1237 {
1240
1243 }
1244
1245 // ensure m_show_search is up to date (the pane can be closed)
1246 m_show_search = m_auimgr.GetPane( SearchPaneName() ).IsShown();
1248 cfg->m_AuiPanels.search_panel_height = m_searchPane->GetSize().y;
1249 }
1250}
1251
1252
1254{
1255 PCBNEW_SETTINGS* cfg = dynamic_cast<PCBNEW_SETTINGS*>( config() );
1256
1257 return cfg ? cfg->m_RotationAngle : ANGLE_90;
1258}
1259
1260
1262{
1264}
1265
1266
1268{
1269
1270 GetColorSettings()->SetColor( LAYER_GRID, aColor );
1271 GetCanvas()->GetGAL()->SetGridColor( aColor );
1272}
1273
1274
1276{
1277 PCB_LAYER_ID oldLayer = GetActiveLayer();
1278
1279 if( oldLayer == aLayer )
1280 return;
1281
1283
1285
1286 m_toolManager->RunAction( PCB_ACTIONS::layerChanged ); // notify other tools
1287 GetCanvas()->SetFocus(); // allow capture of hotkeys
1288 GetCanvas()->SetHighContrastLayer( aLayer );
1289
1291 [&]( KIGFX::VIEW_ITEM* aItem ) -> int
1292 {
1293 BOARD_ITEM* item = dynamic_cast<BOARD_ITEM*>( aItem );
1294
1295 if( !item )
1296 return 0;
1297
1298 // Note: KIGFX::REPAINT isn't enough for things that go from invisible to visible
1299 // as they won't be found in the view layer's itemset for re-painting.
1300 if( GetDisplayOptions().m_ContrastModeDisplay == HIGH_CONTRAST_MODE::HIDDEN )
1301 {
1302 if( item->IsOnLayer( oldLayer ) || item->IsOnLayer( aLayer ) )
1303 return KIGFX::ALL;
1304 }
1305
1306 if( item->Type() == PCB_VIA_T )
1307 {
1308 PCB_VIA* via = static_cast<PCB_VIA*>( item );
1309
1310 // Vias on a restricted layer set must be redrawn when the active layer
1311 // is changed
1312 if( via->GetViaType() == VIATYPE::BLIND_BURIED
1313 || via->GetViaType() == VIATYPE::MICROVIA )
1314 {
1315 return KIGFX::REPAINT;
1316 }
1317 }
1318 else if( item->Type() == PCB_PAD_T )
1319 {
1320 PAD* pad = static_cast<PAD*>( item );
1321
1322 // Clearances could be layer-dependent so redraw them when the active layer
1323 // is changed
1325 {
1326 // Round-corner rects are expensive to draw, but are mostly found on
1327 // SMD pads which only need redrawing on an active-to-not-active
1328 // switch.
1329 if( pad->GetAttribute() == PAD_ATTRIB::SMD )
1330 {
1331 if( ( oldLayer == F_Cu || aLayer == F_Cu ) && pad->IsOnLayer( F_Cu ) )
1332 return KIGFX::REPAINT;
1333
1334 if( ( oldLayer == B_Cu || aLayer == B_Cu ) && pad->IsOnLayer( B_Cu ) )
1335 return KIGFX::REPAINT;
1336 }
1337 else if( pad->IsOnLayer( oldLayer ) || pad->IsOnLayer( aLayer ) )
1338 {
1339 return KIGFX::REPAINT;
1340 }
1341 }
1342 }
1343 else if( item->Type() == PCB_TRACE_T || item->Type() == PCB_ARC_T )
1344 {
1345 PCB_TRACK* track = static_cast<PCB_TRACK*>( item );
1346
1347 // Clearances could be layer-dependent so redraw them when the active layer
1348 // is changed
1350 {
1351 // Tracks aren't particularly expensive to draw, but it's an easy check.
1352 if( track->IsOnLayer( oldLayer ) || track->IsOnLayer( aLayer ) )
1353 return KIGFX::REPAINT;
1354 }
1355 }
1356
1357 return 0;
1358 } );
1359
1360 GetCanvas()->Refresh();
1361}
1362
1363
1365{
1366 // JEY TODO: move this global to the board
1368
1369 layerEnum.Choices().Clear();
1370 layerEnum.Undefined( UNDEFINED_LAYER );
1371
1372 for( LSEQ seq = LSET::AllLayersMask().Seq(); seq; ++seq )
1373 {
1374 // Canonical name
1375 layerEnum.Map( *seq, LSET::Name( *seq ) );
1376
1377 // User name
1378 layerEnum.Map( *seq, GetBoard()->GetLayerName( *seq ) );
1379 }
1380
1381 DRC_TOOL* drcTool = m_toolManager->GetTool<DRC_TOOL>();
1382
1383 try
1384 {
1385 drcTool->GetDRCEngine()->InitEngine( GetDesignRulesPath() );
1386 }
1387 catch( PARSE_ERROR& )
1388 {
1389 // Not sure this is the best place to tell the user their rules are buggy, so
1390 // we'll stay quiet for now. Feel free to revisit this decision....
1391 }
1392
1393 UpdateTitle();
1394
1395 wxFileName fn = GetBoard()->GetFileName();
1396
1397 // Display a warning that the file is read only
1398 if( fn.FileExists() && !fn.IsFileWritable() )
1399 {
1402 m_infoBar->ShowMessage( _( "Board file is read only." ),
1404 }
1405
1407
1408 // Sync layer and item visibility
1410
1411 SetElementVisibility( LAYER_RATSNEST, GetPcbNewSettings()->m_Display.m_ShowGlobalRatsnest );
1412
1414
1415 // Apply saved display state to the appearance panel after it has been set up
1416 PROJECT_LOCAL_SETTINGS& localSettings = Prj().GetLocalSettings();
1417
1419
1420 if( GetBoard()->GetDesignSettings().IsLayerEnabled( localSettings.m_ActiveLayer ) )
1421 SetActiveLayer( localSettings.m_ActiveLayer );
1422
1423 // Updates any auto dimensions and the auxiliary toolbar tracks/via sizes
1425
1426 // Display the loaded board:
1427 Zoom_Automatique( false );
1428
1429 // Invalidate painting as loading the DRC engine will cause clearances to become valid
1431
1432 Refresh();
1433
1434 SetMsgPanel( GetBoard() );
1435 SetStatusText( wxEmptyString );
1436
1437 KIPLATFORM::APP::SetShutdownBlockReason( this, _( "PCB file changes are unsaved" ) );
1438}
1439
1440
1442{
1444}
1445
1446
1448{
1449 return GetBoard()->IsElementVisible( aElement );
1450}
1451
1452
1454{
1455 // Force the RATSNEST visible
1456 if( aElement == LAYER_RATSNEST )
1457 GetCanvas()->GetView()->SetLayerVisible( aElement, true );
1458 else
1459 GetCanvas()->GetView()->SetLayerVisible( aElement , aNewState );
1460
1461 GetBoard()->SetElementVisibility( aElement, aNewState );
1462}
1463
1464
1466{
1467 // call my base class
1469
1470 m_auimgr.GetPane( m_appearancePanel ).Caption( _( "Appearance" ) );
1471 m_auimgr.GetPane( m_selectionFilterPanel ).Caption( _( "Selection Filter" ) );
1472 m_auimgr.GetPane( m_propertiesPanel ).Caption( _( "Properties" ) );
1473 m_auimgr.Update();
1474
1478
1479 UpdateTitle();
1480}
1481
1482
1484{
1486
1487 if( project.m_PcbLastPath[ aType ].IsEmpty() )
1488 return wxEmptyString;
1489
1490 wxFileName absoluteFileName = project.m_PcbLastPath[ aType ];
1491 wxFileName pcbFileName = GetBoard()->GetFileName();
1492
1493 absoluteFileName.MakeAbsolute( pcbFileName.GetPath() );
1494 return absoluteFileName.GetFullPath();
1495}
1496
1497
1498void PCB_EDIT_FRAME::SetLastPath( LAST_PATH_TYPE aType, const wxString& aLastPath )
1499{
1501
1502 wxFileName relativeFileName = aLastPath;
1503 wxFileName pcbFileName = GetBoard()->GetFileName();
1504
1505 relativeFileName.MakeRelativeTo( pcbFileName.GetPath() );
1506
1507 if( relativeFileName.GetFullPath() != project.m_PcbLastPath[ aType ] )
1508 {
1509 project.m_PcbLastPath[ aType ] = relativeFileName.GetFullPath();
1511 }
1512}
1513
1514
1516{
1518
1519 Update3DView( true, GetPcbNewSettings()->m_Display.m_Live3DRefresh );
1520
1521 if( !GetTitle().StartsWith( wxT( "*" ) ) )
1522 UpdateTitle();
1523
1524 m_ZoneFillsDirty = true;
1525}
1526
1527
1529{
1530 Update3DView( true, true );
1531}
1532
1533
1534void PCB_EDIT_FRAME::ExportSVG( wxCommandEvent& event )
1535{
1536 InvokeExportSVG( this, GetBoard() );
1537}
1538
1539
1541{
1542 wxFileName fn = GetBoard()->GetFileName();
1543 bool readOnly = false;
1544 bool unsaved = false;
1545
1546 if( fn.IsOk() && fn.FileExists() )
1547 readOnly = !fn.IsFileWritable();
1548 else
1549 unsaved = true;
1550
1551 wxString title;
1552
1553 if( IsContentModified() )
1554 title = wxT( "*" );
1555
1556 title += fn.GetName();
1557
1558 if( readOnly )
1559 title += wxS( " " ) + _( "[Read Only]" );
1560
1561 if( unsaved )
1562 title += wxS( " " ) + _( "[Unsaved]" );
1563
1564 title += wxT( " \u2014 " ) + _( "PCB Editor" );
1565
1566 SetTitle( title );
1567}
1568
1569
1571{
1572 // Update the layer manager and other widgets from the board setup
1573 // (layer and items visibility, colors ...)
1574
1575 // Rebuild list of nets (full ratsnest rebuild)
1577
1578 // Update info shown by the horizontal toolbars
1580
1581 LSET activeLayers = GetBoard()->GetEnabledLayers();
1582
1583 if( !activeLayers.test( GetActiveLayer() ) )
1584 SetActiveLayer( activeLayers.Seq().front() );
1585
1587
1589
1590 layerEnum.Choices().Clear();
1591 layerEnum.Undefined( UNDEFINED_LAYER );
1592
1593 for( LSEQ seq = LSET::AllLayersMask().Seq(); seq; ++seq )
1594 {
1595 // Canonical name
1596 layerEnum.Map( *seq, LSET::Name( *seq ) );
1597
1598 // User name
1599 layerEnum.Map( *seq, GetBoard()->GetLayerName( *seq ) );
1600 }
1601
1602 // Sync visibility with canvas
1603 for( PCB_LAYER_ID layer : LSET::AllLayersMask().Seq() )
1604 GetCanvas()->GetView()->SetLayerVisible( layer, GetBoard()->IsLayerVisible( layer ) );
1605
1606 // Stackup and/or color theme may have changed
1608}
1609
1610
1612{
1613 // switches currently used canvas (Cairo / OpenGL).
1614 PCB_BASE_FRAME::SwitchCanvas( aCanvasType );
1615}
1616
1617
1619{
1620 if( !m_findDialog )
1621 {
1622 m_findDialog = new DIALOG_FIND( this );
1625 }
1626
1627 wxString findString;
1628
1629 PCB_SELECTION& selection = m_toolManager->GetTool<PCB_SELECTION_TOOL>()->GetSelection();
1630
1631 if( selection.Size() == 1 )
1632 {
1633 EDA_ITEM* front = selection.Front();
1634
1635 switch( front->Type() )
1636 {
1637 case PCB_FOOTPRINT_T:
1638 findString = static_cast<FOOTPRINT*>( front )->GetValue();
1639 break;
1640
1641 case PCB_FP_TEXT_T:
1642 findString = static_cast<FP_TEXT*>( front )->GetShownText();
1643 break;
1644
1645 case PCB_TEXT_T:
1646 findString = static_cast<PCB_TEXT*>( front )->GetShownText();
1647
1648 if( findString.Contains( wxT( "\n" ) ) )
1649 findString = findString.Before( '\n' );
1650
1651 break;
1652
1653 default:
1654 break;
1655 }
1656 }
1657
1658 m_findDialog->Preload( findString );
1659
1660 m_findDialog->Show( true );
1661}
1662
1663
1665{
1666 if( !m_findDialog )
1668
1670}
1671
1672
1674{
1675 PCB_PLOT_PARAMS plotSettings = GetPlotSettings();
1676
1677 switch( aID )
1678 {
1679 case ID_GEN_PLOT_GERBER:
1680 plotSettings.SetFormat( PLOT_FORMAT::GERBER );
1681 break;
1682 case ID_GEN_PLOT_DXF:
1683 plotSettings.SetFormat( PLOT_FORMAT::DXF );
1684 break;
1685 case ID_GEN_PLOT_HPGL:
1686 plotSettings.SetFormat( PLOT_FORMAT::HPGL );
1687 break;
1688 case ID_GEN_PLOT_PDF:
1689 plotSettings.SetFormat( PLOT_FORMAT::PDF );
1690 break;
1691 case ID_GEN_PLOT_PS:
1692 plotSettings.SetFormat( PLOT_FORMAT::POST );
1693 break;
1694 case ID_GEN_PLOT:
1695 /* keep the previous setup */
1696 break;
1697 default:
1698 wxFAIL_MSG( wxT( "ToPlotter(): unexpected plot type" ) ); break;
1699 break;
1700 }
1701
1702 SetPlotSettings( plotSettings );
1703
1704 DIALOG_PLOT dlg( this );
1705 dlg.ShowQuasiModal( );
1706}
1707
1708
1710{
1711 if( Kiface().IsSingle() )
1712 return 0;
1713
1714 // Update PCB requires a netlist. Therefore the schematic editor must be running
1715 // If this is not the case, open the schematic editor
1716 KIWAY_PLAYER* frame = Kiway().Player( FRAME_SCH, true );
1717
1718 // If Kiway() cannot create the eeschema frame, it shows a error message, and
1719 // frame is null
1720 if( !frame )
1721 return -1;
1722
1723 if( !frame->IsShown() )
1724 {
1725 wxFileName fn( Prj().GetProjectPath(), Prj().GetProjectName(),
1727
1728 // Maybe the file hasn't been converted to the new s-expression file format so
1729 // see if the legacy schematic file is still in play.
1730 if( !fn.FileExists() )
1731 {
1732 fn.SetExt( LegacySchematicFileExtension );
1733
1734 if( !fn.FileExists() )
1735 {
1736 DisplayError( this, _( "The schematic for this board cannot be found." ) );
1737 return -2;
1738 }
1739 }
1740
1741 frame->OpenProjectFiles( std::vector<wxString>( 1, fn.GetFullPath() ) );
1742
1743 // we show the schematic editor frame, because do not show is seen as
1744 // a not yet opened schematic by Kicad manager, which is not the case
1745 frame->Show( true );
1746
1747 // bring ourselves back to the front
1748 Raise();
1749 }
1750
1751 return 1; //Success!
1752}
1753
1754
1756 const wxString& aAnnotateMessage )
1757{
1758 if( TestStandalone() == 0 )
1759 {
1760 DisplayErrorMessage( this, _( "Cannot update the PCB because PCB editor is opened in "
1761 "stand-alone mode. In order to create or update PCBs from "
1762 "schematics, you must launch the KiCad project manager and "
1763 "create a project." ) );
1764 return false; // Not in standalone mode
1765 }
1766
1767 if( TestStandalone() < 0 ) // Problem with Eeschema or the schematic
1768 return false;
1769
1770 Raise(); // Show
1771
1772 std::string payload( aAnnotateMessage );
1773
1774 Kiway().ExpressMail( FRAME_SCH, MAIL_SCH_GET_NETLIST, payload, this );
1775
1776 if( payload == aAnnotateMessage )
1777 {
1778 Raise();
1779 DisplayErrorMessage( this, aAnnotateMessage );
1780 return false;
1781 }
1782
1783 try
1784 {
1785 auto lineReader = new STRING_LINE_READER( payload, _( "Eeschema netlist" ) );
1786 KICAD_NETLIST_READER netlistReader( lineReader, &aNetlist );
1787 netlistReader.LoadNetlist();
1788 }
1789 catch( const IO_ERROR& e )
1790 {
1791 Raise();
1792
1793 // Do not translate extra_info strings. These are for developers
1794 wxString extra_info = e.Problem() + wxT( " : " ) + e.What() + wxT( " at " ) + e.Where();
1795
1796 DisplayErrorMessage( this, _( "Received an error while reading netlist. Please "
1797 "report this issue to the KiCad team using the menu "
1798 "Help->Report Bug."), extra_info );
1799 return false;
1800 }
1801
1802 return true;
1803}
1804
1805
1807{
1808 wxString msg;
1809 wxFileName schematic( Prj().GetProjectPath(), Prj().GetProjectName(),
1811
1812 if( !schematic.FileExists() )
1813 {
1814 wxFileName legacySchematic( Prj().GetProjectPath(), Prj().GetProjectName(),
1816
1817 if( legacySchematic.FileExists() )
1818 {
1819 schematic = legacySchematic;
1820 }
1821 else
1822 {
1823 msg.Printf( _( "Schematic file '%s' not found." ), schematic.GetFullPath() );
1824 DisplayErrorMessage( this, msg );
1825 return;
1826 }
1827 }
1828
1829 if( Kiface().IsSingle() )
1830 {
1831 ExecuteFile( EESCHEMA_EXE, schematic.GetFullPath() );
1832 }
1833 else
1834 {
1835 KIWAY_PLAYER* frame = Kiway().Player( FRAME_SCH, false );
1836
1837 // Please: note: DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::initBuffers() calls
1838 // Kiway.Player( FRAME_SCH, true )
1839 // therefore, the schematic editor is sometimes running, but the schematic project
1840 // is not loaded, if the library editor was called, and the dialog field editor was used.
1841 // On Linux, it happens the first time the schematic editor is launched, if
1842 // library editor was running, and the dialog field editor was open
1843 // On Windows, it happens always after the library editor was called,
1844 // and the dialog field editor was used
1845 if( !frame )
1846 {
1847 try
1848 {
1849 frame = Kiway().Player( FRAME_SCH, true );
1850 }
1851 catch( const IO_ERROR& err )
1852 {
1853 DisplayErrorMessage( this, _( "Eeschema failed to load." ) + wxS( "\n" ) + err.What() );
1854 return;
1855 }
1856 }
1857
1858 // If Kiway() cannot create the eeschema frame, it shows a error message, and
1859 // frame is null
1860 if( !frame )
1861 return;
1862
1863 if( !frame->IsShown() ) // the frame exists, (created by the dialog field editor)
1864 // but no project loaded.
1865 {
1866 frame->OpenProjectFiles( std::vector<wxString>( 1, schematic.GetFullPath() ) );
1867 frame->Show( true );
1868 }
1869
1870 // On Windows, Raise() does not bring the window on screen, when iconized or not shown
1871 // On Linux, Raise() brings the window on screen, but this code works fine
1872 if( frame->IsIconized() )
1873 {
1874 frame->Iconize( false );
1875
1876 // If an iconized frame was created by Pcbnew, Iconize( false ) is not enough
1877 // to show the frame at its normal size: Maximize should be called.
1878 frame->Maximize( false );
1879 }
1880
1881 frame->Raise();
1882 }
1883}
1884
1885
1887{
1888 const ENV_VAR_MAP& vars = Pgm().GetLocalEnvVariables();
1889
1890 // Set the environment variables for python scripts
1891 // note: the string will be encoded UTF8 for python env
1892 for( const std::pair<const wxString, ENV_VAR_ITEM>& var : vars )
1893 UpdatePythonEnvVar( var.first, var.second.GetValue() );
1894
1895 // Because the env vars can be modified by the python scripts (rewritten in UTF8),
1896 // regenerate them (in Unicode) for our normal environment
1897 for( const std::pair<const wxString, ENV_VAR_ITEM>& var : vars )
1898 wxSetEnv( var.first, var.second.GetValue() );
1899}
1900
1901
1903{
1904 wxString evValue;
1905 wxGetEnv( PROJECT_VAR_NAME, &evValue );
1906 UpdatePythonEnvVar( wxString( PROJECT_VAR_NAME ).ToStdString(), evValue );
1907
1908 // Because PROJECT_VAR_NAME can be modified by the python scripts (rewritten in UTF8),
1909 // regenerate it (in Unicode) for our normal environment
1910 wxSetEnv( PROJECT_VAR_NAME, evValue );
1911}
1912
1913
1915{
1916 if( aFootprint == nullptr )
1917 return;
1918
1920
1921 /*
1922 * Make sure dlg is destroyed before GetCanvas->Refresh is called
1923 * later or the refresh will try to modify its properties since
1924 * they share a GL context.
1925 */
1926 {
1927 DIALOG_FOOTPRINT_PROPERTIES dlg( this, aFootprint );
1928
1929 dlg.ShowModal();
1930 retvalue = dlg.GetReturnValue();
1931 }
1932
1933 /*
1934 * retvalue =
1935 * FP_PROPS_UPDATE_FP to show Update Footprints dialog
1936 * FP_PROPS_CHANGE_FP to show Change Footprints dialog
1937 * FP_PROPS_OK for normal edit
1938 * FP_PROPS_CANCEL if aborted
1939 * FP_PROPS_EDIT_BOARD_FP to load board footprint into Footprint Editor
1940 * FP_PROPS_EDIT_LIBRARY_FP to load library footprint into Footprint Editor
1941 */
1942
1944 {
1945 // If something edited, push a refresh request
1946 GetCanvas()->Refresh();
1947 }
1949 {
1951
1952 editor->LoadFootprintFromBoard( aFootprint );
1953
1954 editor->Show( true );
1955 editor->Raise(); // Iconize( false );
1956 }
1958 {
1960
1961 editor->LoadFootprintFromLibrary( aFootprint->GetFPID() );
1962
1963 editor->Show( true );
1964 editor->Raise(); // Iconize( false );
1965 }
1967 {
1968 ShowExchangeFootprintsDialog( aFootprint, true, true );
1969 }
1971 {
1972 ShowExchangeFootprintsDialog( aFootprint, false, true );
1973 }
1974}
1975
1976
1978 bool aSelectedMode )
1979{
1980 DIALOG_EXCHANGE_FOOTPRINTS dialog( this, aFootprint, aUpdateMode, aSelectedMode );
1981
1982 return dialog.ShowQuasiModal();
1983}
1984
1985
1986namespace {
1987
1988
1989void processTextItem( const FP_TEXT& aSrc, FP_TEXT& aDest,
1990 bool resetText, bool resetTextLayers, bool resetTextEffects,
1991 bool* aUpdated )
1992{
1993 if( resetText )
1994 *aUpdated |= aSrc.GetText() != aDest.GetText();
1995 else
1996 aDest.SetText( aSrc.GetText() );
1997
1998 if( resetTextLayers )
1999 {
2000 *aUpdated |= aSrc.GetLayer() != aDest.GetLayer();
2001 *aUpdated |= aSrc.IsVisible() != aDest.IsVisible();
2002 }
2003 else
2004 {
2005 aDest.SetLayer( aSrc.GetLayer() );
2006 aDest.SetVisible( aSrc.IsVisible() );
2007 }
2008
2009 if( resetTextEffects )
2010 {
2011 *aUpdated |= aSrc.GetHorizJustify() != aDest.GetHorizJustify();
2012 *aUpdated |= aSrc.GetVertJustify() != aDest.GetVertJustify();
2013 *aUpdated |= aSrc.GetTextSize() != aDest.GetTextSize();
2014 *aUpdated |= aSrc.GetTextThickness() != aDest.GetTextThickness();
2015 *aUpdated |= aSrc.GetTextAngle() != aDest.GetTextAngle();
2016 *aUpdated |= aSrc.GetPos0() != aDest.GetPos0();
2017 }
2018 else
2019 {
2020 // Careful: the visible bit and position are also set by SetAttributes()
2021 bool visible = aDest.IsVisible();
2022 aDest.SetAttributes( aSrc );
2023 aDest.SetVisible( visible );
2024 aDest.SetPos0( aSrc.GetPos0() );
2025 }
2026
2027 aDest.SetLocked( aSrc.IsLocked() );
2028}
2029
2030
2031FP_TEXT* getMatchingTextItem( FP_TEXT* aRefItem, FOOTPRINT* aFootprint )
2032{
2033 std::vector<FP_TEXT*> candidates;
2034
2035 for( BOARD_ITEM* item : aFootprint->GraphicalItems() )
2036 {
2037 FP_TEXT* candidate = dyn_cast<FP_TEXT*>( item );
2038
2039 if( candidate && candidate->GetText() == aRefItem->GetText() )
2040 candidates.push_back( candidate );
2041 }
2042
2043 if( candidates.size() == 0 )
2044 return nullptr;
2045
2046 if( candidates.size() == 1 )
2047 return candidates[0];
2048
2049 // Try refining the match by layer
2050 std::vector<FP_TEXT*> candidatesOnSameLayer;
2051
2052 for( FP_TEXT* candidate : candidates )
2053 {
2054 if( candidate->GetLayer() == aRefItem->GetLayer() )
2055 candidatesOnSameLayer.push_back( candidate );
2056 }
2057
2058 if( candidatesOnSameLayer.size() == 1 )
2059 return candidatesOnSameLayer[0];
2060
2061 // Last ditch effort: refine by position
2062 std::vector<FP_TEXT*> candidatesAtSamePos;
2063
2064 for( FP_TEXT* candidate : candidatesOnSameLayer.size() ? candidatesOnSameLayer : candidates )
2065 {
2066 if( candidate->GetPos0() == aRefItem->GetPos0() )
2067 candidatesAtSamePos.push_back( candidate );
2068 }
2069
2070 if( candidatesAtSamePos.size() > 0 )
2071 return candidatesAtSamePos[0];
2072 else if( candidatesOnSameLayer.size() > 0 )
2073 return candidatesOnSameLayer[0];
2074 else
2075 return candidates[0];
2076}
2077
2078
2079}
2080
2081
2083 BOARD_COMMIT& aCommit, bool deleteExtraTexts,
2084 bool resetTextLayers, bool resetTextEffects,
2085 bool resetFabricationAttrs, bool reset3DModels,
2086 bool* aUpdated )
2087{
2088 PCB_GROUP* parentGroup = aExisting->GetParentGroup();
2089 bool dummyBool = false;
2090
2091 if( !aUpdated )
2092 aUpdated = &dummyBool;
2093
2094 if( parentGroup )
2095 {
2096 parentGroup->RemoveItem( aExisting );
2097 parentGroup->AddItem( aNew );
2098 }
2099
2100 aNew->SetParent( GetBoard() );
2101
2102 PlaceFootprint( aNew, false );
2103
2104 // PlaceFootprint will move the footprint to the cursor position, which we don't want. Copy
2105 // the original position across.
2106 aNew->SetPosition( aExisting->GetPosition() );
2107
2108 if( aNew->GetLayer() != aExisting->GetLayer() )
2109 aNew->Flip( aNew->GetPosition(), GetPcbNewSettings()->m_FlipLeftRight );
2110
2111 if( aNew->GetOrientation() != aExisting->GetOrientation() )
2112 aNew->SetOrientation( aExisting->GetOrientation() );
2113
2114 aNew->SetLocked( aExisting->IsLocked() );
2115
2116 // Now transfer the net info from "old" pads to the new footprint
2117 for( PAD* pad : aNew->Pads() )
2118 {
2119 PAD* pad_model = nullptr;
2120
2121 // Pads with no copper are never connected to a net
2122 if( !pad->IsOnCopperLayer() )
2123 {
2124 pad->SetNetCode( NETINFO_LIST::UNCONNECTED );
2125 continue;
2126 }
2127
2128 // Pads with no numbers are never connected to a net
2129 if( pad->GetNumber().IsEmpty() )
2130 {
2131 pad->SetNetCode( NETINFO_LIST::UNCONNECTED );
2132 continue;
2133 }
2134
2135 // Search for a similar pad on a copper layer, to reuse net info
2136 PAD* last_pad = nullptr;
2137
2138 while( true )
2139 {
2140 pad_model = aExisting->FindPadByNumber( pad->GetNumber(), last_pad );
2141
2142 if( !pad_model )
2143 break;
2144
2145 if( pad_model->IsOnCopperLayer() ) // a candidate is found
2146 break;
2147
2148 last_pad = pad_model;
2149 }
2150
2151 if( pad_model )
2152 {
2153 pad->SetLocalRatsnestVisible( pad_model->GetLocalRatsnestVisible() );
2154 pad->SetPinFunction( pad_model->GetPinFunction() );
2155 pad->SetPinType( pad_model->GetPinType() );
2156 }
2157
2158 pad->SetNetCode( pad_model ? pad_model->GetNetCode() : NETINFO_LIST::UNCONNECTED );
2159 }
2160
2161 // Copy reference
2162 processTextItem( aExisting->Reference(), aNew->Reference(),
2163 // never reset reference text
2164 false,
2165 resetTextLayers, resetTextEffects, aUpdated );
2166
2167 // Copy value
2168 processTextItem( aExisting->Value(), aNew->Value(),
2169 // reset value text only when it is a proxy for the footprint ID
2170 // (cf replacing value "MountingHole-2.5mm" with "MountingHole-4.0mm")
2171 aExisting->GetValue() == aExisting->GetFPID().GetLibItemName(),
2172 resetTextLayers, resetTextEffects, aUpdated );
2173
2174 // Copy fields in accordance with the reset* flags
2175 for( BOARD_ITEM* item : aExisting->GraphicalItems() )
2176 {
2177 FP_TEXT* srcItem = dyn_cast<FP_TEXT*>( item );
2178
2179 if( srcItem )
2180 {
2181 FP_TEXT* destItem = getMatchingTextItem( srcItem, aNew );
2182
2183 if( destItem )
2184 {
2185 processTextItem( *srcItem, *destItem, false, resetTextLayers, resetTextEffects,
2186 aUpdated );
2187 }
2188 else if( !deleteExtraTexts )
2189 {
2190 aNew->Add( new FP_TEXT( *srcItem ) );
2191 }
2192 }
2193 }
2194
2195 if( !resetFabricationAttrs )
2196 aNew->SetAttributes( aExisting->GetAttributes() );
2197
2198 // Copy 3D model settings in accordance with the reset* flag
2199 if( !reset3DModels )
2200 aNew->Models() = aExisting->Models(); // Linked list of 3D models.
2201
2202 // Updating other parameters
2203 const_cast<KIID&>( aNew->m_Uuid ) = aExisting->m_Uuid;
2204 aNew->SetProperties( aExisting->GetProperties() );
2205 aNew->SetPath( aExisting->GetPath() );
2206
2207 aCommit.Remove( aExisting );
2208 aCommit.Add( aNew );
2209
2210 aNew->ClearFlags();
2211}
2212
2213
2214void PCB_EDIT_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged )
2215{
2216 PCB_BASE_EDIT_FRAME::CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged );
2217
2219
2220 KIGFX::PCB_VIEW* view = GetCanvas()->GetView();
2221 KIGFX::PCB_PAINTER* painter = static_cast<KIGFX::PCB_PAINTER*>( view->GetPainter() );
2222 KIGFX::PCB_RENDER_SETTINGS* renderSettings = painter->GetSettings();
2223
2224 renderSettings->LoadDisplayOptions( GetDisplayOptions() );
2225
2226 SetElementVisibility( LAYER_RATSNEST, GetPcbNewSettings()->m_Display.m_ShowGlobalRatsnest );
2227
2229
2230 // Netclass definitions could have changed, either by us or by Eeschema, so we need to
2231 // recompile the implicit rules
2232 DRC_TOOL* drcTool = m_toolManager->GetTool<DRC_TOOL>();
2233 WX_INFOBAR* infobar = GetInfoBar();
2234
2235 try
2236 {
2237 drcTool->GetDRCEngine()->InitEngine( GetDesignRulesPath() );
2238
2239 if( infobar->GetMessageType() == WX_INFOBAR::MESSAGE_TYPE::DRC_RULES_ERROR )
2240 infobar->Dismiss();
2241 }
2242 catch( PARSE_ERROR& )
2243 {
2244 wxHyperlinkCtrl* button = new wxHyperlinkCtrl( infobar, wxID_ANY, _( "Edit design rules" ),
2245 wxEmptyString );
2246
2247 button->Bind( wxEVT_COMMAND_HYPERLINK, std::function<void( wxHyperlinkEvent& aEvent )>(
2248 [&]( wxHyperlinkEvent& aEvent )
2249 {
2250 ShowBoardSetupDialog( _( "Custom Rules" ) );
2251 } ) );
2252
2253 infobar->RemoveAllButtons();
2254 infobar->AddButton( button );
2255 infobar->AddCloseButton();
2256 infobar->ShowMessage( _( "Could not compile custom design rules." ), wxICON_ERROR,
2258 }
2259
2262
2263 // Update the environment variables in the Python interpreter
2264 if( aEnvVarsChanged )
2266
2267 Layout();
2268 SendSizeEvent();
2269}
2270
2271
2273{
2275}
2276
2277
2279{
2281}
2282
2283
2284bool ExportBoardToHyperlynx( BOARD* aBoard, const wxFileName& aPath );
2285
2286
2287void PCB_EDIT_FRAME::OnExportHyperlynx( wxCommandEvent& event )
2288{
2289 wxString wildcard = wxT( "*.hyp" );
2290 wxFileName fn = GetBoard()->GetFileName();
2291
2292 fn.SetExt( wxT("hyp") );
2293
2294 wxFileDialog dlg( this, _( "Export Hyperlynx Layout" ), fn.GetPath(), fn.GetFullName(),
2295 wildcard, wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
2296
2297 if( dlg.ShowModal() != wxID_OK )
2298 return;
2299
2300 fn = dlg.GetPath();
2301
2302 // always enforce filename extension, user may not have entered it.
2303 fn.SetExt( wxT( "hyp" ) );
2304
2306}
2307
2308
2310{
2311 return GetBoard()->GetFileName();
2312}
2313
2314
2316{
2317 return m_auimgr.GetPane( wxS( "LayersManager" ) ).IsShown();
2318}
2319
2320
2322{
2323 return m_auimgr.GetPane( wxS( "PropertiesManager" ) ).IsShown();
2324}
2325
2326
2327void PCB_EDIT_FRAME::onSize( wxSizeEvent& aEvent )
2328{
2329 if( IsShown() )
2330 {
2331 // We only need this until the frame is done resizing and the final client size is
2332 // established.
2333 Unbind( wxEVT_SIZE, &PCB_EDIT_FRAME::onSize, this );
2335 }
2336
2337 // Skip() is called in the base class.
2338 EDA_DRAW_FRAME::OnSize( aEvent );
2339}
Class PCBNEW_ACTION_PLUGINS.
@ KEEP_ENDPOINTS_OR_START_DIRECTION
@ KEEP_CENTER_ADJUST_ANGLE_RADIUS
constexpr EDA_IU_SCALE pcbIUScale
Definition: base_units.h:109
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...
Definition: bitmap.cpp:105
@ icon_pcbnew_32
@ icon_pcbnew_16
#define SKIP_SET_DIRTY
Definition: board_commit.h:41
#define SKIP_UNDO
Definition: board_commit.h:39
@ NORMAL
Inactive layers are shown normally (no high-contrast mode)
@ HIDDEN
Inactive layers are hidden.
static TOOL_ACTION toggleGrid
Definition: actions.h:143
static TOOL_ACTION paste
Definition: actions.h:69
static TOOL_ACTION millimetersUnits
Definition: actions.h:149
static TOOL_ACTION togglePolarCoords
Definition: actions.h:152
static TOOL_ACTION copy
Definition: actions.h:68
static TOOL_ACTION pasteSpecial
Definition: actions.h:70
static TOOL_ACTION milsUnits
Definition: actions.h:148
static TOOL_ACTION toggleBoundingBoxes
Definition: actions.h:107
static TOOL_ACTION showSearch
Definition: actions.h:77
static TOOL_ACTION undo
Definition: actions.h:65
static TOOL_ACTION duplicate
Definition: actions.h:72
static TOOL_ACTION inchesUnits
Definition: actions.h:147
static TOOL_ACTION highContrastMode
Definition: actions.h:105
static TOOL_ACTION toggleCursorStyle
Definition: actions.h:104
static TOOL_ACTION measureTool
Definition: actions.h:157
static TOOL_ACTION doDelete
Definition: actions.h:73
static TOOL_ACTION selectionTool
Definition: actions.h:156
static TOOL_ACTION save
Definition: actions.h:51
static TOOL_ACTION zoomFitScreen
Definition: actions.h:98
static TOOL_ACTION redo
Definition: actions.h:66
static TOOL_ACTION deleteTool
Definition: actions.h:74
static TOOL_ACTION zoomTool
Definition: actions.h:101
static TOOL_ACTION cut
Definition: actions.h:67
static TOOL_ACTION gridSetOrigin
Definition: actions.h:140
static TOOL_ACTION selectAll
Definition: actions.h:71
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.
bool m_ShowEventCounters
Shows debugging event counters in various places.
void ApplyLayerPreset(const wxString &aPresetName)
int GetTabIndex() const
Set the current notebook tab.
void UpdateDisplayOptions()
Return a list of the layer presets created by the user.
void OnColorThemeChanged()
Respond to change in OS's DarkMode.
void OnLanguageChanged()
Update the panel contents from the application and board models.
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Definition: app_settings.h:110
Tool responsible for automagic placement of components.
Handles how to draw a screen (a board, a schematic ...)
Definition: base_screen.h:41
int GetPageCount() const
Definition: base_screen.h:72
bool IsContentModified() const
Definition: base_screen.h:60
const wxString & GetPageNumber() const
Definition: base_screen.cpp:71
virtual void Push(const wxString &aMessage=wxT("A commit"), 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 GetLocalRatsnestVisible() const
Container for design settings for a BOARD object.
std::set< wxString > m_DrcExclusions
Handle actions specific to the board editor in PcbNew.
Tool for pcb inspection.
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...
Definition: board_item.h:58
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:180
virtual void SetLocked(bool aLocked)
Definition: board_item.h:254
PCB_GROUP * GetParentGroup() const
Definition: board_item.h:72
virtual bool IsOnLayer(PCB_LAYER_ID aLayer) const
Test to see if this object is on the given layer.
Definition: board_item.h:245
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
Definition: board_item.h:214
virtual bool IsLocked() const
Definition: board_item.cpp:71
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:265
LSET GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
Definition: board.cpp:565
void BuildListOfNets()
Definition: board.h:744
bool IsElementVisible(GAL_LAYER_ID aLayer) const
Test whether a given element category is visible.
Definition: board.cpp:631
void RemoveAllListeners()
Remove all listeners.
Definition: board.cpp:2042
const PAGE_INFO & GetPageSettings() const
Definition: board.h:626
GAL_SET GetVisibleElements() const
Return a set of all the element categories that are visible.
Definition: board.cpp:625
bool BuildConnectivity(PROGRESS_REPORTER *aReporter=nullptr)
Build or rebuild the board connectivity database for the board, especially the list of connected item...
Definition: board.cpp:162
void SynchronizeNetsAndNetClasses(bool aResetTrackAndViaSizes)
Copy NETCLASS info to each NET, based on NET membership in a NETCLASS.
Definition: board.cpp:1524
TITLE_BLOCK & GetTitleBlock()
Definition: board.h:632
const std::map< wxString, wxString > & GetProperties() const
Definition: board.h:332
void SetProject(PROJECT *aProject, bool aReferenceOnly=false)
Link a board to a given project.
Definition: board.cpp:172
const wxString & GetFileName() const
Definition: board.h:302
void SetElementVisibility(GAL_LAYER_ID aLayer, bool aNewState)
Change the visibility of an element category.
Definition: board.cpp:637
void ClearProject()
Definition: board.cpp:206
PROJECT * GetProject() const
Definition: board.h:440
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:682
void UpdateRatsnestExclusions()
Update the visibility flags on the current unconnected ratsnest lines.
Definition: board.cpp:266
void SetColor(int aLayer, const COLOR4D &aColor)
COLOR4D GetColor(int aLayer) const
COMMIT & Remove(EDA_ITEM *aItem)
Notify observers that aItem has been removed.
Definition: commit.h:90
COMMIT & Add(EDA_ITEM *aItem)
Notify observers that aItem has been added.
Definition: commit.h:78
Handle actions that are shared between different applications.
Handles action that are shared between different applications.
Definition: common_tools.h:38
void SetCallback(std::function< void(BOARD_ITEM *)> aCallback)
Function to be called on each found event.
Definition: dialog_find.h:63
bool Show(bool show=true) override
The Show method is overridden to make the search combobox focused by default.
void Preload(const wxString &aFindString)
Definition: dialog_find.cpp:99
void FindNext()
Finds the next item.
Definition: dialog_find.h:71
enum FP_PROPS_RETVALUE GetReturnValue()
A dialog to set the plot options and create plot files in various formats.
Definition: dialog_plot.h:40
int ShowQuasiModal()
Tool responsible for drawing graphical elements like lines, arcs, circles, etc.
Definition: drawing_tool.h:51
std::shared_ptr< DRC_ENGINE > GetDRCEngine()
Definition: drc_tool.h:78
bool IsDRCRunning() const
Check to see if the DRC engine is running the tests.
Definition: drc_tool.h:71
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.
virtual APP_SETTINGS_BASE * config() const
Returns the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
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.
WX_INFOBAR * m_infoBar
wxAuiManager m_auimgr
static wxString GetAutoSaveFilePrefix()
WX_INFOBAR * GetInfoBar()
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.
KIGFX::GAL_DISPLAY_OPTIONS & GetGalDisplayOptions()
Return a reference to the gal rendering options used by GAL for rendering.
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.
virtual wxString GetScreenDesc() const
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.
void OnGridSettings(wxCommandEvent &event)
SEARCH_PANE * m_searchPane
The current canvas type.
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
Update the board display after modifying it by a python script (note: it is automatically called by a...
KIGFX::GAL * GetGAL() const
Return a pointer to the GAL instance used in the panel.
void SetFocus() override
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:85
const KIID m_Uuid
Definition: eda_item.h:492
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:97
void ClearFlags(EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: eda_item.h:141
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:100
Specialization of the wxAuiPaneInfo class for KiCad panels.
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition: eda_text.h:72
const EDA_ANGLE & GetTextAngle() const
Definition: eda_text.h:120
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:87
void SetAttributes(const EDA_TEXT &aSrc)
Set the text attributes from another instance.
Definition: eda_text.cpp:264
virtual bool IsVisible() const
Definition: eda_text.h:136
GR_TEXT_H_ALIGN_T GetHorizJustify() const
Definition: eda_text.h:149
virtual void SetVisible(bool aVisible)
Definition: eda_text.cpp:217
GR_TEXT_V_ALIGN_T GetVertJustify() const
Definition: eda_text.h:152
virtual void SetText(const wxString &aText)
Definition: eda_text.cpp:163
int GetTextThickness() const
Definition: eda_text.h:112
VECTOR2I GetTextSize() const
Definition: eda_text.h:196
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 UndoAvailable()
Create a functor that tests if there are any items in the undo 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 FullscreenCursor()
Create a functor testing if the cursor is full screen in a frame.
The interactive edit tool.
Definition: edit_tool.h:65
ENUM_MAP & Map(T aValue, const wxString &aName)
Definition: property.h:579
static ENUM_MAP< T > & Instance()
Definition: property.h:573
ENUM_MAP & Undefined(T aValue)
Definition: property.h:586
wxPGChoices & Choices()
Definition: property.h:622
Component library viewer main window.
void SetPosition(const VECTOR2I &aPos) override
Definition: footprint.cpp:1670
void SetLocked(bool isLocked) override
Set the #MODULE_is_LOCKED bit in the m_ModuleStatus.
Definition: footprint.h:350
EDA_ANGLE GetOrientation() const
Definition: footprint.h:191
void SetOrientation(const EDA_ANGLE &aNewAngle)
Definition: footprint.cpp:1802
void SetPath(const KIID_PATH &aPath)
Definition: footprint.h:225
void SetAttributes(int aAttributes)
Definition: footprint.h:251
int GetAttributes() const
Definition: footprint.h:250
PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
Definition: footprint.h:200
PADS & Pads()
Definition: footprint.h:170
const LIB_ID & GetFPID() const
Definition: footprint.h:212
bool IsLocked() const override
Definition: footprint.h:340
FP_TEXT & Value()
read/write accessors:
Definition: footprint.h:567
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
Definition: footprint.cpp:567
std::vector< FP_3DMODEL > & Models()
Definition: footprint.h:184
void Flip(const VECTOR2I &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
Definition: footprint.cpp:1586
const wxString & GetValue() const
Definition: footprint.h:547
void SetProperties(const std::map< wxString, wxString > &aProps)
Definition: footprint.h:575
const KIID_PATH & GetPath() const
Definition: footprint.h:224
VECTOR2I GetPosition() const override
Definition: footprint.h:188
DRAWINGS & GraphicalItems()
Definition: footprint.h:173
FP_TEXT & Reference()
Definition: footprint.h:568
PAD * FindPadByNumber(const wxString &aPadNumber, PAD *aSearchAfterMe=nullptr) const
Return a PAD with a matching number.
Definition: footprint.cpp:1174
const std::map< wxString, wxString > & GetProperties() const
Definition: footprint.h:574
const VECTOR2I & GetPos0() const
Definition: fp_text.h:124
void SetPos0(const VECTOR2I &aPos)
Definition: fp_text.h:123
bool Contains(GAL_LAYER_ID aPos)
Definition: layer_ids.h:329
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
Definition: ki_exception.h:76
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:30
virtual const wxString Problem() const
what was the problem?
Definition: exceptions.cpp:46
virtual const wxString Where() const
where did the Problem() occur?
Definition: exceptions.cpp:40
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
Definition: kiface_base.h:93
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
void ReadWindowSettings(WINDOW_SETTINGS &aCfg)
Read GAL config options from application-level config.
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.
Contains methods for drawing PCB-specific items.
Definition: pcb_painter.h:158
virtual PCB_RENDER_SETTINGS * GetSettings() override
Return a pointer to current settings that are going to be used when drawing items.
Definition: pcb_painter.h:163
PCB specific render settings.
Definition: pcb_painter.h:72
void LoadDisplayOptions(const PCB_DISPLAY_OPTIONS &aOptions)
Load settings related to display options (high-contrast mode, full or outline modes for vias/pads/tra...
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1) override
Add a VIEW_ITEM to the view.
Definition: pcb_view.cpp:58
virtual void Remove(VIEW_ITEM *aItem) override
Remove a VIEW_ITEM from the view.
Definition: pcb_view.cpp:75
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.
Definition: view_item.h:77
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:69
double GetScale() const
Definition: view.h:269
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...
Definition: view.cpp:1591
void SetLayerVisible(int aLayer, bool aVisible=true)
Control the visibility of a particular layer.
Definition: view.h:393
bool IsMirroredX() const
Return true if view is flipped across the X axis.
Definition: view.h:243
void UpdateAllItems(int aUpdateFlags)
Update all items in the view according to the given flags.
Definition: view.cpp:1484
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
Definition: view.h:213
void MarkTargetDirty(int aTarget)
Set or clear target 'dirty' flag.
Definition: view.h:617
void UpdateAllItemsConditionally(int aUpdateFlags, std::function< bool(VIEW_ITEM *)> aCondition)
Update items in the view according to the given flags and condition.
Definition: view.cpp:1494
An implementation of class VIEW_CONTROLS for wxWidgets library.
std::unique_ptr< PROF_COUNTER > m_MotionEventCounter
Definition: kiid.h:48
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
Definition: kiway_holder.h:53
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
Definition: kiway_player.h:66
virtual bool OpenProjectFiles(const std::vector< wxString > &aFileList, int aCtl=0)
Open a project or set of files given by aFileList.
Definition: kiway_player.h:118
void OnSockRequestServer(wxSocketEvent &evt)
Definition: eda_dde.cpp:99
void OnSockRequest(wxSocketEvent &evt)
Definition: eda_dde.cpp:69
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition: kiway.h:274
void OnKiCadExit()
Definition: kiway.cpp:668
virtual void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged)
Call CommonSettingsChanged() on all KIWAY_PLAYERs.
Definition: kiway.cpp:575
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:394
virtual void ExpressMail(FRAME_T aDestination, MAIL_T aCommand, std::string &aPayload, wxWindow *aSource=nullptr)
Send aPayload to aDestination from aSource.
Definition: kiway.cpp:491
int SetLayerSelection(int layer)
const UTF8 & GetLibItemName() const
Definition: lib_id.h:102
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
Definition: layer_ids.h:491
LSET is a set of PCB_LAYER_IDs.
Definition: layer_ids.h:530
static LSET AllLayersMask()
Definition: lset.cpp:808
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Return an LSEQ from the union of this LSET and a desired sequence.
Definition: lset.cpp:411
static const wxChar * Name(PCB_LAYER_ID aLayerId)
Return the fixed name association with aLayerId.
Definition: lset.cpp:82
@ MARKER_DRAWING_SHEET
Definition: marker_base.h:55
Tool responsible for adding microwave features to PCBs.
static const int UNCONNECTED
Constant that forces initialization of a netinfo item to the NETINFO_ITEM ORPHANED (typically -1) whe...
Definition: netinfo.h:382
Store information read from a netlist along with the flags used to update the NETLIST in the BOARD.
Definition: pcb_netlist.h:213
Tool relating to pads and pad settings.
Definition: pad_tool.h:37
Definition: pad.h:59
const wxString & GetPinType() const
Definition: pad.h:152
const wxString & GetPinFunction() const
Definition: pad.h:146
bool IsOnCopperLayer() const override
Definition: pad.h:242
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.
Definition: page_info.h:54
DISPLAY_OPTIONS m_Display
EDA_ANGLE m_RotationAngle
ARC_EDIT_MODE m_ArcEditMode
AUI_PANELS m_AuiPanels
Gather all the actions that are shared by tools.
Definition: pcb_actions.h:49
static TOOL_ACTION toggleHV45Mode
Definition: pcb_actions.h:466
static TOOL_ACTION drawRuleArea
Definition: pcb_actions.h:185
static TOOL_ACTION microwaveCreateGap
Definition: pcb_actions.h:455
static TOOL_ACTION placeText
Definition: pcb_actions.h:176
static TOOL_ACTION pointEditorArcKeepCenter
Definition: pcb_actions.h:248
static TOOL_ACTION drawOrthogonalDimension
Definition: pcb_actions.h:181
static TOOL_ACTION drawRectangle
Definition: pcb_actions.h:172
static TOOL_ACTION padDisplayMode
Definition: pcb_actions.h:280
static TOOL_ACTION showRatsnest
Definition: pcb_actions.h:275
static TOOL_ACTION showLayersManager
Definition: pcb_actions.h:389
static TOOL_ACTION toggleNetHighlight
Definition: pcb_actions.h:499
static TOOL_ACTION drawCircle
Definition: pcb_actions.h:173
static TOOL_ACTION routeDiffPair
Activation of the Push and Shove router (differential pair mode)
Definition: pcb_actions.h:211
static TOOL_ACTION placeImage
Definition: pcb_actions.h:175
static TOOL_ACTION layerChanged
Definition: pcb_actions.h:328
static TOOL_ACTION ddAppendBoard
Drag and drop.
Definition: pcb_actions.h:528
static TOOL_ACTION highlightNet
Definition: pcb_actions.h:497
static TOOL_ACTION routerTuneDiffPair
Activation of the Push and Shove router (diff pair tuning mode)
Definition: pcb_actions.h:217
static TOOL_ACTION drawTextBox
Definition: pcb_actions.h:177
static TOOL_ACTION routerHighlightMode
Actions to enable switching modes via hotkey assignments.
Definition: pcb_actions.h:236
static TOOL_ACTION routerWalkaroundMode
Definition: pcb_actions.h:238
static TOOL_ACTION routerShoveMode
Definition: pcb_actions.h:237
static TOOL_ACTION drawZoneCutout
Definition: pcb_actions.h:186
static TOOL_ACTION drawPolygon
Definition: pcb_actions.h:171
static TOOL_ACTION hideNetInRatsnest
Definition: pcb_actions.h:504
static TOOL_ACTION group
Definition: pcb_actions.h:474
static TOOL_ACTION zoneDisplayFilled
Definition: pcb_actions.h:282
static TOOL_ACTION showNetInRatsnest
Definition: pcb_actions.h:505
static TOOL_ACTION drawRadialDimension
Definition: pcb_actions.h:180
static TOOL_ACTION showProperties
Definition: pcb_actions.h:390
static TOOL_ACTION routerTuneDiffPairSkew
Activation of the Push and Shove router (skew tuning mode)
Definition: pcb_actions.h:220
static TOOL_ACTION zoneFill
Definition: pcb_actions.h:343
static TOOL_ACTION viaDisplayMode
Definition: pcb_actions.h:281
static TOOL_ACTION drawLeader
Definition: pcb_actions.h:182
static TOOL_ACTION zoneUnfill
Definition: pcb_actions.h:346
static TOOL_ACTION drillOrigin
Definition: pcb_actions.h:484
static TOOL_ACTION routerTuneSingleTrace
Activation of the Push and Shove router (tune single line mode)
Definition: pcb_actions.h:214
static TOOL_ACTION trackDisplayMode
Definition: pcb_actions.h:279
static TOOL_ACTION microwaveCreateStubArc
Definition: pcb_actions.h:459
static TOOL_ACTION zoneDisplayTriangulated
Definition: pcb_actions.h:285
static TOOL_ACTION ungroup
Definition: pcb_actions.h:475
static TOOL_ACTION selectUnconnected
Select unconnected footprints from ratsnest of selection.
Definition: pcb_actions.h:92
static TOOL_ACTION zoneDisplayFractured
Definition: pcb_actions.h:284
static TOOL_ACTION drawVia
Definition: pcb_actions.h:184
static TOOL_ACTION drawArc
Definition: pcb_actions.h:174
static TOOL_ACTION zoneDuplicate
Duplicate zone onto another layer.
Definition: pcb_actions.h:351
static TOOL_ACTION graphicsOutlines
Display footprint graphics as outlines.
Definition: pcb_actions.h:438
static TOOL_ACTION pluginsReload
Scripting Actions.
Definition: pcb_actions.h:354
static TOOL_ACTION drawSimilarZone
Definition: pcb_actions.h:187
static TOOL_ACTION pointEditorArcKeepEndpoint
Definition: pcb_actions.h:249
static TOOL_ACTION boardSetup
Definition: pcb_actions.h:358
static TOOL_ACTION drawCenterDimension
Definition: pcb_actions.h:179
static TOOL_ACTION selectSameSheet
Select all components on the same sheet as the selected footprint.
Definition: pcb_actions.h:101
static TOOL_ACTION microwaveCreateStub
Definition: pcb_actions.h:457
static TOOL_ACTION selectNet
Select all connections belonging to a single net.
Definition: pcb_actions.h:86
static TOOL_ACTION microwaveCreateLine
Definition: pcb_actions.h:463
static TOOL_ACTION flipBoard
Definition: pcb_actions.h:330
static TOOL_ACTION zoneDisplayOutline
Definition: pcb_actions.h:283
static TOOL_ACTION ratsnestLineMode
Definition: pcb_actions.h:276
static TOOL_ACTION textOutlines
Display texts as lines.
Definition: pcb_actions.h:441
static TOOL_ACTION highlightNetSelection
Definition: pcb_actions.h:500
static TOOL_ACTION microwaveCreateFunctionShape
Definition: pcb_actions.h:461
static TOOL_ACTION zoneMerge
Definition: pcb_actions.h:348
static TOOL_ACTION unlock
Definition: pcb_actions.h:471
static TOOL_ACTION placeFootprint
Definition: pcb_actions.h:190
static TOOL_ACTION routeSingleTrack
Activation of the Push and Shove router.
Definition: pcb_actions.h:208
static TOOL_ACTION deselectNet
Remove all connections belonging to a single net from the active selection.
Definition: pcb_actions.h:89
static TOOL_ACTION showPythonConsole
Definition: pcb_actions.h:391
static TOOL_ACTION drawLine
Definition: pcb_actions.h:170
static TOOL_ACTION localRatsnestTool
Definition: pcb_actions.h:506
static TOOL_ACTION drawAlignedDimension
Definition: pcb_actions.h:178
static TOOL_ACTION drawZone
Definition: pcb_actions.h:183
static TOOL_ACTION selectOnSchematic
Select symbols/pins on schematic corresponding to selected footprints/pads.
Definition: pcb_actions.h:104
static TOOL_ACTION lock
Definition: pcb_actions.h:470
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.
APPEARANCE_CONTROLS * GetAppearancePanel()
APPEARANCE_CONTROLS * m_appearancePanel
PANEL_SELECTION_FILTER * m_selectionFilterPanel
PROPERTIES_PANEL * m_propertiesPanel
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 ...
bool canCloseWindow(wxCloseEvent &aCloseEvent) override
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.
BOARD * GetBoard() const
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Returns the BOARD_DESIGN_SETTINGS for the open project.
virtual void ShowChangedLanguage() override
Redraw the menus and what not in current language.
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)
void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged) override
Notification event that some of the common (suite-wide) settings have changed.
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.
Definition: pcb_control.h:47
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.
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
int TestStandalone(void)
Test if standalone mode.
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 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 SaveProjectSettings() override
Save changes to the project settings to the project (.pro) file.
void RecordDRCExclusions()
Scan existing markers and record data from any that are Excluded.
void SetElementVisibility(GAL_LAYER_ID aElement, bool aNewState)
Change the visibility of an element category.
void OnClearFileHistory(wxCommandEvent &aEvent)
virtual ~PCB_EDIT_FRAME()
void SwitchCanvas(EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType) override
Switch currently used canvas (Cairo / OpenGL).
void FindNext()
Find the next item using our existing search parameters.
BOARD_ITEM_CONTAINER * GetModel() const override
void OnExportSTEP(wxCommandEvent &event)
Export the current BOARD to a STEP assembly.
DIALOG_FIND * m_findDialog
void SetPageSettings(const PAGE_INFO &aPageSettings) override
bool IsElementVisible(GAL_LAYER_ID aElement) const
Test whether a given element category is visible.
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.
bool Clear_Pcb(bool aQuery, bool aFinal=false)
Delete all and reinitialize the current board.
Definition: initpcb.cpp:43
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 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)
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.
void OnRunTeardropTool(wxCommandEvent &event)
run teardrop tool
TOOL_ACTION * m_exportNetlistAction
The export board netlist tool action object.
void ReCreateAuxiliaryToolbar() override
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.
void OnRemoveTeardropTool(wxCommandEvent &event)
Remove all teardrops.
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.
void ExchangeFootprint(FOOTPRINT *aExisting, FOOTPRINT *aNew, BOARD_COMMIT &aCommit, bool deleteExtraTexts=true, bool resetTextLayers=true, bool resetTextEffects=true, bool resetFabricationAttrs=true, bool reset3DModels=true, bool *aUpdated=nullptr)
Replace aExisting footprint by aNew footprint using the Existing footprint settings (position,...
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)
Definition: edit.cpp:47
SELECTION & GetCurrentSelection() override
Get the current selection from the canvas area.
void OnQuit(wxCommandEvent &event)
bool canCloseWindow(wxCloseEvent &aCloseEvent) override
void ResolveDRCExclusions()
Update markers to match recorded exclusions.
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.
void redrawNetnames(wxTimerEvent &aEvent)
static const wxString SearchPaneName()
void OnFileHistory(wxCommandEvent &event)
void ToPlotter(int aID)
Open a dialog frame to create plot and drill files relative to the current board.
A set of BOARD_ITEMs (i.e., without duplicates).
Definition: pcb_group.h:51
bool RemoveItem(BOARD_ITEM *aItem)
Remove item from group.
Definition: pcb_group.cpp:95
bool AddItem(BOARD_ITEM *aItem)
Add item to group.
Definition: pcb_group.cpp:80
Generic tool for picking an item.
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.
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.
The selection tool: currently supports:
void FindItem(BOARD_ITEM *aItem)
Take necessary actions to mark an item as found.
Tool useful for viewing footprints.
The interactive edit tool.
A progress reporter interface for use in multi-threaded environments.
The backing store for a PROJECT, in JSON format.
Definition: project_file.h:65
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
Definition: project.h:155
virtual PROJECT_FILE & GetProjectFile() const
Definition: project.h:149
float SplitterProportion() const
Action handler for the Properties panel.
PNS::PNS_MODE GetRouterMode()
Tool relating to pads and pad settings.
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 SELECTION_CONDITION HasType(KICAD_T aType)
Create a functor that tests if among the selected items there is at least one of a given type.
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.
EDA_ITEM * Front() const
Definition: selection.h:208
int Size() const
Returns the number of selected parts.
Definition: selection.h:115
Is a LINE_READER that reads from a multiline 8 bit wide std::string.
Definition: richio.h:241
TOOL_MANAGER * m_toolManager
Definition: tools_holder.h:170
TOOL_DISPATCHER * m_toolDispatcher
Definition: tools_holder.h:172
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:54
ACTIONS * m_actions
Definition: tools_holder.h:171
Represent a single user action.
Definition: tool_action.h:68
Base abstract interface for all kinds of tools.
Definition: tool_base.h:66
@ MODEL_RELOAD
Model changes (required full reload)
Definition: tool_base.h:80
Generic, UI-independent tool event.
Definition: tool_event.h:156
void SetHasPosition(bool aHasPosition)
Returns if the action associated with this event should be treated as immediate regardless of the cur...
Definition: tool_event.h:244
Master controller class:
Definition: tool_manager.h:55
bool ProcessEvent(const TOOL_EVENT &aEvent)
Propagate an event to tools that requested events of matching type(s).
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:142
bool InvokeTool(TOOL_ID aToolId)
Call a tool by sending a tool activation event to tool of given ID.
ACTION_MANAGER * GetActionManager() const
Definition: tool_manager.h:196
void ResetTools(TOOL_BASE::RESET_REASON aReason)
Reset all tools (i.e.
std::vector< TOOL_BASE * > Tools()
Definition: tool_manager.h:231
void RegisterTool(TOOL_BASE *aTool)
Add a tool to the manager set and sets it up.
void SetEnvironment(EDA_ITEM *aModel, KIGFX::VIEW *aView, KIGFX::VIEW_CONTROLS *aViewControls, APP_SETTINGS_BASE *aSettings, TOOLS_HOLDER *aFrame)
Set the work environment (model, view, view controls and the parent window).
void InitTools()
Initializes all registered tools.
void ShutdownAllTools()
Shutdown all tools with a currently registered event loop in this tool manager by waking them up with...
A modified version of the wxInfoBar class that allows us to:
Definition: wx_infobar.h:75
void RemoveAllButtons()
Remove all the buttons that have been added by the user.
Definition: wx_infobar.cpp:289
@ 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.
Definition: wx_infobar.cpp:279
void ShowMessage(const wxString &aMessage, int aFlags=wxICON_INFORMATION) override
Show the info bar with the provided message and icon.
Definition: wx_infobar.cpp:142
Handle actions specific to filling copper zones.
PROGRESS_REPORTER * GetProgressReporter()
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:300
bool HandleUnsavedChanges(wxWindow *aParent, const wxString &aMessage, const std::function< bool()> &aSaveFunction)
Display a dialog with Save, Cancel and Discard Changes buttons.
Definition: confirm.cpp:260
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition: confirm.cpp:325
This file is part of the common library.
#define DIALOG_DRC_WINDOW_NAME
Definition: dialog_drc.h:41
bool InvokeExportSVG(PCB_EDIT_FRAME *aCaller, BOARD *aBoard)
Function InvokeExportSVG shows the Export SVG dialog.
#define _HKI(x)
#define _(s)
static constexpr EDA_ANGLE & ANGLE_90
Definition: eda_angle.h:414
#define KICAD_DEFAULT_DRAWFRAME_STYLE
#define PCB_EDIT_FRAME_NAME
GERBVIEW_FRAME::OnZipFileHistory GERBVIEW_FRAME::OnSelectDisplayMode EVT_CHOICE(ID_GBR_AUX_TOOLBAR_PCB_APERATTRIBUTES_CHOICE, GERBVIEW_FRAME::OnSelectHighlightChoice) EVT_UPDATE_UI(ID_TOOLBARH_GERBVIEW_SELECT_ACTIVE_LAYER
KiCad executable names.
const wxString EESCHEMA_EXE
EVT_UPDATE_UI(ID_LOAD_FOOTPRINT_FROM_BOARD, FOOTPRINT_EDIT_FRAME::OnUpdateLoadFootprintFromBoard) EVT_UPDATE_UI(ID_ADD_FOOTPRINT_TO_BOARD
@ FRAME_PCB_EDITOR
Definition: frame_type.h:40
@ FRAME_FOOTPRINT_VIEWER_MODAL
Definition: frame_type.h:43
@ FRAME_FOOTPRINT_VIEWER
Definition: frame_type.h:42
@ FRAME_SCH
Definition: frame_type.h:34
@ FRAME_FOOTPRINT_EDITOR
Definition: frame_type.h:41
@ ID_MAIN_MENUBAR
Definition: gerbview_id.h:38
int ExecuteFile(const wxString &aEditorName, const wxString &aFileName, wxProcess *aCallback)
Call the executable file aEditorName with the parameter aFileName.
Definition: gestfich.cpp:115
const std::string LegacyPcbFileExtension
const std::string LegacySchematicFileExtension
const std::string KiCadPcbFileExtension
const std::string KiCadSchematicFileExtension
const wxChar *const traceAutoSave
Flag to enable auto save feature debug tracing.
@ ID_ON_GRID_SELECT
Definition: id.h:145
@ ID_GEN_PLOT_DXF
Definition: id.h:96
@ ID_FILE_LIST_CLEAR
Definition: id.h:87
@ ID_EDA_SOCKET_EVENT
Definition: id.h:164
@ ID_GEN_PLOT_PS
Definition: id.h:92
@ ID_EDA_SOCKET_EVENT_SERV
Definition: id.h:163
@ ID_GEN_PLOT_GERBER
Definition: id.h:94
@ ID_ON_ZOOM_SELECT
Definition: id.h:143
@ ID_GEN_PLOT
Definition: id.h:91
@ ID_GEN_PLOT_SVG
Definition: id.h:95
@ ID_GEN_PLOT_HPGL
Definition: id.h:93
@ ID_FILEMAX
Definition: id.h:85
@ ID_FILE1
Definition: id.h:84
@ ID_GRID_SETTINGS
Definition: id.h:146
@ ID_GEN_PLOT_PDF
Definition: id.h:97
@ ID_AUTO_SAVE_TIMER
Definition: id.h:79
std::map< wxString, ENV_VAR_ITEM > ENV_VAR_MAP
int GetNetnameLayer(int aLayer)
Returns a netname layer corresponding to the given layer.
Definition: layer_ids.h:966
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
Definition: layer_ids.h:190
@ LAYER_GRID
Definition: layer_ids.h:205
@ LAYER_ZONES
Control for copper zone opacity/visibility (color ignored)
Definition: layer_ids.h:231
@ LAYER_RATSNEST
Definition: layer_ids.h:204
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:59
@ F_Paste
Definition: layer_ids.h:101
@ B_Mask
Definition: layer_ids.h:106
@ B_Cu
Definition: layer_ids.h:95
@ F_Mask
Definition: layer_ids.h:107
@ B_Paste
Definition: layer_ids.h:100
@ UNDEFINED_LAYER
Definition: layer_ids.h:60
@ F_Cu
Definition: layer_ids.h:64
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Definition: macros.h:96
@ MAIL_SCH_GET_NETLIST
Definition: mail_type.h:49
@ REPAINT
Item needs to be redrawn.
Definition: view_item.h:52
@ GEOMETRY
Position or shape has changed.
Definition: view_item.h:49
@ ALL
All except INITIAL_ADD.
Definition: view_item.h:53
@ TARGET_NONCACHED
Auxiliary rendering target (noncached)
Definition: definitions.h:49
void SetShutdownBlockReason(wxWindow *aWindow, const wxString &aReason)
Sets the block reason why the window/application is preventing OS shutdown.
Definition: gtk/app.cpp:83
bool SupportsShutdownBlockReason()
Whether or not the window supports setting a shutdown block reason.
Definition: gtk/app.cpp:72
@ RM_MarkObstacles
Ignore collisions, mark obstacles.
@ RM_Walkaround
Only walk around.
@ RM_Shove
Only shove.
@ SMD
Smd pad, appears on the solder paste layer (default)
#define CHECK(x)
#define CURRENT_TOOL(action)
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 ENABLE(x)
#define CURRENT_EDIT_TOOL(action)
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
@ BLIND_BURIED
@ ID_POPUP_PCB_SELECT_WIDTH_START_RANGE
Definition: pcbnew_id.h:25
@ ID_POPUP_PCB_SELECT_WIDTH1
Definition: pcbnew_id.h:29
@ ID_POPUP_PCB_SELECT_VIASIZE8
Definition: pcbnew_id.h:52
@ ID_GEN_EXPORT_FILE_HYPERLYNX
Definition: pcbnew_id.h:88
@ ID_IMPORT_NON_KICAD_BOARD
Definition: pcbnew_id.h:19
@ ID_MENU_RECOVER_BOARD_AUTOSAVE
Definition: pcbnew_id.h:81
@ ID_RUN_TEARDROP_TOOL
Definition: pcbnew_id.h:119
@ ID_AUX_TOOLBAR_PCB_VIA_SIZE
Definition: pcbnew_id.h:22
@ ID_AUX_TOOLBAR_PCB_SELECT_AUTO_WIDTH
Definition: pcbnew_id.h:24
@ ID_PCB_GEN_CMP_FILE
Definition: pcbnew_id.h:93
@ ID_MENU_EXPORT_FOOTPRINTS_TO_NEW_LIBRARY
Definition: pcbnew_id.h:83
@ ID_POPUP_PCB_SELECT_WIDTH_END_RANGE
Definition: pcbnew_id.h:79
@ ID_MENU_EXPORT_FOOTPRINTS_TO_LIBRARY
Definition: pcbnew_id.h:82
@ ID_GEN_EXPORT_FILE_VRML
Definition: pcbnew_id.h:86
@ ID_POPUP_PCB_SELECT_VIASIZE1
Definition: pcbnew_id.h:45
@ ID_REMOVE_TEARDROP_TOOL
Definition: pcbnew_id.h:120
@ ID_GEN_EXPORT_FILE_STEP
Definition: pcbnew_id.h:87
@ ID_TOOLBARH_PCB_SELECT_LAYER
Definition: pcbnew_id.h:96
@ ID_GEN_EXPORT_FILE_IDF3
Definition: pcbnew_id.h:85
@ ID_AUX_TOOLBAR_PCB_TRACK_WIDTH
Definition: pcbnew_id.h:23
@ ID_GEN_EXPORT_FILE_GENCADFORMAT
Definition: pcbnew_id.h:89
void Refresh()
Update the board display after modifying it by a python script (note: it is automatically called by a...
@ SHOW_WITH_VIA_ALWAYS
see class PGM_BASE
#define PROJECT_VAR_NAME
A variable name whose value holds the current project directory.
Definition: project.h:39
LAST_PATH_TYPE
For storing PcbNew MRU paths of various types.
Definition: project_file.h:47
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
@ RPT_SEVERITY_EXCLUSION
std::function< bool(const SELECTION &)> SELECTION_CONDITION
< Functor type that checks a specific condition for selected items.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:111
const int scale
const double IU_PER_MILS
Definition: base_units.h:78
A filename or source description, a problem input line, a line number, a byte offset,...
Definition: ki_exception.h:119
TRACK_CLEARANCE_MODE m_TrackClearance
@ AS_GLOBAL
Global action (toolbar/main menu event, global shortcut)
Definition: tool_action.h:45
@ AS_ACTIVE
All active tools.
Definition: tool_action.h:44
@ TA_MODEL_CHANGE
Definition: tool_event.h:116
@ TC_COMMAND
Definition: tool_event.h:52
wxLogTrace helper definitions.
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:102
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
Definition: typeinfo.h:115
@ PCB_ZONE_T
class ZONE, a copper pour area
Definition: typeinfo.h:112
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
Definition: typeinfo.h:90
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
Definition: typeinfo.h:86
@ PCB_FP_ZONE_T
class ZONE, managed by a footprint
Definition: typeinfo.h:100
@ PCB_PAD_T
class PAD, a pad in a footprint
Definition: typeinfo.h:87
@ PCB_FP_TEXT_T
class FP_TEXT, text in a footprint
Definition: typeinfo.h:92
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
Definition: typeinfo.h:103
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:101
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.