Browse Source

Enhance compatibility with V6.0 for Intersheetrefs fields associated to GLOBAL labels.

In V6.0, the identifier is "Intersheet References" and was not immediately
seen as Intersheetrefs field.
7.0
jean-pierre charras 3 years ago
parent
commit
96a9ec4a0c
  1. 4
      eeschema/sch_field.cpp
  2. 12
      eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp
  3. 2
      pcbnew/tools/edit_tool_move_fct.cpp

4
eeschema/sch_field.cpp

@ -889,7 +889,9 @@ wxString SCH_FIELD::GetCanonicalName() const
// These should be stored in canonical format, but just in case:
if( m_name == _( "Net Class" ) || m_name == wxT( "Net Class" ) )
return wxT( "Netclass" );
else if( m_name == _( "Sheet References" ) || m_name == wxT( "Sheet References" ) )
else if( m_name == _( "Sheet References" )
|| m_name == wxT( "Sheet References" )
|| m_name == wxT( "Intersheet References" ) )
return wxT( "Intersheetrefs" );
else
return m_name;

12
eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp

@ -3839,10 +3839,16 @@ SCH_TEXT* SCH_SEXPR_PARSER::parseSchText()
SCH_FIELD* field = parseSchField( text.get() );
if( text->Type() == SCH_GLOBAL_LABEL_T && field->GetInternalName() == wxT( "Intersheetrefs") )
if( text->Type() == SCH_GLOBAL_LABEL_T )
{
SCH_GLOBALLABEL* label = static_cast<SCH_GLOBALLABEL*>( text.get() );
label->GetFields()[0] = *field;
// If the field is a Intersheetrefs it is not handled like other fields:
// It always exists and is the first in list
if( field->GetInternalName() == wxT( "Intersheetrefs") || // Current name
field->GetInternalName() == wxT( "Intersheet References") ) // old name in V6.0
{
SCH_GLOBALLABEL* label = static_cast<SCH_GLOBALLABEL*>( text.get() );
label->GetFields()[0] = *field;
}
}
else
static_cast<SCH_LABEL_BASE*>( text.get() )->GetFields().emplace_back( *field );

2
pcbnew/tools/edit_tool_move_fct.cpp

@ -190,8 +190,6 @@ int EDIT_TOOL::Swap( const TOOL_EVENT& aEvent )
int EDIT_TOOL::PackAndMoveFootprints( const TOOL_EVENT& aEvent )
{
PCB_BASE_EDIT_FRAME* editFrame = getEditFrame<PCB_BASE_EDIT_FRAME>();
PCB_SELECTION& selection = m_selectionTool->RequestSelection(
[]( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool )
{

Loading…
Cancel
Save