KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcb_tuning_pattern.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2023 Alex Shvartzkop <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#include <eda_item.h>
27#include <pcb_base_edit_frame.h>
28#include <router/pns_meander.h>
30#include <router/pns_router.h>
32
33
34namespace KIGFX
35{
36 class VIEW;
37 class RENDER_SETTINGS;
38}
39
46
47
49{
50public:
52
53 wxString GetClass() const override;
54
55#if defined(DEBUG)
56 void Show( int nestLevel, std::ostream& os ) const override;
57#endif
58
59 VECTOR2I GetPosition() const override;
60 void SetPosition( const VECTOR2I& aPos ) override;
61
62 void SetMinMax( const double aMin, const double aMax );
63 void SetChainMinMax( const double aMin, const double aMax );
64
65 void ClearMinMax();
66 void ClearChainMinMax();
67
68 void SetCurrent( const double aCurrent, const wxString& aLabel );
69
70 void SetIsTimeDomain( const bool aIsTimeDomain );
71
72 const BOX2I ViewBBox() const override;
73
74 std::vector<int> ViewGetLayers() const override;
75
76 void ViewDraw( int aLayer, KIGFX::VIEW* aView ) const override;
77
78protected:
81 double m_min;
82 double m_max;
83 double m_current;
84 wxString m_currentLabel; // Header line label ("current length" etc.)
85 wxString m_currentText; // (unused now for dual-line layout but kept for compatibility)
86 wxString m_minText;
87 wxString m_maxText;
88 double m_chainMin = 0.0;
89 double m_chainMax = 0.0;
93 wxString m_scopeLine;
94 wxString m_netValue;
95 wxString m_chainValue;
96 bool m_hasSignalValue = false;
97public:
98 void SetScopeLine( const wxString& aLine ) { m_scopeLine = aLine; }
99 void SetNetAndSignalValues( const wxString& aNetVal, const wxString& aSignalVal, bool aHasSignal )
100 {
101 m_netValue = aNetVal;
102 m_chainValue = aSignalVal;
103 m_hasSignalValue = aHasSignal;
104 }
105};
106
107
109{
110public:
111 static const wxString GENERATOR_TYPE;
112 static const wxString DISPLAY_NAME;
113
114 PCB_TUNING_PATTERN( BOARD_ITEM* aParent = nullptr, PCB_LAYER_ID aLayer = F_Cu,
116
117 wxString GetGeneratorType() const override { return wxS( "tuning_pattern" ); }
118
119 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override
120 {
121 return _( "Tuning Pattern" );
122 }
123
124 wxString GetFriendlyName() const override
125 {
126 return _( "Tuning Pattern" );
127 }
128
129 wxString GetPluralName() const override
130 {
131 return _( "Tuning Patterns" );
132 }
133
134 wxString GetCommitMessage() const override
135 {
136 return _( "Edit Tuning Pattern" );
137 }
138
139 BITMAPS GetMenuImage() const override
140 {
141 switch( m_tuningMode )
142 {
143 case SINGLE: return BITMAPS::ps_tune_length; break;
146 }
147
148 return BITMAPS::unknown;
149 }
150
152 BOARD_CONNECTED_ITEM* aStartItem,
153 LENGTH_TUNING_MODE aMode );
154
155 void EditStart( GENERATOR_TOOL* aTool, BOARD* aBoard, BOARD_COMMIT* aCommit ) override;
156 bool Update( GENERATOR_TOOL* aTool, BOARD* aBoard, BOARD_COMMIT* aCommit ) override;
157 void EditFinish( GENERATOR_TOOL* aTool, BOARD* aBoard, BOARD_COMMIT* aCommit ) override;
158 void EditCancel( GENERATOR_TOOL* aTool, BOARD* aBoard, BOARD_COMMIT* aCommit ) override;
159
160 void Remove( GENERATOR_TOOL* aTool, BOARD* aBoard, BOARD_COMMIT* aCommit ) override;
161
162 bool MakeEditPoints( EDIT_POINTS& points ) const override;
163
164 bool UpdateFromEditPoints( EDIT_POINTS& aEditPoints ) override;
165
166 bool UpdateEditPoints( EDIT_POINTS& aEditPoints ) override;
167
168 void Move( const VECTOR2I& aMoveVector ) override
169 {
170 m_origin += aMoveVector;
171 m_end += aMoveVector;
172
173 if( !this->HasFlag( IN_EDIT ) )
174 {
175 PCB_GROUP::Move( aMoveVector );
176
177 if( m_baseLine )
178 m_baseLine->Move( aMoveVector );
179
181 m_baseLineCoupled->Move( aMoveVector );
182 }
183 }
184
185 void Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle ) override
186 {
187 if( !this->HasFlag( IN_EDIT ) )
188 {
189 PCB_GENERATOR::Rotate( aRotCentre, aAngle );
190 RotatePoint( m_end, aRotCentre, aAngle );
191
192 if( m_baseLine )
193 m_baseLine->Rotate( aAngle, aRotCentre );
194
196 m_baseLineCoupled->Rotate( aAngle, aRotCentre );
197 }
198 }
199
200 void Flip( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection ) override
201 {
202 if( !this->HasFlag( IN_EDIT ) )
203 {
204 PCB_GENERATOR::Flip( aCentre, aFlipDirection );
205
206 baseMirror( aCentre, aFlipDirection );
207 }
208 }
209
210 void Mirror( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection ) override
211 {
212 if( !this->HasFlag( IN_EDIT ) )
213 {
214 PCB_GENERATOR::Mirror( aCentre, aFlipDirection );
215
216 baseMirror( aCentre, aFlipDirection );
217 }
218 }
219
220 void SetLayer( PCB_LAYER_ID aLayer ) override
221 {
222 PCB_GENERATOR::SetLayer( aLayer );
223
224 for( BOARD_ITEM* item : GetBoardItems() )
225 item->SetLayer( aLayer );
226 }
227
228 PCB_LAYER_ID GetLayer() const override
229 {
230 for( BOARD_ITEM* item : GetBoardItems() )
231 {
232 if( PCB_TRACK* track = dynamic_cast<PCB_TRACK*>( item ) )
233 return track->GetLayer();
234 }
235
237 }
238
239 const BOX2I GetBoundingBox() const override
240 {
241 return getOutline().BBox();
242 }
243
244 std::vector<int> ViewGetLayers() const override
245 {
246 return { LAYER_ANCHOR, GetLayer() };
247 }
248
249 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override
250 {
251 return getOutline().Collide( aPosition, aAccuracy );
252 }
253
254 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy ) const override
255 {
256 bool anyItems = false;
257
258 for( BOARD_ITEM* item : GetBoardItems() )
259 {
260 anyItems = true;
261
262 if( aContained )
263 {
264 if( !item->HitTest( aRect, true, aAccuracy ) )
265 return false;
266 }
267 else if( item->HitTest( aRect, false, aAccuracy ) )
268 {
269 return true;
270 }
271 }
272
273 if( anyItems )
274 return aContained;
275
276 BOX2I sel = aRect;
277
278 if( aAccuracy )
279 sel.Inflate( aAccuracy );
280
281 // Convert selection box to polygon for accurate hit testing against the actual outline
282 SHAPE_LINE_CHAIN selPoly(
283 {
284 sel.GetOrigin(),
285 VECTOR2I( sel.GetRight(), sel.GetTop() ),
286 sel.GetEnd(),
287 VECTOR2I( sel.GetLeft(), sel.GetBottom() )
288 },
289 true );
290
291 return KIGEOM::ShapeHitTest( selPoly, getOutline(), aContained );
292 }
293
294 bool HitTest( const SHAPE_LINE_CHAIN& aPoly, bool aContained ) const override
295 {
296 bool anyItems = false;
297
298 for( BOARD_ITEM* item : GetBoardItems() )
299 {
300 anyItems = true;
301
302 if( aContained )
303 {
304 if( !item->HitTest( aPoly, true ) )
305 return false;
306 }
307 else if( item->HitTest( aPoly, false ) )
308 {
309 return true;
310 }
311 }
312
313 if( anyItems )
314 return aContained;
315
316 return KIGEOM::ShapeHitTest( aPoly, getOutline(), aContained );
317 }
318
319 const BOX2I ViewBBox() const override { return GetBoundingBox(); }
320
321 EDA_ITEM* Clone() const override { return new PCB_TUNING_PATTERN( *this ); }
322
323 void ViewDraw( int aLayer, KIGFX::VIEW* aView ) const override final;
324
325 const VECTOR2I& GetEnd() const { return m_end; }
326 void SetEnd( const VECTOR2I& aValue ) { m_end = aValue; }
327
328 int GetEndX() const { return m_end.x; }
329 void SetEndX( int aValue ) { m_end.x = aValue; }
330
331 int GetEndY() const { return m_end.y; }
332 void SetEndY( int aValue ) { m_end.y = aValue; }
333
334 int GetWidth() const
335 {
336 for( BOARD_ITEM* item : GetBoardItems() )
337 if( PCB_TRACK* track = dynamic_cast<PCB_TRACK*>( item ) )
338 return track->GetWidth();
339
340 return m_trackWidth;
341 }
342
343 void SetWidth( int aValue )
344 {
345 m_trackWidth = aValue;
346
347 for( BOARD_ITEM* item : GetBoardItems() )
348 if( PCB_TRACK* track = dynamic_cast<PCB_TRACK*>( item ) )
349 track->SetWidth( aValue );
350 }
351
352 int GetNetCode() const
353 {
354 for( BOARD_ITEM* item : GetBoardItems() )
355 if( BOARD_CONNECTED_ITEM* bci = dynamic_cast<BOARD_CONNECTED_ITEM*>( item ) )
356 return bci->GetNetCode();
357
358 return 0;
359 }
360
361 void SetNetCode( int aNetCode )
362 {
363 if( BOARD* board = GetBoard() )
364 {
365 if( NETINFO_ITEM* net = board->FindNet( aNetCode ) )
366 m_lastNetName = net->GetNetname();
367 else
368 m_lastNetName.clear();
369 }
370
371 for( BOARD_ITEM* item : GetBoardItems() )
372 if( BOARD_CONNECTED_ITEM* bci = dynamic_cast<BOARD_CONNECTED_ITEM*>( item ) )
373 bci->SetNetCode( aNetCode );
374 }
375
376 bool HasSolderMask() const
377 {
378 for( BOARD_ITEM* item : GetBoardItems() )
379 if( PCB_TRACK* track = dynamic_cast<PCB_TRACK*>( item ) )
380 return track->HasSolderMask();
381
382 return true;
383 }
384
385 void SetHasSolderMask( bool aVal )
386 {
387 for( BOARD_ITEM* item : GetBoardItems() )
388 if( PCB_TRACK* track = dynamic_cast<PCB_TRACK*>( item ) )
389 track->SetHasSolderMask( aVal );
390 }
391
392 std::optional<int> GetLocalSolderMaskMargin() const
393 {
394 for( BOARD_ITEM* item : GetBoardItems() )
395 if( PCB_TRACK* track = dynamic_cast<PCB_TRACK*>( item ) )
396 return track->GetLocalSolderMaskMargin();
397
398 return std::optional<int>();
399 }
400
401 void SetLocalSolderMaskMargin( std::optional<int> aMargin )
402 {
403 for( BOARD_ITEM* item : GetBoardItems() )
404 if( PCB_TRACK* track = dynamic_cast<PCB_TRACK*>( item ) )
405 track->SetLocalSolderMaskMargin( aMargin );
406 }
407
409
420
422
423 int GetMinAmplitude() const { return m_settings.m_minAmplitude; }
424 void SetMinAmplitude( int aValue )
425 {
426 aValue = std::max( aValue, 0 );
427
428 m_settings.m_minAmplitude = aValue;
429
430 if( m_settings.m_maxAmplitude < m_settings.m_minAmplitude )
431 m_settings.m_maxAmplitude = m_settings.m_minAmplitude;
432 }
433
434 int GetMaxAmplitude() const { return m_settings.m_maxAmplitude; }
435 void SetMaxAmplitude( int aValue )
436 {
437 aValue = std::max( aValue, 0 );
438
439 m_settings.m_maxAmplitude = aValue;
440
441 if( m_settings.m_maxAmplitude < m_settings.m_minAmplitude )
442 m_settings.m_minAmplitude = m_settings.m_maxAmplitude;
443 }
444
445 // Update the initial side one time at EditStart based on m_end.
447
448 PNS::MEANDER_SIDE GetInitialSide() const { return m_settings.m_initialSide; }
449 void SetInitialSide( PNS::MEANDER_SIDE aValue ) { m_settings.m_initialSide = aValue; }
450
451 int GetSpacing() const { return m_settings.m_spacing; }
452 void SetSpacing( int aValue ) { m_settings.m_spacing = aValue; }
453
454 std::optional<int> GetTargetLength() const
455 {
456 if( m_settings.m_targetLength.Opt() == PNS::MEANDER_SETTINGS::LENGTH_UNCONSTRAINED )
457 return std::optional<int>();
458 else
459 return m_settings.m_targetLength.Opt();
460 }
461
462 void SetTargetLength( std::optional<int> aValue )
463 {
464 m_settings.m_isTimeDomain = false;
465
466 if( aValue.has_value() )
467 m_settings.SetTargetLength( aValue.value() );
468 else
470 }
471
472 std::optional<int> GetTargetDelay() const
473 {
474 if( m_settings.m_targetLengthDelay.Opt() == PNS::MEANDER_SETTINGS::DELAY_UNCONSTRAINED )
475 return std::optional<int>();
476 else
477 return m_settings.m_targetLengthDelay.Opt();
478 }
479
480 void SetTargetDelay( std::optional<int> aValue )
481 {
482 m_settings.m_isTimeDomain = true;
483
484 if( aValue.has_value() )
485 m_settings.SetTargetLengthDelay( aValue.value() );
486 else
488 }
489
490 int GetTargetSkew() const { return m_settings.m_targetSkew.Opt(); }
491 void SetTargetSkew( int aValue ) { m_settings.SetTargetSkew( aValue ); }
492
493 int GetTargetSkewDelay() const { return m_settings.m_targetSkewDelay.Opt(); }
494 void SetTargetSkewDelay( int aValue ) { m_settings.SetTargetSkewDelay( aValue ); }
495
496 bool GetOverrideCustomRules() const { return m_settings.m_overrideCustomRules; }
497 void SetOverrideCustomRules( bool aOverride ) { m_settings.m_overrideCustomRules = aOverride; }
498
499 int GetCornerRadiusPercentage() const { return m_settings.m_cornerRadiusPercentage; }
500 void SetCornerRadiusPercentage( int aValue ) { m_settings.m_cornerRadiusPercentage = aValue; }
501
502 bool IsSingleSided() const { return m_settings.m_singleSided; }
503 void SetSingleSided( bool aValue ) { m_settings.m_singleSided = aValue; }
504
505 bool IsRounded() const { return m_settings.m_cornerStyle == PNS::MEANDER_STYLE_ROUND; }
506 void SetRounded( bool aFlag ) { m_settings.m_cornerStyle = aFlag ? PNS::MEANDER_STYLE_ROUND
508
509 std::vector<std::pair<wxString, wxVariant>> GetRowData() override
510 {
511 std::vector<std::pair<wxString, wxVariant>> data = PCB_GENERATOR::GetRowData();
512 data.emplace_back( _HKI( "Net" ), m_lastNetName );
513 data.emplace_back( _HKI( "Tuning" ), m_tuningInfo );
514 return data;
515 }
516
517 const STRING_ANY_MAP GetProperties() const override;
518 void SetProperties( const STRING_ANY_MAP& aProps ) override;
519
520 void ShowPropertiesDialog( PCB_BASE_EDIT_FRAME* aEditFrame ) override;
521
522 std::vector<EDA_ITEM*> GetPreviewItems( GENERATOR_TOOL* aTool, PCB_BASE_EDIT_FRAME* aFrame,
523 bool aStatusItemsOnly = false ) override;
524
525 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
526
527protected:
528 void swapData( BOARD_ITEM* aImage ) override
529 {
530 wxASSERT( aImage->Type() == PCB_GENERATOR_T );
531
532 std::swap( *this, *static_cast<PCB_TUNING_PATTERN*>( aImage ) );
533 }
534
535 bool recoverBaseline( PNS::ROUTER* aRouter );
536
537 bool baselineValid();
538
539 bool initBaseLine( PNS::ROUTER* aRouter, int aPNSLayer, BOARD* aBoard, VECTOR2I& aStart,
540 VECTOR2I& aEnd, NETINFO_ITEM* aNet,
541 std::optional<SHAPE_LINE_CHAIN>& aBaseLine );
542
543 bool initBaseLines( PNS::ROUTER* aRouter, int aPNSLayer, BOARD* aBoard );
544
545 bool removeToBaseline( PNS::ROUTER* aRouter, int aPNSLayer, SHAPE_LINE_CHAIN& aBaseLine );
546
547 bool resetToBaseline( GENERATOR_TOOL* aTool, int aPNSLayer, SHAPE_LINE_CHAIN& aBaseLine,
548 bool aPrimary );
549
551
552 void baseMirror( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection )
553 {
554 PCB_GENERATOR::baseMirror( aCentre, aFlipDirection );
555
556 if( m_baseLine )
557 {
558 m_baseLine->Mirror( aCentre, aFlipDirection );
559 m_origin = m_baseLine->CPoint( 0 );
560 m_end = m_baseLine->CLastPoint();
561 }
562
564 m_baseLineCoupled->Mirror( aCentre, aFlipDirection );
565
566 if( m_settings.m_initialSide == PNS::MEANDER_SIDE_RIGHT )
567 m_settings.m_initialSide = PNS::MEANDER_SIDE_LEFT;
568 else
569 m_settings.m_initialSide = PNS::MEANDER_SIDE_RIGHT;
570 }
571
572protected:
574
576
577 std::optional<SHAPE_LINE_CHAIN> m_baseLine;
578 std::optional<SHAPE_LINE_CHAIN> m_baseLineCoupled;
579
582
584
586 wxString m_tuningInfo;
587 long long m_tuningLength;
588
590
592
593 // Bridging cache (pad-to-pad gaps across 2-net series components in a chain)
594public:
595 long long GetCachedBridgingLength( BOARD* aBoard, const wxString& aNetChain, double* aDelayIUOut );
596
597private:
603};
BITMAPS
A list of all bitmap identifiers.
@ ps_diff_pair_tune_length
@ ps_diff_pair_tune_phase
BOX2< VECTOR2I > BOX2I
Definition box2.h:922
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
BOARD_ITEM(BOARD_ITEM *aParent, KICAD_T idtype, PCB_LAYER_ID aLayer=F_Cu)
Definition board_item.h:86
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition board_item.h:268
friend class BOARD
Definition board_item.h:494
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:323
constexpr BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
Definition box2.h:558
constexpr const Vec GetEnd() const
Definition box2.h:212
constexpr coord_type GetLeft() const
Definition box2.h:228
constexpr const Vec & GetOrigin() const
Definition box2.h:210
constexpr coord_type GetRight() const
Definition box2.h:217
constexpr coord_type GetTop() const
Definition box2.h:229
constexpr coord_type GetBottom() const
Definition box2.h:222
The base class for create windows for drawing purpose.
A base class for most all the KiCad significant classes used in schematics and boards.
Definition eda_item.h:100
KICAD_T Type() const
Returns the type of object.
Definition eda_item.h:112
bool HasFlag(EDA_ITEM_FLAGS aFlag) const
Definition eda_item.h:153
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType, bool isSCH_ITEM=false, bool isBOARD_ITEM=false)
Definition eda_item.cpp:41
EDIT_POINTS is a VIEW_ITEM that manages EDIT_POINTs and EDIT_LINEs and draws them.
Handle actions specific to filling copper zones.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition view.h:67
Handle the data for a net.
Definition netinfo.h:50
Common, abstract interface for edit frames.
void baseMirror(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection)
virtual void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
void Flip(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Flip this object, i.e.
PCB_GENERATOR(BOARD_ITEM *aParent, PCB_LAYER_ID aLayer)
void Mirror(const VECTOR2I &aCentre, FLIP_DIRECTION aMirrorDirection) override
Mirror this object relative to a given horizontal axis the layer is not changed.
VECTOR2I m_origin
virtual std::vector< std::pair< wxString, wxVariant > > GetRowData()
void Move(const VECTOR2I &aMoveVector) override
Move this object.
std::unordered_set< BOARD_ITEM * > GetBoardItems() const
void SetTargetSkew(int aValue)
void Mirror(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Mirror this object relative to a given horizontal axis the layer is not changed.
bool initBaseLines(PNS::ROUTER *aRouter, int aPNSLayer, BOARD *aBoard)
const STRING_ANY_MAP GetProperties() const override
bool HitTest(const BOX2I &aRect, bool aContained, int aAccuracy) const override
Test if aPosition is inside or on the boundary of this item.
void SetEnd(const VECTOR2I &aValue)
void SetLocalSolderMaskMargin(std::optional< int > aMargin)
void SetMinAmplitude(int aValue)
void SetSpacing(int aValue)
wxString GetGeneratorType() const override
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
std::vector< int > ViewGetLayers() const override
bool HitTest(const SHAPE_LINE_CHAIN &aPoly, bool aContained) const override
Test if aPosition is inside or on the boundary of this item.
static const wxString DISPLAY_NAME
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
PNS::ROUTER_MODE GetPNSMode()
bool initBaseLine(PNS::ROUTER *aRouter, int aPNSLayer, BOARD *aBoard, VECTOR2I &aStart, VECTOR2I &aEnd, NETINFO_ITEM *aNet, std::optional< SHAPE_LINE_CHAIN > &aBaseLine)
void SetTargetSkewDelay(int aValue)
PCB_TUNING_PATTERN(BOARD_ITEM *aParent=nullptr, PCB_LAYER_ID aLayer=F_Cu, LENGTH_TUNING_MODE aMode=LENGTH_TUNING_MODE::SINGLE)
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
void swapData(BOARD_ITEM *aImage) override
void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
bool recoverBaseline(PNS::ROUTER *aRouter)
void SetWidth(int aValue)
PNS::MEANDER_SIDE GetInitialSide() const
std::optional< int > GetLocalSolderMaskMargin() const
const VECTOR2I & GetEnd() const
void SetInitialSide(PNS::MEANDER_SIDE aValue)
wxString GetFriendlyName() const override
void SetTargetDelay(std::optional< int > aValue)
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
wxString GetCommitMessage() const override
LENGTH_TUNING_MODE GetTuningMode() const
void SetHasSolderMask(bool aVal)
std::optional< int > GetTargetDelay() const
void Move(const VECTOR2I &aMoveVector) override
Move this object.
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
std::vector< EDA_ITEM * > GetPreviewItems(GENERATOR_TOOL *aTool, PCB_BASE_EDIT_FRAME *aFrame, bool aStatusItemsOnly=false) override
void Flip(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Flip this object, i.e.
void EditStart(GENERATOR_TOOL *aTool, BOARD *aBoard, BOARD_COMMIT *aCommit) override
void baseMirror(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection)
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
long long GetCachedBridgingLength(BOARD *aBoard, const wxString &aNetChain, double *aDelayIUOut)
void SetOverrideCustomRules(bool aOverride)
void SetRounded(bool aFlag)
LENGTH_TUNING_MODE m_tuningMode
std::vector< std::pair< wxString, wxVariant > > GetRowData() override
static const wxString GENERATOR_TYPE
bool resetToBaseline(GENERATOR_TOOL *aTool, int aPNSLayer, SHAPE_LINE_CHAIN &aBaseLine, bool aPrimary)
bool MakeEditPoints(EDIT_POINTS &points) const override
void SetCornerRadiusPercentage(int aValue)
PNS::MEANDER_PLACER_BASE::TUNING_STATUS m_tuningStatus
std::optional< SHAPE_LINE_CHAIN > m_baseLineCoupled
const BOARD * m_cachedBridgingBoardPtr
void SetProperties(const STRING_ANY_MAP &aProps) override
wxString GetPluralName() const override
void ViewDraw(int aLayer, KIGFX::VIEW *aView) const override final
Draw the parts of the object belonging to layer aLayer.
void Remove(GENERATOR_TOOL *aTool, BOARD *aBoard, BOARD_COMMIT *aCommit) override
bool UpdateFromEditPoints(EDIT_POINTS &aEditPoints) override
std::optional< SHAPE_LINE_CHAIN > m_baseLine
PNS::MEANDER_SETTINGS m_settings
void SetEndX(int aValue)
void ShowPropertiesDialog(PCB_BASE_EDIT_FRAME *aEditFrame) override
PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
bool Update(GENERATOR_TOOL *aTool, BOARD *aBoard, BOARD_COMMIT *aCommit) override
void SetNetCode(int aNetCode)
bool UpdateEditPoints(EDIT_POINTS &aEditPoints) override
void EditCancel(GENERATOR_TOOL *aTool, BOARD *aBoard, BOARD_COMMIT *aCommit) override
bool GetOverrideCustomRules() const
void SetMaxAmplitude(int aValue)
PNS::MEANDER_SETTINGS & GetSettings()
void SetSingleSided(bool aValue)
bool removeToBaseline(PNS::ROUTER *aRouter, int aPNSLayer, SHAPE_LINE_CHAIN &aBaseLine)
std::optional< int > GetTargetLength() const
void EditFinish(GENERATOR_TOOL *aTool, BOARD *aBoard, BOARD_COMMIT *aCommit) override
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
int GetCornerRadiusPercentage() const
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
SHAPE_LINE_CHAIN getOutline() const
void SetEndY(int aValue)
void SetTargetLength(std::optional< int > aValue)
static PCB_TUNING_PATTERN * CreateNew(GENERATOR_TOOL *aTool, PCB_BASE_EDIT_FRAME *aFrame, BOARD_CONNECTED_ITEM *aStartItem, LENGTH_TUNING_MODE aMode)
TUNING_STATUS
< Result of the length tuning operation
Dimensions for the meandering algorithm.
Definition pns_meander.h:70
static const long long int LENGTH_UNCONSTRAINED
Definition pns_meander.h:73
static const long long int DELAY_UNCONSTRAINED
Definition pns_meander.h:76
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
virtual bool Collide(const VECTOR2I &aP, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override
Check if point aP lies closer to us than aClearance.
const BOX2I BBox(int aClearance=0) const override
Compute a bounding box of the shape, with a margin of aClearance a collision.
A name/value tuple with unique names and wxAny values.
void SetIsTimeDomain(const bool aIsTimeDomain)
void SetCurrent(const double aCurrent, const wxString &aLabel)
wxString GetClass() const override
Return the class name.
VECTOR2I GetPosition() const override
void SetScopeLine(const wxString &aLine)
void SetMinMax(const double aMin, const double aMax)
void ViewDraw(int aLayer, KIGFX::VIEW *aView) const override
Draw the parts of the object belonging to layer aLayer.
void SetChainMinMax(const double aMin, const double aMax)
std::vector< int > ViewGetLayers() const override
Return the all the layers within the VIEW the object is painted on.
TUNING_STATUS_VIEW_ITEM(PCB_BASE_EDIT_FRAME *aFrame)
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
void SetNetAndSignalValues(const wxString &aNetVal, const wxString &aSignalVal, bool aHasSignal)
void SetPosition(const VECTOR2I &aPos) override
#define _(s)
#define IN_EDIT
Item currently edited.
a few functions useful in geometry calculations.
@ LAYER_ANCHOR
Anchor of items having an anchor point (texts, footprints).
Definition layer_ids.h:248
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:60
@ F_Cu
Definition layer_ids.h:64
FLIP_DIRECTION
Definition mirror.h:27
bool ShapeHitTest(const SHAPE_LINE_CHAIN &aHitter, const SHAPE &aHittee, bool aHitteeContained)
Perform a shape-to-shape hit test.
The Cairo implementation of the graphics abstraction layer.
Definition eda_group.h:33
MEANDER_SIDE
Definition pns_meander.h:60
@ MEANDER_SIDE_RIGHT
Definition pns_meander.h:63
@ MEANDER_SIDE_LEFT
Definition pns_meander.h:61
@ MEANDER_STYLE_ROUND
Definition pns_meander.h:54
@ MEANDER_STYLE_CHAMFER
Definition pns_meander.h:55
ROUTER_MODE
Definition pns_router.h:67
@ PNS_MODE_TUNE_DIFF_PAIR
Definition pns_router.h:71
@ PNS_MODE_TUNE_SINGLE
Definition pns_router.h:70
@ PNS_MODE_TUNE_DIFF_PAIR_SKEW
Definition pns_router.h:72
#define _HKI(x)
Definition page_info.cpp:44
LENGTH_TUNING_MODE
@ DIFF_PAIR
@ DIFF_PAIR_SKEW
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Calculate the new point of coord coord pX, pY, for a rotation center 0, 0.
Definition trigo.cpp:229
@ PCB_GENERATOR_T
class PCB_GENERATOR, generator on a layer
Definition typeinfo.h:88
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:687