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