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