KiCad PCB EDA Suite
PNS::ROUTING_SETTINGS Class Reference

Class ROUTING_SETTINGS. More...

#include <pns_routing_settings.h>

Public Member Functions

 ROUTING_SETTINGS ()
 
void Load (const TOOL_SETTINGS &where)
 
void Save (TOOL_SETTINGS &where) const
 
PNS_MODE Mode () const
 

Returns the routing mode.

More...
 
void SetMode (PNS_MODE aMode)
 

Sets the routing mode.

More...
 
PNS_OPTIMIZATION_EFFORT OptimizerEffort () const
 

Returns the optimizer effort. Bigger means cleaner traces, but slower routing.

More...
 
void SetOptimizerEffort (PNS_OPTIMIZATION_EFFORT aEffort)
 

Sets the optimizer effort. Bigger means cleaner traces, but slower routing.

More...
 
bool ShoveVias () const
 

Returns true if shoving vias is enbled.

More...
 
void SetShoveVias (bool aShoveVias)
 

Enables/disables shoving vias.

More...
 
bool RemoveLoops () const
 

Returns true if loop (redundant track) removal is on.

More...
 
void SetRemoveLoops (bool aRemoveLoops)
 

Enables/disables loop (redundant track) removal.

More...
 
bool SuggestFinish ()
 

Returns true if suggesting the finish of currently placed track is on.

More...
 
void SetSuggestFinish (bool aSuggestFinish)
 

Enables displaying suggestions for finishing the currently placed track.

More...
 
bool SmartPads () const
 

Returns true if Smart Pads (automatic neckdown) is enabled.

More...
 
void SetSmartPads (bool aSmartPads)
 

Enables/disables Smart Pads (automatic neckdown).

More...
 
bool FollowMouse () const
 

Returns true if follow mouse mode is active (permanently on for the moment).

More...
 
bool SmoothDraggedSegments () const
 

Returns true if smoothing segments durign dragging is enabled.

More...
 
void SetSmoothDraggedSegments (bool aSmooth)
 

Enables/disabled smoothing segments during dragging.

More...
 
bool JumpOverObstacles () const
 

Returns true if jumping over unmovable obstacles is on.

More...
 
void SetJumpOverObstacles (bool aJumpOverObstacles)
 

Enables/disables jumping over unmovable obstacles.

More...
 
void SetStartDiagonal (bool aStartDiagonal)
 
bool CanViolateDRC () const
 
void SetCanViolateDRC (bool aViolate)
 
bool GetFreeAngleMode () const
 
void SetFreeAngleMode (bool aEnable)
 
const DIRECTION_45 InitialDirection () const
 
int ShoveIterationLimit () const
 
TIME_LIMIT ShoveTimeLimit () const
 
int WalkaroundIterationLimit () const
 
TIME_LIMIT WalkaroundTimeLimit () const
 
void SetInlineDragEnabled (bool aEnable)
 
bool InlineDragEnabled () const
 
void SetSnapToTracks (bool aSnap)
 
void SetSnapToPads (bool aSnap)
 
bool GetSnapToTracks () const
 
bool GetSnapToPads () const
 

Private Attributes

bool m_shoveVias
 
bool m_startDiagonal
 
bool m_removeLoops
 
bool m_smartPads
 
bool m_suggestFinish
 
bool m_followMouse
 
bool m_jumpOverObstacles
 
bool m_smoothDraggedSegments
 
bool m_canViolateDRC
 
bool m_freeAngleMode
 
bool m_inlineDragEnabled
 
bool m_snapToTracks
 
bool m_snapToPads
 
PNS_MODE m_routingMode
 
PNS_OPTIMIZATION_EFFORT m_optimizerEffort
 
int m_walkaroundIterationLimit
 
int m_shoveIterationLimit
 
TIME_LIMIT m_shoveTimeLimit
 
TIME_LIMIT m_walkaroundTimeLimit
 

Detailed Description

Class ROUTING_SETTINGS.

Contains all persistent settings of the router, such as the mode, optimization effort, etc.

Definition at line 57 of file pns_routing_settings.h.

Constructor & Destructor Documentation

PNS::ROUTING_SETTINGS::ROUTING_SETTINGS ( )

Definition at line 30 of file pns_routing_settings.cpp.

References m_canViolateDRC, m_followMouse, m_freeAngleMode, m_inlineDragEnabled, m_jumpOverObstacles, m_optimizerEffort, m_removeLoops, m_routingMode, m_shoveIterationLimit, m_shoveTimeLimit, m_shoveVias, m_smartPads, m_smoothDraggedSegments, m_snapToPads, m_snapToTracks, m_startDiagonal, m_suggestFinish, m_walkaroundIterationLimit, PNS::OE_MEDIUM, and PNS::RM_Walkaround.

31 {
34  m_removeLoops = true;
35  m_smartPads = true;
36  m_shoveVias = true;
37  m_suggestFinish = false;
38  m_followMouse = true;
39  m_startDiagonal = false;
41  m_shoveTimeLimit = 1000;
43  m_jumpOverObstacles = false;
45  m_canViolateDRC = false;
46  m_freeAngleMode = false;
47  m_inlineDragEnabled = false;
48  m_snapToTracks = false;
49  m_snapToPads = false;
50 }
PNS_OPTIMIZATION_EFFORT m_optimizerEffort

Member Function Documentation

bool PNS::ROUTING_SETTINGS::CanViolateDRC ( ) const
inline

Definition at line 121 of file pns_routing_settings.h.

References m_canViolateDRC.

Referenced by DIALOG_PNS_SETTINGS::DIALOG_PNS_SETTINGS().

bool PNS::ROUTING_SETTINGS::FollowMouse ( ) const
inline

Returns true if follow mouse mode is active (permanently on for the moment).

Definition at line 102 of file pns_routing_settings.h.

References m_followMouse, Mode(), and PNS::RM_MarkObstacles.

Referenced by PNS::LINE_PLACER::routeStep().

103  {
104  return m_followMouse && !( Mode() == RM_MarkObstacles );
105  }
PNS_MODE Mode() const
Returns the routing mode.
bool PNS::ROUTING_SETTINGS::GetFreeAngleMode ( ) const
inline

Definition at line 124 of file pns_routing_settings.h.

References m_freeAngleMode.

Referenced by DIALOG_PNS_SETTINGS::DIALOG_PNS_SETTINGS().

bool PNS::ROUTING_SETTINGS::GetSnapToPads ( ) const
inline

Definition at line 143 of file pns_routing_settings.h.

References m_snapToPads.

143 { return m_snapToPads; }
bool PNS::ROUTING_SETTINGS::GetSnapToTracks ( ) const
inline

Definition at line 142 of file pns_routing_settings.h.

References m_snapToTracks.

const DIRECTION_45 PNS::ROUTING_SETTINGS::InitialDirection ( ) const

Definition at line 93 of file pns_routing_settings.cpp.

References m_startDiagonal, DIRECTION_45::N, and DIRECTION_45::NE.

94 {
95  if( m_startDiagonal )
97  else
98  return DIRECTION_45( DIRECTION_45::N );
99 }
Class DIRECTION_45.
Definition: direction45.h:33
bool PNS::ROUTING_SETTINGS::InlineDragEnabled ( ) const
inline
bool PNS::ROUTING_SETTINGS::JumpOverObstacles ( ) const
inline

Returns true if jumping over unmovable obstacles is on.

Definition at line 114 of file pns_routing_settings.h.

References m_jumpOverObstacles.

Referenced by DIALOG_PNS_SETTINGS::DIALOG_PNS_SETTINGS().

void PNS::ROUTING_SETTINGS::Load ( const TOOL_SETTINGS where)

Definition at line 73 of file pns_routing_settings.cpp.

References TOOL_SETTINGS::Get(), m_canViolateDRC, m_freeAngleMode, m_inlineDragEnabled, m_jumpOverObstacles, m_optimizerEffort, m_removeLoops, m_routingMode, m_shoveIterationLimit, m_shoveTimeLimit, m_shoveVias, m_smartPads, m_smoothDraggedSegments, m_startDiagonal, m_suggestFinish, m_walkaroundIterationLimit, PNS::OE_MEDIUM, PNS::RM_Walkaround, and PNS::TIME_LIMIT::Set().

Referenced by ROUTER_TOOL::Init().

74 {
75  m_routingMode = (PNS_MODE) aSettings.Get( "Mode", (int) RM_Walkaround );
76  m_optimizerEffort = (PNS_OPTIMIZATION_EFFORT) aSettings.Get( "OptimizerEffort", (int) OE_MEDIUM );
77  m_removeLoops = aSettings.Get( "RemoveLoops", true );
78  m_smartPads = aSettings.Get( "SmartPads", true );
79  m_shoveVias = aSettings.Get( "ShoveVias", true );
80  m_startDiagonal = aSettings.Get( "StartDiagonal", false );
81  m_shoveTimeLimit.Set( aSettings.Get( "ShoveTimeLimit", 1000 ) );
82  m_shoveIterationLimit = aSettings.Get( "ShoveIterationLimit", 250 );
83  m_walkaroundIterationLimit = aSettings.Get( "WalkaroundIterationLimit", 50 );
84  m_jumpOverObstacles = aSettings.Get( "JumpOverObstacles", false );
85  m_smoothDraggedSegments = aSettings.Get( "SmoothDraggedSegments", true );
86  m_canViolateDRC = aSettings.Get( "CanViolateDRC", false );
87  m_suggestFinish = aSettings.Get( "SuggestFinish", false );
88  m_freeAngleMode = aSettings.Get( "FreeAngleMode", false );
89  m_inlineDragEnabled = aSettings.Get( "InlineDragEnabled", false );
90 }
PNS_MODE
Routing modes
void Set(int aMilliseconds)
Definition: time_limit.cpp:51
PNS_OPTIMIZATION_EFFORT m_optimizerEffort
PNS_OPTIMIZATION_EFFORT
Optimization effort
PNS_MODE PNS::ROUTING_SETTINGS::Mode ( ) const
inline
PNS_OPTIMIZATION_EFFORT PNS::ROUTING_SETTINGS::OptimizerEffort ( ) const
inline

Returns the optimizer effort. Bigger means cleaner traces, but slower routing.

Definition at line 72 of file pns_routing_settings.h.

References m_optimizerEffort.

Referenced by DIALOG_PNS_SETTINGS::DIALOG_PNS_SETTINGS(), and PNS::SHOVE::runOptimizer().

72 { return m_optimizerEffort; }
PNS_OPTIMIZATION_EFFORT m_optimizerEffort
bool PNS::ROUTING_SETTINGS::RemoveLoops ( ) const
inline

Returns true if loop (redundant track) removal is on.

Definition at line 84 of file pns_routing_settings.h.

References m_removeLoops.

Referenced by DIALOG_PNS_SETTINGS::DIALOG_PNS_SETTINGS(), and PNS::LINE_PLACER::Move().

void PNS::ROUTING_SETTINGS::Save ( TOOL_SETTINGS where) const

Definition at line 53 of file pns_routing_settings.cpp.

References PNS::TIME_LIMIT::Get(), m_canViolateDRC, m_freeAngleMode, m_inlineDragEnabled, m_jumpOverObstacles, m_optimizerEffort, m_removeLoops, m_routingMode, m_shoveIterationLimit, m_shoveTimeLimit, m_shoveVias, m_smartPads, m_smoothDraggedSegments, m_startDiagonal, m_suggestFinish, m_walkaroundIterationLimit, and TOOL_SETTINGS::Set().

Referenced by ROUTER_TOOL::~ROUTER_TOOL().

54 {
55  aSettings.Set( "Mode", (int) m_routingMode );
56  aSettings.Set( "OptimizerEffort", (int) m_optimizerEffort );
57  aSettings.Set( "RemoveLoops", m_removeLoops );
58  aSettings.Set( "SmartPads", m_smartPads );
59  aSettings.Set( "ShoveVias", m_shoveVias );
60  aSettings.Set( "StartDiagonal", m_startDiagonal );
61  aSettings.Set( "ShoveTimeLimit", m_shoveTimeLimit.Get() );
62  aSettings.Set( "ShoveIterationLimit", m_shoveIterationLimit );
63  aSettings.Set( "WalkaroundIterationLimit", m_walkaroundIterationLimit );
64  aSettings.Set( "JumpOverObstacles", m_jumpOverObstacles );
65  aSettings.Set( "SmoothDraggedSegments", m_smoothDraggedSegments );
66  aSettings.Set( "CanViolateDRC", m_canViolateDRC );
67  aSettings.Set( "SuggestFinish", m_suggestFinish );
68  aSettings.Set( "FreeAngleMode", m_freeAngleMode );
69  aSettings.Set( "InlineDragEnabled", m_inlineDragEnabled );
70 }
PNS_OPTIMIZATION_EFFORT m_optimizerEffort
int Get() const
Definition: time_limit.h:39
void PNS::ROUTING_SETTINGS::SetCanViolateDRC ( bool  aViolate)
inline

Definition at line 122 of file pns_routing_settings.h.

References m_canViolateDRC.

Referenced by DIALOG_PNS_SETTINGS::OnOkClick().

122 { m_canViolateDRC = aViolate; }
void PNS::ROUTING_SETTINGS::SetFreeAngleMode ( bool  aEnable)
inline

Definition at line 126 of file pns_routing_settings.h.

References m_freeAngleMode.

Referenced by DIALOG_PNS_SETTINGS::OnOkClick().

126 { m_freeAngleMode = aEnable; }
void PNS::ROUTING_SETTINGS::SetInlineDragEnabled ( bool  aEnable)
inline

Definition at line 136 of file pns_routing_settings.h.

References m_inlineDragEnabled.

Referenced by DIALOG_PNS_SETTINGS::OnOkClick().

136 { m_inlineDragEnabled = aEnable; }
void PNS::ROUTING_SETTINGS::SetJumpOverObstacles ( bool  aJumpOverObstacles)
inline

Enables/disables jumping over unmovable obstacles.

Definition at line 117 of file pns_routing_settings.h.

References m_jumpOverObstacles.

Referenced by DIALOG_PNS_SETTINGS::OnOkClick().

117 { m_jumpOverObstacles = aJumpOverObstacles; }
void PNS::ROUTING_SETTINGS::SetMode ( PNS_MODE  aMode)
inline

Sets the routing mode.

Definition at line 69 of file pns_routing_settings.h.

References m_routingMode.

Referenced by DIALOG_PNS_SETTINGS::OnOkClick().

69 { m_routingMode = aMode; }
void PNS::ROUTING_SETTINGS::SetOptimizerEffort ( PNS_OPTIMIZATION_EFFORT  aEffort)
inline

Sets the optimizer effort. Bigger means cleaner traces, but slower routing.

Definition at line 75 of file pns_routing_settings.h.

References m_optimizerEffort.

Referenced by DIALOG_PNS_SETTINGS::OnOkClick().

75 { m_optimizerEffort = aEffort; }
PNS_OPTIMIZATION_EFFORT m_optimizerEffort
void PNS::ROUTING_SETTINGS::SetRemoveLoops ( bool  aRemoveLoops)
inline

Enables/disables loop (redundant track) removal.

Definition at line 87 of file pns_routing_settings.h.

References m_removeLoops.

Referenced by DIALOG_PNS_SETTINGS::OnOkClick().

87 { m_removeLoops = aRemoveLoops; }
void PNS::ROUTING_SETTINGS::SetShoveVias ( bool  aShoveVias)
inline

Enables/disables shoving vias.

Definition at line 81 of file pns_routing_settings.h.

References m_shoveVias.

Referenced by DIALOG_PNS_SETTINGS::OnOkClick().

81 { m_shoveVias = aShoveVias; }
void PNS::ROUTING_SETTINGS::SetSmartPads ( bool  aSmartPads)
inline

Enables/disables Smart Pads (automatic neckdown).

Definition at line 99 of file pns_routing_settings.h.

References m_smartPads.

Referenced by DIALOG_PNS_SETTINGS::OnOkClick().

99 { m_smartPads = aSmartPads; }
void PNS::ROUTING_SETTINGS::SetSmoothDraggedSegments ( bool  aSmooth)
inline

Enables/disabled smoothing segments during dragging.

Definition at line 111 of file pns_routing_settings.h.

References m_smoothDraggedSegments.

Referenced by DIALOG_PNS_SETTINGS::OnOkClick().

void PNS::ROUTING_SETTINGS::SetSnapToPads ( bool  aSnap)
inline

Definition at line 140 of file pns_routing_settings.h.

References m_snapToPads.

140 { m_snapToPads = aSnap; }
void PNS::ROUTING_SETTINGS::SetSnapToTracks ( bool  aSnap)
inline

Definition at line 139 of file pns_routing_settings.h.

References m_snapToTracks.

139 { m_snapToTracks = aSnap; }
void PNS::ROUTING_SETTINGS::SetStartDiagonal ( bool  aStartDiagonal)
inline

Definition at line 119 of file pns_routing_settings.h.

References m_startDiagonal.

119 { m_startDiagonal = aStartDiagonal; }
void PNS::ROUTING_SETTINGS::SetSuggestFinish ( bool  aSuggestFinish)
inline

Enables displaying suggestions for finishing the currently placed track.

Definition at line 93 of file pns_routing_settings.h.

References m_suggestFinish.

Referenced by DIALOG_PNS_SETTINGS::OnOkClick().

93 { m_suggestFinish = aSuggestFinish; }
int PNS::ROUTING_SETTINGS::ShoveIterationLimit ( ) const

Definition at line 108 of file pns_routing_settings.cpp.

References m_shoveIterationLimit.

Referenced by PNS::SHOVE::shoveMainLoop().

109 {
110  return m_shoveIterationLimit;
111 }
TIME_LIMIT PNS::ROUTING_SETTINGS::ShoveTimeLimit ( ) const

Definition at line 102 of file pns_routing_settings.cpp.

References m_shoveTimeLimit.

Referenced by PNS::SHOVE::shoveMainLoop().

103 {
104  return TIME_LIMIT ( m_shoveTimeLimit );
105 }
bool PNS::ROUTING_SETTINGS::ShoveVias ( ) const
inline

Returns true if shoving vias is enbled.

Definition at line 78 of file pns_routing_settings.h.

References m_shoveVias.

Referenced by DIALOG_PNS_SETTINGS::DIALOG_PNS_SETTINGS().

bool PNS::ROUTING_SETTINGS::SmartPads ( ) const
inline

Returns true if Smart Pads (automatic neckdown) is enabled.

Definition at line 96 of file pns_routing_settings.h.

References m_smartPads.

Referenced by DIALOG_PNS_SETTINGS::DIALOG_PNS_SETTINGS().

bool PNS::ROUTING_SETTINGS::SmoothDraggedSegments ( ) const
inline

Returns true if smoothing segments durign dragging is enabled.

Definition at line 108 of file pns_routing_settings.h.

References m_smoothDraggedSegments.

Referenced by DIALOG_PNS_SETTINGS::DIALOG_PNS_SETTINGS(), PNS::DRAGGER::dragMarkObstacles(), and PNS::DRAGGER::dragShove().

bool PNS::ROUTING_SETTINGS::SuggestFinish ( )
inline

Returns true if suggesting the finish of currently placed track is on.

Definition at line 90 of file pns_routing_settings.h.

References m_suggestFinish.

Referenced by DIALOG_PNS_SETTINGS::DIALOG_PNS_SETTINGS().

int PNS::ROUTING_SETTINGS::WalkaroundIterationLimit ( ) const
inline

Definition at line 133 of file pns_routing_settings.h.

References m_walkaroundIterationLimit.

TIME_LIMIT PNS::ROUTING_SETTINGS::WalkaroundTimeLimit ( ) const

Member Data Documentation

bool PNS::ROUTING_SETTINGS::m_canViolateDRC
private

Definition at line 154 of file pns_routing_settings.h.

Referenced by CanViolateDRC(), Load(), ROUTING_SETTINGS(), Save(), and SetCanViolateDRC().

bool PNS::ROUTING_SETTINGS::m_followMouse
private

Definition at line 151 of file pns_routing_settings.h.

Referenced by FollowMouse(), and ROUTING_SETTINGS().

bool PNS::ROUTING_SETTINGS::m_freeAngleMode
private
bool PNS::ROUTING_SETTINGS::m_inlineDragEnabled
private
bool PNS::ROUTING_SETTINGS::m_jumpOverObstacles
private
PNS_OPTIMIZATION_EFFORT PNS::ROUTING_SETTINGS::m_optimizerEffort
private
bool PNS::ROUTING_SETTINGS::m_removeLoops
private

Definition at line 148 of file pns_routing_settings.h.

Referenced by Load(), RemoveLoops(), ROUTING_SETTINGS(), Save(), and SetRemoveLoops().

PNS_MODE PNS::ROUTING_SETTINGS::m_routingMode
private

Definition at line 160 of file pns_routing_settings.h.

Referenced by Load(), Mode(), ROUTING_SETTINGS(), Save(), and SetMode().

int PNS::ROUTING_SETTINGS::m_shoveIterationLimit
private

Definition at line 164 of file pns_routing_settings.h.

Referenced by Load(), ROUTING_SETTINGS(), Save(), and ShoveIterationLimit().

TIME_LIMIT PNS::ROUTING_SETTINGS::m_shoveTimeLimit
private

Definition at line 165 of file pns_routing_settings.h.

Referenced by Load(), ROUTING_SETTINGS(), Save(), and ShoveTimeLimit().

bool PNS::ROUTING_SETTINGS::m_shoveVias
private

Definition at line 146 of file pns_routing_settings.h.

Referenced by Load(), ROUTING_SETTINGS(), Save(), SetShoveVias(), and ShoveVias().

bool PNS::ROUTING_SETTINGS::m_smartPads
private

Definition at line 149 of file pns_routing_settings.h.

Referenced by Load(), ROUTING_SETTINGS(), Save(), SetSmartPads(), and SmartPads().

bool PNS::ROUTING_SETTINGS::m_smoothDraggedSegments
private
bool PNS::ROUTING_SETTINGS::m_snapToPads
private

Definition at line 158 of file pns_routing_settings.h.

Referenced by GetSnapToPads(), ROUTING_SETTINGS(), and SetSnapToPads().

bool PNS::ROUTING_SETTINGS::m_snapToTracks
private

Definition at line 157 of file pns_routing_settings.h.

Referenced by GetSnapToTracks(), ROUTING_SETTINGS(), and SetSnapToTracks().

bool PNS::ROUTING_SETTINGS::m_startDiagonal
private
bool PNS::ROUTING_SETTINGS::m_suggestFinish
private

Definition at line 150 of file pns_routing_settings.h.

Referenced by Load(), ROUTING_SETTINGS(), Save(), SetSuggestFinish(), and SuggestFinish().

int PNS::ROUTING_SETTINGS::m_walkaroundIterationLimit
private

Definition at line 163 of file pns_routing_settings.h.

Referenced by Load(), ROUTING_SETTINGS(), Save(), and WalkaroundIterationLimit().

TIME_LIMIT PNS::ROUTING_SETTINGS::m_walkaroundTimeLimit
private

Definition at line 166 of file pns_routing_settings.h.


The documentation for this class was generated from the following files: