KiCad PCB EDA Suite
ee_inspection_tool.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) 2019 CERN
5  * Copyright (C) 2019-2021 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #include <sch_symbol.h>
26 #include <id.h>
27 #include <kiway.h>
28 #include <confirm.h>
29 #include <tool/conditional_menu.h>
31 #include <tools/ee_actions.h>
34 #include <tools/ee_selection.h>
35 #include <sim/sim_plot_frame.h>
36 #include <sch_edit_frame.h>
37 #include <symbol_edit_frame.h>
38 #include <symbol_viewer_frame.h>
39 #include <eda_doc.h>
40 #include <sch_marker.h>
41 #include <project.h>
43 #include <dialogs/dialog_erc.h>
44 #include <math/util.h> // for KiROUND
45 
46 
48  EE_TOOL_BASE<SCH_BASE_FRAME>( "eeschema.InspectionTool" ),
49  m_ercDialog( nullptr )
50 {
51 }
52 
53 
55 {
57 
58  auto singleMarkerCondition = SELECTION_CONDITIONS::OnlyType( SCH_MARKER_T )
60 
61  // Add inspection actions to the selection tool menu
62  //
64 
65  selToolMenu.AddItem( EE_ACTIONS::excludeMarker, singleMarkerCondition, 100 );
66 
69 
70  return true;
71 }
72 
73 
75 {
76  EE_TOOL_BASE::Reset( aReason );
77 
78  if( aReason == MODEL_RELOAD )
79  {
81  }
82 }
83 
84 
86 {
87  ShowERCDialog();
88  return 0;
89 }
90 
91 
93 {
94  if( m_frame->IsType( FRAME_SCH ) )
95  {
96  if( m_ercDialog )
97  {
98  // Needed at least on Windows. Raise() is not enough
99  m_ercDialog->Show( true );
100  // Bring it to the top if already open. Dual monitor users need this.
101  m_ercDialog->Raise();
102  }
103  else
104  {
105  // This is a modeless dialog, so new it rather than instantiating on stack.
106  m_ercDialog = new DIALOG_ERC( static_cast<SCH_EDIT_FRAME*>( m_frame ) );
107 
108  m_ercDialog->Show( true );
109  }
110  }
111 }
112 
113 
115 {
116  if( m_ercDialog )
117  m_ercDialog->Destroy();
118 
119  m_ercDialog = nullptr;
120 }
121 
122 
124 {
125  if( m_ercDialog )
126  {
127  m_ercDialog->Show( true );
128  m_ercDialog->Raise();
130  }
131  else
132  {
133  ShowERCDialog();
134  }
135 
136  return 0;
137 }
138 
139 
141 {
142  if( m_ercDialog )
143  {
144  m_ercDialog->Show( true );
145  m_ercDialog->Raise();
147  }
148  else
149  {
150  ShowERCDialog();
151  }
152 
153  return 0;
154 }
155 
156 
158 {
159  if( m_ercDialog )
160  {
161  // Let the ERC dialog handle it since it has more update hassles to worry about
163  }
164  else
165  {
167  EE_SELECTION& selection = selTool->GetSelection();
168 
169  if( selection.GetSize() == 1 && selection.Front()->Type() == SCH_MARKER_T )
170  {
171  SCH_MARKER* marker = static_cast<SCH_MARKER*>( selection.Front() );
172 
173  marker->SetExcluded( true );
174  m_frame->GetCanvas()->GetView()->Update( marker );
175  m_frame->GetCanvas()->Refresh();
176  m_frame->OnModify();
177  }
178  }
179 
180  return 0;
181 }
182 
183 
184 // helper function to sort pins by pin num
185 bool sort_by_pin_number( const LIB_PIN* ref, const LIB_PIN* tst )
186 {
187  // Use number as primary key
188  int test = ref->GetNumber().Cmp( tst->GetNumber() );
189 
190  // Use DeMorgan variant as secondary key
191  if( test == 0 )
192  test = ref->GetConvert() - tst->GetConvert();
193 
194  // Use unit as tertiary key
195  if( test == 0 )
196  test = ref->GetUnit() - tst->GetUnit();
197 
198  return test < 0;
199 }
200 
201 
203 {
204  LIB_SYMBOL* symbol = static_cast<SYMBOL_EDIT_FRAME*>( m_frame )->GetCurSymbol();
205  EDA_UNITS units = m_frame->GetUserUnits();
206 
207  if( !symbol )
208  return 0;
209 
210  LIB_PINS pinList;
211  symbol->GetPins( pinList );
212 
213  // Sort pins by pin num, so 2 duplicate pins
214  // (pins with the same number) will be consecutive in list
215  sort( pinList.begin(), pinList.end(), sort_by_pin_number );
216 
217  // Test for duplicates:
218  DIALOG_DISPLAY_HTML_TEXT_BASE error_display( m_frame, wxID_ANY, _( "Symbol Warnings" ),
219  wxDefaultPosition, wxSize( 750, 600 ) );
220 
221  // The minimal grid size allowed to place a pin is 25 mils
222  // the best grid size is 50 mils, but 25 mils is still usable
223  // this is because all symbols are using a 50 mils grid to place pins, and therefore
224  // the wires must be on the 50 mils grid
225  // So raise an error if a pin is not on a 25 (or bigger :50 or 100) mils grid
226  const int min_grid_size = Mils2iu( 25 );
227  const int grid_size = KiROUND( getView()->GetGAL()->GetGridSize().x );
228  const int clamped_grid_size = ( grid_size < min_grid_size ) ? min_grid_size : grid_size;
229 
230  std::vector<wxString> messages;
231  wxString msg;
232 
233  for( unsigned ii = 1; ii < pinList.size(); ii++ )
234  {
235  LIB_PIN* pin = pinList[ii - 1];
236  LIB_PIN* next = pinList[ii];
237 
238  if( pin->GetNumber() != next->GetNumber() || pin->GetConvert() != next->GetConvert() )
239  continue;
240 
241  wxString pinName;
242  wxString nextName;
243 
244  if( pin->GetName() != "~" && !pin->GetName().IsEmpty() )
245  pinName = " '" + pin->GetName() + "'";
246 
247  if( next->GetName() != "~" && !next->GetName().IsEmpty() )
248  nextName = " '" + next->GetName() + "'";
249 
250  if( symbol->HasConversion() && next->GetConvert() )
251  {
252  if( symbol->GetUnitCount() <= 1 )
253  {
254  msg.Printf( _( "<b>Duplicate pin %s</b> %s at location <b>(%.3f, %.3f)</b>"
255  " conflicts with pin %s%s at location <b>(%.3f, %.3f)</b>"
256  " of converted." ),
257  next->GetNumber(),
258  nextName,
259  MessageTextFromValue( units, next->GetPosition().x ),
260  MessageTextFromValue( units, -next->GetPosition().y ),
261  pin->GetNumber(),
262  pin->GetName(),
263  MessageTextFromValue( units, pin->GetPosition().x ),
264  MessageTextFromValue( units, -pin->GetPosition().y ) );
265  }
266  else
267  {
268  msg.Printf( _( "<b>Duplicate pin %s</b> %s at location <b>(%.3f, %.3f)</b>"
269  " conflicts with pin %s%s at location <b>(%.3f, %.3f)</b>"
270  " in units %c and %c of converted." ),
271  next->GetNumber(),
272  nextName,
273  MessageTextFromValue( units, next->GetPosition().x ),
274  MessageTextFromValue( units, -next->GetPosition().y ),
275  pin->GetNumber(),
276  pinName,
277  MessageTextFromValue( units, pin->GetPosition().x ),
278  MessageTextFromValue( units, -pin->GetPosition().y ),
279  'A' + next->GetUnit() - 1,
280  'A' + pin->GetUnit() - 1 );
281  }
282  }
283  else
284  {
285  if( symbol->GetUnitCount() <= 1 )
286  {
287  msg.Printf( _( "<b>Duplicate pin %s</b> %s at location <b>(%s, %s)</b>"
288  " conflicts with pin %s%s at location <b>(%s, %s)</b>." ),
289  next->GetNumber(),
290  nextName,
291  MessageTextFromValue( units, next->GetPosition().x ),
292  MessageTextFromValue( units, -next->GetPosition().y ),
293  pin->GetNumber(),
294  pinName,
295  MessageTextFromValue( units, pin->GetPosition().x ),
296  MessageTextFromValue( units, -pin->GetPosition().y ) );
297  }
298  else
299  {
300  msg.Printf( _( "<b>Duplicate pin %s</b> %s at location <b>(%s, %s)</b>"
301  " conflicts with pin %s%s at location <b>(%s, %s)</b>"
302  " in units %c and %c." ),
303  next->GetNumber(),
304  nextName,
305  MessageTextFromValue( units, next->GetPosition().x ),
306  MessageTextFromValue( units, -next->GetPosition().y ),
307  pin->GetNumber(),
308  pinName,
309  MessageTextFromValue( units, pin->GetPosition().x ),
310  MessageTextFromValue( units, -pin->GetPosition().y ),
311  'A' + next->GetUnit() - 1,
312  'A' + pin->GetUnit() - 1 );
313  }
314  }
315 
316  msg += wxT( "<br><br>" );
317  messages.push_back( msg );
318  }
319 
320  for( LIB_PIN* pin : pinList )
321  {
322  wxString pinName = pin->GetName();
323 
324  if( pinName.IsEmpty() || pinName == "~" )
325  pinName = "";
326  else
327  pinName = "'" + pinName + "'";
328 
329  if( !symbol->IsPower()
330  && pin->GetType() == ELECTRICAL_PINTYPE::PT_POWER_IN
331  && !pin->IsVisible() )
332  {
333  // hidden power pin
334  if( symbol->HasConversion() && pin->GetConvert() )
335  {
336  if( symbol->GetUnitCount() <= 1 )
337  {
338  msg.Printf( _( "<b>Hidden power pin %s</b> %s at location <b>(%s, %s)</b>"
339  " of converted." ),
340  pin->GetNumber(),
341  pinName,
342  MessageTextFromValue( units, pin->GetPosition().x ),
343  MessageTextFromValue( units, -pin->GetPosition().y ) );
344  }
345  else
346  {
347  msg.Printf( _( "<b>Hidden power pin %s</b> %s at location <b>(%s, %s)</b>"
348  " in unit %c of converted." ),
349  pin->GetNumber(),
350  pinName,
351  MessageTextFromValue( units, pin->GetPosition().x ),
352  MessageTextFromValue( units, -pin->GetPosition().y ),
353  'A' + pin->GetUnit() - 1 );
354  }
355  }
356  else
357  {
358  if( symbol->GetUnitCount() <= 1 )
359  {
360  msg.Printf( _( "<b>Hidden power pin %s</b> %s at location <b>(%s, %s)</b>." ),
361  pin->GetNumber(),
362  pinName,
363  MessageTextFromValue( units, pin->GetPosition().x ),
364  MessageTextFromValue( units, -pin->GetPosition().y ) );
365  }
366  else
367  {
368  msg.Printf( _( "<b>Hidden power pin %s</b> %s at location <b>(%s, %s)</b>"
369  " in unit %c." ),
370  pin->GetNumber(),
371  pinName,
372  MessageTextFromValue( units, pin->GetPosition().x ),
373  MessageTextFromValue( units, -pin->GetPosition().y ),
374  'A' + pin->GetUnit() - 1 );
375  }
376  }
377 
378  msg += wxT( "<br>" );
379  msg += _( "(Hidden power pins will drive their pin names on to any connected nets.)" );
380  msg += wxT( "<br><br>" );
381  messages.push_back( msg );
382  }
383 
384  if( ( (pin->GetPosition().x % clamped_grid_size) != 0 )
385  || ( (pin->GetPosition().y % clamped_grid_size) != 0 ) )
386  {
387  // pin is off grid
388  if( symbol->HasConversion() && pin->GetConvert() )
389  {
390  if( symbol->GetUnitCount() <= 1 )
391  {
392  msg.Printf( _( "<b>Off grid pin %s</b> %s at location <b>(%s, %s)</b>"
393  " of converted." ),
394  pin->GetNumber(),
395  pinName,
396  MessageTextFromValue( units, pin->GetPosition().x ),
397  MessageTextFromValue( units, -pin->GetPosition().y ) );
398  }
399  else
400  {
401  msg.Printf( _( "<b>Off grid pin %s</b> %s at location <b>(%.3s, %.3s)</b>"
402  " in unit %c of converted." ),
403  pin->GetNumber(),
404  pinName,
405  MessageTextFromValue( units, pin->GetPosition().x ),
406  MessageTextFromValue( units, -pin->GetPosition().y ),
407  'A' + pin->GetUnit() - 1 );
408  }
409  }
410  else
411  {
412  if( symbol->GetUnitCount() <= 1 )
413  {
414  msg.Printf( _( "<b>Off grid pin %s</b> %s at location <b>(%s, %s)</b>." ),
415  pin->GetNumber(),
416  pinName,
417  MessageTextFromValue( units, pin->GetPosition().x ),
418  MessageTextFromValue( units, -pin->GetPosition().y ) );
419  }
420  else
421  {
422  msg.Printf( _( "<b>Off grid pin %s</b> %s at location <b>(%s, %s)</b>"
423  " in unit %c." ),
424  pin->GetNumber(),
425  pinName,
426  MessageTextFromValue( units, pin->GetPosition().x ),
427  MessageTextFromValue( units, -pin->GetPosition().y ),
428  'A' + pin->GetUnit() - 1 );
429  }
430  }
431 
432  msg += wxT( "<br><br>" );
433  messages.push_back( msg );
434  }
435  }
436 
437  if( messages.empty() )
438  {
439  DisplayInfoMessage( m_frame, _( "No symbol issues found." ) );
440  }
441  else
442  {
443  wxColour bgcolor = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW );
444  wxColour fgcolor = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT );
445  wxString outmsg = wxString::Format( "<html><body bgcolor='%s' text='%s'>",
446  bgcolor.GetAsString( wxC2S_HTML_SYNTAX ),
447  fgcolor.GetAsString( wxC2S_HTML_SYNTAX ) );
448 
449  for( auto& msgPart : messages )
450  outmsg += msgPart;
451 
452  outmsg += "</body></html>";
453 
454  error_display.m_htmlWindow->SetPage( outmsg );
455  error_display.ShowModal();
456  }
457 
458  return 0;
459 }
460 
461 
463 {
464 #ifdef KICAD_SPICE
466 
467  if( !simFrame )
468  return -1;
469 
470  simFrame->Show( true );
471 
472  // On Windows, Raise() does not bring the window on screen, when iconized
473  if( simFrame->IsIconized() )
474  simFrame->Iconize( false );
475 
476  simFrame->Raise();
477 #endif /* KICAD_SPICE */
478  return 0;
479 }
480 
481 
483 {
484  wxString datasheet;
485 
487  {
488  LIB_SYMBOL* symbol = static_cast<SYMBOL_EDIT_FRAME*>( m_frame )->GetCurSymbol();
489 
490  if( !symbol )
491  return 0;
492 
493  datasheet = symbol->GetDatasheetField().GetText();
494  }
496  {
497  LIB_SYMBOL* entry = static_cast<SYMBOL_VIEWER_FRAME*>( m_frame )->GetSelectedSymbol();
498 
499  if( !entry )
500  return 0;
501 
502  datasheet = entry->GetDatasheetField().GetText();
503  }
504  else if( m_frame->IsType( FRAME_SCH ) )
505  {
507 
508  if( selection.Empty() )
509  return 0;
510 
511  SCH_SYMBOL* symbol = (SCH_SYMBOL*) selection.Front();
512 
513  datasheet = symbol->GetField( DATASHEET_FIELD )->GetText();
514  }
515 
516  if( datasheet.IsEmpty() || datasheet == wxT( "~" ) )
517  m_frame->ShowInfoBarError( _( "No datasheet defined." ) );
518  else
520 
521  return 0;
522 }
523 
524 
526 {
528  EE_SELECTION& selection = selTool->GetSelection();
529 
530  if( selection.GetSize() == 1 )
531  {
532  EDA_ITEM* item = (EDA_ITEM*) selection.Front();
533 
534  MSG_PANEL_ITEMS msgItems;
535  item->GetMsgPanelInfo( m_frame, msgItems );
536  m_frame->SetMsgPanel( msgItems );
537  }
538  else
539  {
541  }
542 
543  if( SCH_EDIT_FRAME* editFrame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame ) )
544  editFrame->UpdateNetHighlightStatus();
545 
546  return 0;
547 }
548 
549 
551 {
556 
559 
561 
566 }
567 
568 
CITER next(CITER it)
Definition: ptree.cpp:126
power input (GND, VCC for ICs). Must be connected to a power output.
KIGFX::SCH_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0) const
Return a list of pin object pointers from the draw item list.
Definition: lib_symbol.cpp:693
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aAddUnitLabel, EDA_DATA_TYPE aType)
Convert a value to a string using double notation.
Definition: base_units.cpp:104
static TOOL_ACTION showDatasheet
Inspection and Editing.
Definition: ee_actions.h:136
void Reset(RESET_REASON aReason) override
Bring the tool to a known, initial state.
Definition: ee_tool_base.h:86
bool GetAssociatedDocument(wxWindow *aParent, const wxString &aDocName, PROJECT *aProject)
Open a document (file) with the suitable browser.
Definition: eda_doc.cpp:79
static const TOOL_EVENT SelectedEvent
Definition: actions.h:199
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
Definition: kiway_holder.h:53
DIALOG_ERC * m_ercDialog
int RunSimulation(const TOOL_EVENT &aEvent)
static SELECTION_CONDITION SingleSymbol
SCH_FIELD * GetField(MANDATORY_FIELD_T aFieldType)
Return a mandatory field in this symbol.
Definition: sch_symbol.cpp:666
Model changes (required full reload)
Definition: tool_base.h:80
static TOOL_ACTION runERC
Definition: ee_actions.h:137
static const TOOL_EVENT UnselectedEvent
Definition: actions.h:200
This file is part of the common library.
void ExcludeMarker()
Definition: dialog_erc.cpp:663
void setTransitions() override
<
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_item.h:55
This file is part of the common library.
static bool Idle(const SELECTION &aSelection)
Test if there no items selected or being edited.
CONDITIONAL_MENU & GetMenu()
Definition: tool_menu.cpp:46
void PrevMarker()
Definition: dialog_erc.cpp:645
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:214
static TOOL_ACTION nextMarker
Definition: actions.h:86
TOOL_MENU & GetToolMenu()
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:382
Schematic editor (Eeschema) main window.
bool IsPower() const
Definition: lib_symbol.cpp:409
bool sort_by_pin_number(const LIB_PIN *ref, const LIB_PIN *tst)
static TOOL_ACTION excludeMarker
Definition: actions.h:87
static SELECTION_CONDITION Count(int aNumber)
Create a functor that tests if the number of selected items is equal to the value given as parameter.
static TOOL_ACTION checkSymbol
Definition: ee_actions.h:152
Define a library symbol object.
Definition: lib_symbol.h:96
void Go(int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
Define which state (aStateFunc) to go when a certain event arrives (aConditions).
int UpdateMessagePanel(const TOOL_EVENT &aEvent)
static const TOOL_EVENT SelectedItemsModified
Selected items were moved, this can be very high frequency on the canvas, use with care.
Definition: actions.h:204
name of datasheet
bool Init() override
Init() is called once upon a registration of the tool.
Definition: ee_tool_base.h:66
static TOOL_ACTION runSimulation
Definition: ee_actions.h:209
EE_SELECTION & GetSelection()
Return the set of currently selected items.
EE_SELECTION & RequestSelection(const KICAD_T *aFilterList=EE_COLLECTOR::AllItems)
Return either an existing selection (filtered), or the selection at the current cursor if the existin...
bool HasConversion() const
Test if symbol has more than one body conversion type (DeMorgan).
int GetUnit() const
Definition: lib_item.h:259
Class DIALOG_DISPLAY_HTML_TEXT_BASE.
void SetExcluded(bool aExcluded)
Definition: marker_base.h:95
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
virtual void OnModify()
Must be called after a model change in order to set the "modify" flag and do other frame-specific pro...
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
virtual void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList)
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
Definition: eda_item.h:214
int GetUnitCount() const override
For items with units, return the number of units.
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
Generic, UI-independent tool event.
Definition: tool_event.h:152
int ExcludeMarker(const TOOL_EVENT &aEvent)
#define _(s)
Subclass of SIM_PLOT_FRAME_BASE, which is generated by wxFormBuilder.
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:177
static const TOOL_EVENT ClearedEvent
Selected item had a property changed (except movement)
Definition: actions.h:201
virtual void ClearMsgPanel()
Clear all messages from the message panel.
int GetConvert() const
Definition: lib_item.h:262
KIGFX::VIEW * getView() const
Returns the instance of #VIEW object used in the application.
Definition: tool_base.cpp:36
void Reset(RESET_REASON aReason) override
Bring the tool to a known, initial state.
bool Show(bool show) override
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:97
Implementing SIM_PLOT_FRAME_BASE.
static TOOL_ACTION prevMarker
Definition: actions.h:85
int RunERC(const TOOL_EVENT &aEvent)
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
EDA_UNITS
Definition: eda_units.h:38
const wxString & GetNumber() const
Definition: lib_pin.h:116
Schematic symbol object.
Definition: sch_symbol.h:78
bool IsType(FRAME_T aType) const
static SELECTION_CONDITION OnlyType(KICAD_T aType)
Create a functor that tests if the selected items are only of given type.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
LIB_FIELD & GetDatasheetField()
Return reference to the datasheet field.
void NextMarker()
Definition: dialog_erc.cpp:654
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:73
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:100
void ShowInfoBarError(const wxString &aErrorMsg, bool aShowCloseButton=false)
Show the WX_INFOBAR displayed on the top of the canvas with a message and an error icon on the left o...
std::vector< MSG_PANEL_ITEM > MSG_PANEL_ITEMS
Definition: msgpanel.h:97
RESET_REASON
Determine the reason of reset for a tool.
Definition: tool_base.h:77
static const KICAD_T SymbolsOnly[]
Definition: ee_collectors.h:45
A foundation class for a tool operating on a schematic or symbol.
Definition: ee_tool_base.h:49
int NextMarker(const TOOL_EVENT &aEvent)
bool Init() override
Init() is called once upon a registration of the tool.
int ShowDatasheet(const TOOL_EVENT &aEvent)
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo)
Display an informational message box with aMessage.
Definition: confirm.cpp:280
int PrevMarker(const TOOL_EVENT &aEvent)
A shim class between EDA_DRAW_FRAME and several derived classes: SYMBOL_EDIT_FRAME,...
void AddItem(const TOOL_ACTION &aAction, const SELECTION_CONDITION &aCondition, int aOrder=ANY_ORDER)
Add a menu entry to run a TOOL_ACTION on selected items.
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:133
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
EDA_ITEM * Front() const
Definition: selection.h:144
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
Definition: view.cpp:1503
int CheckSymbol(const TOOL_EVENT &aEvent)