REMOVED: PCB Editor Layer Alignment Target

No longer used by modern PCB processes.

Only the code to add the target to the board has been removed. Parsing
code for existing designs with targets is left in place.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/10006
This commit is contained in:
Mike Williams 2022-05-09 10:39:24 -04:00
parent cb15bd1635
commit 21a7e050ab
7 changed files with 0 additions and 133 deletions

View File

@ -339,7 +339,6 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
placeMenu->AppendSeparator();
placeMenu->Add( PCB_ACTIONS::placeCharacteristics );
placeMenu->Add( PCB_ACTIONS::placeStackup );
placeMenu->Add( PCB_ACTIONS::placeTarget );
placeMenu->AppendSeparator();
placeMenu->Add( PCB_ACTIONS::drillOrigin );

View File

@ -828,7 +828,6 @@ void PCB_EDIT_FRAME::setupUIConditions()
CURRENT_EDIT_TOOL( PCB_ACTIONS::drawCenterDimension );
CURRENT_EDIT_TOOL( PCB_ACTIONS::drawRadialDimension );
CURRENT_EDIT_TOOL( PCB_ACTIONS::drawLeader );
CURRENT_EDIT_TOOL( PCB_ACTIONS::placeTarget );
CURRENT_EDIT_TOOL( PCB_ACTIONS::drillOrigin );
CURRENT_EDIT_TOOL( PCB_ACTIONS::gridSetOrigin );

View File

@ -458,7 +458,6 @@ void PCB_EDIT_FRAME::ReCreateVToolbar()
m_drawToolBar->Add( PCB_ACTIONS::placeText, ACTION_TOOLBAR::TOGGLE );
m_drawToolBar->Add( PCB_ACTIONS::drawTextBox, ACTION_TOOLBAR::TOGGLE );
m_drawToolBar->AddGroup( dimensionGroup, ACTION_TOOLBAR::TOGGLE );
m_drawToolBar->Add( PCB_ACTIONS::placeTarget, ACTION_TOOLBAR::TOGGLE );
m_drawToolBar->Add( ACTIONS::deleteTool, ACTION_TOOLBAR::TOGGLE );
m_drawToolBar->AddScaledSeparator( this );

View File

@ -1274,124 +1274,6 @@ int BOARD_EDITOR_CONTROL::modifyLockSelected( MODIFY_MODE aMode )
}
int BOARD_EDITOR_CONTROL::PlaceTarget( const TOOL_EVENT& aEvent )
{
if( m_inPlaceTarget )
return 0;
REENTRANCY_GUARD guard( &m_inPlaceTarget );
KIGFX::VIEW* view = getView();
KIGFX::VIEW_CONTROLS* controls = getViewControls();
BOARD* board = getModel<BOARD>();
PCB_TARGET* target = new PCB_TARGET( board );
// Init the new item attributes
target->SetLayer( Edge_Cuts );
target->SetWidth( board->GetDesignSettings().GetLineThickness( Edge_Cuts ) );
target->SetSize( Millimeter2iu( 5 ) );
VECTOR2I cursorPos = controls->GetCursorPosition();
target->SetPosition( wxPoint( cursorPos.x, cursorPos.y ) );
// Add a VIEW_GROUP that serves as a preview for the new item
KIGFX::VIEW_GROUP preview( view );
preview.Add( target );
view->Add( &preview );
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
std::string tool = aEvent.GetCommandStr().get();
m_frame->PushTool( tool );
Activate();
auto setCursor =
[&]()
{
m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW );
};
// Set initial cursor
setCursor();
// Main loop: keep receiving events
while( TOOL_EVENT* evt = Wait() )
{
setCursor();
cursorPos = controls->GetCursorPosition( !evt->DisableGridSnapping() );
if( evt->IsCancelInteractive() )
{
frame()->PopTool( tool );
break;
}
else if( evt->IsActivate() )
{
if( evt->IsMoveTool() )
{
// leave ourselves on the stack so we come back after the move
break;
}
else
{
frame()->PopTool( tool );
break;
}
}
else if( evt->IsAction( &PCB_ACTIONS::incWidth ) )
{
target->SetWidth( target->GetWidth() + WIDTH_STEP );
view->Update( &preview );
}
else if( evt->IsAction( &PCB_ACTIONS::decWidth ) )
{
int width = target->GetWidth();
if( width > WIDTH_STEP )
{
target->SetWidth( width - WIDTH_STEP );
view->Update( &preview );
}
}
else if( evt->IsClick( BUT_LEFT ) )
{
assert( target->GetSize() > 0 );
assert( target->GetWidth() > 0 );
BOARD_COMMIT commit( m_frame );
commit.Add( target );
commit.Push( wxT( "Place a layer alignment target" ) );
preview.Remove( target );
// Create next PCB_TARGET
target = new PCB_TARGET( *target );
preview.Add( target );
}
else if( evt->IsClick( BUT_RIGHT ) )
{
m_menu.ShowContextMenu( selection() );
}
else if( evt->IsMotion() )
{
target->SetPosition( wxPoint( cursorPos.x, cursorPos.y ) );
view->Update( &preview );
}
else
{
evt->SetPassEvent();
}
}
preview.Clear();
delete target;
view->Remove( &preview );
m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW );
return 0;
}
static bool mergeZones( EDA_DRAW_FRAME* aFrame, BOARD_COMMIT& aCommit,
std::vector<ZONE*>& aOriginZones, std::vector<ZONE*>& aMergedZones )
{
@ -1675,7 +1557,6 @@ void BOARD_EDITOR_CONTROL::setTransitions()
Go( &BOARD_EDITOR_CONTROL::ZoneDuplicate, PCB_ACTIONS::zoneDuplicate.MakeEvent() );
// Placing tools
Go( &BOARD_EDITOR_CONTROL::PlaceTarget, PCB_ACTIONS::placeTarget.MakeEvent() );
Go( &BOARD_EDITOR_CONTROL::PlaceFootprint, PCB_ACTIONS::placeFootprint.MakeEvent() );
Go( &BOARD_EDITOR_CONTROL::DrillOrigin, PCB_ACTIONS::drillOrigin.MakeEvent() );

View File

@ -93,11 +93,6 @@ public:
int EditFpInFpEditor( const TOOL_EVENT& aEvent );
/**
* Allow user to place a layer alignment target.
*/
int PlaceTarget( const TOOL_EVENT& aEvent );
/**
* Display a dialog to select a footprint to be added and allows the user to set its position.
*/

View File

@ -674,11 +674,6 @@ TOOL_ACTION PCB_ACTIONS::zoneDuplicate( "pcbnew.EditorControl.zoneDuplicate",
_( "Duplicate Zone onto Layer..." ), _( "Duplicate zone outline onto a different layer" ),
BITMAPS::zone_duplicate );
TOOL_ACTION PCB_ACTIONS::placeTarget( "pcbnew.EditorControl.placeTarget",
AS_GLOBAL, 0, "",
_( "Add Layer Alignment Target" ), _( "Add a layer alignment target" ),
BITMAPS::add_pcb_target, AF_ACTIVATE );
TOOL_ACTION PCB_ACTIONS::placeFootprint( "pcbnew.EditorControl.placeFootprint",
AS_GLOBAL,
'A', LEGACY_HK_NAME( "Add Footprint" ),

View File

@ -160,7 +160,6 @@ public:
static TOOL_ACTION drawZoneCutout;
static TOOL_ACTION drawSimilarZone;
static TOOL_ACTION placeCharacteristics;
static TOOL_ACTION placeTarget;
static TOOL_ACTION placeStackup;
static TOOL_ACTION placeFootprint;
static TOOL_ACTION placeImportedGraphics;