router: orphaned net is not the same as null net handle

This commit is contained in:
Tomasz Wlostowski 2023-09-12 15:59:20 +02:00
parent 403d7019d5
commit a7ae4d8e9a
4 changed files with 9 additions and 2 deletions

View File

@ -2043,6 +2043,12 @@ void PNS_KICAD_IFACE::UpdateNet( PNS::NET_HANDLE aNet )
} }
PNS::NET_HANDLE PNS_KICAD_IFACE_BASE::GetOrphanedNetHandle()
{
return NETINFO_LIST::OrphanedItem();
}
PNS::RULE_RESOLVER* PNS_KICAD_IFACE_BASE::GetRuleResolver() PNS::RULE_RESOLVER* PNS_KICAD_IFACE_BASE::GetRuleResolver()
{ {
return m_ruleResolver; return m_ruleResolver;

View File

@ -77,6 +77,7 @@ public:
int GetNetCode( PNS::NET_HANDLE aNet ) const override { return -1; } int GetNetCode( PNS::NET_HANDLE aNet ) const override { return -1; }
wxString GetNetName( PNS::NET_HANDLE aNet ) const override { return wxEmptyString; } wxString GetNetName( PNS::NET_HANDLE aNet ) const override { return wxEmptyString; }
void UpdateNet( PNS::NET_HANDLE aNet ) override {} void UpdateNet( PNS::NET_HANDLE aNet ) override {}
PNS::NET_HANDLE GetOrphanedNetHandle() override;
void SetDebugDecorator( PNS::DEBUG_DECORATOR* aDec ); void SetDebugDecorator( PNS::DEBUG_DECORATOR* aDec );

View File

@ -1325,7 +1325,7 @@ bool LINE_PLACER::Start( const VECTOR2I& aP, ITEM* aStartItem )
m_currentStart = VECTOR2I( aP ); m_currentStart = VECTOR2I( aP );
m_fixStart = VECTOR2I( aP ); m_fixStart = VECTOR2I( aP );
m_currentEnd = VECTOR2I( aP ); m_currentEnd = VECTOR2I( aP );
m_currentNet = aStartItem ? aStartItem->Net() : nullptr; m_currentNet = aStartItem ? aStartItem->Net() : Router()->GetInterface()->GetOrphanedNetHandle();
m_startItem = aStartItem; m_startItem = aStartItem;
m_placingVia = false; m_placingVia = false;
m_chainedPlacement = false; m_chainedPlacement = false;

View File

@ -108,7 +108,7 @@ enum DRAG_MODE
virtual int GetNetCode( NET_HANDLE aNet ) const = 0; virtual int GetNetCode( NET_HANDLE aNet ) const = 0;
virtual wxString GetNetName( PNS::NET_HANDLE aNet ) const = 0; virtual wxString GetNetName( PNS::NET_HANDLE aNet ) const = 0;
virtual void UpdateNet( NET_HANDLE aNet ) = 0; virtual void UpdateNet( NET_HANDLE aNet ) = 0;
virtual NET_HANDLE GetOrphanedNetHandle() = 0;
virtual PNS::NODE* GetWorld() const = 0; virtual PNS::NODE* GetWorld() const = 0;
virtual RULE_RESOLVER* GetRuleResolver() = 0; virtual RULE_RESOLVER* GetRuleResolver() = 0;