KiCad PCB EDA Suite
dialog_exchange_footprints.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) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
6  * Copyright (C) 2013 Wayne Stambaugh <stambaughw@gmail.com>
7  * Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, you may find one here:
21  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22  * or you may search the http://www.gnu.org website for the version 2 license,
23  * or you may write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25  */
26 
27 #include <bitmaps.h>
28 #include <board_commit.h>
29 #include <board.h>
30 #include <footprint.h>
32 #include <kicad_string.h>
33 #include <kiway.h>
34 #include <pcb_edit_frame.h>
35 #include <pcbnew_settings.h>
36 #include <project.h>
37 #include <wx_html_report_panel.h>
38 
39 
40 #define ID_MATCH_FP_ALL 4200
41 #define ID_MATCH_FP_SELECTED 4201
42 #define ID_MATCH_FP_REF 4202
43 #define ID_MATCH_FP_VAL 4203
44 #define ID_MATCH_FP_ID 4204
45 
46 
51 
52  // { update, change }
53 bool g_removeExtraTextItems[2] = { false, false };
54 bool g_resetTextItemLayers[2] = { false, true };
55 bool g_resetTextItemEffects[2] = { false, true };
56 bool g_resetFabricationAttrs[2] = { false, true };
57 bool g_reset3DModels[2] = { true, true };
58 
59 
61  FOOTPRINT* aFootprint,
62  bool updateMode, bool selectedMode ) :
64  m_commit( aParent ),
65  m_parent( aParent ),
66  m_currentFootprint( aFootprint ),
67  m_updateMode( updateMode )
68 {
69  if( !updateMode )
70  {
71  SetTitle( _( "Change Footprints" ) );
72  m_matchAll->SetLabel( _( "Change all footprints on board" ) );
73  m_matchSelected->SetLabel( _( "Change selected footprint" ) );
74  m_matchSpecifiedRef->SetLabel( _( "Change footprints matching reference designator:" ) );
75  m_matchSpecifiedValue->SetLabel( _( "Change footprints matching value:" ) );
76  m_matchSpecifiedID->SetLabel( _( "Change footprints with library id:" ) );
77  m_resetTextItemLayers->SetLabel( _( "Update text layers and visibilities" ) );
78  m_resetTextItemEffects->SetLabel( _( "Update text sizes, styles and positions" ) );
79  m_resetFabricationAttrs->SetLabel( _( "Update fabrication attributes" ) );
80  m_reset3DModels->SetLabel( _( "Update 3D models" ) );
81  }
82 
83 #if 0 // translator hint
84  wxString x = _( "Update/reset strings: there are two cases these descriptions need to cover: "
85  "the user made overrides to a footprint on the PCB and wants to remove them, "
86  "or the user made changes to the library footprint and wants to propagate "
87  "them back to the PCB." );
88 #endif
89 
90  if( m_updateMode )
91  {
92  m_changeSizer->Show( false );
93  }
94  else
95  {
96  m_upperSizer->FindItem( m_matchAll )->Show( false );
98  }
99 
100  if( m_currentFootprint )
101  {
102  m_newID->AppendText( FROM_UTF8( m_currentFootprint->GetFPID().Format().c_str() ) );
103  }
104  else
105  m_upperSizer->FindItem( m_matchSelected )->Show( false );
106 
107  // Use ChangeValue() instead of SetValue() so we don't generate events.
108  if( m_currentFootprint )
110 
111  if( m_currentFootprint )
112  m_specifiedValue->ChangeValue( m_currentFootprint->GetValue() );
113 
114  if( m_currentFootprint )
115  m_specifiedID->ChangeValue( FROM_UTF8( m_currentFootprint->GetFPID().Format().c_str() ) );
116 
118 
119  m_upperSizer->SetEmptyCellSize( wxSize( 0, 0 ) );
120  // The upper sizer has its content modified: re-layout it:
121  m_upperSizer->Layout();
122 
123  // initialize match-mode
124  if( m_updateMode )
126  else
128 
129  wxCommandEvent event;
130  event.SetEventObject( this );
131 
132  switch( *m_matchMode )
133  {
134  case ID_MATCH_FP_ALL: OnMatchAllClicked( event ); break;
135  case ID_MATCH_FP_SELECTED: OnMatchSelectedClicked( event ); break;
136  case ID_MATCH_FP_REF: OnMatchRefClicked( event ); break;
137  case ID_MATCH_FP_VAL: OnMatchValueClicked( event ); break;
138  case ID_MATCH_FP_ID: OnMatchIDClicked( event ); break;
139  default: break;
140  }
141 
142  m_removeExtraBox->SetValue( g_removeExtraTextItems[ m_updateMode ? 0 : 1 ] );
146  m_reset3DModels->SetValue( g_reset3DModels[ m_updateMode ? 0 : 1 ] );
147 
149  m_MessageWindow->SetFileName( Prj().GetProjectPath() + wxT( "report.txt" ) );
150 
151  // DIALOG_SHIM needs a unique hash_key because classname is not sufficient
152  // because the update and change versions of this dialog have different controls.
153  m_hash_key = TO_UTF8( GetTitle() );
154 
155  // Ensure m_closeButton (with id = wxID_CANCEL) has the right label
156  // (to fix automatic renaming of button label )
157  m_sdbSizerCancel->SetLabel( _( "Close" ) );
158 
159  if( m_updateMode )
160  m_sdbSizerOK->SetLabel( _( "Update" ) );
161  else
162  m_sdbSizerOK->SetLabel( _( "Change" ) );
163 
164  m_sdbSizerOK->SetDefault();
165 
166  // Now all widgets have the size fixed, call FinishDialogSettings
168 }
169 
170 
172 {
173  g_removeExtraTextItems[ m_updateMode ? 0 : 1 ] = m_removeExtraBox->GetValue();
177  g_reset3DModels[ m_updateMode ? 0 : 1 ] = m_reset3DModels->GetValue();
178 }
179 
180 
182 {
183  LIB_ID specifiedID;
184 
185  switch( *m_matchMode )
186  {
187  case ID_MATCH_FP_ALL:
188  return true;
190  return aFootprint == m_currentFootprint;
191  case ID_MATCH_FP_REF:
192  return WildCompareString( m_specifiedRef->GetValue(), aFootprint->GetReference(), false );
193  case ID_MATCH_FP_VAL:
194  return WildCompareString( m_specifiedValue->GetValue(), aFootprint->GetValue(), false );
195  case ID_MATCH_FP_ID:
196  specifiedID.Parse( m_specifiedID->GetValue() );
197  return aFootprint->GetFPID() == specifiedID;
198  default:
199  return false; // just to quiet compiler warnings....
200  }
201 }
202 
203 
205 {
206  switch( *m_matchMode )
207  {
208  case ID_MATCH_FP_ALL: return m_matchAll;
212  case ID_MATCH_FP_ID: return m_matchSpecifiedID;
213  default: return nullptr;
214  }
215 }
216 
217 
219 {
220  wxRadioButton* rb_button = getRadioButtonForMode();
221 
222  wxRadioButton* rb_butt_list[] =
223  {
224  m_matchAll,
229  nullptr // end of list
230  };
231 
232  // Ensure the button state is ok. Only one button can be checked
233  // Change button state only if its state is incorrect, otherwise
234  // we have issues depending on the platform.
235  for( int ii = 0; rb_butt_list[ii]; ++ii )
236  {
237  bool state = rb_butt_list[ii] == rb_button;
238 
239  if( rb_butt_list[ii]->GetValue() != state )
240  rb_butt_list[ii]->SetValue( state );
241  }
242 }
243 
244 
246 {
248 
249  if( event.GetEventObject() == this )
251  else
252  m_matchAll->SetFocus();
253 }
254 
255 
257 {
259 
260  if( event.GetEventObject() == this )
262  else
263  m_matchSelected->SetFocus();
264 }
265 
266 
268 {
270 
271  if( event.GetEventObject() == this )
273  else if( event.GetEventObject() != m_specifiedRef )
274  m_specifiedRef->SetFocus();
275 }
276 
277 
279 {
281 
282  if( event.GetEventObject() == this )
284  else if( event.GetEventObject() != m_specifiedValue )
285  m_specifiedValue->SetFocus();
286 }
287 
288 
289 void DIALOG_EXCHANGE_FOOTPRINTS::OnMatchIDClicked( wxCommandEvent& event )
290 {
292 
293  if( event.GetEventObject() == this )
295  else if( event.GetEventObject() != m_specifiedID )
296  m_specifiedID->SetFocus();
297 }
298 
299 
300 void DIALOG_EXCHANGE_FOOTPRINTS::OnOKClicked( wxCommandEvent& event )
301 {
302  wxBusyCursor dummy;
303 
305  m_MessageWindow->Flush( false );
306 
308  {
309  m_parent->Compile_Ratsnest( true );
310  m_parent->GetCanvas()->Refresh();
311  }
312 
313  m_MessageWindow->Flush( false );
314 
315  m_commit.Push( wxT( "Changed footprint" ) );
316 }
317 
318 
320 {
321  bool change = false;
322  LIB_ID newFPID;
323  wxString value;
324 
325  if( m_parent->GetBoard()->Footprints().empty() )
326  return false;
327 
328  if( !m_updateMode )
329  {
330  newFPID.Parse( m_newID->GetValue() );
331 
332  if( !newFPID.IsValid() )
333  return false;
334  }
335 
336  /* The change is done from the last footprint because processFootprint() modifies the last
337  * item in the list.
338  */
339  for( auto it = m_parent->GetBoard()->Footprints().rbegin();
340  it != m_parent->GetBoard()->Footprints().rend(); it++ )
341  {
342  auto mod = *it;
343 
344  if( !isMatch( mod ) )
345  continue;
346 
347  if( m_updateMode )
348  {
349  if( processFootprint( mod, mod->GetFPID() ) )
350  change = true;
351  }
352  else
353  {
354  if( processFootprint( mod, newFPID ) )
355  change = true;
356  }
357  }
358 
359  return change;
360 }
361 
362 
364 {
365  LIB_ID oldFPID = aFootprint->GetFPID();
366  wxString msg;
367 
368  // Load new footprint.
369  if( m_updateMode )
370  {
371  msg.Printf( _( "Update footprint %s from '%s' to '%s'" ),
372  aFootprint->GetReference(),
373  oldFPID.Format().c_str(),
374  aNewFPID.Format().c_str() );
375  }
376  else
377  {
378  msg.Printf( _( "Change footprint %s from '%s' to '%s'" ),
379  aFootprint->GetReference(),
380  oldFPID.Format().c_str(),
381  aNewFPID.Format().c_str() );
382  }
383 
384  FOOTPRINT* newFootprint = m_parent->LoadFootprint( aNewFPID );
385 
386  if( !newFootprint )
387  {
388  msg << ": " << _( "*** footprint not found ***" );
390  return false;
391  }
392 
393  m_parent->ExchangeFootprint( aFootprint, newFootprint, m_commit,
394  m_removeExtraBox->GetValue(),
395  m_resetTextItemLayers->GetValue(),
396  m_resetTextItemEffects->GetValue(),
397  m_resetFabricationAttrs->GetValue(),
398  m_reset3DModels->GetValue() );
399 
400  if( aFootprint == m_currentFootprint )
401  m_currentFootprint = newFootprint;
402 
403  msg += ": OK";
405 
406  return true;
407 }
408 
409 
410 void processTextItem( const FP_TEXT& aSrc, FP_TEXT& aDest,
411  bool resetText, bool resetTextLayers, bool resetTextEffects )
412 {
413  if( !resetText )
414  aDest.SetText( aSrc.GetText() );
415 
416  if( !resetTextLayers )
417  {
418  aDest.SetLayer( aSrc.GetLayer() );
419  aDest.SetVisible( aSrc.IsVisible() );
420  }
421 
422  if( !resetTextEffects )
423  {
424  // Careful: the visible bit is also in Effects
425  bool visible = aDest.IsVisible();
426  aDest.SetEffects( aSrc );
427  aDest.SetVisible( visible );
428  }
429 }
430 
431 
432 FP_TEXT* getMatchingTextItem( FP_TEXT* aRefItem, FOOTPRINT* aFootprint )
433 {
434  std::vector<FP_TEXT*> candidates;
435 
436  for( BOARD_ITEM* item : aFootprint->GraphicalItems() )
437  {
438  FP_TEXT* candidate = dyn_cast<FP_TEXT*>( item );
439 
440  if( candidate && candidate->GetText() == aRefItem->GetText() )
441  candidates.push_back( candidate );
442  }
443 
444  if( candidates.size() == 0 )
445  return nullptr;
446 
447  if( candidates.size() == 1 )
448  return candidates[0];
449 
450  // Try refining the match by layer
451  std::vector<FP_TEXT*> candidatesOnSameLayer;
452 
453  for( FP_TEXT* candidate : candidates )
454  {
455  if( candidate->GetLayer() == aRefItem->GetLayer() )
456  candidatesOnSameLayer.push_back( candidate );
457  }
458 
459  if( candidatesOnSameLayer.size() == 1 )
460  return candidatesOnSameLayer[0];
461 
462  // Last ditch effort: refine by position
463  std::vector<FP_TEXT*> candidatesAtSamePos;
464 
465  for( FP_TEXT* candidate : candidatesOnSameLayer.size() ? candidatesOnSameLayer : candidates )
466  {
467  if( candidate->GetPos0() == aRefItem->GetPos0() )
468  candidatesAtSamePos.push_back( candidate );
469  }
470 
471  if( candidatesAtSamePos.size() > 0 )
472  return candidatesAtSamePos[0];
473  else if( candidatesOnSameLayer.size() > 0 )
474  return candidatesOnSameLayer[0];
475  else
476  return candidates[0];
477 }
478 
479 
481  BOARD_COMMIT& aCommit, bool deleteExtraTexts,
482  bool resetTextLayers, bool resetTextEffects,
483  bool resetFabricationAttrs, bool reset3DModels )
484 {
485  PCB_GROUP* parentGroup = aExisting->GetParentGroup();
486 
487  if( parentGroup )
488  {
489  parentGroup->RemoveItem( aExisting );
490  parentGroup->AddItem( aNew );
491  }
492 
493  aNew->SetParent( GetBoard() );
494 
495  PlaceFootprint( aNew, false );
496 
497  // PlaceFootprint will move the footprint to the cursor position, which we don't want. Copy
498  // the original position across.
499  aNew->SetPosition( aExisting->GetPosition() );
500 
501  if( aNew->GetLayer() != aExisting->GetLayer() )
502  aNew->Flip( aNew->GetPosition(), m_settings->m_FlipLeftRight );
503 
504  if( aNew->GetOrientation() != aExisting->GetOrientation() )
505  aNew->SetOrientation( aExisting->GetOrientation() );
506 
507  aNew->SetLocked( aExisting->IsLocked() );
508 
509  for( PAD* pad : aNew->Pads() )
510  {
511  PAD* oldPad = aExisting->FindPadByName( pad->GetName() );
512 
513  if( oldPad )
514  {
516  pad->SetPinFunction( oldPad->GetPinFunction() );
517  }
518 
519  pad->SetNetCode( oldPad ? oldPad->GetNetCode() : NETINFO_LIST::UNCONNECTED );
520  }
521 
522  // Copy reference
523  processTextItem( aExisting->Reference(), aNew->Reference(),
524  // never reset reference text
525  false,
526  resetTextLayers, resetTextEffects );
527 
528  // Copy value
529  processTextItem( aExisting->Value(), aNew->Value(),
530  // reset value text only when it is a proxy for the footprint ID
531  // (cf replacing value "MountingHole-2.5mm" with "MountingHole-4.0mm")
532  aExisting->GetValue() == aExisting->GetFPID().GetLibItemName(),
533  resetTextLayers, resetTextEffects );
534 
535  // Copy fields in accordance with the reset* flags
536  for( BOARD_ITEM* item : aExisting->GraphicalItems() )
537  {
538  FP_TEXT* srcItem = dyn_cast<FP_TEXT*>( item );
539 
540  if( srcItem )
541  {
542  FP_TEXT* destItem = getMatchingTextItem( srcItem, aNew );
543 
544  if( destItem )
545  processTextItem( *srcItem, *destItem, false, resetTextLayers, resetTextEffects );
546  else if( !deleteExtraTexts )
547  aNew->Add( new FP_TEXT( *srcItem ) );
548  }
549  }
550 
551  if( !resetFabricationAttrs )
552  aNew->SetAttributes( aExisting->GetAttributes() );
553 
554  // Copy 3D model settings in accordance with the reset* flag
555  if( !reset3DModels )
556  aNew->Models() = aExisting->Models(); // Linked list of 3D models.
557 
558  // Updating other parameters
559  const_cast<KIID&>( aNew->m_Uuid ) = aExisting->m_Uuid;
560  aNew->SetProperties( aExisting->GetProperties() );
561  aNew->SetPath( aExisting->GetPath() );
562 
563  aCommit.Remove( aExisting );
564  aCommit.Add( aNew );
565 
566  aNew->ClearFlags();
567 }
568 
569 
571 {
572  wxString newname = m_newID->GetValue();
573 
575 
576  if( frame->ShowModal( &newname, this ) )
577  {
578  if( event.GetEventObject() == m_newIDBrowseButton )
579  m_newID->SetValue( newname );
580  else
581  m_specifiedID->SetValue( newname );
582  }
583 
584  frame->Destroy();
585 }
586 
587 
virtual bool ShowModal(wxString *aResult=nullptr, wxWindow *aResultantFocusWindow=nullptr)
Show this wxFrame as if it were a modal dialog, with all other instantiated wxFrames disabled until t...
DIALOG_EXCHANGE_FOOTPRINTS(PCB_EDIT_FRAME *aParent, FOOTPRINT *aFootprint, bool updateMode, bool selectedMode)
PCB_GROUP * GetParentGroup() const
Definition: board_item.h:93
bool IsLocked() const override
Definition: footprint.h:279
bool AddItem(BOARD_ITEM *aItem)
Add item to group.
Definition: pcb_group.cpp:38
void SetLazyUpdate(bool aLazyUpdate)
Forces updating the HTML page, after the report is built in lazy mode If aSort = true,...
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
Definition: kiway_player.h:61
const UTF8 & GetLibItemName() const
Definition: lib_id.h:106
void OnMatchIDClicked(wxCommandEvent &event) override
bool processFootprint(FOOTPRINT *aFootprint, const LIB_ID &aNewFPID)
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
Definition: kiway_holder.h:56
std::list< FP_3DMODEL > & Models()
Definition: footprint.h:178
static wxString FROM_UTF8(const char *cstring)
Convert a UTF8 encoded C string to a wxString for all wxWidgets build modes.
Definition: macros.h:110
const wxString & GetValue() const
Definition: footprint.h:445
const KIID_PATH & GetPath() const
Definition: footprint.h:199
void Compile_Ratsnest(bool aDisplayStatus)
Create the entire board ratsnest.
Definition: ratsnest.cpp:41
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
Definition: board_item.h:194
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:82
void SetPath(const KIID_PATH &aPath)
Definition: footprint.h:200
std::string m_hash_key
Definition: dialog_shim.h:200
COMMIT & Add(EDA_ITEM *aItem)
Notify observers that aItem has been added.
Definition: commit.h:78
A set of BOARD_ITEMs (i.e., without duplicates).
Definition: pcb_group.h:50
bool IsVisible() const
Definition: eda_text.h:193
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
void Flush(bool aSort=false)
Set the visible severity filter.
void SetVisible(bool aVisible)
Definition: eda_text.h:192
double GetOrientation() const
Definition: footprint.h:186
bool GetLocalRatsnestVisible() const
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.
Definition: sch_symbol.cpp:69
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:345
void SetLocalRatsnestVisible(bool aVisible)
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
bool IsValid() const
Check if this LID_ID is valid.
Definition: lib_id.h:168
PCBNEW_SETTINGS * m_settings
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
Definition: dialog_shim.h:98
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:165
void SetAttributes(int aAttributes)
Definition: footprint.h:232
void PlaceFootprint(FOOTPRINT *aFootprint, bool aRecreateRatsnest=true)
Places aFootprint at the current cursor position and updates footprint coordinates with the new posit...
PADS & Pads()
Definition: footprint.h:164
FP_TEXT & Value()
read/write accessors:
Definition: footprint.h:459
const char * c_str() const
Definition: utf8.h:102
int g_matchModeForUpdateSelected
FP_TEXT & Reference()
Definition: footprint.h:460
void OnMatchAllClicked(wxCommandEvent &event) override
bool g_resetTextItemEffects[2]
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Definition: macros.h:96
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:82
void ExchangeFootprint(FOOTPRINT *aExisting, FOOTPRINT *aNew, BOARD_COMMIT &aCommit, bool deleteExtraTexts=true, bool resetTextLayers=true, bool resetTextEffects=true, bool resetFabricationAttrs=true, bool reset3DModels=true)
Replace aExisting footprint by aNew footprint using the Existing footprint settings (position,...
#define ID_MATCH_FP_ID
virtual void SetText(const wxString &aText)
Definition: eda_text.cpp:121
Class DIALOG_EXCHANGE_FOOTPRINTS_BASE.
#define ID_MATCH_FP_ALL
FP_TEXT * getMatchingTextItem(FP_TEXT *aRefItem, FOOTPRINT *aFootprint)
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
bool WildCompareString(const wxString &pattern, const wxString &string_to_tst, bool case_sensitive)
Compare a string against wild card (* and ?) pattern using the usual rules.
Definition: string.cpp:499
void SetOrientation(double aNewAngle)
Definition: footprint.cpp:1549
FOOTPRINTS & Footprints()
Definition: board.h:303
bool g_resetFabricationAttrs[2]
void OnMatchSelectedClicked(wxCommandEvent &event) override
void Flip(const wxPoint &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
Definition: footprint.cpp:1366
const wxString & GetReference() const
Definition: footprint.h:423
bool g_reset3DModels[2]
DRAWINGS & GraphicalItems()
Definition: footprint.h:167
FOOTPRINT * LoadFootprint(const LIB_ID &aFootprintId)
Attempt to load aFootprintId from the footprint library table.
bool RemoveItem(BOARD_ITEM *aItem)
Remove item from group.
Definition: pcb_group.cpp:50
bool g_removeExtraTextItems[2]
#define ID_MATCH_FP_SELECTED
const LIB_ID & GetFPID() const
Definition: footprint.h:190
COMMIT & Remove(EDA_ITEM *aItem)
Notify observers that aItem has been removed.
Definition: commit.h:90
PAD * FindPadByName(const wxString &aPadName) const
Return a PAD with a matching name.
Definition: footprint.cpp:956
const BITMAP_OPAQUE small_library_xpm[1]
#define ID_MATCH_FP_REF
int g_matchModeForExchangeSelected
UTF8 Format() const
Definition: lib_id.cpp:233
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
void Report(const wxString &aText, SEVERITY aSeverity, REPORTER::LOCATION aLocation=REPORTER::LOC_BODY)
Reports the string.
void SetEffects(const FP_TEXT &aSrc)
Set the text effects from another instance.
Definition: fp_text.h:146
void processTextItem(const FP_TEXT &aSrc, FP_TEXT &aDest, bool resetText, bool resetTextLayers, bool resetTextEffects)
const KIID m_Uuid
Definition: eda_item.h:524
void updateMatchModeRadioButtons(wxUpdateUIEvent &event) override
const wxPoint & GetPos0() const
Definition: fp_text.h:166
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
int Parse(const UTF8 &aId, bool aFix=false)
Parse LIB_ID with the information from aId.
Definition: lib_id.cpp:122
bool g_resetTextItemLayers[2]
int GetAttributes() const
Definition: footprint.h:231
void Clear()
return the number of messages matching the given severity mask.
#define _(s)
Definition: 3d_actions.cpp:33
void OnMatchRefClicked(wxCommandEvent &event) override
#define ID_MATCH_FP_VAL
void SetLocked(bool isLocked) override
Set the #MODULE_is_LOCKED bit in the m_ModuleStatus.
Definition: footprint.h:289
The main frame for Pcbnew.
virtual void Push(const wxString &aMessage=wxT("A commit"), bool aCreateUndoEntry=true, bool aSetDirtyBit=true) override
Revert the commit by restoring the modified items state.
wxPoint GetPosition() const override
Definition: footprint.h:182
bool Destroy() override
Our version of Destroy() which is virtual from wxWidgets.
void ViewAndSelectFootprint(wxCommandEvent &event) override
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: eda_item.h:203
const std::map< wxString, wxString > & GetProperties() const
Definition: footprint.h:466
BOARD * GetBoard() const
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT) override
Removes an item from the container.
Definition: footprint.cpp:467
void SetProperties(const std::map< wxString, wxString > &aProps)
Definition: footprint.h:467
Definition: pad.h:60
void SetFileName(const wxString &aReportFileName)
void SetPosition(const wxPoint &aPos) override
Definition: footprint.cpp:1437
int g_matchModeForExchange
void OnMatchValueClicked(wxCommandEvent &event) override
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:173
static const int UNCONNECTED
Constant that forces initialization of a netinfo item to the NETINFO_ITEM ORPHANED (typically -1) whe...
Definition: netinfo.h:365
const wxString & GetPinFunction() const
Definition: pad.h:139
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:133
void OnOKClicked(wxCommandEvent &event) override
int g_matchModeForUpdate