KiCad PCB EDA Suite
PNS::MEANDER_PLACER_BASE Class Referenceabstract

MEANDER_PLACER_BASE. More...

#include <pns_meander_placer_base.h>

Inheritance diagram for PNS::MEANDER_PLACER_BASE:
PNS::PLACEMENT_ALGO PNS::ALGO_BASE PNS::DP_MEANDER_PLACER PNS::MEANDER_PLACER PNS::MEANDER_SKEW_PLACER

Public Types

enum  TUNING_STATUS { TOO_SHORT = 0, TOO_LONG, TUNED }
 

Result of the length tuning operation

More...
 

Public Member Functions

 MEANDER_PLACER_BASE (ROUTER *aRouter)
 
virtual ~MEANDER_PLACER_BASE ()
 
virtual const wxString TuningInfo (EDA_UNITS aUnits) const =0
 Function TuningInfo() More...
 
virtual TUNING_STATUS TuningStatus () const =0
 Function TuningStatus() More...
 
virtual void AmplitudeStep (int aSign)
 Function AmplitudeStep() More...
 
virtual void SpacingStep (int aSign)
 Function SpacingStep() More...
 
virtual const MEANDER_SETTINGSMeanderSettings () const
 Function MeanderSettings() More...
 
virtual void UpdateSettings (const MEANDER_SETTINGS &aSettings)
 
virtual bool CheckFit (MEANDER_SHAPE *aShape)
 Function CheckFit() More...
 
int GetTotalPadToDieLength (const LINE &aLine) const
 
virtual bool Start (const VECTOR2I &aP, ITEM *aStartItem)=0
 Function Start() More...
 
virtual bool Move (const VECTOR2I &aP, ITEM *aEndItem)=0
 Function Move() More...
 
virtual bool FixRoute (const VECTOR2I &aP, ITEM *aEndItem, bool aForceFinish=false)=0
 Function FixRoute() More...
 
virtual bool UnfixRoute ()
 
virtual bool CommitPlacement ()
 
virtual bool AbortPlacement ()
 
virtual bool HasPlacedAnything () const
 
virtual bool ToggleVia (bool aEnabled)
 Function ToggleVia() More...
 
virtual bool IsPlacingVia () const
 Function IsPlacingVia() More...
 
virtual bool SetLayer (int aLayer)
 Function SetLayer() More...
 
virtual const ITEM_SET Traces ()=0
 Function Traces() More...
 
virtual const VECTOR2ICurrentEnd () const =0
 Function CurrentEnd() More...
 
virtual const std::vector< int > CurrentNets () const =0
 Function CurrentNets() More...
 
virtual int CurrentLayer () const =0
 Function CurrentLayer() More...
 
virtual NODECurrentNode (bool aLoopsRemoved=false) const =0
 Function CurrentNode() More...
 
virtual void FlipPosture ()
 Function FlipPosture() More...
 
virtual void UpdateSizes (const SIZES_SETTINGS &aSizes)
 Function UpdateSizes() More...
 
virtual void SetOrthoMode (bool aOrthoMode)
 Function SetOrthoMode() More...
 
virtual void GetModifiedNets (std::vector< int > &aNets) const
 Function GetModifiedNets. More...
 
ROUTERRouter () const
 

Returns the instance of our router

More...
 
ROUTING_SETTINGSSettings () const
 

Returns current router settings

More...
 
virtual LOGGERLogger ()
 

Returns the logger object, allowing to dump geometry to a file.

More...
 
void SetLogger (LOGGER *aLogger)
 
void SetDebugDecorator (DEBUG_DECORATOR *aDecorator)
 Function SetDebugDecorator. More...
 
DEBUG_DECORATORDbg () const
 

Protected Member Functions

void cutTunedLine (const SHAPE_LINE_CHAIN &aOrigin, const VECTOR2I &aTuneStart, const VECTOR2I &aCursorPos, SHAPE_LINE_CHAIN &aPre, SHAPE_LINE_CHAIN &aTuned, SHAPE_LINE_CHAIN &aPost)
 Function cutTunedLine() More...
 
void tuneLineLength (MEANDERED_LINE &aTuned, long long int aElongation)
 Function tuneLineLength() More...
 
int compareWithTolerance (long long int aValue, long long int aExpected, long long int aTolerance=0) const
 Function compareWithTolerance() More...
 

Protected Attributes

NODEm_world
 

pointer to world to search colliding items

More...
 
int m_padToDieLenth
 

total length added by pad to die size

More...
 
int m_currentWidth
 

width of the meandered trace(s)

More...
 
MEANDER_SETTINGS m_settings
 

meandering settings

More...
 
VECTOR2I m_currentEnd
 

current end point

More...
 
DEBUG_DECORATORm_debugDecorator
 
ROUTERm_router
 
LOGGERm_logger
 

Detailed Description

MEANDER_PLACER_BASE.

Base class for Single trace & Differenial pair meandering tools, as both of them share a lot of code.

Definition at line 48 of file pns_meander_placer_base.h.

Member Enumeration Documentation

◆ TUNING_STATUS

Result of the length tuning operation

Enumerator
TOO_SHORT 
TOO_LONG 
TUNED 

Definition at line 52 of file pns_meander_placer_base.h.

Constructor & Destructor Documentation

◆ MEANDER_PLACER_BASE()

PNS::MEANDER_PLACER_BASE::MEANDER_PLACER_BASE ( ROUTER aRouter)

Definition at line 29 of file pns_meander_placer_base.cpp.

29  :
30  PLACEMENT_ALGO( aRouter )
31 {
32  m_world = NULL;
33  m_currentWidth = 0;
34  m_padToDieLenth = 0;
35 }
int m_currentWidth
width of the meandered trace(s)
#define NULL
NODE * m_world
pointer to world to search colliding items
int m_padToDieLenth
total length added by pad to die size
PLACEMENT_ALGO(ROUTER *aRouter)

References m_currentWidth, m_padToDieLenth, m_world, and NULL.

◆ ~MEANDER_PLACER_BASE()

PNS::MEANDER_PLACER_BASE::~MEANDER_PLACER_BASE ( )
virtual

Definition at line 38 of file pns_meander_placer_base.cpp.

39 {
40 }

Member Function Documentation

◆ AbortPlacement()

virtual bool PNS::PLACEMENT_ALGO::AbortPlacement ( )
inlinevirtualinherited

Reimplemented in PNS::LINE_PLACER, PNS::DIFF_PAIR_PLACER, PNS::DP_MEANDER_PLACER, and PNS::MEANDER_PLACER.

Definition at line 85 of file pns_placement_algo.h.

85 { return false; };

◆ AmplitudeStep()

void PNS::MEANDER_PLACER_BASE::AmplitudeStep ( int  aSign)
virtual

Function AmplitudeStep()

Increases/decreases the current meandering amplitude by one step.

Parameters
aSigndirection (negative = decrease, positive = increase).

Definition at line 43 of file pns_meander_placer_base.cpp.

44 {
45  int a = m_settings.m_maxAmplitude + aSign * m_settings.m_step;
46  a = std::max( a, m_settings.m_minAmplitude );
47 
49 }
int m_minAmplitude
minimum meandering amplitude
Definition: pns_meander.h:77
int m_step
amplitude/spacing adjustment step
Definition: pns_meander.h:83
MEANDER_SETTINGS m_settings
meandering settings
int m_maxAmplitude
maximum meandering amplitude
Definition: pns_meander.h:79

References PNS::MEANDER_SETTINGS::m_maxAmplitude, PNS::MEANDER_SETTINGS::m_minAmplitude, m_settings, and PNS::MEANDER_SETTINGS::m_step.

◆ CheckFit()

virtual bool PNS::MEANDER_PLACER_BASE::CheckFit ( MEANDER_SHAPE aShape)
inlinevirtual

Function CheckFit()

Checks if it's ok to place the shape aShape (i.e. if it doesn't cause DRC violations or collide with other meanders).

Parameters
aShapethe shape to check
Returns
true if the shape fits

Reimplemented in PNS::DP_MEANDER_PLACER, and PNS::MEANDER_PLACER.

Definition at line 118 of file pns_meander_placer_base.h.

119  {
120  return false;
121  }

Referenced by PNS::MEANDER_SHAPE::Fit().

◆ CommitPlacement()

virtual bool PNS::PLACEMENT_ALGO::CommitPlacement ( )
inlinevirtualinherited

Reimplemented in PNS::LINE_PLACER, PNS::DIFF_PAIR_PLACER, PNS::DP_MEANDER_PLACER, and PNS::MEANDER_PLACER.

Definition at line 83 of file pns_placement_algo.h.

83 { return false; };

◆ compareWithTolerance()

int PNS::MEANDER_PLACER_BASE::compareWithTolerance ( long long int  aValue,
long long int  aExpected,
long long int  aTolerance = 0 
) const
protected

Function compareWithTolerance()

Compares aValue against aExpected with given tolerance.

Definition at line 227 of file pns_meander_placer_base.cpp.

229 {
230  if( aValue < aExpected - aTolerance )
231  return -1;
232  else if( aValue > aExpected + aTolerance )
233  return 1;
234  else
235  return 0;
236 }

Referenced by PNS::MEANDER_PLACER::doMove(), and PNS::DP_MEANDER_PLACER::Move().

◆ CurrentEnd()

virtual const VECTOR2I& PNS::PLACEMENT_ALGO::CurrentEnd ( ) const
pure virtualinherited

Function CurrentEnd()

Returns the current end of the line(s) being placed/tuned. It may not be equal to the cursor position due to collisions.

Implemented in PNS::LINE_PLACER, PNS::DIFF_PAIR_PLACER, PNS::DP_MEANDER_PLACER, and PNS::MEANDER_PLACER.

◆ CurrentLayer()

virtual int PNS::PLACEMENT_ALGO::CurrentLayer ( ) const
pure virtualinherited

Function CurrentLayer()

Returns the layer of currently routed track.

Implemented in PNS::LINE_PLACER, PNS::DIFF_PAIR_PLACER, PNS::DP_MEANDER_PLACER, and PNS::MEANDER_PLACER.

◆ CurrentNets()

virtual const std::vector<int> PNS::PLACEMENT_ALGO::CurrentNets ( ) const
pure virtualinherited

Function CurrentNets()

Returns the net code(s) of currently routed track(s).

Implemented in PNS::LINE_PLACER, PNS::DIFF_PAIR_PLACER, PNS::DP_MEANDER_PLACER, and PNS::MEANDER_PLACER.

◆ CurrentNode()

virtual NODE* PNS::PLACEMENT_ALGO::CurrentNode ( bool  aLoopsRemoved = false) const
pure virtualinherited

Function CurrentNode()

Returns the most recent board state.

Implemented in PNS::LINE_PLACER, PNS::DIFF_PAIR_PLACER, PNS::DP_MEANDER_PLACER, and PNS::MEANDER_PLACER.

◆ cutTunedLine()

void PNS::MEANDER_PLACER_BASE::cutTunedLine ( const SHAPE_LINE_CHAIN aOrigin,
const VECTOR2I aTuneStart,
const VECTOR2I aCursorPos,
SHAPE_LINE_CHAIN aPre,
SHAPE_LINE_CHAIN aTuned,
SHAPE_LINE_CHAIN aPost 
)
protected

Function cutTunedLine()

Extracts the part of a track to be meandered, depending on the starting point and the cursor position.

Parameters
aOriginthe original line
aTuneStartpoint where we start meandering (start click coorinates)
aCursorPoscurrent cursor position
aPrepart before the beginning of meanders
aTunedpart to be meandered
aPostpart after the end of meanders

Definition at line 67 of file pns_meander_placer_base.cpp.

70 {
71  VECTOR2I cp ( aCursorPos );
72 
73  if( cp == aTuneStart ) // we don't like tuning segments with 0 length
74  {
75  int idx = aOrigin.FindSegment( cp );
76 
77  if( idx >= 0 )
78  {
79  const SEG& s = aOrigin.CSegment( idx );
80  cp += (s.B - s.A).Resize(2);
81  }
82  else
83  {
84  cp += VECTOR2I (2, 5); // some arbitrary value that is not 45 degrees oriented
85  }
86  }
87 
88  VECTOR2I n = aOrigin.NearestPoint( cp );
89  VECTOR2I m = aOrigin.NearestPoint( aTuneStart );
90 
91  SHAPE_LINE_CHAIN l( aOrigin );
92  l.Split( n );
93  l.Split( m );
94 
95  int i_start = l.Find( m );
96  int i_end = l.Find( n );
97 
98  if( i_start > i_end )
99  {
100  l = l.Reverse();
101  i_start = l.Find( m );
102  i_end = l.Find( n );
103  }
104 
105  aPre = l.Slice( 0, i_start );
106  aPost = l.Slice( i_end, -1 );
107  aTuned = l.Slice( i_start, i_end );
108 
109  aTuned.Simplify();
110 }
const VECTOR2I NearestPoint(const VECTOR2I &aP) const
Function NearestPoint()
int FindSegment(const VECTOR2I &aP) const
Function FindSegment()
const SHAPE_LINE_CHAIN Slice(int aStartIndex, int aEndIndex=-1) const
Function Slice()
VECTOR2< int > VECTOR2I
Definition: vector2d.h:594
SHAPE_LINE_CHAIN & Simplify()
Function Simplify()
Definition: seg.h:39
const SEG CSegment(int aIndex) const
Function CSegment()
SHAPE_LINE_CHAIN.
VECTOR2I A
Definition: seg.h:47
VECTOR2I B
Definition: seg.h:48

References SEG::A, SEG::B, SHAPE_LINE_CHAIN::CSegment(), SHAPE_LINE_CHAIN::Find(), SHAPE_LINE_CHAIN::FindSegment(), SHAPE_LINE_CHAIN::NearestPoint(), SHAPE_LINE_CHAIN::Reverse(), SHAPE_LINE_CHAIN::Simplify(), SHAPE_LINE_CHAIN::Slice(), and SHAPE_LINE_CHAIN::Split().

Referenced by PNS::MEANDER_PLACER::doMove(), and PNS::DP_MEANDER_PLACER::Move().

◆ Dbg()

◆ FixRoute()

virtual bool PNS::PLACEMENT_ALGO::FixRoute ( const VECTOR2I aP,
ITEM aEndItem,
bool  aForceFinish = false 
)
pure virtualinherited

Function FixRoute()

Commits the currently routed items to the parent node, taking aP as the final end point and aEndItem as the final anchor (if provided).

Returns
true, if route has been commited. May return false if the routing result is violating design rules - in such case, the track is only committed if Settings.CanViolateDRC() is on.

Implemented in PNS::LINE_PLACER, PNS::DIFF_PAIR_PLACER, PNS::DP_MEANDER_PLACER, and PNS::MEANDER_PLACER.

◆ FlipPosture()

virtual void PNS::PLACEMENT_ALGO::FlipPosture ( )
inlinevirtualinherited

Function FlipPosture()

Toggles the current posture (straight/diagonal) of the trace head.

Reimplemented in PNS::LINE_PLACER, and PNS::DIFF_PAIR_PLACER.

Definition at line 160 of file pns_placement_algo.h.

161  {
162  }

◆ GetModifiedNets()

virtual void PNS::PLACEMENT_ALGO::GetModifiedNets ( std::vector< int > &  aNets) const
inlinevirtualinherited

Function GetModifiedNets.

Returns the net codes of all currently routed trace(s)

Reimplemented in PNS::LINE_PLACER, and PNS::DIFF_PAIR_PLACER.

Definition at line 191 of file pns_placement_algo.h.

192  {
193  }

◆ GetTotalPadToDieLength()

int PNS::MEANDER_PLACER_BASE::GetTotalPadToDieLength ( const LINE aLine) const

Definition at line 183 of file pns_meander_placer_base.cpp.

184 {
185  int length = 0;
186  JOINT start;
187  JOINT end;
188 
189  m_world->FindLineEnds( aLine, start, end );
190 
191  // Extract the length of the pad to die for start and end pads
192  for( auto& link : start.LinkList() )
193  {
194  if( const SOLID* solid = dynamic_cast<const SOLID*>( link.item ) )
195  {
196  // If there are overlapping pads, choose the first with a non-zero length
197  if( solid->GetPadToDie() > 0 )
198  {
199  length += solid->GetPadToDie();
200  break;
201  }
202  }
203  }
204 
205  for( auto& link : end.LinkList() )
206  {
207  if( const SOLID* solid = dynamic_cast<const SOLID*>( link.item ) )
208  {
209  if( solid->GetPadToDie() > 0 )
210  {
211  length += solid->GetPadToDie();
212  break;
213  }
214  }
215  }
216 
217  return length;
218 }
void FindLineEnds(const LINE &aLine, JOINT &aA, JOINT &aB)
finds the joints corresponding to the ends of line aLine
Definition: pns_node.cpp:956
NODE * m_world
pointer to world to search colliding items

References PNS::NODE::FindLineEnds(), PNS::JOINT::LinkList(), and m_world.

Referenced by PNS::MEANDER_SKEW_PLACER::Start(), PNS::MEANDER_PLACER::Start(), and PNS::DP_MEANDER_PLACER::Start().

◆ HasPlacedAnything()

virtual bool PNS::PLACEMENT_ALGO::HasPlacedAnything ( ) const
inlinevirtualinherited

Reimplemented in PNS::LINE_PLACER, PNS::DIFF_PAIR_PLACER, PNS::DP_MEANDER_PLACER, and PNS::MEANDER_PLACER.

Definition at line 87 of file pns_placement_algo.h.

87 { return false; }

◆ IsPlacingVia()

virtual bool PNS::PLACEMENT_ALGO::IsPlacingVia ( ) const
inlinevirtualinherited

Function IsPlacingVia()

Returns true if the placer is placing a via (or more vias).

Reimplemented in PNS::LINE_PLACER, and PNS::DIFF_PAIR_PLACER.

Definition at line 104 of file pns_placement_algo.h.

105  {
106  return false;
107  }

◆ Logger()

LOGGER * PNS::ALGO_BASE::Logger ( )
virtualinherited

Returns the logger object, allowing to dump geometry to a file.

Reimplemented in PNS::SHOVE.

Definition at line 34 of file pns_algo_base.cpp.

35 {
36  return NULL;
37 }
#define NULL

References NULL.

Referenced by PNS::DRAGGER::dragWalkaround(), PNS::LINE_PLACER::rhShoveOnly(), PNS::LINE_PLACER::rhWalkOnly(), and PNS::DRAGGER::Start().

◆ MeanderSettings()

const MEANDER_SETTINGS & PNS::MEANDER_PLACER_BASE::MeanderSettings ( ) const
virtual

Function MeanderSettings()

Returns the current meandering configuration.

Returns
the settings

Definition at line 221 of file pns_meander_placer_base.cpp.

222 {
223  return m_settings;
224 }
MEANDER_SETTINGS m_settings
meandering settings

References m_settings.

Referenced by PNS::MEANDER_SHAPE::makeMiterShape(), LENGTH_TUNER_TOOL::meanderSettingsDialog(), PNS::MEANDER_SHAPE::Settings(), and PNS::MEANDERED_LINE::Settings().

◆ Move()

virtual bool PNS::PLACEMENT_ALGO::Move ( const VECTOR2I aP,
ITEM aEndItem 
)
pure virtualinherited

Function Move()

Moves the end of the currently routed primtive(s) to the point aP, taking aEndItem as the anchor (if not NULL). (unless NULL).

Implemented in PNS::LINE_PLACER, PNS::DIFF_PAIR_PLACER, PNS::DP_MEANDER_PLACER, PNS::MEANDER_PLACER, and PNS::MEANDER_SKEW_PLACER.

◆ Router()

◆ SetDebugDecorator()

void PNS::ALGO_BASE::SetDebugDecorator ( DEBUG_DECORATOR aDecorator)
inlineinherited

Function SetDebugDecorator.

Assign a debug decorator allowing this algo to draw extra graphics for visual debugging

Definition at line 72 of file pns_algo_base.h.

73  {
74  m_debugDecorator = aDecorator;
75  }
DEBUG_DECORATOR * m_debugDecorator
Definition: pns_algo_base.h:83

References PNS::ALGO_BASE::m_debugDecorator.

Referenced by PNS::DRAGGER::dragWalkaround(), PNS::LINE_PLACER::rhShoveOnly(), PNS::LINE_PLACER::rhWalkOnly(), and PNS::SHOVE::SHOVE().

◆ SetLayer()

virtual bool PNS::PLACEMENT_ALGO::SetLayer ( int  aLayer)
inlinevirtualinherited

Function SetLayer()

Sets the current routing layer.

Reimplemented in PNS::LINE_PLACER, and PNS::DIFF_PAIR_PLACER.

Definition at line 114 of file pns_placement_algo.h.

115  {
116  return false;
117  }

◆ SetLogger()

void PNS::ALGO_BASE::SetLogger ( LOGGER aLogger)
inlineinherited

Definition at line 62 of file pns_algo_base.h.

63  {
64  m_logger = aLogger;
65  }
LOGGER * m_logger
Definition: pns_algo_base.h:85

References PNS::ALGO_BASE::m_logger.

Referenced by PNS::DRAGGER::dragWalkaround(), PNS::LINE_PLACER::rhShoveOnly(), and PNS::LINE_PLACER::rhWalkOnly().

◆ SetOrthoMode()

virtual void PNS::PLACEMENT_ALGO::SetOrthoMode ( bool  aOrthoMode)
inlinevirtualinherited

Function SetOrthoMode()

Forces the router to place a straight 90/45 degree trace (with the end as near to the cursor as possible) instead of a standard 135 degree two-segment bend.

Reimplemented in PNS::LINE_PLACER, and PNS::DIFF_PAIR_PLACER.

Definition at line 182 of file pns_placement_algo.h.

183  {
184  }

◆ Settings()

◆ SpacingStep()

void PNS::MEANDER_PLACER_BASE::SpacingStep ( int  aSign)
virtual

Function SpacingStep()

Increases/decreases the current meandering spcing by one step.

Parameters
aSigndirection (negative = decrease, positive = increase).

Definition at line 52 of file pns_meander_placer_base.cpp.

53 {
54  int s = m_settings.m_spacing + aSign * m_settings.m_step;
55  s = std::max( s, 2 * m_currentWidth );
56 
58 }
int m_currentWidth
width of the meandered trace(s)
int m_step
amplitude/spacing adjustment step
Definition: pns_meander.h:83
MEANDER_SETTINGS m_settings
meandering settings
int m_spacing
meandering period/spacing (see dialog picture for explanation)
Definition: pns_meander.h:81

References m_currentWidth, m_settings, PNS::MEANDER_SETTINGS::m_spacing, and PNS::MEANDER_SETTINGS::m_step.

◆ Start()

virtual bool PNS::PLACEMENT_ALGO::Start ( const VECTOR2I aP,
ITEM aStartItem 
)
pure virtualinherited

Function Start()

Starts placement/drag operation at point aP, taking item aStartItem as anchor (unless NULL).

Implemented in PNS::LINE_PLACER, PNS::DIFF_PAIR_PLACER, PNS::DP_MEANDER_PLACER, PNS::MEANDER_PLACER, and PNS::MEANDER_SKEW_PLACER.

◆ ToggleVia()

virtual bool PNS::PLACEMENT_ALGO::ToggleVia ( bool  aEnabled)
inlinevirtualinherited

Function ToggleVia()

Enables/disables a via at the end of currently routed trace.

Reimplemented in PNS::LINE_PLACER, and PNS::DIFF_PAIR_PLACER.

Definition at line 94 of file pns_placement_algo.h.

95  {
96  return false;
97  }

◆ Traces()

virtual const ITEM_SET PNS::PLACEMENT_ALGO::Traces ( )
pure virtualinherited

Function Traces()

Returns all routed/tuned traces.

Implemented in PNS::LINE_PLACER, PNS::DIFF_PAIR_PLACER, PNS::DP_MEANDER_PLACER, and PNS::MEANDER_PLACER.

◆ tuneLineLength()

void PNS::MEANDER_PLACER_BASE::tuneLineLength ( MEANDERED_LINE aTuned,
long long int  aElongation 
)
protected

Function tuneLineLength()

Takes a set of meanders in aTuned and tunes their length to extend the original line length by aElongation.

Definition at line 113 of file pns_meander_placer_base.cpp.

114 {
115  long long int remaining = aElongation;
116  bool finished = false;
117 
118  for( MEANDER_SHAPE* m : aTuned.Meanders() )
119  {
120  if( m->Type() != MT_CORNER )
121  {
122  if( remaining >= 0 )
123  remaining -= m->MaxTunableLength() - m->BaselineLength();
124 
125  if( remaining < 0 )
126  {
127  if( !finished )
128  {
129  MEANDER_TYPE newType;
130 
131  if( m->Type() == MT_START || m->Type() == MT_SINGLE )
132  newType = MT_SINGLE;
133  else
134  newType = MT_FINISH;
135 
136  m->SetType( newType );
137  m->Recalculate();
138 
139  finished = true;
140  }
141  else
142  {
143  m->MakeEmpty();
144  }
145  }
146  }
147  }
148 
149  remaining = aElongation;
150  int meanderCount = 0;
151 
152  for( MEANDER_SHAPE* m : aTuned.Meanders() )
153  {
154  if( m->Type() != MT_CORNER && m->Type() != MT_EMPTY )
155  {
156  if(remaining >= 0)
157  {
158  remaining -= m->MaxTunableLength() - m->BaselineLength();
159  meanderCount ++;
160  }
161  }
162  }
163 
164  long long int balance = 0;
165 
166  if( meanderCount )
167  balance = -remaining / meanderCount;
168 
169  if( balance >= 0 )
170  {
171  for( MEANDER_SHAPE* m : aTuned.Meanders() )
172  {
173  if( m->Type() != MT_CORNER && m->Type() != MT_EMPTY )
174  {
175  m->Resize( std::max( m->Amplitude() - balance / 2,
176  (long long int) m_settings.m_minAmplitude ) );
177  }
178  }
179  }
180 }
int m_minAmplitude
minimum meandering amplitude
Definition: pns_meander.h:77
MEANDER_TYPE
Shapes of available meanders.
Definition: pns_meander.h:35
MEANDER_SETTINGS m_settings
meandering settings

References PNS::MEANDER_SETTINGS::m_minAmplitude, m_settings, PNS::MEANDERED_LINE::Meanders(), PNS::MT_CORNER, PNS::MT_EMPTY, PNS::MT_FINISH, PNS::MT_SINGLE, and PNS::MT_START.

Referenced by PNS::MEANDER_PLACER::doMove(), and PNS::DP_MEANDER_PLACER::Move().

◆ TuningInfo()

virtual const wxString PNS::MEANDER_PLACER_BASE::TuningInfo ( EDA_UNITS  aUnits) const
pure virtual

Function TuningInfo()

Returns a string describing the status and length of the tuned traces.

Implemented in PNS::DP_MEANDER_PLACER, PNS::MEANDER_PLACER, and PNS::MEANDER_SKEW_PLACER.

Referenced by PNS_TUNE_STATUS_POPUP::UpdateStatus().

◆ TuningStatus()

virtual TUNING_STATUS PNS::MEANDER_PLACER_BASE::TuningStatus ( ) const
pure virtual

Function TuningStatus()

Returns the tuning status (too short, too long, etc.) of the trace(s) being tuned.

Implemented in PNS::DP_MEANDER_PLACER, and PNS::MEANDER_PLACER.

Referenced by PNS_TUNE_STATUS_POPUP::UpdateStatus().

◆ UnfixRoute()

virtual bool PNS::PLACEMENT_ALGO::UnfixRoute ( )
inlinevirtualinherited

Reimplemented in PNS::LINE_PLACER.

Definition at line 81 of file pns_placement_algo.h.

81 { return false; };

◆ UpdateSettings()

void PNS::MEANDER_PLACER_BASE::UpdateSettings ( const MEANDER_SETTINGS aSettings)
virtual

Definition at line 61 of file pns_meander_placer_base.cpp.

62 {
63  m_settings = aSettings;
64 }
MEANDER_SETTINGS m_settings
meandering settings

References m_settings.

Referenced by LENGTH_TUNER_TOOL::meanderSettingsDialog().

◆ UpdateSizes()

virtual void PNS::PLACEMENT_ALGO::UpdateSizes ( const SIZES_SETTINGS aSizes)
inlinevirtualinherited

Function UpdateSizes()

Performs on-the-fly update of the width, via diameter & drill size from a settings class. Used to dynamically change these parameters as the track is routed.

Reimplemented in PNS::LINE_PLACER, and PNS::DIFF_PAIR_PLACER.

Definition at line 171 of file pns_placement_algo.h.

172  {
173  }

Member Data Documentation

◆ m_currentEnd

VECTOR2I PNS::MEANDER_PLACER_BASE::m_currentEnd
protected

◆ m_currentWidth

int PNS::MEANDER_PLACER_BASE::m_currentWidth
protected

◆ m_debugDecorator

DEBUG_DECORATOR* PNS::ALGO_BASE::m_debugDecorator
protectedinherited

Definition at line 83 of file pns_algo_base.h.

Referenced by PNS::ALGO_BASE::Dbg(), and PNS::ALGO_BASE::SetDebugDecorator().

◆ m_logger

LOGGER* PNS::ALGO_BASE::m_logger
protectedinherited

Definition at line 85 of file pns_algo_base.h.

Referenced by PNS::ALGO_BASE::SetLogger(), and PNS::WALKAROUND::singleStep().

◆ m_padToDieLenth

◆ m_router

◆ m_settings

◆ m_world


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