Fix cross-probing from Cvpcb to Eeschema, broken by commit 3a76d426

Fixes #12293
https://gitlab.com/kicad/code/kicad/issues/12293
This commit is contained in:
jean-pierre charras 2022-08-26 17:20:48 +02:00
parent a90f223644
commit 66febafb9c
2 changed files with 7 additions and 1 deletions

View File

@ -911,7 +911,9 @@ void CVPCB_MAINFRAME::SendComponentSelectionToSch( bool aClearSelectionOnly )
// Now select the corresponding symbol on the schematic: // Now select the corresponding symbol on the schematic:
wxString ref = m_netlist.GetComponent( selection )->GetReference(); wxString ref = m_netlist.GetComponent( selection )->GetReference();
command += wxT( "F" ) + EscapeString( ref, CTX_IPC ); // The prefix 0,F before the reference is for selecting the symbol
// (one can select a pin with a different prefix)
command += wxT( "0,F" ) + EscapeString( ref, CTX_IPC );
if( Kiface().IsSingle() ) if( Kiface().IsSingle() )
SendCommand( MSG_TO_SCH, command ); SendCommand( MSG_TO_SCH, command );

View File

@ -840,6 +840,10 @@ void SCH_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail )
std::string prefix = "$SELECT: "; std::string prefix = "$SELECT: ";
std::string paramStr = payload.substr( prefix.size() ); std::string paramStr = payload.substr( prefix.size() );
if( paramStr.size() < 2 ) // Empty/broken command: we need at least 2 chars for sync string.
break;
std::string syncStr = paramStr.substr( 2 ); std::string syncStr = paramStr.substr( 2 );
bool focusOnFirst = ( paramStr[0] == '1' ); bool focusOnFirst = ( paramStr[0] == '1' );