Horizon
Loading...
Searching...
No Matches
pns_dp_meander_placer.h
1/*
2 * KiRouter - a push-and-(sometimes-)shove PCB router
3 *
4 * Copyright (C) 2013-2014 CERN
5 * Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
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_DP_MEANDER_PLACER_H
24#define __PNS_DP_MEANDER_PLACER_H
25
26#include <math/vector2d.h>
27
28#include <geometry/shape.h>
29#include <geometry/shape_line_chain.h>
30
31#include "pns_node.h"
32#include "pns_via.h"
33#include "pns_line.h"
34#include "pns_placement_algo.h"
35#include "pns_meander.h"
36#include "pns_meander_placer_base.h"
37#include "pns_diff_pair.h"
38#include "pns_debug_decorator.h"
39
40namespace PNS {
41
42class ROUTER;
43
49{
50public:
51 DP_MEANDER_PLACER( ROUTER* aRouter );
53
58 bool Start( const VECTOR2I& aP, ITEM* aStartItem ) override;
59
64 bool Move( const VECTOR2I& aP, ITEM* aEndItem ) override;
65
74 bool FixRoute( const VECTOR2I& aP, ITEM* aEndItem, bool aForceFinish = false ) override;
75
77 bool CommitPlacement() override;
78
80 bool AbortPlacement() override;
81
83 bool HasPlacedAnything() const override;
84
85 const LINE Trace() const;
86
90 NODE* CurrentNode( bool aLoopsRemoved = false ) const override;
91
92 const ITEM_SET Traces() override;
93
94 const VECTOR2I& CurrentEnd() const override;
95
97 const std::vector<int> CurrentNets() const override;
98
99 int CurrentLayer() const override;
100
101 long long int totalLength();
102
103 const wxString TuningInfo( EDA_UNITS aUnits ) const override;
104 TUNING_STATUS TuningStatus() const override;
105
106 bool CheckFit( MEANDER_SHAPE* aShape ) override;
107
108
109private:
110 friend class MEANDER_SHAPE;
111
112 void meanderSegment( const SEG& aBase );
113
114// void addMeander ( PNS_MEANDER *aM );
115// void addCorner ( const VECTOR2I& aP );
116
117 const SEG baselineSegment( const DIFF_PAIR::COUPLED_SEGMENTS& aCoupledSegs );
118 bool pairOrientation( const DIFF_PAIR::COUPLED_SEGMENTS& aPair );
119
120 void setWorld( NODE* aWorld );
121 void release();
122
123 long long int origPathLength() const;
124
126 VECTOR2I m_currentStart;
127
129 NODE* m_currentNode;
130
131 DIFF_PAIR m_originPair;
132 DIFF_PAIR::COUPLED_SEGMENTS_VEC m_coupledSegments;
133
134 LINE m_currentTraceN, m_currentTraceP;
135 ITEM_SET m_tunedPath, m_tunedPathP, m_tunedPathN;
136
137 SHAPE_LINE_CHAIN m_finalShapeP, m_finalShapeN;
138 MEANDERED_LINE m_result;
139 LINKED_ITEM* m_initialSegment;
140
141 long long int m_lastLength;
142 int m_padToDieP;
143 int m_padToDieN;
144 TUNING_STATUS m_lastStatus;
145};
146
147}
148
149#endif // __PNS_DP_MEANDER_PLACER_H
Basic class for a differential pair.
Definition pns_diff_pair.h:235
Differential Pair length-matching/meandering tool.
Definition pns_dp_meander_placer.h:49
bool Start(const VECTOR2I &aP, ITEM *aStartItem) override
Start routing a single track at point aP, taking item aStartItem as anchor (unless NULL).
Definition pns_dp_meander_placer.cpp:72
bool CheckFit(MEANDER_SHAPE *aShape) override
Checks if it's OK to place the shape aShape (i.e.
Definition pns_dp_meander_placer.cpp:387
const ITEM_SET Traces() override
Function Traces()
Definition pns_dp_meander_placer.cpp:405
bool AbortPlacement() override
Definition pns_dp_meander_placer.cpp:364
const std::vector< int > CurrentNets() const override
Function CurrentNets()
Definition pns_dp_meander_placer.cpp:466
bool FixRoute(const VECTOR2I &aP, ITEM *aEndItem, bool aForceFinish=false) override
Commit the currently routed track to the parent node, taking aP as the final end point and aEndItem a...
Definition pns_dp_meander_placer.cpp:350
int CurrentLayer() const override
Function CurrentLayer()
Definition pns_dp_meander_placer.cpp:425
TUNING_STATUS TuningStatus() const override
Return the tuning status (too short, too long, etc.) of the trace(s) being tuned.
Definition pns_dp_meander_placer.cpp:461
const wxString TuningInfo(EDA_UNITS aUnits) const override
Return a string describing the status and length of the tuned traces.
Definition pns_dp_meander_placer.cpp:431
bool HasPlacedAnything() const override
Definition pns_dp_meander_placer.cpp:371
bool CommitPlacement() override
Definition pns_dp_meander_placer.cpp:377
bool Move(const VECTOR2I &aP, ITEM *aEndItem) override
Move the end of the currently routed trace to the point aP, taking aEndItem as anchor (if not NULL).
Definition pns_dp_meander_placer.cpp:169
const VECTOR2I & CurrentEnd() const override
Function CurrentEnd()
Definition pns_dp_meander_placer.cpp:419
NODE * CurrentNode(bool aLoopsRemoved=false) const override
Return the most recent world state.
Definition pns_dp_meander_placer.cpp:63
Definition pns_itemset.h:37
Base class for PNS router board items.
Definition pns_item.h:57
Represents a track on a PCB, connecting two non-trivial joints (that is, vias, pads,...
Definition pns_line.h:61
Definition pns_linked_item.h:30
Represent a set of meanders fitted over a single or two lines.
Definition pns_meander.h:386
Base class for Single trace & Differential pair meandering tools, as both of them share a lot of code...
Definition pns_meander_placer_base.h:47
TUNING_STATUS
< Result of the length tuning operation
Definition pns_meander_placer_base.h:50
The geometry of a single meander.
Definition pns_meander.h:111
Keep the router "world" - i.e.
Definition pns_node.h:148
Definition pns_router.h:116
Definition seg.h:41
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
Definition shape_line_chain.h:81
Definition wx_compat.h:13
Definition pns_diff_pair.h:238