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 {
49 public:
50  DIALOG_DISPLAY_HTML_TEXT( wxWindow* aParent, wxWindowID aId, const wxString& aTitle,
51  const wxPoint& aPos, const wxSize& aSize, long aStyle = 0 ) :
52  DIALOG_DISPLAY_HTML_TEXT_BASE( aParent, aId, aTitle, aPos, aSize, aStyle )
53  { }
54 
56  { }
57 
58  void SetPage( const wxString& message ) { m_htmlWindow->SetPage( message ); }
59 };
60 
61 
63  EE_TOOL_BASE<SCH_BASE_FRAME>( "eeschema.InspectionTool" ),
64  m_ercDialog( nullptr )
65 {
66 }
67 
68 
70 {
72 
73  // Add inspection actions to the selection tool menu
74  //
76 
78 
81 
82  return true;
83 }
84 
85 
87 {
88  EE_TOOL_BASE::Reset( aReason );
89 
90  if( aReason == MODEL_RELOAD )
91  {
93  }
94 }
95 
96 
98 {
99  ShowERCDialog();
100  return 0;
101 }
102 
103 
105 {
106  if( m_frame->IsType( FRAME_SCH ) )
107  {
108  if( m_ercDialog )
109  {
110  // Needed at least on Windows. Raise() is not enough
111  m_ercDialog->Show( true );
112  // Bring it to the top if already open. Dual monitor users need this.
113  m_ercDialog->Raise();
114  }
115  else
116  {
117  // This is a modeless dialog, so new it rather than instantiating on stack.
118  m_ercDialog = new DIALOG_ERC( static_cast<SCH_EDIT_FRAME*>( m_frame ) );
119 
120  m_ercDialog->Show( true );
121  }
122  }
123 }
124 
125 
127 {
128  if( m_ercDialog )
129  m_ercDialog->Destroy();
130 
131  m_ercDialog = nullptr;
132 }
133 
134 
136 {
137  if( m_ercDialog )
138  {
139  m_ercDialog->Show( true );
140  m_ercDialog->Raise();
142  }
143  else
144  {
145  ShowERCDialog();
146  }
147 
148  return 0;
149 }
150 
151 
153 {
154  if( m_ercDialog )
155  {
156  m_ercDialog->Show( true );
157  m_ercDialog->Raise();
159  }
160  else
161  {
162  ShowERCDialog();
163  }
164 
165  return 0;
166 }
167 
168 
170 {
172  EE_SELECTION& selection = selTool->GetSelection();
173  SCH_MARKER* marker = nullptr;
174 
175  if( selection.GetSize() == 1 && selection.Front()->Type() == SCH_MARKER_T )
176  marker = static_cast<SCH_MARKER*>( selection.Front() );
177 
178  if( m_ercDialog )
179  {
180  // Let the ERC dialog handle it since it has more update hassles to worry about
181  // Note that if marker is nullptr the dialog will exclude whichever marker is selected
182  // in the dialog itself
183  m_ercDialog->ExcludeMarker( marker );
184  }
185  else if( marker != nullptr )
186  {
187  marker->SetExcluded( true );
188  m_frame->GetCanvas()->GetView()->Update( marker );
189  m_frame->GetCanvas()->Refresh();
190  m_frame->OnModify();
191  }
192 
193  return 0;
194 }
195 
196 
197 // helper function to sort pins by pin num
198 bool sort_by_pin_number( const LIB_PIN* ref, const LIB_PIN* tst )
199 {
200  // Use number as primary key
201  int test = ref->GetNumber().Cmp( tst->GetNumber() );
202 
203  // Use DeMorgan variant as secondary key
204  if( test == 0 )
205  test = ref->GetConvert() - tst->GetConvert();
206 
207  // Use unit as tertiary key
208  if( test == 0 )
209  test = ref->GetUnit() - tst->GetUnit();
210 
211  return test < 0;
212 }
213 
214 
216 {
217  LIB_SYMBOL* symbol = static_cast<SYMBOL_EDIT_FRAME*>( m_frame )->GetCurSymbol();
218  EDA_UNITS units = m_frame->GetUserUnits();
219 
220  if( !symbol )
221  return 0;
222 
223  LIB_PINS pinList;
224  symbol->GetPins( pinList );
225 
226  // Test for duplicates:
227  // Sort pins by pin num, so 2 duplicate pins
228  // (pins with the same number) will be consecutive in list
229  sort( pinList.begin(), pinList.end(), sort_by_pin_number );
230 
231  // The minimal grid size allowed to place a pin is 25 mils
232  // the best grid size is 50 mils, but 25 mils is still usable
233  // this is because all symbols are using a 50 mils grid to place pins, and therefore
234  // the wires must be on the 50 mils grid
235  // So raise an error if a pin is not on a 25 (or bigger :50 or 100) mils grid
236  const int min_grid_size = Mils2iu( 25 );
237  const int grid_size = KiROUND( getView()->GetGAL()->GetGridSize().x );
238  const int clamped_grid_size = ( grid_size < min_grid_size ) ? min_grid_size : grid_size;
239 
240  std::vector<wxString> messages;
241  wxString msg;
242 
243  for( unsigned ii = 1; ii < pinList.size(); ii++ )
244  {
245  LIB_PIN* pin = pinList[ii - 1];
246  LIB_PIN* next = pinList[ii];
247 
248  if( pin->GetNumber() != next->GetNumber() || pin->GetConvert() != next->GetConvert() )
249  continue;
250 
251  wxString pinName;
252  wxString nextName;
253 
254  if( pin->GetName() != wxT( "~" ) && !pin->GetName().IsEmpty() )
255  pinName = wxT( " '" ) + pin->GetName() + wxT( "'" );
256 
257  if( next->GetName() != wxT( "~" ) && !next->GetName().IsEmpty() )
258  nextName = wxT( " '" ) + next->GetName() + wxT( "'" );
259 
260  if( symbol->HasConversion() && next->GetConvert() )
261  {
262  if( symbol->GetUnitCount() <= 1 )
263  {
264  msg.Printf( _( "<b>Duplicate pin %s</b> %s at location <b>(%.3f, %.3f)</b>"
265  " conflicts with pin %s%s at location <b>(%.3f, %.3f)</b>"
266  " of converted." ),
267  next->GetNumber(),
268  nextName,
269  MessageTextFromValue( units, next->GetPosition().x ),
270  MessageTextFromValue( units, -next->GetPosition().y ),
271  pin->GetNumber(),
272  pin->GetName(),
273  MessageTextFromValue( units, pin->GetPosition().x ),
274  MessageTextFromValue( units, -pin->GetPosition().y ) );
275  }
276  else
277  {
278  msg.Printf( _( "<b>Duplicate pin %s</b> %s at location <b>(%.3f, %.3f)</b>"
279  " conflicts with pin %s%s at location <b>(%.3f, %.3f)</b>"
280  " in units %c and %c of converted." ),
281  next->GetNumber(),
282  nextName,
283  MessageTextFromValue( units, next->GetPosition().x ),
284  MessageTextFromValue( units, -next->GetPosition().y ),
285  pin->GetNumber(),
286  pinName,
287  MessageTextFromValue( units, pin->GetPosition().x ),
288  MessageTextFromValue( units, -pin->GetPosition().y ),
289  'A' + next->GetUnit() - 1,
290  'A' + pin->GetUnit() - 1 );
291  }
292  }
293  else
294  {
295  if( symbol->GetUnitCount() <= 1 )
296  {
297  msg.Printf( _( "<b>Duplicate pin %s</b> %s at location <b>(%s, %s)</b>"
298  " conflicts with pin %s%s at location <b>(%s, %s)</b>." ),
299  next->GetNumber(),
300  nextName,
301  MessageTextFromValue( units, next->GetPosition().x ),
302  MessageTextFromValue( units, -next->GetPosition().y ),
303  pin->GetNumber(),
304  pinName,
305  MessageTextFromValue( units, pin->GetPosition().x ),
306  MessageTextFromValue( units, -pin->GetPosition().y ) );
307  }
308  else
309  {
310  msg.Printf( _( "<b>Duplicate pin %s</b> %s at location <b>(%s, %s)</b>"
311  " conflicts with pin %s%s at location <b>(%s, %s)</b>"
312  " in units %c and %c." ),
313  next->GetNumber(),
314  nextName,
315  MessageTextFromValue( units, next->GetPosition().x ),
316  MessageTextFromValue( units, -next->GetPosition().y ),
317  pin->GetNumber(),
318  pinName,
319  MessageTextFromValue( units, pin->GetPosition().x ),
320  MessageTextFromValue( units, -pin->GetPosition().y ),
321  'A' + next->GetUnit() - 1,
322  'A' + pin->GetUnit() - 1 );
323  }
324  }
325 
326  msg += wxT( "<br><br>" );
327  messages.push_back( msg );
328  }
329 
330  for( LIB_PIN* pin : pinList )
331  {
332  wxString pinName = pin->GetName();
333 
334  if( pinName.IsEmpty() || pinName == wxT( "~" ) )
335  pinName = wxEmptyString;
336  else
337  pinName = wxT( "'" ) + pinName + wxT( "'" );
338 
339  if( !symbol->IsPower()
340  && pin->GetType() == ELECTRICAL_PINTYPE::PT_POWER_IN
341  && !pin->IsVisible() )
342  {
343  // hidden power pin
344  if( symbol->HasConversion() && pin->GetConvert() )
345  {
346  if( symbol->GetUnitCount() <= 1 )
347  {
348  msg.Printf( _( "Info: <b>Hidden power pin %s</b> %s at location <b>(%s, %s)</b>"
349  " of converted." ),
350  pin->GetNumber(),
351  pinName,
352  MessageTextFromValue( units, pin->GetPosition().x ),
353  MessageTextFromValue( units, -pin->GetPosition().y ) );
354  }
355  else
356  {
357  msg.Printf( _( "Info: <b>Hidden power pin %s</b> %s at location <b>(%s, %s)</b>"
358  " in unit %c of converted." ),
359  pin->GetNumber(),
360  pinName,
361  MessageTextFromValue( units, pin->GetPosition().x ),
362  MessageTextFromValue( units, -pin->GetPosition().y ),
363  'A' + pin->GetUnit() - 1 );
364  }
365  }
366  else
367  {
368  if( symbol->GetUnitCount() <= 1 )
369  {
370  msg.Printf( _( "Info: <b>Hidden power pin %s</b> %s at location <b>(%s, %s)</b>." ),
371  pin->GetNumber(),
372  pinName,
373  MessageTextFromValue( units, pin->GetPosition().x ),
374  MessageTextFromValue( units, -pin->GetPosition().y ) );
375  }
376  else
377  {
378  msg.Printf( _( "Info: <b>Hidden power pin %s</b> %s at location <b>(%s, %s)</b>"
379  " in unit %c." ),
380  pin->GetNumber(),
381  pinName,
382  MessageTextFromValue( units, pin->GetPosition().x ),
383  MessageTextFromValue( units, -pin->GetPosition().y ),
384  'A' + pin->GetUnit() - 1 );
385  }
386  }
387 
388  msg += wxT( "<br>" );
389  msg += _( "(Hidden power pins will drive their pin names on to any connected nets.)" );
390  msg += wxT( "<br><br>" );
391  messages.push_back( msg );
392  }
393 
394  if( ( (pin->GetPosition().x % clamped_grid_size) != 0 )
395  || ( (pin->GetPosition().y % clamped_grid_size) != 0 ) )
396  {
397  // pin is off grid
398  if( symbol->HasConversion() && pin->GetConvert() )
399  {
400  if( symbol->GetUnitCount() <= 1 )
401  {
402  msg.Printf( _( "<b>Off grid pin %s</b> %s at location <b>(%s, %s)</b>"
403  " of converted." ),
404  pin->GetNumber(),
405  pinName,
406  MessageTextFromValue( units, pin->GetPosition().x ),
407  MessageTextFromValue( units, -pin->GetPosition().y ) );
408  }
409  else
410  {
411  msg.Printf( _( "<b>Off grid pin %s</b> %s at location <b>(%.3s, %.3s)</b>"
412  " in unit %c of converted." ),
413  pin->GetNumber(),
414  pinName,
415  MessageTextFromValue( units, pin->GetPosition().x ),
416  MessageTextFromValue( units, -pin->GetPosition().y ),
417  'A' + pin->GetUnit() - 1 );
418  }
419  }
420  else
421  {
422  if( symbol->GetUnitCount() <= 1 )
423  {
424  msg.Printf( _( "<b>Off grid pin %s</b> %s at location <b>(%s, %s)</b>." ),
425  pin->GetNumber(),
426  pinName,
427  MessageTextFromValue( units, pin->GetPosition().x ),
428  MessageTextFromValue( units, -pin->GetPosition().y ) );
429  }
430  else
431  {
432  msg.Printf( _( "<b>Off grid pin %s</b> %s at location <b>(%s, %s)</b>"
433  " in unit %c." ),
434  pin->GetNumber(),
435  pinName,
436  MessageTextFromValue( units, pin->GetPosition().x ),
437  MessageTextFromValue( units, -pin->GetPosition().y ),
438  'A' + pin->GetUnit() - 1 );
439  }
440  }
441 
442  msg += wxT( "<br><br>" );
443  messages.push_back( msg );
444  }
445  }
446 
447  if( messages.empty() )
448  {
449  DisplayInfoMessage( m_frame, _( "No symbol issues found." ) );
450  }
451  else
452  {
453  wxString outmsg;
454 
455  for( const wxString& single_msg : messages )
456  outmsg += single_msg;
457 
458  DIALOG_DISPLAY_HTML_TEXT error_display( m_frame, wxID_ANY, _( "Symbol Warnings" ),
459  wxDefaultPosition, wxSize( 700, 350 ) );
460 
461  error_display.SetPage( outmsg );
462  error_display.ShowModal();
463  }
464 
465  return 0;
466 }
467 
468 
470 {
471 #ifdef KICAD_SPICE
473 
474  if( !simFrame )
475  return -1;
476 
477  simFrame->Show( true );
478 
479  // On Windows, Raise() does not bring the window on screen, when iconized
480  if( simFrame->IsIconized() )
481  simFrame->Iconize( false );
482 
483  simFrame->Raise();
484 #endif /* KICAD_SPICE */
485  return 0;
486 }
487 
488 
490 {
491  wxString datasheet;
492 
494  {
495  LIB_SYMBOL* symbol = static_cast<SYMBOL_EDIT_FRAME*>( m_frame )->GetCurSymbol();
496 
497  if( !symbol )
498  return 0;
499 
500  datasheet = symbol->GetDatasheetField().GetText();
501  }
503  {
504  LIB_SYMBOL* entry = static_cast<SYMBOL_VIEWER_FRAME*>( m_frame )->GetSelectedSymbol();
505 
506  if( !entry )
507  return 0;
508 
509  datasheet = entry->GetDatasheetField().GetText();
510  }
511  else if( m_frame->IsType( FRAME_SCH ) )
512  {
514 
515  if( selection.Empty() )
516  return 0;
517 
518  SCH_SYMBOL* symbol = (SCH_SYMBOL*) selection.Front();
519 
520  // Use GetShownText() to resolve any text variables
522  }
523 
524  if( datasheet.IsEmpty() || datasheet == wxT( "~" ) )
525  {
526  m_frame->ShowInfoBarError( _( "No datasheet defined." ) );
527  }
528  else
529  {
530  GetAssociatedDocument( m_frame, datasheet, &m_frame->Prj(), m_frame->Prj().SchSearchS() );
531  }
532 
533  return 0;
534 }
535 
536 
538 {
540  EE_SELECTION& selection = selTool->GetSelection();
541 
542  if( selection.GetSize() == 1 )
543  {
544  EDA_ITEM* item = (EDA_ITEM*) selection.Front();
545 
546  std::vector<MSG_PANEL_ITEM> msgItems;
547  item->GetMsgPanelInfo( m_frame, msgItems );
548  m_frame->SetMsgPanel( msgItems );
549  }
550  else
551  {
553  }
554 
555  if( SCH_EDIT_FRAME* editFrame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame ) )
556  editFrame->UpdateNetHighlightStatus();
557 
558  return 0;
559 }
560 
561 
563 {
568 
571 
573 
578 }
579 
580 
void ExcludeMarker(SCH_MARKER *aMarker=nullptr)
Exclude aMarker from the ERC list.
Definition: dialog_erc.cpp:678
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:756
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:140
void Reset(RESET_REASON aReason) override
Bring the tool to a known, initial state.
Definition: ee_tool_base.h:86
static const TOOL_EVENT SelectedEvent
Definition: actions.h:200
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:705
Model changes (required full reload)
Definition: tool_base.h:80
static TOOL_ACTION runERC
Definition: ee_actions.h:141
static const TOOL_EVENT UnselectedEvent
Definition: actions.h:201
This file is part of the common library.
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 SetPage(const wxString &message)
void PrevMarker()
Definition: dialog_erc.cpp:660
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:393
Schematic editor (Eeschema) main window.
bool IsPower() const
Definition: lib_symbol.cpp:459
bool sort_by_pin_number(const LIB_PIN *ref, const LIB_PIN *tst)
bool GetAssociatedDocument(wxWindow *aParent, const wxString &aDocName, PROJECT *aProject, SEARCH_STACK *aPaths)
Open a document (file) with the suitable browser.
Definition: eda_doc.cpp:74
static TOOL_ACTION excludeMarker
Definition: actions.h:87
static TOOL_ACTION checkSymbol
Definition: ee_actions.h:156
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)
wxString GetShownText(int aDepth=0) const override
Return the string actually shown after processing of the base text.
Definition: sch_field.cpp:105
static const TOOL_EVENT SelectedItemsModified
Selected items were moved, this can be very high frequency on the canvas, use with care.
Definition: actions.h:205
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:215
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...
void ShowInfoBarError(const wxString &aErrorMsg, bool aShowCloseButton=false, WX_INFOBAR::MESSAGE_TYPE aType=WX_INFOBAR::MESSAGE_TYPE::GENERIC)
Show the WX_INFOBAR displayed on the top of the canvas with a message and an error icon on the left o...
bool HasConversion() const
Test if symbol has more than one body conversion type (DeMorgan).
int GetUnit() const
Definition: lib_item.h:266
Class DIALOG_DISPLAY_HTML_TEXT_BASE.
void SetExcluded(bool aExcluded)
Definition: marker_base.h:96
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...
DIALOG_DISPLAY_HTML_TEXT(wxWindow *aParent, wxWindowID aId, const wxString &aTitle, const wxPoint &aPos, const wxSize &aSize, long aStyle=0)
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:213
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)
bool SetPage(const wxString &aSource) override
Definition: html_window.cpp:38
#define _(s)
Subclass of SIM_PLOT_FRAME_BASE, which is generated by wxFormBuilder.
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:179
static const TOOL_EVENT ClearedEvent
Selected item had a property changed (except movement)
Definition: actions.h:202
virtual void ClearMsgPanel()
Clear all messages from the message panel.
int GetConvert() const
Definition: lib_item.h:269
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:98
Implementing SIM_PLOT_FRAME_BASE.
static TOOL_ACTION prevMarker
Definition: actions.h:85
int RunERC(const TOOL_EVENT &aEvent)
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
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.
static SELECTION_CONDITION SingleNonExcludedMarker
void NextMarker()
Definition: dialog_erc.cpp:669
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:99
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:307
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:154
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
EDA_ITEM * Front() const
Definition: selection.h:145
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:1570
int CheckSymbol(const TOOL_EVENT &aEvent)