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 <invoke_sch_dialog.h>
32 #include <project.h>
33 #include <kiface_i.h>
34 #include <bitmaps.h>
35 #include <reporter.h>
37 #include <sch_view.h>
38 #include <netlist_object.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 <wx/ffile.h>
49 #include <erc_item.h>
50 #include <eeschema_settings.h>
51 
53  DIALOG_ERC_BASE( parent, ID_DIALOG_ERC ), // parent looks for this ID explicitly
54  m_parent( parent ),
56 {
57  EESCHEMA_SETTINGS* settings = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
59 
62  m_markerDataView->AssociateModel( m_markerTreeModel );
63 
64  wxFont infoFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
65  infoFont.SetSymbolicSize( wxFONTSIZE_SMALL );
66  m_textMarkers->SetFont( infoFont );
67  m_titleMessages->SetFont( infoFont );
68 
73 
74  // We use a sdbSizer to get platform-dependent ordering of the action buttons, but
75  // that requires us to correct the button labels here.
76  m_sdbSizer1OK->SetLabel( _( "Run" ) );
77  m_sdbSizer1Cancel->SetLabel( _( "Close" ) );
78  m_sdbSizer1->Layout();
79 
80  m_sdbSizer1OK->SetDefault();
81 
82  // Now all widgets have the size fixed, call FinishDialogSettings
84 }
85 
86 
88 {
89  EESCHEMA_SETTINGS* settings = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
91 
92  m_markerTreeModel->DecRef();
93 }
94 
95 
97 {
98  int numErrors = 0;
99  int numWarnings = 0;
100  int numExcluded = 0;
101 
102  if( m_markerProvider )
103  {
107  }
108 
109  m_errorsBadge->SetBitmap( MakeBadge( RPT_SEVERITY_ERROR, numErrors, m_errorsBadge ) );
110  m_warningsBadge->SetBitmap( MakeBadge( RPT_SEVERITY_WARNING, numWarnings, m_warningsBadge ) );
112 }
113 
114 
115 /* Delete the old ERC markers, over the whole hierarchy
116  */
117 void DIALOG_ERC::OnEraseDrcMarkersClick( wxCommandEvent& event )
118 {
120 
122  m_parent->GetCanvas()->Refresh();
123 }
124 
125 
126 // This is a modeless dialog so we have to handle these ourselves.
127 void DIALOG_ERC::OnButtonCloseClick( wxCommandEvent& event )
128 {
129  m_parent->FocusOnItem( nullptr );
130 
131  Close();
132 }
133 
134 
135 void DIALOG_ERC::OnCloseErcDialog( wxCloseEvent& event )
136 {
137  m_parent->FocusOnItem( nullptr );
138 
139  Destroy();
140 }
141 
142 
144 
145 
147 {
148  m_showAll->SetValue( m_severities == RPT_SEVERITY_ALL );
152 }
153 
154 
155 void DIALOG_ERC::OnRunERCClick( wxCommandEvent& event )
156 {
157  wxBusyCursor busy;
159 
160  m_MessagesList->Clear();
161  wxSafeYield(); // m_MarkersList must be redraw
162 
164  TestErc( reporter );
165 }
166 
167 
169 {
170  WINDOW_THAWER thawer( m_parent );
171 
172  m_parent->GetCanvas()->Refresh();
173 }
174 
175 
176 void DIALOG_ERC::TestErc( REPORTER& aReporter )
177 {
178  wxFileName fn;
179 
180  // Build the whole sheet list in hierarchy (sheet, not screen)
181  SCH_SHEET_LIST sheets( g_RootSheet );
182  sheets.AnnotatePowerSymbols();
183 
184  if( m_parent->CheckAnnotate( aReporter, false ) )
185  {
186  if( aReporter.HasMessage() )
187  aReporter.ReportTail( _( "Annotation required!" ), RPT_SEVERITY_ERROR );
188 
189  return;
190  }
191 
192  SCH_SCREENS screens;
193 
194  // Test duplicate sheet names inside a given sheet. While one can have multiple references
195  // to the same file, each must have a unique name.
197  {
198  aReporter.ReportTail( _( "Checking sheet names...\n" ), RPT_SEVERITY_INFO );
199  TestDuplicateSheetNames( true );
200  }
201 
203  {
204  aReporter.ReportTail( _( "Checking bus conflicts...\n" ), RPT_SEVERITY_INFO );
206  }
207 
208  // The connection graph has a whole set of ERC checks it can run
209  aReporter.ReportTail( _( "Checking conflicts...\n" ) );
212 
213  // Test is all units of each multiunit component have the same footprint assigned.
215  {
216  aReporter.ReportTail( _( "Checking footprints...\n" ), RPT_SEVERITY_INFO );
217  TestMultiunitFootprints( sheets );
218  }
219 
220  std::unique_ptr<NETLIST_OBJECT_LIST> objectsConnectedList( m_parent->BuildNetListBase() );
221 
222  // Reset the connection type indicator
223  objectsConnectedList->ResetConnectionsType();
224 
225  unsigned lastItemIdx = 0;
226  unsigned nextItemIdx = 0;
227  int MinConn = NOC;
228 
229  // Check that a pin appears in only one net. This check is necessary because multi-unit
230  // components that have shared pins could be wired to different nets.
231  std::unordered_map<wxString, wxString> pin_to_net_map;
232 
233  // The netlist generated by SCH_EDIT_FRAME::BuildNetListBase is sorted by net number, which
234  // means we can group netlist items into ranges that live in the same net. The range from
235  // nextItem to the current item (exclusive) needs to be checked against the current item.
236  // The lastItem variable is used as a helper to pass the last item's number from one loop
237  // iteration to the next, which simplifies the initial pass.
238  aReporter.ReportTail( _( "Checking connections...\n" ), RPT_SEVERITY_INFO );
239  for( unsigned itemIdx = 0; itemIdx < objectsConnectedList->size(); itemIdx++ )
240  {
241  auto item = objectsConnectedList->GetItem( itemIdx );
242  auto lastItem = objectsConnectedList->GetItem( lastItemIdx );
243 
244  auto lastNet = lastItem->GetNet();
245  auto net = item->GetNet();
246 
247  wxASSERT_MSG( lastNet <= net, wxT( "Netlist not correctly ordered" ) );
248 
249  if( lastNet != net )
250  {
251  // New net found:
252  MinConn = NOC;
253  nextItemIdx = itemIdx;
254  }
255 
256  switch( item->m_Type )
257  {
258  // These items do not create erc problems
261  case NETLIST_ITEM::BUS:
263  case NETLIST_ITEM::LABEL:
267  break;
268 
269  // TODO(JE) Port this to the new system
270  case NETLIST_ITEM::PIN:
271  {
272  // Check if this pin has appeared before on a different net
273  if( item->m_Link && g_ErcSettings->IsTestEnabled( ERCE_DIFFERENT_UNIT_NET ) )
274  {
275  wxString ref = item->GetComponentParent()->GetRef( &item->m_SheetPath );
276  wxString pin_name = ref + "_" + item->m_PinNum;
277  wxString msg;
278 
279  if( pin_to_net_map.count( pin_name ) == 0 )
280  {
281  pin_to_net_map[pin_name] = item->GetNetName();
282  }
283  else if( pin_to_net_map[pin_name] != item->GetNetName() )
284  {
285  msg.Printf( _( "Pin %s on %s is connected to both %s and %s" ),
286  item->m_PinNum,
287  ref,
288  pin_to_net_map[pin_name],
289  item->GetNetName() );
290 
292  marker->SetData( ERCE_DIFFERENT_UNIT_NET, item->m_Start, msg, item->m_Start );
293  item->m_SheetPath.LastScreen()->Append( marker );
294  }
295  }
296 
297  // Look for ERC problems between pins:
298  TestOthersItems( objectsConnectedList.get(), itemIdx, nextItemIdx, &MinConn );
299  break;
300  }
301  default:
302  break;
303  }
304 
305  lastItemIdx = itemIdx;
306  }
307 
308  // Test similar labels (i;e. labels which are identical when
309  // using case insensitive comparisons)
311  {
312  aReporter.ReportTail( _( "Checking labels...\n" ), RPT_SEVERITY_INFO );
313  objectsConnectedList->TestforSimilarLabels();
314  }
315 
316  // Display diags:
318 
319  // Displays global results:
321 
322  // Display new markers from the current screen:
323  KIGFX::VIEW* view = m_parent->GetCanvas()->GetView();
324 
325  for( auto item : m_parent->GetScreen()->Items().OfType( SCH_MARKER_T ) )
326  view->Add( item );
327 
328  m_parent->GetCanvas()->Refresh();
329 
330  // Display message
331  aReporter.ReportTail( _( "Finished" ), RPT_SEVERITY_INFO );
332 }
333 
334 
335 void DIALOG_ERC::OnERCItemSelected( wxDataViewEvent& aEvent )
336 {
337  const KIID& itemID = RC_TREE_MODEL::ToUUID( aEvent.GetItem() );
338  SCH_SHEET_LIST sheetList( g_RootSheet );
339  SCH_SHEET_PATH sheet;
340  SCH_ITEM* item = sheetList.GetItem( itemID, &sheet );
341 
342  if( item )
343  {
344  WINDOW_THAWER thawer( m_parent );
345 
346  if( sheet != m_parent->GetCurrentSheet() )
347  {
350 
351  m_parent->SetCurrentSheet( sheet );
353  sheet.LastScreen()->SetZoom( m_parent->GetScreen()->GetZoom() );
355  }
356 
357  m_parent->FocusOnItem( item );
358  RedrawDrawPanel();
359  }
360 
361  aEvent.Skip();
362 }
363 
364 
365 void DIALOG_ERC::OnERCItemDClick( wxDataViewEvent& aEvent )
366 {
367  if( aEvent.GetItem().IsOk() )
368  {
369  // turn control over to m_parent, hide this DIALOG_ERC window,
370  // no destruction so we can preserve listbox cursor
371  if( !IsModal() )
372  Show( false );
373  }
374 
375  aEvent.Skip();
376 }
377 
378 
379 void DIALOG_ERC::OnERCItemRClick( wxDataViewEvent& aEvent )
380 {
381  RC_TREE_NODE* node = RC_TREE_MODEL::ToNode( aEvent.GetItem() );
382 
383  if( !node )
384  return;
385 
386  RC_ITEM* rcItem = node->m_RcItem;
387  wxString listName;
388  wxMenu menu;
389 
390  switch( GetSeverity( rcItem->GetErrorCode() ) )
391  {
392  case RPT_SEVERITY_ERROR: listName = _( "errors" ); break;
393  case RPT_SEVERITY_WARNING: listName = _( "warnings" ); break;
394  default: listName = _( "appropriate" ); break;
395  }
396 
397  if( rcItem->GetParent()->IsExcluded() )
398  {
399  menu.Append( 1, _( "Remove exclusion for this violation" ),
400  wxString::Format( _( "It will be placed back in the %s list" ), listName ) );
401  }
402  else
403  {
404  menu.Append( 2, _( "Exclude this violation" ),
405  wxString::Format( _( "It will be excluded from the %s list" ), listName ) );
406  }
407 
408  menu.AppendSeparator();
409 
410  if( GetSeverity( rcItem->GetErrorCode() ) == RPT_SEVERITY_WARNING )
411  {
412  menu.Append( 3, wxString::Format( _( "Change severity to Error for all '%s' violations" ),
413  rcItem->GetErrorText(),
414  _( "Violation severities can also be edited in the Board Setup... dialog" ) ) );
415  }
416  else
417  {
418  menu.Append( 4, wxString::Format( _( "Change severity to Warning for all '%s' violations" ),
419  rcItem->GetErrorText(),
420  _( "Violation severities can also be edited in the Board Setup... dialog" ) ) );
421  }
422 
423  menu.Append( 5, wxString::Format( _( "Ignore all '%s' violations" ),
424  rcItem->GetErrorText() ),
425  _( "Violations will not be checked or reported" ) );
426 
427  menu.AppendSeparator();
428 
429  menu.Append( 6, _( "Edit violation severities..." ), _( "Open the Schematic Setup... dialog" ) );
430 
431  switch( GetPopupMenuSelectionFromUser( menu ) )
432  {
433  case 1:
434  node->m_RcItem->GetParent()->SetExcluded( false );
435 
436  // Update view
437  static_cast<RC_TREE_MODEL*>( aEvent.GetModel() )->ValueChanged( node );
439  break;
440 
441  case 2:
442  node->m_RcItem->GetParent()->SetExcluded( true );
443 
444  // Update view
446  static_cast<RC_TREE_MODEL*>( aEvent.GetModel() )->ValueChanged( node );
447  else
448  static_cast<RC_TREE_MODEL*>( aEvent.GetModel() )->DeleteCurrentItem( false );
449 
451  break;
452 
453  case 3:
455 
456  // Rebuild model and view
457  static_cast<RC_TREE_MODEL*>( aEvent.GetModel() )->SetProvider( m_markerProvider );
459  break;
460 
461  case 4:
463 
464  // Rebuild model and view
465  static_cast<RC_TREE_MODEL*>( aEvent.GetModel() )->SetProvider( m_markerProvider );
467  break;
468 
469  case 5:
470  {
472 
473  SCH_SCREENS ScreenList;
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 6:
483  m_parent->DoShowSchematicSetupDialog( _( "Violation Severity" ) );
484  break;
485  }
486 }
487 
488 
489 void DIALOG_ERC::OnSeverity( wxCommandEvent& aEvent )
490 {
491  int flag = 0;
492 
493  if( aEvent.GetEventObject() == m_showAll )
494  flag = RPT_SEVERITY_ALL;
495  else if( aEvent.GetEventObject() == m_showErrors )
496  flag = RPT_SEVERITY_ERROR;
497  else if( aEvent.GetEventObject() == m_showWarnings )
498  flag = RPT_SEVERITY_WARNING;
499  else if( aEvent.GetEventObject() == m_showExclusions )
500  flag = RPT_SEVERITY_EXCLUSION;
501 
502  if( aEvent.IsChecked() )
503  m_severities |= flag;
504  else if( aEvent.GetEventObject() == m_showAll )
506  else
507  m_severities &= ~flag;
508 
509  syncCheckboxes();
510 
511  // Set the provider's severity levels through the TreeModel so that the old tree
512  // can be torn down before the severity changes.
513  //
514  // It's not clear this is required, but we've had a lot of issues with wxDataView
515  // being cranky on various platforms.
516 
518 
520 }
521 
522 
524 {
525  // Clear current selection list to avoid selection of deleted items
527 
529 }
530 
531 
532 void DIALOG_ERC::OnSaveReport( wxCommandEvent& aEvent )
533 {
534  wxFileName fn( "./ERC." + ReportFileExtension );
535 
536  wxFileDialog dlg( this, _( "Save Report to File" ), fn.GetPath(), fn.GetFullName(),
537  ReportFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
538 
539  if( dlg.ShowModal() != wxID_OK )
540  return;
541 
542  fn = dlg.GetPath();
543 
544  if( fn.GetExt().IsEmpty() )
545  fn.SetExt( ReportFileExtension );
546 
547  if( !fn.IsAbsolute() )
548  {
549  wxString prj_path = Prj().GetProjectPath();
550  fn.MakeAbsolute( prj_path );
551  }
552 
553  if( writeReport( fn.GetFullPath() ) )
554  {
555  m_MessagesList->AppendText( wxString::Format( _( "Report file '%s' created\n" ),
556  fn.GetFullPath() ) );
557  }
558  else
559  {
560  DisplayError( this, wxString::Format( _( "Unable to create report file '%s'" ),
561  fn.GetFullPath() ) );
562  }
563 }
564 
565 
566 bool DIALOG_ERC::writeReport( const wxString& aFullFileName )
567 {
568  wxFFile file( aFullFileName, wxT( "wt" ) );
569 
570  if( !file.IsOpened() )
571  return false;
572 
573  wxString msg = wxString::Format( _( "ERC report (%s, Encoding UTF8)\n" ), DateAndTime() );
574 
575  int err_count = 0;
576  int warn_count = 0;
577  int total_count = 0;
578  SCH_SHEET_LIST sheetList( g_RootSheet );
579 
580  for( unsigned i = 0; i < sheetList.size(); i++ )
581  {
582  msg << wxString::Format( _( "\n***** Sheet %s\n" ), sheetList[i].PathHumanReadable() );
583 
584  for( auto aItem : sheetList[i].LastScreen()->Items().OfType( SCH_MARKER_T ) )
585  {
586  auto marker = static_cast<const SCH_MARKER*>( aItem );
587 
588  if( marker->GetMarkerType() != MARKER_BASE::MARKER_ERC )
589  continue;
590 
591  total_count++;
592 
593  switch( g_ErcSettings->m_Severities[ marker->GetRCItem()->GetErrorCode() ] )
594  {
595  case RPT_SEVERITY_ERROR: err_count++; break;
596  case RPT_SEVERITY_WARNING: warn_count++; break;
597  default: break;
598  }
599 
600  msg << marker->GetRCItem()->ShowReport( GetUserUnits() );
601  }
602  }
603 
604  msg << wxString::Format( _( "\n ** ERC messages: %d Errors %d Warnings %d\n" ),
605  total_count, err_count, warn_count );
606 
607  // Currently: write report using UTF8 (as usual in Kicad).
608  // TODO: see if we can use the current encoding page (mainly for Windows users),
609  // Or other format (HTML?)
610  file.Write( msg );
611 
612  // wxFFile dtor will close the file.
613 
614  return true;
615 }
616 
617 
618 wxDialog* InvokeDialogERC( SCH_EDIT_FRAME* aCaller )
619 {
620  // This is a modeless dialog, so new it rather than instantiating on stack.
621  DIALOG_ERC* dlg = new DIALOG_ERC( aCaller );
622 
623  dlg->Show( true );
624 
625  return dlg; // wxDialog is information hiding about DIALOG_ERC.
626 }
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
SCH_SHEET_LIST.
int GetSeverity(int aErrorCode)
KIGFX::SCH_VIEW * GetView() const override
Function GetView() Returns a pointer to the VIEW instance used in the panel.
virtual bool HasMessage() const =0
Function HasMessage Returns true if the reporter client is non-empty.
wxTextCtrl * m_MessagesList
void OnERCItemRClick(wxDataViewEvent &aEvent) override
Definition: dialog_erc.cpp:379
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
NETLIST_OBJECT_LIST * BuildNetListBase(bool updateStatusText=true)
Create a flat list which stores all connected objects.
virtual void RedrawScreen(const wxPoint &aCenterPoint, bool aWarpPointer)
void SetProvider(RC_ITEMS_PROVIDER *aProvider)
Definition: rc_item.cpp:166
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.
RC_TREE_MODEL * m_markerTreeModel
Definition: dialog_erc.h:43
This file is part of the common library.
void syncCheckboxes()
Definition: dialog_erc.cpp:146
Class DIALOG_ERC_BASE.
double GetZoom() const
Function GetZoom returns the current "zoom factor", which is a measure of "internal units per device ...
Definition: base_screen.h:240
RC_ITEM is a holder for a DRC (in Pcbnew) or ERC (in Eeschema) error item.
Definition: rc_item.h:82
bool writeReport(const wxString &aFullFileName)
Definition: dialog_erc.cpp:566
bool IsTestEnabled(int aErrorCode) const
Definition: erc_settings.h:68
void OnEraseDrcMarkersClick(wxCommandEvent &event) override
Definition: dialog_erc.cpp:117
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:92
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:139
void updateDisplayedCounts()
Definition: dialog_erc.cpp:96
virtual int GetCount(int aSeverity=-1)=0
Schematic editor (Eeschema) main window.
static KIID ToUUID(wxDataViewItem aItem)
Definition: rc_item.cpp:67
void DisplayCurrentSheet()
Draw the current sheet on the display.
Definition: hierarch.cpp:218
REPORTER is a pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:62
void OnSeverity(wxCommandEvent &aEvent) override
Definition: dialog_erc.cpp:489
SHEETLIST_ERC_ITEMS_PROVIDER is an implementation of the RC_ITEM_LISTinterface which uses the global ...
Definition: erc_item.h:54
wxButton * m_sdbSizer1Cancel
CONNECTION_GRAPH * g_ConnectionGraph
This also wants to live in the eventual SCHEMATIC object.
VTBL_ENTRY const wxString GetProjectPath() const
Function GetProjectPath returns the full path of the project.
Definition: project.cpp:102
static int RPT_SEVERITY_ALL
Definition: dialog_erc.cpp:143
WX_TEXT_CTRL_REPORTER is wrapper for reporting to a wxTextCtrl object.
Definition: reporter.h:129
void SetSeverities(int aSeverities)
Definition: rc_item.cpp:172
EDA_UNITS GetUserUnits() const
Definition: dialog_shim.h:132
int TestConflictingBusAliases()
Checks that there are not conflicting bus alias definitions in the schematic.
ERC_SETTINGS * g_ErcSettings
This also wants to live in the eventual SCHEMATIC object.
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
Definition: common.h:65
wxCheckBox * m_showAll
void SetExcluded(bool aExcluded)
Definition: marker_base.h:173
void deleteAllMarkers()
Definition: dialog_erc.cpp:523
wxButton * m_sdbSizer1OK
static RC_TREE_NODE * ToNode(wxDataViewItem aItem)
Definition: rc_item.h:322
wxString ReportFileWildcard()
void RedrawDrawPanel()
Definition: dialog_erc.cpp:168
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.
int TestDuplicateSheetNames(bool aCreateMarker)
Function TestDuplicateSheetNames( ) inside a given sheet, one cannot have sheets with duplicate names...
SCH_SHEET_PATH & GetCurrentSheet()
wxStaticText * m_textMarkers
int GetErrorCode() const
Definition: rc_item.h:273
Definition of file extensions used in Kicad.
wxStaticBitmap * m_warningsBadge
int m_severities
Definition: dialog_erc.h:45
DIALOG_ERC(SCH_EDIT_FRAME *parent)
Definition: dialog_erc.cpp:52
void OnButtonCloseClick(wxCommandEvent &event) override
Definition: dialog_erc.cpp:127
void DoShowSchematicSetupDialog(const wxString &aInitialPage=wxEmptyString, const wxString &aInitialParentPage=wxEmptyString)
bool IsExcluded() const
Definition: marker_base.h:172
virtual wxString GetErrorText() const =0
Function GetErrorText returns the string form of a drc error code.
std::map< int, int > m_Severities
Definition: erc_settings.h:75
static TOOL_ACTION clearSelection
Clears the current selection.
Definition: ee_actions.h:58
virtual bool SetZoom(double iu_per_du)
Function SetZoom adjusts the current zoom factor.
Definition: base_screen.cpp:88
SCH_SHEET_PATH.
void OnERCItemSelected(wxDataViewEvent &aEvent) override
Definition: dialog_erc.cpp:335
SCH_EDIT_FRAME * m_parent
Definition: dialog_erc.h:40
void FocusOnItem(SCH_ITEM *aItem)
wxStaticBitmap * m_errorsBadge
bool Show(bool show) override
void OnCloseErcDialog(wxCloseEvent &event) override
Definition: dialog_erc.cpp:135
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:365
void DeleteAllItems()
Definition: rc_item.cpp:341
wxCheckBox * m_showWarnings
eeschema ERC modeless dialog ID
Definition: id.h:220
RC_ITEM * m_RcItem
Definition: rc_item.h:307
wxCheckBox * m_showErrors
#define NOC
Definition: erc.h:83
see class PGM_BASE
SCH_SCREEN * LastScreen()
Function LastScreen.
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:205
const std::string ReportFileExtension
wxBitmap MakeBadge(SEVERITY aStyle, int aCount, wxWindow *aWindow, int aDepth)
Definition: ui_common.cpp:34
wxStaticText * m_titleMessages
#define _(s)
Definition: 3d_actions.cpp:33
EE_RTREE & Items()
Definition: sch_screen.h:127
void SetSeverity(int aErrorCode, int aSeverity)
void OnSaveReport(wxCommandEvent &aEvent) override
Definition: dialog_erc.cpp:532
wxStaticBitmap * m_exclusionsBadge
void TestOthersItems(NETLIST_OBJECT_LIST *aList, unsigned aNetItemRef, unsigned aNetStart, int *aMinConnexion)
Perform ERC testing for electrical conflicts between NetItemRef and other items (mainly pin) on the s...
MARKER_BASE * GetParent() const
Definition: rc_item.h:256
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:346
VECTOR2D m_ScrollCenter
Current scroll center point in logical units.
Definition: base_screen.h:127
SCH_SHEET * g_RootSheet
void SetData(EDA_UNITS aUnits, int aErrorCode, const wxPoint &aMarkerPos, EDA_ITEM *aItem, const wxPoint &aPos, EDA_ITEM *bItem=nullptr, const wxPoint &bPos=wxPoint())
Function SetData fills in all the reportable data associated with a MARKER.
Definition: marker_base.cpp:91
VIEW.
Definition: view.h:61
void TestErc(REPORTER &aReporter)
Definition: dialog_erc.cpp:176
Definition of the NETLIST_OBJECT class.
int TestMultiunitFootprints(SCH_SHEET_LIST &aSheetList)
Test if all units of each multiunit component have the same footprint assigned.
SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:147
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:618
int RunERC()
Runs electrical rule checks on the connectivity graph.
wxString DateAndTime()
Definition: string.cpp:345
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
Definition: sch_screen.h:491
void DeleteMarkers(enum MARKER_BASE::TYPEMARKER aMarkerTyp, int aErrorCode)
Delete all markers of a particular type and error code.
void OnRunERCClick(wxCommandEvent &event) override
Definition: dialog_erc.cpp:155