router: fix shortcut crash & inline dragging for inline dragging P&S
This commit is contained in:
parent
2fd493255d
commit
0ade919a98
|
@ -40,6 +40,7 @@ PNS_ROUTING_SETTINGS::PNS_ROUTING_SETTINGS()
|
||||||
m_smoothDraggedSegments = true;
|
m_smoothDraggedSegments = true;
|
||||||
m_canViolateDRC = false;
|
m_canViolateDRC = false;
|
||||||
m_freeAngleMode = false;
|
m_freeAngleMode = false;
|
||||||
|
m_inlineDragEnabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PNS_ROUTING_SETTINGS::Save ( TOOL_SETTINGS& aSettings ) const
|
void PNS_ROUTING_SETTINGS::Save ( TOOL_SETTINGS& aSettings ) const
|
||||||
|
@ -58,6 +59,7 @@ void PNS_ROUTING_SETTINGS::Save ( TOOL_SETTINGS& aSettings ) const
|
||||||
aSettings.Set( "CanViolateDRC", m_canViolateDRC );
|
aSettings.Set( "CanViolateDRC", m_canViolateDRC );
|
||||||
aSettings.Set( "SuggestFinish", m_suggestFinish );
|
aSettings.Set( "SuggestFinish", m_suggestFinish );
|
||||||
aSettings.Set( "FreeAngleMode", m_freeAngleMode );
|
aSettings.Set( "FreeAngleMode", m_freeAngleMode );
|
||||||
|
aSettings.Set( "InlineDragEnabled", m_inlineDragEnabled );
|
||||||
}
|
}
|
||||||
|
|
||||||
void PNS_ROUTING_SETTINGS::Load ( const TOOL_SETTINGS& aSettings )
|
void PNS_ROUTING_SETTINGS::Load ( const TOOL_SETTINGS& aSettings )
|
||||||
|
@ -76,6 +78,7 @@ void PNS_ROUTING_SETTINGS::Load ( const TOOL_SETTINGS& aSettings )
|
||||||
m_canViolateDRC = aSettings.Get( "CanViolateDRC", false );
|
m_canViolateDRC = aSettings.Get( "CanViolateDRC", false );
|
||||||
m_suggestFinish = aSettings.Get( "SuggestFinish", false );
|
m_suggestFinish = aSettings.Get( "SuggestFinish", false );
|
||||||
m_freeAngleMode = aSettings.Get( "FreeAngleMode", false );
|
m_freeAngleMode = aSettings.Get( "FreeAngleMode", false );
|
||||||
|
m_inlineDragEnabled = aSettings.Get( "InlineDragEnabled", false );
|
||||||
}
|
}
|
||||||
|
|
||||||
const DIRECTION_45 PNS_ROUTING_SETTINGS::InitialDirection() const
|
const DIRECTION_45 PNS_ROUTING_SETTINGS::InitialDirection() const
|
||||||
|
|
|
@ -131,6 +131,9 @@ public:
|
||||||
TIME_LIMIT WalkaroundTimeLimit() const;
|
TIME_LIMIT WalkaroundTimeLimit() const;
|
||||||
|
|
||||||
|
|
||||||
|
void SetInlineDragEnabled ( bool aEnable ) { m_inlineDragEnabled = aEnable; }
|
||||||
|
bool InlineDragEnabled( ) const { return m_inlineDragEnabled; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_shoveVias;
|
bool m_shoveVias;
|
||||||
bool m_startDiagonal;
|
bool m_startDiagonal;
|
||||||
|
@ -142,6 +145,7 @@ private:
|
||||||
bool m_smoothDraggedSegments;
|
bool m_smoothDraggedSegments;
|
||||||
bool m_canViolateDRC;
|
bool m_canViolateDRC;
|
||||||
bool m_freeAngleMode;
|
bool m_freeAngleMode;
|
||||||
|
bool m_inlineDragEnabled;
|
||||||
|
|
||||||
PNS_MODE m_routingMode;
|
PNS_MODE m_routingMode;
|
||||||
PNS_OPTIMIZATION_EFFORT m_optimizerEffort;
|
PNS_OPTIMIZATION_EFFORT m_optimizerEffort;
|
||||||
|
|
|
@ -247,7 +247,7 @@ void PNS_TOOL_BASE::updateEndItem( TOOL_EVENT& aEvent )
|
||||||
VECTOR2I p = getView()->ToWorld( mp );
|
VECTOR2I p = getView()->ToWorld( mp );
|
||||||
VECTOR2I cp = m_ctls->GetCursorPosition();
|
VECTOR2I cp = m_ctls->GetCursorPosition();
|
||||||
int layer;
|
int layer;
|
||||||
bool snapEnabled = !aEvent.Modifier( MD_CTRL );
|
bool snapEnabled = !aEvent.Modifier( MD_SHIFT );
|
||||||
|
|
||||||
m_router->EnableSnapping( snapEnabled );
|
m_router->EnableSnapping( snapEnabled );
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,11 @@ public:
|
||||||
|
|
||||||
virtual void Reset( RESET_REASON aReason );
|
virtual void Reset( RESET_REASON aReason );
|
||||||
|
|
||||||
|
const PNS_ROUTING_SETTINGS& PNSSettings() const
|
||||||
|
{
|
||||||
|
return m_savedSettings;
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual PNS_ITEM* pickSingleItem( const VECTOR2I& aWhere, int aNet = -1, int aLayer = -1 );
|
virtual PNS_ITEM* pickSingleItem( const VECTOR2I& aWhere, int aNet = -1, int aLayer = -1 );
|
||||||
|
|
|
@ -530,7 +530,7 @@ TOOL_ACTION COMMON_ACTIONS::routerActivateTuneDiffPairSkew( "pcbnew.LengthTuner.
|
||||||
_( "Tune skew of a differential pair" ), "", NULL, AF_ACTIVATE );
|
_( "Tune skew of a differential pair" ), "", NULL, AF_ACTIVATE );
|
||||||
|
|
||||||
TOOL_ACTION COMMON_ACTIONS::routerInlineDrag( "pcbnew.InteractiveRouter.InlineDrag",
|
TOOL_ACTION COMMON_ACTIONS::routerInlineDrag( "pcbnew.InteractiveRouter.InlineDrag",
|
||||||
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_DRAG_TRACK_KEEP_SLOPE ),
|
AS_GLOBAL, 0,
|
||||||
"", "" );
|
"", "" );
|
||||||
|
|
||||||
// Point editor
|
// Point editor
|
||||||
|
|
|
@ -49,6 +49,8 @@
|
||||||
#include "edit_tool.h"
|
#include "edit_tool.h"
|
||||||
#include "grid_helper.h"
|
#include "grid_helper.h"
|
||||||
|
|
||||||
|
#include <router/router_tool.h>
|
||||||
|
|
||||||
#include <dialogs/dialog_create_array.h>
|
#include <dialogs/dialog_create_array.h>
|
||||||
#include <dialogs/dialog_move_exact.h>
|
#include <dialogs/dialog_move_exact.h>
|
||||||
|
|
||||||
|
@ -105,11 +107,14 @@ bool EDIT_TOOL::invokeInlineRouter()
|
||||||
TRACK* track = uniqueSelected<TRACK>();
|
TRACK* track = uniqueSelected<TRACK>();
|
||||||
VIA* via = uniqueSelected<VIA>();
|
VIA* via = uniqueSelected<VIA>();
|
||||||
|
|
||||||
if ( !GetSettings().Get("DragInvokesRouter", false ) )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if( track || via )
|
if( track || via )
|
||||||
{
|
{
|
||||||
|
ROUTER_TOOL *theRouter = static_cast<ROUTER_TOOL*> ( m_toolMgr->FindTool( "pcbnew.InteractiveRouter" ) );
|
||||||
|
assert ( theRouter );
|
||||||
|
|
||||||
|
if( !theRouter->PNSSettings().InlineDragEnabled() )
|
||||||
|
return false;
|
||||||
|
|
||||||
m_toolMgr->RunAction( COMMON_ACTIONS::routerInlineDrag, true, track ? track : via );
|
m_toolMgr->RunAction( COMMON_ACTIONS::routerInlineDrag, true, track ? track : via );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue