mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 10:13:19 +02:00
Prevent invalid via layers due to property editor
This commit is contained in:
parent
fde51f4c79
commit
382f2ee302
@ -1156,7 +1156,6 @@ void PCB_VIA::SetLayerSet( const LSET& aLayerSet )
|
|||||||
|
|
||||||
void PCB_VIA::SetLayerPair( PCB_LAYER_ID aTopLayer, PCB_LAYER_ID aBottomLayer )
|
void PCB_VIA::SetLayerPair( PCB_LAYER_ID aTopLayer, PCB_LAYER_ID aBottomLayer )
|
||||||
{
|
{
|
||||||
|
|
||||||
Padstack().Drill().start = aTopLayer;
|
Padstack().Drill().start = aTopLayer;
|
||||||
Padstack().Drill().end = aBottomLayer;
|
Padstack().Drill().end = aBottomLayer;
|
||||||
SanitizeLayers();
|
SanitizeLayers();
|
||||||
@ -1165,13 +1164,24 @@ void PCB_VIA::SetLayerPair( PCB_LAYER_ID aTopLayer, PCB_LAYER_ID aBottomLayer )
|
|||||||
|
|
||||||
void PCB_VIA::SetTopLayer( PCB_LAYER_ID aLayer )
|
void PCB_VIA::SetTopLayer( PCB_LAYER_ID aLayer )
|
||||||
{
|
{
|
||||||
|
// refuse invalid via
|
||||||
|
if( aLayer == Padstack().Drill().end )
|
||||||
|
return;
|
||||||
|
|
||||||
Padstack().Drill().start = aLayer;
|
Padstack().Drill().start = aLayer;
|
||||||
|
SanitizeLayers();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PCB_VIA::SetBottomLayer( PCB_LAYER_ID aLayer )
|
void PCB_VIA::SetBottomLayer( PCB_LAYER_ID aLayer )
|
||||||
{
|
{
|
||||||
|
// refuse invalid via
|
||||||
|
if( aLayer == Padstack().Drill().start )
|
||||||
|
return;
|
||||||
|
|
||||||
Padstack().Drill().end = aLayer;
|
Padstack().Drill().end = aLayer;
|
||||||
|
SanitizeLayers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2163,7 +2173,7 @@ static struct TRACK_VIA_DESC
|
|||||||
propMgr.AddProperty( new PROPERTY<PCB_VIA, int>( _HKI( "Hole" ),
|
propMgr.AddProperty( new PROPERTY<PCB_VIA, int>( _HKI( "Hole" ),
|
||||||
&PCB_VIA::SetDrill, &PCB_VIA::GetDrillValue, PROPERTY_DISPLAY::PT_SIZE ), groupVia );
|
&PCB_VIA::SetDrill, &PCB_VIA::GetDrillValue, PROPERTY_DISPLAY::PT_SIZE ), groupVia );
|
||||||
propMgr.AddProperty( new PROPERTY_ENUM<PCB_VIA, PCB_LAYER_ID>( _HKI( "Layer Top" ),
|
propMgr.AddProperty( new PROPERTY_ENUM<PCB_VIA, PCB_LAYER_ID>( _HKI( "Layer Top" ),
|
||||||
&PCB_VIA::SetLayer, &PCB_VIA::GetLayer ), groupVia );
|
&PCB_VIA::SetTopLayer, &PCB_VIA::GetLayer ), groupVia );
|
||||||
propMgr.AddProperty( new PROPERTY_ENUM<PCB_VIA, PCB_LAYER_ID>( _HKI( "Layer Bottom" ),
|
propMgr.AddProperty( new PROPERTY_ENUM<PCB_VIA, PCB_LAYER_ID>( _HKI( "Layer Bottom" ),
|
||||||
&PCB_VIA::SetBottomLayer, &PCB_VIA::BottomLayer ), groupVia );
|
&PCB_VIA::SetBottomLayer, &PCB_VIA::BottomLayer ), groupVia );
|
||||||
propMgr.AddProperty( new PROPERTY_ENUM<PCB_VIA, VIATYPE>( _HKI( "Via Type" ),
|
propMgr.AddProperty( new PROPERTY_ENUM<PCB_VIA, VIATYPE>( _HKI( "Via Type" ),
|
||||||
|
@ -413,7 +413,12 @@ public:
|
|||||||
bool HasValidLayerPair( int aCopperLayerCount );
|
bool HasValidLayerPair( int aCopperLayerCount );
|
||||||
|
|
||||||
VIATYPE GetViaType() const { return m_viaType; }
|
VIATYPE GetViaType() const { return m_viaType; }
|
||||||
void SetViaType( VIATYPE aViaType ) { m_viaType = aViaType; }
|
void SetViaType( VIATYPE aViaType )
|
||||||
|
{
|
||||||
|
m_viaType = aViaType;
|
||||||
|
// If someone updates a VIA to TH, we want to kick out any non-outer layers
|
||||||
|
SanitizeLayers();
|
||||||
|
}
|
||||||
|
|
||||||
const PADSTACK& Padstack() const { return m_padStack; }
|
const PADSTACK& Padstack() const { return m_padStack; }
|
||||||
PADSTACK& Padstack() { return m_padStack; }
|
PADSTACK& Padstack() { return m_padStack; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user