diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index cd96d96543..c6527bd15d 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -49,6 +49,7 @@ using namespace std::placeholders; #include #include #include +#include #include "router_tool.h" #include "pns_segment.h" @@ -2085,22 +2086,53 @@ void ROUTER_TOOL::UpdateMessagePanel() PNS::SIZES_SETTINGS sizes( m_router->Sizes() ); PNS::RULE_RESOLVER* resolver = m_iface->GetRuleResolver(); bool isDiffPair = m_router->Mode() == PNS::ROUTER_MODE::PNS_MODE_ROUTE_DIFF_PAIR; + std::vector nets = m_router->GetCurrentNets(); + wxString description; + wxString secondary; - if( m_startItem && m_startItem->Net() > 0 ) + if( isDiffPair ) { - wxString description = isDiffPair ? _( "Routing Diff Pair: %s" ) : _( "Routing Track: %s" ); + wxASSERT( nets.size() >= 2 ); - NETINFO_ITEM* netInfo = board()->FindNet( m_startItem->Net() ); - wxASSERT( netInfo ); + NETINFO_ITEM* netA = board()->FindNet( nets[0] ); + NETINFO_ITEM* netB = board()->FindNet( nets[1] ); + wxASSERT( netA ); + wxASSERT( netB ); - items.emplace_back( wxString::Format( description, netInfo->GetNetname() ), - wxString::Format( _( "Net Class: %s" ), netInfo->GetNetClassName() ) ); + description = wxString::Format( _( "Routing Diff Pair: %s" ), + netA->GetNetname() + wxT( "/" ) + netB->GetNetname() ); + + wxString netclass; + NETCLASS* netclassA = netA->GetNetClass(); + NETCLASS* netclassB = netB->GetNetClass(); + + if( netclassA == netclassB ) + netclass = netclassA->GetName(); + else + netclass = netclassA->GetName() + wxT( "/" ) + netclassB->GetName(); + + secondary = wxString::Format( _( "Net Class: %s" ), + UnescapeString( netclass ) ); + } + else if( !nets.empty() ) + { + NETINFO_ITEM* net = board()->FindNet( nets[0] ); + wxASSERT( net ); + + description = wxString::Format( _( "Routing Track: %s" ), + net->GetNetname() ); + + secondary = wxString::Format( _( "Net Class: %s" ), + UnescapeString( net->GetNetClass()->GetName() ) ); } else { - items.emplace_back( _( "Routing Track" ), _( "(no net)" ) ); + description = _( "Routing Track" ); + secondary = _( "(no net)" ); } + items.emplace_back( description, secondary ); + wxString cornerMode; if( m_router->Settings().GetFreeAngleMode() )