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