KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pns_meander_placer_base.h
Go to the documentation of this file.
1/*
2 * KiRouter - a push-and-(sometimes-)shove PCB router
3 *
4 * Copyright (C) 2013-2015 CERN
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * @author Tomasz Wlostowski <[email protected]>
8 *
9 * This program is free software: you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation, either version 3 of the License, or (at your
12 * option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program. If not, see <http://www.gnu.org/licenses/>.
21 */
22
23#ifndef __PNS_MEANDER_PLACER_BASE_H
24#define __PNS_MEANDER_PLACER_BASE_H
25
26#include <math/vector2d.h>
27
29
30#include "pns_node.h"
31#include "pns_line.h"
32#include "pns_placement_algo.h"
33#include "pns_meander.h"
34
35namespace PNS {
36
37class ROUTER;
38class SHOVE;
39class OPTIMIZER;
40
46{
47public:
52 TUNED
53 };
54
55 MEANDER_PLACER_BASE( ROUTER* aRouter );
56 virtual ~MEANDER_PLACER_BASE();
57
61 virtual long long int TuningLengthResult() const = 0;
62
66 virtual int64_t TuningDelayResult() const { return 0; };
67
71 virtual TUNING_STATUS TuningStatus() const = 0;
72
78 virtual void AmplitudeStep( int aSign );
79
85 virtual void SpacingStep( int aSign );
86
92 virtual int Clearance();
93
99 virtual const MEANDER_SETTINGS& MeanderSettings() const;
100
101 /*
102 * Set the current meandering configuration.
103 *
104 * @param aSettings the settings.
105 */
106 virtual void UpdateSettings( const MEANDER_SETTINGS& aSettings);
107
115 virtual bool CheckFit( MEANDER_SHAPE* aShape )
116 {
117 return false;
118 }
119
120 virtual const ITEM_SET TunedPath() = 0;
121
122protected:
127 void tuneLineLength( MEANDERED_LINE& aTuned, long long int aElongation );
128
129 VECTOR2I getSnappedStartPoint( LINKED_ITEM* aStartItem, VECTOR2I aStartPoint );
130
136 long long int lineLength( const ITEM_SET& aLine, const SOLID* aStartPad, const SOLID* aEndPad ) const;
137
143 int64_t lineDelay( const ITEM_SET& aLine, const SOLID* aStartPad, const SOLID* aEndPad ) const;
144
147
150
153
156
161};
162
163}
164
165#endif // __PNS_MEANDER_PLACER_BASE_H
Represent a set of meanders fitted over a single or two lines.
Definition: pns_meander.h:447
Base class for Single trace & Differential pair meandering tools, as both of them share a lot of code...
virtual void UpdateSettings(const MEANDER_SETTINGS &aSettings)
void tuneLineLength(MEANDERED_LINE &aTuned, long long int aElongation)
Take a set of meanders in aTuned and tunes their length to extend the original line length by aElonga...
TUNING_STATUS
< Result of the length tuning operation
virtual void SpacingStep(int aSign)
Increase/decrease the current meandering spacing by one step.
int m_currentWidth
Meander settings.
virtual bool CheckFit(MEANDER_SHAPE *aShape)
Checks if it's OK to place the shape aShape (i.e.
virtual int64_t TuningDelayResult() const
Return the resultant delay or skew of the tuned traces.
MEANDER_SETTINGS m_settings
The current end point.
int64_t lineDelay(const ITEM_SET &aLine, const SOLID *aStartPad, const SOLID *aEndPad) const
Calculate the total delay of the line represented by an item set (tracks and vias)
virtual int Clearance()
Return the clearance of the track(s) being length tuned.
virtual const ITEM_SET TunedPath()=0
virtual TUNING_STATUS TuningStatus() const =0
Return the tuning status (too short, too long, etc.) of the trace(s) being tuned.
virtual const MEANDER_SETTINGS & MeanderSettings() const
Return the current meandering configuration.
NODE * m_world
Width of the meandered trace(s).
VECTOR2I getSnappedStartPoint(LINKED_ITEM *aStartItem, VECTOR2I aStartPoint)
long long int lineLength(const ITEM_SET &aLine, const SOLID *aStartPad, const SOLID *aEndPad) const
Calculate the total length of the line represented by an item set (tracks and vias)
virtual void AmplitudeStep(int aSign)
Increase/decreases the current meandering amplitude by one step.
virtual long long int TuningLengthResult() const =0
Return the resultant length or skew of the tuned traces.
Dimensions for the meandering algorithm.
Definition: pns_meander.h:68
The geometry of a single meander.
Definition: pns_meander.h:150
Keep the router "world" - i.e.
Definition: pns_node.h:232
Push and Shove diff pair dimensions (gap) settings dialog.