Use explicit message for multiple drivers ERC

Fixes https://gitlab.com/kicad/code/kicad/-/issues/3980
This commit is contained in:
Jon Evans 2020-10-25 18:30:22 -04:00
parent ee08a3488f
commit 2edd246f36
1 changed files with 7 additions and 0 deletions

View File

@ -203,8 +203,15 @@ bool CONNECTION_SUBGRAPH::ResolveDrivers( bool aCreateMarkers )
static_cast<SCH_PIN*>( candidates[0] )->GetTransformedPosition() : static_cast<SCH_PIN*>( candidates[0] )->GetTransformedPosition() :
candidates[0]->GetPosition(); candidates[0]->GetPosition();
wxString msg = wxString::Format( _( "Both %s and %s are attached to the same "
"items; %s will be used in the netlist" ),
first,
GetNameForDriver( second_item ),
first );
std::shared_ptr<ERC_ITEM> ercItem = ERC_ITEM::Create( ERCE_DRIVER_CONFLICT ); std::shared_ptr<ERC_ITEM> ercItem = ERC_ITEM::Create( ERCE_DRIVER_CONFLICT );
ercItem->SetItems( candidates[0], second_item ); ercItem->SetItems( candidates[0], second_item );
ercItem->SetErrorMessage( msg );
SCH_MARKER* marker = new SCH_MARKER( ercItem, pos ); SCH_MARKER* marker = new SCH_MARKER( ercItem, pos );
m_sheet.LastScreen()->Append( marker ); m_sheet.LastScreen()->Append( marker );