KiCad PCB EDA Suite
dialog_edit_module_for_BoardEditor.cpp
Go to the documentation of this file.
1 
5 /*
6  * This program source code file is part of KiCad, a free EDA CAD application.
7  *
8  * Copyright (C) 2016 Mario Luzeiro <mrluzeiro@ua.pt>
9  * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
10  * Copyright (C) 2015 Dick Hollenbeck, dick@softplc.com
11  * Copyright (C) 2004-2017 KiCad Developers, see AUTHORS.txt for contributors.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, you may find one here:
25  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
26  * or you may search the http://www.gnu.org website for the version 2 license,
27  * or you may write to the Free Software Foundation, Inc.,
28  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
29  */
30 
31 
32 #include <fctsys.h>
33 #include <kiface_i.h>
34 #include <gr_basic.h>
35 #include <class_drawpanel.h>
36 #include <confirm.h>
37 #include <pcbnew.h>
38 #include <pgm_base.h>
39 #include <gestfich.h>
40 #include <3d_viewer.h>
41 #include <wxPcbStruct.h>
42 #include <base_units.h>
43 #include <project.h>
44 #include <board_commit.h>
45 #include <bitmaps.h>
46 
47 #include <class_module.h>
48 #include <class_text_mod.h>
49 #include <validators.h>
50 
55 #include "3d_cache/3d_cache.h"
57 
58 size_t DIALOG_MODULE_BOARD_EDITOR::m_page = 0; // remember the last open page during session
59 
60 
62  MODULE* aModule,
63  wxDC* aDC ) :
65  m_OrientValidator( 1, &m_OrientValue )
66 {
67  wxASSERT( aParent != NULL );
68  wxASSERT( aModule != NULL );
69 
70  m_Parent = aParent;
71  m_DC = aDC;
72  m_CurrentModule = aModule;
73 
74  m_currentModuleCopy = new MODULE( *aModule );
75 
76  // Give an icon
77  wxIcon icon;
78  icon.CopyFromBitmap( KiBitmap( icon_modedit_xpm ) );
79  SetIcon( icon );
80 
81  m_OrientValidator.SetRange( -360.0, 360.0 );
82  m_OrientValueCtrl->SetValidator( m_OrientValidator );
84 
85  aParent->Prj().Get3DCacheManager()->GetResolver()->SetProgramBase( &Pgm() );
86 
88  aParent->Prj().Get3DCacheManager(),
90  &m_shapes3D_list );
91 
92  bLowerSizer3D->Add( m_PreviewPane, 1, wxEXPAND, 5 );
93 
94  m_NoteBook->SetSelection( m_page );
95  m_sdbSizerStdButtonsOK->SetDefault();
96 
97  m_ReferenceCopy = NULL;
98  m_ValueCopy = NULL;
100  m_OrientValue = 0;
101 
102  // Layout() gets called correctly in TransferDataToWindow().
103 }
104 
105 
106 
108 {
109  m_shapes3D_list.clear();
110 
111  // free the memory used by all models, otherwise models which were
112  // browsed but not used would consume memory
113  Prj().Get3DCacheManager()->FlushCache( false );
114 
115  // the GL canvas has to be visible before it is destroyed
116  m_page = m_NoteBook->GetSelection();
117  m_NoteBook->SetSelection( 1 );
118 
119  delete m_ReferenceCopy;
120  m_ReferenceCopy = NULL;
121 
122  delete m_ValueCopy;
123  m_ValueCopy = NULL;
124 
125  delete m_PreviewPane;
126  m_PreviewPane = NULL; // just in case, to avoid double-free
127 
128  // this is already deleted by the board used on preview pane so
129  // no need to delete here
130  // delete m_currentModuleCopy;
131  // m_currentModuleCopy = NULL;
132 }
133 
134 
135 // Creation of the panel properties of the module editor.
137 {
140 
143 
144  m_LayerCtrl->SetSelection(
145  (m_CurrentModule->GetLayer() == B_Cu) ? 1 : 0 );
146 
147  bool custom_orientation = false;
148  switch( int( m_CurrentModule->GetOrientation() ) )
149  {
150  case 0:
151  m_OrientCtrl->SetSelection( 0 );
152  break;
153 
154  case 900:
155  case -2700:
156  m_OrientCtrl->SetSelection( 1 );
157  break;
158 
159  case -900:
160  case 2700:
161  m_OrientCtrl->SetSelection( 2 );
162  break;
163 
164  case -1800:
165  case 1800:
166  m_OrientCtrl->SetSelection( 3 );
167  break;
168 
169  default:
170  m_OrientCtrl->SetSelection( 4 );
171  custom_orientation = true;
172  break;
173  }
174 
175  m_OrientValueCtrl->Enable( custom_orientation );
177  m_OrientValidator.TransferToWindow();
178 
179  // Initialize dialog relative to masks clearances
183 
186 
187  // These 2 parameters are usually < 0, so prepare entering a negative
188  // value, if current is 0
190 
192  m_SolderPasteMarginCtrl->SetValue( wxT( "-" ) +
193  m_SolderPasteMarginCtrl->GetValue() );
194 
195  // Add solder paste margin ration in per cent
196  // for the usual default value 0.0, display -0.0 (or -0,0 in some countries)
197  wxString msg;
198  msg.Printf( wxT( "%f" ),
200 
202  msg[0] == '0') // Sometimes Printf adds a sign if the value is very small (0.0)
203  m_SolderPasteMarginRatioCtrl->SetValue( wxT("-") + msg );
204  else
205  m_SolderPasteMarginRatioCtrl->SetValue( msg );
206 
208  {
209  default:
211  m_ZoneConnectionChoice->SetSelection( 0 );
212  break;
213 
214  case PAD_ZONE_CONN_FULL:
215  m_ZoneConnectionChoice->SetSelection( 1 );
216  break;
217 
219  m_ZoneConnectionChoice->SetSelection( 2 );
220  break;
221 
222  case PAD_ZONE_CONN_NONE:
223  m_ZoneConnectionChoice->SetSelection( 3 );
224  break;
225  }
226 }
227 
228 
229 void DIALOG_MODULE_BOARD_EDITOR::GotoModuleEditor( wxCommandEvent& event )
230 {
231  if( m_CurrentModule->GetTimeStamp() == 0 ) // Module Editor needs a non null timestamp
232  {
234  m_Parent->OnModify();
235  }
236 
237  EndModal( PRM_EDITOR_WANT_MODEDIT );
238 }
239 
240 
241 void DIALOG_MODULE_BOARD_EDITOR::ExchangeModule( wxCommandEvent& event )
242 {
243  EndModal( PRM_EDITOR_WANT_EXCHANGE_FP );
244 }
245 
246 
248 {
249  bool custom_orientation = false;
250 
251  switch( m_OrientCtrl->GetSelection() )
252  {
253  case 0:
254  m_OrientValue = 0.0;
255  break;
256 
257  case 1:
258  m_OrientValue = 90.0;
259  break;
260 
261  case 2:
262  m_OrientValue = 270.0;
263  break;
264 
265  case 3:
266  m_OrientValue = 180.0;
267  break;
268 
269  default:
270  custom_orientation = true;
271  break;
272  }
273 
274  m_OrientValidator.TransferToWindow();
275  m_OrientValueCtrl->Enable( custom_orientation );
276 }
277 
278 
280 {
281  wxString default_path;
282  wxGetEnv( KISYS3DMOD, &default_path );
283 #ifdef __WINDOWS__
284  default_path.Replace( wxT( "/" ), wxT( "\\" ) );
285 #endif
286 
288 
289  // Init 3D shape list
290  m_3D_ShapeNameListBox->Clear();
291  std::list<S3D_INFO>::iterator sM = m_CurrentModule->Models().begin();
292  std::list<S3D_INFO>::iterator eM = m_CurrentModule->Models().end();
293  m_shapes3D_list.clear();
294 
295  wxString origPath;
296  wxString alias;
297  wxString shortPath;
298  S3D_FILENAME_RESOLVER* res = Prj().Get3DCacheManager()->GetResolver();
299 
300  while( sM != eM )
301  {
302  m_shapes3D_list.push_back( *sM );
303  origPath = sM->m_Filename;
304 
305  if( res && res->SplitAlias( origPath, alias, shortPath ) )
306  {
307  origPath = alias;
308  origPath.append( ":" );
309  origPath.append( shortPath );
310  }
311 
312  m_3D_ShapeNameListBox->Append( origPath );
313  ++sM;
314 
315  }
316 
321  m_ReferenceCtrl->SetValue( m_ReferenceCopy->GetText() );
322  m_ValueCtrl->SetValue( m_ValueCopy->GetText() );
323 
324  // Shows the footprint's schematic path.
326 
327  m_AttributsCtrl->SetItemToolTip( 0,
328  _( "Use this attribute for most non SMD components\n"
329  "Components with this option are not put in the footprint position list file" ) );
330  m_AttributsCtrl->SetItemToolTip( 1,
331  _( "Use this attribute for SMD components.\n"
332  "Only components with this option are put in the footprint position list file" ) );
333  m_AttributsCtrl->SetItemToolTip( 2,
334  _( "Use this attribute for \"virtual\" components drawn on board\n"
335  "like an edge connector (old ISA PC bus for instance)" ) );
336 
337  // Controls on right side of the dialog
338  switch( m_CurrentModule->GetAttributes() & 255 )
339  {
340  case 0:
341  m_AttributsCtrl->SetSelection( 0 );
342  break;
343 
344  case MOD_CMS:
345  m_AttributsCtrl->SetSelection( 1 );
346  break;
347 
348  case MOD_VIRTUAL:
349  m_AttributsCtrl->SetSelection( 2 );
350  break;
351 
352  default:
353  m_AttributsCtrl->SetSelection( 0 );
354  break;
355  }
356 
357  if( m_CurrentModule->IsLocked() )
358  m_AutoPlaceCtrl->SetSelection( 2 );
359  else if( m_CurrentModule->PadsLocked() )
360  m_AutoPlaceCtrl->SetSelection( 1 );
361  else
362  m_AutoPlaceCtrl->SetSelection( 0 );
363 
364  m_AutoPlaceCtrl->SetItemToolTip( 0,
365  _( "Component can be freely moved and auto placed. User "
366  "can arbitrarily select and edit component's pads." ) );
367  m_AutoPlaceCtrl->SetItemToolTip( 1,
368  _( "Component can be freely moved and auto placed, but its "
369  "pads cannot be selected or edited." ) );
370  m_AutoPlaceCtrl->SetItemToolTip( 2,
371  _( "Component is locked: it cannot be freely moved or auto "
372  "placed." ) );
373 
375 
377 
378  // if m_3D_ShapeNameListBox is not empty, preselect first 3D shape
379  if( m_3D_ShapeNameListBox->GetCount() > 0 )
380  {
383 
384  if( m_PreviewPane )
386  }
387  else
388  {
389  if( m_PreviewPane )
390  m_PreviewPane->ResetModelData( true );
391  }
392 
393  // We have modified the UI, so call Fit() for m_Panel3D
394  // to be sure the m_Panel3D sizers are initiliazed before opening the dialog
395  m_Panel3D->GetSizer()->Fit( m_Panel3D );
396 
397  // For some reason, on Linux, after the call to
398  // m_PreviewPane->SetModelDataIdx( m_LastSelected3DShapeIndex, true )
399  // the dialog has no longer the focus. Force it:
400  m_sdbSizerStdButtonsOK->SetFocus();
401 }
402 
403 
405 {
407 
408  if( m_LastSelected3DShapeIndex < 0 ) // happens under wxGTK when
409  // deleting an item in
410  // m_3D_ShapeNameListBox wxListBox
411  {
412  if( m_PreviewPane )
414 
415  return;
416  }
417 
418  if( m_LastSelected3DShapeIndex >= (int) m_shapes3D_list.size() )
419  {
420  wxMessageBox( wxT( "On3DShapeNameSelected() error" ) );
422 
423  if( m_PreviewPane )
425 
426  return;
427  }
428 
429  if( m_PreviewPane )
431 }
432 
433 
434 
435 void DIALOG_MODULE_BOARD_EDITOR::Remove3DShape( wxCommandEvent& event )
436 {
437  int ii = m_3D_ShapeNameListBox->GetSelection();
438 
439  if( ii < 0 )
440  {
441  if( m_PreviewPane )
442  m_PreviewPane->ResetModelData( true );
443 
444  return;
445  }
446 
447  m_shapes3D_list.erase( m_shapes3D_list.begin() + ii );
448  m_3D_ShapeNameListBox->Delete( ii );
449 
450  if( m_3D_ShapeNameListBox->GetCount() > 0 )
451  {
452  if( ii > 0 )
454  else
456 
458 
459  if( m_PreviewPane )
461  }
462  else
463  {
464  if( m_PreviewPane )
465  m_PreviewPane->ResetModelData( true );
466  }
467 
468  return;
469 }
470 
471 
473 {
474  int idx = m_3D_ShapeNameListBox->GetSelection();
475 
476  if( idx < 0 )
477  return;
478 
479  // Edit filename
480  wxString filename = m_3D_ShapeNameListBox->GetStringSelection();
481  wxTextEntryDialog dlg( this, wxEmptyString, wxEmptyString, filename );
482 
483  bool hasAlias;
484  S3D_FILENAME_RESOLVER* res = Prj().Get3DCacheManager()->GetResolver();
485 
486  if( dlg.ShowModal() != wxID_OK )
487  return;
488 
489  filename = dlg.GetValue();
490 
491  if( filename.empty() )
492  return;
493 
494  if( !res->ValidateFileName( filename, hasAlias ) )
495  {
496  wxString msg = _( "Invalid filename: " );
497  msg.append( filename );
498  wxMessageBox( msg, _( "Edit 3D file name" ) );
499 
500  return;
501  }
502 
503  m_3D_ShapeNameListBox->SetString( idx, filename );
504 
505  // if the user has specified an alias in the name then prepend ':'
506  if( hasAlias )
507  filename.insert( 0, wxT( ":" ) );
508 
509  #ifdef __WINDOWS__
510  // In Kicad files, filenames and paths are stored using Unix notation
511  filename.Replace( wxT( "\\" ), wxT( "/" ) );
512  #endif
513 
514  m_shapes3D_list[idx].m_Filename = filename;
515 
516  // This assumes that the index didn't change and will just update the filename
517  if( m_PreviewPane )
518  m_PreviewPane->UpdateModelName( filename );
519 
520  return;
521 }
522 
523 
525 {
526  PROJECT& prj = Prj();
527  S3D_INFO model;
528 
529  wxString initialpath = prj.GetRString( PROJECT::VIEWER_3D_PATH );
530  wxString sidx = prj.GetRString( PROJECT::VIEWER_3D_FILTER_INDEX );
531  int filter = 0;
532 
533  if( !sidx.empty() )
534  {
535  long tmp;
536  sidx.ToLong( &tmp );
537 
538  if( tmp > 0 && tmp <= INT_MAX )
539  filter = (int) tmp;
540  }
541 
542  if( !S3D::Select3DModel( this, Prj().Get3DCacheManager(),
543  initialpath, filter, &model ) || model.m_Filename.empty() )
544  {
545  return;
546  }
547 
548  prj.SetRString( PROJECT::VIEWER_3D_PATH, initialpath );
549  sidx = wxString::Format( wxT( "%i" ), filter );
551  S3D_FILENAME_RESOLVER* res = Prj().Get3DCacheManager()->GetResolver();
552  wxString alias;
553  wxString shortPath;
554  wxString filename = model.m_Filename;
555 
556  if( res && res->SplitAlias( filename, alias, shortPath ) )
557  {
558  alias.Append( wxT( ":" ) );
559  alias.Append( shortPath );
560  m_3D_ShapeNameListBox->Append( alias );
561  }
562  else
563  {
564  m_3D_ShapeNameListBox->Append( filename );
565  }
566 
567 #ifdef __WINDOWS__
568  // In Kicad files, filenames and paths are stored using Unix notation
569  model.m_Filename.Replace( "\\", "/" );
570 #endif
571 
572  m_shapes3D_list.push_back( model );
575 
576  if( m_PreviewPane )
578 
579  return;
580 }
581 
582 
584 {
585  if( !wxDialog::TransferDataToWindow() ||
586  !m_PanelProperties->TransferDataToWindow() )
587  {
588  wxMessageBox( _( "Error: invalid footprint parameter" ) );
589  return false;
590  }
591 
592  if( !m_Panel3D->TransferDataToWindow() )
593  {
594  wxMessageBox( _( "Error: invalid 3D parameter" ) );
595  return false;
596  }
597 
600  Layout();
601 
602  return true;
603 }
604 
605 
607 {
608  wxPoint modpos;
609  wxString msg;
610 
611  if( !Validate() || !DIALOG_MODULE_BOARD_EDITOR_BASE::TransferDataFromWindow() ||
612  !m_PanelProperties->TransferDataFromWindow() )
613  {
614  wxMessageBox( _( "Error: invalid or missing footprint parameter" ) );
615  return false;
616  }
617 
618  if( !m_Panel3D->TransferDataFromWindow() )
619  {
620  wxMessageBox( _( "Error: invalid or missing 3D parameter" ) );
621  return false;
622  }
623 
624  if( m_DC )
625  {
628  }
629 
630  BOARD_COMMIT commit( m_Parent );
631  commit.Modify( m_CurrentModule );
632 
633  // Init Fields (should be first, because they can be moved or/and flipped later):
634  TEXTE_MODULE& reference = m_CurrentModule->Reference();
635  reference = *m_ReferenceCopy;
636  TEXTE_MODULE& value = m_CurrentModule->Value();
637  value = *m_ValueCopy;
638 
639  // Initialize masks clearances
643 
644  double dtmp = 0.0;
645  msg = m_SolderPasteMarginRatioCtrl->GetValue();
646  msg.ToDouble( &dtmp );
647 
648  // A -50% margin ratio means no paste on a pad, the ratio must be >= -50%
649  if( dtmp < -50.0 )
650  dtmp = -50.0;
651  // A margin ratio is always <= 0
652  // 0 means use full pad copper area
653  if( dtmp > 0.0 )
654  dtmp = 0.0;
655 
657 
658  switch( m_ZoneConnectionChoice->GetSelection() )
659  {
660  default:
661  case 0:
663  break;
664 
665  case 1:
667  break;
668 
669  case 2:
671  break;
672 
673  case 3:
675  break;
676  }
677 
678  // Set Module Position
679  modpos.x = ValueFromTextCtrl( *m_ModPositionX );
680  modpos.y = ValueFromTextCtrl( *m_ModPositionY );
681  m_CurrentModule->SetPosition( modpos );
682  m_CurrentModule->SetLocked( m_AutoPlaceCtrl->GetSelection() == 2 );
683  m_CurrentModule->SetPadsLocked( m_AutoPlaceCtrl->GetSelection() == 1 );
684 
685  switch( m_AttributsCtrl->GetSelection() )
686  {
687  case 0:
689  break;
690 
691  case 1:
693  break;
694 
695  case 2:
697  break;
698  }
699 
702 
703  /* Now, set orientation. must be made after others changes,
704  * because rotation changes fields positions on board according to the new orientation
705  * (relative positions are not modified)
706  */
707  int orient = KiROUND( m_OrientValue * 10.0 );
708 
709  if( m_CurrentModule->GetOrientation() != orient )
711  orient - m_CurrentModule->GetOrientation() );
712 
713  // Set component side, that also have effect on the fields positions on board
714  bool change_layer = false;
715  if( m_LayerCtrl->GetSelection() == 0 ) // layer req = COMPONENT
716  {
717  if( m_CurrentModule->GetLayer() == B_Cu )
718  change_layer = true;
719  }
720  else if( m_CurrentModule->GetLayer() == F_Cu )
721  change_layer = true;
722 
723  if( change_layer )
725 
726  // This will update the S3D_INFO list into the current module
727  msg.Clear();
728 
729  if( !m_PreviewPane->ValidateWithMessage( msg ) )
730  {
731  DisplayError( this, msg );
732  return false;
733  }
734 
735  std::list<S3D_INFO>* draw3D = &m_CurrentModule->Models();
736  draw3D->clear();
737  draw3D->insert( draw3D->end(), m_shapes3D_list.begin(), m_shapes3D_list.end() );
738 
740 
741  // This is a simple edition, we must create an undo entry
742  if( m_CurrentModule->GetFlags() == 0 )
743  commit.Push( _( "Modify module properties" ) );
744 
745  SetReturnCode( PRM_EDITOR_EDIT_OK );
746 
747  if( m_DC )
748  {
751  }
752 
753  return true;
754 }
755 
756 
757 void DIALOG_MODULE_BOARD_EDITOR::OnEditReference( wxCommandEvent& event )
758 {
760 
765  m_ReferenceCtrl->SetValue( m_ReferenceCopy->GetText() );
766 }
767 
768 
769 void DIALOG_MODULE_BOARD_EDITOR::OnEditValue( wxCommandEvent& event )
770 {
772 
777  m_ValueCtrl->SetValue( m_ValueCopy->GetText() );
778 }
779 
780 
781 void DIALOG_MODULE_BOARD_EDITOR::Cfg3DPath( wxCommandEvent& event )
782 {
783  if( S3D::Configure3DPaths( this, Prj().Get3DCacheManager()->GetResolver() ) )
784  if( m_LastSelected3DShapeIndex >= 0 )
785  if( m_PreviewPane )
787 }
void ResetModelData(bool aReloadPreviewModule=false)
ResetModelData - Clear the values and reload the preview board.
void SetPlacementCost90(int aCost)
Definition: class_module.h:534
virtual void OnModify() override
Function OnModify must be called after a board change to set the modified flag.
Definition: pcbframe.cpp:993
STATUS_FLAGS GetFlags() const
Definition: base_struct.h:255
COMMIT & Modify(EDA_ITEM *aItem)
Modifies a given item in the model.
Definition: commit.h:103
TEXTE_MODULE & Reference()
Definition: class_module.h:463
void Rotate(const wxPoint &aRotCentre, double aAngle) override
Function Rotate Rotate this object.
Class PROJECT holds project specific data.
Definition: project.h:52
const wxPoint & GetTextPos() const
Definition: eda_text.h:224
void SetLocalClearance(int aClearance)
Definition: class_module.h:180
This file is part of the common library TODO brief description.
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107
void SetPlacementCost180(int aCost)
Definition: class_module.h:531
Implementation of conversion functions that require both schematic and board internal units...
This file is part of the common library.
EDA_DRAW_PANEL * GetCanvas()
Definition: draw_frame.h:299
int GetLocalClearance() const
Definition: class_module.h:179
void CalculateBoundingBox()
Function CalculateBoundingBox calculates the bounding box in board coordinates.
void Draw(EDA_DRAW_PANEL *aPanel, wxDC *aDC, GR_DRAWMODE aDrawMode, const wxPoint &aOffset=ZeroOffset) override
Function Draw draws the footprint to the aDC.
void Flip(const wxPoint &aCentre) override
Function Flip Flip this object, i.e.
const wxPoint & GetPosition() const override
Definition: class_module.h:155
time_t GetNewTimeStamp()
Definition: common.cpp:166
bool ValidateWithMessage(wxString &aErrorMessage)
verify X,Y and Z scale factors are acceptable (> 0.001 and < 1000.0)
Set for modules listed in the automatic insertion list (usually SMD footprints)
Definition: class_module.h:77
void SetZoneConnection(ZoneConnection aType)
Definition: class_module.h:188
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
wxFloatingPointValidator< double > m_OrientValidator
ZoneConnection GetZoneConnection() const
Definition: class_module.h:189
std::list< S3D_INFO > & Models()
Definition: class_module.h:150
static size_t m_page
Module editor: Dialog for editing module properties in the pcb editor.
int GetPlacementCost90() const
Definition: class_module.h:533
void Cfg3DPath(wxCommandEvent &event) override
void SetLocalSolderPasteMarginRatio(double aRatio)
Definition: class_module.h:186
void ExchangeModule(wxCommandEvent &event) override
double GetLocalSolderPasteMarginRatio() const
Definition: class_module.h:185
virtual void Push(const wxString &aMessage=wxT("A commit"), bool aCreateUndoEntry=true) override
Executes the changes.
void SetTimeStamp(time_t aNewTimeStamp)
Definition: base_struct.h:203
Class DIALOG_MODULE_BOARD_EDITOR_BASE.
Pads are not covered.
Definition: zones.h:57
bool Configure3DPaths(wxWindow *aParent, S3D_FILENAME_RESOLVER *aResolver)
bool ValidateFileName(const wxString &aFileName, bool &hasAlias)
Function ValidateName returns true if the given path is a valid aliased relative path.
bool SplitAlias(const wxString &aFileName, wxString &anAlias, wxString &aRelPath)
Function SplitAlias returns true if the given name contains an alias and populates the string anAlias...
void On3DShapeNameSelected(wxCommandEvent &event) override
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:36
bool PadsLocked() const
Definition: class_module.h:272
void SetModelDataIdx(int idx, bool aReloadPreviewModule=false)
SetModelDataIdx - This will set the index of the INFO list that was set on the parent.
Footprint text class description.
Defines a panel which is to be added to a wxFileDialog via SetExtraControl(); The panel shows a previ...
void InstallTextModOptionsFrame(TEXTE_MODULE *TextMod, wxDC *DC)
DIALOG_MODULE_BOARD_EDITOR(PCB_EDIT_FRAME *aParent, MODULE *aModule, wxDC *aDC)
void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:213
double GetOrientation() const
Definition: class_module.h:160
bool Select3DModel(wxWindow *aParent, S3D_CACHE *aCache, wxString &prevModelSelectDir, int &prevModelWildcard, S3D_INFO *aModel)
TEXTE_MODULE & Value()
read/write accessors:
Definition: class_module.h:462
const wxString & GetText() const
Function GetText returns the string associated with the text object.
Definition: eda_text.h:130
wxString GetAbbreviatedUnitsLabel(EDA_UNITS_T aUnit)
Definition: base_units.cpp:479
#define KISYS3DMOD
A variable name whose value holds the path of 3D shape files.
Definition: 3d_viewer.h:38
The common library.
int GetAttributes() const
Definition: class_module.h:197
void SetPadsLocked(bool aPadsLocked)
Definition: class_module.h:274
void SetPosition(const wxPoint &aPos) override
int GetLocalSolderMaskMargin() const
Definition: class_module.h:176
int ValueFromTextCtrl(const wxTextCtrl &aTextCtr)
Convert the number Value in a string according to the internal units and the selected unit (g_UserUni...
Definition: base_units.cpp:384
void CrossHairOff(wxDC *DC)
Definition: draw_panel.cpp:253
bool IsLocked() const override
Function IsLocked.
Definition: class_module.h:236
void SetLocalSolderMaskMargin(int aMargin)
Definition: class_module.h:177
int GetLocalSolderPasteMargin() const
Definition: class_module.h:182
time_t GetTimeStamp() const
Definition: base_struct.h:204
VTBL_ENTRY void SetRString(RSTRING_T aStringId, const wxString &aString)
Function SetRString stores a "retained string", which is any session and project specific string iden...
Definition: project.cpp:162
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
Definition: gr_basic.h:42
void PutValueInLocalUnits(wxTextCtrl &aTextCtr, int aValue)
Function PutValueInLocalUnits converts aValue from internal units to user units and append the units ...
Definition: base_units.cpp:265
PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
void SetLocalSolderPasteMargin(int aMargin)
Definition: class_module.h:183
VTBL_ENTRY const wxString & GetRString(RSTRING_T aStringId)
Function GetRString returns a "retained string", which is any session and project specific string ide...
Definition: project.cpp:177
void CrossHairOn(wxDC *DC)
Definition: draw_panel.cpp:260
see class PGM_BASE
void SetLocked(bool isLocked) override
Function SetLocked sets the MODULE_is_LOCKED bit in the m_ModuleStatus.
Definition: class_module.h:246
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
provides an extensible class to resolve 3D model paths.
void OnEditValue(wxCommandEvent &event) override
Virtual component: when created by copper shapes on board (Like edge card connectors, mounting hole...)
Definition: class_module.h:79
void OnEditReference(wxCommandEvent &event) override
defines the display data cache manager for 3D models
void Remove3DShape(wxCommandEvent &event) override
void GotoModuleEditor(wxCommandEvent &event) override
void ModuleOrientEvent(wxCommandEvent &event) override
Module description (excepted pads)
const wxString & GetPath() const
Definition: class_module.h:173
void SetCrossHairPosition(const wxPoint &aPosition, bool aSnapToGrid=true)
Function SetCrossHairPosition sets the screen cross hair position to aPosition in logical (drawing) u...
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:69
wxPoint GetCrossHairPosition(bool aInvertY=false) const
Function GetCrossHairPosition return the current cross hair position in logical (drawing) coordinates...
int GetPlacementCost180() const
Definition: class_module.h:530
Use thermal relief for pads.
Definition: zones.h:58
Custom text control validator definitions.
Declaration of the eda_3d_viewer class.
void UpdateModelName(wxString const &aModel)
void SetAttributes(int aAttributes)
Definition: class_module.h:198
pads are covered by copper
Definition: zones.h:59
wxString m_Filename
The 3D shape filename in 3D library.
Definition: 3d_info.h:45