KiCad PCB EDA Suite
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 (C) 2016 KiCad Developers, see AUTHORS.txt for contributors.
6  * Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
7  *
8  * This program is free software: you can redistribute it and/or modify it
9  * under the terms of the GNU General Public License as published by the
10  * Free Software Foundation, either version 3 of the License, or (at your
11  * option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef __PNS_MEANDER_PLACER_BASE_H
23 #define __PNS_MEANDER_PLACER_BASE_H
24 
25 #include <math/vector2d.h>
26 
27 #include <geometry/shape.h>
29 
30 #include "pns_node.h"
31 #include "pns_via.h"
32 #include "pns_line.h"
33 #include "pns_placement_algo.h"
34 #include "pns_meander.h"
35 
36 namespace PNS {
37 
38 class ROUTER;
39 class SHOVE;
40 class OPTIMIZER;
41 
49 {
50 public:
53  TOO_SHORT = 0,
56  };
57 
58  MEANDER_PLACER_BASE( ROUTER* aRouter );
59  virtual ~MEANDER_PLACER_BASE();
60 
67  virtual const wxString TuningInfo() const = 0;
68 
75  virtual TUNING_STATUS TuningStatus() const = 0;
76 
83  virtual void AmplitudeStep( int aSign );
84 
91  virtual void SpacingStep( int aSign );
92 
99  virtual const MEANDER_SETTINGS& MeanderSettings() const;
100 
101  /*
102  * Function UpdateSettings()
103  *
104  * Sets the current meandering configuration.
105  * @param aSettings the settings
106  */
107  virtual void UpdateSettings( const MEANDER_SETTINGS& aSettings);
108 
118  virtual bool CheckFit( MEANDER_SHAPE* aShape )
119  {
120  return false;
121  }
122 
123 protected:
124 
137  void cutTunedLine( const SHAPE_LINE_CHAIN& aOrigin,
138  const VECTOR2I& aTuneStart,
139  const VECTOR2I& aCursorPos,
140  SHAPE_LINE_CHAIN& aPre,
141  SHAPE_LINE_CHAIN& aTuned,
142  SHAPE_LINE_CHAIN& aPost );
143 
150  void tuneLineLength( MEANDERED_LINE& aTuned, int aElongation );
151 
157  int compareWithTolerance ( int aValue, int aExpected, int aTolerance = 0 ) const;
158 
165 };
166 
167 }
168 
169 #endif // __PNS_MEANDER_PLACER_BASE_H
Class MEANDER_PLACER_BASE.
Class MEANDER_SETTINGS.
Definition: pns_meander.h:104
virtual const wxString TuningInfo() const =0
Function TuningInfo()
VECTOR2I m_currentEnd
current end point
Class MEANDER_SETTINGS.
Definition: pns_meander.h:57
virtual bool CheckFit(MEANDER_SHAPE *aShape)
Function CheckFit()
virtual void UpdateSettings(const MEANDER_SETTINGS &aSettings)
TUNING_STATUS
Result of the length tuning operation
virtual TUNING_STATUS TuningStatus() const =0
Function TuningStatus()
int m_currentWidth
width of the meandered trace(s)
Class PLACEMENT_ALGO.
void tuneLineLength(MEANDERED_LINE &aTuned, int aElongation)
Function tuneLineLength()
virtual void SpacingStep(int aSign)
Function SpacingStep()
Class MEANDERED_LINE.
Definition: pns_meander.h:395
int compareWithTolerance(int aValue, int aExpected, int aTolerance=0) const
Function compareWithTolerance()
MEANDER_SETTINGS m_settings
meandering settings
Class SHAPE_LINE_CHAIN.
virtual const MEANDER_SETTINGS & MeanderSettings() const
Function MeanderSettings()
virtual void AmplitudeStep(int aSign)
Function AmplitudeStep()
Push and Shove diff pair dimensions (gap) settings dialog.
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()