post-rebase fixes

This commit is contained in:
Tomasz Włostowski 2017-04-24 22:26:11 +02:00
parent 3b7b0603b6
commit 63f4ab697b
5 changed files with 29 additions and 18 deletions

View File

@ -752,22 +752,29 @@ void BOARD::SetElementVisibility( GAL_LAYER_ID LAYER_aPCB, bool isEnabled )
switch( LAYER_aPCB )
{
case LAYER_RATSNEST:
{
bool visible = IsElementVisible( LAYER_RATSNEST );
// we must clear or set the CH_VISIBLE flags to hide/show ratsnest
// because we have a tool to show/hide ratsnest relative to a pad or a module
// so the hide/show option is a per item selection
if( IsElementVisible( LAYER_RATSNEST ) )
{
for( unsigned ii = 0; ii < GetRatsnestsCount(); ii++ )
m_FullRatsnest[ii].m_Status |= CH_VISIBLE;
}
else
{
for( unsigned ii = 0; ii < GetRatsnestsCount(); ii++ )
m_FullRatsnest[ii].m_Status &= ~CH_VISIBLE;
}
break;
for ( int net = 1; net < GetNetCount(); net++ )
GetConnectivity()->GetRatsnestForNet( net )->SetVisible( visible );
for ( auto track : Tracks() )
track->SetLocalRatsnestVisible( isEnabled );
for( auto mod : Modules() )
for ( auto pad : mod->PadsIter() )
pad->SetLocalRatsnestVisible( isEnabled );
for( int i = 0; i<GetAreaCount(); i++ )
{
auto zone = GetArea( i );
zone->SetLocalRatsnestVisible( isEnabled );
}
m_Status_Pcb = 0;
break;
}
default:
;
}

View File

@ -92,7 +92,7 @@ TOOL_ACTION PCB_ACTIONS::drawVia( "pcbnew.InteractiveDrawing.via",
AS_GLOBAL, 0,
_( "Add Vias" ), _( "Add free-stanging vias" ), NULL, AF_ACTIVATE );
TOOL_ACTION PCB_ACTIONS::drawKeepout( "pcbnew.InteractiveDrawing.keepout",
TOOL_ACTION PCB_ACTIONS::drawZoneKeepout( "pcbnew.InteractiveDrawing.keepout",
AS_GLOBAL, 0,
_( "Add Keepout Area" ), _( "Add a keepout area" ), NULL, AF_ACTIVATE );
@ -1464,8 +1464,8 @@ int DRAWING_TOOL::DrawVia( const TOOL_EVENT& aEvent )
// layer pair is B_Cu and F_Cu.
via->SetLayerPair( B_Cu, F_Cu );
LAYER_ID first_layer = m_frame->GetActiveLayer();
LAYER_ID last_layer;
PCB_LAYER_ID first_layer = m_frame->GetActiveLayer();
PCB_LAYER_ID last_layer;
// prepare switch to new active layer:
if( first_layer != m_frame->GetScreen()->m_Route_Layer_TOP )
@ -1482,7 +1482,7 @@ int DRAWING_TOOL::DrawVia( const TOOL_EVENT& aEvent )
case VIA_MICROVIA: // from external to the near neighbor inner layer
{
LAYER_ID last_inner_layer = ToLAYER_ID( ( m_board->GetCopperLayerCount() - 2 ) );
PCB_LAYER_ID last_inner_layer = ToLAYER_ID( ( m_board->GetCopperLayerCount() - 2 ) );
if( first_layer == B_Cu )
last_layer = last_inner_layer;

View File

@ -488,7 +488,7 @@ int PCB_EDITOR_CONTROL::PlaceModule( const TOOL_EVENT& aEvent )
controls->SetSnapping( false );
controls->SetAutoPan( false );
controls->CaptureCursor( false );
view->Remove( &preview );
m_frame->SetNoToolSelected();
@ -1110,6 +1110,7 @@ int PCB_EDITOR_CONTROL::ShowLocalRatsnest( const TOOL_EVENT& aEvent )
int PCB_EDITOR_CONTROL::UpdateSelectionRatsnest( const TOOL_EVENT& aEvent )
{
return 0;
/* SELECTION_TOOL* selTool = m_toolMgr->GetTool<SELECTION_TOOL>();
const SELECTION& selection = selTool->GetSelection();
RN_DATA* ratsnest = getModel<BOARD>()->GetRatsnest();

View File

@ -105,6 +105,9 @@ public:
///> Updates ratsnest for selected items.
int UpdateSelectionRatsnest( const TOOL_EVENT& aEvent );
///> Shows local ratsnest of a component
int ShowLocalRatsnest( const TOOL_EVENT& aEvent );
///> Sets up handlers for various events.
void SetTransitions() override;

View File

@ -839,7 +839,7 @@ int PCBNEW_CONTROL::AppendBoard( const TOOL_EVENT& aEvent )
// rebuild nets and ratsnest before any use of nets
board->BuildListOfNets();
board->SynchronizeNetsAndNetClasses();
board->GetRatsnest()->ProcessBoard();
board->GetConnectivity()->Build( board );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );