KiCad PCB EDA Suite
PANEL_SETUP_LAYERS Class Reference

#include <panel_setup_layers.h>

Inheritance diagram for PANEL_SETUP_LAYERS:
PANEL_SETUP_LAYERS_BASE

Public Member Functions

 PANEL_SETUP_LAYERS (PAGED_DIALOG *aParent, PCB_EDIT_FRAME *aFrame)
 
void ImportSettingsFrom (BOARD *aBoard)
 

Protected Attributes

wxChoice * m_PresetsChoice
 
wxStaticLine * m_staticline1
 
wxStaticText * m_staticTextCopperLayers
 
wxChoice * m_CopperLayersChoice
 
wxStaticText * m_thicknessLabel
 
wxTextCtrl * m_thicknessCtrl
 
wxStaticText * m_thicknessUnits
 
wxStaticLine * m_staticline2
 
wxScrolledWindow * m_LayersListPanel
 
wxFlexGridSizer * m_LayerListFlexGridSizer
 
wxCheckBox * m_CrtYdFrontCheckBox
 
wxStaticText * m_CrtYdFrontName
 
wxStaticText * m_CrtYdFrontStaticText
 
wxCheckBox * m_FabFrontCheckBox
 
wxStaticText * m_FabFrontName
 
wxStaticText * m_FabFrontStaticText
 
wxCheckBox * m_AdhesFrontCheckBox
 
wxStaticText * m_AdhesFrontName
 
wxStaticText * m_AdhesFrontStaticText
 
wxCheckBox * m_SoldPFrontCheckBox
 
wxStaticText * m_SoldPFrontName
 
wxStaticText * m_SoldPFrontStaticText
 
wxCheckBox * m_SilkSFrontCheckBox
 
wxStaticText * m_SilkSFrontName
 
wxStaticText * m_SilkSFrontStaticText
 
wxCheckBox * m_MaskFrontCheckBox
 
wxStaticText * m_MaskFrontName
 
wxStaticText * m_MaskFrontStaticText
 
wxCheckBox * m_FrontCheckBox
 
wxTextCtrl * m_FrontName
 
wxChoice * m_FrontChoice
 
wxCheckBox * m_In1CheckBox
 
wxTextCtrl * m_In1Name
 
wxChoice * m_In1Choice
 
wxCheckBox * m_In2CheckBox
 
wxTextCtrl * m_In2Name
 
wxChoice * m_In2Choice
 
wxCheckBox * m_In3CheckBox
 
wxTextCtrl * m_In3Name
 
wxChoice * m_In3Choice
 
wxCheckBox * m_In4CheckBox
 
wxTextCtrl * m_In4Name
 
wxChoice * m_In4Choice
 
wxCheckBox * m_In5CheckBox
 
wxTextCtrl * m_In5Name
 
wxChoice * m_In5Choice
 
wxCheckBox * m_In6CheckBox
 
wxTextCtrl * m_In6Name
 
wxChoice * m_In6Choice
 
wxCheckBox * m_In7CheckBox
 
wxTextCtrl * m_In7Name
 
wxChoice * m_In7Choice
 
wxCheckBox * m_In8CheckBox
 
wxTextCtrl * m_In8Name
 
wxChoice * m_In8Choice
 
wxCheckBox * m_In9CheckBox
 
wxTextCtrl * m_In9Name
 
wxChoice * m_In9Choice
 
wxCheckBox * m_In10CheckBox
 
wxTextCtrl * m_In10Name
 
wxChoice * m_In10Choice
 
wxCheckBox * m_In11CheckBox
 
wxTextCtrl * m_In11Name
 
wxChoice * m_In11Choice
 
wxCheckBox * m_In12CheckBox
 
wxTextCtrl * m_In12Name
 
wxChoice * m_In12Choice
 
wxCheckBox * m_In13CheckBox
 
wxTextCtrl * m_In13Name
 
wxChoice * m_In13Choice
 
wxCheckBox * m_In14CheckBox
 
wxTextCtrl * m_In14Name
 
wxChoice * m_In14Choice
 
wxCheckBox * m_In15CheckBox
 
wxTextCtrl * m_In15Name
 
wxChoice * m_In15Choice
 
wxCheckBox * m_In16CheckBox
 
wxTextCtrl * m_In16Name
 
wxChoice * m_In16Choice
 
wxCheckBox * m_In17CheckBox
 
wxTextCtrl * m_In17Name
 
wxChoice * m_In17Choice
 
wxCheckBox * m_In18CheckBox
 
wxTextCtrl * m_In18Name
 
wxChoice * m_In18Choice
 
wxCheckBox * m_In19CheckBox
 
wxTextCtrl * m_In19Name
 
wxChoice * m_In19Choice
 
wxCheckBox * m_In20CheckBox
 
wxTextCtrl * m_In20Name
 
wxChoice * m_In20Choice
 
wxCheckBox * m_In21CheckBox
 
wxTextCtrl * m_In21Name
 
wxChoice * m_In21Choice
 
wxCheckBox * m_In22CheckBox
 
wxTextCtrl * m_In22Name
 
wxChoice * m_In22Choice
 
wxCheckBox * m_In23CheckBox
 
wxTextCtrl * m_In23Name
 
wxChoice * m_In23Choice
 
wxCheckBox * m_In24CheckBox
 
wxTextCtrl * m_In24Name
 
wxChoice * m_In24Choice
 
wxCheckBox * m_In25CheckBox
 
wxTextCtrl * m_In25Name
 
wxChoice * m_In25Choice
 
wxCheckBox * m_In26CheckBox
 
wxTextCtrl * m_In26Name
 
wxChoice * m_In26Choice
 
wxCheckBox * m_In27CheckBox
 
wxTextCtrl * m_In27Name
 
wxChoice * m_In27Choice
 
wxCheckBox * m_In28CheckBox
 
wxTextCtrl * m_In28Name
 
wxChoice * m_In28Choice
 
wxCheckBox * m_In29CheckBox
 
wxTextCtrl * m_In29Name
 
wxChoice * m_In29Choice
 
wxCheckBox * m_In30CheckBox
 
wxTextCtrl * m_In30Name
 
wxChoice * m_In30Choice
 
wxCheckBox * m_BackCheckBox
 
wxTextCtrl * m_BackName
 
wxChoice * m_BackChoice
 
wxCheckBox * m_MaskBackCheckBox
 
wxStaticText * m_MaskBackName
 
wxStaticText * m_MaskBackStaticText
 
wxCheckBox * m_SilkSBackCheckBox
 
wxStaticText * m_SilkSBackName
 
wxStaticText * m_SilkSBackStaticText
 
wxCheckBox * m_SoldPBackCheckBox
 
wxStaticText * m_SoldPBackName
 
wxStaticText * m_SoldPBackStaticText
 
wxCheckBox * m_AdhesBackCheckBox
 
wxStaticText * m_AdhesBackName
 
wxStaticText * m_AdhesBackStaticText
 
wxCheckBox * m_FabBackCheckBox
 
wxStaticText * m_FabBackName
 
wxStaticText * m_FabBackStaticText
 
wxCheckBox * m_CrtYdBackCheckBox
 
wxStaticText * m_CrtYdBackName
 
wxStaticText * m_CrtYdBackStaticText
 
wxCheckBox * m_PCBEdgesCheckBox
 
wxStaticText * m_PCBEdgesName
 
wxStaticText * m_PCBEdgesStaticText
 
wxCheckBox * m_MarginCheckBox
 
wxStaticText * m_MarginName
 
wxStaticText * m_MarginStaticText
 
wxCheckBox * m_Eco1CheckBox
 
wxStaticText * m_Eco1Name
 
wxStaticText * m_Eco1StaticText
 
wxCheckBox * m_Eco2CheckBox
 
wxStaticText * m_Eco2Name
 
wxStaticText * m_Eco2StaticText
 
wxCheckBox * m_CommentsCheckBox
 
wxStaticText * m_CommentsName
 
wxStaticText * m_CommentsStaticText
 
wxCheckBox * m_DrawingsCheckBox
 
wxStaticText * m_DrawingsName
 
wxStaticText * m_DrawingsStaticText
 

Private Member Functions

void setLayerCheckBox (LAYER_NUM layer, bool isChecked)
 
void setCopperLayerCheckBoxes (int copperCount)
 
void setMandatoryLayerCheckBoxes ()
 
void showCopperChoice (int copperCount)
 
void showBoardLayerNames ()
 
void showSelectedLayerCheckBoxes (LSET enableLayerMask)
 
void showLayerTypes ()
 
void showPresets (LSET enabledLayerMask)
 
LSET getUILayerMask ()
 Return the selected layer mask within the UI checkboxes. More...
 
wxString getLayerName (LAYER_NUM layer)
 
int getLayerTypeIndex (LAYER_NUM layer)
 
void OnCheckBox (wxCommandEvent &event) override
 
void DenyChangeCheckBox (wxCommandEvent &event) override
 
void OnPresetsChoice (wxCommandEvent &event) override
 
void OnCopperLayersChoice (wxCommandEvent &event) override
 
bool TransferDataToWindow () override
 
bool TransferDataFromWindow () override
 
bool testLayerNames ()
 
LSEQ getRemovedLayersWithItems ()
 Return a list of layers removed from the board that contain items. More...
 
LSEQ getNonRemovableLayers ()
 Return a list of layers in use in footprints, and therefore not removable. More...
 
PANEL_SETUP_LAYERS_CTLs getCTLs (LAYER_NUM aLayerNumber)
 
wxControl * getName (LAYER_NUM aLayer)
 
wxCheckBox * getCheckBox (LAYER_NUM aLayer)
 
wxChoice * getChoice (LAYER_NUM aLayer)
 

Private Attributes

PAGED_DIALOGm_Parent
 
PCB_EDIT_FRAMEm_frame
 
BOARDm_pcb
 
LSET m_enabledLayers
 
UNIT_BINDER m_pcbThickness
 

Detailed Description

Definition at line 55 of file panel_setup_layers.h.

Constructor & Destructor Documentation

PANEL_SETUP_LAYERS::PANEL_SETUP_LAYERS ( PAGED_DIALOG aParent,
PCB_EDIT_FRAME aFrame 
)

Definition at line 137 of file panel_setup_layers.cpp.

References PCB_BASE_FRAME::GetBoard(), PANEL_SETUP_LAYERS_BASE::m_LayersListPanel, and m_pcb.

137  :
138  PANEL_SETUP_LAYERS_BASE( aParent->GetTreebook() ),
139  m_Parent( aParent ), m_frame( aFrame ),
141  Millimeter2iu( 0.1 ), Millimeter2iu( 10.0 ) )
142 {
143  m_pcb = aFrame->GetBoard();
144 
145  m_LayersListPanel->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_LISTBOX) );
146 }
wxScrolledWindow * m_LayersListPanel
BOARD * GetBoard() const
UNIT_BINDER m_pcbThickness
PAGED_DIALOG * m_Parent
wxTreebook * GetTreebook()
Definition: paged_dialog.h:43
PANEL_SETUP_LAYERS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(585, 545), long style=wxTAB_TRAVERSAL)
PCB_EDIT_FRAME * m_frame

Member Function Documentation

void PANEL_SETUP_LAYERS::DenyChangeCheckBox ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PANEL_SETUP_LAYERS_BASE.

Definition at line 418 of file panel_setup_layers.cpp.

References LSET::AllCuMask(), B_CrtYd, DisplayError(), Edge_Cuts, F_CrtYd, getCheckBox(), getLayerName(), PANEL_SETUP_LAYERS_BASE::m_staticTextCopperLayers, and Margin.

419 {
420  wxObject* source = event.GetEventObject();
421  wxString msg;
422 
423  for( LSEQ seq = LSET::AllCuMask().Seq(); seq; ++seq )
424  {
425  wxCheckBox* copper = getCheckBox( *seq );
426 
427  if( source == copper )
428  {
429  wxString controlLabel = m_staticTextCopperLayers->GetLabel();
430  // knock the ':' off the end
431  controlLabel = controlLabel.substr( 0, controlLabel.size() - 1 );
432 
433  msg.Printf( _( "Use the \"%s\" control to change the number of copper layers." ),
434  controlLabel );
435  DisplayError( this, msg );
436 
437  copper->SetValue( true );
438  return;
439  }
440  }
441 
442  for( int layer : { F_CrtYd, B_CrtYd, Edge_Cuts, Margin } )
443  {
444  wxCheckBox* mandatory = getCheckBox( layer );
445 
446  if( source == mandatory )
447  {
448  msg.Printf( _( "The %s layer is mandatory." ), getLayerName( layer ) );
449  DisplayError( this, msg );
450  mandatory->SetValue( true );
451  return;
452  }
453  }
454 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:673
wxCheckBox * getCheckBox(LAYER_NUM aLayer)
Class LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
wxString getLayerName(LAYER_NUM layer)
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:245
wxCheckBox * PANEL_SETUP_LAYERS::getCheckBox ( LAYER_NUM  aLayer)
private

Definition at line 223 of file panel_setup_layers.cpp.

References PANEL_SETUP_LAYERS_CTLs::checkbox, and getCTLs().

Referenced by DenyChangeCheckBox(), and getUILayerMask().

224 {
225  return getCTLs( aLayer ).checkbox;
226 }
PANEL_SETUP_LAYERS_CTLs getCTLs(LAYER_NUM aLayerNumber)
wxChoice * PANEL_SETUP_LAYERS::getChoice ( LAYER_NUM  aLayer)
private

Definition at line 229 of file panel_setup_layers.cpp.

References PANEL_SETUP_LAYERS_CTLs::choice, and getCTLs().

Referenced by getLayerTypeIndex(), and showLayerTypes().

230 {
231  return (wxChoice*) getCTLs( aLayer ).choice;
232 }
PANEL_SETUP_LAYERS_CTLs getCTLs(LAYER_NUM aLayerNumber)
PANEL_SETUP_LAYERS_CTLs PANEL_SETUP_LAYERS::getCTLs ( LAYER_NUM  aLayerNumber)
private

Definition at line 149 of file panel_setup_layers.cpp.

References B_Adhes, B_CrtYd, B_Cu, B_Fab, B_Mask, B_Paste, B_SilkS, Cmts_User, Dwgs_User, Eco1_User, Eco2_User, Edge_Cuts, F_Adhes, F_CrtYd, F_Cu, F_Fab, F_Mask, F_Paste, F_SilkS, In10_Cu, In11_Cu, In12_Cu, In13_Cu, In14_Cu, In15_Cu, In16_Cu, In17_Cu, In18_Cu, In19_Cu, In1_Cu, In20_Cu, In21_Cu, In22_Cu, In23_Cu, In24_Cu, In25_Cu, In26_Cu, In27_Cu, In28_Cu, In29_Cu, In2_Cu, In30_Cu, In3_Cu, In4_Cu, In5_Cu, In6_Cu, In7_Cu, In8_Cu, In9_Cu, Margin, RETURN_AUX, and RETURN_COPPER.

Referenced by getCheckBox(), getChoice(), getName(), setCopperLayerCheckBoxes(), and setLayerCheckBox().

150 {
151 #define RETURN_COPPER(x) return PANEL_SETUP_LAYERS_CTLs( x##Name, x##CheckBox, x##Choice )
152 #define RETURN_AUX(x) return PANEL_SETUP_LAYERS_CTLs( x##Name, x##CheckBox, x##StaticText )
153 
154  switch( aLayerNumber )
155  {
156  case F_CrtYd: RETURN_AUX( m_CrtYdFront );
157  case F_Fab: RETURN_AUX( m_FabFront );
158  case F_Adhes: RETURN_AUX( m_AdhesFront );
159  case F_Paste: RETURN_AUX( m_SoldPFront );
160  case F_SilkS: RETURN_AUX( m_SilkSFront );
161  case F_Mask: RETURN_AUX( m_MaskFront );
162  case F_Cu: RETURN_COPPER( m_Front );
163 
164  case In1_Cu: RETURN_COPPER( m_In1 );
165  case In2_Cu: RETURN_COPPER( m_In2 );
166  case In3_Cu: RETURN_COPPER( m_In3 );
167  case In4_Cu: RETURN_COPPER( m_In4 );
168  case In5_Cu: RETURN_COPPER( m_In5 );
169  case In6_Cu: RETURN_COPPER( m_In6 );
170  case In7_Cu: RETURN_COPPER( m_In7 );
171  case In8_Cu: RETURN_COPPER( m_In8 );
172  case In9_Cu: RETURN_COPPER( m_In9 );
173  case In10_Cu: RETURN_COPPER( m_In10 );
174  case In11_Cu: RETURN_COPPER( m_In11 );
175  case In12_Cu: RETURN_COPPER( m_In12 );
176  case In13_Cu: RETURN_COPPER( m_In13 );
177  case In14_Cu: RETURN_COPPER( m_In14 );
178  case In15_Cu: RETURN_COPPER( m_In15 );
179 
180  case In16_Cu: RETURN_COPPER( m_In16 );
181  case In17_Cu: RETURN_COPPER( m_In17 );
182  case In18_Cu: RETURN_COPPER( m_In18 );
183  case In19_Cu: RETURN_COPPER( m_In19 );
184  case In20_Cu: RETURN_COPPER( m_In20 );
185  case In21_Cu: RETURN_COPPER( m_In21 );
186  case In22_Cu: RETURN_COPPER( m_In22 );
187  case In23_Cu: RETURN_COPPER( m_In23 );
188  case In24_Cu: RETURN_COPPER( m_In24 );
189  case In25_Cu: RETURN_COPPER( m_In25 );
190  case In26_Cu: RETURN_COPPER( m_In26 );
191  case In27_Cu: RETURN_COPPER( m_In27 );
192  case In28_Cu: RETURN_COPPER( m_In28 );
193  case In29_Cu: RETURN_COPPER( m_In29 );
194  case In30_Cu: RETURN_COPPER( m_In30 );
195 
196  case B_Cu: RETURN_COPPER( m_Back );
197  case B_Mask: RETURN_AUX( m_MaskBack );
198  case B_SilkS: RETURN_AUX( m_SilkSBack );
199  case B_Paste: RETURN_AUX( m_SoldPBack );
200  case B_Adhes: RETURN_AUX( m_AdhesBack );
201  case B_Fab: RETURN_AUX( m_FabBack );
202  case B_CrtYd: RETURN_AUX( m_CrtYdBack );
203 
204  case Edge_Cuts: RETURN_AUX( m_PCBEdges );
205  case Margin: RETURN_AUX( m_Margin );
206  case Eco2_User: RETURN_AUX( m_Eco2 );
207  case Eco1_User: RETURN_AUX( m_Eco1 );
208  case Cmts_User: RETURN_AUX( m_Comments );
209  case Dwgs_User: RETURN_AUX( m_Drawings );
210  default:
211  wxASSERT_MSG( 0, wxT( "bad layer id" ) );
212  return PANEL_SETUP_LAYERS_CTLs( nullptr, nullptr, nullptr );
213  }
214 }
#define RETURN_COPPER(x)
Holds the 3 UI control pointers for a single board layer.
#define RETURN_AUX(x)
wxString PANEL_SETUP_LAYERS::getLayerName ( LAYER_NUM  layer)
private

Definition at line 600 of file panel_setup_layers.cpp.

References getName().

Referenced by DenyChangeCheckBox(), testLayerNames(), and TransferDataFromWindow().

601 {
602  wxControl* control = getName( aLayer );
603 
604  if( dynamic_cast<wxTextCtrl*>( control ) )
605  return dynamic_cast<wxTextCtrl*>( control )->GetValue().Trim();
606  else
607  return dynamic_cast<wxStaticText*>( control )->GetLabel();
608 }
wxControl * getName(LAYER_NUM aLayer)
int PANEL_SETUP_LAYERS::getLayerTypeIndex ( LAYER_NUM  layer)
private

Definition at line 592 of file panel_setup_layers.cpp.

References getChoice().

Referenced by TransferDataFromWindow().

593 {
594  wxChoice* ctl = getChoice( aLayer );
595  int ret = ctl->GetCurrentSelection(); // indices must have same sequence as LAYER_T
596  return ret;
597 }
wxChoice * getChoice(LAYER_NUM aLayer)
wxControl * PANEL_SETUP_LAYERS::getName ( LAYER_NUM  aLayer)
private

Definition at line 217 of file panel_setup_layers.cpp.

References getCTLs(), and PANEL_SETUP_LAYERS_CTLs::name.

Referenced by getLayerName(), showBoardLayerNames(), and testLayerNames().

218 {
219  return getCTLs( aLayer ).name;
220 }
PANEL_SETUP_LAYERS_CTLs getCTLs(LAYER_NUM aLayerNumber)
LSEQ PANEL_SETUP_LAYERS::getNonRemovableLayers ( )
private

Return a list of layers in use in footprints, and therefore not removable.

Definition at line 715 of file panel_setup_layers.cpp.

References PCB_LAYER_COLLECTOR::Collect(), COLLECTOR::GetCount(), BOARD::GetEnabledLayers(), getUILayerMask(), IsCopperLayer(), m_pcb, GENERAL_COLLECTOR::ModuleItems, LSET::Seq(), and PCB_LAYER_COLLECTOR::SetLayerId().

Referenced by TransferDataFromWindow().

716 {
717  //Build the list of non copper layers in use in footprints.
718  LSEQ inUseLayers;
719  LSET newLayers = getUILayerMask();
720  LSET curLayers = m_pcb->GetEnabledLayers();
721 
722  if( newLayers == curLayers ) // return a empty list if no change
723  return inUseLayers;
724 
725  PCB_LAYER_COLLECTOR collector;
726  LSEQ newLayerSeq = newLayers.Seq();
727 
728  for( auto layer_id : curLayers.Seq() )
729  {
730  if( IsCopperLayer( layer_id ) ) // Copper layers are not taken in account here
731  continue;
732 
733  if( std::find( newLayerSeq.begin(), newLayerSeq.end(), layer_id ) == newLayerSeq.end() )
734  {
735  collector.SetLayerId( layer_id );
737 
738  if( collector.GetCount() != 0 )
739  inUseLayers.push_back( layer_id );
740  }
741  }
742 
743  return inUseLayers;
744 }
int GetCount() const
Function GetCount returns the number of objects in the list.
Definition: collector.h:114
LSET getUILayerMask()
Return the selected layer mask within the UI checkboxes.
void Collect(BOARD_ITEM *aBoard, const KICAD_T aScanList[])
Tests a BOARD_ITEM using this class&#39;s Inspector method, which does the collection.
Definition: collectors.cpp:532
Collect all BOARD_ITEM objects on a given layer.
Definition: collectors.h:642
LSET GetEnabledLayers() const
Function GetEnabledLayers is a proxy function that calls the corresponding function in m_BoardSetting...
void SetLayerId(PCB_LAYER_ID aLayerId)
Definition: collectors.h:652
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Function Seq returns an LSEQ from the union of this LSET and a desired sequence.
Definition: lset.cpp:364
Class LSET is a set of PCB_LAYER_IDs.
Class LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
static const KICAD_T ModuleItems[]
A scan list for primary module items.
Definition: collectors.h:310
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.
LSEQ PANEL_SETUP_LAYERS::getRemovedLayersWithItems ( )
private

Return a list of layers removed from the board that contain items.

Definition at line 687 of file panel_setup_layers.cpp.

References GENERAL_COLLECTOR::BoardLevelItems, PCB_LAYER_COLLECTOR::Collect(), COLLECTOR::GetCount(), BOARD::GetEnabledLayers(), getUILayerMask(), m_pcb, LSET::Seq(), and PCB_LAYER_COLLECTOR::SetLayerId().

Referenced by TransferDataFromWindow().

688 {
689  LSEQ removedLayers;
690  LSET newLayers = getUILayerMask();
691  LSET curLayers = m_pcb->GetEnabledLayers();
692 
693  if( newLayers == curLayers ) // return a empty list if no change
694  return removedLayers;
695 
696  PCB_LAYER_COLLECTOR collector;
697  LSEQ newLayerSeq = newLayers.Seq();
698 
699  for( auto layer_id : curLayers.Seq() )
700  {
701  if( std::find( newLayerSeq.begin(), newLayerSeq.end(), layer_id ) == newLayerSeq.end() )
702  {
703  collector.SetLayerId( layer_id );
705 
706  if( collector.GetCount() != 0 )
707  removedLayers.push_back( layer_id );
708  }
709  }
710 
711  return removedLayers;
712 }
int GetCount() const
Function GetCount returns the number of objects in the list.
Definition: collector.h:114
static const KICAD_T BoardLevelItems[]
A scan list for all primary board items, omitting items which are subordinate to a MODULE...
Definition: collectors.h:285
LSET getUILayerMask()
Return the selected layer mask within the UI checkboxes.
void Collect(BOARD_ITEM *aBoard, const KICAD_T aScanList[])
Tests a BOARD_ITEM using this class&#39;s Inspector method, which does the collection.
Definition: collectors.cpp:532
Collect all BOARD_ITEM objects on a given layer.
Definition: collectors.h:642
LSET GetEnabledLayers() const
Function GetEnabledLayers is a proxy function that calls the corresponding function in m_BoardSetting...
void SetLayerId(PCB_LAYER_ID aLayerId)
Definition: collectors.h:652
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Function Seq returns an LSEQ from the union of this LSET and a desired sequence.
Definition: lset.cpp:364
Class LSET is a set of PCB_LAYER_IDs.
Class LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
LSET PANEL_SETUP_LAYERS::getUILayerMask ( )
private

Return the selected layer mask within the UI checkboxes.

Definition at line 344 of file panel_setup_layers.cpp.

References dlg_layers(), and getCheckBox().

Referenced by getNonRemovableLayers(), getRemovedLayersWithItems(), OnCheckBox(), OnCopperLayersChoice(), and TransferDataFromWindow().

345 {
346  LSET layerMaskResult;
347 
348  for( LSEQ seq = dlg_layers(); seq; ++seq )
349  {
350  PCB_LAYER_ID layer = *seq;
351  wxCheckBox* ctl = getCheckBox( layer );
352 
353  if( ctl->GetValue() )
354  layerMaskResult.set( layer );
355  }
356 
357  return layerMaskResult;
358 }
wxCheckBox * getCheckBox(LAYER_NUM aLayer)
PCB_LAYER_ID
A quick note on layer IDs:
Class LSET is a set of PCB_LAYER_IDs.
Class LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
static LSEQ dlg_layers()
void PANEL_SETUP_LAYERS::ImportSettingsFrom ( BOARD aBoard)

Definition at line 747 of file panel_setup_layers.cpp.

References m_pcb, and TransferDataToWindow().

Referenced by DIALOG_BOARD_SETUP::OnAuxiliaryAction().

748 {
749  BOARD* savedBoard = m_pcb;
750 
751  m_pcb = aBoard;
753 
754  m_pcb = savedBoard;
755 }
bool TransferDataToWindow() override
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:170
void PANEL_SETUP_LAYERS::OnCheckBox ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PANEL_SETUP_LAYERS_BASE.

Definition at line 410 of file panel_setup_layers.cpp.

References getUILayerMask(), m_enabledLayers, and showPresets().

411 {
413 
415 }
LSET getUILayerMask()
Return the selected layer mask within the UI checkboxes.
void showPresets(LSET enabledLayerMask)
void PANEL_SETUP_LAYERS::OnCopperLayersChoice ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PANEL_SETUP_LAYERS_BASE.

Definition at line 480 of file panel_setup_layers.cpp.

References getUILayerMask(), PANEL_SETUP_LAYERS_BASE::m_CopperLayersChoice, m_enabledLayers, setCopperLayerCheckBoxes(), and showPresets().

481 {
482  setCopperLayerCheckBoxes( m_CopperLayersChoice->GetCurrentSelection() * 2 + 2 );
484  showPresets( m_enabledLayers );
485 }
LSET getUILayerMask()
Return the selected layer mask within the UI checkboxes.
void setCopperLayerCheckBoxes(int copperCount)
void showPresets(LSET enabledLayerMask)
void PANEL_SETUP_LAYERS::OnPresetsChoice ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PANEL_SETUP_LAYERS_BASE.

Definition at line 457 of file panel_setup_layers.cpp.

References LSET::AllCuMask(), DIM, m_enabledLayers, PANEL_SETUP_LAYERS_BASE::m_PresetsChoice, setCopperLayerCheckBoxes(), setMandatoryLayerCheckBoxes(), showCopperChoice(), and showSelectedLayerCheckBoxes().

458 {
459  int presetNdx = m_PresetsChoice->GetCurrentSelection();
460 
461  if( presetNdx <= 0 ) // the Custom setting controls nothing.
462  return;
463 
464  if( presetNdx < (int) DIM(presets) )
465  {
466  m_enabledLayers = presets[ presetNdx ];
467  LSET copperSet = m_enabledLayers & LSET::AllCuMask();
468  int copperCount = copperSet.count();
469 
470  showCopperChoice( copperCount );
472  setCopperLayerCheckBoxes( copperCount );
473  }
474 
475  // Ensure mandatory layers are activated
477 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:673
#define DIM(x)
of elements in an array
Definition: macros.h:98
void showCopperChoice(int copperCount)
void setCopperLayerCheckBoxes(int copperCount)
Class LSET is a set of PCB_LAYER_IDs.
static const LSET presets[]
void showSelectedLayerCheckBoxes(LSET enableLayerMask)
void PANEL_SETUP_LAYERS::setCopperLayerCheckBoxes ( int  copperCount)
private

Definition at line 369 of file panel_setup_layers.cpp.

References B_Cu, PANEL_SETUP_LAYERS_CTLs::checkbox, PANEL_SETUP_LAYERS_CTLs::choice, F_Cu, getCTLs(), LSET::InternalCuMask(), PANEL_SETUP_LAYERS_BASE::m_LayersListPanel, PANEL_SETUP_LAYERS_CTLs::name, and setLayerCheckBox().

Referenced by OnCopperLayersChoice(), OnPresetsChoice(), and TransferDataToWindow().

370 {
371  if( copperCount > 0 )
372  {
373  setLayerCheckBox( F_Cu, true );
374  --copperCount;
375  }
376 
377  if( copperCount > 0 )
378  {
379  setLayerCheckBox( B_Cu, true );
380  --copperCount;
381  }
382 
383  for( LSEQ seq = LSET::InternalCuMask().Seq(); seq; ++seq, --copperCount )
384  {
385  PCB_LAYER_ID layer = *seq;
386  bool state = copperCount > 0;
387 
388 #ifdef HIDE_INACTIVE_LAYERS
389  // This code hides non-active copper layers, or redisplays hidden
390  // layers which are now needed.
391  PANEL_SETUP_LAYERS_CTLs ctl = getCTLs( layer );
392 
393  ctl.name->Show( state );
394  ctl.checkbox->Show( state );
395  ctl.choice->Show( state );
396 #endif
397 
398  setLayerCheckBox( layer, state );
399  }
400 
401 #ifdef HIDE_INACTIVE_LAYERS
402  // Send an size event to force sizers to be updated,
403  // because the number of copper layers can have changed.
404  wxSizeEvent evt_size( m_LayersListPanel->GetSize() );
405  m_LayersListPanel->GetEventHandler()->ProcessEvent( evt_size );
406 #endif
407 }
wxScrolledWindow * m_LayersListPanel
PCB_LAYER_ID
A quick note on layer IDs:
static LSET InternalCuMask()
Function InternalCuMask() returns a complete set of internal copper layers, which is all Cu layers ex...
Definition: lset.cpp:633
Class LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
PANEL_SETUP_LAYERS_CTLs getCTLs(LAYER_NUM aLayerNumber)
void setLayerCheckBox(LAYER_NUM layer, bool isChecked)
Holds the 3 UI control pointers for a single board layer.
void PANEL_SETUP_LAYERS::setLayerCheckBox ( LAYER_NUM  layer,
bool  isChecked 
)
private

Definition at line 361 of file panel_setup_layers.cpp.

References PANEL_SETUP_LAYERS_CTLs::checkbox, and getCTLs().

Referenced by setCopperLayerCheckBoxes(), setMandatoryLayerCheckBoxes(), and showSelectedLayerCheckBoxes().

362 {
363  PANEL_SETUP_LAYERS_CTLs ctl = getCTLs( aLayer );
364 
365  ctl.checkbox->SetValue( isChecked );
366 }
PANEL_SETUP_LAYERS_CTLs getCTLs(LAYER_NUM aLayerNumber)
Holds the 3 UI control pointers for a single board layer.
void PANEL_SETUP_LAYERS::setMandatoryLayerCheckBoxes ( )
private

Definition at line 253 of file panel_setup_layers.cpp.

References B_CrtYd, Edge_Cuts, F_CrtYd, Margin, and setLayerCheckBox().

Referenced by OnPresetsChoice(), and TransferDataToWindow().

254 {
255  for( int layer : { F_CrtYd, B_CrtYd, Edge_Cuts, Margin } )
256  setLayerCheckBox( layer, true );
257 }
void setLayerCheckBox(LAYER_NUM layer, bool isChecked)
void PANEL_SETUP_LAYERS::showBoardLayerNames ( )
private

Definition at line 281 of file panel_setup_layers.cpp.

References dlg_layers(), BOARD::GetLayerName(), getName(), and m_pcb.

Referenced by TransferDataToWindow().

282 {
283  // Set all the board's layer names into the dialog by calling BOARD::GetLayerName(),
284  // which will call BOARD::GetStandardLayerName() for non-coppers.
285 
286  for( LSEQ seq = dlg_layers(); seq; ++seq )
287  {
288  PCB_LAYER_ID layer = *seq;
289  wxControl* ctl = getName( layer );
290 
291  if( ctl )
292  {
293  wxString lname = m_pcb->GetLayerName( layer );
294 
295  if( dynamic_cast<wxTextCtrl*>( ctl ) )
296  dynamic_cast<wxTextCtrl*>( ctl )->SetValue( lname ); // wxTextCtrl
297  else
298  ctl->SetLabel( lname ); // wxStaticText
299  }
300  }
301 }
PCB_LAYER_ID
A quick note on layer IDs:
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Function GetLayerName returns the name of a layer given by aLayer.
Class LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
wxControl * getName(LAYER_NUM aLayer)
static LSEQ dlg_layers()
void PANEL_SETUP_LAYERS::showCopperChoice ( int  copperCount)
private

Definition at line 260 of file panel_setup_layers.cpp.

References PANEL_SETUP_LAYERS_BASE::m_CopperLayersChoice, and MAX_CU_LAYERS.

Referenced by OnPresetsChoice(), and TransferDataToWindow().

261 {
262  if( copperCount > MAX_CU_LAYERS )
263  copperCount = MAX_CU_LAYERS;
264 
265  if( copperCount < 2 )
266  copperCount = 2;
267 
268  for( int lyrCnt = 2; lyrCnt <= MAX_CU_LAYERS; lyrCnt += 2 )
269  {
270  // note this will change a one layer board to 2:
271  if( copperCount <= lyrCnt )
272  {
273  int idx = lyrCnt/2 - 1;
274  m_CopperLayersChoice->SetSelection(idx);
275  break;
276  }
277  }
278 }
void PANEL_SETUP_LAYERS::showLayerTypes ( )
private

Definition at line 332 of file panel_setup_layers.cpp.

References LSET::AllCuMask(), getChoice(), BOARD::GetLayerType(), and m_pcb.

Referenced by TransferDataToWindow().

333 {
334  for( LSEQ seq = LSET::AllCuMask().Seq(); seq; ++seq )
335  {
336  PCB_LAYER_ID cu_layer = *seq;
337 
338  wxChoice* ctl = getChoice( cu_layer );
339  ctl->SetSelection( m_pcb->GetLayerType( cu_layer ) );
340  }
341 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:673
wxChoice * getChoice(LAYER_NUM aLayer)
PCB_LAYER_ID
A quick note on layer IDs:
Class LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
LAYER_T GetLayerType(PCB_LAYER_ID aLayer) const
Function GetLayerType returns the type of the copper layer given by aLayer.
void PANEL_SETUP_LAYERS::showPresets ( LSET  enabledLayerMask)
private

Definition at line 315 of file panel_setup_layers.cpp.

References DIM, i, and PANEL_SETUP_LAYERS_BASE::m_PresetsChoice.

Referenced by OnCheckBox(), OnCopperLayersChoice(), and TransferDataToWindow().

316 {
317  int presetsNdx = 0; // the "Custom" setting, matches nothing
318 
319  for( unsigned i=1; i<DIM( presets ); ++i )
320  {
321  if( enabledLayers == presets[i] )
322  {
323  presetsNdx = i;
324  break;
325  }
326  }
327 
328  m_PresetsChoice->SetSelection( presetsNdx );
329 }
#define DIM(x)
of elements in an array
Definition: macros.h:98
static const LSET presets[]
size_t i
Definition: json11.cpp:597
void PANEL_SETUP_LAYERS::showSelectedLayerCheckBoxes ( LSET  enableLayerMask)
private

Definition at line 304 of file panel_setup_layers.cpp.

References dlg_layers(), and setLayerCheckBox().

Referenced by OnPresetsChoice(), and TransferDataToWindow().

305 {
306  // the check boxes
307  for( LSEQ seq = dlg_layers(); seq; ++seq )
308  {
309  PCB_LAYER_ID layer = *seq;
310  setLayerCheckBox( layer, enabledLayers[layer] );
311  }
312 }
PCB_LAYER_ID
A quick note on layer IDs:
Class LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
void setLayerCheckBox(LAYER_NUM layer, bool isChecked)
static LSEQ dlg_layers()
bool PANEL_SETUP_LAYERS::testLayerNames ( )
private

Definition at line 623 of file panel_setup_layers.cpp.

References LSET::AllCuMask(), Format(), getLayerName(), getName(), hasOneOf(), m_enabledLayers, m_Parent, name, and PAGED_DIALOG::SetError().

Referenced by TransferDataFromWindow().

624 {
625  std::vector<wxString> names;
626  wxTextCtrl* ctl;
627 
628  for( LSEQ seq = LSET::AllCuMask().Seq(); seq; ++seq )
629  {
630  PCB_LAYER_ID layer = *seq;
631 
632  // we _can_ rely on m_enabledLayers being current here:
633  if( !m_enabledLayers[layer] )
634  continue;
635 
636  wxString name = getLayerName( layer );
637 
638  ctl = (wxTextCtrl*) getName( layer );
639 
640  // check name for legality.
641  // 1) cannot be blank.
642  // 2) cannot have blanks.
643  // 3) cannot have " chars
644  // 4) cannot be 'signal'
645  // 5) must be unique.
646  // 6) cannot have illegal chars in filenames ( some filenames are built from layer names )
647  // like : % $ \ " / :
648  wxString badchars = wxFileName::GetForbiddenChars( wxPATH_DOS );
649  badchars.Append( '%' );
650 
651  if( !name )
652  {
653  m_Parent->SetError( _( "Layer must have a name." ), this, ctl );
654  return false;
655  }
656 
657  if( hasOneOf( name, badchars ) )
658  {
659  auto msg = wxString::Format(_( "\"%s\" are forbidden in layer names." ), badchars );
660  m_Parent->SetError( msg, this, ctl );
661  return false;
662  }
663 
664  if( name == wxT( "signal" ) )
665  {
666  m_Parent->SetError( _( "Layer name \"signal\" is reserved." ), this, ctl );
667  return false;
668  }
669 
670  for( const wxString& existingName : names )
671  {
672  if( name == existingName )
673  {
674  auto msg = wxString::Format(_( "Layer name \"%s\" is already in use." ), name );
675  m_Parent->SetError( msg, this, ctl );
676  return false;
677  }
678  }
679 
680  names.push_back( name );
681  }
682 
683  return true;
684 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:673
static bool hasOneOf(const wxString &str, const wxString &chars)
PAGED_DIALOG * m_Parent
PCB_LAYER_ID
A quick note on layer IDs:
void SetError(const wxString &aMessage, wxWindow *aPage, wxObject *aCtrl, int aRow=-1, int aCol=-1)
Class LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
const char * name
Definition: DXF_plotter.cpp:61
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
wxString getLayerName(LAYER_NUM layer)
wxControl * getName(LAYER_NUM aLayer)
bool PANEL_SETUP_LAYERS::TransferDataFromWindow ( )
overrideprivate

Definition at line 488 of file panel_setup_layers.cpp.

References LSET::AllCuMask(), GENERAL_COLLECTOR::BoardLevelItems, BOARD::BuildConnectivity(), PCB_LAYER_COLLECTOR::Collect(), PCB_BASE_FRAME::Compile_Ratsnest(), Format(), COLLECTOR::GetCount(), BOARD::GetDesignSettings(), BOARD::GetEnabledLayers(), getLayerName(), BOARD::GetLayerName(), getLayerTypeIndex(), getNonRemovableLayers(), getRemovedLayersWithItems(), getUILayerMask(), UNIT_BINDER::GetValue(), i, IsOK(), m_enabledLayers, m_frame, m_pcb, m_pcbThickness, BOARD::Remove(), BOARD_DESIGN_SETTINGS::SetBoardThickness(), BOARD::SetEnabledLayers(), PCB_LAYER_COLLECTOR::SetLayerId(), BOARD::SetLayerName(), BOARD::SetLayerType(), BOARD::SetVisibleLayers(), testLayerNames(), and UNIT_BINDER::Validate().

489 {
490  if( !m_pcbThickness.Validate( true ) )
491  return false;
492 
493  if( !testLayerNames() )
494  return false;
495 
496  wxString msg;
497 
498  int thickness = m_pcbThickness.GetValue();
499 
500  // Check for removed layers with items which will get deleted from the board.
501  LSEQ removedLayers = getRemovedLayersWithItems();
502 
503  // Check for non copper layers in use in footprints, and therefore not removable.
504  LSEQ notremovableLayers = getNonRemovableLayers();
505 
506  if( !notremovableLayers.empty() )
507  {
508  for( unsigned int ii = 0; ii < notremovableLayers.size(); ii++ )
509  msg << m_pcb->GetLayerName( notremovableLayers[ii] ) << "\n";
510 
511  if( !IsOK( this, wxString::Format( _( "Footprints have some items on removed layers:\n"
512  "%s\n"
513  "These items will be no longer accessible\n"
514  "Do you wish to continue?" ), msg ) ) )
515  return false;
516  }
517 
518  if( !removedLayers.empty() &&
519  !IsOK( this, _( "Items have been found on removed layers. This operation will delete "
520  "all items from removed layers and cannot be undone. Do you wish to "
521  "continue?" ) ) )
522  return false;
523 
524  // Delete all objects on layers that have been removed. Leaving them in copper layers
525  // can (will?) result in DRC errors and it pollutes the board file with cruft.
526  bool hasRemovedBoardItems = false;
527 
528  if( !removedLayers.empty() )
529  {
530  PCB_LAYER_COLLECTOR collector;
531 
532  for( auto layer_id : removedLayers )
533  {
534  collector.SetLayerId( layer_id );
536 
537  // Bye-bye items on on removed layer.
538  if( collector.GetCount() != 0 )
539  {
540  hasRemovedBoardItems = true;
541 
542  for( int i = 0; i < collector.GetCount(); i++ )
543  {
544  BOARD_ITEM* item = collector[i];
545  m_pcb->Remove( item );
546  delete item;
547  }
548  }
549  }
550  }
551 
553 
555  {
557 
558  /* Ensure enabled layers are also visible
559  * This is mainly to avoid mistakes if some enabled
560  * layers are not visible when exiting this dialog
561  */
563  }
564 
565  for( LSEQ seq = LSET::AllCuMask().Seq(); seq; ++seq )
566  {
567  PCB_LAYER_ID layer = *seq;
568 
569  if( m_enabledLayers[layer] )
570  {
571  m_pcb->SetLayerName( layer, getLayerName( layer ) );
572  LAYER_T t = (LAYER_T) getLayerTypeIndex( layer );
573  m_pcb->SetLayerType( layer, t );
574  }
575  }
576 
577  m_pcb->GetDesignSettings().SetBoardThickness( thickness );
578 
579  // If some board items are deleted: rebuild the connectivity,
580  // because it is likely some tracks and vias where removed
581  if( hasRemovedBoardItems )
582  {
583  // Rebuild list of nets (full ratsnest rebuild)
584  m_frame->Compile_Ratsnest( NULL, true );
586  }
587 
588  return true;
589 }
virtual bool Validate(bool setFocusOnError=false)
Function Validate Validates the control, informing the user of any errors found.
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:673
LSEQ getNonRemovableLayers()
Return a list of layers in use in footprints, and therefore not removable.
int GetCount() const
Function GetCount returns the number of objects in the list.
Definition: collector.h:114
static const KICAD_T BoardLevelItems[]
A scan list for all primary board items, omitting items which are subordinate to a MODULE...
Definition: collectors.h:285
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class...
LSET getUILayerMask()
Return the selected layer mask within the UI checkboxes.
void Collect(BOARD_ITEM *aBoard, const KICAD_T aScanList[])
Tests a BOARD_ITEM using this class&#39;s Inspector method, which does the collection.
Definition: collectors.cpp:532
UNIT_BINDER m_pcbThickness
Collect all BOARD_ITEM objects on a given layer.
Definition: collectors.h:642
bool SetLayerType(PCB_LAYER_ID aLayer, LAYER_T aLayerType)
Function SetLayerType changes the type of the layer given by aLayer.
void SetBoardThickness(int aThickness)
LSET GetEnabledLayers() const
Function GetEnabledLayers is a proxy function that calls the corresponding function in m_BoardSetting...
void SetLayerId(PCB_LAYER_ID aLayerId)
Definition: collectors.h:652
virtual int GetValue()
Function GetValue Returns the current value in Internal Units.
PCB_LAYER_ID
A quick note on layer IDs:
void SetVisibleLayers(LSET aLayerMask)
Function SetVisibleLayers is a proxy function that calls the correspondent function in m_BoardSetting...
LAYER_T
Enum LAYER_T gives the allowed types of layers, same as Specctra DSN spec.
Definition: class_board.h:72
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Function GetLayerName returns the name of a layer given by aLayer.
bool SetLayerName(PCB_LAYER_ID aLayer, const wxString &aLayerName)
Function SetLayerName changes the name of the layer given by aLayer.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:538
void BuildConnectivity()
Builds or rebuilds the board connectivity database for the board, especially the list of connected it...
Class LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
void Compile_Ratsnest(wxDC *aDC, bool aDisplayStatus)
Function Compile_Ratsnest Create the entire board ratsnest.
Definition: ratsnest.cpp:53
PCB_EDIT_FRAME * m_frame
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
wxString getLayerName(LAYER_NUM layer)
size_t i
Definition: json11.cpp:597
int getLayerTypeIndex(LAYER_NUM layer)
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Function IsOK displays a yes/no dialog with aMessage and returns the user response.
Definition: confirm.cpp:295
void SetEnabledLayers(LSET aLayerMask)
Function SetEnabledLayers is a proxy function that calls the correspondent function in m_BoardSetting...
void Remove(BOARD_ITEM *aBoardItem) override
Removes an item from the container.
LSEQ getRemovedLayersWithItems()
Return a list of layers removed from the board that contain items.
bool PANEL_SETUP_LAYERS::TransferDataToWindow ( )
overrideprivate

Definition at line 235 of file panel_setup_layers.cpp.

References BOARD_DESIGN_SETTINGS::GetBoardThickness(), BOARD::GetCopperLayerCount(), BOARD::GetDesignSettings(), BOARD::GetEnabledLayers(), m_enabledLayers, m_pcb, m_pcbThickness, setCopperLayerCheckBoxes(), setMandatoryLayerCheckBoxes(), UNIT_BINDER::SetValue(), showBoardLayerNames(), showCopperChoice(), showLayerTypes(), showPresets(), and showSelectedLayerCheckBoxes().

Referenced by ImportSettingsFrom().

236 {
238 
242 
246  showLayerTypes();
248 
249  return true;
250 }
void showCopperChoice(int copperCount)
int GetCopperLayerCount() const
Function GetCopperLayerCount.
UNIT_BINDER m_pcbThickness
LSET GetEnabledLayers() const
Function GetEnabledLayers is a proxy function that calls the corresponding function in m_BoardSetting...
void setCopperLayerCheckBoxes(int copperCount)
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:538
virtual void SetValue(int aValue)
Function SetValue Sets new value (in Internal Units) for the text field, taking care of units convers...
void showPresets(LSET enabledLayerMask)
void showSelectedLayerCheckBoxes(LSET enableLayerMask)

Member Data Documentation

wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_AdhesBackCheckBox
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_AdhesBackName
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_AdhesBackStaticText
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_AdhesFrontCheckBox
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_AdhesFrontName
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_AdhesFrontStaticText
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_BackCheckBox
protectedinherited
wxChoice* PANEL_SETUP_LAYERS_BASE::m_BackChoice
protectedinherited
wxTextCtrl* PANEL_SETUP_LAYERS_BASE::m_BackName
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_CommentsCheckBox
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_CommentsName
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_CommentsStaticText
protectedinherited
wxChoice* PANEL_SETUP_LAYERS_BASE::m_CopperLayersChoice
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_CrtYdBackCheckBox
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_CrtYdBackName
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_CrtYdBackStaticText
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_CrtYdFrontCheckBox
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_CrtYdFrontName
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_CrtYdFrontStaticText
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_DrawingsCheckBox
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_DrawingsName
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_DrawingsStaticText
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_Eco1CheckBox
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_Eco1Name
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_Eco1StaticText
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_Eco2CheckBox
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_Eco2Name
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_Eco2StaticText
protectedinherited
LSET PANEL_SETUP_LAYERS::m_enabledLayers
private
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_FabBackCheckBox
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_FabBackName
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_FabBackStaticText
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_FabFrontCheckBox
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_FabFrontName
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_FabFrontStaticText
protectedinherited
PCB_EDIT_FRAME* PANEL_SETUP_LAYERS::m_frame
private

Definition at line 64 of file panel_setup_layers.h.

Referenced by TransferDataFromWindow().

wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_FrontCheckBox
protectedinherited
wxChoice* PANEL_SETUP_LAYERS_BASE::m_FrontChoice
protectedinherited
wxTextCtrl* PANEL_SETUP_LAYERS_BASE::m_FrontName
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_In10CheckBox
protectedinherited
wxChoice* PANEL_SETUP_LAYERS_BASE::m_In10Choice
protectedinherited
wxTextCtrl* PANEL_SETUP_LAYERS_BASE::m_In10Name
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_In11CheckBox
protectedinherited
wxChoice* PANEL_SETUP_LAYERS_BASE::m_In11Choice
protectedinherited
wxTextCtrl* PANEL_SETUP_LAYERS_BASE::m_In11Name
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_In12CheckBox
protectedinherited
wxChoice* PANEL_SETUP_LAYERS_BASE::m_In12Choice
protectedinherited
wxTextCtrl* PANEL_SETUP_LAYERS_BASE::m_In12Name
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_In13CheckBox
protectedinherited
wxChoice* PANEL_SETUP_LAYERS_BASE::m_In13Choice
protectedinherited
wxTextCtrl* PANEL_SETUP_LAYERS_BASE::m_In13Name
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_In14CheckBox
protectedinherited
wxChoice* PANEL_SETUP_LAYERS_BASE::m_In14Choice
protectedinherited
wxTextCtrl* PANEL_SETUP_LAYERS_BASE::m_In14Name
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_In15CheckBox
protectedinherited
wxChoice* PANEL_SETUP_LAYERS_BASE::m_In15Choice
protectedinherited
wxTextCtrl* PANEL_SETUP_LAYERS_BASE::m_In15Name
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_In16CheckBox
protectedinherited
wxChoice* PANEL_SETUP_LAYERS_BASE::m_In16Choice
protectedinherited
wxTextCtrl* PANEL_SETUP_LAYERS_BASE::m_In16Name
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_In17CheckBox
protectedinherited
wxChoice* PANEL_SETUP_LAYERS_BASE::m_In17Choice
protectedinherited
wxTextCtrl* PANEL_SETUP_LAYERS_BASE::m_In17Name
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_In18CheckBox
protectedinherited
wxChoice* PANEL_SETUP_LAYERS_BASE::m_In18Choice
protectedinherited
wxTextCtrl* PANEL_SETUP_LAYERS_BASE::m_In18Name
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_In19CheckBox
protectedinherited
wxChoice* PANEL_SETUP_LAYERS_BASE::m_In19Choice
protectedinherited
wxTextCtrl* PANEL_SETUP_LAYERS_BASE::m_In19Name
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_In1CheckBox
protectedinherited
wxChoice* PANEL_SETUP_LAYERS_BASE::m_In1Choice
protectedinherited
wxTextCtrl* PANEL_SETUP_LAYERS_BASE::m_In1Name
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_In20CheckBox
protectedinherited
wxChoice* PANEL_SETUP_LAYERS_BASE::m_In20Choice
protectedinherited
wxTextCtrl* PANEL_SETUP_LAYERS_BASE::m_In20Name
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_In21CheckBox
protectedinherited
wxChoice* PANEL_SETUP_LAYERS_BASE::m_In21Choice
protectedinherited
wxTextCtrl* PANEL_SETUP_LAYERS_BASE::m_In21Name
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_In22CheckBox
protectedinherited
wxChoice* PANEL_SETUP_LAYERS_BASE::m_In22Choice
protectedinherited
wxTextCtrl* PANEL_SETUP_LAYERS_BASE::m_In22Name
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_In23CheckBox
protectedinherited
wxChoice* PANEL_SETUP_LAYERS_BASE::m_In23Choice
protectedinherited
wxTextCtrl* PANEL_SETUP_LAYERS_BASE::m_In23Name
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_In24CheckBox
protectedinherited
wxChoice* PANEL_SETUP_LAYERS_BASE::m_In24Choice
protectedinherited
wxTextCtrl* PANEL_SETUP_LAYERS_BASE::m_In24Name
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_In25CheckBox
protectedinherited
wxChoice* PANEL_SETUP_LAYERS_BASE::m_In25Choice
protectedinherited
wxTextCtrl* PANEL_SETUP_LAYERS_BASE::m_In25Name
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_In26CheckBox
protectedinherited
wxChoice* PANEL_SETUP_LAYERS_BASE::m_In26Choice
protectedinherited
wxTextCtrl* PANEL_SETUP_LAYERS_BASE::m_In26Name
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_In27CheckBox
protectedinherited
wxChoice* PANEL_SETUP_LAYERS_BASE::m_In27Choice
protectedinherited
wxTextCtrl* PANEL_SETUP_LAYERS_BASE::m_In27Name
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_In28CheckBox
protectedinherited
wxChoice* PANEL_SETUP_LAYERS_BASE::m_In28Choice
protectedinherited
wxTextCtrl* PANEL_SETUP_LAYERS_BASE::m_In28Name
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_In29CheckBox
protectedinherited
wxChoice* PANEL_SETUP_LAYERS_BASE::m_In29Choice
protectedinherited
wxTextCtrl* PANEL_SETUP_LAYERS_BASE::m_In29Name
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_In2CheckBox
protectedinherited
wxChoice* PANEL_SETUP_LAYERS_BASE::m_In2Choice
protectedinherited
wxTextCtrl* PANEL_SETUP_LAYERS_BASE::m_In2Name
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_In30CheckBox
protectedinherited
wxChoice* PANEL_SETUP_LAYERS_BASE::m_In30Choice
protectedinherited
wxTextCtrl* PANEL_SETUP_LAYERS_BASE::m_In30Name
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_In3CheckBox
protectedinherited
wxChoice* PANEL_SETUP_LAYERS_BASE::m_In3Choice
protectedinherited
wxTextCtrl* PANEL_SETUP_LAYERS_BASE::m_In3Name
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_In4CheckBox
protectedinherited
wxChoice* PANEL_SETUP_LAYERS_BASE::m_In4Choice
protectedinherited
wxTextCtrl* PANEL_SETUP_LAYERS_BASE::m_In4Name
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_In5CheckBox
protectedinherited
wxChoice* PANEL_SETUP_LAYERS_BASE::m_In5Choice
protectedinherited
wxTextCtrl* PANEL_SETUP_LAYERS_BASE::m_In5Name
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_In6CheckBox
protectedinherited
wxChoice* PANEL_SETUP_LAYERS_BASE::m_In6Choice
protectedinherited
wxTextCtrl* PANEL_SETUP_LAYERS_BASE::m_In6Name
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_In7CheckBox
protectedinherited
wxChoice* PANEL_SETUP_LAYERS_BASE::m_In7Choice
protectedinherited
wxTextCtrl* PANEL_SETUP_LAYERS_BASE::m_In7Name
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_In8CheckBox
protectedinherited
wxChoice* PANEL_SETUP_LAYERS_BASE::m_In8Choice
protectedinherited
wxTextCtrl* PANEL_SETUP_LAYERS_BASE::m_In8Name
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_In9CheckBox
protectedinherited
wxChoice* PANEL_SETUP_LAYERS_BASE::m_In9Choice
protectedinherited
wxTextCtrl* PANEL_SETUP_LAYERS_BASE::m_In9Name
protectedinherited
wxFlexGridSizer* PANEL_SETUP_LAYERS_BASE::m_LayerListFlexGridSizer
protectedinherited
wxScrolledWindow* PANEL_SETUP_LAYERS_BASE::m_LayersListPanel
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_MarginCheckBox
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_MarginName
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_MarginStaticText
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_MaskBackCheckBox
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_MaskBackName
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_MaskBackStaticText
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_MaskFrontCheckBox
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_MaskFrontName
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_MaskFrontStaticText
protectedinherited
PAGED_DIALOG* PANEL_SETUP_LAYERS::m_Parent
private

Definition at line 63 of file panel_setup_layers.h.

Referenced by testLayerNames().

wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_PCBEdgesCheckBox
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_PCBEdgesName
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_PCBEdgesStaticText
protectedinherited
UNIT_BINDER PANEL_SETUP_LAYERS::m_pcbThickness
private

Definition at line 68 of file panel_setup_layers.h.

Referenced by TransferDataFromWindow(), and TransferDataToWindow().

wxChoice* PANEL_SETUP_LAYERS_BASE::m_PresetsChoice
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_SilkSBackCheckBox
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_SilkSBackName
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_SilkSBackStaticText
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_SilkSFrontCheckBox
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_SilkSFrontName
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_SilkSFrontStaticText
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_SoldPBackCheckBox
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_SoldPBackName
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_SoldPBackStaticText
protectedinherited
wxCheckBox* PANEL_SETUP_LAYERS_BASE::m_SoldPFrontCheckBox
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_SoldPFrontName
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_SoldPFrontStaticText
protectedinherited
wxStaticLine* PANEL_SETUP_LAYERS_BASE::m_staticline1
protectedinherited
wxStaticLine* PANEL_SETUP_LAYERS_BASE::m_staticline2
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_staticTextCopperLayers
protectedinherited
wxTextCtrl* PANEL_SETUP_LAYERS_BASE::m_thicknessCtrl
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_thicknessLabel
protectedinherited
wxStaticText* PANEL_SETUP_LAYERS_BASE::m_thicknessUnits
protectedinherited

The documentation for this class was generated from the following files: