Insert the same unit on all sheet instances when adding a symbol
Fixes https://gitlab.com/kicad/code/kicad/issues/5898 (C)
This commit is contained in:
parent
2e21489acf
commit
1598e870b6
|
@ -576,6 +576,13 @@ void SCH_COMPONENT::SetUnitSelection( const SCH_SHEET_PATH* aSheet, int aUnitSel
|
|||
}
|
||||
|
||||
|
||||
void SCH_COMPONENT::SetUnitSelection( int aUnitSelection )
|
||||
{
|
||||
for( SYMBOL_INSTANCE_REFERENCE& instance : m_instanceReferences )
|
||||
instance.m_Unit = aUnitSelection;
|
||||
}
|
||||
|
||||
|
||||
const wxString SCH_COMPONENT::GetValue( const SCH_SHEET_PATH* sheet, bool aResolve ) const
|
||||
{
|
||||
KIID_PATH path = sheet->Path();
|
||||
|
|
|
@ -553,8 +553,13 @@ public:
|
|||
|
||||
// Returns the instance-specific unit selection for the given sheet path.
|
||||
int GetUnitSelection( const SCH_SHEET_PATH* aSheet ) const;
|
||||
|
||||
// Set the selected unit of this symbol on one sheet
|
||||
void SetUnitSelection( const SCH_SHEET_PATH* aSheet, int aUnitSelection );
|
||||
|
||||
// Set the selected unit of this symbol for all sheets
|
||||
void SetUnitSelection( int aUnitSelection );
|
||||
|
||||
// Returns the instance-specific value for the given sheet path.
|
||||
const wxString GetValue( const SCH_SHEET_PATH* sheet, bool aResolve ) const;
|
||||
void SetValue( const SCH_SHEET_PATH* sheet, const wxString& aValue );
|
||||
|
|
|
@ -252,7 +252,7 @@ int SCH_DRAWING_TOOLS::PlaceComponent( const TOOL_EVENT& aEvent )
|
|||
next_comp = static_cast<SCH_COMPONENT*>( component->Duplicate() );
|
||||
next_comp->SetFlags( IS_NEW | IS_MOVED );
|
||||
next_comp->SetUnit( new_unit );
|
||||
next_comp->SetUnitSelection( &m_frame->GetCurrentSheet(), new_unit );
|
||||
next_comp->SetUnitSelection( new_unit );
|
||||
|
||||
if( m_frame->eeconfig()->m_AutoplaceFields.enable )
|
||||
component->AutoplaceFields( /* aScreen */ NULL, /* aManual */ false );
|
||||
|
|
Loading…
Reference in New Issue