router: Added messages explaining why a blind/buried/microvia cannot be placed.

This commit is contained in:
Maciej Suminski 2015-09-24 11:04:42 +02:00
parent b27176f230
commit 41e96e03d6
1 changed files with 21 additions and 5 deletions

View File

@ -39,6 +39,7 @@
#include <dialogs/dialog_track_via_size.h> #include <dialogs/dialog_track_via_size.h>
#include <base_units.h> #include <base_units.h>
#include <hotkeys.h> #include <hotkeys.h>
#include <confirm.h>
#include <tool/context_menu.h> #include <tool/context_menu.h>
#include <tool/tool_manager.h> #include <tool/tool_manager.h>
@ -397,23 +398,38 @@ bool ROUTER_TOOL::onViaCommand( VIATYPE_T aType )
{ {
// Cannot place microvias or blind vias if not allowed (obvious) // Cannot place microvias or blind vias if not allowed (obvious)
if( ( aType == VIA_BLIND_BURIED ) && ( !bds.m_BlindBuriedViaAllowed ) ) if( ( aType == VIA_BLIND_BURIED ) && ( !bds.m_BlindBuriedViaAllowed ) )
{
DisplayError( m_frame, _( "Blind/buried vias have to be enabled in the design settings." ) );
return false; return false;
}
if( ( aType == VIA_MICROVIA ) && ( !bds.m_MicroViasAllowed ) ) if( ( aType == VIA_MICROVIA ) && ( !bds.m_MicroViasAllowed ) )
{
DisplayError( m_frame, _( "Microvias have to be enabled in the design settings." ) );
return false; return false;
}
//Can only place through vias on 2-layer boards // Can only place through vias on 2-layer boards
if( ( aType != VIA_THROUGH ) && ( layerCount <= 2 ) ) if( ( aType != VIA_THROUGH ) && ( layerCount <= 2 ) )
{
DisplayError( m_frame, _( "Only through vias are allowed on 2 layer boards." ) );
return false; return false;
}
//Can only place microvias if we're on an outer layer, or directly adjacent to one // Can only place microvias if we're on an outer layer, or directly adjacent to one
if( ( aType == VIA_MICROVIA ) && ( currentLayer > In1_Cu ) && ( currentLayer < layerCount-2 ) ) if( ( aType == VIA_MICROVIA ) && ( currentLayer > In1_Cu ) && ( currentLayer < layerCount - 2 ) )
{
DisplayError( m_frame, _( "Microvias can be placed only on the outer layers." ) );
return false; return false;
}
//Cannot place blind vias with front/back as the layer pair, this doesn't make sense // Cannot place blind vias with front/back as the layer pair, this doesn't make sense
if( ( aType == VIA_BLIND_BURIED ) && ( sizes.GetLayerTop() == F_Cu ) && ( sizes.GetLayerBottom() == B_Cu ) ) if( ( aType == VIA_BLIND_BURIED ) && ( sizes.GetLayerTop() == F_Cu ) && ( sizes.GetLayerBottom() == B_Cu ) )
{
DisplayError( m_frame, _( "Only through vias can be placed between front and bottom layers." ) );
return false; return false;
} }
}
sizes.SetViaType( aType ); sizes.SetViaType( aType );
if( VIA_MICROVIA == aType ) if( VIA_MICROVIA == aType )
@ -463,7 +479,7 @@ bool ROUTER_TOOL::prepareInteractive()
if( !m_router->StartRouting( m_startSnapPoint, m_startItem, routingLayer ) ) if( !m_router->StartRouting( m_startSnapPoint, m_startItem, routingLayer ) )
{ {
wxMessageBox( m_router->FailureReason(), _( "Error" ) ); DisplayError( m_frame, m_router->FailureReason() );
highlightNet( false ); highlightNet( false );
return false; return false;
} }