Make the net identifier opaque to PNS router.
This also improves performance as we don't have to look up the netcodes in a map.
This commit is contained in:
parent
5136ec07cf
commit
76cd637895
|
@ -2,7 +2,7 @@
|
|||
* KiRouter - a push-and-(sometimes-)shove PCB router
|
||||
*
|
||||
* Copyright (C) 2013-2017 CERN
|
||||
* Copyright (C) 2016-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
|
@ -145,7 +145,7 @@ void LENGTH_TUNER_TOOL::performTuning()
|
|||
{
|
||||
frame()->SetActiveLayer( ToLAYER_ID ( m_startItem->Layers().Start() ) );
|
||||
|
||||
if( m_startItem->Net() >= 0 )
|
||||
if( m_startItem->Net() )
|
||||
highlightNets( true, { m_startItem->Net() } );
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
* KiRouter - a push-and-(sometimes-)shove PCB router
|
||||
*
|
||||
* Copyright (C) 2019 CERN
|
||||
* Copyright (C) 2019-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Author: Seth Hillbrand <hillbrand@ucdavis.edu>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
|
@ -40,7 +41,7 @@ public:
|
|||
LINKED_ITEM( ARC_T )
|
||||
{}
|
||||
|
||||
ARC( const SHAPE_ARC& aArc, int aNet ) :
|
||||
ARC( const SHAPE_ARC& aArc, NET_HANDLE aNet ) :
|
||||
LINKED_ITEM( ARC_T ),
|
||||
m_arc( aArc )
|
||||
{
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
* KiRouter - a push-and-(sometimes-)shove PCB router
|
||||
*
|
||||
* Copyright (C) 2013-2020 CERN
|
||||
* Copyright (C) 2013-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
|
@ -78,12 +79,12 @@ public:
|
|||
/**
|
||||
* Function CurrentNets()
|
||||
*
|
||||
* Returns the net code(s) of currently dragged item(s).
|
||||
* Returns the net(s) of currently dragged item(s).
|
||||
* Currently unused for component dragging.
|
||||
*/
|
||||
const std::vector<int> CurrentNets() const override
|
||||
const std::vector<NET_HANDLE> CurrentNets() const override
|
||||
{
|
||||
return std::vector<int>();
|
||||
return std::vector<NET_HANDLE>();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* KiRouter - a push-and-(sometimes-)shove PCB router
|
||||
*
|
||||
* Copyright (C) 2013-2015 CERN
|
||||
* Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
|
@ -364,7 +364,7 @@ public:
|
|||
m_n = aPair.m_n;
|
||||
}
|
||||
|
||||
void SetNets( int aP, int aN )
|
||||
void SetNets( NET_HANDLE aP, NET_HANDLE aN )
|
||||
{
|
||||
m_net_p = aP;
|
||||
m_net_n = aN;
|
||||
|
@ -423,12 +423,12 @@ public:
|
|||
m_via_n.SetDrill( aDrill );
|
||||
}
|
||||
|
||||
int NetP() const
|
||||
NET_HANDLE NetP() const
|
||||
{
|
||||
return m_net_p;
|
||||
}
|
||||
|
||||
int NetN() const
|
||||
NET_HANDLE NetN() const
|
||||
{
|
||||
return m_net_n;
|
||||
}
|
||||
|
@ -490,7 +490,7 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
void updateLine( LINE &aLine, const SHAPE_LINE_CHAIN& aShape, int aNet, const VIA& aVia )
|
||||
void updateLine( LINE &aLine, const SHAPE_LINE_CHAIN& aShape, NET_HANDLE aNet, const VIA& aVia )
|
||||
{
|
||||
aLine.SetShape( aShape );
|
||||
aLine.SetWidth( m_width );
|
||||
|
@ -506,7 +506,7 @@ private:
|
|||
VIA m_via_p, m_via_n;
|
||||
|
||||
bool m_hasVias;
|
||||
int m_net_p, m_net_n;
|
||||
NET_HANDLE m_net_p, m_net_n;
|
||||
int m_width;
|
||||
int m_gap;
|
||||
int m_viaGap;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* KiRouter - a push-and-(sometimes-)shove PCB router
|
||||
*
|
||||
* Copyright (C) 2013-2015 CERN
|
||||
* Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
|
@ -38,8 +38,8 @@ DIFF_PAIR_PLACER::DIFF_PAIR_PLACER( ROUTER* aRouter ) :
|
|||
m_initialDiagonal = false;
|
||||
m_startDiagonal = false;
|
||||
m_fitOk = false;
|
||||
m_netP = 0;
|
||||
m_netN = 0;
|
||||
m_netP = nullptr;
|
||||
m_netN = nullptr;
|
||||
m_iteration = 0;
|
||||
m_world = nullptr;
|
||||
m_shove = nullptr;
|
||||
|
@ -49,7 +49,6 @@ DIFF_PAIR_PLACER::DIFF_PAIR_PLACER( ROUTER* aRouter ) :
|
|||
m_viaDiameter = 0;
|
||||
m_viaDrill = 0;
|
||||
m_currentWidth = 0;
|
||||
m_currentNet = 0;
|
||||
m_currentLayer = 0;
|
||||
m_startsOnVia = false;
|
||||
m_orthoMode = false;
|
||||
|
@ -69,12 +68,11 @@ void DIFF_PAIR_PLACER::setWorld( NODE* aWorld )
|
|||
}
|
||||
|
||||
|
||||
const VIA DIFF_PAIR_PLACER::makeVia( const VECTOR2I& aP, int aNet )
|
||||
const VIA DIFF_PAIR_PLACER::makeVia( const VECTOR2I& aP, NET_HANDLE aNet )
|
||||
{
|
||||
const LAYER_RANGE layers( m_sizes.GetLayerTop(), m_sizes.GetLayerBottom() );
|
||||
|
||||
VIA v( aP, layers, m_sizes.ViaDiameter(), m_sizes.ViaDrill(), -1, m_sizes.ViaType() );
|
||||
v.SetNet( aNet );
|
||||
VIA v( aP, layers, m_sizes.ViaDiameter(), m_sizes.ViaDrill(), aNet, m_sizes.ViaType() );
|
||||
|
||||
return v;
|
||||
}
|
||||
|
@ -116,7 +114,7 @@ bool DIFF_PAIR_PLACER::rhMarkObstacles( const VECTOR2I& aP )
|
|||
|
||||
bool DIFF_PAIR_PLACER::propagateDpHeadForces ( const VECTOR2I& aP, VECTOR2I& aNewP )
|
||||
{
|
||||
VIA virtHead = makeVia( aP, -1 );
|
||||
VIA virtHead = makeVia( aP, nullptr );
|
||||
|
||||
if( m_placingVia )
|
||||
{
|
||||
|
@ -487,7 +485,7 @@ OPT_VECTOR2I getDanglingAnchor( NODE* aNode, ITEM* aItem )
|
|||
bool DIFF_PAIR_PLACER::FindDpPrimitivePair( NODE* aWorld, const VECTOR2I& aP, ITEM* aItem,
|
||||
DP_PRIMITIVE_PAIR& aPair, wxString* aErrorMsg )
|
||||
{
|
||||
int netP, netN;
|
||||
NET_HANDLE netP, netN;
|
||||
|
||||
bool result = aWorld->GetRuleResolver()->DpNetPair( aItem, netP, netN );
|
||||
|
||||
|
@ -502,8 +500,8 @@ bool DIFF_PAIR_PLACER::FindDpPrimitivePair( NODE* aWorld, const VECTOR2I& aP, IT
|
|||
return false;
|
||||
}
|
||||
|
||||
int refNet = aItem->Net();
|
||||
int coupledNet = ( refNet == netP ) ? netN : netP;
|
||||
NET_HANDLE refNet = aItem->Net();
|
||||
NET_HANDLE coupledNet = ( refNet == netP ) ? netN : netP;
|
||||
|
||||
OPT_VECTOR2I refAnchor = getDanglingAnchor( aWorld, aItem );
|
||||
ITEM* primRef = aItem;
|
||||
|
@ -858,7 +856,7 @@ bool DIFF_PAIR_PLACER::CommitPlacement()
|
|||
}
|
||||
|
||||
|
||||
void DIFF_PAIR_PLACER::GetModifiedNets( std::vector<int> &aNets ) const
|
||||
void DIFF_PAIR_PLACER::GetModifiedNets( std::vector<NET_HANDLE> &aNets ) const
|
||||
{
|
||||
aNets.push_back( m_netP );
|
||||
aNets.push_back( m_netN );
|
||||
|
@ -878,9 +876,9 @@ void DIFF_PAIR_PLACER::updateLeadingRatLine()
|
|||
}
|
||||
|
||||
|
||||
const std::vector<int> DIFF_PAIR_PLACER::CurrentNets() const
|
||||
const std::vector<NET_HANDLE> DIFF_PAIR_PLACER::CurrentNets() const
|
||||
{
|
||||
std::vector<int> rv;
|
||||
std::vector<NET_HANDLE> rv;
|
||||
rv.push_back( m_netP );
|
||||
rv.push_back( m_netN );
|
||||
return rv;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* KiRouter - a push-and-(sometimes-)shove PCB router
|
||||
*
|
||||
* Copyright (C) 2013-2014 CERN
|
||||
* Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
*
|
||||
|
@ -121,9 +121,9 @@ public:
|
|||
}
|
||||
|
||||
/**
|
||||
* Return the net code of currently routed track.
|
||||
* Return the net of currently routed track.
|
||||
*/
|
||||
const std::vector<int> CurrentNets() const override;
|
||||
const std::vector<NET_HANDLE> CurrentNets() const override;
|
||||
|
||||
/**
|
||||
* Return the layer of currently routed track.
|
||||
|
@ -154,7 +154,7 @@ public:
|
|||
|
||||
void SetOrthoMode( bool aOrthoMode ) override;
|
||||
|
||||
void GetModifiedNets( std::vector<int>& aNets ) const override;
|
||||
void GetModifiedNets( std::vector<NET_HANDLE>& aNets ) const override;
|
||||
|
||||
private:
|
||||
int viaGap() const;
|
||||
|
@ -208,7 +208,7 @@ private:
|
|||
///< route step, mark obstacles mode
|
||||
bool rhMarkObstacles( const VECTOR2I& aP );
|
||||
|
||||
const VIA makeVia ( const VECTOR2I& aP, int aNet );
|
||||
const VIA makeVia ( const VECTOR2I& aP, NET_HANDLE aNet );
|
||||
|
||||
bool attemptWalk( NODE* aNode, DIFF_PAIR* aCurrent, DIFF_PAIR& aWalk, bool aPFirst,
|
||||
bool aWindCw, bool aSolidsOnly );
|
||||
|
@ -227,7 +227,7 @@ private:
|
|||
bool m_startDiagonal;
|
||||
bool m_fitOk;
|
||||
|
||||
int m_netP, m_netN;
|
||||
NET_HANDLE m_netP, m_netN;
|
||||
|
||||
DP_PRIMITIVE_PAIR m_start;
|
||||
std::optional<DP_PRIMITIVE_PAIR> m_prevPair;
|
||||
|
@ -264,7 +264,6 @@ private:
|
|||
///< current track width
|
||||
int m_currentWidth;
|
||||
|
||||
int m_currentNet;
|
||||
int m_currentLayer;
|
||||
|
||||
bool m_startsOnVia;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* KiRouter - a push-and-(sometimes-)shove PCB router
|
||||
*
|
||||
* Copyright (C) 2013-2014 CERN
|
||||
* Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
|
@ -488,9 +488,9 @@ DP_MEANDER_PLACER::TUNING_STATUS DP_MEANDER_PLACER::TuningStatus() const
|
|||
}
|
||||
|
||||
|
||||
const std::vector<int> DP_MEANDER_PLACER::CurrentNets() const
|
||||
const std::vector<NET_HANDLE> DP_MEANDER_PLACER::CurrentNets() const
|
||||
{
|
||||
std::vector<int> rv;
|
||||
std::vector<NET_HANDLE> rv;
|
||||
rv.push_back( m_originPair.NetP() );
|
||||
rv.push_back( m_originPair.NetN() );
|
||||
return rv;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* KiRouter - a push-and-(sometimes-)shove PCB router
|
||||
*
|
||||
* Copyright (C) 2013-2014 CERN
|
||||
* Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
*
|
||||
|
@ -98,7 +98,7 @@ public:
|
|||
const VECTOR2I& CurrentEnd() const override;
|
||||
|
||||
/// @copydoc PLACEMENT_ALGO::CurrentNets()
|
||||
const std::vector<int> CurrentNets() const override;
|
||||
const std::vector<NET_HANDLE> CurrentNets() const override;
|
||||
|
||||
int CurrentLayer() const override;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* KiRouter - a push-and-(sometimes-)shove PCB router
|
||||
*
|
||||
* Copyright (C) 2013-2020 CERN
|
||||
* Copyright (C) 2016 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
|
@ -98,9 +98,9 @@ public:
|
|||
/**
|
||||
* Function CurrentNets()
|
||||
*
|
||||
* Returns the net code(s) of currently dragged item(s).
|
||||
* Returns the net(s) of currently dragged item(s).
|
||||
*/
|
||||
virtual const std::vector<int> CurrentNets() const = 0;
|
||||
virtual const std::vector<NET_HANDLE> CurrentNets() const = 0;
|
||||
|
||||
/**
|
||||
* Function CurrentLayer()
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* KiRouter - a push-and-(sometimes-)shove PCB router
|
||||
*
|
||||
* Copyright (C) 2013-2014 CERN
|
||||
* Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
|
@ -266,12 +266,12 @@ PNS::DRAG_MODE DRAGGER::Mode() const
|
|||
}
|
||||
|
||||
|
||||
const std::vector<int> DRAGGER::CurrentNets() const
|
||||
const std::vector<NET_HANDLE> DRAGGER::CurrentNets() const
|
||||
{
|
||||
if( m_mode == PNS::DM_VIA )
|
||||
return std::vector<int>( 1, m_draggedVia.net );
|
||||
return std::vector<NET_HANDLE>( 1, m_draggedVia.net );
|
||||
else
|
||||
return std::vector<int>( 1, m_draggedLine.Net() );
|
||||
return std::vector<NET_HANDLE>( 1, m_draggedLine.Net() );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* KiRouter - a push-and-(sometimes-)shove PCB router
|
||||
*
|
||||
* Copyright (C) 2013-2014 CERN
|
||||
* Copyright (C) 2016 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
|
@ -86,9 +86,9 @@ public:
|
|||
/**
|
||||
* Function CurrentNets()
|
||||
*
|
||||
* Returns the net code(s) of currently routed track(s).
|
||||
* Returns the net(s) of currently routed track(s).
|
||||
*/
|
||||
const std::vector<int> CurrentNets() const override;
|
||||
const std::vector<NET_HANDLE> CurrentNets() const override;
|
||||
|
||||
/**
|
||||
* Function CurrentLayer()
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
*/
|
||||
virtual HOLE* Clone() const override;
|
||||
|
||||
virtual int Net() const override
|
||||
virtual NET_HANDLE Net() const override
|
||||
{
|
||||
if( m_parentPadVia )
|
||||
return m_parentPadVia->Net();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* KiRouter - a push-and-(sometimes-)shove PCB router
|
||||
*
|
||||
* Copyright (C) 2013-2014 CERN
|
||||
* Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
|
@ -36,9 +36,9 @@ void INDEX::Add( ITEM* aItem )
|
|||
m_subIndices[i].Add( aItem );
|
||||
|
||||
m_allItems.insert( aItem );
|
||||
int net = aItem->Net();
|
||||
NET_HANDLE net = aItem->Net();
|
||||
|
||||
if( net >= 0 )
|
||||
if( net )
|
||||
m_netMap[net].push_back( aItem );
|
||||
}
|
||||
|
||||
|
@ -54,9 +54,9 @@ void INDEX::Remove( ITEM* aItem )
|
|||
m_subIndices[i].Remove( aItem );
|
||||
|
||||
m_allItems.erase( aItem );
|
||||
int net = aItem->Net();
|
||||
NET_HANDLE net = aItem->Net();
|
||||
|
||||
if( net >= 0 && m_netMap.find( net ) != m_netMap.end() )
|
||||
if( net && m_netMap.find( net ) != m_netMap.end() )
|
||||
m_netMap[net].remove( aItem );
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ void INDEX::Replace( ITEM* aOldItem, ITEM* aNewItem )
|
|||
}
|
||||
|
||||
|
||||
INDEX::NET_ITEMS_LIST* INDEX::GetItemsForNet( int aNet )
|
||||
INDEX::NET_ITEMS_LIST* INDEX::GetItemsForNet( NET_HANDLE aNet )
|
||||
{
|
||||
if( m_netMap.find( aNet ) == m_netMap.end() )
|
||||
return nullptr;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* KiRouter - a push-and-(sometimes-)shove PCB router
|
||||
*
|
||||
* Copyright (C) 2013-2014 CERN
|
||||
* Copyright (C) 2016-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
|
@ -97,7 +97,7 @@ public:
|
|||
/**
|
||||
* Returns list of all items in a given net.
|
||||
*/
|
||||
NET_ITEMS_LIST* GetItemsForNet( int aNet );
|
||||
NET_ITEMS_LIST* GetItemsForNet( NET_HANDLE aNet );
|
||||
|
||||
/**
|
||||
* Function Contains()
|
||||
|
@ -122,9 +122,9 @@ private:
|
|||
int querySingle( std::size_t aIndex, const SHAPE* aShape, int aMinDistance, Visitor& aVisitor ) const;
|
||||
|
||||
private:
|
||||
std::deque<ITEM_SHAPE_INDEX> m_subIndices;
|
||||
std::map<int, NET_ITEMS_LIST> m_netMap;
|
||||
ITEM_SET m_allItems;
|
||||
std::deque<ITEM_SHAPE_INDEX> m_subIndices;
|
||||
std::map<NET_HANDLE, NET_ITEMS_LIST> m_netMap;
|
||||
ITEM_SET m_allItems;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -157,7 +157,7 @@ bool ITEM::collideSimple( const ITEM* aHead, const NODE* aNode,
|
|||
if( Kind() == HOLE_T && aHead->Kind() == HOLE_T )
|
||||
differentNetsOnly = false;
|
||||
|
||||
if( differentNetsOnly && Net() == aHead->Net() && aHead->Net() >= 0 )
|
||||
if( differentNetsOnly && Net() == aHead->Net() && aHead->Net() )
|
||||
{
|
||||
// same nets? no clearance!
|
||||
clearance = -1;
|
||||
|
|
|
@ -50,6 +50,9 @@ class ITEM;
|
|||
class HOLE;
|
||||
struct COLLISION_SEARCH_CONTEXT;
|
||||
|
||||
// An opaque net identifier. The internal workings are owned by the ROUTER_IFACE.
|
||||
typedef void* NET_HANDLE;
|
||||
|
||||
class ITEM_OWNER {
|
||||
public:
|
||||
virtual ~ITEM_OWNER() {};
|
||||
|
@ -93,8 +96,6 @@ protected:
|
|||
class ITEM : public OWNABLE_ITEM, public ITEM_OWNER
|
||||
{
|
||||
public:
|
||||
static const int UnusedNet = INT_MAX;
|
||||
|
||||
///< Supported item types
|
||||
enum PnsKind
|
||||
{
|
||||
|
@ -111,7 +112,7 @@ public:
|
|||
|
||||
ITEM( PnsKind aKind )
|
||||
{
|
||||
m_net = UnusedNet;
|
||||
m_net = nullptr;
|
||||
m_movable = true;
|
||||
m_kind = aKind;
|
||||
m_parent = nullptr;
|
||||
|
@ -188,8 +189,8 @@ public:
|
|||
*/
|
||||
virtual BOARD_ITEM* BoardItem() const { return m_parent; }
|
||||
|
||||
void SetNet( int aNet ) { m_net = aNet; }
|
||||
virtual int Net() const { return m_net; }
|
||||
void SetNet( NET_HANDLE aNet ) { m_net = aNet; }
|
||||
virtual NET_HANDLE Net() const { return m_net; }
|
||||
|
||||
const LAYER_RANGE& Layers() const { return m_layers; }
|
||||
void SetLayers( const LAYER_RANGE& aLayers ) { m_layers = aLayers; }
|
||||
|
@ -286,7 +287,7 @@ protected:
|
|||
LAYER_RANGE m_layers;
|
||||
|
||||
bool m_movable;
|
||||
int m_net;
|
||||
NET_HANDLE m_net;
|
||||
mutable int m_marker;
|
||||
int m_rank;
|
||||
bool m_routable;
|
||||
|
|
|
@ -99,7 +99,7 @@ ITEM_SET& ITEM_SET::FilterMarker( int aMarker, bool aInvert )
|
|||
}
|
||||
|
||||
|
||||
ITEM_SET& ITEM_SET::FilterNet( int aNet, bool aInvert )
|
||||
ITEM_SET& ITEM_SET::FilterNet( NET_HANDLE aNet, bool aInvert )
|
||||
{
|
||||
std::vector<ITEM*> newItems;
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ public:
|
|||
|
||||
ITEM_SET& FilterLayers( int aStart, int aEnd = -1, bool aInvert = false );
|
||||
ITEM_SET& FilterKinds( int aKindMask, bool aInvert = false );
|
||||
ITEM_SET& FilterNet( int aNet, bool aInvert = false );
|
||||
ITEM_SET& FilterNet( NET_HANDLE aNet, bool aInvert = false );
|
||||
ITEM_SET& FilterMarker( int aMarker, bool aInvert = false );
|
||||
|
||||
ITEM_SET& ExcludeLayers( int aStart, int aEnd = -1 )
|
||||
|
@ -102,7 +102,7 @@ public:
|
|||
return FilterKinds( aKindMask, true );
|
||||
}
|
||||
|
||||
ITEM_SET& ExcludeNet( int aNet )
|
||||
ITEM_SET& ExcludeNet( NET_HANDLE aNet )
|
||||
{
|
||||
return FilterNet( aNet, true );
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* KiRouter - a push-and-(sometimes-)shove PCB router
|
||||
*
|
||||
* Copyright (C) 2013-2014 CERN
|
||||
* Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
*
|
||||
|
@ -47,7 +47,7 @@ public:
|
|||
struct HASH_TAG
|
||||
{
|
||||
VECTOR2I pos;
|
||||
int net;
|
||||
NET_HANDLE net;
|
||||
};
|
||||
|
||||
struct JOINT_TAG_HASH
|
||||
|
@ -60,14 +60,14 @@ public:
|
|||
|
||||
return ( (hash<int>()( aP.pos.x )
|
||||
^ (hash<int>()( aP.pos.y ) << 1) ) >> 1 )
|
||||
^ (hash<int>()( aP.net ) << 1);
|
||||
^ (hash<void*>()( aP.net ) << 1);
|
||||
}
|
||||
};
|
||||
|
||||
JOINT() :
|
||||
ITEM( JOINT_T ), m_tag(), m_locked( false ) {}
|
||||
|
||||
JOINT( const VECTOR2I& aPos, const LAYER_RANGE& aLayers, int aNet = -1 ) :
|
||||
JOINT( const VECTOR2I& aPos, const LAYER_RANGE& aLayers, NET_HANDLE aNet = nullptr ) :
|
||||
ITEM( JOINT_T )
|
||||
{
|
||||
m_tag.pos = aPos;
|
||||
|
@ -231,7 +231,7 @@ public:
|
|||
return m_tag.pos;
|
||||
}
|
||||
|
||||
int Net() const override
|
||||
NET_HANDLE Net() const override
|
||||
{
|
||||
return m_tag.net;
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include <board.h>
|
||||
#include <board_connected_item.h>
|
||||
#include <board_design_settings.h>
|
||||
#include <netinfo.h>
|
||||
#include <footprint.h>
|
||||
#include <pad.h>
|
||||
#include <pcb_track.h>
|
||||
|
@ -105,9 +106,13 @@ public:
|
|||
virtual int Clearance( const PNS::ITEM* aA, const PNS::ITEM* aB,
|
||||
bool aUseClearanceEpsilon = true ) override;
|
||||
|
||||
virtual int DpCoupledNet( int aNet ) override;
|
||||
virtual int DpNetPolarity( int aNet ) override;
|
||||
virtual bool DpNetPair( const PNS::ITEM* aItem, int& aNetP, int& aNetN ) override;
|
||||
virtual PNS::NET_HANDLE DpCoupledNet( PNS::NET_HANDLE aNet ) override;
|
||||
virtual int DpNetPolarity( PNS::NET_HANDLE aNet ) override;
|
||||
virtual bool DpNetPair( const PNS::ITEM* aItem, PNS::NET_HANDLE& aNetP,
|
||||
PNS::NET_HANDLE& aNetN ) override;
|
||||
|
||||
virtual int NetCode( PNS::NET_HANDLE aNet ) override;
|
||||
virtual wxString NetName( PNS::NET_HANDLE aNet ) override;
|
||||
|
||||
virtual bool IsInNetTie( const PNS::ITEM* aA ) override;
|
||||
virtual bool IsNetTieExclusion( const PNS::ITEM* aItem, const VECTOR2I& aCollisionPos,
|
||||
|
@ -118,7 +123,6 @@ public:
|
|||
virtual bool QueryConstraint( PNS::CONSTRAINT_TYPE aType, const PNS::ITEM* aItemA,
|
||||
const PNS::ITEM* aItemB, int aLayer,
|
||||
PNS::CONSTRAINT* aConstraint ) override;
|
||||
virtual wxString NetName( int aNet ) override;
|
||||
|
||||
int ClearanceEpsilon() const override { return m_clearanceEpsilon; }
|
||||
|
||||
|
@ -207,7 +211,7 @@ bool PNS_PCBNEW_RULE_RESOLVER::IsNetTieExclusion( const PNS::ITEM* aItem,
|
|||
|
||||
if( drcEngine )
|
||||
{
|
||||
return drcEngine->IsNetTieExclusion( aItem->Net(), ToLAYER_ID( aItem->Layer() ),
|
||||
return drcEngine->IsNetTieExclusion( NetCode( aItem->Net() ), ToLAYER_ID( aItem->Layer() ),
|
||||
aCollisionPos, collidingItem );
|
||||
}
|
||||
|
||||
|
@ -354,7 +358,7 @@ bool PNS_PCBNEW_RULE_RESOLVER::QueryConstraint( PNS::CONSTRAINT_TYPE aType,
|
|||
{
|
||||
case PNS::ITEM::ARC_T:
|
||||
m_dummyArcs[0].SetLayer( ToLAYER_ID( aLayer ) );
|
||||
m_dummyArcs[0].SetNetCode( aItemA->Net(), true );
|
||||
m_dummyArcs[0].SetNet( static_cast<NETINFO_ITEM*>( aItemA->Net() ) );
|
||||
m_dummyArcs[0].SetStart( aItemA->Anchor( 0 ) );
|
||||
m_dummyArcs[0].SetEnd( aItemA->Anchor( 1 ) );
|
||||
parentA = &m_dummyArcs[0];
|
||||
|
@ -363,7 +367,7 @@ bool PNS_PCBNEW_RULE_RESOLVER::QueryConstraint( PNS::CONSTRAINT_TYPE aType,
|
|||
case PNS::ITEM::VIA_T:
|
||||
case PNS::ITEM::HOLE_T:
|
||||
m_dummyVias[0].SetLayer( ToLAYER_ID( aLayer ) );
|
||||
m_dummyVias[0].SetNetCode( aItemA->Net(), true );
|
||||
m_dummyVias[0].SetNet( static_cast<NETINFO_ITEM*>( aItemA->Net() ) );
|
||||
m_dummyVias[0].SetStart( aItemA->Anchor( 0 ) );
|
||||
parentA = &m_dummyVias[0];
|
||||
break;
|
||||
|
@ -371,7 +375,7 @@ bool PNS_PCBNEW_RULE_RESOLVER::QueryConstraint( PNS::CONSTRAINT_TYPE aType,
|
|||
case PNS::ITEM::SEGMENT_T:
|
||||
case PNS::ITEM::LINE_T:
|
||||
m_dummyTracks[0].SetLayer( ToLAYER_ID( aLayer ) );
|
||||
m_dummyTracks[0].SetNetCode( aItemA->Net(), true );
|
||||
m_dummyTracks[0].SetNet( static_cast<NETINFO_ITEM*>( aItemA->Net() ) );
|
||||
m_dummyTracks[0].SetStart( aItemA->Anchor( 0 ) );
|
||||
m_dummyTracks[0].SetEnd( aItemA->Anchor( 1 ) );
|
||||
parentA = &m_dummyTracks[0];
|
||||
|
@ -388,7 +392,7 @@ bool PNS_PCBNEW_RULE_RESOLVER::QueryConstraint( PNS::CONSTRAINT_TYPE aType,
|
|||
{
|
||||
case PNS::ITEM::ARC_T:
|
||||
m_dummyArcs[1].SetLayer( ToLAYER_ID( aLayer ) );
|
||||
m_dummyArcs[1].SetNetCode( aItemB->Net(), true );
|
||||
m_dummyArcs[1].SetNet( static_cast<NETINFO_ITEM*>( aItemB->Net() ) );
|
||||
m_dummyArcs[1].SetStart( aItemB->Anchor( 0 ) );
|
||||
m_dummyArcs[1].SetEnd( aItemB->Anchor( 1 ) );
|
||||
parentB = &m_dummyArcs[1];
|
||||
|
@ -397,7 +401,7 @@ bool PNS_PCBNEW_RULE_RESOLVER::QueryConstraint( PNS::CONSTRAINT_TYPE aType,
|
|||
case PNS::ITEM::VIA_T:
|
||||
case PNS::ITEM::HOLE_T:
|
||||
m_dummyVias[1].SetLayer( ToLAYER_ID( aLayer ) );
|
||||
m_dummyVias[1].SetNetCode( aItemB->Net(), true );
|
||||
m_dummyVias[1].SetNet( static_cast<NETINFO_ITEM*>( aItemB->Net() ) );
|
||||
m_dummyVias[1].SetStart( aItemB->Anchor( 0 ) );
|
||||
parentB = &m_dummyVias[1];
|
||||
break;
|
||||
|
@ -405,7 +409,7 @@ bool PNS_PCBNEW_RULE_RESOLVER::QueryConstraint( PNS::CONSTRAINT_TYPE aType,
|
|||
case PNS::ITEM::SEGMENT_T:
|
||||
case PNS::ITEM::LINE_T:
|
||||
m_dummyTracks[1].SetLayer( ToLAYER_ID( aLayer ) );
|
||||
m_dummyTracks[1].SetNetCode( aItemB->Net(), true );
|
||||
m_dummyTracks[1].SetNet( static_cast<NETINFO_ITEM*>( aItemB->Net() ) );
|
||||
m_dummyTracks[1].SetStart( aItemB->Anchor( 0 ) );
|
||||
m_dummyTracks[1].SetEnd( aItemB->Anchor( 1 ) );
|
||||
parentB = &m_dummyTracks[1];
|
||||
|
@ -627,7 +631,7 @@ bool PNS_KICAD_IFACE_BASE::inheritTrackWidth( PNS::ITEM* aItem, int* aInheritedW
|
|||
|
||||
|
||||
bool PNS_KICAD_IFACE_BASE::ImportSizes( PNS::SIZES_SETTINGS& aSizes, PNS::ITEM* aStartItem,
|
||||
int aNet )
|
||||
PNS::NET_HANDLE aNet )
|
||||
{
|
||||
BOARD_DESIGN_SETTINGS& bds = m_board->GetDesignSettings();
|
||||
PNS::CONSTRAINT constraint;
|
||||
|
@ -854,59 +858,53 @@ int PNS_PCBNEW_RULE_RESOLVER::matchDpSuffix( const wxString& aNetName, wxString&
|
|||
}
|
||||
|
||||
|
||||
int PNS_PCBNEW_RULE_RESOLVER::DpCoupledNet( int aNet )
|
||||
PNS::NET_HANDLE PNS_PCBNEW_RULE_RESOLVER::DpCoupledNet( PNS::NET_HANDLE aNet )
|
||||
{
|
||||
wxString refName = m_board->FindNet( aNet )->GetNetname();
|
||||
wxString coupledNetName;
|
||||
|
||||
if( matchDpSuffix( refName, coupledNetName ) )
|
||||
if( NETINFO_ITEM* net = static_cast<NETINFO_ITEM*>( aNet ) )
|
||||
{
|
||||
NETINFO_ITEM* net = m_board->FindNet( coupledNetName );
|
||||
wxString refName = net->GetNetname();
|
||||
wxString coupledNetName;
|
||||
|
||||
if( !net )
|
||||
return -1;
|
||||
|
||||
return net->GetNetCode();
|
||||
if( matchDpSuffix( refName, coupledNetName ) )
|
||||
return m_board->FindNet( coupledNetName );
|
||||
}
|
||||
|
||||
return -1;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
wxString PNS_PCBNEW_RULE_RESOLVER::NetName( int aNet )
|
||||
int PNS_PCBNEW_RULE_RESOLVER::NetCode( PNS::NET_HANDLE aNet )
|
||||
{
|
||||
return m_board->FindNet( aNet )->GetNetname();
|
||||
return m_routerIface->GetNetCode( aNet );
|
||||
}
|
||||
|
||||
|
||||
int PNS_PCBNEW_RULE_RESOLVER::DpNetPolarity( int aNet )
|
||||
wxString PNS_PCBNEW_RULE_RESOLVER::NetName( PNS::NET_HANDLE aNet )
|
||||
{
|
||||
wxString refName = m_board->FindNet( aNet )->GetNetname();
|
||||
return m_routerIface->GetNetName( aNet );
|
||||
}
|
||||
|
||||
|
||||
int PNS_PCBNEW_RULE_RESOLVER::DpNetPolarity( PNS::NET_HANDLE aNet )
|
||||
{
|
||||
wxString refName;
|
||||
|
||||
if( NETINFO_ITEM* net = static_cast<NETINFO_ITEM*>( aNet ) )
|
||||
refName = net->GetNetname();
|
||||
|
||||
wxString dummy1;
|
||||
|
||||
return matchDpSuffix( refName, dummy1 );
|
||||
}
|
||||
|
||||
|
||||
bool PNS_PCBNEW_RULE_RESOLVER::DpNetPair( const PNS::ITEM* aItem, int& aNetP, int& aNetN )
|
||||
bool PNS_PCBNEW_RULE_RESOLVER::DpNetPair( const PNS::ITEM* aItem, PNS::NET_HANDLE& aNetP,
|
||||
PNS::NET_HANDLE& aNetN )
|
||||
{
|
||||
if( !aItem )
|
||||
if( !aItem || !aItem->Net() )
|
||||
return false;
|
||||
|
||||
NETINFO_ITEM* netInfo = nullptr;
|
||||
|
||||
if( aItem->Parent() && aItem->Parent()->IsConnected() )
|
||||
{
|
||||
BOARD_CONNECTED_ITEM* cItem = static_cast<BOARD_CONNECTED_ITEM*>( aItem->Parent() );
|
||||
netInfo = cItem->GetNet();
|
||||
}
|
||||
else
|
||||
netInfo = m_board->FindNet( aItem->Net() );
|
||||
|
||||
if( !netInfo )
|
||||
return false;
|
||||
|
||||
wxString netNameP = netInfo->GetNetname();
|
||||
wxString netNameP = static_cast<NETINFO_ITEM*>( aItem->Net() )->GetNetname();
|
||||
wxString netNameN, netNameCoupled;
|
||||
|
||||
int r = matchDpSuffix( netNameP, netNameCoupled );
|
||||
|
@ -925,14 +923,14 @@ bool PNS_PCBNEW_RULE_RESOLVER::DpNetPair( const PNS::ITEM* aItem, int& aNetP, in
|
|||
netNameP = netNameCoupled;
|
||||
}
|
||||
|
||||
NETINFO_ITEM* netInfoP = m_board->FindNet( netNameP );
|
||||
NETINFO_ITEM* netInfoN = m_board->FindNet( netNameN );
|
||||
PNS::NET_HANDLE netInfoP = m_board->FindNet( netNameP );
|
||||
PNS::NET_HANDLE netInfoN = m_board->FindNet( netNameN );
|
||||
|
||||
if( !netInfoP || !netInfoN )
|
||||
return false;
|
||||
|
||||
aNetP = netInfoP->GetNetCode();
|
||||
aNetN = netInfoN->GetNetCode();
|
||||
aNetP = netInfoP;
|
||||
aNetN = netInfoN;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -1170,7 +1168,7 @@ std::unique_ptr<PNS::SOLID> PNS_KICAD_IFACE_BASE::syncPad( PAD* aPad )
|
|||
solid->SetRoutable( false );
|
||||
|
||||
solid->SetLayers( layers );
|
||||
solid->SetNet( aPad->GetNetCode() );
|
||||
solid->SetNet( aPad->GetNet() );
|
||||
solid->SetParent( aPad );
|
||||
solid->SetPadToDie( aPad->GetPadToDieLength() );
|
||||
solid->SetOrientation( aPad->GetOrientation() );
|
||||
|
@ -1215,7 +1213,7 @@ std::unique_ptr<PNS::SOLID> PNS_KICAD_IFACE_BASE::syncPad( PAD* aPad )
|
|||
std::unique_ptr<PNS::SEGMENT> PNS_KICAD_IFACE_BASE::syncTrack( PCB_TRACK* aTrack )
|
||||
{
|
||||
auto segment = std::make_unique<PNS::SEGMENT>( SEG( aTrack->GetStart(), aTrack->GetEnd() ),
|
||||
aTrack->GetNetCode() );
|
||||
aTrack->GetNet() );
|
||||
|
||||
segment->SetWidth( aTrack->GetWidth() );
|
||||
segment->SetLayers( LAYER_RANGE( aTrack->GetLayer() ) );
|
||||
|
@ -1230,9 +1228,9 @@ std::unique_ptr<PNS::SEGMENT> PNS_KICAD_IFACE_BASE::syncTrack( PCB_TRACK* aTrack
|
|||
|
||||
std::unique_ptr<PNS::ARC> PNS_KICAD_IFACE_BASE::syncArc( PCB_ARC* aArc )
|
||||
{
|
||||
auto arc = std::make_unique<PNS::ARC>(
|
||||
SHAPE_ARC( aArc->GetStart(), aArc->GetMid(), aArc->GetEnd(), aArc->GetWidth() ),
|
||||
aArc->GetNetCode() );
|
||||
auto arc = std::make_unique<PNS::ARC>( SHAPE_ARC( aArc->GetStart(), aArc->GetMid(),
|
||||
aArc->GetEnd(), aArc->GetWidth() ),
|
||||
aArc->GetNet() );
|
||||
|
||||
arc->SetLayers( LAYER_RANGE( aArc->GetLayer() ) );
|
||||
arc->SetParent( aArc );
|
||||
|
@ -1253,7 +1251,7 @@ std::unique_ptr<PNS::VIA> PNS_KICAD_IFACE_BASE::syncVia( PCB_VIA* aVia )
|
|||
LAYER_RANGE( aVia->TopLayer(), aVia->BottomLayer() ),
|
||||
aVia->GetWidth(),
|
||||
aVia->GetDrillValue(),
|
||||
aVia->GetNetCode(),
|
||||
aVia->GetNet(),
|
||||
aVia->GetViaType() );
|
||||
|
||||
via->SetParent( aVia );
|
||||
|
@ -1319,7 +1317,7 @@ bool PNS_KICAD_IFACE_BASE::syncZone( PNS::NODE* aWorld, ZONE* aZone, SHAPE_POLY_
|
|||
std::unique_ptr<PNS::SOLID> solid = std::make_unique<PNS::SOLID>();
|
||||
|
||||
solid->SetLayer( layer );
|
||||
solid->SetNet( -1 );
|
||||
solid->SetNet( nullptr );
|
||||
solid->SetParent( aZone );
|
||||
solid->SetShape( triShape );
|
||||
solid->SetIsCompoundShapePrimitive();
|
||||
|
@ -1343,7 +1341,7 @@ bool PNS_KICAD_IFACE_BASE::syncTextItem( PNS::NODE* aWorld, PCB_TEXT* aText, PCB
|
|||
SHAPE_SIMPLE* shape = new SHAPE_SIMPLE;
|
||||
|
||||
solid->SetLayer( aLayer );
|
||||
solid->SetNet( -1 );
|
||||
solid->SetNet( nullptr );
|
||||
solid->SetParent( aText );
|
||||
solid->SetShape( shape ); // takes ownership
|
||||
solid->SetRoutable( false );
|
||||
|
@ -1394,7 +1392,7 @@ bool PNS_KICAD_IFACE_BASE::syncGraphicalItem( PNS::NODE* aWorld, PCB_SHAPE* aIte
|
|||
}
|
||||
|
||||
solid->SetAnchorPoints( aItem->GetConnectionPoints() );
|
||||
solid->SetNet( aItem->GetNetCode() );
|
||||
solid->SetNet( aItem->GetNet() );
|
||||
solid->SetParent( aItem );
|
||||
solid->SetShape( shape ); // takes ownership
|
||||
|
||||
|
@ -1738,7 +1736,7 @@ void PNS_KICAD_IFACE::DisplayPathLine( const SHAPE_LINE_CHAIN& aLine, int aImpor
|
|||
}
|
||||
|
||||
|
||||
void PNS_KICAD_IFACE::DisplayRatline( const SHAPE_LINE_CHAIN& aRatline, int aNetCode )
|
||||
void PNS_KICAD_IFACE::DisplayRatline( const SHAPE_LINE_CHAIN& aRatline, PNS::NET_HANDLE aNet )
|
||||
{
|
||||
ROUTER_PREVIEW_ITEM* pitem = new ROUTER_PREVIEW_ITEM( aRatline, m_view );
|
||||
|
||||
|
@ -1753,11 +1751,15 @@ void PNS_KICAD_IFACE::DisplayRatline( const SHAPE_LINE_CHAIN& aRatline, int aNet
|
|||
std::map<int, KIGFX::COLOR4D>& netColors = rs->GetNetColorMap();
|
||||
std::map<wxString, KIGFX::COLOR4D>& ncColors = rs->GetNetclassColorMap();
|
||||
const std::map<int, wxString>& ncMap = connectivity->GetNetclassMap();
|
||||
int netCode = -1;
|
||||
|
||||
if( colorByNet && netColors.count( aNetCode ) )
|
||||
color = netColors.at( aNetCode );
|
||||
else if( colorByNet && ncMap.count( aNetCode ) && ncColors.count( ncMap.at( aNetCode ) ) )
|
||||
color = ncColors.at( ncMap.at( aNetCode ) );
|
||||
if( NETINFO_ITEM* net = static_cast<NETINFO_ITEM*>( aNet ) )
|
||||
netCode = net->GetNetCode();
|
||||
|
||||
if( colorByNet && netColors.count( netCode ) )
|
||||
color = netColors.at( netCode );
|
||||
else if( colorByNet && ncMap.count( netCode ) && ncColors.count( ncMap.at( netCode ) ) )
|
||||
color = ncColors.at( ncMap.at( netCode ) );
|
||||
else
|
||||
color = defaultColor;
|
||||
|
||||
|
@ -1865,7 +1867,7 @@ void PNS_KICAD_IFACE::UpdateItem( PNS::ITEM* aItem )
|
|||
via_board->SetPosition( VECTOR2I( via->Pos().x, via->Pos().y ) );
|
||||
via_board->SetWidth( via->Diameter() );
|
||||
via_board->SetDrill( via->Drill() );
|
||||
via_board->SetNetCode( via->Net() > 0 ? via->Net() : 0 );
|
||||
via_board->SetNet( static_cast<NETINFO_ITEM*>( via->Net() ) );
|
||||
via_board->SetViaType( via->ViaType() ); // MUST be before SetLayerPair()
|
||||
via_board->SetIsFree( via->IsFree() );
|
||||
via_board->SetLayerPair( ToLAYER_ID( via->Layers().Start() ),
|
||||
|
@ -1906,7 +1908,7 @@ void PNS_KICAD_IFACE::AddItem( PNS::ITEM* aItem )
|
|||
PCB_ARC* new_arc = new PCB_ARC( m_board, static_cast<const SHAPE_ARC*>( arc->Shape() ) );
|
||||
new_arc->SetWidth( arc->Width() );
|
||||
new_arc->SetLayer( ToLAYER_ID( arc->Layers().Start() ) );
|
||||
new_arc->SetNetCode( std::max<int>( 0, arc->Net() ) );
|
||||
new_arc->SetNet( static_cast<NETINFO_ITEM*>( arc->Net() ) );
|
||||
newBI = new_arc;
|
||||
break;
|
||||
}
|
||||
|
@ -1920,7 +1922,7 @@ void PNS_KICAD_IFACE::AddItem( PNS::ITEM* aItem )
|
|||
track->SetEnd( VECTOR2I( s.B.x, s.B.y ) );
|
||||
track->SetWidth( seg->Width() );
|
||||
track->SetLayer( ToLAYER_ID( seg->Layers().Start() ) );
|
||||
track->SetNetCode( seg->Net() > 0 ? seg->Net() : 0 );
|
||||
track->SetNet( static_cast<NETINFO_ITEM*>( seg->Net() ) );
|
||||
newBI = track;
|
||||
break;
|
||||
}
|
||||
|
@ -1932,7 +1934,7 @@ void PNS_KICAD_IFACE::AddItem( PNS::ITEM* aItem )
|
|||
via_board->SetPosition( VECTOR2I( via->Pos().x, via->Pos().y ) );
|
||||
via_board->SetWidth( via->Diameter() );
|
||||
via_board->SetDrill( via->Drill() );
|
||||
via_board->SetNetCode( via->Net() > 0 ? via->Net() : 0 );
|
||||
via_board->SetNet( static_cast<NETINFO_ITEM*>( via->Net() ) );
|
||||
via_board->SetViaType( via->ViaType() ); // MUST be before SetLayerPair()
|
||||
via_board->SetIsFree( via->IsFree() );
|
||||
via_board->SetLayerPair( ToLAYER_ID( via->Layers().Start() ),
|
||||
|
@ -2028,9 +2030,27 @@ void PNS_KICAD_IFACE::SetView( KIGFX::VIEW* aView )
|
|||
}
|
||||
|
||||
|
||||
void PNS_KICAD_IFACE::UpdateNet( int aNetCode )
|
||||
int PNS_KICAD_IFACE::GetNetCode( PNS::NET_HANDLE aNet ) const
|
||||
{
|
||||
wxLogTrace( wxT( "PNS" ), wxT( "Update-net %d" ), aNetCode );
|
||||
if( aNet )
|
||||
return static_cast<NETINFO_ITEM*>( aNet )->GetNetCode();
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
wxString PNS_KICAD_IFACE::GetNetName( PNS::NET_HANDLE aNet ) const
|
||||
{
|
||||
if( aNet )
|
||||
return static_cast<NETINFO_ITEM*>( aNet )->GetNetname();
|
||||
else
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
|
||||
void PNS_KICAD_IFACE::UpdateNet( PNS::NET_HANDLE aNet )
|
||||
{
|
||||
wxLogTrace( wxT( "PNS" ), wxT( "Update-net %s" ), GetNetName( aNet ) );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -65,15 +65,18 @@ public:
|
|||
void DisplayItem( const PNS::ITEM* aItem, int aClearance, bool aEdit = false,
|
||||
bool aIsHeadTrace = false ) override {}
|
||||
void DisplayPathLine( const SHAPE_LINE_CHAIN& aLine, int aImportance ) override {}
|
||||
void DisplayRatline( const SHAPE_LINE_CHAIN& aRatline, int aNetCode ) override {}
|
||||
void DisplayRatline( const SHAPE_LINE_CHAIN& aRatline, PNS::NET_HANDLE aNet ) override {}
|
||||
void AddItem( PNS::ITEM* aItem ) override;
|
||||
void UpdateItem( PNS::ITEM* aItem ) override;
|
||||
void RemoveItem( PNS::ITEM* aItem ) override;
|
||||
void Commit() override {}
|
||||
bool ImportSizes( PNS::SIZES_SETTINGS& aSizes, PNS::ITEM* aStartItem, int aNet ) override;
|
||||
bool ImportSizes( PNS::SIZES_SETTINGS& aSizes, PNS::ITEM* aStartItem,
|
||||
PNS::NET_HANDLE aNet ) override;
|
||||
int StackupHeight( int aFirstLayer, int aSecondLayer ) const override;
|
||||
|
||||
void UpdateNet( int aNetCode ) override {}
|
||||
int GetNetCode( PNS::NET_HANDLE aNet ) const override { return -1; }
|
||||
wxString GetNetName( PNS::NET_HANDLE aNet ) const override { return wxEmptyString; }
|
||||
void UpdateNet( PNS::NET_HANDLE aNet ) override {}
|
||||
|
||||
void SetDebugDecorator( PNS::DEBUG_DECORATOR* aDec );
|
||||
|
||||
|
@ -122,13 +125,15 @@ public:
|
|||
void HideItem( PNS::ITEM* aItem ) override;
|
||||
void DisplayItem( const PNS::ITEM* aItem, int aClearance, bool aEdit = false, bool aIsHeadTrace = false ) override;
|
||||
void DisplayPathLine( const SHAPE_LINE_CHAIN& aLine, int aImportance ) override;
|
||||
void DisplayRatline( const SHAPE_LINE_CHAIN& aRatline, int aNetCode ) override;
|
||||
void DisplayRatline( const SHAPE_LINE_CHAIN& aRatline, PNS::NET_HANDLE aNet ) override;
|
||||
void Commit() override;
|
||||
void AddItem( PNS::ITEM* aItem ) override;
|
||||
void UpdateItem( PNS::ITEM* aItem ) override;
|
||||
void RemoveItem( PNS::ITEM* aItem ) override;
|
||||
|
||||
void UpdateNet( int aNetCode ) override;
|
||||
int GetNetCode( PNS::NET_HANDLE aNet ) const override;
|
||||
wxString GetNetName( PNS::NET_HANDLE aNet ) const override;
|
||||
void UpdateNet( PNS::NET_HANDLE aNet ) override;
|
||||
|
||||
EDA_UNITS GetUnits() const override;
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ LINE_PLACER::LINE_PLACER( ROUTER* aRouter ) :
|
|||
// Init temporary variables (do not leave uninitialized members)
|
||||
m_lastNode = nullptr;
|
||||
m_placingVia = false;
|
||||
m_currentNet = 0;
|
||||
m_currentNet = nullptr;
|
||||
m_currentLayer = 0;
|
||||
m_startItem = nullptr;
|
||||
m_endItem = nullptr;
|
||||
|
@ -75,7 +75,7 @@ const VIA LINE_PLACER::makeVia( const VECTOR2I& aP )
|
|||
const LAYER_RANGE layers( m_sizes.ViaType() == VIATYPE::THROUGH ? F_Cu : m_sizes.GetLayerTop(),
|
||||
m_sizes.ViaType() == VIATYPE::THROUGH ? B_Cu : m_sizes.GetLayerBottom() );
|
||||
|
||||
return VIA( aP, layers, m_sizes.ViaDiameter(), m_sizes.ViaDrill(), -1, m_sizes.ViaType() );
|
||||
return VIA( aP, layers, m_sizes.ViaDiameter(), m_sizes.ViaDrill(), nullptr, m_sizes.ViaType() );
|
||||
}
|
||||
|
||||
|
||||
|
@ -1325,7 +1325,7 @@ bool LINE_PLACER::Start( const VECTOR2I& aP, ITEM* aStartItem )
|
|||
m_currentStart = VECTOR2I( aP );
|
||||
m_fixStart = VECTOR2I( aP );
|
||||
m_currentEnd = VECTOR2I( aP );
|
||||
m_currentNet = std::max( 0, aStartItem ? aStartItem->Net() : 0 );
|
||||
m_currentNet = aStartItem ? aStartItem->Net() : nullptr;
|
||||
m_startItem = aStartItem;
|
||||
m_placingVia = false;
|
||||
m_chainedPlacement = false;
|
||||
|
@ -1482,12 +1482,12 @@ bool LINE_PLACER::FixRoute( const VECTOR2I& aP, ITEM* aEndItem, bool aForceFinis
|
|||
{
|
||||
// The user has indicated a connection should be made. If either the trace or
|
||||
// endItem is net-less, then allow the connection by adopting the net of the other.
|
||||
if( m_currentNet <= 0 )
|
||||
if( m_router->GetInterface()->GetNetCode( m_currentNet ) <= 0 )
|
||||
{
|
||||
m_currentNet = aEndItem->Net();
|
||||
pl.SetNet( m_currentNet );
|
||||
}
|
||||
else if (aEndItem->Net() <= 0 )
|
||||
else if( m_router->GetInterface()->GetNetCode( aEndItem->Net() ) <= 0 )
|
||||
{
|
||||
aEndItem->SetNet( m_currentNet );
|
||||
}
|
||||
|
@ -1551,7 +1551,7 @@ bool LINE_PLACER::FixRoute( const VECTOR2I& aP, ITEM* aEndItem, bool aForceFinis
|
|||
if( l.PointCount() > 2 )
|
||||
p_pre_last = l.CPoint( -2 );
|
||||
|
||||
if( aEndItem && m_currentNet >= 0 && m_currentNet == aEndItem->Net() )
|
||||
if( aEndItem && m_currentNet && m_currentNet == aEndItem->Net() )
|
||||
realEnd = true;
|
||||
|
||||
if( aForceFinish )
|
||||
|
@ -2004,7 +2004,7 @@ bool LINE_PLACER::buildInitialLine( const VECTOR2I& aP, LINE& aHead, bool aForce
|
|||
}
|
||||
|
||||
|
||||
void LINE_PLACER::GetModifiedNets( std::vector<int>& aNets ) const
|
||||
void LINE_PLACER::GetModifiedNets( std::vector<NET_HANDLE>& aNets ) const
|
||||
{
|
||||
aNets.push_back( m_currentNet );
|
||||
}
|
||||
|
|
|
@ -166,11 +166,11 @@ public:
|
|||
}
|
||||
|
||||
/**
|
||||
* Return the net code of currently routed track.
|
||||
* Return the net of currently routed track.
|
||||
*/
|
||||
const std::vector<int> CurrentNets() const override
|
||||
const std::vector<NET_HANDLE> CurrentNets() const override
|
||||
{
|
||||
return std::vector<int>( 1, m_currentNet );
|
||||
return std::vector<NET_HANDLE>( 1, m_currentNet );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -203,7 +203,7 @@ public:
|
|||
|
||||
bool IsPlacingVia() const override { return m_placingVia; }
|
||||
|
||||
void GetModifiedNets( std::vector<int>& aNets ) const override;
|
||||
void GetModifiedNets( std::vector<NET_HANDLE>& aNets ) const override;
|
||||
|
||||
/**
|
||||
* Check if point \a aP lies on segment \a aSeg. If so, splits the segment in two, forming a
|
||||
|
@ -362,7 +362,7 @@ private:
|
|||
|
||||
bool m_placingVia;
|
||||
|
||||
int m_currentNet;
|
||||
NET_HANDLE m_currentNet;
|
||||
int m_currentLayer;
|
||||
|
||||
VECTOR2I m_currentEnd;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* KiRouter - a push-and-(sometimes-)shove PCB router
|
||||
*
|
||||
* Copyright (C) 2013-2014 CERN
|
||||
* Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
*
|
||||
|
@ -80,9 +80,9 @@ public:
|
|||
const VECTOR2I& CurrentEnd() const override;
|
||||
|
||||
/// @copydoc PLACEMENT_ALGO::CurrentNets()
|
||||
const std::vector<int> CurrentNets() const override
|
||||
const std::vector<NET_HANDLE> CurrentNets() const override
|
||||
{
|
||||
return std::vector<int> (1, m_originLine.Net() );
|
||||
return std::vector<NET_HANDLE> (1, m_originLine.Net() );
|
||||
}
|
||||
|
||||
/// @copydoc PLACEMENT_ALGO::CurrentLayer()
|
||||
|
|
|
@ -761,7 +761,7 @@ void NODE::rebuildJoint( const JOINT* aJoint, const ITEM* aItem )
|
|||
|
||||
std::vector<ITEM*> links( aJoint->LinkList() );
|
||||
JOINT::HASH_TAG tag;
|
||||
int net = aItem->Net();
|
||||
NET_HANDLE net = aItem->Net();
|
||||
|
||||
tag.net = net;
|
||||
tag.pos = aJoint->Pos();
|
||||
|
@ -1186,7 +1186,7 @@ void NODE::FixupVirtualVias()
|
|||
}
|
||||
|
||||
|
||||
const JOINT* NODE::FindJoint( const VECTOR2I& aPos, int aLayer, int aNet ) const
|
||||
const JOINT* NODE::FindJoint( const VECTOR2I& aPos, int aLayer, NET_HANDLE aNet ) const
|
||||
{
|
||||
JOINT::HASH_TAG tag;
|
||||
|
||||
|
@ -1223,7 +1223,7 @@ void NODE::LockJoint( const VECTOR2I& aPos, const ITEM* aItem, bool aLock )
|
|||
}
|
||||
|
||||
|
||||
JOINT& NODE::touchJoint( const VECTOR2I& aPos, const LAYER_RANGE& aLayers, int aNet )
|
||||
JOINT& NODE::touchJoint( const VECTOR2I& aPos, const LAYER_RANGE& aLayers, NET_HANDLE aNet )
|
||||
{
|
||||
JOINT::HASH_TAG tag;
|
||||
|
||||
|
@ -1284,7 +1284,8 @@ void JOINT::Dump() const
|
|||
}
|
||||
|
||||
|
||||
void NODE::linkJoint( const VECTOR2I& aPos, const LAYER_RANGE& aLayers, int aNet, ITEM* aWhere )
|
||||
void NODE::linkJoint( const VECTOR2I& aPos, const LAYER_RANGE& aLayers, NET_HANDLE aNet,
|
||||
ITEM* aWhere )
|
||||
{
|
||||
JOINT& jt = touchJoint( aPos, aLayers, aNet );
|
||||
|
||||
|
@ -1292,7 +1293,8 @@ void NODE::linkJoint( const VECTOR2I& aPos, const LAYER_RANGE& aLayers, int aNet
|
|||
}
|
||||
|
||||
|
||||
void NODE::unlinkJoint( const VECTOR2I& aPos, const LAYER_RANGE& aLayers, int aNet, ITEM* aWhere )
|
||||
void NODE::unlinkJoint( const VECTOR2I& aPos, const LAYER_RANGE& aLayers, NET_HANDLE aNet,
|
||||
ITEM* aWhere )
|
||||
{
|
||||
// fixme: remove dangling joints
|
||||
JOINT& jt = touchJoint( aPos, aLayers, aNet );
|
||||
|
@ -1474,7 +1476,7 @@ void NODE::KillChildren()
|
|||
}
|
||||
|
||||
|
||||
void NODE::AllItemsInNet( int aNet, std::set<ITEM*>& aItems, int aKindMask )
|
||||
void NODE::AllItemsInNet( NET_HANDLE aNet, std::set<ITEM*>& aItems, int aKindMask )
|
||||
{
|
||||
INDEX::NET_ITEMS_LIST* l_cur = m_index->GetItemsForNet( aNet );
|
||||
|
||||
|
@ -1529,7 +1531,7 @@ void NODE::RemoveByMarker( int aMarker )
|
|||
|
||||
|
||||
SEGMENT* NODE::findRedundantSegment( const VECTOR2I& A, const VECTOR2I& B, const LAYER_RANGE& lr,
|
||||
int aNet )
|
||||
NET_HANDLE aNet )
|
||||
{
|
||||
const JOINT* jtStart = FindJoint( A, lr.Start(), aNet );
|
||||
|
||||
|
@ -1564,7 +1566,7 @@ SEGMENT* NODE::findRedundantSegment( SEGMENT* aSeg )
|
|||
|
||||
|
||||
ARC* NODE::findRedundantArc( const VECTOR2I& A, const VECTOR2I& B, const LAYER_RANGE& lr,
|
||||
int aNet )
|
||||
NET_HANDLE aNet )
|
||||
{
|
||||
const JOINT* jtStart = FindJoint( A, lr.Start(), aNet );
|
||||
|
||||
|
@ -1641,7 +1643,7 @@ ITEM *NODE::FindItemByParent( const BOARD_ITEM* aParent )
|
|||
if( aParent->IsConnected() )
|
||||
{
|
||||
const BOARD_CONNECTED_ITEM* cItem = static_cast<const BOARD_CONNECTED_ITEM*>( aParent );
|
||||
INDEX::NET_ITEMS_LIST* l_cur = m_index->GetItemsForNet( cItem->GetNetCode() );
|
||||
INDEX::NET_ITEMS_LIST* l_cur = m_index->GetItemsForNet( cItem->GetNet() );
|
||||
|
||||
if( l_cur )
|
||||
{
|
||||
|
|
|
@ -139,23 +139,23 @@ public:
|
|||
|
||||
virtual int Clearance( const ITEM* aA, const ITEM* aB, bool aUseClearanceEpsilon = true ) = 0;
|
||||
|
||||
virtual int DpCoupledNet( int aNet ) = 0;
|
||||
virtual int DpNetPolarity( int aNet ) = 0;
|
||||
virtual bool DpNetPair( const ITEM* aItem, int& aNetP, int& aNetN ) = 0;
|
||||
virtual NET_HANDLE DpCoupledNet( NET_HANDLE aNet ) = 0;
|
||||
virtual int DpNetPolarity( NET_HANDLE aNet ) = 0;
|
||||
virtual bool DpNetPair( const ITEM* aItem, NET_HANDLE& aNetP, NET_HANDLE& aNetN ) = 0;
|
||||
|
||||
virtual int NetCode( NET_HANDLE aNet ) = 0;
|
||||
virtual wxString NetName( NET_HANDLE aNet ) = 0;
|
||||
|
||||
virtual bool IsInNetTie( const ITEM* aA ) = 0;
|
||||
virtual bool IsNetTieExclusion( const PNS::ITEM* aItem, const VECTOR2I& aCollisionPos,
|
||||
const PNS::ITEM* aCollidingItem )= 0;
|
||||
virtual bool IsNetTieExclusion( const ITEM* aItem, const VECTOR2I& aCollisionPos,
|
||||
const ITEM* aCollidingItem )= 0;
|
||||
|
||||
virtual bool IsKeepout( const ITEM* aA, const ITEM* aB ) = 0;
|
||||
|
||||
virtual bool QueryConstraint( CONSTRAINT_TYPE aType, const PNS::ITEM* aItemA,
|
||||
const PNS::ITEM* aItemB, int aLayer,
|
||||
PNS::CONSTRAINT* aConstraint ) = 0;
|
||||
virtual bool QueryConstraint( CONSTRAINT_TYPE aType, const ITEM* aItemA, const ITEM* aItemB,
|
||||
int aLayer, CONSTRAINT* aConstraint ) = 0;
|
||||
|
||||
virtual wxString NetName( int aNet ) = 0;
|
||||
|
||||
virtual void ClearCacheForItems( std::vector<const PNS::ITEM*>& aItems ) {}
|
||||
virtual void ClearCacheForItems( std::vector<const ITEM*>& aItems ) {}
|
||||
virtual void ClearCaches() {}
|
||||
|
||||
virtual int ClearanceEpsilon() const { return 0; }
|
||||
|
@ -400,7 +400,7 @@ public:
|
|||
*
|
||||
* @return the joint, if found, otherwise empty.
|
||||
*/
|
||||
const JOINT* FindJoint( const VECTOR2I& aPos, int aLayer, int aNet ) const;
|
||||
const JOINT* FindJoint( const VECTOR2I& aPos, int aLayer, NET_HANDLE aNet ) const;
|
||||
|
||||
void LockJoint( const VECTOR2I& aPos, const ITEM* aItem, bool aLock );
|
||||
|
||||
|
@ -423,7 +423,7 @@ public:
|
|||
///< Destroy all child nodes. Applicable only to the root node.
|
||||
void KillChildren();
|
||||
|
||||
void AllItemsInNet( int aNet, std::set<ITEM*>& aItems, int aKindMask = -1 );
|
||||
void AllItemsInNet( NET_HANDLE aNet, std::set<ITEM*>& aItems, int aKindMask = -1 );
|
||||
|
||||
void ClearRanks( int aMarkerMask = MK_HEAD | MK_VIOLATION );
|
||||
|
||||
|
@ -464,13 +464,15 @@ private:
|
|||
NODE& operator=( const NODE& aB );
|
||||
|
||||
///< Try to find matching joint and creates a new one if not found.
|
||||
JOINT& touchJoint( const VECTOR2I& aPos, const LAYER_RANGE& aLayers, int aNet );
|
||||
JOINT& touchJoint( const VECTOR2I& aPos, const LAYER_RANGE& aLayers, NET_HANDLE aNet );
|
||||
|
||||
///< Touch a joint and links it to an m_item.
|
||||
void linkJoint( const VECTOR2I& aPos, const LAYER_RANGE& aLayers, int aNet, ITEM* aWhere );
|
||||
void linkJoint( const VECTOR2I& aPos, const LAYER_RANGE& aLayers, NET_HANDLE aNet,
|
||||
ITEM* aWhere );
|
||||
|
||||
///< Unlink an item from a joint.
|
||||
void unlinkJoint( const VECTOR2I& aPos, const LAYER_RANGE& aLayers, int aNet, ITEM* aWhere );
|
||||
void unlinkJoint( const VECTOR2I& aPos, const LAYER_RANGE& aLayers, NET_HANDLE aNet,
|
||||
ITEM* aWhere );
|
||||
|
||||
///< Helpers for adding/removing items.
|
||||
void addSolid( SOLID* aSeg );
|
||||
|
@ -496,10 +498,11 @@ private:
|
|||
}
|
||||
|
||||
SEGMENT* findRedundantSegment( const VECTOR2I& A, const VECTOR2I& B, const LAYER_RANGE& lr,
|
||||
int aNet );
|
||||
NET_HANDLE aNet );
|
||||
SEGMENT* findRedundantSegment( SEGMENT* aSeg );
|
||||
|
||||
ARC* findRedundantArc( const VECTOR2I& A, const VECTOR2I& B, const LAYER_RANGE& lr, int aNet );
|
||||
ARC* findRedundantArc( const VECTOR2I& A, const VECTOR2I& B, const LAYER_RANGE& lr,
|
||||
NET_HANDLE aNet );
|
||||
ARC* findRedundantArc( ARC* aSeg );
|
||||
|
||||
///< Scan the joint map, forming a line starting from segment (current).
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* KiRouter - a push-and-(sometimes-)shove PCB router
|
||||
*
|
||||
* Copyright (C) 2013-2014 CERN
|
||||
* Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
|
@ -927,7 +927,7 @@ OPTIMIZER::BREAKOUT_LIST OPTIMIZER::computeBreakouts( int aWidth, const ITEM* aI
|
|||
}
|
||||
|
||||
|
||||
ITEM* OPTIMIZER::findPadOrVia( int aLayer, int aNet, const VECTOR2I& aP ) const
|
||||
ITEM* OPTIMIZER::findPadOrVia( int aLayer, NET_HANDLE aNet, const VECTOR2I& aP ) const
|
||||
{
|
||||
const JOINT* jt = m_world->FindJoint( aP, aLayer, aNet );
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* KiRouter - a push-and-(sometimes-)shove PCB router
|
||||
*
|
||||
* Copyright (C) 2013-2014 CERN
|
||||
* Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
*
|
||||
|
@ -195,7 +195,7 @@ private:
|
|||
|
||||
int smartPadsSingle( LINE* aLine, ITEM* aPad, bool aEnd, int aEndVertex );
|
||||
|
||||
ITEM* findPadOrVia( int aLayer, int aNet, const VECTOR2I& aP ) const;
|
||||
ITEM* findPadOrVia( int aLayer, NET_HANDLE aNet, const VECTOR2I& aP ) const;
|
||||
|
||||
private:
|
||||
SHAPE_INDEX_LIST<ITEM*> m_cache;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* KiRouter - a push-and-(sometimes-)shove PCB router
|
||||
*
|
||||
* Copyright (C) 2013-2014 CERN
|
||||
* Copyright (C) 2016 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
|
@ -141,9 +141,9 @@ public:
|
|||
/**
|
||||
* Function CurrentNets()
|
||||
*
|
||||
* Returns the net code(s) of currently routed track(s).
|
||||
* Returns the net(s) of currently routed track(s).
|
||||
*/
|
||||
virtual const std::vector<int> CurrentNets() const = 0;
|
||||
virtual const std::vector<NET_HANDLE> CurrentNets() const = 0;
|
||||
|
||||
/**
|
||||
* Function CurrentLayer()
|
||||
|
@ -193,9 +193,9 @@ public:
|
|||
/**
|
||||
* Function GetModifiedNets
|
||||
*
|
||||
* Returns the net codes of all currently routed trace(s)
|
||||
* Returns the nets of all currently routed trace(s)
|
||||
*/
|
||||
virtual void GetModifiedNets( std::vector<int> &aNets ) const
|
||||
virtual void GetModifiedNets( std::vector<NET_HANDLE> &aNets ) const
|
||||
{
|
||||
}
|
||||
};
|
||||
|
|
|
@ -146,7 +146,7 @@ const ITEM_SET ROUTER::QueryHoverItems( const VECTOR2I& aP, bool aUseClearance )
|
|||
if( aUseClearance )
|
||||
{
|
||||
NODE::OBSTACLES obs;
|
||||
SEGMENT test( SEG( aP, aP ), -1 );
|
||||
SEGMENT test( SEG( aP, aP ), nullptr );
|
||||
COLLISION_SEARCH_OPTIONS opts;
|
||||
|
||||
test.SetWidth( 1 );
|
||||
|
@ -922,11 +922,11 @@ void ROUTER::StopRouting()
|
|||
|
||||
if( m_placer )
|
||||
{
|
||||
std::vector<int> nets;
|
||||
std::vector<NET_HANDLE> nets;
|
||||
m_placer->GetModifiedNets( nets );
|
||||
|
||||
// Update the ratsnest with new changes
|
||||
for( int n : nets )
|
||||
for( NET_HANDLE n : nets )
|
||||
m_iface->UpdateNet( n );
|
||||
}
|
||||
|
||||
|
@ -981,14 +981,14 @@ void ROUTER::ToggleViaPlacement()
|
|||
}
|
||||
|
||||
|
||||
const std::vector<int> ROUTER::GetCurrentNets() const
|
||||
const std::vector<NET_HANDLE> ROUTER::GetCurrentNets() const
|
||||
{
|
||||
if( m_placer )
|
||||
return m_placer->CurrentNets();
|
||||
else if( m_dragger )
|
||||
return m_dragger->CurrentNets();
|
||||
|
||||
return std::vector<int>();
|
||||
return std::vector<NET_HANDLE>();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -99,13 +99,15 @@ enum DRAG_MODE
|
|||
virtual bool IsFlashedOnLayer( const PNS::ITEM* aItem, const LAYER_RANGE& aLayer ) const = 0;
|
||||
virtual void DisplayItem( const ITEM* aItem, int aClearance, bool aEdit = false, bool aIsHeadTrace = false ) = 0;
|
||||
virtual void DisplayPathLine( const SHAPE_LINE_CHAIN& aLine, int aImportance ) = 0;
|
||||
virtual void DisplayRatline( const SHAPE_LINE_CHAIN& aRatline, int aNetCode ) = 0;
|
||||
virtual void DisplayRatline( const SHAPE_LINE_CHAIN& aRatline, NET_HANDLE aNetCode ) = 0;
|
||||
virtual void HideItem( ITEM* aItem ) = 0;
|
||||
virtual void Commit() = 0;
|
||||
virtual bool ImportSizes( SIZES_SETTINGS& aSizes, ITEM* aStartItem, int aNet ) = 0;
|
||||
virtual bool ImportSizes( SIZES_SETTINGS& aSizes, ITEM* aStartItem, NET_HANDLE aNet ) = 0;
|
||||
virtual int StackupHeight( int aFirstLayer, int aSecondLayer ) const = 0;
|
||||
virtual void EraseView() = 0;
|
||||
virtual void UpdateNet( int aNetCode ) = 0;
|
||||
virtual int GetNetCode( NET_HANDLE aNet ) const = 0;
|
||||
virtual wxString GetNetName( PNS::NET_HANDLE aNet ) const = 0;
|
||||
virtual void UpdateNet( NET_HANDLE aNet ) = 0;
|
||||
|
||||
virtual PNS::NODE* GetWorld() const = 0;
|
||||
|
||||
|
@ -170,7 +172,7 @@ public:
|
|||
void ToggleCornerMode();
|
||||
|
||||
int GetCurrentLayer() const;
|
||||
const std::vector<int> GetCurrentNets() const;
|
||||
const std::vector<NET_HANDLE> GetCurrentNets() const;
|
||||
|
||||
LOGGER* Logger();
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* KiRouter - a push-and-(sometimes-)shove PCB router
|
||||
*
|
||||
* Copyright (C) 2013-2014 CERN
|
||||
* Copyright (C) 2016 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
|
@ -42,7 +42,7 @@ public:
|
|||
LINKED_ITEM( SEGMENT_T )
|
||||
{}
|
||||
|
||||
SEGMENT( const SEG& aSeg, int aNet ) :
|
||||
SEGMENT( const SEG& aSeg, NET_HANDLE aNet ) :
|
||||
LINKED_ITEM( SEGMENT_T ),
|
||||
m_seg( aSeg, 0 )
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* KiRouter - a push-and-(sometimes-)shove PCB router
|
||||
*
|
||||
* Copyright (C) 2013 CERN
|
||||
* Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
|
@ -95,8 +95,8 @@ void TOOL_BASE::Reset( RESET_REASON aReason )
|
|||
}
|
||||
|
||||
|
||||
ITEM* TOOL_BASE::pickSingleItem( const VECTOR2I& aWhere, int aNet, int aLayer, bool aIgnorePads,
|
||||
const std::vector<ITEM*> aAvoidItems )
|
||||
ITEM* TOOL_BASE::pickSingleItem( const VECTOR2I& aWhere, NET_HANDLE aNet, int aLayer,
|
||||
bool aIgnorePads, const std::vector<ITEM*> aAvoidItems )
|
||||
{
|
||||
int tl = aLayer > 0 ? aLayer : getView()->GetTopLayer();
|
||||
|
||||
|
@ -148,7 +148,7 @@ ITEM* TOOL_BASE::pickSingleItem( const VECTOR2I& aWhere, int aNet, int aLayer, b
|
|||
{
|
||||
continue;
|
||||
}
|
||||
else if( aNet <= 0 || item->Net() == aNet )
|
||||
else if( m_router->GetInterface()->GetNetCode( aNet) <= 0 || item->Net() == aNet )
|
||||
{
|
||||
if( item->OfKind( ITEM::VIA_T | ITEM::SOLID_T ) )
|
||||
{
|
||||
|
@ -234,11 +234,15 @@ ITEM* TOOL_BASE::pickSingleItem( const VECTOR2I& aWhere, int aNet, int aLayer, b
|
|||
}
|
||||
|
||||
|
||||
void TOOL_BASE::highlightNets( bool aEnabled, std::set<int> aNetcodes )
|
||||
void TOOL_BASE::highlightNets( bool aEnabled, std::set<NET_HANDLE> aNets )
|
||||
{
|
||||
RENDER_SETTINGS* rs = getView()->GetPainter()->GetSettings();
|
||||
std::set<int> netcodes;
|
||||
|
||||
if( aNetcodes.size() > 0 && aEnabled )
|
||||
for( const NET_HANDLE& net : aNets )
|
||||
netcodes.insert( m_router->GetInterface()->GetNetCode( net ) );
|
||||
|
||||
if( netcodes.size() > 0 && aEnabled )
|
||||
{
|
||||
// If the user has previously set some of the routed nets to be highlighted,
|
||||
// we assume they want to keep them highlighted after routing
|
||||
|
@ -246,7 +250,7 @@ void TOOL_BASE::highlightNets( bool aEnabled, std::set<int> aNetcodes )
|
|||
const std::set<int>& currentNetCodes = rs->GetHighlightNetCodes();
|
||||
bool keep = false;
|
||||
|
||||
for( const int& netcode : aNetcodes )
|
||||
for( const int& netcode : netcodes )
|
||||
{
|
||||
if( currentNetCodes.find( netcode ) != currentNetCodes.end() )
|
||||
{
|
||||
|
@ -260,7 +264,7 @@ void TOOL_BASE::highlightNets( bool aEnabled, std::set<int> aNetcodes )
|
|||
else
|
||||
m_startHighlightNetcodes.clear();
|
||||
|
||||
rs->SetHighlight( aNetcodes, true );
|
||||
rs->SetHighlight( netcodes, true );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -328,7 +332,7 @@ void TOOL_BASE::updateStartItem( const TOOL_EVENT& aEvent, bool aIgnorePads )
|
|||
else
|
||||
p = cp;
|
||||
|
||||
m_startItem = pickSingleItem( aEvent.IsClick() ? cp : p, -1, -1, aIgnorePads );
|
||||
m_startItem = pickSingleItem( aEvent.IsClick() ? cp : p, nullptr, -1, aIgnorePads );
|
||||
|
||||
if( !m_gridHelper->GetUseGrid() && m_startItem && !m_startItem->Layers().Overlaps( tl ) )
|
||||
m_startItem = nullptr;
|
||||
|
@ -359,7 +363,7 @@ void TOOL_BASE::updateEndItem( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
|
||||
if( m_router->Settings().Mode() != RM_MarkObstacles &&
|
||||
( m_router->GetCurrentNets().empty() || m_router->GetCurrentNets().front() < 0 ) )
|
||||
( m_router->GetCurrentNets().empty() || m_router->GetCurrentNets().front() == nullptr ) )
|
||||
{
|
||||
m_endSnapPoint = snapToItem( nullptr, mousePos );
|
||||
controls()->ForceCursorPosition( true, m_endSnapPoint );
|
||||
|
@ -375,9 +379,9 @@ void TOOL_BASE::updateEndItem( const TOOL_EVENT& aEvent )
|
|||
|
||||
ITEM* endItem = nullptr;
|
||||
|
||||
std::vector<int> nets = m_router->GetCurrentNets();
|
||||
std::vector<NET_HANDLE> nets = m_router->GetCurrentNets();
|
||||
|
||||
for( int net : nets )
|
||||
for( NET_HANDLE net : nets )
|
||||
{
|
||||
endItem = pickSingleItem( mousePos, net, layer, false, { m_startItem } );
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* KiRouter - a push-and-(sometimes-)shove PCB router
|
||||
*
|
||||
* Copyright (C) 2013-2014 CERN
|
||||
* Copyright (C) 2016-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
* Author: Maciej Suminski <maciej.suminski@cern.ch>
|
||||
*
|
||||
|
@ -57,11 +57,11 @@ protected:
|
|||
|
||||
const VECTOR2I snapToItem( ITEM* aSnapToItem, const VECTOR2I& aP);
|
||||
|
||||
virtual ITEM* pickSingleItem( const VECTOR2I& aWhere, int aNet = -1, int aLayer = -1,
|
||||
bool aIgnorePads = false,
|
||||
virtual ITEM* pickSingleItem( const VECTOR2I& aWhere, NET_HANDLE aNet = nullptr,
|
||||
int aLayer = -1, bool aIgnorePads = false,
|
||||
const std::vector<ITEM*> aAvoidItems = {} );
|
||||
|
||||
virtual void highlightNets( bool aEnabled, std::set<int> aNetcodes = {} );
|
||||
virtual void highlightNets( bool aEnabled, std::set<NET_HANDLE> aNetcodes = {} );
|
||||
|
||||
virtual void updateStartItem( const TOOL_EVENT& aEvent, bool aIgnorePads = false );
|
||||
virtual void updateEndItem( const TOOL_EVENT& aEvent );
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* KiRouter - a push-and-(sometimes-)shove PCB router
|
||||
*
|
||||
* Copyright (C) 2013-2015 CERN
|
||||
* Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
|
@ -107,7 +107,7 @@ bool TOPOLOGY::NearestUnconnectedAnchorPoint( const LINE* aTrack, VECTOR2I& aPoi
|
|||
|
||||
const JOINT* jt = tmpNode->FindJoint( track.CPoint( -1 ), &track );
|
||||
|
||||
if( !jt || jt->Net() <= 0 )
|
||||
if( !jt || m_world->GetRuleResolver()->NetCode( jt->Net() ) <= 0 )
|
||||
return false;
|
||||
|
||||
if( ( !track.EndsWithVia() && jt->LinkCount() >= 2 )
|
||||
|
@ -465,10 +465,10 @@ bool commonParallelProjection( SEG p, SEG n, SEG &pClip, SEG& nClip );
|
|||
|
||||
bool TOPOLOGY::AssembleDiffPair( ITEM* aStart, DIFF_PAIR& aPair )
|
||||
{
|
||||
int refNet = aStart->Net();
|
||||
int coupledNet = m_world->GetRuleResolver()->DpCoupledNet( refNet );
|
||||
NET_HANDLE refNet = aStart->Net();
|
||||
NET_HANDLE coupledNet = m_world->GetRuleResolver()->DpCoupledNet( refNet );
|
||||
|
||||
if( coupledNet < 0 )
|
||||
if( !coupledNet )
|
||||
return false;
|
||||
|
||||
std::set<ITEM*> coupledItems;
|
||||
|
|
|
@ -44,7 +44,7 @@ struct VIA_HANDLE
|
|||
bool valid = false;
|
||||
VECTOR2I pos;
|
||||
LAYER_RANGE layers;
|
||||
int net = -1;
|
||||
NET_HANDLE net = nullptr;
|
||||
};
|
||||
|
||||
class VIA : public LINKED_ITEM
|
||||
|
@ -63,7 +63,7 @@ public:
|
|||
}
|
||||
|
||||
VIA( const VECTOR2I& aPos, const LAYER_RANGE& aLayers, int aDiameter, int aDrill,
|
||||
int aNet = -1, VIATYPE aViaType = VIATYPE::THROUGH ) :
|
||||
NET_HANDLE aNet = nullptr, VIATYPE aViaType = VIATYPE::THROUGH ) :
|
||||
LINKED_ITEM( VIA_T ),
|
||||
m_hole( nullptr )
|
||||
{
|
||||
|
@ -217,7 +217,7 @@ private:
|
|||
class VVIA : public VIA
|
||||
{
|
||||
public:
|
||||
VVIA( const VECTOR2I& aPos, int aLayer, int aDiameter, int aNet ) :
|
||||
VVIA( const VECTOR2I& aPos, int aLayer, int aDiameter, NET_HANDLE aNet ) :
|
||||
VIA( aPos, LAYER_RANGE( aLayer, aLayer ), aDiameter, aDiameter / 2, aNet )
|
||||
{
|
||||
m_isVirtual = true;
|
||||
|
|
|
@ -504,10 +504,11 @@ bool ROUTER_TOOL::Init()
|
|||
auto hasOtherEnd =
|
||||
[&]( const SELECTION& )
|
||||
{
|
||||
std::vector<int> currentNets = m_router->GetCurrentNets();
|
||||
std::vector<PNS::NET_HANDLE> currentNets = m_router->GetCurrentNets();
|
||||
NETINFO_ITEM* netInfo = static_cast<NETINFO_ITEM*>( currentNets[0] );
|
||||
|
||||
// Need to have something unconnected to finish to
|
||||
int currentNet = currentNets.empty() ? -1 : currentNets[0];
|
||||
int currentNet = netInfo ? netInfo->GetNetCode() : -1;
|
||||
BOARD* board = getEditFrame<PCB_EDIT_FRAME>()->GetBoard();
|
||||
RN_NET* ratsnest = board->GetConnectivity()->GetRatsnestForNet( currentNet );
|
||||
|
||||
|
@ -714,7 +715,7 @@ void ROUTER_TOOL::switchLayerOnViaPlacement()
|
|||
|
||||
void ROUTER_TOOL::updateSizesAfterLayerSwitch( PCB_LAYER_ID targetLayer, const VECTOR2I& aPos )
|
||||
{
|
||||
std::vector<int> nets = m_router->GetCurrentNets();
|
||||
std::vector<PNS::NET_HANDLE> nets = m_router->GetCurrentNets();
|
||||
|
||||
PNS::SIZES_SETTINGS sizes = m_router->Sizes();
|
||||
BOARD_DESIGN_SETTINGS& bds = board()->GetDesignSettings();
|
||||
|
@ -724,7 +725,7 @@ void ROUTER_TOOL::updateSizesAfterLayerSwitch( PCB_LAYER_ID targetLayer, const V
|
|||
PCB_TRACK dummyTrack( board() );
|
||||
dummyTrack.SetFlags( ROUTER_TRANSIENT );
|
||||
dummyTrack.SetLayer( targetLayer );
|
||||
dummyTrack.SetNetCode( nets.empty() ? 0 : nets[0] );
|
||||
dummyTrack.SetNet( nets.empty() ? nullptr: static_cast<NETINFO_ITEM*>( nets[0] ) );
|
||||
dummyTrack.SetStart( aPos );
|
||||
dummyTrack.SetEnd( dummyTrack.GetStart() );
|
||||
|
||||
|
@ -762,7 +763,7 @@ void ROUTER_TOOL::updateSizesAfterLayerSwitch( PCB_LAYER_ID targetLayer, const V
|
|||
PCB_TRACK dummyTrackB( board() );
|
||||
dummyTrackB.SetFlags( ROUTER_TRANSIENT );
|
||||
dummyTrackB.SetLayer( targetLayer );
|
||||
dummyTrackB.SetNetCode( nets[1] );
|
||||
dummyTrackB.SetNet( static_cast<NETINFO_ITEM*>( nets[1] ) );
|
||||
dummyTrackB.SetStart( aPos );
|
||||
dummyTrackB.SetEnd( dummyTrackB.GetStart() );
|
||||
|
||||
|
@ -1196,7 +1197,7 @@ int ROUTER_TOOL::handleLayerSwitch( const TOOL_EVENT& aEvent, bool aForceVia )
|
|||
dummyVia.SetLayerPair( currentLayer, targetLayer );
|
||||
|
||||
if( !m_router->GetCurrentNets().empty() )
|
||||
dummyVia.SetNetCode( m_router->GetCurrentNets()[0] );
|
||||
dummyVia.SetNet( static_cast<NETINFO_ITEM*>( m_router->GetCurrentNets()[0] ) );
|
||||
|
||||
DRC_CONSTRAINT constraint;
|
||||
|
||||
|
@ -1267,17 +1268,17 @@ bool ROUTER_TOOL::prepareInteractive()
|
|||
m_iface->SetStartLayer( routingLayer );
|
||||
|
||||
frame()->GetBoard()->GetDesignSettings().m_TempOverrideTrackWidth = false;
|
||||
m_iface->ImportSizes( sizes, m_startItem, -1 );
|
||||
m_iface->ImportSizes( sizes, m_startItem, nullptr );
|
||||
sizes.AddLayerPair( frame()->GetScreen()->m_Route_Layer_TOP,
|
||||
frame()->GetScreen()->m_Route_Layer_BOTTOM );
|
||||
|
||||
m_router->UpdateSizes( sizes );
|
||||
|
||||
if( m_startItem && m_startItem->Net() > 0 )
|
||||
if( m_startItem && m_startItem->Net() )
|
||||
{
|
||||
if( m_router->Mode() == PNS::PNS_MODE_ROUTE_DIFF_PAIR )
|
||||
{
|
||||
if( int coupledNet = m_router->GetRuleResolver()->DpCoupledNet( m_startItem->Net() ) )
|
||||
if( PNS::NET_HANDLE coupledNet = m_router->GetRuleResolver()->DpCoupledNet( m_startItem->Net() ) )
|
||||
highlightNets( true, { m_startItem->Net(), coupledNet } );
|
||||
}
|
||||
else
|
||||
|
@ -1932,7 +1933,7 @@ void ROUTER_TOOL::performDragging( int aMode )
|
|||
if( !dragStarted )
|
||||
return;
|
||||
|
||||
if( m_startItem && m_startItem->Net() > 0 )
|
||||
if( m_startItem && m_startItem->Net() )
|
||||
highlightNets( true, { m_startItem->Net() } );
|
||||
|
||||
ctls->SetAutoPan( true );
|
||||
|
@ -2229,7 +2230,7 @@ int ROUTER_TOOL::InlineDrag( const TOOL_EVENT& aEvent )
|
|||
p = snapToItem( startItem, p0 );
|
||||
m_startItem = startItem;
|
||||
|
||||
if( m_startItem && m_startItem->Net() > 0 )
|
||||
if( m_startItem->Net() )
|
||||
highlightNets( true, { m_startItem->Net() } );
|
||||
}
|
||||
else if( footprint )
|
||||
|
@ -2554,18 +2555,18 @@ void ROUTER_TOOL::UpdateMessagePanel()
|
|||
|
||||
if( m_router->GetState() == PNS::ROUTER::ROUTE_TRACK )
|
||||
{
|
||||
PNS::SIZES_SETTINGS sizes( m_router->Sizes() );
|
||||
PNS::RULE_RESOLVER* resolver = m_iface->GetRuleResolver();
|
||||
std::vector<int> nets = m_router->GetCurrentNets();
|
||||
wxString description;
|
||||
wxString secondary;
|
||||
PNS::SIZES_SETTINGS sizes( m_router->Sizes() );
|
||||
PNS::RULE_RESOLVER* resolver = m_iface->GetRuleResolver();
|
||||
std::vector<PNS::NET_HANDLE> nets = m_router->GetCurrentNets();
|
||||
wxString description;
|
||||
wxString secondary;
|
||||
|
||||
if( m_router->Mode() == PNS::ROUTER_MODE::PNS_MODE_ROUTE_DIFF_PAIR )
|
||||
{
|
||||
wxASSERT( nets.size() >= 2 );
|
||||
|
||||
NETINFO_ITEM* netA = board()->FindNet( nets[0] );
|
||||
NETINFO_ITEM* netB = board()->FindNet( nets[1] );
|
||||
NETINFO_ITEM* netA = static_cast<NETINFO_ITEM*>( nets[0] );
|
||||
NETINFO_ITEM* netB = static_cast<NETINFO_ITEM*>( nets[1] );
|
||||
wxASSERT( netA );
|
||||
wxASSERT( netB );
|
||||
|
||||
|
@ -2584,10 +2585,9 @@ void ROUTER_TOOL::UpdateMessagePanel()
|
|||
secondary = wxString::Format( _( "Resolved Netclass: %s" ),
|
||||
UnescapeString( netclass ) );
|
||||
}
|
||||
else if( !nets.empty() )
|
||||
else if( !nets.empty() && nets[0] )
|
||||
{
|
||||
NETINFO_ITEM* net = board()->FindNet( nets[0] );
|
||||
wxASSERT( net );
|
||||
NETINFO_ITEM* net = static_cast<NETINFO_ITEM*>( nets[0] );
|
||||
|
||||
description = wxString::Format( _( "Routing Track: %s" ),
|
||||
net->GetNetname() );
|
||||
|
|
|
@ -153,14 +153,25 @@ public:
|
|||
return rv;
|
||||
}
|
||||
|
||||
virtual int DpCoupledNet( int aNet ) override { return -1; }
|
||||
virtual int DpNetPolarity( int aNet ) override { return -1; }
|
||||
virtual PNS::NET_HANDLE DpCoupledNet( PNS::NET_HANDLE aNet ) override { return nullptr; }
|
||||
virtual int DpNetPolarity( PNS::NET_HANDLE aNet ) override { return -1; }
|
||||
|
||||
virtual bool DpNetPair( const PNS::ITEM* aItem, int& aNetP, int& aNetN ) override
|
||||
virtual bool DpNetPair( const PNS::ITEM* aItem, PNS::NET_HANDLE& aNetP,
|
||||
PNS::NET_HANDLE& aNetN ) override
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual int NetCode( PNS::NET_HANDLE aNet ) override
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
virtual wxString NetName( PNS::NET_HANDLE aNet ) override
|
||||
{
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
virtual bool QueryConstraint( PNS::CONSTRAINT_TYPE aType, const PNS::ITEM* aItemA,
|
||||
const PNS::ITEM* aItemB, int aLayer,
|
||||
PNS::CONSTRAINT* aConstraint ) override
|
||||
|
@ -199,8 +210,6 @@ public:
|
|||
return true;
|
||||
}
|
||||
|
||||
virtual wxString NetName( int aNet ) override { return wxT( "noname" ); }
|
||||
|
||||
int ClearanceEpsilon() const override { return m_clearanceEpsilon; }
|
||||
|
||||
struct ITEM_KEY
|
||||
|
|
|
@ -115,7 +115,7 @@ void PNS_LOG_PLAYER::ReplayLog( PNS_LOG_FILE* aLog, int aStartEventIndex, int aF
|
|||
{
|
||||
PNS::SIZES_SETTINGS sizes( m_router->Sizes() );
|
||||
m_iface->SetStartLayer( routingLayer );
|
||||
m_iface->ImportSizes( sizes, ritem, -1 );
|
||||
m_iface->ImportSizes( sizes, ritem, nullptr );
|
||||
m_router->UpdateSizes( sizes );
|
||||
|
||||
m_debugDecorator->NewStage( "route-start", 0, PNSLOGINFO );
|
||||
|
@ -135,7 +135,7 @@ void PNS_LOG_PLAYER::ReplayLog( PNS_LOG_FILE* aLog, int aStartEventIndex, int aF
|
|||
{
|
||||
PNS::SIZES_SETTINGS sizes( m_router->Sizes() );
|
||||
m_iface->SetStartLayer( routingLayer );
|
||||
m_iface->ImportSizes( sizes, ritem, -1 );
|
||||
m_iface->ImportSizes( sizes, ritem, nullptr );
|
||||
m_router->UpdateSizes( sizes );
|
||||
|
||||
m_debugDecorator->NewStage( "drag-start", 0, PNSLOGINFO );
|
||||
|
|
Loading…
Reference in New Issue