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  &aParent->Settings().Colors(),
91  &m_shapes3D_list );
92 
93  bLowerSizer3D->Add( m_PreviewPane, 1, wxEXPAND, 5 );
94 
95  m_NoteBook->SetSelection( m_page );
96  m_sdbSizerStdButtonsOK->SetDefault();
97 
98  m_ReferenceCopy = NULL;
99  m_ValueCopy = NULL;
101  m_OrientValue = 0;
102 
103  // Layout() gets called correctly in TransferDataToWindow().
104 }
105 
106 
107 
109 {
110  m_shapes3D_list.clear();
111 
112  // free the memory used by all models, otherwise models which were
113  // browsed but not used would consume memory
114  Prj().Get3DCacheManager()->FlushCache( false );
115 
116  // the GL canvas has to be visible before it is destroyed
117  m_page = m_NoteBook->GetSelection();
118  m_NoteBook->SetSelection( 1 );
119 
120  delete m_ReferenceCopy;
121  m_ReferenceCopy = NULL;
122 
123  delete m_ValueCopy;
124  m_ValueCopy = NULL;
125 
126  delete m_PreviewPane;
127  m_PreviewPane = NULL; // just in case, to avoid double-free
128 
129  // this is already deleted by the board used on preview pane so
130  // no need to delete here
131  // delete m_currentModuleCopy;
132  // m_currentModuleCopy = NULL;
133 }
134 
135 
136 // Creation of the panel properties of the module editor.
138 {
141 
144 
145  m_LayerCtrl->SetSelection(
146  (m_CurrentModule->GetLayer() == B_Cu) ? 1 : 0 );
147 
148  bool custom_orientation = false;
149  switch( int( m_CurrentModule->GetOrientation() ) )
150  {
151  case 0:
152  m_OrientCtrl->SetSelection( 0 );
153  break;
154 
155  case 900:
156  case -2700:
157  m_OrientCtrl->SetSelection( 1 );
158  break;
159 
160  case -900:
161  case 2700:
162  m_OrientCtrl->SetSelection( 2 );
163  break;
164 
165  case -1800:
166  case 1800:
167  m_OrientCtrl->SetSelection( 3 );
168  break;
169 
170  default:
171  m_OrientCtrl->SetSelection( 4 );
172  custom_orientation = true;
173  break;
174  }
175 
176  m_OrientValueCtrl->Enable( custom_orientation );
178  m_OrientValidator.TransferToWindow();
179 
180  // Initialize dialog relative to masks clearances
184 
187 
188  // These 2 parameters are usually < 0, so prepare entering a negative
189  // value, if current is 0
191 
193  m_SolderPasteMarginCtrl->SetValue( wxT( "-" ) +
194  m_SolderPasteMarginCtrl->GetValue() );
195 
196  // Add solder paste margin ration in per cent
197  // for the usual default value 0.0, display -0.0 (or -0,0 in some countries)
198  wxString msg;
199  msg.Printf( wxT( "%f" ),
201 
203  msg[0] == '0') // Sometimes Printf adds a sign if the value is very small (0.0)
204  m_SolderPasteMarginRatioCtrl->SetValue( wxT("-") + msg );
205  else
206  m_SolderPasteMarginRatioCtrl->SetValue( msg );
207 
209  {
210  default:
212  m_ZoneConnectionChoice->SetSelection( 0 );
213  break;
214 
215  case PAD_ZONE_CONN_FULL:
216  m_ZoneConnectionChoice->SetSelection( 1 );
217  break;
218 
220  m_ZoneConnectionChoice->SetSelection( 2 );
221  break;
222 
223  case PAD_ZONE_CONN_NONE:
224  m_ZoneConnectionChoice->SetSelection( 3 );
225  break;
226  }
227 }
228 
229 
230 void DIALOG_MODULE_BOARD_EDITOR::GotoModuleEditor( wxCommandEvent& event )
231 {
232  if( m_CurrentModule->GetTimeStamp() == 0 ) // Module Editor needs a non null timestamp
233  {
235  m_Parent->OnModify();
236  }
237 
238  EndModal( PRM_EDITOR_WANT_MODEDIT );
239 }
240 
241 
242 void DIALOG_MODULE_BOARD_EDITOR::ExchangeModule( wxCommandEvent& event )
243 {
244  EndModal( PRM_EDITOR_WANT_EXCHANGE_FP );
245 }
246 
247 
249 {
250  bool custom_orientation = false;
251 
252  switch( m_OrientCtrl->GetSelection() )
253  {
254  case 0:
255  m_OrientValue = 0.0;
256  break;
257 
258  case 1:
259  m_OrientValue = 90.0;
260  break;
261 
262  case 2:
263  m_OrientValue = 270.0;
264  break;
265 
266  case 3:
267  m_OrientValue = 180.0;
268  break;
269 
270  default:
271  custom_orientation = true;
272  break;
273  }
274 
275  m_OrientValidator.TransferToWindow();
276  m_OrientValueCtrl->Enable( custom_orientation );
277 }
278 
279 
281 {
282  wxString default_path;
283  wxGetEnv( KISYS3DMOD, &default_path );
284 #ifdef __WINDOWS__
285  default_path.Replace( wxT( "/" ), wxT( "\\" ) );
286 #endif
287 
289 
290  // Init 3D shape list
291  m_3D_ShapeNameListBox->Clear();
292  std::list<S3D_INFO>::iterator sM = m_CurrentModule->Models().begin();
293  std::list<S3D_INFO>::iterator eM = m_CurrentModule->Models().end();
294  m_shapes3D_list.clear();
295 
296  wxString origPath;
297  wxString alias;
298  wxString shortPath;
299  S3D_FILENAME_RESOLVER* res = Prj().Get3DCacheManager()->GetResolver();
300 
301  while( sM != eM )
302  {
303  m_shapes3D_list.push_back( *sM );
304  origPath = sM->m_Filename;
305 
306  if( res && res->SplitAlias( origPath, alias, shortPath ) )
307  {
308  origPath = alias;
309  origPath.append( ":" );
310  origPath.append( shortPath );
311  }
312 
313  m_3D_ShapeNameListBox->Append( origPath );
314  ++sM;
315 
316  }
317 
322  m_ReferenceCtrl->SetValue( m_ReferenceCopy->GetText() );
323  m_ValueCtrl->SetValue( m_ValueCopy->GetText() );
324 
325  // Shows the footprint's schematic path.
327 
328  m_AttributsCtrl->SetItemToolTip( 0,
329  _( "Use this attribute for most non SMD components\n"
330  "Components with this option are not put in the footprint position list file" ) );
331  m_AttributsCtrl->SetItemToolTip( 1,
332  _( "Use this attribute for SMD components.\n"
333  "Only components with this option are put in the footprint position list file" ) );
334  m_AttributsCtrl->SetItemToolTip( 2,
335  _( "Use this attribute for \"virtual\" components drawn on board\n"
336  "like an edge connector (old ISA PC bus for instance)" ) );
337 
338  // Controls on right side of the dialog
339  switch( m_CurrentModule->GetAttributes() & 255 )
340  {
341  case 0:
342  m_AttributsCtrl->SetSelection( 0 );
343  break;
344 
345  case MOD_CMS:
346  m_AttributsCtrl->SetSelection( 1 );
347  break;
348 
349  case MOD_VIRTUAL:
350  m_AttributsCtrl->SetSelection( 2 );
351  break;
352 
353  default:
354  m_AttributsCtrl->SetSelection( 0 );
355  break;
356  }
357 
358  if( m_CurrentModule->IsLocked() )
359  m_AutoPlaceCtrl->SetSelection( 2 );
360  else if( m_CurrentModule->PadsLocked() )
361  m_AutoPlaceCtrl->SetSelection( 1 );
362  else
363  m_AutoPlaceCtrl->SetSelection( 0 );
364 
365  m_AutoPlaceCtrl->SetItemToolTip( 0,
366  _( "Component can be freely moved and auto placed. User "
367  "can arbitrarily select and edit component's pads." ) );
368  m_AutoPlaceCtrl->SetItemToolTip( 1,
369  _( "Component can be freely moved and auto placed, but its "
370  "pads cannot be selected or edited." ) );
371  m_AutoPlaceCtrl->SetItemToolTip( 2,
372  _( "Component is locked: it cannot be freely moved or auto "
373  "placed." ) );
374 
376 
378 
379  // if m_3D_ShapeNameListBox is not empty, preselect first 3D shape
380  if( m_3D_ShapeNameListBox->GetCount() > 0 )
381  {
384 
385  if( m_PreviewPane )
387  }
388  else
389  {
390  if( m_PreviewPane )
391  m_PreviewPane->ResetModelData( true );
392  }
393 
394  // We have modified the UI, so call Fit() for m_Panel3D
395  // to be sure the m_Panel3D sizers are initiliazed before opening the dialog
396  m_Panel3D->GetSizer()->Fit( m_Panel3D );
397 
398  // For some reason, on Linux, after the call to
399  // m_PreviewPane->SetModelDataIdx( m_LastSelected3DShapeIndex, true )
400  // the dialog has no longer the focus. Force it:
401  m_sdbSizerStdButtonsOK->SetFocus();
402 }
403 
404 
406 {
408 
409  if( m_LastSelected3DShapeIndex < 0 ) // happens under wxGTK when
410  // deleting an item in
411  // m_3D_ShapeNameListBox wxListBox
412  {
413  if( m_PreviewPane )
415 
416  return;
417  }
418 
419  if( m_LastSelected3DShapeIndex >= (int) m_shapes3D_list.size() )
420  {
421  wxMessageBox( wxT( "On3DShapeNameSelected() error" ) );
423 
424  if( m_PreviewPane )
426 
427  return;
428  }
429 
430  if( m_PreviewPane )
432 }
433 
434 
435 
436 void DIALOG_MODULE_BOARD_EDITOR::Remove3DShape( wxCommandEvent& event )
437 {
438  int ii = m_3D_ShapeNameListBox->GetSelection();
439 
440  if( ii < 0 )
441  {
442  if( m_PreviewPane )
443  m_PreviewPane->ResetModelData( true );
444 
445  return;
446  }
447 
448  m_shapes3D_list.erase( m_shapes3D_list.begin() + ii );
449  m_3D_ShapeNameListBox->Delete( ii );
450 
451  if( m_3D_ShapeNameListBox->GetCount() > 0 )
452  {
453  if( ii > 0 )
455  else
457 
459 
460  if( m_PreviewPane )
462  }
463  else
464  {
465  if( m_PreviewPane )
466  m_PreviewPane->ResetModelData( true );
467  }
468 
469  return;
470 }
471 
472 
474 {
475  int idx = m_3D_ShapeNameListBox->GetSelection();
476 
477  if( idx < 0 )
478  return;
479 
480  // Edit filename
481  wxString filename = m_3D_ShapeNameListBox->GetStringSelection();
482  wxTextEntryDialog dlg( this, wxEmptyString, wxEmptyString, filename );
483 
484  bool hasAlias;
485  S3D_FILENAME_RESOLVER* res = Prj().Get3DCacheManager()->GetResolver();
486 
487  if( dlg.ShowModal() != wxID_OK )
488  return;
489 
490  filename = dlg.GetValue();
491 
492  if( filename.empty() )
493  return;
494 
495  if( !res->ValidateFileName( filename, hasAlias ) )
496  {
497  wxString msg = _( "Invalid filename: " );
498  msg.append( filename );
499  wxMessageBox( msg, _( "Edit 3D file name" ) );
500 
501  return;
502  }
503 
504  m_3D_ShapeNameListBox->SetString( idx, filename );
505 
506  // if the user has specified an alias in the name then prepend ':'
507  if( hasAlias )
508  filename.insert( 0, wxT( ":" ) );
509 
510  #ifdef __WINDOWS__
511  // In Kicad files, filenames and paths are stored using Unix notation
512  filename.Replace( wxT( "\\" ), wxT( "/" ) );
513  #endif
514 
515  m_shapes3D_list[idx].m_Filename = filename;
516 
517  // This assumes that the index didn't change and will just update the filename
518  if( m_PreviewPane )
519  m_PreviewPane->UpdateModelName( filename );
520 
521  return;
522 }
523 
524 
526 {
527  PROJECT& prj = Prj();
528  S3D_INFO model;
529 
530  wxString initialpath = prj.GetRString( PROJECT::VIEWER_3D_PATH );
531  wxString sidx = prj.GetRString( PROJECT::VIEWER_3D_FILTER_INDEX );
532  int filter = 0;
533 
534  if( !sidx.empty() )
535  {
536  long tmp;
537  sidx.ToLong( &tmp );
538 
539  if( tmp > 0 && tmp <= INT_MAX )
540  filter = (int) tmp;
541  }
542 
543  if( !S3D::Select3DModel( this, Prj().Get3DCacheManager(),
544  initialpath, filter, &model ) || model.m_Filename.empty() )
545  {
546  return;
547  }
548 
549  prj.SetRString( PROJECT::VIEWER_3D_PATH, initialpath );
550  sidx = wxString::Format( wxT( "%i" ), filter );
552  S3D_FILENAME_RESOLVER* res = Prj().Get3DCacheManager()->GetResolver();
553  wxString alias;
554  wxString shortPath;
555  wxString filename = model.m_Filename;
556 
557  if( res && res->SplitAlias( filename, alias, shortPath ) )
558  {
559  alias.Append( wxT( ":" ) );
560  alias.Append( shortPath );
561  m_3D_ShapeNameListBox->Append( alias );
562  }
563  else
564  {
565  m_3D_ShapeNameListBox->Append( filename );
566  }
567 
568 #ifdef __WINDOWS__
569  // In Kicad files, filenames and paths are stored using Unix notation
570  model.m_Filename.Replace( "\\", "/" );
571 #endif
572 
573  m_shapes3D_list.push_back( model );
576 
577  if( m_PreviewPane )
579 
580  return;
581 }
582 
583 
585 {
586  if( !wxDialog::TransferDataToWindow() ||
587  !m_PanelProperties->TransferDataToWindow() )
588  {
589  wxMessageBox( _( "Error: invalid footprint parameter" ) );
590  return false;
591  }
592 
593  if( !m_Panel3D->TransferDataToWindow() )
594  {
595  wxMessageBox( _( "Error: invalid 3D parameter" ) );
596  return false;
597  }
598 
601  Layout();
602 
603  return true;
604 }
605 
606 
608 {
609  wxPoint modpos;
610  wxString msg;
611 
612  if( !Validate() || !DIALOG_MODULE_BOARD_EDITOR_BASE::TransferDataFromWindow() ||
613  !m_PanelProperties->TransferDataFromWindow() )
614  {
615  wxMessageBox( _( "Error: invalid or missing footprint parameter" ) );
616  return false;
617  }
618 
619  if( !m_Panel3D->TransferDataFromWindow() )
620  {
621  wxMessageBox( _( "Error: invalid or missing 3D parameter" ) );
622  return false;
623  }
624 
625  if( m_DC )
626  {
629  }
630 
631  BOARD_COMMIT commit( m_Parent );
632  commit.Modify( m_CurrentModule );
633 
634  // Init Fields (should be first, because they can be moved or/and flipped later):
635  TEXTE_MODULE& reference = m_CurrentModule->Reference();
636  reference = *m_ReferenceCopy;
637  TEXTE_MODULE& value = m_CurrentModule->Value();
638  value = *m_ValueCopy;
639 
640  // Initialize masks clearances
644 
645  double dtmp = 0.0;
646  msg = m_SolderPasteMarginRatioCtrl->GetValue();
647  msg.ToDouble( &dtmp );
648 
649  // A -50% margin ratio means no paste on a pad, the ratio must be >= -50%
650  if( dtmp < -50.0 )
651  dtmp = -50.0;
652  // A margin ratio is always <= 0
653  // 0 means use full pad copper area
654  if( dtmp > 0.0 )
655  dtmp = 0.0;
656 
658 
659  switch( m_ZoneConnectionChoice->GetSelection() )
660  {
661  default:
662  case 0:
664  break;
665 
666  case 1:
668  break;
669 
670  case 2:
672  break;
673 
674  case 3:
676  break;
677  }
678 
679  // Set Module Position
680  modpos.x = ValueFromTextCtrl( *m_ModPositionX );
681  modpos.y = ValueFromTextCtrl( *m_ModPositionY );
682  m_CurrentModule->SetPosition( modpos );
683  m_CurrentModule->SetLocked( m_AutoPlaceCtrl->GetSelection() == 2 );
684  m_CurrentModule->SetPadsLocked( m_AutoPlaceCtrl->GetSelection() == 1 );
685 
686  switch( m_AttributsCtrl->GetSelection() )
687  {
688  case 0:
690  break;
691 
692  case 1:
694  break;
695 
696  case 2:
698  break;
699  }
700 
703 
704  /* Now, set orientation. must be made after others changes,
705  * because rotation changes fields positions on board according to the new orientation
706  * (relative positions are not modified)
707  */
708  int orient = KiROUND( m_OrientValue * 10.0 );
709 
710  if( m_CurrentModule->GetOrientation() != orient )
712  orient - m_CurrentModule->GetOrientation() );
713 
714  // Set component side, that also have effect on the fields positions on board
715  bool change_layer = false;
716  if( m_LayerCtrl->GetSelection() == 0 ) // layer req = COMPONENT
717  {
718  if( m_CurrentModule->GetLayer() == B_Cu )
719  change_layer = true;
720  }
721  else if( m_CurrentModule->GetLayer() == F_Cu )
722  change_layer = true;
723 
724  if( change_layer )
726 
727  // This will update the S3D_INFO list into the current module
728  msg.Clear();
729 
730  if( !m_PreviewPane->ValidateWithMessage( msg ) )
731  {
732  DisplayError( this, msg );
733  return false;
734  }
735 
736  std::list<S3D_INFO>* draw3D = &m_CurrentModule->Models();
737  draw3D->clear();
738  draw3D->insert( draw3D->end(), m_shapes3D_list.begin(), m_shapes3D_list.end() );
739 
741 
742  // This is a simple edition, we must create an undo entry
743  if( m_CurrentModule->GetFlags() == 0 )
744  commit.Push( _( "Modify module properties" ) );
745 
746  SetReturnCode( PRM_EDITOR_EDIT_OK );
747 
748  if( m_DC )
749  {
752  }
753 
754  return true;
755 }
756 
757 
758 void DIALOG_MODULE_BOARD_EDITOR::OnEditReference( wxCommandEvent& event )
759 {
761 
766  m_ReferenceCtrl->SetValue( m_ReferenceCopy->GetText() );
767 }
768 
769 
770 void DIALOG_MODULE_BOARD_EDITOR::OnEditValue( wxCommandEvent& event )
771 {
773 
778  m_ValueCtrl->SetValue( m_ValueCopy->GetText() );
779 }
780 
781 
782 void DIALOG_MODULE_BOARD_EDITOR::Cfg3DPath( wxCommandEvent& event )
783 {
784  if( S3D::Configure3DPaths( this, Prj().Get3DCacheManager()->GetResolver() ) )
785  if( m_LastSelected3DShapeIndex >= 0 )
786  if( m_PreviewPane )
788 }
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:1001
STATUS_FLAGS GetFlags() const
Definition: base_struct.h:269
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:56
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:337
int GetLocalClearance() const
Definition: class_module.h:179
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.
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:217
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:227
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
PCB_GENERAL_SETTINGS & Settings()
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:252
bool IsLocked() const override
Function IsLocked.
Definition: class_module.h:236
void SetLocalSolderMaskMargin(int aMargin)
Definition: class_module.h:177
COLORS_DESIGN_SETTINGS & Colors()
int GetLocalSolderPasteMargin() const
Definition: class_module.h:182
time_t GetTimeStamp() const
Definition: base_struct.h:218
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
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:259
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:71
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