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  auto singleMarkerCondition = SELECTION_CONDITIONS::OnlyType( SCH_MARKER_T )
75 
76  // Add inspection actions to the selection tool menu
77  //
79 
80  selToolMenu.AddItem( EE_ACTIONS::excludeMarker, singleMarkerCondition, 100 );
81 
84 
85  return true;
86 }
87 
88 
90 {
91  EE_TOOL_BASE::Reset( aReason );
92 
93  if( aReason == MODEL_RELOAD )
94  {
96  }
97 }
98 
99 
101 {
102  ShowERCDialog();
103  return 0;
104 }
105 
106 
108 {
109  if( m_frame->IsType( FRAME_SCH ) )
110  {
111  if( m_ercDialog )
112  {
113  // Needed at least on Windows. Raise() is not enough
114  m_ercDialog->Show( true );
115  // Bring it to the top if already open. Dual monitor users need this.
116  m_ercDialog->Raise();
117  }
118  else
119  {
120  // This is a modeless dialog, so new it rather than instantiating on stack.
121  m_ercDialog = new DIALOG_ERC( static_cast<SCH_EDIT_FRAME*>( m_frame ) );
122 
123  m_ercDialog->Show( true );
124  }
125  }
126 }
127 
128 
130 {
131  if( m_ercDialog )
132  m_ercDialog->Destroy();
133 
134  m_ercDialog = nullptr;
135 }
136 
137 
139 {
140  if( m_ercDialog )
141  {
142  m_ercDialog->Show( true );
143  m_ercDialog->Raise();
145  }
146  else
147  {
148  ShowERCDialog();
149  }
150 
151  return 0;
152 }
153 
154 
156 {
157  if( m_ercDialog )
158  {
159  m_ercDialog->Show( true );
160  m_ercDialog->Raise();
162  }
163  else
164  {
165  ShowERCDialog();
166  }
167 
168  return 0;
169 }
170 
171 
173 {
174  if( m_ercDialog )
175  {
176  // Let the ERC dialog handle it since it has more update hassles to worry about
178  }
179  else
180  {
182  EE_SELECTION& selection = selTool->GetSelection();
183 
184  if( selection.GetSize() == 1 && selection.Front()->Type() == SCH_MARKER_T )
185  {
186  SCH_MARKER* marker = static_cast<SCH_MARKER*>( selection.Front() );
187 
188  marker->SetExcluded( true );
189  m_frame->GetCanvas()->GetView()->Update( marker );
190  m_frame->GetCanvas()->Refresh();
191  m_frame->OnModify();
192  }
193  }
194 
195  return 0;
196 }
197 
198 
199 // helper function to sort pins by pin num
200 bool sort_by_pin_number( const LIB_PIN* ref, const LIB_PIN* tst )
201 {
202  // Use number as primary key
203  int test = ref->GetNumber().Cmp( tst->GetNumber() );
204 
205  // Use DeMorgan variant as secondary key
206  if( test == 0 )
207  test = ref->GetConvert() - tst->GetConvert();
208 
209  // Use unit as tertiary key
210  if( test == 0 )
211  test = ref->GetUnit() - tst->GetUnit();
212 
213  return test < 0;
214 }
215 
216 
218 {
219  LIB_SYMBOL* symbol = static_cast<SYMBOL_EDIT_FRAME*>( m_frame )->GetCurSymbol();
220  EDA_UNITS units = m_frame->GetUserUnits();
221 
222  if( !symbol )
223  return 0;
224 
225  LIB_PINS pinList;
226  symbol->GetPins( pinList );
227 
228  // Test for duplicates:
229  // Sort pins by pin num, so 2 duplicate pins
230  // (pins with the same number) will be consecutive in list
231  sort( pinList.begin(), pinList.end(), sort_by_pin_number );
232 
233  // The minimal grid size allowed to place a pin is 25 mils
234  // the best grid size is 50 mils, but 25 mils is still usable
235  // this is because all symbols are using a 50 mils grid to place pins, and therefore
236  // the wires must be on the 50 mils grid
237  // So raise an error if a pin is not on a 25 (or bigger :50 or 100) mils grid
238  const int min_grid_size = Mils2iu( 25 );
239  const int grid_size = KiROUND( getView()->GetGAL()->GetGridSize().x );
240  const int clamped_grid_size = ( grid_size < min_grid_size ) ? min_grid_size : grid_size;
241 
242  std::vector<wxString> messages;
243  wxString msg;
244 
245  for( unsigned ii = 1; ii < pinList.size(); ii++ )
246  {
247  LIB_PIN* pin = pinList[ii - 1];
248  LIB_PIN* next = pinList[ii];
249 
250  if( pin->GetNumber() != next->GetNumber() || pin->GetConvert() != next->GetConvert() )
251  continue;
252 
253  wxString pinName;
254  wxString nextName;
255 
256  if( pin->GetName() != "~" && !pin->GetName().IsEmpty() )
257  pinName = " '" + pin->GetName() + "'";
258 
259  if( next->GetName() != "~" && !next->GetName().IsEmpty() )
260  nextName = " '" + next->GetName() + "'";
261 
262  if( symbol->HasConversion() && next->GetConvert() )
263  {
264  if( symbol->GetUnitCount() <= 1 )
265  {
266  msg.Printf( _( "<b>Duplicate pin %s</b> %s at location <b>(%.3f, %.3f)</b>"
267  " conflicts with pin %s%s at location <b>(%.3f, %.3f)</b>"
268  " of converted." ),
269  next->GetNumber(),
270  nextName,
271  MessageTextFromValue( units, next->GetPosition().x ),
272  MessageTextFromValue( units, -next->GetPosition().y ),
273  pin->GetNumber(),
274  pin->GetName(),
275  MessageTextFromValue( units, pin->GetPosition().x ),
276  MessageTextFromValue( units, -pin->GetPosition().y ) );
277  }
278  else
279  {
280  msg.Printf( _( "<b>Duplicate pin %s</b> %s at location <b>(%.3f, %.3f)</b>"
281  " conflicts with pin %s%s at location <b>(%.3f, %.3f)</b>"
282  " in units %c and %c of converted." ),
283  next->GetNumber(),
284  nextName,
285  MessageTextFromValue( units, next->GetPosition().x ),
286  MessageTextFromValue( units, -next->GetPosition().y ),
287  pin->GetNumber(),
288  pinName,
289  MessageTextFromValue( units, pin->GetPosition().x ),
290  MessageTextFromValue( units, -pin->GetPosition().y ),
291  'A' + next->GetUnit() - 1,
292  'A' + pin->GetUnit() - 1 );
293  }
294  }
295  else
296  {
297  if( symbol->GetUnitCount() <= 1 )
298  {
299  msg.Printf( _( "<b>Duplicate pin %s</b> %s at location <b>(%s, %s)</b>"
300  " conflicts with pin %s%s at location <b>(%s, %s)</b>." ),
301  next->GetNumber(),
302  nextName,
303  MessageTextFromValue( units, next->GetPosition().x ),
304  MessageTextFromValue( units, -next->GetPosition().y ),
305  pin->GetNumber(),
306  pinName,
307  MessageTextFromValue( units, pin->GetPosition().x ),
308  MessageTextFromValue( units, -pin->GetPosition().y ) );
309  }
310  else
311  {
312  msg.Printf( _( "<b>Duplicate pin %s</b> %s at location <b>(%s, %s)</b>"
313  " conflicts with pin %s%s at location <b>(%s, %s)</b>"
314  " in units %c and %c." ),
315  next->GetNumber(),
316  nextName,
317  MessageTextFromValue( units, next->GetPosition().x ),
318  MessageTextFromValue( units, -next->GetPosition().y ),
319  pin->GetNumber(),
320  pinName,
321  MessageTextFromValue( units, pin->GetPosition().x ),
322  MessageTextFromValue( units, -pin->GetPosition().y ),
323  'A' + next->GetUnit() - 1,
324  'A' + pin->GetUnit() - 1 );
325  }
326  }
327 
328  msg += wxT( "<br><br>" );
329  messages.push_back( msg );
330  }
331 
332  for( LIB_PIN* pin : pinList )
333  {
334  wxString pinName = pin->GetName();
335 
336  if( pinName.IsEmpty() || pinName == "~" )
337  pinName = "";
338  else
339  pinName = "'" + pinName + "'";
340 
341  if( !symbol->IsPower()
342  && pin->GetType() == ELECTRICAL_PINTYPE::PT_POWER_IN
343  && !pin->IsVisible() )
344  {
345  // hidden power pin
346  if( symbol->HasConversion() && pin->GetConvert() )
347  {
348  if( symbol->GetUnitCount() <= 1 )
349  {
350  msg.Printf( _( "Info: <b>Hidden power pin %s</b> %s at location <b>(%s, %s)</b>"
351  " of converted." ),
352  pin->GetNumber(),
353  pinName,
354  MessageTextFromValue( units, pin->GetPosition().x ),
355  MessageTextFromValue( units, -pin->GetPosition().y ) );
356  }
357  else
358  {
359  msg.Printf( _( "Info: <b>Hidden power pin %s</b> %s at location <b>(%s, %s)</b>"
360  " in unit %c of converted." ),
361  pin->GetNumber(),
362  pinName,
363  MessageTextFromValue( units, pin->GetPosition().x ),
364  MessageTextFromValue( units, -pin->GetPosition().y ),
365  'A' + pin->GetUnit() - 1 );
366  }
367  }
368  else
369  {
370  if( symbol->GetUnitCount() <= 1 )
371  {
372  msg.Printf( _( "Info: <b>Hidden power pin %s</b> %s at location <b>(%s, %s)</b>." ),
373  pin->GetNumber(),
374  pinName,
375  MessageTextFromValue( units, pin->GetPosition().x ),
376  MessageTextFromValue( units, -pin->GetPosition().y ) );
377  }
378  else
379  {
380  msg.Printf( _( "Info: <b>Hidden power pin %s</b> %s at location <b>(%s, %s)</b>"
381  " in unit %c." ),
382  pin->GetNumber(),
383  pinName,
384  MessageTextFromValue( units, pin->GetPosition().x ),
385  MessageTextFromValue( units, -pin->GetPosition().y ),
386  'A' + pin->GetUnit() - 1 );
387  }
388  }
389 
390  msg += wxT( "<br>" );
391  msg += _( "(Hidden power pins will drive their pin names on to any connected nets.)" );
392  msg += wxT( "<br><br>" );
393  messages.push_back( msg );
394  }
395 
396  if( ( (pin->GetPosition().x % clamped_grid_size) != 0 )
397  || ( (pin->GetPosition().y % clamped_grid_size) != 0 ) )
398  {
399  // pin is off grid
400  if( symbol->HasConversion() && pin->GetConvert() )
401  {
402  if( symbol->GetUnitCount() <= 1 )
403  {
404  msg.Printf( _( "<b>Off grid pin %s</b> %s at location <b>(%s, %s)</b>"
405  " of converted." ),
406  pin->GetNumber(),
407  pinName,
408  MessageTextFromValue( units, pin->GetPosition().x ),
409  MessageTextFromValue( units, -pin->GetPosition().y ) );
410  }
411  else
412  {
413  msg.Printf( _( "<b>Off grid pin %s</b> %s at location <b>(%.3s, %.3s)</b>"
414  " in unit %c of converted." ),
415  pin->GetNumber(),
416  pinName,
417  MessageTextFromValue( units, pin->GetPosition().x ),
418  MessageTextFromValue( units, -pin->GetPosition().y ),
419  'A' + pin->GetUnit() - 1 );
420  }
421  }
422  else
423  {
424  if( symbol->GetUnitCount() <= 1 )
425  {
426  msg.Printf( _( "<b>Off grid pin %s</b> %s at location <b>(%s, %s)</b>." ),
427  pin->GetNumber(),
428  pinName,
429  MessageTextFromValue( units, pin->GetPosition().x ),
430  MessageTextFromValue( units, -pin->GetPosition().y ) );
431  }
432  else
433  {
434  msg.Printf( _( "<b>Off grid pin %s</b> %s at location <b>(%s, %s)</b>"
435  " in unit %c." ),
436  pin->GetNumber(),
437  pinName,
438  MessageTextFromValue( units, pin->GetPosition().x ),
439  MessageTextFromValue( units, -pin->GetPosition().y ),
440  'A' + pin->GetUnit() - 1 );
441  }
442  }
443 
444  msg += wxT( "<br><br>" );
445  messages.push_back( msg );
446  }
447  }
448 
449  if( messages.empty() )
450  {
451  DisplayInfoMessage( m_frame, _( "No symbol issues found." ) );
452  }
453  else
454  {
455  wxString outmsg;
456 
457  for( const wxString& single_msg : messages )
458  outmsg += single_msg;
459 
460  DIALOG_DISPLAY_HTML_TEXT error_display( m_frame, wxID_ANY, _( "Symbol Warnings" ),
461  wxDefaultPosition, wxSize( 700, 350 ) );
462 
463  error_display.SetPage( outmsg );
464  error_display.ShowModal();
465  }
466 
467  return 0;
468 }
469 
470 
472 {
473 #ifdef KICAD_SPICE
475 
476  if( !simFrame )
477  return -1;
478 
479  simFrame->Show( true );
480 
481  // On Windows, Raise() does not bring the window on screen, when iconized
482  if( simFrame->IsIconized() )
483  simFrame->Iconize( false );
484 
485  simFrame->Raise();
486 #endif /* KICAD_SPICE */
487  return 0;
488 }
489 
490 
492 {
493  wxString datasheet;
494 
496  {
497  LIB_SYMBOL* symbol = static_cast<SYMBOL_EDIT_FRAME*>( m_frame )->GetCurSymbol();
498 
499  if( !symbol )
500  return 0;
501 
502  datasheet = symbol->GetDatasheetField().GetText();
503  }
505  {
506  LIB_SYMBOL* entry = static_cast<SYMBOL_VIEWER_FRAME*>( m_frame )->GetSelectedSymbol();
507 
508  if( !entry )
509  return 0;
510 
511  datasheet = entry->GetDatasheetField().GetText();
512  }
513  else if( m_frame->IsType( FRAME_SCH ) )
514  {
516 
517  if( selection.Empty() )
518  return 0;
519 
520  SCH_SYMBOL* symbol = (SCH_SYMBOL*) selection.Front();
521 
522  datasheet = symbol->GetField( DATASHEET_FIELD )->GetText();
523  }
524 
525  if( datasheet.IsEmpty() || datasheet == wxT( "~" ) )
526  m_frame->ShowInfoBarError( _( "No datasheet defined." ) );
527  else
529 
530  return 0;
531 }
532 
533 
535 {
537  EE_SELECTION& selection = selTool->GetSelection();
538 
539  if( selection.GetSize() == 1 )
540  {
541  EDA_ITEM* item = (EDA_ITEM*) selection.Front();
542 
543  std::vector<MSG_PANEL_ITEM> msgItems;
544  item->GetMsgPanelInfo( m_frame, msgItems );
545  m_frame->SetMsgPanel( msgItems );
546  }
547  else
548  {
550  }
551 
552  if( SCH_EDIT_FRAME* editFrame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame ) )
553  editFrame->UpdateNetHighlightStatus();
554 
555  return 0;
556 }
557 
558 
560 {
565 
568 
570 
575 }
576 
577 
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:706
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:139
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:74
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:675
Model changes (required full reload)
Definition: tool_base.h:80
static TOOL_ACTION runERC
Definition: ee_actions.h:140
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 SetPage(const wxString &message)
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:383
Schematic editor (Eeschema) main window.
bool IsPower() const
Definition: lib_symbol.cpp:408
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:155
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:212
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:258
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...
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: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)
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: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:261
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
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
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:1512
int CheckSymbol(const TOOL_EVENT &aEvent)