Update DIFF_PAIR_PLACER to new callbacks

Needs to handle changes to PNS_ROUTER.  This does not implement
springback or backspace in DIFF_PAIR_PLACER, only allows committing
lines as before

Fixes https://gitlab.com/kicad/code/kicad/issues/3988
This commit is contained in:
Seth Hillbrand 2020-03-04 17:21:50 -06:00
parent ecbfea68dd
commit fe8524b9bb
2 changed files with 32 additions and 3 deletions

View File

@ -794,9 +794,7 @@ bool DIFF_PAIR_PLACER::FixRoute( const VECTOR2I& aP, ITEM* aEndItem, bool aForce
m_prevPair = m_currentTrace.EndingPrimitives();
Router()->CommitRouting( m_lastNode );
m_lastNode = NULL;
CommitPlacement();
m_placingVia = false;
if( m_snapOnTarget || aForceFinish )
@ -812,6 +810,31 @@ bool DIFF_PAIR_PLACER::FixRoute( const VECTOR2I& aP, ITEM* aEndItem, bool aForce
}
bool DIFF_PAIR_PLACER::AbortPlacement()
{
m_world->KillChildren();
return true;
}
bool DIFF_PAIR_PLACER::HasPlacedAnything() const
{
return m_currentTrace.CP().SegmentCount() > 0 ||
m_currentTrace.CN().SegmentCount() > 0;
}
bool DIFF_PAIR_PLACER::CommitPlacement()
{
if( m_lastNode )
Router()->CommitRouting( m_lastNode );
m_lastNode = NULL;
m_currentNode = NULL;
return true;
}
void DIFF_PAIR_PLACER::GetModifiedNets( std::vector<int> &aNets ) const
{
aNets.push_back( m_netP );

View File

@ -86,6 +86,12 @@ public:
*/
bool FixRoute( const VECTOR2I& aP, ITEM* aEndItem, bool aForceFinish ) override;
bool CommitPlacement() override;
bool AbortPlacement() override;
bool HasPlacedAnything() const override;
/**
* Function ToggleVia()
*