Skip to content

Commit

Permalink
PNS: ratlines need to not be debug graphics
Browse files Browse the repository at this point in the history
  • Loading branch information
craftyjon committed Oct 14, 2020
1 parent 6a3384e commit fd4b9f0
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
8 changes: 2 additions & 6 deletions pcbnew/router/pns_diff_pair_placer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -848,14 +848,10 @@ void DIFF_PAIR_PLACER::updateLeadingRatLine()
TOPOLOGY topo( m_lastNode );

if( topo.LeadingRatLine( &m_currentTrace.PLine(), ratLineP ) )
{
Dbg()->AddLine( ratLineP, 1, 10000 );
}
m_router->GetInterface()->DisplayRatline( ratLineP, 1 );

if( topo.LeadingRatLine ( &m_currentTrace.NLine(), ratLineN ) )
{
Dbg()->AddLine( ratLineN, 3, 10000 );
}
m_router->GetInterface()->DisplayRatline( ratLineN, 3 );
}


Expand Down
9 changes: 9 additions & 0 deletions pcbnew/router/pns_kicad_iface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1301,6 +1301,15 @@ void PNS_KICAD_IFACE::DisplayItem( const PNS::ITEM* aItem, int aColor, int aClea
}


void PNS_KICAD_IFACE::DisplayRatline( const SHAPE_LINE_CHAIN& aRatline, int aColor )
{
ROUTER_PREVIEW_ITEM* pitem = new ROUTER_PREVIEW_ITEM( nullptr, m_view );
pitem->Line( aRatline, 10000, aColor );
m_previewItems->Add( pitem );
m_view->Update( m_previewItems );
}


void PNS_KICAD_IFACE::HideItem( PNS::ITEM* aItem )
{
BOARD_CONNECTED_ITEM* parent = aItem->Parent();
Expand Down
2 changes: 2 additions & 0 deletions pcbnew/router/pns_kicad_iface.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class PNS_KICAD_IFACE_BASE : public PNS::ROUTER_IFACE {
bool IsItemVisible( const PNS::ITEM* aItem ) const override { return true; }
void HideItem( PNS::ITEM* aItem ) override {}
void DisplayItem( const PNS::ITEM* aItem, int aColor = 0, int aClearance = 0, bool aEdit = false ) override {}
void DisplayRatline( const SHAPE_LINE_CHAIN& aRatline, int aColor = -1 ) override {}
void AddItem( PNS::ITEM* aItem ) override;
void RemoveItem( PNS::ITEM* aItem ) override;
void Commit() override {}
Expand Down Expand Up @@ -117,6 +118,7 @@ class PNS_KICAD_IFACE : public PNS_KICAD_IFACE_BASE {
bool IsOnLayer( const PNS::ITEM* aItem, int aLayer ) const override;
void HideItem( PNS::ITEM* aItem ) override;
void DisplayItem( const PNS::ITEM* aItem, int aColor = 0, int aClearance = 0, bool aEdit = false ) override;
void DisplayRatline( const SHAPE_LINE_CHAIN& aRatline, int aColor = -1 ) override;
void Commit() override;
void AddItem( PNS::ITEM* aItem ) override;
void RemoveItem( PNS::ITEM* aItem ) override;
Expand Down
2 changes: 1 addition & 1 deletion pcbnew/router/pns_line_placer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1367,7 +1367,7 @@ void LINE_PLACER::updateLeadingRatLine()
TOPOLOGY topo( m_lastNode );

if( topo.LeadingRatLine( &current, ratLine ) )
Dbg()->AddLine( ratLine, 5, 10000 );
m_router->GetInterface()->DisplayRatline( ratLine, 5 );
}


Expand Down
1 change: 1 addition & 0 deletions pcbnew/router/pns_router.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ enum DRAG_MODE
virtual bool IsItemVisible( const PNS::ITEM* aItem ) const = 0;
virtual bool IsOnLayer( const PNS::ITEM* aItem, int aLayer ) const = 0;
virtual void DisplayItem( const ITEM* aItem, int aColor = -1, int aClearance = -1, bool aEdit = false ) = 0;
virtual void DisplayRatline( const SHAPE_LINE_CHAIN& aRatline, int aColor = -1 ) = 0;
virtual void HideItem( ITEM* aItem ) = 0;
virtual void Commit() = 0;
virtual bool ImportSizes( SIZES_SETTINGS& aSizes, ITEM* aStartItem, int aNet ) = 0;
Expand Down

0 comments on commit fd4b9f0

Please sign in to comment.