Skip to content
Permalink
Browse files

Use Via Properties dialog to modify via type and start/end layers.

  • Loading branch information...
DasBasti committed Aug 18, 2017
1 parent 434e748 commit 7046b708fb2791c8897265a4cf8a23e6fd372882
Showing with 35 additions and 4 deletions.
  1. +35 −4 pcbnew/dialogs/dialog_track_via_properties.cpp
@@ -289,6 +289,7 @@ bool DIALOG_TRACK_VIA_PROPERTIES::Apply( COMMIT& aCommit )

bool changeLock = m_lockedCbox->Get3StateValue() != wxCHK_UNDETERMINED;
bool setLock = m_lockedCbox->Get3StateValue() == wxCHK_CHECKED;
bool setNetclassSizes = false;

for( auto item : m_items )
{
@@ -373,7 +374,40 @@ bool DIALOG_TRACK_VIA_PROPERTIES::Apply( COMMIT& aCommit )
v->SetPosition( pos );
}

if( m_viaNetclass->IsChecked() )
if( m_ViaTypeChoice->GetSelection() != VIA_NOT_DEFINED )
v->SetViaType( (VIATYPE_T)m_ViaTypeChoice->GetSelection() );

if( !m_viaNetclass->IsChecked() )
{
if( m_ViaTypeChoice->GetSelection() == VIA_MICROVIA && (
v->GetWidth() < v->GetNetClass()->GetuViaDiameter()
|| v->GetDrill() < v->GetNetClass()->GetuViaDrill() ) )
{
wxMessageDialog dlg( this, _( "MicroVia sizes are smaller than net class. Use net class instead?" ), wxEmptyString, wxYES_NO );
if( dlg.ShowModal() == wxID_YES )
{
m_viaNetclass->SetValue(true);
setNetclassSizes = true;
}
}
else if( m_ViaTypeChoice->GetSelection() != VIA_MICROVIA && (
v->GetWidth() < v->GetNetClass()->GetViaDiameter()
|| v->GetDrill() < v->GetNetClass()->GetViaDrill() ) )
{
wxMessageDialog dlg( this, _( "Via sizes are smaller than net class. Use net class instead?" ), wxEmptyString, wxYES_NO );
if( dlg.ShowModal() == wxID_YES )
{
m_viaNetclass->SetValue(true);
setNetclassSizes = true;
}
}
}
else
{
setNetclassSizes = true;
}

if( setNetclassSizes )
{
switch( v->GetViaType() )
{
@@ -415,9 +449,6 @@ bool DIALOG_TRACK_VIA_PROPERTIES::Apply( COMMIT& aCommit )
if( startLayer != UNDEFINED_LAYER && endLayer != UNDEFINED_LAYER)
v->SetLayerPair( (PCB_LAYER_ID)startLayer, (PCB_LAYER_ID)endLayer );

if( m_ViaTypeChoice->GetSelection() != VIA_NOT_DEFINED )
v->SetViaType( (VIATYPE_T)m_ViaTypeChoice->GetSelection() );

if( changeLock )
v->SetLocked( setLock );

0 comments on commit 7046b70

Please sign in to comment.
You can’t perform that action at this time.