KiCad PCB EDA Suite
board_editor_control.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) 2014 CERN
5 * Copyright (C) 2014-2022 KiCad Developers, see AUTHORS.txt for contributors.
6 * @author Maciej Suminski <[email protected]>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, you may find one here:
20 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21 * or you may search the http://www.gnu.org website for the version 2 license,
22 * or you may write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 */
25
26#include <functional>
27#include <memory>
28
29#include <pgm_base.h>
30#include <advanced_config.h>
32#include <bitmaps.h>
33#include <pcb_painter.h>
34#include <board.h>
35#include <board_commit.h>
37#include <pcb_group.h>
38#include <footprint.h>
39#include <pad.h>
40#include <pcb_target.h>
41#include <pcb_track.h>
42#include <zone.h>
43#include <pcb_marker.h>
44#include <confirm.h>
48#include <kiface_base.h>
49#include <kiway.h>
51#include <origin_viewitem.h>
52#include <pcb_edit_frame.h>
53#include <pcbnew_id.h>
54#include <project.h>
55#include <project/project_file.h> // LAST_PATH_TYPE
56#include <tool/tool_manager.h>
57#include <tool/tool_event.h>
58#include <tools/drawing_tool.h>
59#include <tools/pcb_actions.h>
62#include <tools/edit_tool.h>
64#include <router/router_tool.h>
65#include <view/view_controls.h>
66#include <view/view_group.h>
70#include <wx/filedlg.h>
71#include <wx/log.h>
72
74
75using namespace std::placeholders;
76
77
79{
80public:
82 ACTION_MENU( true )
83 {
85 SetTitle( _( "Zones" ) );
86
91
92 AppendSeparator();
93
98 }
99
100protected:
101 ACTION_MENU* create() const override
102 {
103 return new ZONE_CONTEXT_MENU();
104 }
105};
106
107
109{
110public:
112 ACTION_MENU( true )
113 {
115 SetTitle( _( "Locking" ) );
116
120 }
121
122 ACTION_MENU* create() const override
123 {
124 return new LOCK_CONTEXT_MENU();
125 }
126};
127
128
130 PCB_TOOL_BASE( "pcbnew.EditorControl" ),
131 m_frame( nullptr ),
132 m_inPlaceFootprint( false ),
133 m_placingFootprint( false ),
134 m_inPlaceTarget( false )
135{
136 m_placeOrigin = std::make_unique<KIGFX::ORIGIN_VIEWITEM>( KIGFX::COLOR4D( 0.8, 0.0, 0.0, 1.0 ),
138}
139
140
142{
143}
144
145
147{
148 m_frame = getEditFrame<PCB_EDIT_FRAME>();
149
150 if( aReason == MODEL_RELOAD || aReason == GAL_SWITCH )
151 {
152 m_placeOrigin->SetPosition( getModel<BOARD>()->GetDesignSettings().GetAuxOrigin() );
153 getView()->Remove( m_placeOrigin.get() );
154 getView()->Add( m_placeOrigin.get() );
155 }
156}
157
158
160{
161 auto activeToolCondition =
162 [this]( const SELECTION& aSel )
163 {
164 return ( !m_frame->ToolStackIsEmpty() );
165 };
166
167 auto inactiveStateCondition =
168 [this]( const SELECTION& aSel )
169 {
170 return ( m_frame->ToolStackIsEmpty() && aSel.Size() == 0 );
171 };
172
173 auto placeModuleCondition =
174 [this]( const SELECTION& aSel )
175 {
176 return m_frame->IsCurrentTool( PCB_ACTIONS::placeFootprint ) && aSel.GetSize() == 0;
177 };
178
179 auto& ctxMenu = m_menu.GetMenu();
180
181 // "Cancel" goes at the top of the context menu when a tool is active
182 ctxMenu.AddItem( ACTIONS::cancelInteractive, activeToolCondition, 1 );
183 ctxMenu.AddSeparator( 1 );
184
185 // "Get and Place Footprint" should be available for Place Footprint tool
186 ctxMenu.AddItem( PCB_ACTIONS::getAndPlace, placeModuleCondition, 1000 );
187 ctxMenu.AddSeparator( 1000 );
188
189 // Finally, add the standard zoom & grid items
190 getEditFrame<PCB_BASE_FRAME>()->AddStandardSubMenus( m_menu );
191
192 auto zoneMenu = std::make_shared<ZONE_CONTEXT_MENU>();
193 zoneMenu->SetTool( this );
194
195 auto lockMenu = std::make_shared<LOCK_CONTEXT_MENU>();
196 lockMenu->SetTool( this );
197
198 // Add the PCB control menus to relevant other tools
199
201
202 if( selTool )
203 {
204 TOOL_MENU& toolMenu = selTool->GetToolMenu();
205 CONDITIONAL_MENU& menu = toolMenu.GetMenu();
206
207 // Add "Get and Place Footprint" when Selection tool is in an inactive state
208 menu.AddItem( PCB_ACTIONS::getAndPlace, inactiveStateCondition );
209 menu.AddSeparator();
210
211 toolMenu.RegisterSubMenu( zoneMenu );
212 toolMenu.RegisterSubMenu( lockMenu );
213
214 menu.AddMenu( lockMenu.get(), SELECTION_CONDITIONS::NotEmpty, 100 );
215
216 menu.AddMenu( zoneMenu.get(), SELECTION_CONDITIONS::OnlyTypes( { PCB_ZONE_T } ), 200 );
217 }
218
219 DRAWING_TOOL* drawingTool = m_toolMgr->GetTool<DRAWING_TOOL>();
220
221 if( drawingTool )
222 {
223 TOOL_MENU& toolMenu = drawingTool->GetToolMenu();
224 CONDITIONAL_MENU& menu = toolMenu.GetMenu();
225
226 toolMenu.RegisterSubMenu( zoneMenu );
227
228 // Functor to say if the PCB_EDIT_FRAME is in a given mode
229 // Capture the tool pointer and tool mode by value
230 auto toolActiveFunctor =
231 [=]( DRAWING_TOOL::MODE aMode )
232 {
233 return [=]( const SELECTION& sel )
234 {
235 return drawingTool->GetDrawingMode() == aMode;
236 };
237 };
238
239 menu.AddMenu( zoneMenu.get(), toolActiveFunctor( DRAWING_TOOL::MODE::ZONE ), 200 );
240 }
241
242 return true;
243}
244
245
247{
249 return 0;
250}
251
252
254{
256 return 0;
257}
258
259
261{
263 return 0;
264}
265
266
268{
270 return 0;
271}
272
273
275{
277 return 0;
278}
279
280
282{
284 return 0;
285}
286
287
289{
290 PICKED_ITEMS_LIST undoCmd;
292 ITEM_PICKER wrapper( nullptr, undoItem, UNDO_REDO::PAGESETTINGS );
293
294 undoCmd.PushItem( wrapper );
296
300
301 if( dlg.ShowModal() == wxID_OK )
302 {
304 [&]( KIGFX::VIEW_ITEM* aItem ) -> bool
305 {
306 BOARD_ITEM* item = dynamic_cast<BOARD_ITEM*>( aItem );
307
308 if( !item )
309 return false;
310
311 switch( item->Type() )
312 {
313 case PCB_TEXT_T:
314 case PCB_FP_TEXT_T:
315 return true; // text variables
316
317 default:
318 return false;
319 }
320 } );
321
322 m_frame->OnModify();
323 }
324 else
325 {
327 }
328
329 return 0;
330}
331
332
334{
336 return 0;
337}
338
339
341{
343 return 0;
344}
345
346
348{
350 return 0;
351}
352
353
355{
356 m_frame->FindNext();
357 return 0;
358}
359
360
362{
363 getEditFrame<PCB_EDIT_FRAME>()->ShowBoardSetupDialog();
364 return 0;
365}
366
367
369{
370 getEditFrame<PCB_EDIT_FRAME>()->InstallNetlistFrame();
371 return 0;
372}
373
374
376{
377 wxString fullFileName = frame()->GetBoard()->GetFileName();
378 wxString path;
379 wxString name;
380 wxString ext;
381
382 wxFileName::SplitPath( fullFileName, &path, &name, &ext );
383 name += wxT( "." ) + SpecctraSessionFileExtension;
384
385 fullFileName = wxFileSelector( _( "Specctra Session File" ), path, name,
386 wxT( "." ) + SpecctraSessionFileExtension,
387 SpecctraSessionFileWildcard(), wxFD_OPEN | wxFD_CHANGE_DIR,
388 frame() );
389
390 if( !fullFileName.IsEmpty() )
391 getEditFrame<PCB_EDIT_FRAME>()->ImportSpecctraSession( fullFileName );
392
393 return 0;
394}
395
396
398{
399 wxString fullFileName = m_frame->GetLastPath( LAST_PATH_SPECCTRADSN );
400 wxFileName fn;
401
402 if( fullFileName.IsEmpty() )
403 {
404 fn = m_frame->GetBoard()->GetFileName();
405 fn.SetExt( SpecctraDsnFileExtension );
406 }
407 else
408 {
409 fn = fullFileName;
410 }
411
412 fullFileName = wxFileSelector( _( "Specctra DSN File" ), fn.GetPath(), fn.GetFullName(),
414 wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxFD_CHANGE_DIR, frame() );
415
416 if( !fullFileName.IsEmpty() )
417 {
418 m_frame->SetLastPath( LAST_PATH_SPECCTRADSN, fullFileName );
419 getEditFrame<PCB_EDIT_FRAME>()->ExportSpecctraFile( fullFileName );
420 }
421
422 return 0;
423}
424
425
427{
428 wxCHECK( m_frame, 0 );
429
430 wxFileName fn = m_frame->Prj().GetProjectFullName();
431
432 // Use a different file extension for the board netlist so the schematic netlist file
433 // is accidentally overwritten.
434 fn.SetExt( wxT( "pcb_net" ) );
435
436 wxFileDialog dlg( m_frame, _( "Export Board Netlist" ), fn.GetPath(), fn.GetFullName(),
437 _( "KiCad board netlist files" ) + AddFileExtListToFilter( { "pcb_net" } ),
438 wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
439
440 dlg.SetExtraControlCreator( &LEGACYFILEDLG_NETLIST_OPTIONS::Create );
441
442 if( dlg.ShowModal() == wxID_CANCEL )
443 return 0;
444
445 fn = dlg.GetPath();
446
447 if( !fn.IsDirWritable() )
448 {
449 wxString msg;
450
451 msg.Printf( _( "Path `%s` is read only." ), fn.GetPath() );
452 wxMessageDialog( m_frame, msg, _( "I/O Error" ), wxOK | wxCENTER | wxICON_EXCLAMATION );
453 return 0;
454 }
455
457 dynamic_cast<const LEGACYFILEDLG_NETLIST_OPTIONS*>( dlg.GetExtraControl() );
458 wxCHECK( noh, 0 );
459
461
462 for( const FOOTPRINT* footprint : board()->Footprints() )
463 {
466 { footprint->m_Uuid } );
467
468 for( const PAD* pad : footprint->Pads() )
469 {
470 const wxString& netname = pad->GetShortNetname();
471
472 if( !netname.IsEmpty() )
473 {
474 component->AddNet( pad->GetNumber(), netname, pad->GetPinFunction(),
475 pad->GetPinType() );
476 }
477 }
478
479 netlist.AddComponent( component );
480 }
481
482 FILE_OUTPUTFORMATTER formatter( fn.GetFullPath() );
483
484 netlist.Format( "pcb_netlist", &formatter, 0, noh->GetNetlistOptions() );
485
486 return 0;
487}
488
489
491{
492 wxCommandEvent dummy;
493
496 else if( aEvent.IsAction( &PCB_ACTIONS::generateReportFile ) )
498 else if( aEvent.IsAction( &PCB_ACTIONS::generateD356File ) )
500 else if( aEvent.IsAction( &PCB_ACTIONS::generateBOM ) )
502 else
503 wxFAIL_MSG( wxT( "GenerateFabFiles(): unexpected request" ) );
504
505 return 0;
506}
507
508
510{
511 int errors = 0;
512 wxString details;
513 bool quiet = aEvent.Parameter<bool>();
514
515 // Repair duplicate IDs and missing nets.
516 std::set<KIID> ids;
517 int duplicates = 0;
518
519 auto processItem =
520 [&]( EDA_ITEM* aItem )
521 {
522 if( ids.count( aItem->m_Uuid ) )
523 {
524 duplicates++;
525 const_cast<KIID&>( aItem->m_Uuid ) = KIID();
526 }
527
528 ids.insert( aItem->m_Uuid );
529
530 BOARD_CONNECTED_ITEM* cItem = dynamic_cast<BOARD_CONNECTED_ITEM*>( aItem );
531
532 if( cItem && cItem->GetNetCode() )
533 {
534 NETINFO_ITEM* netinfo = cItem->GetNet();
535
536 if( netinfo && !board()->FindNet( netinfo->GetNetname() ) )
537 {
538 board()->Add( netinfo );
539
540 details += wxString::Format( _( "Orphaned net %s re-parented.\n" ),
541 netinfo->GetNetname() );
542 errors++;
543 }
544 }
545 };
546
547 // Footprint IDs are the most important, so give them the first crack at "claiming" a
548 // particular KIID.
549
550 for( FOOTPRINT* footprint : board()->Footprints() )
551 processItem( footprint );
552
553 // After that the principal use is for DRC marker pointers, which are most likely to pads
554 // or tracks.
555
556 for( FOOTPRINT* footprint : board()->Footprints() )
557 {
558 for( PAD* pad : footprint->Pads() )
559 processItem( pad );
560 }
561
562 for( PCB_TRACK* track : board()->Tracks() )
563 processItem( track );
564
565 // From here out I don't think order matters much.
566
567 for( FOOTPRINT* footprint : board()->Footprints() )
568 {
569 processItem( &footprint->Reference() );
570 processItem( &footprint->Value() );
571
572 for( BOARD_ITEM* item : footprint->GraphicalItems() )
573 processItem( item );
574
575 for( ZONE* zone : footprint->Zones() )
576 processItem( zone );
577
578 for( PCB_GROUP* group : footprint->Groups() )
579 processItem( group );
580 }
581
582 for( BOARD_ITEM* drawing : board()->Drawings() )
583 processItem( drawing );
584
585 for( ZONE* zone : board()->Zones() )
586 processItem( zone );
587
588 for( PCB_MARKER* marker : board()->Markers() )
589 processItem( marker );
590
591 for( PCB_GROUP* group : board()->Groups() )
592 processItem( group );
593
594 if( duplicates )
595 {
596 errors += duplicates;
597 details += wxString::Format( _( "%d duplicate IDs replaced.\n" ), duplicates );
598 }
599
600 /*******************************
601 * Your test here
602 */
603
604 /*******************************
605 * Inform the user
606 */
607
608 if( errors )
609 {
610 m_frame->OnModify();
611
612 wxString msg = wxString::Format( _( "%d potential problems repaired." ), errors );
613
614 if( !quiet )
615 DisplayInfoMessage( m_frame, msg, details );
616 }
617 else if( !quiet )
618 {
619 DisplayInfoMessage( m_frame, _( "No board problems found." ) );
620 }
621
622 return 0;
623}
624
625
627{
629
630 if( m_frame->FetchNetlistFromSchematic( netlist, _( "Updating PCB requires a fully annotated "
631 "schematic." ) ) )
632 {
633 DIALOG_UPDATE_PCB updateDialog( m_frame, &netlist );
634 updateDialog.ShowModal();
635 }
636
637 return 0;
638}
639
641{
642 if( Kiface().IsSingle() )
643 {
644 DisplayErrorMessage( m_frame, _( "Cannot update schematic because Pcbnew is opened in "
645 "stand-alone mode. In order to create or update PCBs "
646 "from schematics, you must launch the KiCad project "
647 "manager and create a project." ) );
648 return 0;
649 }
650
653
654 if( frame )
655 {
656 std::string payload;
657
658 if( wxWindow* blocking_win = frame->Kiway().GetBlockingDialog() )
659 blocking_win->Close( true );
660
662 }
663 return 0;
664}
665
666
668{
670 return 0;
671}
672
673
675{
676 getEditFrame<PCB_EDIT_FRAME>()->ToggleLayersManager();
677 return 0;
678}
679
680
682{
683 getEditFrame<PCB_EDIT_FRAME>()->ToggleProperties();
684 return 0;
685}
686
687
689{
690 getEditFrame<PCB_EDIT_FRAME>()->ToggleSearch();
691 return 0;
692}
693
694
696{
698 return 0;
699}
700
701
702// Track & via size control
704{
705 BOARD_DESIGN_SETTINGS& designSettings = getModel<BOARD>()->GetDesignSettings();
707
709 && SELECTION_CONDITIONS::OnlyTypes( { PCB_TRACE_T, PCB_ARC_T, PCB_VIA_T } )( selection ) )
710 {
711 BOARD_COMMIT commit( this );
712
713 for( EDA_ITEM* item : selection )
714 {
715 if( item->IsType( { PCB_TRACE_T, PCB_ARC_T } ) )
716 {
717 PCB_TRACK* track = static_cast<PCB_TRACK*>( item );
718
719 // Note: skip first entry which is the current netclass value
720 for( int i = 1; i < (int) designSettings.m_TrackWidthList.size(); ++i )
721 {
722 int candidate = designSettings.m_TrackWidthList[ i ];
723
724 if( candidate > track->GetWidth() )
725 {
726 commit.Modify( track );
727 track->SetWidth( candidate );
728 break;
729 }
730 }
731 }
732 }
733
734 commit.Push( wxT( "Increase Track Width" ) );
735 return 0;
736 }
737
738 ROUTER_TOOL* routerTool = m_toolMgr->GetTool<ROUTER_TOOL>();
739
740 if( routerTool && routerTool->IsToolActive()
741 && routerTool->Router()->Mode() == PNS::PNS_MODE_ROUTE_DIFF_PAIR )
742 {
743 int widthIndex = designSettings.GetDiffPairIndex() + 1;
744
745 // If we go past the last track width entry in the list, start over at the beginning
746 if( widthIndex >= (int) designSettings.m_DiffPairDimensionsList.size() )
747 widthIndex = 0;
748
749 designSettings.SetDiffPairIndex( widthIndex );
750 designSettings.UseCustomDiffPairDimensions( false );
751
753 }
754 else
755 {
756 int widthIndex = designSettings.GetTrackWidthIndex();
757
758 if( routerTool && routerTool->IsToolActive()
759 && routerTool->Router()->GetState() == PNS::ROUTER::RouterState::ROUTE_TRACK
760 && designSettings.m_UseConnectedTrackWidth && !designSettings.m_TempOverrideTrackWidth )
761 {
762 designSettings.m_TempOverrideTrackWidth = true;
763 }
764 else
765 {
766 widthIndex++;
767 }
768
769 // If we go past the last track width entry in the list, start over at the beginning
770 if( widthIndex >= (int) designSettings.m_TrackWidthList.size() )
771 widthIndex = 0;
772
773 designSettings.SetTrackWidthIndex( widthIndex );
774 designSettings.UseCustomTrackViaSize( false );
775
777 }
778
779 return 0;
780}
781
782
784{
785 BOARD_DESIGN_SETTINGS& designSettings = getModel<BOARD>()->GetDesignSettings();
787
789 && SELECTION_CONDITIONS::OnlyTypes( { PCB_TRACE_T, PCB_ARC_T, PCB_VIA_T } )( selection ) )
790 {
791 BOARD_COMMIT commit( this );
792
793 for( EDA_ITEM* item : selection )
794 {
795 if( item->IsType( { PCB_TRACE_T, PCB_ARC_T } ) )
796 {
797 PCB_TRACK* track = static_cast<PCB_TRACK*>( item );
798
799 // Note: skip first entry which is the current netclass value
800 for( int i = designSettings.m_TrackWidthList.size() - 1; i >= 1; --i )
801 {
802 int candidate = designSettings.m_TrackWidthList[ i ];
803
804 if( candidate < track->GetWidth() )
805 {
806 commit.Modify( track );
807 track->SetWidth( candidate );
808 break;
809 }
810 }
811 }
812 }
813
814 commit.Push( wxT( "Decrease Track Width" ) );
815 return 0;
816 }
817
818 ROUTER_TOOL* routerTool = m_toolMgr->GetTool<ROUTER_TOOL>();
819
820 if( routerTool && routerTool->IsToolActive()
821 && routerTool->Router()->Mode() == PNS::PNS_MODE_ROUTE_DIFF_PAIR )
822 {
823 int widthIndex = designSettings.GetDiffPairIndex() - 1;
824
825 // If we get to the lowest entry start over at the highest
826 if( widthIndex < 0 )
827 widthIndex = designSettings.m_DiffPairDimensionsList.size() - 1;
828
829 designSettings.SetDiffPairIndex( widthIndex );
830 designSettings.UseCustomDiffPairDimensions( false );
831
833 }
834 else
835 {
836 int widthIndex = designSettings.GetTrackWidthIndex();
837
838 if( routerTool && routerTool->IsToolActive()
839 && routerTool->Router()->GetState() == PNS::ROUTER::RouterState::ROUTE_TRACK
840 && designSettings.m_UseConnectedTrackWidth && !designSettings.m_TempOverrideTrackWidth )
841 {
842 designSettings.m_TempOverrideTrackWidth = true;
843 }
844 else
845 {
846 widthIndex--;
847 }
848
849 // If we get to the lowest entry start over at the highest
850 if( widthIndex < 0 )
851 widthIndex = designSettings.m_TrackWidthList.size() - 1;
852
853 designSettings.SetTrackWidthIndex( widthIndex );
854 designSettings.UseCustomTrackViaSize( false );
855
857 }
858
859 return 0;
860}
861
862
864{
865 BOARD_DESIGN_SETTINGS& designSettings = getModel<BOARD>()->GetDesignSettings();
867
869 && SELECTION_CONDITIONS::OnlyTypes( { PCB_TRACE_T, PCB_ARC_T, PCB_VIA_T } )( selection ) )
870 {
871 BOARD_COMMIT commit( this );
872
873 for( EDA_ITEM* item : selection )
874 {
875 if( item->Type() == PCB_VIA_T )
876 {
877 PCB_VIA* via = static_cast<PCB_VIA*>( item );
878
879 for( VIA_DIMENSION candidate : designSettings.m_ViasDimensionsList )
880 {
881 if( candidate.m_Diameter > via->GetWidth() )
882 {
883 commit.Modify( via );
884 via->SetWidth( candidate.m_Diameter );
885 via->SetDrill( candidate.m_Drill );
886 break;
887 }
888 }
889 }
890 }
891
892 commit.Push( wxT( "Increase Via Size" ) );
893 }
894 else
895 {
896 int sizeIndex = designSettings.GetViaSizeIndex() + 1;
897
898 // If we go past the last via entry in the list, start over at the beginning
899 if( sizeIndex >= (int) designSettings.m_ViasDimensionsList.size() )
900 sizeIndex = 0;
901
902 designSettings.SetViaSizeIndex( sizeIndex );
903 designSettings.UseCustomTrackViaSize( false );
904
906 }
907
908 return 0;
909}
910
911
913{
914 BOARD_DESIGN_SETTINGS& designSettings = getModel<BOARD>()->GetDesignSettings();
916
918 && SELECTION_CONDITIONS::OnlyTypes( { PCB_TRACE_T, PCB_ARC_T, PCB_VIA_T } )( selection ) )
919 {
920 BOARD_COMMIT commit( this );
921
922 for( EDA_ITEM* item : selection )
923 {
924 if( item->Type() == PCB_VIA_T )
925 {
926 PCB_VIA* via = static_cast<PCB_VIA*>( item );
927
928 for( int i = designSettings.m_ViasDimensionsList.size() - 1; i >= 0; --i )
929 {
930 VIA_DIMENSION candidate = designSettings.m_ViasDimensionsList[ i ];
931
932 if( candidate.m_Diameter < via->GetWidth() )
933 {
934 commit.Modify( via );
935 via->SetWidth( candidate.m_Diameter );
936 via->SetDrill( candidate.m_Drill );
937 break;
938 }
939 }
940 }
941 }
942
943 commit.Push( "Decrease Via Size" );
944 }
945 else
946 {
947 int sizeIndex = 0; // Assume we only have a single via size entry
948
949 // If there are more, cycle through them backwards
950 if( designSettings.m_ViasDimensionsList.size() > 0 )
951 {
952 sizeIndex = designSettings.GetViaSizeIndex() - 1;
953
954 // If we get to the lowest entry start over at the highest
955 if( sizeIndex < 0 )
956 sizeIndex = designSettings.m_ViasDimensionsList.size() - 1;
957 }
958
959 designSettings.SetViaSizeIndex( sizeIndex );
960 designSettings.UseCustomTrackViaSize( false );
961
963 }
964
965 return 0;
966}
967
968
970{
972 return 0;
973
975
976 FOOTPRINT* fp = aEvent.Parameter<FOOTPRINT*>();
977 bool fromOtherCommand = fp != nullptr;
979 BOARD_COMMIT commit( m_frame );
980 BOARD* board = getModel<BOARD>();
981 COMMON_SETTINGS* common_settings = Pgm().GetCommonSettings();
982
984
985 m_frame->PushTool( aEvent );
986
987 auto setCursor =
988 [&]()
989 {
991 };
992
993 auto cleanup =
994 [&] ()
995 {
997 commit.Revert();
998
999 if( fromOtherCommand )
1000 {
1002
1003 if( undo )
1004 {
1006 undo->ClearListAndDeleteItems();
1007 delete undo;
1008 }
1009 }
1010
1011 fp = nullptr;
1012 m_placingFootprint = false;
1013 };
1014
1015 Activate();
1016 // Must be done after Activate() so that it gets set into the correct context
1017 controls->ShowCursor( true );
1018 // Set initial cursor
1019 setCursor();
1020
1021 VECTOR2I cursorPos = controls->GetCursorPosition();
1022 bool ignorePrimePosition = false;
1023 bool reselect = false;
1024
1025 // Prime the pump
1026 if( fp )
1027 {
1028 m_placingFootprint = true;
1029 fp->SetPosition( cursorPos );
1032 }
1033 else if( aEvent.HasPosition() )
1034 {
1035 m_toolMgr->PrimeTool( aEvent.Position() );
1036 }
1037 else if( common_settings->m_Input.immediate_actions && !aEvent.IsReactivate() )
1038 {
1039 m_toolMgr->PrimeTool( { 0, 0 } );
1040 ignorePrimePosition = true;
1041 }
1042
1043 // Main loop: keep receiving events
1044 while( TOOL_EVENT* evt = Wait() )
1045 {
1046 setCursor();
1047 cursorPos = controls->GetCursorPosition( !evt->DisableGridSnapping() );
1048
1049 if( reselect && fp )
1051
1052 if( evt->IsCancelInteractive() )
1053 {
1054 if( fp )
1055 {
1056 cleanup();
1057 }
1058 else
1059 {
1060 m_frame->PopTool( aEvent );
1061 break;
1062 }
1063 }
1064 else if( evt->IsActivate() )
1065 {
1066 if( fp )
1067 cleanup();
1068
1069 if( evt->IsMoveTool() )
1070 {
1071 // leave ourselves on the stack so we come back after the move
1072 break;
1073 }
1074 else
1075 {
1076 frame()->PopTool( aEvent );
1077 break;
1078 }
1079 }
1080 else if( evt->IsClick( BUT_LEFT ) )
1081 {
1082 if( !fp )
1083 {
1084 // Pick the footprint to be placed
1086
1087 if( fp == nullptr )
1088 continue;
1089
1090 // If we started with a hotkey which has a position then warp back to that.
1091 // Otherwise update to the current mouse position pinned inside the autoscroll
1092 // boundaries.
1093 if( evt->IsPrime() && !ignorePrimePosition )
1094 {
1095 cursorPos = evt->Position();
1096 getViewControls()->WarpMouseCursor( cursorPos, true );
1097 }
1098 else
1099 {
1101 cursorPos = getViewControls()->GetMousePosition();
1102 }
1103
1104 m_placingFootprint = true;
1105
1106 fp->SetLink( niluuid );
1107
1108 fp->SetFlags(IS_NEW ); // whatever
1109
1110 // Set parent so that clearance can be loaded
1111 fp->SetParent( board );
1112
1113 for( PAD* pad : fp->Pads() )
1114 {
1115 pad->SetLocalRatsnestVisible( m_frame->GetPcbNewSettings()->m_Display.m_ShowGlobalRatsnest );
1116
1117 // Pads in the library all have orphaned nets. Replace with Default.
1118 pad->SetNetCode( 0 );
1119 }
1120
1121 // Put it on FRONT layer,
1122 // (Can be stored flipped if the lib is an archive built from a board)
1123 if( fp->IsFlipped() )
1125
1126 fp->SetOrientation( ANGLE_0 );
1127 fp->SetPosition( cursorPos );
1128
1129 commit.Add( fp );
1131
1133 }
1134 else
1135 {
1137 commit.Push( _( "Place a footprint" ) );
1138 fp = nullptr; // to indicate that there is no footprint that we currently modify
1139 m_placingFootprint = false;
1140 }
1141 }
1142 else if( evt->IsClick( BUT_RIGHT ) )
1143 {
1145 }
1146 else if( fp && ( evt->IsMotion() || evt->IsAction( &ACTIONS::refreshPreview ) ) )
1147 {
1148 fp->SetPosition( cursorPos );
1149 selection().SetReferencePoint( cursorPos );
1150 getView()->Update( &selection() );
1151 getView()->Update( fp );
1152 }
1153 else if( fp && evt->IsAction( &PCB_ACTIONS::properties ) )
1154 {
1155 // Calling 'Properties' action clears the selection, so we need to restore it
1156 reselect = true;
1157 }
1158 else
1159 {
1160 evt->SetPassEvent();
1161 }
1162
1163 // Enable autopanning and cursor capture only when there is a footprint to be placed
1164 controls->SetAutoPan( fp != nullptr );
1165 controls->CaptureCursor( fp != nullptr );
1166 }
1167
1168 controls->SetAutoPan( false );
1169 controls->CaptureCursor( false );
1171
1172 return 0;
1173}
1174
1175
1177{
1178 return modifyLockSelected( TOGGLE );
1179}
1180
1181
1183{
1184 return modifyLockSelected( ON );
1185}
1186
1187
1189{
1190 return modifyLockSelected( OFF );
1191}
1192
1193
1195{
1197 const PCB_SELECTION& selection = selTool->GetSelection();
1198 BOARD_COMMIT commit( m_frame );
1199
1200 if( selection.Empty() )
1202
1203 // Resolve TOGGLE mode
1204 if( aMode == TOGGLE )
1205 {
1206 aMode = ON;
1207
1208 for( EDA_ITEM* item : selection )
1209 {
1210 BOARD_ITEM* board_item = static_cast<BOARD_ITEM*>( item );
1211
1212 if( board_item->IsLocked() )
1213 {
1214 aMode = OFF;
1215 break;
1216 }
1217 }
1218 }
1219
1220 bool modified = false;
1221
1222 for( EDA_ITEM* item : selection )
1223 {
1224 BOARD_ITEM* board_item = static_cast<BOARD_ITEM*>( item );
1225
1226 commit.Modify( board_item );
1227
1228 if( aMode == ON )
1229 {
1230 modified |= !board_item->IsLocked();
1231 board_item->SetLocked( true );
1232 }
1233 else
1234 {
1235 modified |= board_item->IsLocked();
1236 board_item->SetLocked( false );
1237 }
1238 }
1239
1240 if( modified )
1241 {
1242 commit.Push( aMode == ON ? _( "Lock" ) : _( "Unlock" ) );
1243
1246 m_frame->OnModify();
1247 }
1248
1249 return 0;
1250}
1251
1252
1253static bool mergeZones( EDA_DRAW_FRAME* aFrame, BOARD_COMMIT& aCommit,
1254 std::vector<ZONE*>& aOriginZones, std::vector<ZONE*>& aMergedZones )
1255{
1256 aCommit.Modify( aOriginZones[0] );
1257
1258 for( unsigned int i = 1; i < aOriginZones.size(); i++ )
1259 {
1260 aOriginZones[0]->Outline()->BooleanAdd( *aOriginZones[i]->Outline(),
1262 }
1263
1264 aOriginZones[0]->Outline()->Simplify( SHAPE_POLY_SET::PM_FAST );
1265
1266 // We should have one polygon, possibly with holes. If we end up with two polygons (either
1267 // because the intersection was a single point or because the intersection was within one of
1268 // the zone's holes) then we can't merge.
1269 if( aOriginZones[0]->Outline()->IsSelfIntersecting()
1270 || aOriginZones[0]->Outline()->OutlineCount() > 1 )
1271 {
1272 DisplayErrorMessage( aFrame, _( "Zones have insufficient overlap for merging." ) );
1273 aCommit.Revert();
1274 return false;
1275 }
1276
1277 for( unsigned int i = 1; i < aOriginZones.size(); i++ )
1278 aCommit.Remove( aOriginZones[i] );
1279
1280 aMergedZones.push_back( aOriginZones[0] );
1281
1282 aOriginZones[0]->SetLocalFlags( 1 );
1283 aOriginZones[0]->HatchBorder();
1284 aOriginZones[0]->CacheTriangulation();
1285
1286 return true;
1287}
1288
1289
1291{
1292 const PCB_SELECTION& selection = m_toolMgr->GetTool<PCB_SELECTION_TOOL>()->GetSelection();
1293 BOARD* board = getModel<BOARD>();
1294 BOARD_COMMIT commit( m_frame );
1295
1296 if( selection.Size() < 2 )
1297 return 0;
1298
1299 int netcode = -1;
1300
1301 ZONE* firstZone = nullptr;
1302 std::vector<ZONE*> toMerge, merged;
1303
1304 for( EDA_ITEM* item : selection )
1305 {
1306 ZONE* curr_area = dynamic_cast<ZONE*>( item );
1307
1308 if( !curr_area )
1309 continue;
1310
1311 if( !firstZone )
1312 firstZone = curr_area;
1313
1314 netcode = curr_area->GetNetCode();
1315
1316 if( firstZone->GetNetCode() != netcode )
1317 {
1318 wxLogMessage( _( "Some zone netcodes did not match and were not merged." ) );
1319 continue;
1320 }
1321
1322 if( curr_area->GetAssignedPriority() != firstZone->GetAssignedPriority() )
1323 {
1324 wxLogMessage( _( "Some zone priorities did not match and were not merged." ) );
1325 continue;
1326 }
1327
1328 if( curr_area->GetIsRuleArea() != firstZone->GetIsRuleArea() )
1329 {
1330 wxLogMessage( _( "Some zones were rule areas and were not merged." ) );
1331 continue;
1332 }
1333
1334 if( curr_area->GetLayerSet() != firstZone->GetLayerSet() )
1335 {
1336 wxLogMessage( _( "Some zone layer sets did not match and were not merged." ) );
1337 continue;
1338 }
1339
1340 bool intersects = curr_area == firstZone;
1341
1342 for( ZONE* candidate : toMerge )
1343 {
1344 if( intersects )
1345 break;
1346
1347 if( board->TestZoneIntersection( curr_area, candidate ) )
1348 intersects = true;
1349 }
1350
1351 if( !intersects )
1352 {
1353 wxLogMessage( _( "Some zones did not intersect and were not merged." ) );
1354 continue;
1355 }
1356
1357 toMerge.push_back( curr_area );
1358 }
1359
1361
1362 if( !toMerge.empty() )
1363 {
1364 if( mergeZones( m_frame, commit, toMerge, merged ) )
1365 {
1366 commit.Push( wxT( "Merge zones" ) );
1367
1368 for( EDA_ITEM* item : merged )
1370 }
1371 }
1372
1373 return 0;
1374}
1375
1376
1378{
1380 const PCB_SELECTION& selection = selTool->GetSelection();
1381
1382 // because this pops up the zone editor, it would be confusing to handle multiple zones,
1383 // so just handle single selections containing exactly one zone
1384 if( selection.Size() != 1 )
1385 return 0;
1386
1387 ZONE* oldZone = dyn_cast<ZONE*>( selection[0] );
1388
1389 if( !oldZone )
1390 return 0;
1391
1392 ZONE_SETTINGS zoneSettings;
1393 zoneSettings << *oldZone;
1394 int dialogResult;
1395
1396 if( oldZone->GetIsRuleArea() )
1397 dialogResult = InvokeRuleAreaEditor( m_frame, &zoneSettings );
1398 else if( oldZone->IsOnCopperLayer() )
1399 dialogResult = InvokeCopperZonesEditor( m_frame, &zoneSettings );
1400 else
1401 dialogResult = InvokeNonCopperZonesEditor( m_frame, &zoneSettings );
1402
1403 if( dialogResult != wxID_OK )
1404 return 0;
1405
1406 // duplicate the zone
1407 BOARD_COMMIT commit( m_frame );
1408
1409 std::unique_ptr<ZONE> newZone = std::make_unique<ZONE>( *oldZone );
1410 newZone->ClearSelected();
1411 newZone->UnFill();
1412 zoneSettings.ExportSetting( *newZone );
1413
1414 // If the new zone is on the same layer(s) as the initial zone,
1415 // offset it a bit so it can more easily be picked.
1416 if( oldZone->GetIsRuleArea() && ( oldZone->GetLayerSet() == zoneSettings.m_Layers ) )
1417 newZone->Move( wxPoint( pcbIUScale.IU_PER_MM, pcbIUScale.IU_PER_MM ) );
1418 else if( !oldZone->GetIsRuleArea() && zoneSettings.m_Layers.test( oldZone->GetLayer() ) )
1419 newZone->Move( wxPoint( pcbIUScale.IU_PER_MM, pcbIUScale.IU_PER_MM ) );
1420
1421 commit.Add( newZone.release() );
1422 commit.Push( _( "Duplicate zone" ) );
1423
1424 return 0;
1425}
1426
1427
1429{
1430 doCrossProbePcbToSch( aEvent, false );
1431
1432 return 0;
1433}
1434
1435
1437{
1438 doCrossProbePcbToSch( aEvent, true );
1439
1440 return 0;
1441}
1442
1443
1445{
1446 // Don't get in an infinite loop PCB -> SCH -> PCB -> SCH -> ...
1448 return;
1449
1451 const PCB_SELECTION& selection = selTool->GetSelection();
1452 EDA_ITEM* focusItem = nullptr;
1453
1454 if( aEvent.Matches( EVENTS::PointSelectedEvent ) )
1455 focusItem = selection.GetLastAddedItem();
1456
1457 m_frame->SendSelectItemsToSch( selection.GetItems(), focusItem, aForce );
1458
1459 // Update 3D viewer highlighting
1461}
1462
1463
1465{
1467
1468 const PCB_SELECTION& selection = selectionTool->RequestSelection(
1469 []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool )
1470 {
1471 // Iterate from the back so we don't have to worry about removals.
1472 for( int i = aCollector.GetCount() - 1; i >= 0; --i )
1473 {
1474 if( !dynamic_cast<BOARD_CONNECTED_ITEM*>( aCollector[ i ] ) )
1475 aCollector.Remove( aCollector[ i ] );
1476 }
1477 },
1478 true /* prompt user regarding locked items */ );
1479
1480 intptr_t netCode = -1;
1481 wxString netName;
1482
1483 for( EDA_ITEM* item : selection )
1484 {
1485 NETINFO_ITEM* net = static_cast<BOARD_CONNECTED_ITEM*>( item )->GetNet();
1486
1487 if( !net->HasAutoGeneratedNetname() )
1488 {
1489 netCode = net->GetNetCode();
1490 netName = net->GetNetname();
1491 break;
1492 }
1493 }
1494
1495 if( netName.IsEmpty() )
1496 {
1497 m_frame->ShowInfoBarError( _( "Selection contains no items with labeled nets." ) );
1498 return 0;
1499 }
1500
1501 selectionTool->ClearSelection();
1502 m_toolMgr->RunAction( PCB_ACTIONS::selectNet, true, (void*) netCode );
1503 canvas()->ForceRefresh();
1504
1505 DIALOG_ASSIGN_NETCLASS dlg( m_frame, netName, board()->GetNetClassAssignmentCandidates(),
1506 [this]( const std::vector<wxString>& aNetNames )
1507 {
1509 selTool->ClearSelection();
1510
1511 for( const wxString& curr_netName : aNetNames )
1512 {
1513 int curr_netCode = board()->GetNetInfo().GetNetItem( curr_netName )->GetNetCode();
1514
1515 if( curr_netCode > 0 )
1516 selTool->SelectAllItemsOnNet( curr_netCode );
1517 }
1518
1519 canvas()->ForceRefresh();
1520 } );
1521
1522 dlg.ShowModal();
1523
1524 return 0;
1525}
1526
1527
1529{
1532
1533 if( selection.Empty() )
1534 return 0;
1535
1537
1538 if( !fp )
1539 return 0;
1540
1541 PCB_BASE_EDIT_FRAME* editFrame = getEditFrame<PCB_BASE_EDIT_FRAME>();
1542
1543 auto editor = (FOOTPRINT_EDIT_FRAME*) editFrame->Kiway().Player( FRAME_FOOTPRINT_EDITOR, true );
1544
1546 editor->LoadFootprintFromBoard( fp );
1547 else if( aEvent.IsAction( &PCB_ACTIONS::editLibFpInFpEditor ) )
1548 editor->LoadFootprintFromLibrary( fp->GetFPID() );
1549
1550 editor->Show( true );
1551 editor->Raise(); // Iconize( false );
1552
1553 if( selection.IsHover() )
1555
1556 return 0;
1557}
1558
1559
1561 EDA_ITEM* originViewItem, const VECTOR2D& aPosition )
1562{
1563 aFrame->GetDesignSettings().SetAuxOrigin( wxPoint( aPosition ) );
1564 originViewItem->SetPosition( aPosition );
1565 aView->MarkDirty();
1566 aFrame->OnModify();
1567}
1568
1569
1571{
1573
1574 // Deactivate other tools; particularly important if another PICKER is currently running
1575 Activate();
1576
1577 picker->SetClickHandler(
1578 [this] ( const VECTOR2D& pt ) -> bool
1579 {
1582 return false; // drill origin is a one-shot; don't continue with tool
1583 } );
1584
1586
1587 return 0;
1588}
1589
1590
1592{
1601
1605
1611
1612 if( ADVANCED_CFG::GetCfg().m_ShowPcbnewExportNetlist && m_frame &&
1615
1617 PCB_ACTIONS::generateDrillFiles.MakeEvent() );
1621 PCB_ACTIONS::generateReportFile.MakeEvent() );
1624
1625 // Track & via size control
1630
1631 // Zone actions
1634
1635 // Placing tools
1638
1641
1642 // Cross-select
1648
1649 // Other
1653
1655
1657 ACTIONS::updatePcbFromSchematic.MakeEvent() );
1659 ACTIONS::updateSchematicFromPcb.MakeEvent() );
1666}
1667
1668
1669const int BOARD_EDITOR_CONTROL::WIDTH_STEP = 100000;
const char * name
Definition: DXF_plotter.cpp:56
constexpr EDA_IU_SCALE pcbIUScale
Definition: base_units.h:109
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
static bool mergeZones(EDA_DRAW_FRAME *aFrame, BOARD_COMMIT &aCommit, std::vector< ZONE * > &aOriginZones, std::vector< ZONE * > &aMergedZones)
static TOOL_ACTION updatePcbFromSchematic
Definition: actions.h:166
static TOOL_ACTION cancelInteractive
Definition: actions.h:63
static TOOL_ACTION revert
Definition: actions.h:55
static TOOL_ACTION saveAs
Definition: actions.h:52
static TOOL_ACTION pickerTool
Definition: actions.h:158
static TOOL_ACTION plot
Definition: actions.h:58
static TOOL_ACTION open
Definition: actions.h:50
static TOOL_ACTION findNext
Definition: actions.h:80
static TOOL_ACTION pageSettings
Definition: actions.h:56
static TOOL_ACTION showSearch
Definition: actions.h:77
static TOOL_ACTION save
Definition: actions.h:51
static TOOL_ACTION updateSchematicFromPcb
Definition: actions.h:167
static TOOL_ACTION doNew
Definition: actions.h:47
static TOOL_ACTION saveCopy
Definition: actions.h:53
static TOOL_ACTION refreshPreview
Definition: actions.h:109
static TOOL_ACTION find
Definition: actions.h:78
Defines the structure of a menu based on ACTIONs.
Definition: action_menu.h:49
void SetTitle(const wxString &aTitle) override
Set title for the menu.
Definition: action_menu.cpp:87
void SetIcon(BITMAPS aIcon)
Assign an icon for the entry.
Definition: action_menu.cpp:73
wxMenuItem * Add(const wxString &aLabel, int aId, BITMAPS aIcon)
Add a wxWidgets-style entry to the menu.
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
static wxString m_DrawingSheetFileName
the name of the drawing sheet file, or empty to use the default drawing sheet
Definition: base_screen.h:85
virtual void Revert() override
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,...
NETINFO_ITEM * GetNet() const
Return #NET_INFO object for a given item.
Container for design settings for a BOARD object.
void UseCustomTrackViaSize(bool aEnabled)
Enables/disables custom track/via size settings.
void SetDiffPairIndex(unsigned aIndex)
std::vector< DIFF_PAIR_DIMENSION > m_DiffPairDimensionsList
void SetTrackWidthIndex(unsigned aIndex)
Set the current track width list index to aIndex.
void SetAuxOrigin(const VECTOR2I &aOrigin)
void SetViaSizeIndex(unsigned aIndex)
Set the current via size list index to aIndex.
unsigned GetTrackWidthIndex() const
unsigned GetViaSizeIndex() const
void UseCustomDiffPairDimensions(bool aEnabled)
Enables/disables custom differential pair dimensions.
std::vector< int > m_TrackWidthList
unsigned GetDiffPairIndex() const
std::vector< VIA_DIMENSION > m_ViasDimensionsList
int ExportNetlist(const TOOL_EVENT &aEvent)
int UnlockSelected(const TOOL_EVENT &aEvent)
Run the drill origin tool for setting the origin for drill and pick-and-place files.
int Save(const TOOL_EVENT &aEvent)
int ImportNetlist(const TOOL_EVENT &aEvent)
int GenerateDrillFiles(const TOOL_EVENT &aEvent)
int ZoneMerge(const TOOL_EVENT &aEvent)
Duplicate a zone onto a layer (prompts for new layer)
int CrossProbeToSch(const TOOL_EVENT &aEvent)
Equivalent to the above, but initiated by the user.
int TogglePythonConsole(const TOOL_EVENT &aEvent)
static void DoSetDrillOrigin(KIGFX::VIEW *aView, PCB_BASE_FRAME *aFrame, EDA_ITEM *aItem, const VECTOR2D &aPoint)
int UpdatePCBFromSchematic(const TOOL_EVENT &aEvent)
std::unique_ptr< KIGFX::ORIGIN_VIEWITEM > m_placeOrigin
int ShowEeschema(const TOOL_EVENT &aEvent)
int SaveAs(const TOOL_EVENT &aEvent)
int AssignNetclass(const TOOL_EVENT &aEvent)
int UpdateSchematicFromPCB(const TOOL_EVENT &aEvent)
int ExplicitCrossProbeToSch(const TOOL_EVENT &aEvent)
Assign a netclass to a labelled net.
int ToggleSearch(const TOOL_EVENT &aEvent)
int DrillOrigin(const TOOL_EVENT &aEvent)
Low-level access (below undo) to setting the drill origin.
MODIFY_MODE
< How to modify a property for selected items.
int GenerateFabFiles(const TOOL_EVENT &aEvent)
int ViaSizeDec(const TOOL_EVENT &aEvent)
void Reset(RESET_REASON aReason) override
Bring the tool to a known, initial state.
int RepairBoard(const TOOL_EVENT &aEvent)
int ZoneDuplicate(const TOOL_EVENT &aEvent)
int ToggleLayersManager(const TOOL_EVENT &aEvent)
int ImportSpecctraSession(const TOOL_EVENT &aEvent)
bool Init() override
Init() is called once upon a registration of the tool.
int PlaceFootprint(const TOOL_EVENT &aEvent)
Display a dialog to select a footprint to be added and allows the user to set its position.
int BoardSetup(const TOOL_EVENT &aEvent)
int modifyLockSelected(MODIFY_MODE aMode)
Set up handlers for various events.
void setTransitions() override
This method is meant to be overridden in order to specify handlers for events.
int TrackWidthInc(const TOOL_EVENT &aEvent)
static const int WIDTH_STEP
How does line width change after one -/+ key press.
int ToggleLockSelected(const TOOL_EVENT &aEvent)
Lock selected items.
int LockSelected(const TOOL_EVENT &aEvent)
Unlock selected items.
int PageSettings(const TOOL_EVENT &aEvent)
int ExportSpecctraDSN(const TOOL_EVENT &aEvent)
int FindNext(const TOOL_EVENT &aEvent)
int ViaSizeInc(const TOOL_EVENT &aEvent)
int New(const TOOL_EVENT &aEvent)
int Find(const TOOL_EVENT &aEvent)
void doCrossProbePcbToSch(const TOOL_EVENT &aEvent, bool aForce)
int Plot(const TOOL_EVENT &aEvent)
int TrackWidthDec(const TOOL_EVENT &aEvent)
int Revert(const TOOL_EVENT &aEvent)
int Search(const TOOL_EVENT &aEvent)
int Open(const TOOL_EVENT &aEvent)
int SaveCopy(const TOOL_EVENT &aEvent)
int GeneratePosFile(const TOOL_EVENT &aEvent)
int EditFpInFpEditor(const TOOL_EVENT &aEvent)
Notify Eeschema about selected items.
int ToggleProperties(const TOOL_EVENT &aEvent)
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:50
virtual void SetLocked(bool aLocked)
Definition: board_item.h:241
virtual bool IsLocked() const
Definition: board_item.cpp:65
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:265
const NETINFO_LIST & GetNetInfo() const
Definition: board.h:763
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
Definition: board.cpp:686
NETINFO_ITEM * FindNet(int aNetcode) const
Search for a net with the given netcode.
Definition: board.cpp:1392
const wxString & GetFileName() const
Definition: board.h:302
bool TestZoneIntersection(ZONE *aZone1, ZONE *aZone2)
Test for intersection of 2 copper areas.
int GetCount() const
Return the number of objects in the list.
Definition: collector.h:81
void Remove(int aIndex)
Remove the item at aIndex (first position is 0).
Definition: collector.h:109
COMMIT & Modify(EDA_ITEM *aItem)
Create an undo entry for an item that has been already modified.
Definition: commit.h:103
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
Store all of the related footprint information found in a netlist.
Definition: pcb_netlist.h:85
void AddNet(const wxString &aPinName, const wxString &aNetName, const wxString &aPinFunction, const wxString &aPinType)
Definition: pcb_netlist.h:103
void AddItem(const TOOL_ACTION &aAction, const SELECTION_CONDITION &aCondition, int aOrder=ANY_ORDER)
Add a menu entry to run a TOOL_ACTION on selected items.
void AddSeparator(int aOrder=ANY_ORDER)
Add a separator to the menu.
void AddMenu(ACTION_MENU *aMenu, const SELECTION_CONDITION &aCondition=SELECTION_CONDITIONS::ShowAlways, int aOrder=ANY_ORDER)
Add a submenu to the menu.
void SetWksFileName(const wxString &aFilename)
Tool responsible for drawing graphical elements like lines, arcs, circles, etc.
Definition: drawing_tool.h:51
MODE GetDrawingMode() const
Return the current drawing mode of the DRAWING_TOOL or #MODE::NONE if not currently in any drawing mo...
virtual PICKED_ITEMS_LIST * PopCommandFromUndoList()
Return the last command to undo and remove it from list, nothing is deleted.
void ShowInfoBarError(const wxString &aErrorMsg, bool aShowCloseButton=false, WX_INFOBAR::MESSAGE_TYPE aType=WX_INFOBAR::MESSAGE_TYPE::GENERIC)
Show the WX_INFOBAR displayed on the top of the canvas with a message and an error icon on the left o...
The base class for create windows for drawing purpose.
void ScriptingConsoleEnableDisable()
Toggles the scripting console visibility.
virtual void UpdateMsgPanel()
Redraw the message panel.
void ForceRefresh()
Force a redraw.
void SetCurrentCursor(KICURSOR aCursor)
Set the current cursor shape for this panel.
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:85
virtual void SetPosition(const VECTOR2I &aPos)
Definition: eda_item.h:250
void SetFlags(EDA_ITEM_FLAGS aMask)
Definition: eda_item.h:142
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:97
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:100
static void FootprintFilter(const VECTOR2I &, GENERAL_COLLECTOR &aCollector, PCB_SELECTION_TOOL *sTool)
A selection filter which prunes the selection to contain only items of type #PCB_MODULE_T.
Definition: edit_tool.cpp:2036
static const TOOL_EVENT ClearedEvent
Selected item had a property changed (except movement)
Definition: actions.h:207
static const TOOL_EVENT SelectedEvent
Definition: actions.h:205
static const TOOL_EVENT PointSelectedEvent
Definition: actions.h:204
static const TOOL_EVENT UnselectedEvent
Definition: actions.h:206
Used for text file output.
Definition: richio.h:457
void SetPosition(const VECTOR2I &aPos) override
Definition: footprint.cpp:1636
void SetLink(const KIID &aLink)
Definition: footprint.h:630
void SetOrientation(const EDA_ANGLE &aNewAngle)
Definition: footprint.cpp:1766
FP_GROUPS & Groups()
Definition: footprint.h:183
bool IsFlipped() const
Definition: footprint.h:319
PADS & Pads()
Definition: footprint.h:174
const LIB_ID & GetFPID() const
Definition: footprint.h:207
FP_TEXT & Value()
read/write accessors:
Definition: footprint.h:555
void Flip(const VECTOR2I &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
Definition: footprint.cpp:1553
const wxString & GetValue() const
Definition: footprint.h:541
const wxString & GetReference() const
Definition: footprint.h:519
const KIID_PATH & GetPath() const
Definition: footprint.h:219
FP_ZONES & Zones()
Definition: footprint.h:180
VECTOR2I GetPosition() const override
Definition: footprint.h:192
DRAWINGS & GraphicalItems()
Definition: footprint.h:177
FP_TEXT & Reference()
Definition: footprint.h:556
Used when the right click button is pressed, or when the select tool is in effect.
Definition: collectors.h:204
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
An interface for classes handling user events controlling the view behavior such as zooming,...
virtual void CaptureCursor(bool aEnabled)
Force the cursor to stay within the drawing panel area.
virtual void ShowCursor(bool aEnabled)
Enable or disables display of cursor.
virtual void WarpMouseCursor(const VECTOR2D &aPosition, bool aWorldCoordinates=false, bool aWarpView=false)=0
If enabled (.
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.
virtual VECTOR2D GetMousePosition(bool aWorldCoordinates=true) const =0
Return the current mouse pointer position.
virtual void SetAutoPan(bool aEnabled)
Turn on/off auto panning (this feature is used when there is a tool active (eg.
virtual void PinCursorInsideNonAutoscrollArea(bool aWarpMouseCursor)=0
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
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
Definition: view.cpp:316
virtual void Remove(VIEW_ITEM *aItem)
Remove a VIEW_ITEM from the view.
Definition: view.cpp:346
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:1574
void MarkDirty()
Force redraw of view on the next rendering.
Definition: view.h:641
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:1488
Definition: kiid.h:47
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 KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:394
wxWindow * GetBlockingDialog()
Gets the window pointer to the blocking dialog (to send it signals)
Definition: kiway.cpp:617
virtual void ExpressMail(FRAME_T aDestination, MAIL_T aCommand, std::string &aPayload, wxWindow *aSource=nullptr)
Send aPayload to aDestination from aSource.
Definition: kiway.cpp:488
Helper widget to add controls to a wxFileDialog to set netlist configuration options.
static wxWindow * Create(wxWindow *aParent)
ACTION_MENU * create() const override
< Return an instance of this class. It has to be overridden in inheriting classes.
Handle the data for a net.
Definition: netinfo.h:66
bool HasAutoGeneratedNetname()
Definition: netinfo.h:129
const wxString & GetNetname() const
Definition: netinfo.h:119
int GetNetCode() const
Definition: netinfo.h:113
NETINFO_ITEM * GetNetItem(int aNetCode) const
Store information read from a netlist along with the flags used to update the NETLIST in the BOARD.
Definition: pcb_netlist.h:213
Definition: pad.h:58
DISPLAY_OPTIONS m_Display
static TOOL_ACTION generateBOM
Definition: pcb_actions.h:373
static TOOL_ACTION zoneFillAll
Definition: pcb_actions.h:336
static TOOL_ACTION showLayersManager
Definition: pcb_actions.h:381
static TOOL_ACTION trackWidthDec
Definition: pcb_actions.h:326
static TOOL_ACTION generateDrillFiles
Definition: pcb_actions.h:369
static TOOL_ACTION selectionCursor
Select a single item under the cursor position.
Definition: pcb_actions.h:56
static TOOL_ACTION generateD356File
Definition: pcb_actions.h:372
static TOOL_ACTION trackViaSizeChanged
Definition: pcb_actions.h:330
static TOOL_ACTION exportSpecctraDSN
Definition: pcb_actions.h:366
static TOOL_ACTION trackWidthInc
Definition: pcb_actions.h:325
static TOOL_ACTION getAndPlace
Find an item and start moving.
Definition: pcb_actions.h:506
static TOOL_ACTION drawZoneCutout
Definition: pcb_actions.h:182
static TOOL_ACTION viaSizeDec
Definition: pcb_actions.h:328
static TOOL_ACTION showProperties
Definition: pcb_actions.h:382
static TOOL_ACTION zoneFill
Definition: pcb_actions.h:335
static TOOL_ACTION properties
Activation of the edit tool.
Definition: pcb_actions.h:145
static TOOL_ACTION editFpInFpEditor
Definition: pcb_actions.h:378
static TOOL_ACTION selectionClear
Clear the current selection.
Definition: pcb_actions.h:59
static TOOL_ACTION toggleLock
Definition: pcb_actions.h:461
static TOOL_ACTION viaSizeInc
Definition: pcb_actions.h:327
static TOOL_ACTION zoneUnfill
Definition: pcb_actions.h:338
static TOOL_ACTION generatePosFile
Definition: pcb_actions.h:370
static TOOL_ACTION drillOrigin
Definition: pcb_actions.h:476
static TOOL_ACTION assignNetClass
Definition: pcb_actions.h:332
static TOOL_ACTION repairBoard
Definition: pcb_actions.h:482
static TOOL_ACTION generateGerbers
Definition: pcb_actions.h:368
static TOOL_ACTION generateReportFile
Definition: pcb_actions.h:371
static TOOL_ACTION zoneDuplicate
Duplicate zone onto another layer.
Definition: pcb_actions.h:343
static TOOL_ACTION importNetlist
Definition: pcb_actions.h:363
static TOOL_ACTION drawSimilarZone
Definition: pcb_actions.h:183
static TOOL_ACTION boardSetup
Definition: pcb_actions.h:350
static TOOL_ACTION showEeschema
Definition: pcb_actions.h:479
static TOOL_ACTION zoneUnfillAll
Definition: pcb_actions.h:339
static TOOL_ACTION selectItem
Select an item (specified as the event parameter).
Definition: pcb_actions.h:62
static TOOL_ACTION selectNet
Select all connections belonging to a single net.
Definition: pcb_actions.h:86
static TOOL_ACTION editLibFpInFpEditor
Definition: pcb_actions.h:379
static TOOL_ACTION zoneMerge
Definition: pcb_actions.h:340
static TOOL_ACTION unlock
Definition: pcb_actions.h:463
static TOOL_ACTION placeFootprint
Definition: pcb_actions.h:186
static TOOL_ACTION showPythonConsole
Definition: pcb_actions.h:383
static TOOL_ACTION importSpecctraSession
Definition: pcb_actions.h:365
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:462
Common, abstract interface for edit frames.
void SaveCopyInUndoList(EDA_ITEM *aItemToCopy, UNDO_REDO aTypeCommand) override
Create a new entry in undo list of commands.
Definition: undo_redo.cpp:300
void RollbackFromUndo()
Perform an undo of the last edit without logging a corresponding redo.
Definition: undo_redo.cpp:604
void PutDataInPreviousState(PICKED_ITEMS_LIST *aList)
Used in undo or redo command.
Definition: undo_redo.cpp:391
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
FOOTPRINT * SelectFootprintFromLibTree(LIB_ID aPreselect=LIB_ID())
Open a dialog to select a footprint.
PCBNEW_SETTINGS * GetPcbNewSettings() const
virtual void OnModify()
Must be called after a change in order to set the "modify" flag of the current screen and update the ...
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
BOARD * GetBoard() const
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Returns the BOARD_DESIGN_SETTINGS for the open project.
virtual void Update3DView(bool aMarkDirty, bool aRefresh, const wxString *aTitle=nullptr)
Update the 3D view, if the viewer is opened by this frame.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void SetLastPath(LAST_PATH_TYPE aType, const wxString &aLastPath)
Set the path of the last file successfully read.
TOOL_ACTION * GetExportNetlistAction()
void OnModify() override
Must be called after a board change to set the modified flag.
void RecreateBOMFileFromBoard(wxCommandEvent &aEvent)
Create a BOM file from the current loaded board.
void FindNext()
Find the next item using our existing search parameters.
void GenD356File(wxCommandEvent &event)
wxString GetLastPath(LAST_PATH_TYPE aType)
Get the last path for a particular type.
bool Files_io_from_id(int aId)
Read and write board files according to aId.
void ShowFindDialog()
Show the Find dialog.
bool FetchNetlistFromSchematic(NETLIST &aNetlist, const wxString &aAnnotateMessage)
void SendSelectItemsToSch(const std::deque< EDA_ITEM * > &aItems, EDA_ITEM *aFocusItem, bool aForce)
Send a message to the schematic editor to try to find schematic counterparts of specified PCB items a...
void GenFootprintsReport(wxCommandEvent &event)
Call DoGenFootprintsReport to create a footprint report file.
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
Generic tool for picking an item.
The selection tool: currently supports:
PCB_SELECTION & RequestSelection(CLIENT_SELECTION_FILTER aClientFilter, bool aConfirmLockedItems=false)
Return the current selection, filtered according to aClientFilter.
int ClearSelection(const TOOL_EVENT &aEvent)
PCB_SELECTION & GetSelection()
void SelectAllItemsOnNet(int aNetCode, bool aSelect=true)
Select all items with the given net code.
PCB_BASE_EDIT_FRAME * frame() const
KIGFX::VIEW_CONTROLS * controls() const
BOARD * board() const
PCB_DRAW_PANEL_GAL * canvas() const
const PCB_SELECTION & selection() const
FOOTPRINT * footprint() const
void SetWidth(int aWidth)
Definition: pcb_track.h:104
int GetWidth() const
Definition: pcb_track.h:105
A holder to handle information on schematic or board items.
void PushItem(const ITEM_PICKER &aItem)
Push aItem to the top of the list.
void SetClickHandler(CLICK_HANDLER aHandler)
Set a handler for mouse click event.
Definition: picker_tool.h:71
ROUTER_MODE Mode() const
Definition: pns_router.h:132
RouterState GetState() const
Definition: pns_router.h:134
ROUTER * Router() const
virtual const wxString GetProjectFullName() const
Return the full path and name of the project.
Definition: project.cpp:119
static bool NotEmpty(const SELECTION &aSelection)
Test if there are any items selected.
static SELECTION_CONDITION OnlyTypes(std::vector< KICAD_T > aTypes)
Create a functor that tests if the selected items are only of given types.
T * FirstOfKind() const
Definition: selection.h:216
const std::deque< EDA_ITEM * > GetItems() const
Definition: selection.h:118
EDA_ITEM * GetLastAddedItem() const
Definition: selection.h:123
bool IsHover() const
Definition: selection.h:81
int Size() const
Returns the number of selected parts.
Definition: selection.h:113
void SetReferencePoint(const VECTOR2I &aP)
Definition: selection.h:252
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:107
virtual void PopTool(const TOOL_EVENT &aEvent)
Pops a tool from the stack.
virtual void PushTool(const TOOL_EVENT &aEvent)
NB: the definition of "tool" is different at the user level.
bool ToolStackIsEmpty()
Definition: tools_holder.h:128
bool IsCurrentTool(const TOOL_ACTION &aAction) const
TOOL_EVENT MakeEvent() const
Return the event associated with the action (i.e.
Definition: tool_action.cpp:72
KIGFX::VIEW_CONTROLS * getViewControls() const
Return the instance of VIEW_CONTROLS object used in the application.
Definition: tool_base.cpp:42
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
KIGFX::VIEW * getView() const
Returns the instance of #VIEW object used in the application.
Definition: tool_base.cpp:36
bool IsToolActive() const
Definition: tool_base.cpp:31
RESET_REASON
Determine the reason of reset for a tool.
Definition: tool_base.h:78
@ MODEL_RELOAD
Model changes (required full reload)
Definition: tool_base.h:80
@ GAL_SWITCH
Rendering engine changes.
Definition: tool_base.h:81
Generic, UI-independent tool event.
Definition: tool_event.h:156
bool HasPosition() const
Definition: tool_event.h:243
T Parameter() const
Return a non-standard parameter assigned to the event.
Definition: tool_event.h:442
bool Matches(const TOOL_EVENT &aEvent) const
Test whether two events match in terms of category & action or command.
Definition: tool_event.h:365
const VECTOR2D Position() const
Returns the point where dragging has started.
Definition: tool_event.h:266
bool IsReactivate() const
Definition: tool_event.h:255
bool IsAction(const TOOL_ACTION *aAction) const
Test if the event contains an action issued upon activation of the given TOOL_ACTION.
Definition: tool_event.cpp:88
void Go(int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
Define which state (aStateFunc) to go when a certain event arrives (aConditions).
TOOL_MENU & GetToolMenu()
TOOL_MENU m_menu
The functions below are not yet implemented - their interface may change.
TOOL_EVENT * Wait(const TOOL_EVENT_LIST &aEventList=TOOL_EVENT(TC_ANY, TA_ANY))
Suspend execution of the tool until an event specified in aEventList arrives.
void Activate()
Run the tool.
void PostEvent(const TOOL_EVENT &aEvent)
Put an event to the event queue to be processed at the end of event processing cycle.
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:142
void PrimeTool(const VECTOR2D &aPosition)
"Prime" a tool by sending a cursor left-click event with the mouse position set to the passed in posi...
Manage a CONDITIONAL_MENU and some number of CONTEXT_MENUs as sub-menus.
Definition: tool_menu.h:43
CONDITIONAL_MENU & GetMenu()
Definition: tool_menu.cpp:44
void RegisterSubMenu(std::shared_ptr< ACTION_MENU > aSubMenu)
Store a submenu of this menu model.
Definition: tool_menu.cpp:50
void ShowContextMenu(SELECTION &aSelection)
Helper function to set and immediately show a CONDITIONAL_MENU in concert with the given SELECTION.
Definition: tool_menu.cpp:57
ACTION_MENU * create() const override
< Return an instance of this class. It has to be overridden in inheriting classes.
ZONE_SETTINGS handles zones parameters.
Definition: zone_settings.h:70
void ExportSetting(ZONE &aTarget, bool aFullExport=true) const
Function ExportSetting copy settings to a given zone.
Handle a list of polygons defining a copper zone.
Definition: zone.h:57
bool GetIsRuleArea() const
Accessors to parameters used in Rule Area zones:
Definition: zone.h:691
virtual PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
Definition: zone.cpp:230
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition: zone.h:115
bool IsOnCopperLayer() const override
Definition: zone.cpp:245
unsigned GetAssignedPriority() const
Definition: zone.h:106
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo)
Display an informational message box with aMessage.
Definition: confirm.cpp:320
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition: confirm.cpp:299
This file is part of the common library.
int InvokeCopperZonesEditor(PCB_BASE_FRAME *aCaller, ZONE_SETTINGS *aSettings, CONVERT_SETTINGS *aConvertSettings)
Function InvokeCopperZonesEditor invokes up a modal dialog window for copper zone editing.
int InvokeNonCopperZonesEditor(PCB_BASE_FRAME *aParent, ZONE_SETTINGS *aSettings, CONVERT_SETTINGS *aConvertSettings)
Function InvokeNonCopperZonesEditor invokes up a modal dialog window for non-copper zone editing.
int InvokeRuleAreaEditor(PCB_BASE_FRAME *aCaller, ZONE_SETTINGS *aZoneSettings, CONVERT_SETTINGS *aConvertSettings)
Function InvokeRuleAreaEditor invokes up a modal dialog window for copper zone editing.
#define _(s)
static constexpr EDA_ANGLE & ANGLE_0
Definition: eda_angle.h:412
#define IS_NEW
New item, just created.
@ FRAME_SCH
Definition: frame_type.h:34
@ FRAME_FOOTPRINT_EDITOR
Definition: frame_type.h:41
const std::string SpecctraDsnFileExtension
const std::string SpecctraSessionFileExtension
wxString AddFileExtListToFilter(const std::vector< std::string > &aExts)
Build the wildcard extension file dialog wildcard filter to add to the base message dialog.
wxString SpecctraDsnFileWildcard()
wxString SpecctraSessionFileWildcard()
@ ID_NEW_BOARD
Definition: id.h:76
@ ID_SAVE_BOARD
Definition: id.h:77
@ ID_LOAD_FILE
Definition: id.h:75
@ ID_GEN_PLOT_GERBER
Definition: id.h:94
@ ID_GEN_PLOT
Definition: id.h:91
@ ID_SAVE_BOARD_AS
Definition: id.h:78
KIID niluuid(0)
@ MAIL_SCH_UPDATE
Definition: mail_type.h:47
@ REPAINT
Item needs to be redrawn.
Definition: view_item.h:52
@ PNS_MODE_ROUTE_DIFF_PAIR
Definition: pns_router.h:64
#define MAX_PAGE_SIZE_PCBNEW_MILS
Definition: page_info.h:40
@ ID_REVERT_BOARD
Definition: pcbnew_id.h:18
@ ID_COPY_BOARD_AS
Definition: pcbnew_id.h:17
see class PGM_BASE
@ LAST_PATH_SPECCTRADSN
Definition: project_file.h:52
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
static LIB_SYMBOL * dummy()
Used to draw a dummy shape when a LIB_SYMBOL is not found in library.
Definition: sch_symbol.cpp:74
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:111
const double IU_PER_MM
Definition: base_units.h:77
const double IU_PER_MILS
Definition: base_units.h:78
Container to handle a stock of specific vias each with unique diameter and drill sizes in the BOARD c...
@ BUT_LEFT
Definition: tool_event.h:127
@ BUT_RIGHT
Definition: tool_event.h:128
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:102
@ 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_FP_TEXT_T
class FP_TEXT, text in a footprint
Definition: typeinfo.h:92
Definition of file extensions used in Kicad.