From 036241c81924815e388614bf445b034d45953a0b Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 1 Jan 2024 10:45:18 +0000 Subject: [PATCH] More explicit pad-missing message when net involved. Fixes https://gitlab.com/kicad/code/kicad/-/issues/16489 (cherry picked from commit 15a2d65a0ccd49faf2a4e428b8699a396fc78ac3) --- .../drc_test_provider_schematic_parity.cpp | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/pcbnew/drc/drc_test_provider_schematic_parity.cpp b/pcbnew/drc/drc_test_provider_schematic_parity.cpp index 5c97717708..09529463cd 100644 --- a/pcbnew/drc/drc_test_provider_schematic_parity.cpp +++ b/pcbnew/drc/drc_test_provider_schematic_parity.cpp @@ -114,8 +114,8 @@ void DRC_TEST_PROVIDER_SCHEMATIC_PARITY::testNetlist( NETLIST& aNetlist ) wxString msg; msg.Printf( _( "Missing footprint %s (%s)" ), - component->GetReference(), - component->GetValue() ); + component->GetReference(), + component->GetValue() ); std::shared_ptr drcItem = DRC_ITEM::Create( DRCE_MISSING_FOOTPRINT ); @@ -149,7 +149,7 @@ void DRC_TEST_PROVIDER_SCHEMATIC_PARITY::testNetlist( NETLIST& aNetlist ) { wxString msg; msg.Printf( _( "Pad missing net given by schematic (%s)." ), - sch_net.GetNetName() ); + sch_net.GetNetName() ); std::shared_ptr drcItem = DRC_ITEM::Create( DRCE_NET_CONFLICT ); drcItem->SetErrorMessage( msg ); @@ -160,8 +160,8 @@ void DRC_TEST_PROVIDER_SCHEMATIC_PARITY::testNetlist( NETLIST& aNetlist ) { wxString msg; msg.Printf( _( "Pad net (%s) doesn't match net given by schematic (%s)." ), - pcb_netname, - sch_net.GetNetName() ); + pcb_netname, + sch_net.GetNetName() ); std::shared_ptr drcItem = DRC_ITEM::Create( DRCE_NET_CONFLICT ); drcItem->SetErrorMessage( msg ); @@ -180,8 +180,19 @@ void DRC_TEST_PROVIDER_SCHEMATIC_PARITY::testNetlist( NETLIST& aNetlist ) if( !footprint->FindPadByNumber( sch_net.GetPinName() ) ) { wxString msg; - msg.Printf( _( "No pad found for pin %s in schematic." ), - sch_net.GetPinName() ); + + if( sch_net.GetNetName().StartsWith( wxT( "unconnected-" ) ) ) + { + msg = sch_net.GetPinName(); + } + else + { + msg = wxString::Format( wxT( "%s (%s)" ), + sch_net.GetPinName(), + sch_net.GetNetName() ); + } + + msg.Printf( _( "No pad found for pin %s in schematic." ), msg ); std::shared_ptr drcItem = DRC_ITEM::Create( DRCE_NET_CONFLICT ); drcItem->SetErrorMessage( msg );