KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_erc.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) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright (C) 2012 Wayne Stambaugh <[email protected]>
6 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
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, see <https://www.gnu.org/licenses/>.
20 */
21
23#include <advanced_config.h>
24#include <gestfich.h>
25#include <sch_screen.h>
26#include <sch_edit_frame.h>
27#include <widgets/wx_infobar.h>
28#include <project.h>
29#include <kiface_base.h>
30#include <reporter.h>
32#include <sch_marker.h>
33#include <connection_graph.h>
34#include <tools/sch_actions.h>
36#include <dialog_erc.h>
37#include <erc/erc.h>
38#include <erc/erc_report.h>
39#include <id.h>
40#include <confirm.h>
44#include <string_utils.h>
45#include <kiplatform/ui.h>
46#include <confirm.h>
47
48#include <wx/ffile.h>
49#include <wx/filedlg.h>
50#include <wx/hyperlink.h>
51#include <wx/msgdlg.h>
52#include <sch_edit_tool.h>
53
54
55wxDEFINE_EVENT( EDA_EVT_CLOSE_ERC_DIALOG, wxCommandEvent );
56
57
58// Route marker exclusion through the provider so its cached severity counts stay in sync.
59static void setMarkerExcluded( const std::shared_ptr<RC_ITEMS_PROVIDER>& aProvider,
60 SCH_MARKER* aMarker, bool aExcluded,
61 const wxString& aComment = wxEmptyString )
62{
63 static_cast<SHEETLIST_ERC_ITEMS_PROVIDER&>( *aProvider ).SetMarkerExcluded( aMarker, aExcluded,
64 aComment );
65}
66
67
68// wxWidgets spends *far* too long calculating column widths (most of it, believe it or
69// not, in repeatedly creating/destroying a wxDC to do the measurement in).
70// Use default column widths instead.
71static int DEFAULT_SINGLE_COL_WIDTH = 660;
72
73
74static SCHEMATIC* g_lastERCSchematic = nullptr;
75static bool g_lastERCRun = false;
76
77static std::vector<std::pair<wxString, int>> g_lastERCIgnored;
78
79
81 DIALOG_ERC_BASE( parent ),
83 m_parent( parent ),
84 m_markerTreeModel( nullptr ),
85 m_running( false ),
86 m_ercRun( false ),
87 m_centerMarkerOnIdle( nullptr ),
88 m_crossprobe( true ),
90 m_showAllErrors( false )
91{
92 m_currentSchematic = &parent->Schematic();
93
94 SetName( DIALOG_ERC_WINDOW_NAME ); // Set a window name to be able to find it
96
97 m_bMenu->SetBitmap( KiBitmapBundle( BITMAPS::config ) );
98
99 m_messages->SetImmediateMode();
100
101 m_markerProvider = std::make_shared<SHEETLIST_ERC_ITEMS_PROVIDER>( &m_parent->Schematic() );
102
104 m_markerDataView->AssociateModel( m_markerTreeModel );
106
107 // Prevent RTL locales from mirroring the text in the data views
108 m_markerDataView->SetLayoutDirection( wxLayout_LeftToRight );
109 m_ignoredList->SetLayoutDirection( wxLayout_LeftToRight );
110
111 m_ignoredList->InsertColumn( 0, wxEmptyString, wxLIST_FORMAT_LEFT, DEFAULT_SINGLE_COL_WIDTH );
112
114 {
116
117 for( const auto& [ str, code ] : g_lastERCIgnored )
118 {
119 wxListItem listItem;
120 listItem.SetId( m_ignoredList->GetItemCount() );
121 listItem.SetText( str );
122 listItem.SetData( code );
123
124 m_ignoredList->InsertItem( listItem );
125 }
126 }
127
128 m_notebook->SetSelection( 0 );
129
130 SetupStandardButtons( { { wxID_OK, _( "Run ERC" ) },
131 { wxID_CANCEL, _( "Close" ) } } );
132
133 m_violationsTitleTemplate = m_notebook->GetPageText( 0 );
134 m_ignoredTitleTemplate = m_notebook->GetPageText( 1 );
135
136 m_errorsBadge->SetMaximumNumber( 999 );
137 m_warningsBadge->SetMaximumNumber( 999 );
138 m_exclusionsBadge->SetMaximumNumber( 999 );
139
141
142 Layout();
143
144 SetFocus();
145
147 {
148 m_crossprobe = cfg->m_ERCDialog.crossprobe;
149 m_scroll_on_crossprobe = cfg->m_ERCDialog.scroll_on_crossprobe;
150 m_showAllErrors = cfg->m_ERCDialog.show_all_errors;
151 }
152
153 // Now all widgets have the size fixed, call FinishDialogSettings
155}
156
157
159{
162
163 g_lastERCIgnored.clear();
164
165 for( int ii = 0; ii < m_ignoredList->GetItemCount(); ++ii )
166 g_lastERCIgnored.push_back( { m_ignoredList->GetItemText( ii ), m_ignoredList->GetItemData( ii ) } );
167
169 {
170 cfg->m_ERCDialog.crossprobe = m_crossprobe;
171 cfg->m_ERCDialog.scroll_on_crossprobe = m_scroll_on_crossprobe;
172 cfg->m_ERCDialog.show_all_errors = m_showAllErrors;
173 }
174
175 m_markerTreeModel->DecRef();
176}
177
178
180{
181 if( m_parent->CheckAnnotate(
182 []( ERCE_T, const wxString&, SCH_REFERENCE*, SCH_REFERENCE* )
183 {
184 },
186 true,
188 {
189 if( !m_infoBar->IsShownOnScreen() )
190 {
191 m_infoBar->RemoveAllButtons();
192 m_infoBar->AddLink( _( "Show Annotation dialog" ),
193 [&]( wxHyperlinkEvent& aEvent )
194 {
195 wxHtmlLinkEvent htmlEvent( aEvent.GetId(), wxHtmlLinkInfo( aEvent.GetURL() ) );
196 OnLinkClicked( htmlEvent );
197 } );
198
199 m_infoBar->ShowMessage( _( "Schematic is not fully annotated. ERC results will be incomplete." ) );
200 }
201 }
202 else
203 {
204 if( m_infoBar->IsShownOnScreen() )
205 {
206 m_infoBar->RemoveAllButtons();
207 m_infoBar->Hide();
208 }
209 }
210}
211
212
214{
215 int severities = 0;
216
217 if( m_showErrors->GetValue() )
218 severities |= RPT_SEVERITY_ERROR;
219
220 if( m_showWarnings->GetValue() )
221 severities |= RPT_SEVERITY_WARNING;
222
223 if( m_showExclusions->GetValue() )
224 severities |= RPT_SEVERITY_EXCLUSION;
225
226 return severities;
227}
228
229
230void DIALOG_ERC::OnMenu( wxCommandEvent& event )
231{
232 // Build a pop menu:
233 wxMenu menu;
234
235 menu.Append( 4206, _( "Cross-probe Selected Items" ),
236 _( "Highlight corresponding items on canvas when selected in the ERC list" ),
237 wxITEM_CHECK );
238 menu.Check( 4206, m_crossprobe );
239
240 menu.Append( 4207, _( "Center on Cross-probe" ),
241 _( "When cross-probing, scroll the canvas so that the item is visible" ),
242 wxITEM_CHECK );
243 menu.Check( 4207, m_scroll_on_crossprobe );
244
245 menu.Append( 4208, _( "Show all errors" ),
246 _( "Show duplicate ERC markers on all applicable pins" ),
247 wxITEM_CHECK );
248 menu.Check( 4208, m_showAllErrors );
249
250 // menu_id is the selected submenu id from the popup menu or wxID_NONE
251 int menu_id = m_bMenu->GetPopupMenuSelectionFromUser( menu );
252
253 if( menu_id == 0 || menu_id == 4206 )
254 {
256 }
257 else if( menu_id == 1 || menu_id == 4207 )
258 {
260 }
261 else if( menu_id == 2 || menu_id == 4208 )
262 {
264 }
265}
266
267
268void DIALOG_ERC::OnCharHook( wxKeyEvent& aEvt )
269{
270 if( int hotkey = aEvt.GetKeyCode() )
271 {
272 if( aEvt.ControlDown() )
273 hotkey |= MD_CTRL;
274 if( aEvt.ShiftDown() )
275 hotkey |= MD_SHIFT;
276 if( aEvt.AltDown() )
277 hotkey |= MD_ALT;
278
279 if( hotkey == ACTIONS::excludeMarker.GetHotKey() )
280 {
282 return;
283 }
284 }
285
287}
288
289
291{
292 UpdateData();
293 return true;
294}
295
296
298{
299 // If ERC checks ever get slow enough we'll want a progress indicator...
300 //
301 // double cur = (double) m_progress.load() / m_maxProgress;
302 // cur = std::max( 0.0, std::min( cur, 1.0 ) );
303 //
304 // m_gauge->SetValue( KiROUND( cur * 1000.0 ) );
305 // wxSafeYield( this );
306
307 return !m_cancelled;
308}
309
310
311void DIALOG_ERC::AdvancePhase( const wxString& aMessage )
312{
313 // Will also call Report( aMessage ):
315 SetCurrentProgress( 0.0 );
316}
317
318
319void DIALOG_ERC::Report( const wxString& aMessage )
320{
321 m_messages->Report( aMessage );
322}
323
324
330
331
333{
334 int numErrors = 0;
335 int numWarnings = 0;
336 int numExcluded = 0;
337
338 int numMarkers = 0;
339
340 if( m_markerProvider )
341 {
342 numMarkers += m_markerProvider->GetCount();
343 numErrors += m_markerProvider->GetCount( RPT_SEVERITY_ERROR );
344 numWarnings += m_markerProvider->GetCount( RPT_SEVERITY_WARNING );
345 numExcluded += m_markerProvider->GetCount( RPT_SEVERITY_EXCLUSION );
346 }
347
348 bool markersOverflowed = false;
349
350 // We don't currently have a limit on ERC violations, so the above is always false.
351
352 wxString num;
353 wxString msg;
354
355 if( m_ercRun )
356 {
357 num.Printf( markersOverflowed ? wxT( "%d+" ) : wxT( "%d" ), numMarkers );
358 msg.Printf( m_violationsTitleTemplate, num );
359 }
360 else
361 {
363 msg.Replace( wxT( "(%s)" ), wxEmptyString );
364 }
365
366 m_notebook->SetPageText( 0, msg );
367
368 if( m_ercRun )
369 {
370 num.Printf( wxT( "%d" ), m_ignoredList->GetItemCount() );
371 msg.sprintf( m_ignoredTitleTemplate, num );
372 }
373 else
374 {
376 msg.Replace( wxT( "(%s)" ), wxEmptyString );
377 }
378
379 m_notebook->SetPageText( 1, msg );
380
381 if( !m_ercRun && numErrors == 0 )
382 numErrors = -1;
383
384 if( !m_ercRun && numWarnings == 0 )
385 numWarnings = -1;
386
387 m_errorsBadge->UpdateNumber( numErrors, RPT_SEVERITY_ERROR );
388 m_warningsBadge->UpdateNumber( numWarnings, RPT_SEVERITY_WARNING );
389 m_exclusionsBadge->UpdateNumber( numExcluded, RPT_SEVERITY_EXCLUSION );
390}
391
392
393void DIALOG_ERC::OnDeleteOneClick( wxCommandEvent& aEvent )
394{
395 if( m_notebook->GetSelection() == 0 )
396 {
397 // Clear the selection. It may be the selected ERC marker.
398 m_parent->GetToolManager()->RunAction( ACTIONS::selectionClear );
399
400 m_markerTreeModel->DeleteCurrentItem( true );
401
402 // redraw the schematic
404 }
405
407}
408
409
410void DIALOG_ERC::OnDeleteAllClick( wxCommandEvent& event )
411{
412 bool includeExclusions = false;
413 size_t numExcluded = m_parent->Schematic().GetUnresolvedERCExclusionCount();
414
415 if( m_markerProvider )
416 numExcluded += m_markerProvider->GetCount( RPT_SEVERITY_EXCLUSION );
417
418 if( numExcluded > 0 )
419 {
420 KICAD_MESSAGE_DIALOG dlg( this, _( "Delete exclusions too?" ), _( "Delete All Markers" ),
421 wxYES_NO | wxCANCEL | wxCENTER | wxICON_QUESTION );
422 dlg.SetYesNoLabels( _( "Errors and Warnings Only" ),
423 _( "Errors, Warnings and Exclusions" ) );
424
425 int ret = dlg.ShowModal();
426
427 if( ret == wxID_CANCEL )
428 return;
429 else if( ret == wxID_NO )
430 includeExclusions = true;
431 }
432
433 if( includeExclusions )
434 m_parent->Schematic().ClearUnresolvedERCExclusions();
435
436 DeleteAllMarkers( includeExclusions );
437 m_ercRun = false;
438
439 // redraw the schematic
442}
443
444
445void DIALOG_ERC::OnCancelClick( wxCommandEvent& aEvent )
446{
447 if( m_running )
448 {
449 m_cancelled = true;
450 return;
451 }
452
453 m_parent->ClearFocus();
454
455 aEvent.Skip();
456}
457
458
459void DIALOG_ERC::OnCloseErcDialog( wxCloseEvent& aEvent )
460{
461 m_parent->ClearFocus();
462
463 // Dialog is mode-less so let the parent know that it needs to be destroyed.
464 if( !IsModal() && !IsQuasiModal() )
465 {
466 if( wxWindow* parent = GetParent() )
467 wxQueueEvent( parent, new wxCommandEvent( EDA_EVT_CLOSE_ERC_DIALOG, wxID_ANY ) );
468 }
469
470 aEvent.Skip();
471}
472
473
474void DIALOG_ERC::OnLinkClicked( wxHtmlLinkEvent& event )
475{
476 m_parent->OnAnnotate();
477}
478
479
480void DIALOG_ERC::OnRunERCClick( wxCommandEvent& event )
481{
482 wxBusyCursor busy;
483
484 SCHEMATIC* sch = &m_parent->Schematic();
485
487
488 m_parent->ClearErcMarkers();
489
490 std::vector<std::reference_wrapper<RC_ITEM>> violations = ERC_ITEM::GetItemsWithSeverities();
491 m_ignoredList->DeleteAllItems();
492
493 for( std::reference_wrapper<RC_ITEM>& item : violations )
494 {
495 if( sch->ErcSettings().GetSeverity( item.get().GetErrorCode() ) == RPT_SEVERITY_IGNORE )
496 {
497 wxListItem listItem;
498 listItem.SetId( m_ignoredList->GetItemCount() );
499 listItem.SetText( wxT( " • " ) + item.get().GetErrorText( true ) );
500 listItem.SetData( item.get().GetErrorCode() );
501
502 m_ignoredList->InsertItem( listItem );
503 }
504 }
505
506 m_ignoredList->SetColumnWidth( 0, m_ignoredList->GetParent()->GetClientSize().x - 20 );
507
508 m_cancelled = false;
509 Raise();
510
511 m_runningResultsBook->ChangeSelection( 0 ); // Display the "Tests Running..." tab
512 m_messages->Clear();
513 Update(); // Repaint only, don't enter the full event loop
514
515 m_running = true;
516 m_sdbSizer1Cancel->SetLabel( _( "Cancel" ) );
517 m_sdbSizer1OK->Enable( false );
518 m_deleteOneMarker->Enable( false );
519 m_deleteAllMarkers->Enable( false );
520 m_saveReport->Enable( false );
521
522 int itemsNotAnnotated = m_parent->CheckAnnotate(
523 []( ERCE_T aType, const wxString& aMsg, SCH_REFERENCE* aItemA, SCH_REFERENCE* aItemB )
524 {
525 std::shared_ptr<ERC_ITEM> ercItem = ERC_ITEM::Create( aType );
526 ercItem->SetErrorMessage( aMsg );
527
528 if( aItemB )
529 ercItem->SetItems( aItemA->GetSymbol(), aItemB->GetSymbol() );
530 else
531 ercItem->SetItems( aItemA->GetSymbol() );
532
533 SCH_MARKER* marker = new SCH_MARKER( std::move( ercItem ), aItemA->GetSymbol()->GetPosition() );
534 aItemA->GetSheetPath().LastScreen()->Append( marker );
535 },
537 true,
539
540 testErc();
541
542 if( itemsNotAnnotated )
543 {
544 m_messages->ReportHead( wxString::Format( _( "%d symbol(s) require annotation.<br><br>" ),
545 itemsNotAnnotated ),
547 }
548
549 if( m_cancelled )
550 m_messages->Report( _( "-------- ERC cancelled by user.<br><br>" ), RPT_SEVERITY_INFO );
551 else
552 m_messages->Report( _( "Done.<br><br>" ), RPT_SEVERITY_INFO );
553
554 Raise();
555 Update(); // Repaint only, don't enter the full event loop
556
557 m_running = false;
558 m_sdbSizer1Cancel->SetLabel( _( "Close" ) );
559 m_sdbSizer1OK->Enable( true );
560 m_deleteOneMarker->Enable( true );
561 m_deleteAllMarkers->Enable( true );
562 m_saveReport->Enable( true );
563
564 if( !m_cancelled )
565 {
566 m_sdbSizer1Cancel->SetDefault();
567
568 // wxWidgets has a tendency to keep both buttons highlighted without the following:
569 m_sdbSizer1OK->Enable( false );
570
571 wxMilliSleep( 500 );
572 m_runningResultsBook->ChangeSelection( 1 );
574
575 // now re-enable m_sdbSizerOK button
576 m_sdbSizer1OK->Enable( true );
577 }
578
579 m_ercRun = true;
582 // set float level again, it can be lost due to window events during test run
584}
585
586
588{
589 WINDOW_THAWER thawer( m_parent );
590
591 m_parent->GetCanvas()->GetView()->RefreshDrawingSheetPageInfo();
592 m_parent->GetCanvas()->Refresh();
593}
594
595
597{
598 wxFileName fn;
599
600 SCHEMATIC* sch = &m_parent->Schematic();
601
602 SCH_SCREENS screens( sch->Root() );
603 ERC_TESTER tester( sch, m_showAllErrors );
604
605 {
606 wxBusyCursor dummy;
607 tester.RunTests( m_parent->GetCanvas()->GetView()->GetDrawingSheet(), m_parent,
608 m_parent->Kiway().KiFACE( KIWAY::FACE_CVPCB ), &m_parent->Prj(), this );
609 }
610
611 m_parent->RefreshErcMarkers();
612}
613
614
615void DIALOG_ERC::OnERCItemSelected( wxDataViewEvent& aEvent )
616{
617 if( !m_crossprobe )
618 {
619 aEvent.Skip();
620 return;
621 }
622
623 const KIID& itemID = RC_TREE_MODEL::ToUUID( aEvent.GetItem() );
624 SCH_SHEET_PATH sheet;
625 SCH_ITEM* item = m_parent->Schematic().ResolveItem( itemID, &sheet, true );
626
628 {
629 // we already came from a cross-probe of the marker in the document; don't go
630 // around in circles
631 }
632 else if( item && item->GetClass() != wxT( "DELETED_SHEET_ITEM" ) )
633 {
634 const RC_TREE_NODE* node = RC_TREE_MODEL::ToNode( aEvent.GetItem() );
635
636 if( node )
637 {
638 // Determine the owning sheet for sheet-specific items
639 std::shared_ptr<ERC_ITEM> ercItem = std::static_pointer_cast<ERC_ITEM>( node->m_RcItem );
640
641 if( ercItem->IsSheetSpecific() )
642 sheet = ercItem->GetSpecificSheetPath();
643
644 switch( node->m_Type )
645 {
647 if( ercItem->MainItemHasSheetPath() )
648 sheet = ercItem->GetMainItemSheetPath();
649 break;
651 if( ercItem->AuxItemHasSheetPath() )
652 sheet = ercItem->GetAuxItemSheetPath();
653 break;
654 default:
655 break;
656 }
657 }
658
659 if( !sheet.empty() )
660 {
661 const auto currentPath = m_parent->Schematic().Hierarchy().GetSheetPathByKIIDPath( sheet.PathRef() );
662
663 if( !currentPath )
664 {
665 aEvent.Skip();
666 return;
667 }
668
669 sheet = *currentPath;
670 }
671
672 WINDOW_THAWER thawer( m_parent );
673
674 if( !sheet.empty() && sheet != m_parent->GetCurrentSheet() )
675 {
676 m_parent->GetToolManager()->RunAction<SCH_SHEET_PATH*>( SCH_ACTIONS::changeSheet, &sheet );
677 m_parent->RedrawScreen( m_parent->GetScreen()->m_ScrollCenter, false );
678 }
679
680 m_parent->FocusOnItem( item, m_scroll_on_crossprobe );
682 }
683
684 aEvent.Skip();
685}
686
687
688void DIALOG_ERC::OnERCItemDClick( wxDataViewEvent& aEvent )
689{
690 if( aEvent.GetItem().IsOk() )
691 {
692 // turn control over to m_parent, hide this DIALOG_ERC window,
693 // no destruction so we can preserve listbox cursor
694 if( !IsModal() )
695 Show( false );
696 }
697
698 aEvent.Skip();
699}
700
701
702void DIALOG_ERC::OnERCItemRClick( wxDataViewEvent& aEvent )
703{
704 TOOL_MANAGER* toolMgr = m_parent->GetToolManager();
705 SCH_INSPECTION_TOOL* inspectionTool = toolMgr->GetTool<SCH_INSPECTION_TOOL>();
706 SCH_EDIT_TOOL* editTool = toolMgr->GetTool<SCH_EDIT_TOOL>();
707 RC_TREE_NODE* node = RC_TREE_MODEL::ToNode( aEvent.GetItem() );
708
709 if( !node )
710 return;
711
712 ERC_SETTINGS& settings = m_parent->Schematic().ErcSettings();
713
714 std::shared_ptr<RC_ITEM> rcItem = node->m_RcItem;
715 wxString listName;
716 wxMenu menu;
717
718 switch( settings.GetSeverity( rcItem->GetErrorCode() ) )
719 {
720 case RPT_SEVERITY_ERROR: listName = _( "errors" ); break;
721 case RPT_SEVERITY_WARNING: listName = _( "warnings" ); break;
722 default: listName = _( "appropriate" ); break;
723 }
724
725 enum MENU_IDS
726 {
727 ID_EDIT_EXCLUSION_COMMENT = 4467,
728 ID_REMOVE_EXCLUSION,
729 ID_REMOVE_EXCLUSION_ALL,
730 ID_ADD_EXCLUSION,
731 ID_ADD_EXCLUSION_WITH_COMMENT,
732 ID_ADD_EXCLUSION_ALL,
733 ID_INSPECT_VIOLATION,
734 ID_FIX_VIOLATION,
735 ID_EDIT_PIN_CONFLICT_MAP,
736 ID_EDIT_CONNECTION_GRID,
737 ID_SET_SEVERITY_TO_ERROR,
738 ID_SET_SEVERITY_TO_WARNING,
739 ID_SET_SEVERITY_TO_IGNORE,
740 ID_EDIT_SEVERITIES,
741 };
742
743 if( rcItem->GetParent()->IsExcluded() )
744 {
745 menu.Append( ID_REMOVE_EXCLUSION,
746 _( "Remove exclusion for this violation" ),
747 wxString::Format( _( "It will be placed back in the %s list" ), listName ) );
748
749 menu.Append( ID_EDIT_EXCLUSION_COMMENT,
750 _( "Edit exclusion comment..." ) );
751 }
752 else
753 {
754 menu.Append( ID_ADD_EXCLUSION,
755 _( "Exclude this violation" ),
756 wxString::Format( _( "It will be excluded from the %s list" ), listName ) );
757
758 menu.Append( ID_ADD_EXCLUSION_WITH_COMMENT,
759 _( "Exclude with comment..." ),
760 wxString::Format( _( "It will be excluded from the %s list" ), listName ) );
761 }
762
763 menu.AppendSeparator();
764
765 wxString inspectERCErrorMenuText = inspectionTool->InspectERCErrorMenuText( rcItem );
766 wxString fixERCErrorMenuText = editTool->FixERCErrorMenuText( rcItem );
767
768 if( !inspectERCErrorMenuText.IsEmpty() || !fixERCErrorMenuText.IsEmpty() )
769 {
770 if( !inspectERCErrorMenuText.IsEmpty() )
771 menu.Append( ID_INSPECT_VIOLATION, inspectERCErrorMenuText );
772
773 if( !fixERCErrorMenuText.IsEmpty() )
774 menu.Append( ID_FIX_VIOLATION, fixERCErrorMenuText );
775
776 menu.AppendSeparator();
777 }
778
779 if( rcItem->GetErrorCode() == ERCE_PIN_TO_PIN_WARNING
780 || rcItem->GetErrorCode() == ERCE_PIN_TO_PIN_ERROR )
781 {
782 // Pin to pin severities edited through pin conflict map
783 }
784 else if( settings.GetSeverity( rcItem->GetErrorCode() ) == RPT_SEVERITY_WARNING )
785 {
786 menu.Append( ID_SET_SEVERITY_TO_ERROR,
787 wxString::Format( _( "Change severity to Error for all '%s' violations" ),
788 rcItem->GetErrorText( true ) ),
789 _( "Violation severities can also be edited in Schematic Setup" ) );
790 }
791 else
792 {
793 menu.Append( ID_SET_SEVERITY_TO_WARNING,
794 wxString::Format( _( "Change severity to Warning for all '%s' violations" ),
795 rcItem->GetErrorText( true ) ),
796 _( "Violation severities can also be edited in Schematic Setup" ) );
797 }
798
799 menu.Append( ID_SET_SEVERITY_TO_IGNORE,
800 wxString::Format( _( "Ignore all '%s' violations" ), rcItem->GetErrorText( true ) ),
801 _( "Violations will not be checked or reported" ) );
802
803 menu.AppendSeparator();
804
805 if( rcItem->GetErrorCode() == ERCE_PIN_TO_PIN_WARNING
806 || rcItem->GetErrorCode() == ERCE_PIN_TO_PIN_ERROR )
807 {
808 menu.Append( ID_EDIT_PIN_CONFLICT_MAP,
809 _( "Edit pin-to-pin conflict map..." ),
810 _( "Open the Schematic Setup dialog" ) );
811 }
812 else
813 {
814 menu.Append( ID_EDIT_SEVERITIES,
815 _( "Edit violation severities..." ),
816 _( "Open the Schematic Setup dialog" ) );
817 }
818
819 if( rcItem->GetErrorCode() == ERCE_ENDPOINT_OFF_GRID )
820 {
821 menu.Append( ID_EDIT_CONNECTION_GRID,
822 _( "Edit connection grid spacing..." ),
823 _( "Open the Schematic Setup dialog" ) );
824 }
825
826 bool modified = false;
827 int command = GetPopupMenuSelectionFromUser( menu );
828
829 switch( command )
830 {
831 case ID_EDIT_EXCLUSION_COMMENT:
832 if( SCH_MARKER* marker = dynamic_cast<SCH_MARKER*>( node->m_RcItem->GetParent() ) )
833 {
834 WX_TEXT_ENTRY_DIALOG dlg( this, wxEmptyString, _( "Exclusion Comment" ), marker->GetComment(), true );
835
836 if( dlg.ShowModal() == wxID_CANCEL )
837 break;
838
839 setMarkerExcluded( m_markerProvider, marker, true, dlg.GetValue() );
840
841 // Update view
842 static_cast<RC_TREE_MODEL*>( aEvent.GetModel() )->ValueChanged( node );
843 modified = true;
844 }
845
846 break;
847
848 case ID_REMOVE_EXCLUSION:
849 if( SCH_MARKER* marker = dynamic_cast<SCH_MARKER*>( node->m_RcItem->GetParent() ) )
850 {
851 setMarkerExcluded( m_markerProvider, marker, false );
852 m_parent->GetCanvas()->GetView()->Update( marker );
853
855
856 modified = true;
857 }
858
859 break;
860
861 case ID_ADD_EXCLUSION:
862 case ID_ADD_EXCLUSION_WITH_COMMENT:
863 if( SCH_MARKER* marker = dynamic_cast<SCH_MARKER*>( node->m_RcItem->GetParent() ) )
864 {
865 wxString comment;
866
867 if( command == ID_ADD_EXCLUSION_WITH_COMMENT )
868 {
869 WX_TEXT_ENTRY_DIALOG dlg( this, wxEmptyString, _( "Exclusion Comment" ), wxEmptyString, true );
870
871 if( dlg.ShowModal() == wxID_CANCEL )
872 break;
873
874 comment = dlg.GetValue();
875 }
876
877 setMarkerExcluded( m_markerProvider, marker, true, comment );
878
879 m_parent->GetCanvas()->GetView()->Update( marker );
880
882
883 modified = true;
884 }
885
886 break;
887
888 case ID_INSPECT_VIOLATION:
889 inspectionTool->InspectERCError( node->m_RcItem );
890 break;
891
892 case ID_FIX_VIOLATION:
893 editTool->FixERCError( node->m_RcItem );
894 break;
895
896 case ID_SET_SEVERITY_TO_ERROR:
897 settings.SetSeverity( rcItem->GetErrorCode(), RPT_SEVERITY_ERROR );
898
899 for( SCH_ITEM* item : m_parent->GetScreen()->Items().OfType( SCH_MARKER_T ) )
900 {
901 SCH_MARKER* marker = static_cast<SCH_MARKER*>( item );
902
903 if( marker->GetRCItem()->GetErrorCode() == rcItem->GetErrorCode() )
904 m_parent->GetCanvas()->GetView()->Update( marker );
905 }
906
907 // Rebuild model and view
908 static_cast<RC_TREE_MODEL*>( aEvent.GetModel() )->Update( m_markerProvider, getSeverities() );
909 modified = true;
910 break;
911
912 case ID_SET_SEVERITY_TO_WARNING:
913 settings.SetSeverity( rcItem->GetErrorCode(), RPT_SEVERITY_WARNING );
914
915 for( SCH_ITEM* item : m_parent->GetScreen()->Items().OfType( SCH_MARKER_T ) )
916 {
917 SCH_MARKER* marker = static_cast<SCH_MARKER*>( item );
918
919 if( marker->GetRCItem()->GetErrorCode() == rcItem->GetErrorCode() )
920 m_parent->GetCanvas()->GetView()->Update( marker );
921 }
922
923 // Rebuild model and view
924 static_cast<RC_TREE_MODEL*>( aEvent.GetModel() )->Update( m_markerProvider, getSeverities() );
925 modified = true;
926 break;
927
928 case ID_SET_SEVERITY_TO_IGNORE:
929 {
930 settings.SetSeverity( rcItem->GetErrorCode(), RPT_SEVERITY_IGNORE );
931
932 if( rcItem->GetErrorCode() == ERCE_PIN_TO_PIN_ERROR )
934
935 wxListItem listItem;
936 listItem.SetId( m_ignoredList->GetItemCount() );
937 listItem.SetText( wxT( " • " ) + rcItem->GetErrorText( true ) );
938 listItem.SetData( rcItem->GetErrorCode() );
939
940 m_ignoredList->InsertItem( listItem );
941
942 // Clear the selection before deleting markers. It may be some selected ERC markers.
943 // Deleting a selected marker without deselecting it first generates a crash
944 m_parent->GetToolManager()->RunAction( ACTIONS::selectionClear );
945
946 SCH_SCREENS ScreenList( m_parent->Schematic().Root() );
947 ScreenList.DeleteMarkers( MARKER_BASE::MARKER_ERC, rcItem->GetErrorCode() );
948 m_parent->Schematic().ClearUnresolvedERCExclusions( rcItem->GetErrorCode() );
949
950 // Rebuild model and view
951 static_cast<RC_TREE_MODEL*>( aEvent.GetModel() )->Update( m_markerProvider, getSeverities() );
952 modified = true;
953 break;
954 }
955
956 case ID_EDIT_PIN_CONFLICT_MAP:
957 m_parent->ShowSchematicSetupDialog( _( "Pin Conflicts Map" ) );
958 break;
959
960 case ID_EDIT_SEVERITIES:
961 m_parent->ShowSchematicSetupDialog( _( "Violation Severity" ) );
962 break;
963
964 case ID_EDIT_CONNECTION_GRID:
965 m_parent->ShowSchematicSetupDialog( _( "Formatting" ) );
966 break;
967 }
968
969 if( modified )
970 {
973 m_parent->OnModify();
974 }
975}
976
977
978void DIALOG_ERC::OnIgnoredItemRClick( wxListEvent& event )
979{
980 ERC_SETTINGS& settings = m_parent->Schematic().ErcSettings();
981 int errorCode = (int) event.m_item.GetData();
982 wxMenu menu;
983
984 menu.Append( RPT_SEVERITY_ERROR, _( "Error" ), wxEmptyString, wxITEM_RADIO );
985 menu.Append( RPT_SEVERITY_WARNING, _( "Warning" ), wxEmptyString, wxITEM_RADIO );
986 menu.Append( RPT_SEVERITY_IGNORE, _( "Ignore" ), wxEmptyString, wxITEM_RADIO );
987
988 menu.Check( settings.GetSeverity( errorCode ), true );
989
990 int severity = GetPopupMenuSelectionFromUser( menu );
991
992 if( severity > 0 )
993 {
994 if( settings.GetSeverity( errorCode ) != severity )
995 {
996 settings.SetSeverity( errorCode, (SEVERITY) severity );
997
1000 m_parent->OnModify();
1001 }
1002 }
1003}
1004
1005
1007{
1008 if( m_notebook->IsShown() )
1009 {
1010 if( m_notebook->GetSelection() != 0 )
1011 m_notebook->SetSelection( 0 );
1012
1013 m_markerTreeModel->PrevMarker();
1014 }
1015}
1016
1017
1019{
1020 if( m_notebook->IsShown() )
1021 {
1022 if( m_notebook->GetSelection() != 0 )
1023 m_notebook->SetSelection( 0 );
1024
1025 m_markerTreeModel->NextMarker();
1026 }
1027}
1028
1029
1031{
1032 if( m_notebook->IsShown() )
1033 {
1034 m_notebook->SetSelection( 0 );
1035 m_markerTreeModel->SelectMarker( aMarker );
1036
1037 // wxWidgets on some platforms fails to correctly ensure that a selected item is
1038 // visible, so we have to do it in a separate idle event.
1039 m_centerMarkerOnIdle = aMarker;
1040 Bind( wxEVT_IDLE, &DIALOG_ERC::centerMarkerIdleHandler, this );
1041 }
1042}
1043
1044
1045void DIALOG_ERC::centerMarkerIdleHandler( wxIdleEvent& aEvent )
1046{
1047 if( m_markerTreeModel->GetView()->IsFrozen() )
1048 return;
1049
1050 m_markerTreeModel->CenterMarker( m_centerMarkerOnIdle );
1051 m_centerMarkerOnIdle = nullptr;
1052 Unbind( wxEVT_IDLE, &DIALOG_ERC::centerMarkerIdleHandler, this );
1053}
1054
1055
1057{
1058 SCH_MARKER* marker = aMarker;
1059
1060 if( marker != nullptr )
1061 m_markerTreeModel->SelectMarker( marker );
1062
1063 RC_TREE_NODE* node = nullptr;
1064
1065 if( m_notebook->GetSelection() == 0 )
1066 {
1067 node = RC_TREE_MODEL::ToNode( m_markerDataView->GetCurrentItem() );
1068
1069 if( node && node->m_RcItem )
1070 marker = dynamic_cast<SCH_MARKER*>( node->m_RcItem->GetParent() );
1071 }
1072
1073 if( !marker || marker->IsExcluded() )
1074 return;
1075
1076 // Route through the provider so its cached counts stay in sync even when the dialog is not on
1077 // the violations tab and has no tree node to refresh.
1078 setMarkerExcluded( m_markerProvider, marker, true );
1079 m_parent->GetCanvas()->GetView()->Update( marker );
1080
1081 // Severity changes affect both report order and the tree's matching provider indices.
1083
1086 m_parent->OnModify();
1087}
1088
1089
1090void DIALOG_ERC::OnEditViolationSeverities( wxHyperlinkEvent& aEvent )
1091{
1092 m_parent->ShowSchematicSetupDialog( _( "Violation Severity" ) );
1093}
1094
1095
1096void DIALOG_ERC::OnSeverity( wxCommandEvent& aEvent )
1097{
1098 if( aEvent.GetEventObject() == m_showAll )
1099 {
1100 m_showErrors->SetValue( true );
1101 m_showWarnings->SetValue( aEvent.IsChecked() );
1102 m_showExclusions->SetValue( aEvent.IsChecked() );
1103 }
1104
1105 UpdateData();
1106}
1107
1108
1109void DIALOG_ERC::DeleteAllMarkers( bool aIncludeExclusions )
1110{
1111 // Clear current selection list to avoid selection of deleted items
1112 // Freeze to avoid repainting the dialog, which can cause a RePaint()
1113 // of the screen as well
1114 Freeze();
1115
1116 m_parent->GetToolManager()->RunAction( ACTIONS::selectionClear );
1117
1118 m_markerTreeModel->DeleteItems( false, aIncludeExclusions, false );
1119
1120 SCH_SCREENS screens( m_parent->Schematic().Root() );
1121 screens.DeleteAllMarkers( MARKER_BASE::MARKER_ERC, aIncludeExclusions );
1122
1123 // DeleteItems() only decremented the cached counts for markers matching the current filter,
1124 // but DeleteAllMarkers() removed hidden severities too; rebuild to resync the counts.
1126
1127 Thaw();
1128}
1129
1130
1131void DIALOG_ERC::OnSaveReport( wxCommandEvent& aEvent )
1132{
1133 wxFileName fn( wxS( "ERC." ) + wxString( FILEEXT::ReportFileExtension ) );
1134
1135 wxFileDialog dlg( this, _( "Save Report File" ), Prj().GetProjectPath(), fn.GetFullName(),
1137 wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
1138
1140
1141 if( dlg.ShowModal() != wxID_OK )
1142 return;
1143
1144 fn = dlg.GetPath();
1145
1146 if( fn.GetExt().IsEmpty() )
1147 fn.SetExt( FILEEXT::ReportFileExtension );
1148
1149 if( !fn.IsAbsolute() )
1150 {
1151 wxString prj_path = Prj().GetProjectPath();
1152 fn.MakeAbsolute( prj_path );
1153 }
1154
1155 ERC_REPORT reportWriter( &m_parent->Schematic(), m_parent->GetUserUnits(), m_markerProvider );
1156
1157 bool success = false;
1158 if( fn.GetExt() == FILEEXT::JsonFileExtension )
1159 success = reportWriter.WriteJsonReport( fn.GetFullPath() );
1160 else
1161 success = reportWriter.WriteTextReport( fn.GetFullPath() );
1162
1163 if( success )
1164 m_messages->Report( wxString::Format( _( "Report file '%s' created." ), fn.GetFullPath() ) );
1165 else
1166 DisplayErrorMessage( this, wxString::Format( _( "Failed to create file '%s'." ), fn.GetFullPath() ) );
1167}
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
Definition bitmap.cpp:106
static TOOL_ACTION excludeMarker
Definition actions.h:125
static TOOL_ACTION selectionClear
Clear the current selection.
Definition actions.h:220
wxButton * m_saveReport
wxButton * m_sdbSizer1Cancel
wxSimplebook * m_runningResultsBook
wxCheckBox * m_showExclusions
NUMBER_BADGE * m_errorsBadge
WX_INFOBAR * m_infoBar
STD_BITMAP_BUTTON * m_bMenu
wxCheckBox * m_showErrors
wxNotebook * m_notebook
wxCheckBox * m_showAll
NUMBER_BADGE * m_exclusionsBadge
wxListCtrl * m_ignoredList
WX_HTML_REPORT_BOX * m_messages
wxDataViewCtrl * m_markerDataView
wxButton * m_deleteAllMarkers
NUMBER_BADGE * m_warningsBadge
wxButton * m_deleteOneMarker
wxCheckBox * m_showWarnings
wxButton * m_sdbSizer1OK
DIALOG_ERC_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Electrical Rules Checker"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
void OnMenu(wxCommandEvent &aEvent) override
void ExcludeMarker(SCH_MARKER *aMarker=nullptr)
Exclude aMarker from the ERC list.
void OnIgnoredItemRClick(wxListEvent &aEvent) override
const SCH_MARKER * m_centerMarkerOnIdle
Definition dialog_erc.h:114
void OnERCItemDClick(wxDataViewEvent &aEvent) override
std::shared_ptr< RC_ITEMS_PROVIDER > m_markerProvider
Definition dialog_erc.h:108
bool TransferDataToWindow() override
bool m_ercRun
Definition dialog_erc.h:112
bool m_crossprobe
Definition dialog_erc.h:116
DIALOG_ERC(SCH_EDIT_FRAME *parent)
bool m_scroll_on_crossprobe
Definition dialog_erc.h:117
void testErc()
void SelectMarker(const SCH_MARKER *aMarker)
bool updateUI() override
SCH_EDIT_FRAME * m_parent
Definition dialog_erc.h:102
wxString m_violationsTitleTemplate
Definition dialog_erc.h:105
void OnERCItemRClick(wxDataViewEvent &aEvent) override
void centerMarkerIdleHandler(wxIdleEvent &aEvent)
void DeleteAllMarkers(bool aIncludeExclusions)
void OnDeleteAllClick(wxCommandEvent &event) override
void OnLinkClicked(wxHtmlLinkEvent &event) override
void OnCharHook(wxKeyEvent &aEvt) override
void OnRunERCClick(wxCommandEvent &event) override
wxString m_ignoredTitleTemplate
Definition dialog_erc.h:106
void OnDeleteOneClick(wxCommandEvent &event) override
void UpdateData()
void OnSaveReport(wxCommandEvent &aEvent) override
int getSeverities()
void PrevMarker()
void NextMarker()
SCHEMATIC * m_currentSchematic
Definition dialog_erc.h:103
void OnEditViolationSeverities(wxHyperlinkEvent &aEvent) override
void UpdateAnnotationWarning()
void redrawDrawPanel()
void Report(const wxString &aMessage) override
Display aMessage in the progress bar dialog.
void OnERCItemSelected(wxDataViewEvent &aEvent) override
RC_TREE_MODEL * m_markerTreeModel
Definition dialog_erc.h:109
void updateDisplayedCounts()
void OnSeverity(wxCommandEvent &aEvent) override
bool m_running
Definition dialog_erc.h:111
bool m_showAllErrors
Definition dialog_erc.h:118
void OnCloseErcDialog(wxCloseEvent &event) override
void OnCancelClick(wxCommandEvent &event) override
bool Show(bool show) override
void SetupStandardButtons(std::map< int, wxString > aLabels={})
bool IsQuasiModal() const
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
virtual void OnCharHook(wxKeyEvent &aEvt)
int ShowModal() override
static std::shared_ptr< ERC_ITEM > Create(int aErrorCode)
Constructs an ERC_ITEM for the given error code.
Definition erc_item.cpp:305
static std::vector< std::reference_wrapper< RC_ITEM > > GetItemsWithSeverities()
Definition erc_item.h:72
bool WriteJsonReport(const wxString &aFullFileName)
Writes a JSON formatted ERC Report to the given file path in the c-locale.
bool WriteTextReport(const wxString &aFullFileName)
Writes the text report also available via GetTextReport directly to a given file path.
Container for ERC settings.
SEVERITY GetSeverity(int aErrorCode) const
void SetSeverity(int aErrorCode, SEVERITY aSeverity)
void RunTests(DS_PROXY_VIEW_ITEM *aDrawingSheet, SCH_EDIT_FRAME *aEditFrame, KIFACE *aCvPcb, PROJECT *aProject, PROGRESS_REPORTER *aProgressReporter)
Definition erc.cpp:2751
A specialisation of the RC_TREE_MODEL class to enable ERC errors / warnings to be resolved in a speci...
Definition erc_item.h:34
Definition kiid.h:46
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
@ FACE_CVPCB
Definition kiway.h:349
bool IsExcluded() const
Definition marker_base.h:89
std::shared_ptr< RC_ITEM > GetRCItem() const
virtual void AdvancePhase() override
Use the next available virtual zone of the dialog progress bar.
virtual void SetCurrentProgress(double aProgress) override
Set the progress value to aProgress (0..1).
virtual void AdvancePhase()=0
Use the next available virtual zone of the dialog progress bar.
virtual const wxString GetProjectPath() const
Return the full path of the project.
Definition project.cpp:183
int GetErrorCode() const
Definition rc_item.h:158
MARKER_BASE * GetParent() const
Definition rc_item.h:134
static RC_TREE_NODE * ToNode(wxDataViewItem aItem)
Definition rc_item.h:267
void ValueChanged(RC_TREE_NODE *aNode)
Definition rc_item.cpp:623
void Update(std::shared_ptr< RC_ITEMS_PROVIDER > aProvider, int aSeverities)
Definition rc_item.cpp:425
static KIID ToUUID(wxDataViewItem aItem)
Definition rc_item.cpp:223
std::shared_ptr< RC_ITEM > m_RcItem
Definition rc_item.h:251
NODE_TYPE m_Type
Definition rc_item.h:250
Holds all the data relating to one schematic.
Definition schematic.h:148
SCH_SHEET & Root() const
Definition schematic.h:199
ERC_SETTINGS & ErcSettings() const
static TOOL_ACTION changeSheet
Schematic editor (Eeschema) main window.
SCHEMATIC & Schematic() const
void InspectERCError(const std::shared_ptr< RC_ITEM > &aERCItem)
wxString InspectERCErrorMenuText(const std::shared_ptr< RC_ITEM > &aERCItem)
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition sch_item.h:165
wxString GetClass() const override
Return the class name.
Definition sch_item.h:175
A helper to define a symbol's reference designator in a schematic.
const SCH_SHEET_PATH & GetSheetPath() const
SCH_SYMBOL * GetSymbol() const
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
Definition sch_screen.h:758
void DeleteMarkers(enum MARKER_BASE::MARKER_T aMarkerTyp, int aErrorCode, bool aIncludeExclusions=true)
Delete all markers of a particular type and error code.
void DeleteAllMarkers(enum MARKER_BASE::MARKER_T aMarkerType, bool aIncludeExclusions)
Delete all electronic rules check markers of aMarkerType from all the screens in the list.
void Append(SCH_ITEM *aItem, bool aUpdateLibSymbol=true)
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
bool empty() const
Forwarded method from std::vector.
SCH_SCREEN * LastScreen()
const KIID_PATH & PathRef() const
Borrow the cached path until this sheet path is modified or destroyed.
VECTOR2I GetPosition() const override
Definition sch_symbol.h:934
An implementation of the RC_ITEM_LIST interface which uses the global SHEETLIST to fulfill the contra...
void SetMarkerExcluded(SCH_MARKER *aMarker, bool aExcluded, const wxString &aComment=wxEmptyString)
Set the exclusion state of a marker while keeping the cached severity counts in sync.
Master controller class:
A KICAD version of wxTextEntryDialog which supports the various improvements/work-arounds from DIALOG...
wxString GetValue() const
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition confirm.cpp:217
This file is part of the common library.
#define KICAD_MESSAGE_DIALOG
Definition confirm.h:48
static bool g_lastERCRun
static void setMarkerExcluded(const std::shared_ptr< RC_ITEMS_PROVIDER > &aProvider, SCH_MARKER *aMarker, bool aExcluded, const wxString &aComment=wxEmptyString)
wxDEFINE_EVENT(EDA_EVT_CLOSE_ERC_DIALOG, wxCommandEvent)
static std::vector< std::pair< wxString, int > > g_lastERCIgnored
static SCHEMATIC * g_lastERCSchematic
#define DIALOG_ERC_WINDOW_NAME
Definition dialog_erc.h:35
#define _(s)
static int DEFAULT_SINGLE_COL_WIDTH
ERCE_T
ERC error codes.
@ ERCE_ENDPOINT_OFF_GRID
Pin or wire-end off grid.
@ ERCE_PIN_TO_PIN_WARNING
@ ERCE_PIN_TO_PIN_ERROR
static const std::string ReportFileExtension
static const std::string JsonFileExtension
static wxString JsonFileWildcard()
static wxString ReportFileWildcard()
void SetFloatLevel(wxWindow *aWindow)
Intended to set the floating window level in macOS on a window.
Definition wxgtk/ui.cpp:510
void ForceFocus(wxWindow *aWindow)
Pass the current focus to the window.
Definition wxgtk/ui.cpp:127
void AllowNetworkFileSystems(wxDialog *aDialog)
Configure a file dialog to show network and virtual file systems.
Definition wxgtk/ui.cpp:521
SEVERITY
@ RPT_SEVERITY_WARNING
@ RPT_SEVERITY_ERROR
@ RPT_SEVERITY_EXCLUSION
@ RPT_SEVERITY_IGNORE
@ RPT_SEVERITY_INFO
@ ANNOTATE_ALL
Annotate the full schematic.
@ SYMBOL_FILTER_NON_POWER
T * GetAppSettings(const char *aFilename)
std::vector< FAB_LAYER_COLOR > dummy
@ MD_ALT
Definition tool_event.h:141
@ MD_CTRL
Definition tool_event.h:140
@ MD_SHIFT
Definition tool_event.h:139
@ SCH_MARKER_T
Definition typeinfo.h:154
Definition of file extensions used in Kicad.