DIALOG_LAYERS_SETUP: force 4 non copper layers to be always in use.
edge cut, courtyard and margin layers are (or can be) used in DRC. So they are seen as mandatory, and the dialog always force them active.
This commit is contained in:
parent
545e6bbd0c
commit
2edc675eaf
|
@ -151,7 +151,7 @@ private:
|
||||||
void setLayerCheckBox( LAYER_NUM layer, bool isChecked );
|
void setLayerCheckBox( LAYER_NUM layer, bool isChecked );
|
||||||
void setCopperLayerCheckBoxes( int copperCount );
|
void setCopperLayerCheckBoxes( int copperCount );
|
||||||
// Force mandatory non copper layers enabled
|
// Force mandatory non copper layers enabled
|
||||||
void enableMandatoryLayerCheckBoxes();
|
void setStateMandatoryLayerCheckBoxes();
|
||||||
|
|
||||||
void showCopperChoice( int copperCount );
|
void showCopperChoice( int copperCount );
|
||||||
void showBoardLayerNames();
|
void showBoardLayerNames();
|
||||||
|
@ -387,7 +387,7 @@ bool DIALOG_LAYERS_SETUP::TransferDataToWindow()
|
||||||
showSelectedLayerCheckBoxes( m_enabledLayers );
|
showSelectedLayerCheckBoxes( m_enabledLayers );
|
||||||
showPresets( m_enabledLayers );
|
showPresets( m_enabledLayers );
|
||||||
showLayerTypes();
|
showLayerTypes();
|
||||||
enableMandatoryLayerCheckBoxes();
|
setStateMandatoryLayerCheckBoxes();
|
||||||
|
|
||||||
// All widgets are now initialized. Fix the min sizes:
|
// All widgets are now initialized. Fix the min sizes:
|
||||||
GetSizer()->SetSizeHints( this );
|
GetSizer()->SetSizeHints( this );
|
||||||
|
@ -396,15 +396,18 @@ bool DIALOG_LAYERS_SETUP::TransferDataToWindow()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DIALOG_LAYERS_SETUP::enableMandatoryLayerCheckBoxes()
|
void DIALOG_LAYERS_SETUP::setStateMandatoryLayerCheckBoxes()
|
||||||
{
|
{
|
||||||
// Currently, do nothing
|
int layerList[4] =
|
||||||
#if 0
|
{
|
||||||
setLayerCheckBox( F_CrtYd, true );
|
F_CrtYd, B_CrtYd, Edge_Cuts, Margin
|
||||||
setLayerCheckBox( B_CrtYd, true );
|
};
|
||||||
setLayerCheckBox( Edge_Cuts, true );
|
|
||||||
setLayerCheckBox( Margin, true );
|
for( int ii = 0; ii < 4; ii++ )
|
||||||
#endif
|
{
|
||||||
|
setLayerCheckBox( layerList[ii], true );
|
||||||
|
getCheckBox( layerList[ii] )->Enable( false ); // do not allow changes
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -604,30 +607,25 @@ void DIALOG_LAYERS_SETUP::OnPresetsChoice( wxCommandEvent& event )
|
||||||
if( presetNdx < DIM(presets) )
|
if( presetNdx < DIM(presets) )
|
||||||
{
|
{
|
||||||
m_enabledLayers = presets[ presetNdx ];
|
m_enabledLayers = presets[ presetNdx ];
|
||||||
|
|
||||||
LSET copperSet = m_enabledLayers & LSET::AllCuMask();
|
LSET copperSet = m_enabledLayers & LSET::AllCuMask();
|
||||||
|
|
||||||
int copperCount = copperSet.count();
|
int copperCount = copperSet.count();
|
||||||
|
|
||||||
m_copperLayerCount = copperCount;
|
m_copperLayerCount = copperCount;
|
||||||
|
|
||||||
showCopperChoice( m_copperLayerCount );
|
showCopperChoice( m_copperLayerCount );
|
||||||
|
|
||||||
showSelectedLayerCheckBoxes( m_enabledLayers );
|
showSelectedLayerCheckBoxes( m_enabledLayers );
|
||||||
|
|
||||||
setCopperLayerCheckBoxes( m_copperLayerCount );
|
setCopperLayerCheckBoxes( m_copperLayerCount );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensure mandatory layers are activated
|
||||||
|
setStateMandatoryLayerCheckBoxes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DIALOG_LAYERS_SETUP::OnCopperLayersChoice( wxCommandEvent& event )
|
void DIALOG_LAYERS_SETUP::OnCopperLayersChoice( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
m_copperLayerCount = m_CopperLayersChoice->GetCurrentSelection() * 2 + 2;
|
m_copperLayerCount = m_CopperLayersChoice->GetCurrentSelection() * 2 + 2;
|
||||||
|
|
||||||
setCopperLayerCheckBoxes( m_copperLayerCount );
|
setCopperLayerCheckBoxes( m_copperLayerCount );
|
||||||
|
|
||||||
m_enabledLayers = getUILayerMask();
|
m_enabledLayers = getUILayerMask();
|
||||||
|
|
||||||
showPresets( m_enabledLayers );
|
showPresets( m_enabledLayers );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -745,9 +743,7 @@ bool DIALOG_LAYERS_SETUP::TransferDataFromWindow()
|
||||||
int DIALOG_LAYERS_SETUP::getLayerTypeIndex( LAYER_NUM aLayer )
|
int DIALOG_LAYERS_SETUP::getLayerTypeIndex( LAYER_NUM aLayer )
|
||||||
{
|
{
|
||||||
wxChoice* ctl = getChoice( aLayer );
|
wxChoice* ctl = getChoice( aLayer );
|
||||||
|
|
||||||
int ret = ctl->GetCurrentSelection(); // indices must have same sequence as LAYER_T
|
int ret = ctl->GetCurrentSelection(); // indices must have same sequence as LAYER_T
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -755,11 +751,8 @@ int DIALOG_LAYERS_SETUP::getLayerTypeIndex( LAYER_NUM aLayer )
|
||||||
wxString DIALOG_LAYERS_SETUP::getLayerName( LAYER_NUM aLayer )
|
wxString DIALOG_LAYERS_SETUP::getLayerName( LAYER_NUM aLayer )
|
||||||
{
|
{
|
||||||
wxString ret;
|
wxString ret;
|
||||||
|
|
||||||
wxASSERT( IsCopperLayer( aLayer ) );
|
wxASSERT( IsCopperLayer( aLayer ) );
|
||||||
|
|
||||||
wxTextCtrl* ctl = (wxTextCtrl*) getName( aLayer );
|
wxTextCtrl* ctl = (wxTextCtrl*) getName( aLayer );
|
||||||
|
|
||||||
ret = ctl->GetValue().Trim();
|
ret = ctl->GetValue().Trim();
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -781,7 +774,6 @@ static bool hasOneOf( const wxString& str, const wxString& chars )
|
||||||
bool DIALOG_LAYERS_SETUP::testLayerNames()
|
bool DIALOG_LAYERS_SETUP::testLayerNames()
|
||||||
{
|
{
|
||||||
std::vector<wxString> names;
|
std::vector<wxString> names;
|
||||||
|
|
||||||
wxTextCtrl* ctl;
|
wxTextCtrl* ctl;
|
||||||
|
|
||||||
for( LSEQ seq = LSET::AllCuMask().Seq(); seq; ++seq )
|
for( LSEQ seq = LSET::AllCuMask().Seq(); seq; ++seq )
|
||||||
|
|
Loading…
Reference in New Issue