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-2017 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 <sch_screen.h>
37 #include <sch_edit_frame.h>
38 #include <invoke_sch_dialog.h>
39 #include <project.h>
40 #include <kiface_i.h>
41 #include <bitmaps.h>
42 #include <reporter.h>
44 
45 #include <netlist.h>
46 #include <netlist_object.h>
47 #include <sch_marker.h>
48 #include <sch_sheet.h>
49 #include <lib_pin.h>
50 
51 #include <dialog_erc.h>
52 #include <erc.h>
53 #include <id.h>
54 
55 
58 
59 
60 bool DIALOG_ERC::m_writeErcFile = false; // saved only for the current session
61 bool DIALOG_ERC::m_TestSimilarLabels = true; // Save in project config
62 bool DIALOG_ERC::m_diagErcTableInit = false; // saved only for the current session
63 bool DIALOG_ERC::m_tstUniqueGlobalLabels = true; // saved only for the current session
64 
65 // Control identifiers for events
66 #define ID_MATRIX_0 1800
67 
68 
69 BEGIN_EVENT_TABLE( DIALOG_ERC, DIALOG_ERC_BASE )
71  wxEVT_COMMAND_BUTTON_CLICKED, DIALOG_ERC::ChangeErrorLevel )
72 END_EVENT_TABLE()
73 
74 
76  DIALOG_ERC_BASE( parent, ID_DIALOG_ERC // parent looks for this ID explicitly
77  )
78 {
79  m_parent = parent;
80  m_lastMarkerFound = NULL;
81  Init();
82 
83  // Now all widgets have the size fixed, call FinishDialogSettings
84  FinishDialogSettings();
85 }
86 
87 
89 {
92 }
93 
94 
96 {
97  m_initialized = false;
98 
99  for( int ii = 0; ii < PINTYPE_COUNT; ii++ )
100  {
101  for( int jj = 0; jj < PINTYPE_COUNT; jj++ )
102  m_buttonList[ii][jj] = NULL;
103  }
104 
105  m_WriteResultOpt->SetValue( m_writeErcFile );
108 
109  SCH_SCREENS screens;
110  updateMarkerCounts( &screens );
111 
113 
114  // Init Panel Matrix
116 
117  // Set the run ERC button as the default button.
118  m_buttonERC->SetDefault();
119 }
120 
121 
123 {
124  int markers = screens->GetMarkerCount( MARKER_BASE::MARKER_ERC,
126  int warnings = screens->GetMarkerCount( MARKER_BASE::MARKER_ERC,
128  int errors = screens->GetMarkerCount( MARKER_BASE::MARKER_ERC,
130 
131  wxString num;
132  num.Printf( wxT( "%d" ), markers );
133  m_TotalErrCount->SetValue( num );
134 
135  num.Printf( wxT( "%d" ), errors );
136  m_LastErrCount->SetValue( num );
137 
138  num.Printf( wxT( "%d" ), warnings );
139  m_LastWarningCount->SetValue( num );
140 }
141 
142 
143 /* Delete the old ERC markers, over the whole hierarchy
144  */
145 void DIALOG_ERC::OnEraseDrcMarkersClick( wxCommandEvent& event )
146 {
147  SCH_SCREENS ScreenList;
148 
150  updateMarkerCounts( &ScreenList );
151 
153  m_parent->GetCanvas()->Refresh();
154 }
155 
156 
157 
158 /* event handler for Close button
159 */
160 void DIALOG_ERC::OnButtonCloseClick( wxCommandEvent& event )
161 {
162  Close();
163 }
164 
165 
166 void DIALOG_ERC::OnCloseErcDialog( wxCloseEvent& event )
167 {
168  Destroy();
169 }
170 
171 
172 void DIALOG_ERC::OnResetMatrixClick( wxCommandEvent& event )
173 {
174  ResetDefaultERCDiag( event );
175 }
176 
177 
178 void DIALOG_ERC::OnErcCmpClick( wxCommandEvent& event )
179 {
180  wxBusyCursor();
182 
183  m_MessagesList->Clear();
184  wxSafeYield(); // m_MarkersList must be redraw
185 
187  TestErc( reporter );
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( REPORTER& aReporter )
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();
462 
463  if( m_parent->CheckAnnotate( aReporter, false ) )
464  {
465  if( aReporter.HasMessage() )
466  aReporter.Report( _( "Annotation required!" ), REPORTER::RPT_ERROR );
467 
468  return;
469  }
470 
471  SCH_SCREENS screens;
472 
473  // Erase all previous DRC markers.
475 
476  /* Test duplicate sheet names inside a given sheet, one cannot have sheets with
477  * duplicate names (file names can be duplicated).
478  */
479  TestDuplicateSheetNames( true );
480 
481  /* Test is all units of each multiunit component have the same footprint assigned.
482  */
483  TestMultiunitFootprints( sheets );
484 
485  std::unique_ptr<NETLIST_OBJECT_LIST> objectsConnectedList( m_parent->BuildNetListBase() );
486 
487  // Reset the connection type indicator
488  objectsConnectedList->ResetConnectionsType();
489 
490  unsigned lastItemIdx;
491  unsigned nextItemIdx = lastItemIdx = 0;
492  int MinConn = NOC;
493 
494  /* The netlist generated by SCH_EDIT_FRAME::BuildNetListBase is sorted
495  * by net number, which means we can group netlist items into ranges
496  * that live in the same net. The range from nextItem to the current
497  * item (exclusive) needs to be checked against the current item. The
498  * lastItem variable is used as a helper to pass the last item's number
499  * from one loop iteration to the next, which simplifies the initial
500  * pass.
501  */
502 
503  for( unsigned itemIdx = 0; itemIdx < objectsConnectedList->size(); itemIdx++ )
504  {
505  auto item = objectsConnectedList->GetItem( itemIdx );
506  auto lastItem = objectsConnectedList->GetItem( lastItemIdx );
507 
508  auto lastNet = lastItem->GetNet();
509  auto net = item->GetNet();
510 
511  wxASSERT_MSG( lastNet <= net, wxT( "Netlist not correctly ordered" ) );
512 
513  if( lastNet != net )
514  {
515  // New net found:
516  MinConn = NOC;
517  nextItemIdx = itemIdx;
518  }
519 
520  switch( item->m_Type )
521  {
522  // These items do not create erc problems
524  case NET_SEGMENT:
525  case NET_BUS:
526  case NET_JUNCTION:
527  case NET_LABEL:
528  case NET_BUSLABELMEMBER:
529  case NET_PINLABEL:
531  break;
532 
533  case NET_HIERLABEL:
535  case NET_SHEETLABEL:
537  // ERC problems when pin sheets do not match hierarchical labels.
538  // Each pin sheet must match a hierarchical label
539  // Each hierarchical label must match a pin sheet
540  objectsConnectedList->TestforNonOrphanLabel( itemIdx, nextItemIdx );
541  break;
542  case NET_GLOBLABEL:
544  objectsConnectedList->TestforNonOrphanLabel( itemIdx, nextItemIdx );
545  break;
546 
547  case NET_NOCONNECT:
548 
549  // ERC problems when a noconnect symbol is connected to more than one pin.
550  MinConn = NET_NC;
551 
552  if( objectsConnectedList->CountPinsInNet( nextItemIdx ) > 1 )
553  Diagnose( item, NULL, MinConn, UNC );
554 
555  break;
556 
557  case NET_PIN:
558 
559  // Look for ERC problems between pins:
560  TestOthersItems( objectsConnectedList.get(), itemIdx, nextItemIdx, &MinConn );
561  break;
562  }
563 
564  lastItemIdx = itemIdx;
565  }
566 
567  // Test similar labels (i;e. labels which are identical when
568  // using case insensitive comparisons)
569  if( m_TestSimilarLabels )
570  objectsConnectedList->TestforSimilarLabels();
571 
572  // Displays global results:
573  updateMarkerCounts( &screens );
574 
575  // Display diags:
577 
578  // Display new markers:
579  m_parent->GetCanvas()->Refresh();
580 
581  // Display message
582  aReporter.Report( _( "Finished" ), REPORTER::RPT_INFO );
583 
584  if( m_writeErcFile )
585  {
586  fn = g_RootSheet->GetScreen()->GetFileName();
587  fn.SetExt( wxT( "erc" ) );
588 
589  wxFileDialog dlg( this, _( "ERC File" ), fn.GetPath(), fn.GetFullName(),
590  ErcFileWildcard(), wxFD_SAVE );
591 
592  if( dlg.ShowModal() == wxID_CANCEL )
593  return;
594 
595  if( WriteDiagnosticERC( dlg.GetPath() ) )
596  ExecuteFile( this, Pgm().GetEditorName(), QuoteFullPath( fn ) );
597  }
598 }
599 
600 
601 wxDialog* InvokeDialogERC( SCH_EDIT_FRAME* aCaller )
602 {
603  // This is a modeless dialog, so new it rather than instantiating on stack.
604  DIALOG_ERC* dlg = new DIALOG_ERC( aCaller );
605 
606  dlg->Show( true );
607 
608  return dlg; // wxDialog is information hiding about DIALOG_ERC.
609 }
void SetCurrentSheet(const SCH_SHEET_PATH &aSheet)
Definition of the SCH_SHEET class for Eeschema.
Class SCH_SHEET_LIST.
KICAD_T Type() const
Function Type()
Definition: base_struct.h:227
void DisplayList()
Function DisplayList(); Build the Html marker list and show it.
virtual bool HasMessage() const =0
Function HasMessage Returns true if the reporter client is non-empty.
static bool m_TestSimilarLabels
Definition: dialog_erc.h:51
wxTextCtrl * m_MessagesList
Definition: erc.h:43
NETLIST_OBJECT_LIST * BuildNetListBase(bool updateStatusText=true)
Create a flat list which stores all connected objects.
void DeleteAllMarkers(enum MARKER_BASE::TYPEMARKER aMarkerType)
Delete all electronic rules check markers of aMarkerType from all the screens in the list...
void setDRCMatrixButtonState(wxBitmapButton *aButton, int aState)
Definition: dialog_erc.cpp:346
PNG memory record (file in memory).
Definition: bitmap_types.h:41
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:430
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:95
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:339
EDA_DRAW_PANEL * GetCanvas()
Definition: draw_frame.h:342
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:340
void OnEraseDrcMarkersClick(wxCommandEvent &event) override
Definition: dialog_erc.cpp:145
const wxString CommentERC_H[]
Definition: erc.cpp:87
const wxString & GetFileName() const
Definition: sch_screen.h:120
wxPoint m_Pos
position of the marker
Definition: marker_base.h:53
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:294
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
Schematic editor (Eeschema) main window.
wxTextCtrl * m_TotalErrCount
void SkipNextLeftButtonReleaseEvent()
function SkipNextLeftButtonReleaseEvent after calling this function, if the left mouse button is down...
Definition: draw_frame.cpp:289
Class REPORTER is a pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:61
void UpdateAllScreenReferences()
Function UpdateAllScreenReferences updates the reference and the m_Multi parameter (part selection) f...
SCH_SCREEN * GetScreen()
Definition: sch_sheet.h:279
SCH_ITEM * Next() const
#define ID_MATRIX_0
Definition: dialog_erc.cpp:66
ERC_HTML_LISTFRAME * m_MarkersList
Class WX_TEXT_CTRL_REPORTER is wrapper for reporting to a wxTextCtrl object.
Definition: reporter.h:103
bool WriteDiagnosticERC(const wxString &aFullFileName)
Function WriteDiagnosticERC save the ERC errors to aFullFileName.
Definition: erc.cpp:583
enum TYPEMARKER GetMarkerType() const
Definition: marker_base.h:150
Definition: erc.h:42
SCH_SCREEN * GetScreen() const override
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
void ChangeErrorLevel(wxCommandEvent &event)
Definition: dialog_erc.cpp:415
void OnLeftClickMarkersList(wxHtmlLinkEvent &event) override
Definition: dialog_erc.cpp:191
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:78
Definition: erc.h:44
bool m_initialized
Definition: dialog_erc.h:44
void OnErcCmpClick(wxCommandEvent &event) override
Definition: dialog_erc.cpp:178
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
wxButton * m_buttonERC
wxPanel * m_matrixPanel
SCH_SHEET_PATH & GetCurrentSheet()
void OnLeftDblClickMarkersList(wxMouseEvent &event) override
Definition: dialog_erc.cpp:251
The common library.
DIALOG_ERC(SCH_EDIT_FRAME *parent)
void OnButtonCloseClick(wxCommandEvent &event) override
Definition: dialog_erc.cpp:160
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:166
int CheckAnnotate(REPORTER &aReporter, bool aOneSheetOnly)
Check for annotation errors.
Definition: annotate.cpp:243
int GetMarkerCount(enum MARKER_BASE::TYPEMARKER aMarkerType, enum MARKER_BASE::MARKER_SEVERITY aSeverity)
Return the number of ERC markers of aMarkerType from all of the screens in the list.
int DiagErc[PINTYPE_COUNT][PINTYPE_COUNT]
Definition: erc.cpp:124
Definitions for the Eeschema program SCH_SCREEN class.
void ClearList()
Function ClearList deletes all items shown in the list.
eeschema ERC modeless dialog ID
Definition: id.h:284
wxString ErcFileWildcard()
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:71
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:172
void updateMarkerCounts(SCH_SCREENS *screens)
Definition: dialog_erc.cpp:122
static bool m_tstUniqueGlobalLabels
Definition: dialog_erc.h:48
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_UNDEFINED)=0
Function Report is a pure virtual function to override in the derived object.
wxCheckBox * m_WriteResultOpt
const wxString CommentERC_V[]
Definition: erc.cpp:103
void AnnotatePowerSymbols()
Function AnnotatePowerSymbols Silently annotates the not yet annotated power symbols of the entire hi...
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:70
#define NET_NC
Definition: erc.h:69
void ReBuildMatrixPanel()
Definition: dialog_erc.cpp:271
void TestErc(REPORTER &aReporter)
Definition: dialog_erc.cpp:451
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
Definition of the NETLIST_OBJECT class.
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
int TestMultiunitFootprints(SCH_SHEET_LIST &aSheetList)
Test if all units of each multiunit component have the same footprint assigned.
Definition: erc.cpp:228
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:601
const SCH_MARKER * m_lastMarkerFound
Definition: dialog_erc.h:45
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
Definition: sch_screen.h:503
void DisplayERC_MarkersList()
Definition: dialog_erc.cpp:377
wxCheckBox * m_cbTestSimilarLabels