Don't show annular rings controls for vias that span only a single layer.
This commit is contained in:
parent
d6ae915616
commit
32836da14b
|
@ -508,6 +508,18 @@ void BOARD::SetCopperLayerCount( int aCount )
|
|||
}
|
||||
|
||||
|
||||
int BOARD::LayerDepth( PCB_LAYER_ID aStartLayer, PCB_LAYER_ID aEndLayer ) const
|
||||
{
|
||||
if( aStartLayer > aEndLayer )
|
||||
std::swap( aStartLayer, aEndLayer );
|
||||
|
||||
if( aEndLayer == B_Cu )
|
||||
aEndLayer = ToLAYER_ID( F_Cu + GetCopperLayerCount() - 1 );
|
||||
|
||||
return aEndLayer - aStartLayer;
|
||||
}
|
||||
|
||||
|
||||
LSET BOARD::GetEnabledLayers() const
|
||||
{
|
||||
return GetDesignSettings().GetEnabledLayers();
|
||||
|
|
|
@ -510,6 +510,8 @@ public:
|
|||
int GetCopperLayerCount() const;
|
||||
void SetCopperLayerCount( int aCount );
|
||||
|
||||
int LayerDepth( PCB_LAYER_ID aStartLayer, PCB_LAYER_ID aEndLayer ) const;
|
||||
|
||||
/**
|
||||
* A proxy function that calls the corresponding function in m_BoardSettings.
|
||||
*
|
||||
|
|
|
@ -265,6 +265,7 @@ DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES( PCB_BASE_FRAME* aParen
|
|||
m_ViaStartLayer->SetUndefinedLayerName( INDETERMINATE_STATE );
|
||||
m_ViaStartLayer->Resync();
|
||||
}
|
||||
|
||||
m_ViaStartLayer->SetLayerSelection( selection_first_layer );
|
||||
|
||||
if( selection_last_layer == UNDEFINED_LAYER )
|
||||
|
@ -272,6 +273,7 @@ DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES( PCB_BASE_FRAME* aParen
|
|||
m_ViaEndLayer->SetUndefinedLayerName( INDETERMINATE_STATE );
|
||||
m_ViaEndLayer->Resync();
|
||||
}
|
||||
|
||||
m_ViaEndLayer->SetLayerSelection( selection_last_layer );
|
||||
}
|
||||
|
||||
|
@ -336,6 +338,9 @@ DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES( PCB_BASE_FRAME* aParen
|
|||
|
||||
m_ViaStartLayer->Enable( viaType != VIATYPE::THROUGH );
|
||||
m_ViaEndLayer->Enable( viaType != VIATYPE::THROUGH );
|
||||
|
||||
m_annularRingsLabel->Show( getLayerDepth() > 1 );
|
||||
m_annularRingsCtrl->Show( getLayerDepth() > 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -481,7 +486,7 @@ bool DIALOG_TRACK_VIA_PROPERTIES::confirmPadChange( const std::vector<PAD*>& cha
|
|||
|
||||
bool DIALOG_TRACK_VIA_PROPERTIES::TransferDataFromWindow()
|
||||
{
|
||||
// Run validations:
|
||||
// Check for malformed data ONLY; design rules and constraints are the business of DRC.
|
||||
|
||||
if( m_vias )
|
||||
{
|
||||
|
@ -797,6 +802,23 @@ void DIALOG_TRACK_VIA_PROPERTIES::onViaSelect( wxCommandEvent& aEvent )
|
|||
}
|
||||
|
||||
|
||||
int DIALOG_TRACK_VIA_PROPERTIES::getLayerDepth()
|
||||
{
|
||||
int viaType = m_ViaTypeChoice->GetSelection();
|
||||
|
||||
if( viaType <= 0 )
|
||||
return m_frame->GetBoard()->GetCopperLayerCount() - 1;
|
||||
|
||||
int startLayer = m_ViaStartLayer->GetLayerSelection();
|
||||
int endLayer = m_ViaEndLayer->GetLayerSelection();
|
||||
|
||||
if( startLayer < 0 || endLayer < 0 )
|
||||
return m_frame->GetBoard()->GetCopperLayerCount() - 1;
|
||||
else
|
||||
return m_frame->GetBoard()->LayerDepth( ToLAYER_ID( startLayer ), ToLAYER_ID( endLayer ) );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_TRACK_VIA_PROPERTIES::onViaEdit( wxCommandEvent& aEvent )
|
||||
{
|
||||
m_DesignRuleViasCtrl->SetSelection( wxNOT_FOUND );
|
||||
|
@ -816,5 +838,8 @@ void DIALOG_TRACK_VIA_PROPERTIES::onViaEdit( wxCommandEvent& aEvent )
|
|||
m_ViaStartLayer->Enable( false );
|
||||
m_ViaEndLayer->Enable( false );
|
||||
}
|
||||
|
||||
m_annularRingsLabel->Show( getLayerDepth() > 1 );
|
||||
m_annularRingsCtrl->Show( getLayerDepth() > 1 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,6 +56,9 @@ private:
|
|||
|
||||
bool confirmPadChange( const std::vector<PAD*>& connectedPads );
|
||||
|
||||
int getLayerDepth();
|
||||
|
||||
private:
|
||||
PCB_BASE_FRAME* m_frame;
|
||||
const PCB_SELECTION& m_items; // List of items to be modified.
|
||||
COMMIT& m_commit; // An undo record to add any changes to.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5)
|
||||
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
|
@ -319,6 +319,8 @@ DIALOG_TRACK_VIA_PROPERTIES_BASE::DIALOG_TRACK_VIA_PROPERTIES_BASE( wxWindow* pa
|
|||
m_ViaDrillCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_TRACK_VIA_PROPERTIES_BASE::onViaEdit ), NULL, this );
|
||||
m_viaNetclass->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_TRACK_VIA_PROPERTIES_BASE::onViaNetclassCheck ), NULL, this );
|
||||
m_ViaTypeChoice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_TRACK_VIA_PROPERTIES_BASE::onViaEdit ), NULL, this );
|
||||
m_ViaStartLayer->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_TRACK_VIA_PROPERTIES_BASE::onViaEdit ), NULL, this );
|
||||
m_ViaEndLayer->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_TRACK_VIA_PROPERTIES_BASE::onViaEdit ), NULL, this );
|
||||
}
|
||||
|
||||
DIALOG_TRACK_VIA_PROPERTIES_BASE::~DIALOG_TRACK_VIA_PROPERTIES_BASE()
|
||||
|
@ -333,5 +335,7 @@ DIALOG_TRACK_VIA_PROPERTIES_BASE::~DIALOG_TRACK_VIA_PROPERTIES_BASE()
|
|||
m_ViaDrillCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_TRACK_VIA_PROPERTIES_BASE::onViaEdit ), NULL, this );
|
||||
m_viaNetclass->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_TRACK_VIA_PROPERTIES_BASE::onViaNetclassCheck ), NULL, this );
|
||||
m_ViaTypeChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_TRACK_VIA_PROPERTIES_BASE::onViaEdit ), NULL, this );
|
||||
m_ViaStartLayer->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_TRACK_VIA_PROPERTIES_BASE::onViaEdit ), NULL, this );
|
||||
m_ViaEndLayer->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_TRACK_VIA_PROPERTIES_BASE::onViaEdit ), NULL, this );
|
||||
|
||||
}
|
||||
|
|
|
@ -3128,6 +3128,7 @@
|
|||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnCombobox">onViaEdit</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
|
@ -3254,6 +3255,7 @@
|
|||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnCombobox">onViaEdit</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5)
|
||||
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
|
|
Loading…
Reference in New Issue