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 #include <sch_component.h>
51 
52 #include <dialog_erc.h>
53 #include <erc.h>
54 #include <id.h>
55 
56 
59 
60 
61 bool DIALOG_ERC::m_writeErcFile = false; // saved only for the current session
62 bool DIALOG_ERC::m_TestSimilarLabels = true; // Save in project config
63 bool DIALOG_ERC::m_diagErcTableInit = false; // saved only for the current session
64 bool DIALOG_ERC::m_tstUniqueGlobalLabels = true; // saved only for the current session
65 
66 // Control identifiers for events
67 #define ID_MATRIX_0 1800
68 
69 
70 BEGIN_EVENT_TABLE( DIALOG_ERC, DIALOG_ERC_BASE )
72  wxEVT_COMMAND_BUTTON_CLICKED, DIALOG_ERC::ChangeErrorLevel )
73 END_EVENT_TABLE()
74 
75 
77  DIALOG_ERC_BASE( parent, ID_DIALOG_ERC // parent looks for this ID explicitly
78  )
79 {
80  m_parent = parent;
81  m_lastMarkerFound = NULL;
82  Init();
83 
84  // Now all widgets have the size fixed, call FinishDialogSettings
85  FinishDialogSettings();
86 }
87 
88 
90 {
93 }
94 
95 
97 {
98  m_initialized = false;
99 
100  for( int ii = 0; ii < PINTYPE_COUNT; ii++ )
101  {
102  for( int jj = 0; jj < PINTYPE_COUNT; jj++ )
103  m_buttonList[ii][jj] = NULL;
104  }
105 
106  m_WriteResultOpt->SetValue( m_writeErcFile );
109 
110  SCH_SCREENS screens;
111  updateMarkerCounts( &screens );
112 
114 
115  // Init Panel Matrix
117 
118  // Set the run ERC button as the default button.
119  m_buttonERC->SetDefault();
120 }
121 
122 
124 {
125  int markers = screens->GetMarkerCount( MARKER_BASE::MARKER_ERC,
127  int warnings = screens->GetMarkerCount( MARKER_BASE::MARKER_ERC,
129  int errors = screens->GetMarkerCount( MARKER_BASE::MARKER_ERC,
131 
132  wxString num;
133  num.Printf( wxT( "%d" ), markers );
134  m_TotalErrCount->SetValue( num );
135 
136  num.Printf( wxT( "%d" ), errors );
137  m_LastErrCount->SetValue( num );
138 
139  num.Printf( wxT( "%d" ), warnings );
140  m_LastWarningCount->SetValue( num );
141 }
142 
143 
144 /* Delete the old ERC markers, over the whole hierarchy
145  */
146 void DIALOG_ERC::OnEraseDrcMarkersClick( wxCommandEvent& event )
147 {
148  SCH_SCREENS ScreenList;
149 
151  updateMarkerCounts( &ScreenList );
152 
154  m_parent->GetCanvas()->Refresh();
155 }
156 
157 
158 
159 /* event handler for Close button
160 */
161 void DIALOG_ERC::OnButtonCloseClick( wxCommandEvent& event )
162 {
163  Close();
164 }
165 
166 
167 void DIALOG_ERC::OnCloseErcDialog( wxCloseEvent& event )
168 {
169  Destroy();
170 }
171 
172 
173 void DIALOG_ERC::OnResetMatrixClick( wxCommandEvent& event )
174 {
175  ResetDefaultERCDiag( event );
176 }
177 
178 
179 void DIALOG_ERC::OnErcCmpClick( wxCommandEvent& event )
180 {
181  wxBusyCursor();
183 
184  m_MessagesList->Clear();
185  wxSafeYield(); // m_MarkersList must be redraw
186 
188  TestErc( reporter );
189 }
190 
191 
192 void DIALOG_ERC::OnLeftClickMarkersList( wxHtmlLinkEvent& event )
193 {
194  wxString link = event.GetLinkInfo().GetHref();
195 
196  m_lastMarkerFound = NULL;
197 
198  long index;
199 
200  if( !link.ToLong( &index ) )
201  return;
202 
203  const SCH_MARKER* marker = m_MarkersList->GetItem( index );
204 
205  if( marker == NULL )
206  return;
207 
208  // Search for the selected marker
209  unsigned i;
210  SCH_SHEET_LIST sheetList( g_RootSheet );
211  bool notFound = true;
212 
213  for( i = 0; i < sheetList.size(); i++ )
214  {
215  SCH_ITEM* item = (SCH_ITEM*) sheetList[i].LastDrawList();
216 
217  for( ; item; item = item->Next() )
218  {
219  if( item == marker )
220  {
221  notFound = false;
222  break;
223  }
224  }
225 
226  if( notFound == false )
227  break;
228  }
229 
230  if( notFound ) // Error
231  {
232  wxMessageBox( _( "Marker not found" ) );
233 
234  // The marker was deleted, so rebuild marker list
236  return;
237  }
238 
239  if( sheetList[i] != m_parent->GetCurrentSheet() )
240  {
241  sheetList[i].LastScreen()->SetZoom( m_parent->GetScreen()->GetZoom() );
242  m_parent->SetCurrentSheet( sheetList[i] );
244  }
245 
246  m_lastMarkerFound = marker;
247  m_parent->SetCrossHairPosition( marker->m_Pos );
248  m_parent->RedrawScreen( marker->m_Pos, false);
249 }
250 
251 
252 void DIALOG_ERC::OnLeftDblClickMarkersList( wxMouseEvent& event )
253 {
254  // Remember: OnLeftClickMarkersList was called just before
255  // and therefore m_lastMarkerFound was initialized.
256  // (NULL if not found)
257  if( m_lastMarkerFound )
258  {
261  // prevent a mouse left button release event in
262  // coming from the ERC dialog double click
263  // ( the button is released after closing this dialog and will generate
264  // an unwanted event in parent frame)
266  }
267 
268  Close();
269 }
270 
271 
273 {
274  // Try to know the size of bitmap button used in drc matrix
275  wxBitmapButton * dummy = new wxBitmapButton( m_matrixPanel, wxID_ANY, KiBitmap( ercerr_xpm ) );
276  wxSize bitmap_size = dummy->GetSize();
277  delete dummy;
278 
279  if( !m_diagErcTableInit )
280  {
281  memcpy( DiagErc, DefaultDiagErc, sizeof(DefaultDiagErc) );
282  m_diagErcTableInit = true;
283  }
284 
285  wxPoint pos;
286  // Get the current text size:use a dummy text.
287  wxStaticText* text = new wxStaticText( m_matrixPanel, -1, wxT( "W" ), pos );
288  int text_height = text->GetRect().GetHeight();
289  bitmap_size.y = std::max( bitmap_size.y, text_height );
290  delete text;
291 
292  // compute the Y pos interval:
293  pos.y = text_height;
294 
295  if( m_initialized == false )
296  {
297  std::vector<wxStaticText*> labels;
298 
299  // Print row labels
300  for( int ii = 0; ii < PINTYPE_COUNT; ii++ )
301  {
302  int y = pos.y + (ii * bitmap_size.y);
303  text = new wxStaticText( m_matrixPanel, -1, CommentERC_H[ii],
304  wxPoint( 5, y + ( bitmap_size.y / 2) - (text_height / 2) ) );
305  labels.push_back( text );
306 
307  int x = text->GetRect().GetRight();
308  pos.x = std::max( pos.x, x );
309  }
310 
311  // Right-align
312  for( int ii = 0; ii < PINTYPE_COUNT; ii++ )
313  {
314  wxPoint labelPos = labels[ ii ]->GetPosition();
315  labelPos.x = pos.x - labels[ ii ]->GetRect().GetWidth();
316  labels[ ii ]->SetPosition( labelPos );
317  }
318 
319  pos.x += 5;
320  }
321  else
322  pos = m_buttonList[0][0]->GetPosition();
323 
324  for( int ii = 0; ii < PINTYPE_COUNT; ii++ )
325  {
326  int y = pos.y + (ii * bitmap_size.y);
327 
328  for( int jj = 0; jj <= ii; jj++ )
329  {
330  // Add column labels (only once)
331  int diag = DiagErc[ii][jj];
332  int x = pos.x + (jj * bitmap_size.x);
333 
334  if( (ii == jj) && !m_initialized )
335  {
336  wxPoint txtpos;
337  txtpos.x = x + (bitmap_size.x / 2);
338  txtpos.y = y - text_height;
339  text = new wxStaticText( m_matrixPanel, -1, CommentERC_V[ii], txtpos );
340  }
341 
342  int event_id = ID_MATRIX_0 + ii + ( jj * PINTYPE_COUNT );
343  BITMAP_DEF bitmap_butt = erc_green_xpm;
344 
345  delete m_buttonList[ii][jj];
346  m_buttonList[ii][jj] = new wxBitmapButton( m_matrixPanel,
347  event_id,
348  KiBitmap( bitmap_butt ),
349  wxPoint( x, y ) );
350  setDRCMatrixButtonState( m_buttonList[ii][jj], diag );
351  }
352  }
353 
354  m_initialized = true;
355 }
356 
357 
358 void DIALOG_ERC::setDRCMatrixButtonState( wxBitmapButton *aButton, int aState )
359 {
360  BITMAP_DEF bitmap_butt = NULL;
361  wxString tooltip;
362 
363  switch( aState )
364  {
365  case OK:
366  bitmap_butt = erc_green_xpm;
367  tooltip = _( "No error or warning" );
368  break;
369 
370  case WAR:
371  bitmap_butt = ercwarn_xpm;
372  tooltip = _( "Generate warning" );
373  break;
374 
375  case ERR:
376  bitmap_butt = ercerr_xpm;
377  tooltip = _( "Generate error" );
378  break;
379  }
380 
381  if( bitmap_butt )
382  {
383  aButton->SetBitmap( KiBitmap( bitmap_butt ) );
384  aButton->SetToolTip( tooltip );
385  }
386 }
387 
388 
390 {
391  SCH_SHEET_LIST sheetList( g_RootSheet);
393 
394  for( unsigned i = 0; i < sheetList.size(); i++ )
395  {
396  SCH_ITEM* item = sheetList[i].LastDrawList();
397 
398  for( ; item != NULL; item = item->Next() )
399  {
400  if( item->Type() != SCH_MARKER_T )
401  continue;
402 
403  SCH_MARKER* marker = (SCH_MARKER*) item;
404 
405  if( marker->GetMarkerType() != MARKER_BASE::MARKER_ERC )
406  continue;
407 
408  m_MarkersList->AppendToList( marker );
409  }
410  }
411 
413 }
414 
415 
416 void DIALOG_ERC::ResetDefaultERCDiag( wxCommandEvent& event )
417 {
418  memcpy( DiagErc, DefaultDiagErc, sizeof( DiagErc ) );
420  m_TestSimilarLabels = true;
424 }
425 
426 
427 void DIALOG_ERC::ChangeErrorLevel( wxCommandEvent& event )
428 {
429  int id, level, ii, x, y;
430  wxPoint pos;
431 
432  id = event.GetId();
433  ii = id - ID_MATRIX_0;
434  wxBitmapButton* butt = (wxBitmapButton*) event.GetEventObject();
435  pos = butt->GetPosition();
436 
437  x = ii / PINTYPE_COUNT; y = ii % PINTYPE_COUNT;
438 
439  level = DiagErc[y][x];
440 
441  //change to the next error level
442  switch( level )
443  {
444  case OK:
445  level = WAR;
446  break;
447 
448  case WAR:
449  level = ERR;
450  break;
451 
452  case ERR:
453  level = OK;
454  break;
455  }
456 
457  setDRCMatrixButtonState( butt, level );
458 
459  DiagErc[y][x] = DiagErc[x][y] = level;
460 }
461 
462 
463 void DIALOG_ERC::TestErc( REPORTER& aReporter )
464 {
465  wxFileName fn;
466 
467  m_writeErcFile = m_WriteResultOpt->GetValue();
470 
471  // Build the whole sheet list in hierarchy (sheet, not screen)
472  SCH_SHEET_LIST sheets( g_RootSheet );
473  sheets.AnnotatePowerSymbols();
474 
475  if( m_parent->CheckAnnotate( aReporter, false ) )
476  {
477  if( aReporter.HasMessage() )
478  aReporter.ReportTail( _( "Annotation required!" ), REPORTER::RPT_ERROR );
479 
480  return;
481  }
482 
483  SCH_SCREENS screens;
484 
485  // Erase all previous DRC markers.
487 
488  /* Test duplicate sheet names inside a given sheet, one cannot have sheets with
489  * duplicate names (file names can be duplicated).
490  */
491  TestDuplicateSheetNames( true );
492 
493  /* Test is all units of each multiunit component have the same footprint assigned.
494  */
495  TestMultiunitFootprints( sheets );
496 
497  std::unique_ptr<NETLIST_OBJECT_LIST> objectsConnectedList( m_parent->BuildNetListBase() );
498 
499  // Reset the connection type indicator
500  objectsConnectedList->ResetConnectionsType();
501 
502  unsigned lastItemIdx;
503  unsigned nextItemIdx = lastItemIdx = 0;
504  int MinConn = NOC;
505 
506  /* Check that a pin appears in only one net. This check is necessary
507  * because multi-unit components that have shared pins can be wired to
508  * different nets.
509  */
510  std::unordered_map<wxString, wxString> pin_to_net_map;
511 
512  /* The netlist generated by SCH_EDIT_FRAME::BuildNetListBase is sorted
513  * by net number, which means we can group netlist items into ranges
514  * that live in the same net. The range from nextItem to the current
515  * item (exclusive) needs to be checked against the current item. The
516  * lastItem variable is used as a helper to pass the last item's number
517  * from one loop iteration to the next, which simplifies the initial
518  * pass.
519  */
520 
521  for( unsigned itemIdx = 0; itemIdx < objectsConnectedList->size(); itemIdx++ )
522  {
523  auto item = objectsConnectedList->GetItem( itemIdx );
524  auto lastItem = objectsConnectedList->GetItem( lastItemIdx );
525 
526  auto lastNet = lastItem->GetNet();
527  auto net = item->GetNet();
528 
529  wxASSERT_MSG( lastNet <= net, wxT( "Netlist not correctly ordered" ) );
530 
531  if( lastNet != net )
532  {
533  // New net found:
534  MinConn = NOC;
535  nextItemIdx = itemIdx;
536  }
537 
538  switch( item->m_Type )
539  {
540  // These items do not create erc problems
542  case NET_SEGMENT:
543  case NET_BUS:
544  case NET_JUNCTION:
545  case NET_LABEL:
546  case NET_BUSLABELMEMBER:
547  case NET_PINLABEL:
549  break;
550 
551  case NET_HIERLABEL:
553  case NET_SHEETLABEL:
555  // ERC problems when pin sheets do not match hierarchical labels.
556  // Each pin sheet must match a hierarchical label
557  // Each hierarchical label must match a pin sheet
558  objectsConnectedList->TestforNonOrphanLabel( itemIdx, nextItemIdx );
559  break;
560  case NET_GLOBLABEL:
562  objectsConnectedList->TestforNonOrphanLabel( itemIdx, nextItemIdx );
563  break;
564 
565  case NET_NOCONNECT:
566 
567  // ERC problems when a noconnect symbol is connected to more than one pin.
568  MinConn = NET_NC;
569 
570  if( objectsConnectedList->CountPinsInNet( nextItemIdx ) > 1 )
571  Diagnose( item, NULL, MinConn, UNC );
572 
573  break;
574 
575  case NET_PIN:
576  {
577  // Check if this pin has appeared before on a different net
578  if( item->m_Link )
579  {
580  auto ref = item->GetComponentParent()->GetRef( &item->m_SheetPath );
581  wxString pin_name = ref + "_" + item->m_PinNum;
582 
583  if( pin_to_net_map.count( pin_name ) == 0 )
584  {
585  pin_to_net_map[pin_name] = item->GetNetName();
586  }
587  else if( pin_to_net_map[pin_name] != item->GetNetName() )
588  {
589  SCH_MARKER* marker = new SCH_MARKER();
590 
591  marker->SetTimeStamp( GetNewTimeStamp() );
592  marker->SetData( ERCE_DIFFERENT_UNIT_NET, item->m_Start,
593  wxString::Format( _( "Pin %s on %s is connected to both %s and %s" ),
594  item->m_PinNum, ref, pin_to_net_map[pin_name], item->GetNetName() ),
595  item->m_Start );
598 
599  item->m_SheetPath.LastScreen()->Append( marker );
600  }
601  }
602 
603  // Look for ERC problems between pins:
604  TestOthersItems( objectsConnectedList.get(), itemIdx, nextItemIdx, &MinConn );
605  break;
606  }
607  }
608 
609  lastItemIdx = itemIdx;
610  }
611 
612  // Test similar labels (i;e. labels which are identical when
613  // using case insensitive comparisons)
614  if( m_TestSimilarLabels )
615  objectsConnectedList->TestforSimilarLabels();
616 
617  // Displays global results:
618  updateMarkerCounts( &screens );
619 
620  // Display diags:
622 
623  // Display new markers:
624  m_parent->GetCanvas()->Refresh();
625 
626  // Display message
627  aReporter.ReportTail( _( "Finished" ), REPORTER::RPT_INFO );
628 
629  if( m_writeErcFile )
630  {
631  fn = g_RootSheet->GetScreen()->GetFileName();
632  fn.SetExt( wxT( "erc" ) );
633 
634  wxFileDialog dlg( this, _( "ERC File" ), fn.GetPath(), fn.GetFullName(),
635  ErcFileWildcard(), wxFD_SAVE );
636 
637  if( dlg.ShowModal() == wxID_CANCEL )
638  return;
639 
640  if( WriteDiagnosticERC( dlg.GetPath() ) )
641  ExecuteFile( this, Pgm().GetEditorName(), QuoteFullPath( fn ) );
642  }
643 }
644 
645 
646 wxDialog* InvokeDialogERC( SCH_EDIT_FRAME* aCaller )
647 {
648  // This is a modeless dialog, so new it rather than instantiating on stack.
649  DIALOG_ERC* dlg = new DIALOG_ERC( aCaller );
650 
651  dlg->Show( true );
652 
653  return dlg; // wxDialog is information hiding about DIALOG_ERC.
654 }
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:209
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:358
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:96
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
Definition: draw_panel.cpp:338
EDA_DRAW_PANEL * GetCanvas()
Definition: draw_frame.h:359
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:146
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:66
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:300
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:67
ERC_HTML_LISTFRAME * m_MarkersList
void SetData(int aErrorCode, const wxPoint &aMarkerPos, const wxString &aText, const wxPoint &aPos, const wxString &bText, const wxPoint &bPos)
Function SetData fills in all the reportable data associated with a MARKER.
#define ERCE_DIFFERENT_UNIT_NET
Definition: erc.h:65
Class WX_TEXT_CTRL_REPORTER is wrapper for reporting to a wxTextCtrl object.
Definition: reporter.h:142
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:427
void OnLeftClickMarkersList(wxHtmlLinkEvent &event) override
Definition: dialog_erc.cpp:192
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:78
timestamp_t GetNewTimeStamp()
Definition: common.cpp:160
Definition: erc.h:44
bool m_initialized
Definition: dialog_erc.h:44
void OnErcCmpClick(wxCommandEvent &event) override
Definition: dialog_erc.cpp:179
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
virtual REPORTER & ReportTail(const wxString &aText, SEVERITY aSeverity=RPT_UNDEFINED)
Function ReportTail Places the report at the end of the list, for objects that support report orderin...
Definition: reporter.h:109
wxButton * m_buttonERC
wxPanel * m_matrixPanel
SCH_SHEET_PATH & GetCurrentSheet()
void OnLeftDblClickMarkersList(wxMouseEvent &event) override
Definition: dialog_erc.cpp:252
The common library.
DIALOG_ERC(SCH_EDIT_FRAME *parent)
void OnButtonCloseClick(wxCommandEvent &event) override
Definition: dialog_erc.cpp:161
Definition: erc.h:45
void AppendToList(SCH_MARKER *aMarker)
Function AppendToList.
void SetMarkerType(enum TYPEMARKER aMarkerType)
accessors to set/get marker type (DRC, ERC, or other)
Definition: marker_base.h:145
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:167
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:285
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
Definition the SCH_COMPONENT class for Eeschema.
static bool m_diagErcTableInit
Definition: dialog_erc.h:47
#define NOC
Definition: erc.h:73
see class PGM_BASE
const SCH_MARKER * GetItem(unsigned aIndex)
Function GetItem returns a requested DRC_ITEM* or NULL.
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
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 SetErrorLevel(MARKER_SEVERITY aErrorLevel)
accessors to set/get error levels (warning, error, fatal error..)
Definition: marker_base.h:133
void OnResetMatrixClick(wxCommandEvent &event) override
Definition: dialog_erc.cpp:173
size_t i
Definition: json11.cpp:597
void updateMarkerCounts(SCH_SCREENS *screens)
Definition: dialog_erc.cpp:123
static bool m_tstUniqueGlobalLabels
Definition: dialog_erc.h:48
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:71
#define NET_NC
Definition: erc.h:71
void ReBuildMatrixPanel()
Definition: dialog_erc.cpp:272
void TestErc(REPORTER &aReporter)
Definition: dialog_erc.cpp:463
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:416
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:646
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:389
void SetTimeStamp(timestamp_t aNewTimeStamp)
Definition: base_struct.h:214
wxCheckBox * m_cbTestSimilarLabels