|
|
@ -94,7 +94,6 @@ private: |
|
|
|
bool isAutoGenerated( const wxString& netName ); |
|
|
|
void updateCurrentNetSelection(); |
|
|
|
void updateInfoBar(); |
|
|
|
void handleRemoveIslandsSelection(); |
|
|
|
void storePersistentNetSortConfigurations(); |
|
|
|
void loadPersistentNetSortConfigurations(); |
|
|
|
|
|
|
@ -254,11 +253,7 @@ DIALOG_COPPER_ZONE::DIALOG_COPPER_ZONE( PCB_BASE_FRAME* aParent, ZONE_SETTINGS* |
|
|
|
[&]( wxCommandEvent& ) |
|
|
|
{ |
|
|
|
// Area mode is index 2
|
|
|
|
bool val = m_cbRemoveIslands->GetSelection() == 2; |
|
|
|
|
|
|
|
m_tcIslandThreshold->Enable( val ); |
|
|
|
m_islandThresholdLabel->Enable( val ); |
|
|
|
m_islandThresholdUnits->Enable( val ); |
|
|
|
m_islandThreshold.Enable( m_cbRemoveIslands->GetSelection() == 2 ); |
|
|
|
} ); |
|
|
|
|
|
|
|
SetupStandardButtons(); |
|
|
@ -325,11 +320,7 @@ bool DIALOG_COPPER_ZONE::TransferDataToWindow() |
|
|
|
|
|
|
|
m_cbRemoveIslands->SetSelection( static_cast<int>( m_settings.GetIslandRemovalMode() ) ); |
|
|
|
|
|
|
|
bool val = m_settings.GetIslandRemovalMode() == ISLAND_REMOVAL_MODE::AREA; |
|
|
|
|
|
|
|
m_tcIslandThreshold->Enable( val ); |
|
|
|
m_islandThresholdLabel->Enable( val ); |
|
|
|
m_islandThresholdUnits->Enable( val ); |
|
|
|
m_islandThreshold.Enable( m_settings.GetIslandRemovalMode() == ISLAND_REMOVAL_MODE::AREA ); |
|
|
|
|
|
|
|
loadPersistentNetSortConfigurations(); |
|
|
|
|
|
|
@ -376,16 +367,12 @@ bool DIALOG_COPPER_ZONE::TransferDataToWindow() |
|
|
|
|
|
|
|
m_tcZoneName->SetValue( m_settings.m_Name ); |
|
|
|
|
|
|
|
updateInfoBar(); |
|
|
|
handleRemoveIslandsSelection(); |
|
|
|
|
|
|
|
updateDisplayedListOfNets(); |
|
|
|
|
|
|
|
SetInitialFocus( m_ShowNetNameFilter ); |
|
|
|
|
|
|
|
// Enable/Disable some widgets
|
|
|
|
wxCommandEvent event; |
|
|
|
OnStyleSelection( event ); |
|
|
|
OnNetSelectionUpdated( event ); |
|
|
|
|
|
|
|
Fit(); |
|
|
|
|
|
|
@ -465,26 +452,28 @@ void DIALOG_COPPER_ZONE::OnNetSelectionUpdated( wxCommandEvent& event ) |
|
|
|
// correct selection
|
|
|
|
updateDisplayedListOfNets(); |
|
|
|
|
|
|
|
handleRemoveIslandsSelection(); |
|
|
|
} |
|
|
|
|
|
|
|
// Zones with no net never have islands removed
|
|
|
|
if( m_currentlySelectedNetcode == INVALID_NET_CODE ) |
|
|
|
{ |
|
|
|
if( m_cbRemoveIslands->IsEnabled() ) |
|
|
|
m_settings.SetIslandRemovalMode( (ISLAND_REMOVAL_MODE) m_cbRemoveIslands->GetSelection() ); |
|
|
|
|
|
|
|
void DIALOG_COPPER_ZONE::OnRemoveIslandsSelection( wxCommandEvent& event ) |
|
|
|
{ |
|
|
|
handleRemoveIslandsSelection(); |
|
|
|
m_cbRemoveIslands->SetSelection( 1 ); |
|
|
|
m_staticText40->Enable( false ); |
|
|
|
m_cbRemoveIslands->Enable( false ); |
|
|
|
} |
|
|
|
else if( !m_cbRemoveIslands->IsEnabled() ) |
|
|
|
{ |
|
|
|
m_cbRemoveIslands->SetSelection( static_cast<int>( m_settings.GetIslandRemovalMode() ) ); |
|
|
|
m_staticText40->Enable( true ); |
|
|
|
m_cbRemoveIslands->Enable( true ); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void DIALOG_COPPER_ZONE::handleRemoveIslandsSelection() |
|
|
|
void DIALOG_COPPER_ZONE::OnRemoveIslandsSelection( wxCommandEvent& event ) |
|
|
|
{ |
|
|
|
bool noNetSelected = m_currentlySelectedNetcode == INVALID_NET_CODE; |
|
|
|
bool enableSize = !noNetSelected && ( m_cbRemoveIslands->GetSelection() == 2 ); |
|
|
|
|
|
|
|
// Zones with no net never have islands removed
|
|
|
|
m_cbRemoveIslands->Enable( !noNetSelected ); |
|
|
|
m_islandThresholdLabel->Enable( enableSize ); |
|
|
|
m_islandThresholdUnits->Enable( enableSize ); |
|
|
|
m_tcIslandThreshold->Enable( enableSize ); |
|
|
|
m_islandThreshold.Enable( m_cbRemoveIslands->GetSelection() == 2 ); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -601,8 +590,7 @@ bool DIALOG_COPPER_ZONE::AcceptOptions( bool aUseExportableSetupOnly ) |
|
|
|
cfg->m_Zones.thermal_relief_gap = Iu2Mils( m_settings.m_ThermalReliefGap ); |
|
|
|
cfg->m_Zones.thermal_relief_copper_width = Iu2Mils( m_settings.m_ThermalReliefSpokeWidth ); |
|
|
|
|
|
|
|
m_settings.SetIslandRemovalMode( |
|
|
|
static_cast<ISLAND_REMOVAL_MODE>( m_cbRemoveIslands->GetSelection() ) ); |
|
|
|
m_settings.SetIslandRemovalMode( (ISLAND_REMOVAL_MODE) m_cbRemoveIslands->GetSelection() ); |
|
|
|
m_settings.SetMinIslandArea( m_islandThreshold.GetValue() ); |
|
|
|
|
|
|
|
// If we use only exportable to others zones parameters, exit here:
|
|
|
@ -636,7 +624,7 @@ void DIALOG_COPPER_ZONE::updateCurrentNetSelection() |
|
|
|
{ |
|
|
|
const int netSelection{ m_ListNetNameSelection->GetSelection() }; |
|
|
|
|
|
|
|
if( netSelection ) |
|
|
|
if( netSelection > 0 ) |
|
|
|
{ |
|
|
|
const wxString& selectedNetName = m_ListNetNameSelection->GetString( netSelection ); |
|
|
|
m_currentlySelectedNetcode = m_netNameToNetCode[selectedNetName]; |
|
|
|