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-2016 Wayne Stambaugh <stambaughw@verizon.net>
6  * Copyright (C) 1992-2016 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 
31 #include <fctsys.h>
32 #include <class_drawpanel.h>
33 #include <kicad_string.h>
34 #include <gestfich.h>
35 #include <pgm_base.h>
36 #include <class_sch_screen.h>
37 #include <schframe.h>
38 #include <invoke_sch_dialog.h>
39 #include <project.h>
40 #include <kiface_i.h>
41 #include <bitmaps.h>
42 
43 #include <netlist.h>
44 #include <class_netlist_object.h>
45 #include <sch_marker.h>
46 #include <sch_sheet.h>
47 #include <lib_pin.h>
48 
49 #include <dialog_erc.h>
50 #include <erc.h>
51 #include <id.h>
52 
53 
56 
57 
58 bool DIALOG_ERC::m_writeErcFile = false; // saved only for the current session
59 bool DIALOG_ERC::m_TestSimilarLabels = true; // Save in project config
60 bool DIALOG_ERC::m_diagErcTableInit = false; // saved only for the current session
61 bool DIALOG_ERC::m_tstUniqueGlobalLabels = true; // saved only for the current session
62 
63 // Control identifiers for events
64 #define ID_MATRIX_0 1800
65 
66 
67 BEGIN_EVENT_TABLE( DIALOG_ERC, DIALOG_ERC_BASE )
69  wxEVT_COMMAND_BUTTON_CLICKED, DIALOG_ERC::ChangeErrorLevel )
70 END_EVENT_TABLE()
71 
72 
74  DIALOG_ERC_BASE( parent, ID_DIALOG_ERC // parent looks for this ID explicitly
75  )
76 {
77  m_parent = parent;
78  m_lastMarkerFound = NULL;
79  Init();
80 
81  // Now all widgets have the size fixed, call FinishDialogSettings
82  FinishDialogSettings();
83 }
84 
85 
87 {
90 }
91 
92 
94 {
95  m_initialized = false;
96 
97  for( int ii = 0; ii < PINTYPE_COUNT; ii++ )
98  {
99  for( int jj = 0; jj < PINTYPE_COUNT; jj++ )
100  m_buttonList[ii][jj] = NULL;
101  }
102 
103  m_WriteResultOpt->SetValue( m_writeErcFile );
106 
107  SCH_SCREENS screens;
108  updateMarkerCounts( &screens );
109 
111 
112  // Init Panel Matrix
114 
115  // Set the run ERC button as the default button.
116  m_buttonERC->SetDefault();
117 }
118 
119 
121 {
122  int markers = screens->GetMarkerCount( MARKER_BASE::MARKER_ERC,
124  int warnings = screens->GetMarkerCount( MARKER_BASE::MARKER_ERC,
126  int errors = screens->GetMarkerCount( MARKER_BASE::MARKER_ERC,
128 
129  wxString num;
130  num.Printf( wxT( "%d" ), markers );
131  m_TotalErrCount->SetValue( num );
132 
133  num.Printf( wxT( "%d" ), errors );
134  m_LastErrCount->SetValue( num );
135 
136  num.Printf( wxT( "%d" ), warnings );
137  m_LastWarningCount->SetValue( num );
138 }
139 
140 
141 /* Delete the old ERC markers, over the whole hierarchy
142  */
143 void DIALOG_ERC::OnEraseDrcMarkersClick( wxCommandEvent& event )
144 {
145  SCH_SCREENS ScreenList;
146 
148  updateMarkerCounts( &ScreenList );
149 
151  m_parent->GetCanvas()->Refresh();
152 }
153 
154 
155 
156 /* event handler for Close button
157 */
158 void DIALOG_ERC::OnButtonCloseClick( wxCommandEvent& event )
159 {
160  Close();
161 }
162 
163 
164 void DIALOG_ERC::OnCloseErcDialog( wxCloseEvent& event )
165 {
166  Destroy();
167 }
168 
169 
170 void DIALOG_ERC::OnResetMatrixClick( wxCommandEvent& event )
171 {
172  ResetDefaultERCDiag( event );
173 }
174 
175 
176 void DIALOG_ERC::OnErcCmpClick( wxCommandEvent& event )
177 {
178  wxBusyCursor();
180 
181  m_MessagesList->Clear();
182  wxSafeYield(); // m_MarkersList must be redraw
183  wxArrayString messageList;
184  TestErc( &messageList );
185 
186  for( unsigned ii = 0; ii < messageList.GetCount(); ii++ )
187  m_MessagesList->AppendText( messageList[ii] );
188 }
189 
190 
191 void DIALOG_ERC::OnLeftClickMarkersList( wxHtmlLinkEvent& event )
192 {
193  wxString link = event.GetLinkInfo().GetHref();
194 
195  m_lastMarkerFound = NULL;
196 
197  long index;
198 
199  if( !link.ToLong( &index ) )
200  return;
201 
202  const SCH_MARKER* marker = m_MarkersList->GetItem( index );
203 
204  if( marker == NULL )
205  return;
206 
207  // Search for the selected marker
208  unsigned i;
209  SCH_SHEET_LIST sheetList( g_RootSheet );
210  bool notFound = true;
211 
212  for( i = 0; i < sheetList.size(); i++ )
213  {
214  SCH_ITEM* item = (SCH_ITEM*) sheetList[i].LastDrawList();
215 
216  for( ; item; item = item->Next() )
217  {
218  if( item == marker )
219  {
220  notFound = false;
221  break;
222  }
223  }
224 
225  if( notFound == false )
226  break;
227  }
228 
229  if( notFound ) // Error
230  {
231  wxMessageBox( _( "Marker not found" ) );
232 
233  // The marker was deleted, so rebuild marker list
235  return;
236  }
237 
238  if( sheetList[i] != m_parent->GetCurrentSheet() )
239  {
240  sheetList[i].LastScreen()->SetZoom( m_parent->GetScreen()->GetZoom() );
241  m_parent->SetCurrentSheet( sheetList[i] );
243  }
244 
245  m_lastMarkerFound = marker;
246  m_parent->SetCrossHairPosition( marker->m_Pos );
247  m_parent->RedrawScreen( marker->m_Pos, false);
248 }
249 
250 
251 void DIALOG_ERC::OnLeftDblClickMarkersList( wxMouseEvent& event )
252 {
253  // Remember: OnLeftClickMarkersList was called just before
254  // and therefore m_lastMarkerFound was initialized.
255  // (NULL if not found)
256  if( m_lastMarkerFound )
257  {
260  // prevent a mouse left button release event in
261  // coming from the ERC dialog double click
262  // ( the button is released after closing this dialog and will generate
263  // an unwanted event in parent frame)
265  }
266 
267  Close();
268 }
269 
270 
272 {
273  // Try to know the size of bitmap button used in drc matrix
274  wxBitmapButton * dummy = new wxBitmapButton( m_matrixPanel, wxID_ANY, KiBitmap( ercerr_xpm ) );
275  wxSize bitmap_size = dummy->GetSize();
276  delete dummy;
277 
278  if( !m_diagErcTableInit )
279  {
280  memcpy( DiagErc, DefaultDiagErc, sizeof(DefaultDiagErc) );
281  m_diagErcTableInit = true;
282  }
283 
284  wxPoint pos;
285  // Get the current text size:use a dummy text.
286  wxStaticText* text = new wxStaticText( m_matrixPanel, -1, wxT( "W" ), pos );
287  int text_height = text->GetRect().GetHeight();
288  bitmap_size.y = std::max( bitmap_size.y, text_height );
289  delete text;
290 
291  // compute the Y pos interval:
292  pos.y = text_height;
293 
294  if( m_initialized == false )
295  {
296  // Print row labels
297  for( int ii = 0; ii < PINTYPE_COUNT; ii++ )
298  {
299  int y = pos.y + (ii * bitmap_size.y);
300  text = new wxStaticText( m_matrixPanel, -1, CommentERC_H[ii],
301  wxPoint( 5, y + ( bitmap_size.y / 2) - (text_height / 2) ) );
302 
303  int x = text->GetRect().GetRight();
304  pos.x = std::max( pos.x, x );
305  }
306 
307  pos.x += 5;
308  }
309  else
310  pos = m_buttonList[0][0]->GetPosition();
311 
312  for( int ii = 0; ii < PINTYPE_COUNT; ii++ )
313  {
314  int y = pos.y + (ii * bitmap_size.y);
315 
316  for( int jj = 0; jj <= ii; jj++ )
317  {
318  // Add column labels (only once)
319  int diag = DiagErc[ii][jj];
320  int x = pos.x + (jj * bitmap_size.x);
321 
322  if( (ii == jj) && !m_initialized )
323  {
324  wxPoint txtpos;
325  txtpos.x = x + (bitmap_size.x / 2);
326  txtpos.y = y - text_height;
327  text = new wxStaticText( m_matrixPanel, -1, CommentERC_V[ii], txtpos );
328  }
329 
330  int event_id = ID_MATRIX_0 + ii + ( jj * PINTYPE_COUNT );
331  BITMAP_DEF bitmap_butt = erc_green_xpm;
332 
333  delete m_buttonList[ii][jj];
334  m_buttonList[ii][jj] = new wxBitmapButton( m_matrixPanel,
335  event_id,
336  KiBitmap( bitmap_butt ),
337  wxPoint( x, y ) );
338  setDRCMatrixButtonState( m_buttonList[ii][jj], diag );
339  }
340  }
341 
342  m_initialized = true;
343 }
344 
345 
346 void DIALOG_ERC::setDRCMatrixButtonState( wxBitmapButton *aButton, int aState )
347 {
348  BITMAP_DEF bitmap_butt = NULL;
349  wxString tooltip;
350 
351  switch( aState )
352  {
353  case OK:
354  bitmap_butt = erc_green_xpm;
355  tooltip = _( "No error or warning" );
356  break;
357 
358  case WAR:
359  bitmap_butt = ercwarn_xpm;
360  tooltip = _( "Generate warning" );
361  break;
362 
363  case ERR:
364  bitmap_butt = ercerr_xpm;
365  tooltip = _( "Generate error" );
366  break;
367  }
368 
369  if( bitmap_butt )
370  {
371  aButton->SetBitmap( KiBitmap( bitmap_butt ) );
372  aButton->SetToolTip( tooltip );
373  }
374 }
375 
376 
378 {
379  SCH_SHEET_LIST sheetList( g_RootSheet);
381 
382  for( unsigned i = 0; i < sheetList.size(); i++ )
383  {
384  SCH_ITEM* item = sheetList[i].LastDrawList();
385 
386  for( ; item != NULL; item = item->Next() )
387  {
388  if( item->Type() != SCH_MARKER_T )
389  continue;
390 
391  SCH_MARKER* marker = (SCH_MARKER*) item;
392 
393  if( marker->GetMarkerType() != MARKER_BASE::MARKER_ERC )
394  continue;
395 
396  m_MarkersList->AppendToList( marker );
397  }
398  }
399 
401 }
402 
403 
404 void DIALOG_ERC::ResetDefaultERCDiag( wxCommandEvent& event )
405 {
406  memcpy( DiagErc, DefaultDiagErc, sizeof( DiagErc ) );
408  m_TestSimilarLabels = true;
412 }
413 
414 
415 void DIALOG_ERC::ChangeErrorLevel( wxCommandEvent& event )
416 {
417  int id, level, ii, x, y;
418  wxPoint pos;
419 
420  id = event.GetId();
421  ii = id - ID_MATRIX_0;
422  wxBitmapButton* butt = (wxBitmapButton*) event.GetEventObject();
423  pos = butt->GetPosition();
424 
425  x = ii / PINTYPE_COUNT; y = ii % PINTYPE_COUNT;
426 
427  level = DiagErc[y][x];
428 
429  //change to the next error level
430  switch( level )
431  {
432  case OK:
433  level = WAR;
434  break;
435 
436  case WAR:
437  level = ERR;
438  break;
439 
440  case ERR:
441  level = OK;
442  break;
443  }
444 
445  setDRCMatrixButtonState( butt, level );
446 
447  DiagErc[y][x] = DiagErc[x][y] = level;
448 }
449 
450 
451 void DIALOG_ERC::TestErc( wxArrayString* aMessagesList )
452 {
453  wxFileName fn;
454 
455  m_writeErcFile = m_WriteResultOpt->GetValue();
458 
459  // Build the whole sheet list in hierarchy (sheet, not screen)
460  SCH_SHEET_LIST sheets( g_RootSheet );
461  sheets.AnnotatePowerSymbols( Prj().SchLibs() );
462 
463  if( m_parent->CheckAnnotate( aMessagesList, false ) )
464  {
465  if( aMessagesList )
466  {
467  wxString msg = _( "Annotation required!" );
468  msg += wxT( "\n" );
469  aMessagesList->Add( msg );
470  }
471 
472  return;
473  }
474 
475  SCH_SCREENS screens;
476 
477  // Erase all previous DRC markers.
479 
480  for( SCH_SCREEN* screen = screens.GetFirst(); screen != NULL; screen = screens.GetNext() )
481  {
482  /* Ff wire list has changed, delete Undo Redo list to avoid pointers on deleted
483  * data problems.
484  */
485  if( screen->SchematicCleanUp() )
486  screen->ClearUndoRedoList();
487  }
488 
489  /* Test duplicate sheet names inside a given sheet, one cannot have sheets with
490  * duplicate names (file names can be duplicated).
491  */
492  TestDuplicateSheetNames( true );
493 
494  std::unique_ptr<NETLIST_OBJECT_LIST> objectsConnectedList( m_parent->BuildNetListBase() );
495 
496  // Reset the connection type indicator
497  objectsConnectedList->ResetConnectionsType();
498 
499  unsigned lastItemIdx;
500  unsigned nextItemIdx = lastItemIdx = 0;
501  int MinConn = NOC;
502 
503  /* The netlist generated by SCH_EDIT_FRAME::BuildNetListBase is sorted
504  * by net number, which means we can group netlist items into ranges
505  * that live in the same net. The range from nextItem to the current
506  * item (exclusive) needs to be checked against the current item. The
507  * lastItem variable is used as a helper to pass the last item's number
508  * from one loop iteration to the next, which simplifies the initial
509  * pass.
510  */
511 
512  for( unsigned itemIdx = 0; itemIdx < objectsConnectedList->size(); itemIdx++ )
513  {
514  auto item = objectsConnectedList->GetItem( itemIdx );
515  auto lastItem = objectsConnectedList->GetItem( lastItemIdx );
516 
517  auto lastNet = lastItem->GetNet();
518  auto net = item->GetNet();
519 
520  wxASSERT_MSG( lastNet <= net, wxT( "Netlist not correctly ordered" ) );
521 
522  if( lastNet != net )
523  {
524  // New net found:
525  MinConn = NOC;
526  nextItemIdx = itemIdx;
527  }
528 
529  switch( item->m_Type )
530  {
531  // These items do not create erc problems
533  case NET_SEGMENT:
534  case NET_BUS:
535  case NET_JUNCTION:
536  case NET_LABEL:
537  case NET_BUSLABELMEMBER:
538  case NET_PINLABEL:
540  break;
541 
542  case NET_HIERLABEL:
544  case NET_SHEETLABEL:
546  // ERC problems when pin sheets do not match hierarchical labels.
547  // Each pin sheet must match a hierarchical label
548  // Each hierarchical label must match a pin sheet
549  objectsConnectedList->TestforNonOrphanLabel( itemIdx, nextItemIdx );
550  break;
551  case NET_GLOBLABEL:
553  objectsConnectedList->TestforNonOrphanLabel( itemIdx, nextItemIdx );
554  break;
555 
556  case NET_NOCONNECT:
557 
558  // ERC problems when a noconnect symbol is connected to more than one pin.
559  MinConn = NET_NC;
560 
561  if( objectsConnectedList->CountPinsInNet( nextItemIdx ) > 1 )
562  Diagnose( item, NULL, MinConn, UNC );
563 
564  break;
565 
566  case NET_PIN:
567 
568  // Look for ERC problems between pins:
569  TestOthersItems( objectsConnectedList.get(), itemIdx, nextItemIdx, &MinConn );
570  break;
571  }
572 
573  lastItemIdx = itemIdx;
574  }
575 
576  // Test similar labels (i;e. labels which are identical when
577  // using case insensitive comparisons)
578  if( m_TestSimilarLabels )
579  objectsConnectedList->TestforSimilarLabels();
580 
581  // Displays global results:
582  updateMarkerCounts( &screens );
583 
584  // Display diags:
586 
587  // Display new markers:
588  m_parent->GetCanvas()->Refresh();
589 
590  // Display message
591  wxString msg = _( "Finished" );
592  msg += wxT( "\n" );
593  aMessagesList->Add( msg );
594 
595  if( m_writeErcFile )
596  {
597  fn = g_RootSheet->GetScreen()->GetFileName();
598  fn.SetExt( wxT( "erc" ) );
599 
600  wxFileDialog dlg( this, _( "ERC File" ), fn.GetPath(), fn.GetFullName(),
601  _( "Electronic rule check file (.erc)|*.erc" ),
602  wxFD_SAVE );
603 
604  if( dlg.ShowModal() == wxID_CANCEL )
605  return;
606 
607  if( WriteDiagnosticERC( dlg.GetPath() ) )
608  ExecuteFile( this, Pgm().GetEditorName(), QuoteFullPath( fn ) );
609  }
610 }
611 
612 
613 wxDialog* InvokeDialogERC( SCH_EDIT_FRAME* aCaller )
614 {
615  // This is a modeless dialog, so new it rather than instantiating on stack.
616  DIALOG_ERC* dlg = new DIALOG_ERC( aCaller );
617 
618  dlg->Show( true );
619 
620  return dlg; // wxDialog is information hiding about DIALOG_ERC.
621 }
void SetCurrentSheet(const SCH_SHEET_PATH &aSheet)
Definition: schframe.cpp:583
Definition of the SCH_SHEET class for Eeschema.
Class SCH_SHEET_LIST.
KICAD_T Type() const
Function Type()
Definition: base_struct.h:212
void AnnotatePowerSymbols(PART_LIBS *aLib)
Function AnnotatePowerSymbols Silently annotates the not yet annotated power symbols of the entire hi...
void DisplayList()
Function DisplayList(); Build the Html marker list and show it.
static bool m_TestSimilarLabels
Definition: dialog_erc.h:51
wxTextCtrl * m_MessagesList
SCH_SCREEN * GetNext()
Definition: erc.h:43
NETLIST_OBJECT_LIST * BuildNetListBase(bool updateStatusText=true)
BuildNetListBase netlist generation: Creates a flat list which stores all connected objects...
void DeleteAllMarkers(enum MARKER_BASE::TYPEMARKER aMarkerType)
Function DeleteAllMarkers deletes all electronic rules check markers of aMarkerType from all the scre...
void setDRCMatrixButtonState(wxBitmapButton *aButton, int aState)
Definition: dialog_erc.cpp:346
PNG memory record (file in memory).
Definition: bitmap_types.h:38
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...
Definition: erc.cpp:372
static bool m_writeErcFile
Definition: dialog_erc.h:46
This file is part of the common library TODO brief description.
void Init()
Definition: dialog_erc.cpp:93
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL) override
Update the board display after modifying it bu a python script (note: it is automatically called by a...
Definition: draw_panel.cpp:325
EDA_DRAW_PANEL * GetCanvas()
Definition: draw_frame.h:337
Class DIALOG_ERC_BASE.
int CheckAnnotate(wxArrayString *aMessageList, bool aOneSheetOnly)
Function CheckAnnotate checks for annotation errors.
Definition: annotate.cpp:187
double GetZoom() const
Function GetZoom returns the current "zoom factor", which is a measure of "internal units per device ...
void OnEraseDrcMarkersClick(wxCommandEvent &event) override
Definition: dialog_erc.cpp:143
const wxString CommentERC_H[]
Definition: erc.cpp:87
const wxString & GetFileName() const
wxPoint m_Pos
position of the marker
int DefaultDiagErc[PINTYPE_COUNT][PINTYPE_COUNT]
Default Look up table which gives the ERC error level for a pair of connected pins Same as DiagErc...
Definition: erc.cpp:133
void Diagnose(NETLIST_OBJECT *aNetItemRef, NETLIST_OBJECT *aNetItemTst, int aMinConn, int aDiag)
Performs ERC testing and creates an ERC marker to show the ERC problem for aNetItemRef or between aNe...
Definition: erc.cpp:228
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
Schematic editor (Eeschema) main window.
Definition: schframe.h:117
wxTextCtrl * m_TotalErrCount
void SkipNextLeftButtonReleaseEvent()
function SkipNextLeftButtonReleaseEvent after calling this function, if the left mouse button is down...
Definition: draw_frame.cpp:286
void UpdateAllScreenReferences()
Function UpdateAllScreenReferences updates the reference and the m_Multi parameter (part selection) f...
SCH_SCREEN * GetScreen()
Definition: sch_sheet.h:286
SCH_ITEM * Next() const
#define ID_MATRIX_0
Definition: dialog_erc.cpp:64
ERC_HTML_LISTFRAME * m_MarkersList
bool WriteDiagnosticERC(const wxString &aFullFileName)
Function WriteDiagnosticERC save the ERC errors to aFullFileName.
Definition: erc.cpp:525
enum TYPEMARKER GetMarkerType() const
Definition: erc.h:42
SCH_SCREEN * GetScreen() const override
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
Definition: schframe.cpp:530
void ChangeErrorLevel(wxCommandEvent &event)
Definition: dialog_erc.cpp:415
void OnLeftClickMarkersList(wxHtmlLinkEvent &event) override
Definition: dialog_erc.cpp:191
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:36
Definition: erc.h:44
bool m_initialized
Definition: dialog_erc.h:44
void OnErcCmpClick(wxCommandEvent &event) override
Definition: dialog_erc.cpp:176
int TestDuplicateSheetNames(bool aCreateMarker)
Function TestDuplicateSheetNames( ) inside a given sheet, one cannot have sheets with duplicate names...
Definition: erc.cpp:177
wxBitmapButton * m_buttonList[PINTYPE_COUNT][PINTYPE_COUNT]
Definition: dialog_erc.h:43
SCH_SHEET * g_RootSheet
Definition: eeschema.cpp:55
Definitions for the Eeschema program SCH_SCREEN class.
wxButton * m_buttonERC
wxPanel * m_matrixPanel
SCH_SHEET_PATH & GetCurrentSheet()
Definition: schframe.cpp:575
void OnLeftDblClickMarkersList(wxMouseEvent &event) override
Definition: dialog_erc.cpp:251
void OnButtonCloseClick(wxCommandEvent &event) override
Definition: dialog_erc.cpp:158
Definition: erc.h:45
void AppendToList(SCH_MARKER *aMarker)
Function AppendToList.
wxTextCtrl * m_LastWarningCount
SCH_EDIT_FRAME * m_parent
Definition: dialog_erc.h:42
wxCheckBox * m_cbTestUniqueGlbLabels
bool Show(bool show) override
void OnCloseErcDialog(wxCloseEvent &event) override
Definition: dialog_erc.cpp:164
int GetMarkerCount(enum MARKER_BASE::TYPEMARKER aMarkerType, enum MARKER_BASE::MARKER_SEVERITY aSeverity)
Function GetMarkerCount returns the number of ERC markers of aMarkerType from all of the screens in t...
int DiagErc[PINTYPE_COUNT][PINTYPE_COUNT]
Definition: erc.cpp:124
Definition of the NETLIST_OBJECT class.
void ClearList()
Function ClearList deletes all items shown in the list.
void TestErc(wxArrayString *aMessagesList)
Definition: dialog_erc.cpp:451
eeschema ERC modeless dialog ID
Definition: id.h:272
void RedrawScreen(const wxPoint &aCenterPoint, bool aWarpPointer)
Function RedrawScreen redraws the entire screen area by updating the scroll bars and mouse pointer in...
Definition: zoom.cpp:46
static bool m_diagErcTableInit
Definition: dialog_erc.h:47
#define NOC
Definition: erc.h:69
see class PGM_BASE
const SCH_MARKER * GetItem(unsigned aIndex)
Function GetItem returns a requested DRC_ITEM* or NULL.
static LIB_PART * dummy()
Used when a LIB_PART is not found in library to draw a dummy shape This component is a 400 mils squar...
#define max(a, b)
Definition: auxiliary.h:86
wxString QuoteFullPath(wxFileName &fn, wxPathFormat format)
Quote return value of wxFileName::GetFullPath().
Definition: gestfich.cpp:417
void OnResetMatrixClick(wxCommandEvent &event) override
Definition: dialog_erc.cpp:170
void updateMarkerCounts(SCH_SCREENS *screens)
Definition: dialog_erc.cpp:120
static bool m_tstUniqueGlobalLabels
Definition: dialog_erc.h:48
wxCheckBox * m_WriteResultOpt
const wxString CommentERC_V[]
Definition: erc.cpp:103
SCH_SCREEN * GetFirst()
EVT_COMMAND_RANGE(ID_MATRIX_0, ID_MATRIX_0+(PINTYPE_COUNT *PINTYPE_COUNT)-1, wxEVT_COMMAND_BUTTON_CLICKED, DIALOG_ERC::ChangeErrorLevel) DIALOG_ERC
Definition: dialog_erc.cpp:68
#define NET_NC
Definition: erc.h:67
void ReBuildMatrixPanel()
Definition: dialog_erc.cpp:271
void SetCrossHairPosition(const wxPoint &aPosition, bool aSnapToGrid=true)
Function SetCrossHairPosition sets the screen cross hair position to aPosition in logical (drawing) u...
wxTextCtrl * m_LastErrCount
void ResetDefaultERCDiag(wxCommandEvent &event)
Definition: dialog_erc.cpp:404
int ExecuteFile(wxWindow *frame, const wxString &ExecFile, const wxString &param, wxProcess *callback)
Function ExecuteFile calls the executable file ExecFile with the command line parameters param...
Definition: gestfich.cpp:208
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
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:613
const SCH_MARKER * m_lastMarkerFound
Definition: dialog_erc.h:45
Class SCH_SCREENS is a container class that holds multiple SCH_SCREENs in a hierarchy.
void DisplayERC_MarkersList()
Definition: dialog_erc.cpp:377
wxCheckBox * m_cbTestSimilarLabels