KiCad PCB EDA Suite
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 <stambaughw@gmail.com>
6  * Copyright (C) 1992-2019 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, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
26 #include <fctsys.h>
27 #include <gestfich.h>
28 #include <pgm_base.h>
29 #include <sch_screen.h>
30 #include <sch_edit_frame.h>
31 #include <schematic.h>
32 #include <invoke_sch_dialog.h>
33 #include <project.h>
34 #include <kiface_i.h>
35 #include <bitmaps.h>
36 #include <reporter.h>
38 #include <sch_view.h>
39 #include <sch_marker.h>
40 #include <sch_component.h>
41 #include <connection_graph.h>
42 #include <tools/ee_actions.h>
43 #include <tool/tool_manager.h>
44 #include <dialog_erc.h>
45 #include <erc.h>
46 #include <id.h>
47 #include <confirm.h>
48 #include <widgets/infobar.h>
49 #include <wx/ffile.h>
50 #include <erc_item.h>
51 #include <eeschema_settings.h>
52 
54  DIALOG_ERC_BASE( parent, ID_DIALOG_ERC ), // parent looks for this ID explicitly
55  m_parent( parent ),
56  m_ercRun( false ),
58 {
59  EESCHEMA_SETTINGS* settings = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
61 
64  m_markerDataView->AssociateModel( m_markerTreeModel );
65 
66  wxFont infoFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
67  infoFont.SetSymbolicSize( wxFONTSIZE_SMALL );
68  m_textMarkers->SetFont( infoFont );
69  m_titleMessages->SetFont( infoFont );
70 
75 
76  // We use a sdbSizer to get platform-dependent ordering of the action buttons, but
77  // that requires us to correct the button labels here.
78  m_sdbSizer1OK->SetLabel( _( "Run" ) );
79  m_sdbSizer1Cancel->SetLabel( _( "Close" ) );
80  m_sdbSizer1->Layout();
81 
82  m_sdbSizer1OK->SetDefault();
83 
85  m_infoBar->ShowMessage( _( "Some components are not annotated. ERC cannot be run." ) );
86 
87  // Now all widgets have the size fixed, call FinishDialogSettings
89 }
90 
91 
93 {
94  EESCHEMA_SETTINGS* settings = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
95  wxASSERT( settings );
96 
97  if( settings )
99 
100  m_markerTreeModel->DecRef();
101 }
102 
103 
105 {
106  int numErrors = 0;
107  int numWarnings = 0;
108  int numExcluded = 0;
109 
110  if( m_markerProvider )
111  {
115  }
116 
117  if( !m_ercRun )
118  {
119  numErrors = -1;
120  numWarnings = -1;
121  }
122 
123  m_errorsBadge->SetBitmap( MakeBadge( RPT_SEVERITY_ERROR, numErrors, m_errorsBadge ) );
124  m_warningsBadge->SetBitmap( MakeBadge( RPT_SEVERITY_WARNING, numWarnings, m_warningsBadge ) );
126 }
127 
128 
129 /* Delete the old ERC markers, over the whole hierarchy
130  */
131 void DIALOG_ERC::OnEraseDrcMarkersClick( wxCommandEvent& event )
132 {
133  bool includeExclusions = false;
134  int numExcluded = 0;
135 
136  if( m_markerProvider )
138 
139  if( numExcluded > 0 )
140  {
141  wxMessageDialog dlg( this, _( "Delete exclusions too?" ), _( "Delete All Markers" ),
142  wxYES_NO | wxCANCEL | wxCENTER | wxICON_QUESTION );
143  dlg.SetYesNoLabels( _( "Errors and Warnings Only" ) , _( "Errors, Warnings and Exclusions" ) );
144 
145  int ret = dlg.ShowModal();
146 
147  if( ret == wxID_CANCEL )
148  return;
149  else if( ret == wxID_NO )
150  includeExclusions = true;
151  }
152 
153  deleteAllMarkers( includeExclusions );
154 
155  m_ercRun = false;
157  m_parent->GetCanvas()->Refresh();
158 }
159 
160 
161 // This is a modeless dialog so we have to handle these ourselves.
162 void DIALOG_ERC::OnButtonCloseClick( wxCommandEvent& event )
163 {
164  m_parent->FocusOnItem( nullptr );
165 
166  Close();
167 }
168 
169 
170 void DIALOG_ERC::OnCloseErcDialog( wxCloseEvent& event )
171 {
172  m_parent->FocusOnItem( nullptr );
173 
174  Destroy();
175 }
176 
177 
179 
180 
182 {
183  m_showAll->SetValue( m_severities == RPT_SEVERITY_ALL );
187 }
188 
189 
190 void DIALOG_ERC::OnRunERCClick( wxCommandEvent& event )
191 {
192  wxBusyCursor busy;
193  deleteAllMarkers( true );
194 
195  m_MessagesList->Clear();
196  wxSafeYield(); // m_MarkersList must be redraw
197 
199  testErc( reporter );
200 
201  m_ercRun = true;
203 }
204 
205 
207 {
208  WINDOW_THAWER thawer( m_parent );
209 
210  m_parent->GetCanvas()->Refresh();
211 }
212 
213 
214 void DIALOG_ERC::testErc( REPORTER& aReporter )
215 {
216  wxFileName fn;
217 
218  SCHEMATIC* sch = &m_parent->Schematic();
219 
220  // Build the whole sheet list in hierarchy (sheet, not screen)
222 
223  if( m_parent->CheckAnnotate( aReporter, false ) )
224  {
225  if( aReporter.HasMessage() )
226  aReporter.ReportTail( _( "Some components are not annotated. ERC cannot be run." ),
228 
229  if( IsOK( m_parent, _( "Some components are not annotated. Open annotation dialog?" ) ) )
230  {
231  wxCommandEvent dummy;
233 
234  // We don't actually get notified when the annotation error is resolved, but we can
235  // assume that the user will take corrective action. If they don't, we can just show
236  // the dialog again.
237  m_infoBar->Hide();
238  }
239  else
240  {
241  m_infoBar->ShowMessage( _( "Some components are not annotated. ERC cannot be run." ) );
242  }
243 
244  return;
245  }
246 
247  m_infoBar->Hide();
248 
249  SCH_SCREENS screens( sch->Root() );
250  ERC_SETTINGS& settings = sch->ErcSettings();
251  ERC_TESTER tester( sch );
252 
253  // Test duplicate sheet names inside a given sheet. While one can have multiple references
254  // to the same file, each must have a unique name.
255  if( settings.IsTestEnabled( ERCE_DUPLICATE_SHEET_NAME ) )
256  {
257  aReporter.ReportTail( _( "Checking sheet names...\n" ), RPT_SEVERITY_INFO );
258  tester.TestDuplicateSheetNames( true );
259  }
260 
261  if( settings.IsTestEnabled( ERCE_BUS_ALIAS_CONFLICT ) )
262  {
263  aReporter.ReportTail( _( "Checking bus conflicts...\n" ), RPT_SEVERITY_INFO );
264  tester.TestConflictingBusAliases();
265  }
266 
267  // The connection graph has a whole set of ERC checks it can run
268  aReporter.ReportTail( _( "Checking conflicts...\n" ) );
270  sch->ConnectionGraph()->RunERC();
271 
272  // Test is all units of each multiunit component have the same footprint assigned.
273  if( settings.IsTestEnabled( ERCE_DIFFERENT_UNIT_FP ) )
274  {
275  aReporter.ReportTail( _( "Checking footprints...\n" ), RPT_SEVERITY_INFO );
276  tester.TestMultiunitFootprints();
277  }
278 
279  aReporter.ReportTail( _( "Checking pins...\n" ), RPT_SEVERITY_INFO );
280 
281  if( settings.IsTestEnabled( ERCE_DIFFERENT_UNIT_NET ) )
282  tester.TestMultUnitPinConflicts();
283 
284  // Test pins on each net against the pin connection table
285  if( settings.IsTestEnabled( ERCE_PIN_TO_PIN_ERROR ) )
286  tester.TestPinToPin();
287 
288  // Test similar labels (i;e. labels which are identical when
289  // using case insensitive comparisons)
290  if( settings.IsTestEnabled( ERCE_SIMILAR_LABELS ) )
291  {
292  aReporter.ReportTail( _( "Checking labels...\n" ), RPT_SEVERITY_INFO );
293  tester.TestSimilarLabels();
294  }
295 
296  if( settings.IsTestEnabled( ERCE_UNRESOLVED_VARIABLE ) )
298 
299  if( settings.IsTestEnabled( ERCE_NOCONNECT_CONNECTED ) )
300  tester.TestNoConnectPins();
301 
302  // Display diags:
304 
305  // Display new markers from the current screen:
306  KIGFX::VIEW* view = m_parent->GetCanvas()->GetView();
307 
308  for( auto item : m_parent->GetScreen()->Items().OfType( SCH_MARKER_T ) )
309  view->Add( item );
310 
311  m_parent->GetCanvas()->Refresh();
312 
313  // Display message
314  aReporter.ReportTail( _( "Finished" ), RPT_SEVERITY_INFO );
315 }
316 
317 
318 void DIALOG_ERC::OnERCItemSelected( wxDataViewEvent& aEvent )
319 {
320  const KIID& itemID = RC_TREE_MODEL::ToUUID( aEvent.GetItem() );
321  SCH_SHEET_PATH sheet;
322  SCH_ITEM* item = m_parent->Schematic().GetSheets().GetItem( itemID, &sheet );
323 
324  if( item && item->GetClass() != wxT( "DELETED_SHEET_ITEM" ) )
325  {
326  WINDOW_THAWER thawer( m_parent );
327 
328  if( !sheet.empty() && sheet != m_parent->GetCurrentSheet() )
329  {
332 
333  m_parent->SetCurrentSheet( sheet );
336  }
337 
338  m_parent->FocusOnItem( item );
339  redrawDrawPanel();
340  }
341 
342  aEvent.Skip();
343 }
344 
345 
346 void DIALOG_ERC::OnERCItemDClick( wxDataViewEvent& aEvent )
347 {
348  if( aEvent.GetItem().IsOk() )
349  {
350  // turn control over to m_parent, hide this DIALOG_ERC window,
351  // no destruction so we can preserve listbox cursor
352  if( !IsModal() )
353  Show( false );
354  }
355 
356  aEvent.Skip();
357 }
358 
359 
360 void DIALOG_ERC::OnERCItemRClick( wxDataViewEvent& aEvent )
361 {
362  RC_TREE_NODE* node = RC_TREE_MODEL::ToNode( aEvent.GetItem() );
363 
364  if( !node )
365  return;
366 
367  ERC_SETTINGS& settings = m_parent->Schematic().ErcSettings();
368 
369  std::shared_ptr<RC_ITEM> rcItem = node->m_RcItem;
370  wxString listName;
371  wxMenu menu;
372  wxString msg;
373 
374  switch( settings.GetSeverity( rcItem->GetErrorCode() ) )
375  {
376  case RPT_SEVERITY_ERROR: listName = _( "errors" ); break;
377  case RPT_SEVERITY_WARNING: listName = _( "warnings" ); break;
378  default: listName = _( "appropriate" ); break;
379  }
380 
381  if( rcItem->GetParent()->IsExcluded() )
382  {
383  menu.Append( 1, _( "Remove exclusion for this violation" ),
384  wxString::Format( _( "It will be placed back in the %s list" ), listName ) );
385  }
386  else
387  {
388  menu.Append( 2, _( "Exclude this violation" ),
389  wxString::Format( _( "It will be excluded from the %s list" ), listName ) );
390  }
391 
392  menu.AppendSeparator();
393 
394  if( rcItem->GetErrorCode() == ERCE_PIN_TO_PIN_WARNING
395  || rcItem->GetErrorCode() == ERCE_PIN_TO_PIN_ERROR )
396  {
397  // Pin to pin severities edited through pin conflict map
398  }
399  else if( settings.GetSeverity( rcItem->GetErrorCode() ) == RPT_SEVERITY_WARNING )
400  {
401  menu.Append( 4, wxString::Format( _( "Change severity to Error for all '%s' violations" ),
402  rcItem->GetErrorText() ),
403  _( "Violation severities can also be edited in the Board Setup... dialog" ) );
404  }
405  else
406  {
407  menu.Append( 5, wxString::Format( _( "Change severity to Warning for all '%s' violations" ),
408  rcItem->GetErrorText() ),
409  _( "Violation severities can also be edited in the Board Setup... dialog" ) );
410  }
411 
412  menu.Append( 6, wxString::Format( _( "Ignore all '%s' violations" ), rcItem->GetErrorText() ),
413  _( "Violations will not be checked or reported" ) );
414 
415  menu.AppendSeparator();
416 
417  if( rcItem->GetErrorCode() == ERCE_PIN_TO_PIN_WARNING
418  || rcItem->GetErrorCode() == ERCE_PIN_TO_PIN_ERROR )
419  {
420  menu.Append( 7, _( "Edit pin-to-pin conflict map..." ) );
421  }
422  else
423  {
424  menu.Append( 8, _( "Edit violation severities..." ),
425  _( "Open the Schematic Setup... dialog" ) );
426  }
427 
428  switch( GetPopupMenuSelectionFromUser( menu ) )
429  {
430  case 1:
431  node->m_RcItem->GetParent()->SetExcluded( false );
432 
433  // Update view
434  static_cast<RC_TREE_MODEL*>( aEvent.GetModel() )->ValueChanged( node );
436  break;
437 
438  case 2:
439  node->m_RcItem->GetParent()->SetExcluded( true );
440 
441  // Update view
443  static_cast<RC_TREE_MODEL*>( aEvent.GetModel() )->ValueChanged( node );
444  else
445  static_cast<RC_TREE_MODEL*>( aEvent.GetModel() )->DeleteCurrentItem( false );
446 
448  break;
449 
450  case 4:
451  settings.SetSeverity( rcItem->GetErrorCode(), RPT_SEVERITY_ERROR );
452 
453  // Rebuild model and view
454  static_cast<RC_TREE_MODEL*>( aEvent.GetModel() )->SetProvider( m_markerProvider );
456  break;
457 
458  case 5:
459  settings.SetSeverity( rcItem->GetErrorCode(), RPT_SEVERITY_WARNING );
460 
461  // Rebuild model and view
462  static_cast<RC_TREE_MODEL*>( aEvent.GetModel() )->SetProvider( m_markerProvider );
464  break;
465 
466  case 6:
467  {
468  settings.SetSeverity( rcItem->GetErrorCode(), RPT_SEVERITY_IGNORE );
469 
470  if( rcItem->GetErrorCode() == ERCE_PIN_TO_PIN_ERROR )
472 
473  SCH_SCREENS ScreenList( m_parent->Schematic().Root() );
474  ScreenList.DeleteMarkers( MARKER_BASE::MARKER_ERC, rcItem->GetErrorCode() );
475 
476  // Rebuild model and view
477  static_cast<RC_TREE_MODEL*>( aEvent.GetModel() )->SetProvider( m_markerProvider );
479  }
480  break;
481 
482  case 7:
483  m_parent->ShowSchematicSetupDialog( _( "Pin Conflicts Map" ) );
484  break;
485 
486  case 8:
487  m_parent->ShowSchematicSetupDialog( _( "Violation Severity" ) );
488  break;
489  }
490 }
491 
492 
493 void DIALOG_ERC::OnSeverity( wxCommandEvent& aEvent )
494 {
495  int flag = 0;
496 
497  if( aEvent.GetEventObject() == m_showAll )
498  flag = RPT_SEVERITY_ALL;
499  else if( aEvent.GetEventObject() == m_showErrors )
500  flag = RPT_SEVERITY_ERROR;
501  else if( aEvent.GetEventObject() == m_showWarnings )
502  flag = RPT_SEVERITY_WARNING;
503  else if( aEvent.GetEventObject() == m_showExclusions )
504  flag = RPT_SEVERITY_EXCLUSION;
505 
506  if( aEvent.IsChecked() )
507  m_severities |= flag;
508  else if( aEvent.GetEventObject() == m_showAll )
510  else
511  m_severities &= ~flag;
512 
513  syncCheckboxes();
514 
515  // Set the provider's severity levels through the TreeModel so that the old tree
516  // can be torn down before the severity changes.
517  //
518  // It's not clear this is required, but we've had a lot of issues with wxDataView
519  // being cranky on various platforms.
520 
522 
524 }
525 
526 
527 void DIALOG_ERC::deleteAllMarkers( bool aIncludeExclusions )
528 {
529  // Clear current selection list to avoid selection of deleted items
531 
532  m_markerTreeModel->DeleteItems( false, aIncludeExclusions, true );
533 }
534 
535 
536 void DIALOG_ERC::OnSaveReport( wxCommandEvent& aEvent )
537 {
538  wxFileName fn( "./ERC." + ReportFileExtension );
539 
540  wxFileDialog dlg( this, _( "Save Report to File" ), fn.GetPath(), fn.GetFullName(),
541  ReportFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
542 
543  if( dlg.ShowModal() != wxID_OK )
544  return;
545 
546  fn = dlg.GetPath();
547 
548  if( fn.GetExt().IsEmpty() )
549  fn.SetExt( ReportFileExtension );
550 
551  if( !fn.IsAbsolute() )
552  {
553  wxString prj_path = Prj().GetProjectPath();
554  fn.MakeAbsolute( prj_path );
555  }
556 
557  if( writeReport( fn.GetFullPath() ) )
558  {
559  m_MessagesList->AppendText( wxString::Format( _( "Report file '%s' created\n" ),
560  fn.GetFullPath() ) );
561  }
562  else
563  {
564  DisplayError( this, wxString::Format( _( "Unable to create report file '%s'" ),
565  fn.GetFullPath() ) );
566  }
567 }
568 
569 
570 bool DIALOG_ERC::writeReport( const wxString& aFullFileName )
571 {
572  wxFFile file( aFullFileName, wxT( "wt" ) );
573 
574  if( !file.IsOpened() )
575  return false;
576 
577  wxString msg = wxString::Format( _( "ERC report (%s, Encoding UTF8)\n" ), DateAndTime() );
578 
579  std::map<KIID, EDA_ITEM*> itemMap;
580 
581  int err_count = 0;
582  int warn_count = 0;
583  int total_count = 0;
584  SCH_SHEET_LIST sheetList = m_parent->Schematic().GetSheets();
585 
586  sheetList.FillItemMap( itemMap );
587 
588  ERC_SETTINGS& settings = m_parent->Schematic().ErcSettings();
589 
590  for( unsigned i = 0; i < sheetList.size(); i++ )
591  {
592  msg << wxString::Format( _( "\n***** Sheet %s\n" ), sheetList[i].PathHumanReadable() );
593 
594  for( SCH_ITEM* aItem : sheetList[i].LastScreen()->Items().OfType( SCH_MARKER_T ) )
595  {
596  const SCH_MARKER* marker = static_cast<const SCH_MARKER*>( aItem );
597  RC_ITEM* item = marker->GetRCItem().get();
598  SEVERITY severity = (SEVERITY)settings.GetSeverity( item->GetErrorCode() );
599 
600  if( marker->GetMarkerType() != MARKER_BASE::MARKER_ERC )
601  continue;
602 
603  total_count++;
604 
605  switch( severity )
606  {
607  case RPT_SEVERITY_ERROR: err_count++; break;
608  case RPT_SEVERITY_WARNING: warn_count++; break;
609  default: break;
610  }
611 
612  msg << marker->GetRCItem()->ShowReport( GetUserUnits(), severity, itemMap );
613  }
614  }
615 
616  msg << wxString::Format( _( "\n ** ERC messages: %d Errors %d Warnings %d\n" ),
617  total_count, err_count, warn_count );
618 
619  // Currently: write report using UTF8 (as usual in Kicad).
620  // TODO: see if we can use the current encoding page (mainly for Windows users),
621  // Or other format (HTML?)
622  file.Write( msg );
623 
624  // wxFFile dtor will close the file.
625 
626  return true;
627 }
628 
629 
630 wxDialog* InvokeDialogERC( SCH_EDIT_FRAME* aCaller )
631 {
632  // This is a modeless dialog, so new it rather than instantiating on stack.
633  DIALOG_ERC* dlg = new DIALOG_ERC( aCaller );
634 
635  dlg->Show( true );
636 
637  return dlg; // wxDialog is information hiding about DIALOG_ERC.
638 }
void SetCurrentSheet(const SCH_SHEET_PATH &aSheet)
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:239
void DeleteItems(bool aCurrentOnly, bool aIncludeExclusions, bool aDeep)
Deletes the current item or all items.
Definition: rc_item.cpp:424
SCH_SHEET_LIST.
KIGFX::SCH_VIEW * GetView() const override
Function GetView() Returns a pointer to the VIEW instance used in the panel.
void ShowMessage(const wxString &aMessage, int aFlags=wxICON_INFORMATION) override
Show the info bar with the provided message and icon.
Definition: infobar.cpp:119
virtual bool HasMessage() const =0
Function HasMessage Returns true if the reporter client is non-empty.
void deleteAllMarkers(bool aIncludeExclusions)
Definition: dialog_erc.cpp:527
wxTextCtrl * m_MessagesList
void OnERCItemRClick(wxDataViewEvent &aEvent) override
Definition: dialog_erc.cpp:360
void DeleteMarkers(enum MARKER_BASE::TYPEMARKER aMarkerTyp, int aErrorCode, bool aIncludeExclusions=true)
Delete all markers of a particular type and error code.
virtual void RedrawScreen(const wxPoint &aCenterPoint, bool aWarpPointer)
SCH_SHEET_LIST GetSheets() const
Builds and returns an updated schematic hierarchy TODO: can this be cached?
Definition: schematic.h:89
void SetProvider(RC_ITEMS_PROVIDER *aProvider)
Definition: rc_item.cpp:257
This file is part of the common library TODO brief description.
void RecalculateConnections(SCH_CLEANUP_FLAGS aCleanupFlags)
Generates the connection data for the entire schematic hierarchy.
SCH_ITEM * GetItem(const KIID &aID, SCH_SHEET_PATH *aPathOut=nullptr)
Fetch a SCH_ITEM by ID.
int TestMultUnitPinConflicts()
Checks if shared pins on multi-unit components have been connected to different nets.
RC_TREE_MODEL * m_markerTreeModel
Definition: dialog_erc.h:43
Holds all the data relating to one schematic A schematic may consist of one or more sheets (and one r...
Definition: schematic.h:42
CONNECTION_GRAPH * ConnectionGraph() const
Definition: schematic.h:129
This file is part of the common library.
void syncCheckboxes()
Definition: dialog_erc.cpp:181
Class DIALOG_ERC_BASE.
SEVERITY
Definition: ui_common.h:45
RC_ITEM is a holder for a DRC (in Pcbnew) or ERC (in Eeschema) error item.
Definition: rc_item.h:74
bool writeReport(const wxString &aFullFileName)
Definition: dialog_erc.cpp:570
void OnEraseDrcMarkersClick(wxCommandEvent &event) override
Definition: dialog_erc.cpp:131
EE_TYPE OfType(KICAD_T aType)
Definition: sch_rtree.h:219
virtual REPORTER & ReportTail(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Function ReportTail Places the report at the end of the list, for objects that support report orderin...
Definition: reporter.h:94
void FinishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
static TOOL_ACTION cancelInteractive
Definition: actions.h:65
RC_ITEMS_PROVIDER * m_markerProvider
Definition: dialog_erc.h:42
wxCheckBox * m_showExclusions
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:140
void TestTextVars(KIGFX::WS_PROXY_VIEW_ITEM *aWorksheet)
Checks for any unresolved text variable references.
void updateDisplayedCounts()
Definition: dialog_erc.cpp:104
Definition: erc.h:51
WS_PROXY_VIEW_ITEM * GetWorksheet() const
Definition: sch_view.h:104
virtual int GetCount(int aSeverity=-1)=0
Schematic editor (Eeschema) main window.
static KIID ToUUID(wxDataViewItem aItem)
Definition: rc_item.cpp:118
void DisplayCurrentSheet()
Draw the current sheet on the display.
Definition: hierarch.cpp:236
REPORTER is a pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:64
void OnSeverity(wxCommandEvent &aEvent) override
Definition: dialog_erc.cpp:493
SHEETLIST_ERC_ITEMS_PROVIDER is an implementation of the RC_ITEM_LISTinterface which uses the global ...
Definition: erc_settings.h:174
wxButton * m_sdbSizer1Cancel
VTBL_ENTRY const wxString GetProjectPath() const
Function GetProjectPath returns the full path of the project.
Definition: project.cpp:124
static int RPT_SEVERITY_ALL
Definition: dialog_erc.cpp:178
WX_TEXT_CTRL_REPORTER is wrapper for reporting to a wxTextCtrl object.
Definition: reporter.h:136
void SetSeverities(int aSeverities)
Definition: rc_item.cpp:263
EDA_UNITS GetUserUnits() const
Definition: dialog_shim.h:131
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
void FillItemMap(std::map< KIID, EDA_ITEM * > &aMap)
Fill an item cache for temporary use when many items need to be fetched.
void SetSeverity(int aErrorCode, int aSeverity)
Definition: common.h:68
void testErc(REPORTER &aReporter)
Definition: dialog_erc.cpp:214
wxCheckBox * m_showAll
int TestConflictingBusAliases()
Checks that there are not conflicting bus alias definitions in the schematic.
int GetSeverity(int aErrorCode) const
std::shared_ptr< RC_ITEM > m_RcItem
Definition: rc_item.h:202
wxButton * m_sdbSizer1OK
static RC_TREE_NODE * ToNode(wxDataViewItem aItem)
Definition: rc_item.h:217
wxString ReportFileWildcard()
int TestMultiunitFootprints()
Test if all units of each multiunit component have the same footprint assigned.
wxStdDialogButtonSizer * m_sdbSizer1
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
wxStaticText * m_textMarkers
int GetErrorCode() const
Definition: rc_item.h:157
SCHEMATIC & Schematic() const
Definition of file extensions used in Kicad.
wxStaticBitmap * m_warningsBadge
int m_severities
Definition: dialog_erc.h:47
DIALOG_ERC(SCH_EDIT_FRAME *parent)
Definition: dialog_erc.cpp:53
void OnButtonCloseClick(wxCommandEvent &event) override
Definition: dialog_erc.cpp:162
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:56
Container for ERC settings.
Definition: erc_settings.h:88
SCH_SHEET_PATH.
void OnERCItemSelected(wxDataViewEvent &aEvent) override
Definition: dialog_erc.cpp:318
SCH_EDIT_FRAME * m_parent
Definition: dialog_erc.h:40
wxStaticBitmap * m_errorsBadge
bool Show(bool show) override
void OnCloseErcDialog(wxCloseEvent &event) override
Definition: dialog_erc.cpp:170
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
int CheckAnnotate(REPORTER &aReporter, bool aOneSheetOnly)
Check for annotation errors.
void OnERCItemDClick(wxDataViewEvent &aEvent) override
Definition: dialog_erc.cpp:346
void OnAnnotate(wxCommandEvent &event)
wxCheckBox * m_showWarnings
WX_INFOBAR * m_infoBar
eeschema ERC modeless dialog ID
Definition: id.h:184
wxCheckBox * m_showErrors
SCH_SHEET & Root() const
Definition: schematic.h:94
see class PGM_BASE
wxDataViewCtrl * m_markerDataView
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:201
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.
enum TYPEMARKER GetMarkerType() const
Definition: marker_base.h:107
const std::string ReportFileExtension
wxBitmap MakeBadge(SEVERITY aStyle, int aCount, wxWindow *aWindow, int aDepth)
Definition: ui_common.cpp:36
wxStaticText * m_titleMessages
#define _(s)
Definition: 3d_actions.cpp:33
int TestPinToPin()
Checks the full netlist against the pin-to-pin connectivity requirements.
EE_RTREE & Items()
Definition: sch_screen.h:158
void OnSaveReport(wxCommandEvent &aEvent) override
Definition: dialog_erc.cpp:536
bool m_ercRun
Definition: dialog_erc.h:45
wxStaticBitmap * m_exclusionsBadge
virtual wxString GetClass() const override
Function GetClass returns the class name.
Definition: sch_item.h:221
SCH_SHEET_PATH & GetCurrentSheet() const
void FocusOnItem(SCH_ITEM *aItem)
void AnnotatePowerSymbols()
Function AnnotatePowerSymbols Silently annotates the not yet annotated power symbols of the entire hi...
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Function Add() Adds a VIEW_ITEM to the view.
Definition: view.cpp:345
VECTOR2D m_ScrollCenter
Current scroll center point in logical units.
Definition: base_screen.h:75
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:78
ERC_SETTINGS & ErcSettings() const
Definition: schematic.cpp:131
static REPORTER & GetInstance()
Definition: reporter.cpp:105
VIEW.
Definition: view.h:61
int TestSimilarLabels()
Checks for labels that differ only in capitalization.
void ShowSchematicSetupDialog(const wxString &aInitialPage=wxEmptyString)
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:194
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
Definition: confirm.cpp:283
wxDialog * InvokeDialogERC(SCH_EDIT_FRAME *aCaller)
Create the modeless DIALOG_ERC and show it, return something to destroy or close it.
Definition: dialog_erc.cpp:630
int TestNoConnectPins()
In KiCad 5 and earlier, you could connect stuff up to pins with NC electrical type.
void redrawDrawPanel()
Definition: dialog_erc.cpp:206
int RunERC()
Runs electrical rule checks on the connectivity graph.
std::shared_ptr< RC_ITEM > GetRCItem() const
Function GetReporter returns the DRC_ITEM held within this MARKER so that its interface may be used.
Definition: marker_base.h:120
wxString DateAndTime()
Definition: string.cpp:400
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
Definition: sch_screen.h:515
int TestDuplicateSheetNames(bool aCreateMarker)
inside a given sheet, one cannot have sheets with duplicate names (file names can be duplicated).
void OnRunERCClick(wxCommandEvent &event) override
Definition: dialog_erc.cpp:190