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) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
10  * Copyright (C) 2015 Dick Hollenbeck, dick@softplc.com
11  * Copyright (C) 2004-2018 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 #include <widgets/text_ctrl_eval.h>
51 
56 #include "3d_cache/3d_cache.h"
58 
60 
61 size_t DIALOG_MODULE_BOARD_EDITOR::m_page = 0; // remember the last open page during session
62 
63 
65  MODULE* aModule,
66  wxDC* aDC ) :
68  m_OrientValidator( 1, &m_OrientValue )
69 {
70  wxASSERT( aParent != NULL );
71  wxASSERT( aModule != NULL );
72 
73  m_Parent = aParent;
74  m_DC = aDC;
75  m_CurrentModule = aModule;
76 
77  m_currentModuleCopy = new MODULE( *aModule );
78 
79  // Give an icon
80  wxIcon icon;
81  icon.CopyFromBitmap( KiBitmap( icon_modedit_xpm ) );
82  SetIcon( icon );
83 
84  m_OrientValidator.SetRange( -360.0, 360.0 );
85  m_OrientValueCtrl->SetValidator( m_OrientValidator );
87 
88  aParent->Prj().Get3DCacheManager()->GetResolver()->SetProgramBase( &Pgm() );
89 
91  aParent->Prj().Get3DCacheManager(),
93  &aParent->Settings().Colors(),
94  &m_shapes3D_list );
95 
96  bLowerSizer3D->Add( m_PreviewPane, 1, wxEXPAND, 5 );
97 
98  m_NoteBook->SetSelection( m_page );
99  m_sdbSizerStdButtonsOK->SetDefault();
100 
101  m_ReferenceCopy = NULL;
102  m_ValueCopy = NULL;
104  m_OrientValue = 0;
105 
106  // Layout() gets called correctly in TransferDataToWindow().
107 }
108 
109 
110 
112 {
113  m_shapes3D_list.clear();
114 
115  // free the memory used by all models, otherwise models which were
116  // browsed but not used would consume memory
117  Prj().Get3DCacheManager()->FlushCache( false );
118 
119  // the GL canvas has to be visible before it is destroyed
120  m_page = m_NoteBook->GetSelection();
121  m_NoteBook->SetSelection( 1 );
122 
123  delete m_ReferenceCopy;
124  m_ReferenceCopy = NULL;
125 
126  delete m_ValueCopy;
127  m_ValueCopy = NULL;
128 
129  delete m_PreviewPane;
130  m_PreviewPane = NULL; // just in case, to avoid double-free
131 
132  // this is already deleted by the board used on preview pane so
133  // no need to delete here
134  // delete m_currentModuleCopy;
135  // m_currentModuleCopy = NULL;
136 }
137 
138 
139 // Creation of the panel properties of the module editor.
141 {
144 
147 
148  m_LayerCtrl->SetSelection(
149  (m_CurrentModule->GetLayer() == B_Cu) ? 1 : 0 );
150 
151  bool custom_orientation = false;
152  switch( int( m_CurrentModule->GetOrientation() ) )
153  {
154  case 0:
155  m_OrientCtrl->SetSelection( 0 );
156  break;
157 
158  case 900:
159  case -2700:
160  m_OrientCtrl->SetSelection( 1 );
161  break;
162 
163  case -900:
164  case 2700:
165  m_OrientCtrl->SetSelection( 2 );
166  break;
167 
168  case -1800:
169  case 1800:
170  m_OrientCtrl->SetSelection( 3 );
171  break;
172 
173  default:
174  m_OrientCtrl->SetSelection( 4 );
175  custom_orientation = true;
176  break;
177  }
178 
179  m_OrientValueCtrl->Enable( custom_orientation );
181  m_OrientValidator.TransferToWindow();
182 
183  // Initialize dialog relative to masks clearances
187 
190 
191  // These 2 parameters are usually < 0, so prepare entering a negative
192  // value, if current is 0
194 
196  m_SolderPasteMarginCtrl->SetValue( wxT( "-" ) +
197  m_SolderPasteMarginCtrl->GetValue() );
198 
199  // Add solder paste margin ration in per cent
200  // for the usual default value 0.0, display -0.0 (or -0,0 in some countries)
201  wxString msg;
202  msg.Printf( wxT( "%f" ),
204 
206  msg[0] == '0') // Sometimes Printf adds a sign if the value is very small (0.0)
207  m_SolderPasteMarginRatioCtrl->SetValue( wxT("-") + msg );
208  else
209  m_SolderPasteMarginRatioCtrl->SetValue( msg );
210 
212  {
213  default:
215  m_ZoneConnectionChoice->SetSelection( 0 );
216  break;
217 
218  case PAD_ZONE_CONN_FULL:
219  m_ZoneConnectionChoice->SetSelection( 1 );
220  break;
221 
223  m_ZoneConnectionChoice->SetSelection( 2 );
224  break;
225 
226  case PAD_ZONE_CONN_NONE:
227  m_ZoneConnectionChoice->SetSelection( 3 );
228  break;
229  }
230 }
231 
232 
233 void DIALOG_MODULE_BOARD_EDITOR::GotoModuleEditor( wxCommandEvent& event )
234 {
235  if( m_CurrentModule->GetTimeStamp() == 0 ) // Module Editor needs a non null timestamp
236  {
238  m_Parent->OnModify();
239  }
240 
241  EndModal( PRM_EDITOR_WANT_MODEDIT );
242 }
243 
244 
245 void DIALOG_MODULE_BOARD_EDITOR::ExchangeModule( wxCommandEvent& event )
246 {
247  EndModal( PRM_EDITOR_WANT_EXCHANGE_FP );
248 }
249 
250 
252 {
253  bool custom_orientation = false;
254 
255  switch( m_OrientCtrl->GetSelection() )
256  {
257  case 0:
258  m_OrientValue = 0.0;
259  break;
260 
261  case 1:
262  m_OrientValue = 90.0;
263  break;
264 
265  case 2:
266  m_OrientValue = 270.0;
267  break;
268 
269  case 3:
270  m_OrientValue = 180.0;
271  break;
272 
273  default:
274  custom_orientation = true;
275  break;
276  }
277 
278  m_OrientValidator.TransferToWindow();
279  m_OrientValueCtrl->Enable( custom_orientation );
280 }
281 
282 
284 {
285  wxString default_path;
286  wxGetEnv( KISYS3DMOD, &default_path );
287 #ifdef __WINDOWS__
288  default_path.Replace( wxT( "/" ), wxT( "\\" ) );
289 #endif
290 
292 
293  // Init 3D shape list
294  m_3D_ShapeNameListBox->Clear();
295  auto sM = m_CurrentModule->Models().begin();
296  auto eM = m_CurrentModule->Models().end();
297  m_shapes3D_list.clear();
298 
299  wxString origPath;
300  wxString alias;
301  wxString shortPath;
302  S3D_FILENAME_RESOLVER* res = Prj().Get3DCacheManager()->GetResolver();
303 
304  while( sM != eM )
305  {
306  m_shapes3D_list.push_back( *sM );
307  origPath = sM->m_Filename;
308 
309  if( res && res->SplitAlias( origPath, alias, shortPath ) )
310  {
311  origPath = alias;
312  origPath.append( ":" );
313  origPath.append( shortPath );
314  }
315 
316  m_3D_ShapeNameListBox->Append( origPath );
317  ++sM;
318 
319  }
320 
325  m_ReferenceCtrl->SetValue( m_ReferenceCopy->GetText() );
326  m_ValueCtrl->SetValue( m_ValueCopy->GetText() );
327 
328  // Shows the footprint's schematic path.
330 
331  m_AttributsCtrl->SetItemToolTip( 0,
332  _( "Use this attribute for most non SMD footprints\n"
333  "Footprints with this option are not put in the footprint position list file" ) );
334  m_AttributsCtrl->SetItemToolTip( 1,
335  _( "Use this attribute for SMD footprints.\n"
336  "Only footprints with this option are put in the footprint position list file" ) );
337  m_AttributsCtrl->SetItemToolTip( 2,
338  _( "Use this attribute for \"virtual\" footprints drawn on board\n"
339  "such as an edge connector (old ISA PC bus for instance)" ) );
340 
341  // Controls on right side of the dialog
342  switch( m_CurrentModule->GetAttributes() & 255 )
343  {
344  case 0:
345  m_AttributsCtrl->SetSelection( 0 );
346  break;
347 
348  case MOD_CMS:
349  m_AttributsCtrl->SetSelection( 1 );
350  break;
351 
352  case MOD_VIRTUAL:
353  m_AttributsCtrl->SetSelection( 2 );
354  break;
355 
356  default:
357  m_AttributsCtrl->SetSelection( 0 );
358  break;
359  }
360 
361  if( m_CurrentModule->IsLocked() )
362  m_AutoPlaceCtrl->SetSelection( 2 );
363  else if( m_CurrentModule->PadsLocked() )
364  m_AutoPlaceCtrl->SetSelection( 1 );
365  else
366  m_AutoPlaceCtrl->SetSelection( 0 );
367 
368  m_AutoPlaceCtrl->SetItemToolTip( 0,
369  _( "Component can be freely moved and auto placed. User "
370  "can arbitrarily select and edit component's pads." ) );
371  m_AutoPlaceCtrl->SetItemToolTip( 1,
372  _( "Component can be freely moved and auto placed, but its "
373  "pads cannot be selected or edited." ) );
374  m_AutoPlaceCtrl->SetItemToolTip( 2,
375  _( "Component is locked: it cannot be freely moved or auto "
376  "placed." ) );
377 
379 
381 
382  // if m_3D_ShapeNameListBox is not empty, preselect first 3D shape
383  if( m_3D_ShapeNameListBox->GetCount() > 0 )
384  {
387 
388  if( m_PreviewPane )
390  }
391  else
392  {
393  if( m_PreviewPane )
394  m_PreviewPane->ResetModelData( true );
395  }
396 
397  // We have modified the UI, so call Fit() for m_Panel3D
398  // to be sure the m_Panel3D sizers are initiliazed before opening the dialog
399  m_Panel3D->GetSizer()->Fit( m_Panel3D );
400 
401  // For some reason, on Linux, after the call to
402  // m_PreviewPane->SetModelDataIdx( m_LastSelected3DShapeIndex, true )
403  // the dialog has no longer the focus. Force it:
404  m_sdbSizerStdButtonsOK->SetFocus();
405 }
406 
407 
409 {
411 
412  if( m_LastSelected3DShapeIndex < 0 ) // happens under wxGTK when
413  // deleting an item in
414  // m_3D_ShapeNameListBox wxListBox
415  {
416  if( m_PreviewPane )
418 
419  return;
420  }
421 
422  if( m_LastSelected3DShapeIndex >= (int) m_shapes3D_list.size() )
423  {
424  wxMessageBox( wxT( "On3DShapeNameSelected() error" ) );
426 
427  if( m_PreviewPane )
429 
430  return;
431  }
432 
433  if( m_PreviewPane )
435 }
436 
437 
438 
439 void DIALOG_MODULE_BOARD_EDITOR::Remove3DShape( wxCommandEvent& event )
440 {
441  int ii = m_3D_ShapeNameListBox->GetSelection();
442 
443  if( ii < 0 )
444  {
445  if( m_PreviewPane )
446  m_PreviewPane->ResetModelData( true );
447 
448  return;
449  }
450 
451  m_shapes3D_list.erase( m_shapes3D_list.begin() + ii );
452  m_3D_ShapeNameListBox->Delete( ii );
453 
454  if( m_3D_ShapeNameListBox->GetCount() > 0 )
455  {
456  if( ii > 0 )
458  else
460 
462 
463  if( m_PreviewPane )
465  }
466  else
467  {
468  if( m_PreviewPane )
469  m_PreviewPane->ResetModelData( true );
470  }
471 
472  return;
473 }
474 
475 
477 {
478  int idx = m_3D_ShapeNameListBox->GetSelection();
479 
480  if( idx < 0 )
481  return;
482 
483  // Edit filename
484  wxString filename = m_3D_ShapeNameListBox->GetStringSelection();
485  wxTextEntryDialog dlg( this, wxEmptyString, wxEmptyString, filename );
486 
487  bool hasAlias;
488  S3D_FILENAME_RESOLVER* res = Prj().Get3DCacheManager()->GetResolver();
489 
490  if( dlg.ShowModal() != wxID_OK )
491  return;
492 
493  filename = dlg.GetValue();
494 
495  if( filename.empty() )
496  return;
497 
498  if( !res->ValidateFileName( filename, hasAlias ) )
499  {
500  wxString msg = _( "Invalid filename: " );
501  msg.append( filename );
502  wxMessageBox( msg, _( "Edit 3D file name" ) );
503 
504  return;
505  }
506 
507  m_3D_ShapeNameListBox->SetString( idx, filename );
508 
509  // if the user has specified an alias in the name then prepend ':'
510  if( hasAlias )
511  filename.insert( 0, wxT( ":" ) );
512 
513  #ifdef __WINDOWS__
514  // In Kicad files, filenames and paths are stored using Unix notation
515  filename.Replace( wxT( "\\" ), wxT( "/" ) );
516  #endif
517 
518  m_shapes3D_list[idx].m_Filename = filename;
519 
520  // This assumes that the index didn't change and will just update the filename
521  if( m_PreviewPane )
522  m_PreviewPane->UpdateModelName( filename );
523 
524  return;
525 }
526 
527 
529 {
530  PROJECT& prj = Prj();
531  MODULE_3D_SETTINGS model;
532 
533  wxString initialpath = prj.GetRString( PROJECT::VIEWER_3D_PATH );
534  wxString sidx = prj.GetRString( PROJECT::VIEWER_3D_FILTER_INDEX );
535  int filter = 0;
536 
537  // If the PROJECT::VIEWER_3D_PATH hasn't been set yet, use the KISYS3DMOD environment
538  // varaible and fall back to the project path if necessary.
539  if( initialpath.IsEmpty() )
540  {
541  if( !wxGetEnv( "KISYS3DMOD", &initialpath ) || initialpath.IsEmpty() )
542  initialpath = prj.GetProjectPath();
543  }
544 
545  if( !sidx.empty() )
546  {
547  long tmp;
548  sidx.ToLong( &tmp );
549 
550  if( tmp > 0 && tmp <= INT_MAX )
551  filter = (int) tmp;
552  }
553 
554  if( !S3D::Select3DModel( this, Prj().Get3DCacheManager(),
555  initialpath, filter, &model ) || model.m_Filename.empty() )
556  {
557  return;
558  }
559 
560  prj.SetRString( PROJECT::VIEWER_3D_PATH, initialpath );
561  sidx = wxString::Format( wxT( "%i" ), filter );
563  S3D_FILENAME_RESOLVER* res = Prj().Get3DCacheManager()->GetResolver();
564  wxString alias;
565  wxString shortPath;
566  wxString filename = model.m_Filename;
567 
568  if( res && res->SplitAlias( filename, alias, shortPath ) )
569  {
570  alias.Append( wxT( ":" ) );
571  alias.Append( shortPath );
572  m_3D_ShapeNameListBox->Append( alias );
573  }
574  else
575  {
576  m_3D_ShapeNameListBox->Append( filename );
577  }
578 
579 #ifdef __WINDOWS__
580  // In Kicad files, filenames and paths are stored using Unix notation
581  model.m_Filename.Replace( "\\", "/" );
582 #endif
583 
584  m_shapes3D_list.push_back( model );
587 
588  if( m_PreviewPane )
590 
591  return;
592 }
593 
594 
596 {
597  if( !wxDialog::TransferDataToWindow() ||
598  !m_PanelProperties->TransferDataToWindow() )
599  {
600  wxMessageBox( _( "Error: invalid footprint parameter" ) );
601  return false;
602  }
603 
604  if( !m_Panel3D->TransferDataToWindow() )
605  {
606  wxMessageBox( _( "Error: invalid 3D parameter" ) );
607  return false;
608  }
609 
612  Layout();
613 
614  return true;
615 }
616 
617 
619 {
620  wxPoint modpos;
621  wxString msg;
622 
623  if( !Validate() || !DIALOG_MODULE_BOARD_EDITOR_BASE::TransferDataFromWindow() ||
624  !m_PanelProperties->TransferDataFromWindow() )
625  {
626  wxMessageBox( _( "Error: invalid or missing footprint parameter" ) );
627  return false;
628  }
629 
630  if( !m_Panel3D->TransferDataFromWindow() )
631  {
632  wxMessageBox( _( "Error: invalid or missing 3D parameter" ) );
633  return false;
634  }
635 
636  if( m_DC )
637  {
640  }
641 
642  BOARD_COMMIT commit( m_Parent );
643  commit.Modify( m_CurrentModule );
644 
645  // Init Fields (should be first, because they can be moved or/and flipped later):
646  TEXTE_MODULE& reference = m_CurrentModule->Reference();
647  reference = *m_ReferenceCopy;
648  TEXTE_MODULE& value = m_CurrentModule->Value();
649  value = *m_ValueCopy;
650 
651  // Initialize masks clearances
655 
656  double dtmp = 0.0;
657  msg = m_SolderPasteMarginRatioCtrl->GetValue();
658  msg.ToDouble( &dtmp );
659 
660  // A -50% margin ratio means no paste on a pad, the ratio must be >= -50%
661  if( dtmp < -50.0 )
662  dtmp = -50.0;
663  // A margin ratio is always <= 0
664  // 0 means use full pad copper area
665  if( dtmp > 0.0 )
666  dtmp = 0.0;
667 
669 
670  switch( m_ZoneConnectionChoice->GetSelection() )
671  {
672  default:
673  case 0:
675  break;
676 
677  case 1:
679  break;
680 
681  case 2:
683  break;
684 
685  case 3:
687  break;
688  }
689 
690  // Set Module Position
691  modpos.x = ValueFromTextCtrl( *m_ModPositionX );
692  modpos.y = ValueFromTextCtrl( *m_ModPositionY );
693  m_CurrentModule->SetPosition( modpos );
694  m_CurrentModule->SetLocked( m_AutoPlaceCtrl->GetSelection() == 2 );
695  m_CurrentModule->SetPadsLocked( m_AutoPlaceCtrl->GetSelection() == 1 );
696 
697  switch( m_AttributsCtrl->GetSelection() )
698  {
699  case 0:
701  break;
702 
703  case 1:
705  break;
706 
707  case 2:
709  break;
710  }
711 
714 
715  /* Now, set orientation. must be made after others changes,
716  * because rotation changes fields positions on board according to the new orientation
717  * (relative positions are not modified)
718  */
719  int orient = KiROUND( m_OrientValue * 10.0 );
720 
721  if( m_CurrentModule->GetOrientation() != orient )
723  orient - m_CurrentModule->GetOrientation() );
724 
725  // Set component side, that also have effect on the fields positions on board
726  bool change_layer = false;
727  if( m_LayerCtrl->GetSelection() == 0 ) // layer req = COMPONENT
728  {
729  if( m_CurrentModule->GetLayer() == B_Cu )
730  change_layer = true;
731  }
732  else if( m_CurrentModule->GetLayer() == F_Cu )
733  change_layer = true;
734 
735  if( change_layer )
737 
738  // This will update the S3D_INFO list into the current module
739  msg.Clear();
740 
741  if( !m_PreviewPane->ValidateWithMessage( msg ) )
742  {
743  DisplayError( this, msg );
744  return false;
745  }
746 
747  std::list<MODULE_3D_SETTINGS>* draw3D = &m_CurrentModule->Models();
748  draw3D->clear();
749  draw3D->insert( draw3D->end(), m_shapes3D_list.begin(), m_shapes3D_list.end() );
750 
752 
753  // This is a simple edition, we must create an undo entry
754  if( m_CurrentModule->GetFlags() == 0 )
755  commit.Push( _( "Modify module properties" ) );
756 
757  SetReturnCode( PRM_EDITOR_EDIT_OK );
758 
759  if( m_DC )
760  {
763  }
764 
765  return true;
766 }
767 
768 
769 void DIALOG_MODULE_BOARD_EDITOR::OnEditReference( wxCommandEvent& event )
770 {
772 
775 
776  DIALOG_EDIT_FPTEXT dialog( this, m_Parent, m_ReferenceCopy, NULL );
777  dialog.ShowModal();
778 
780  m_ReferenceCtrl->SetValue( m_ReferenceCopy->GetText() );
781 }
782 
783 
784 void DIALOG_MODULE_BOARD_EDITOR::OnEditValue( wxCommandEvent& event )
785 {
787 
790 
791  DIALOG_EDIT_FPTEXT dialog( this, m_Parent, m_ValueCopy, NULL );
792  dialog.ShowModal();
793 
795  m_ValueCtrl->SetValue( m_ValueCopy->GetText() );
796 }
797 
798 
799 void DIALOG_MODULE_BOARD_EDITOR::Cfg3DPath( wxCommandEvent& event )
800 {
801  if( S3D::Configure3DPaths( this, Prj().Get3DCacheManager()->GetResolver() ) )
802  if( m_LastSelected3DShapeIndex >= 0 )
803  if( m_PreviewPane )
805 }
void ResetModelData(bool aReloadPreviewModule=false)
ResetModelData - Clear the values and reload the preview board.
void SetPlacementCost90(int aCost)
Definition: class_module.h:554
virtual void OnModify() override
Function OnModify must be called after a board change to set the modified flag.
Definition: pcbframe.cpp:1038
STATUS_FLAGS GetFlags() const
Definition: base_struct.h:282
COMMIT & Modify(EDA_ITEM *aItem)
Modifies a given item in the model.
Definition: commit.h:103
TEXTE_MODULE & Reference()
Definition: class_module.h:483
void Rotate(const wxPoint &aRotCentre, double aAngle) override
Function Rotate Rotate this object.
Class PROJECT holds project specific data.
Definition: project.h:56
const wxPoint & GetTextPos() const
Definition: eda_text.h:222
void SetLocalClearance(int aClearance)
Definition: class_module.h:200
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:551
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:346
int GetLocalClearance() const
Definition: class_module.h:199
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
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.
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:76
void SetZoneConnection(ZoneConnection aType)
Definition: class_module.h:208
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
wxFloatingPointValidator< double > m_OrientValidator
ZoneConnection GetZoneConnection() const
Definition: class_module.h:209
static size_t m_page
Module editor: Dialog for editing module properties in the pcb editor.
int GetPlacementCost90() const
Definition: class_module.h:553
void Cfg3DPath(wxCommandEvent &event) override
void SetLocalSolderPasteMarginRatio(double aRatio)
Definition: class_module.h:206
void ExchangeModule(wxCommandEvent &event) override
double GetLocalSolderPasteMarginRatio() const
Definition: class_module.h:205
virtual void Push(const wxString &aMessage=wxT("A commit"), bool aCreateUndoEntry=true) override
Executes the changes.
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:78
bool PadsLocked() const
Definition: class_module.h:292
timestamp_t GetNewTimeStamp()
Definition: common.cpp:166
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...
DIALOG_MODULE_BOARD_EDITOR(PCB_EDIT_FRAME *aParent, MODULE *aModule, wxDC *aDC)
void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:240
double GetOrientation() const
Definition: class_module.h:180
TEXTE_MODULE & Value()
read/write accessors:
Definition: class_module.h:482
PCB_GENERAL_SETTINGS & Settings()
std::vector< MODULE_3D_SETTINGS > m_shapes3D_list
const wxString & GetText() const
Function GetText returns the string associated with the text object.
Definition: eda_text.h:128
wxString GetAbbreviatedUnitsLabel(EDA_UNITS_T aUnit)
Definition: base_units.cpp:484
#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:217
void SetPadsLocked(bool aPadsLocked)
Definition: class_module.h:294
void SetPosition(const wxPoint &aPos) override
int GetLocalSolderMaskMargin() const
Definition: class_module.h:196
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:385
void CrossHairOff(wxDC *DC)
Definition: draw_panel.cpp:259
bool IsLocked() const override
Function IsLocked.
Definition: class_module.h:256
void SetLocalSolderMaskMargin(int aMargin)
Definition: class_module.h:197
COLORS_DESIGN_SETTINGS & Colors()
int GetLocalSolderPasteMargin() const
Definition: class_module.h:202
wxString m_Filename
The 3D shape filename in 3D library.
Definition: class_module.h:101
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:171
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
Definition: gr_basic.h:38
void PutValueInLocalUnits(wxTextCtrl &aTextCtr, int aValue)
Function PutValueInLocalUnits converts aValue from internal units to user units and append the units ...
Definition: base_units.cpp:266
void SetLocalSolderPasteMargin(int aMargin)
Definition: class_module.h:203
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:186
std::list< MODULE_3D_SETTINGS > & Models()
Definition: class_module.h:170
void CrossHairOn(wxDC *DC)
Definition: draw_panel.cpp:266
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:266
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:78
void OnEditReference(wxCommandEvent &event) override
defines the display data cache manager for 3D models
VTBL_ENTRY const wxString GetProjectPath() const
Function GetProjectPath returns the full path of the project.
Definition: project.cpp:100
void Remove3DShape(wxCommandEvent &event) override
void GotoModuleEditor(wxCommandEvent &event) override
void ModuleOrientEvent(wxCommandEvent &event) override
bool Select3DModel(wxWindow *aParent, S3D_CACHE *aCache, wxString &prevModelSelectDir, int &prevModelWildcard, MODULE_3D_SETTINGS *aModel)
Module description (excepted pads)
const wxString & GetPath() const
Definition: class_module.h:193
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:74
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:550
const wxPoint GetPosition() const override
Definition: class_module.h:175
Use thermal relief for pads.
Definition: zones.h:58
Custom text control validator definitions.
Declaration of the eda_3d_viewer class.
timestamp_t GetTimeStamp() const
Definition: base_struct.h:231
void UpdateModelName(wxString const &aModel)
void SetAttributes(int aAttributes)
Definition: class_module.h:218
void SetTimeStamp(timestamp_t aNewTimeStamp)
Definition: base_struct.h:230
pads are covered by copper
Definition: zones.h:59