Don't allow both DeMorgan alternates and general pin alternates.
Fixes https://gitlab.com/kicad/code/kicad/issues/6087
This commit is contained in:
parent
bfd04926b5
commit
e497639320
|
@ -271,7 +271,11 @@ public:
|
||||||
|
|
||||||
DIALOG_SYMBOL_PROPERTIES::DIALOG_SYMBOL_PROPERTIES( SCH_EDIT_FRAME* aParent,
|
DIALOG_SYMBOL_PROPERTIES::DIALOG_SYMBOL_PROPERTIES( SCH_EDIT_FRAME* aParent,
|
||||||
SCH_COMPONENT* aComponent ) :
|
SCH_COMPONENT* aComponent ) :
|
||||||
DIALOG_SYMBOL_PROPERTIES_BASE( aParent )
|
DIALOG_SYMBOL_PROPERTIES_BASE( aParent ),
|
||||||
|
m_comp( nullptr ),
|
||||||
|
m_part( nullptr ),
|
||||||
|
m_fields( nullptr ),
|
||||||
|
m_dataModel( nullptr )
|
||||||
{
|
{
|
||||||
m_comp = aComponent;
|
m_comp = aComponent;
|
||||||
m_part = m_comp->GetPartRef().get();
|
m_part = m_comp->GetPartRef().get();
|
||||||
|
@ -316,6 +320,15 @@ DIALOG_SYMBOL_PROPERTIES::DIALOG_SYMBOL_PROPERTIES( SCH_EDIT_FRAME* aParent,
|
||||||
m_fieldsGrid->ShowHideColumns( m_shownColumns );
|
m_fieldsGrid->ShowHideColumns( m_shownColumns );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( m_part->HasConversion() )
|
||||||
|
{
|
||||||
|
// DeMorgan conversions are a subclass of alternate pin assignments, so don't allow
|
||||||
|
// free-form alternate assignments as well. (We won't know how to map the alternates
|
||||||
|
// back and forth when the conversion is changed.)
|
||||||
|
m_notebook1->RemovePage( 1 );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
m_dataModel = new SCH_PIN_TABLE_DATA_MODEL();
|
m_dataModel = new SCH_PIN_TABLE_DATA_MODEL();
|
||||||
|
|
||||||
// Make a copy of the pins for editing
|
// Make a copy of the pins for editing
|
||||||
|
@ -326,6 +339,8 @@ DIALOG_SYMBOL_PROPERTIES::DIALOG_SYMBOL_PROPERTIES( SCH_EDIT_FRAME* aParent,
|
||||||
m_dataModel->BuildAttrs();
|
m_dataModel->BuildAttrs();
|
||||||
|
|
||||||
m_pinGrid->SetTable( m_dataModel );
|
m_pinGrid->SetTable( m_dataModel );
|
||||||
|
}
|
||||||
|
|
||||||
m_pinGrid->PushEventHandler( new GRID_TRICKS( m_pinGrid ) );
|
m_pinGrid->PushEventHandler( new GRID_TRICKS( m_pinGrid ) );
|
||||||
|
|
||||||
// Set font size for items showing long strings:
|
// Set font size for items showing long strings:
|
||||||
|
@ -366,11 +381,14 @@ DIALOG_SYMBOL_PROPERTIES::~DIALOG_SYMBOL_PROPERTIES()
|
||||||
|
|
||||||
// Prevents crash bug in wxGrid's d'tor
|
// Prevents crash bug in wxGrid's d'tor
|
||||||
m_fieldsGrid->DestroyTable( m_fields );
|
m_fieldsGrid->DestroyTable( m_fields );
|
||||||
|
|
||||||
|
if( m_dataModel )
|
||||||
m_pinGrid->DestroyTable( m_dataModel );
|
m_pinGrid->DestroyTable( m_dataModel );
|
||||||
|
|
||||||
m_fieldsGrid->Disconnect( wxEVT_GRID_CELL_CHANGING,
|
m_fieldsGrid->Disconnect( wxEVT_GRID_CELL_CHANGING,
|
||||||
wxGridEventHandler( DIALOG_SYMBOL_PROPERTIES::OnGridCellChanging ),
|
wxGridEventHandler( DIALOG_SYMBOL_PROPERTIES::OnGridCellChanging ),
|
||||||
nullptr, this );
|
nullptr, this );
|
||||||
|
|
||||||
m_pinGrid->Disconnect( wxEVT_GRID_COL_SORT,
|
m_pinGrid->Disconnect( wxEVT_GRID_COL_SORT,
|
||||||
wxGridEventHandler( DIALOG_SYMBOL_PROPERTIES::OnPinTableColSort ),
|
wxGridEventHandler( DIALOG_SYMBOL_PROPERTIES::OnPinTableColSort ),
|
||||||
nullptr, this );
|
nullptr, this );
|
||||||
|
@ -698,12 +716,15 @@ bool DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update any assignments
|
// Update any assignments
|
||||||
|
if( m_dataModel )
|
||||||
|
{
|
||||||
for( const SCH_PIN& model_pin : *m_dataModel )
|
for( const SCH_PIN& model_pin : *m_dataModel )
|
||||||
{
|
{
|
||||||
// map from the edited copy back to the "real" pin in the component
|
// map from the edited copy back to the "real" pin in the component
|
||||||
SCH_PIN* src_pin = m_comp->GetPin( model_pin.GetLibPin() );
|
SCH_PIN* src_pin = m_comp->GetPin( model_pin.GetLibPin() );
|
||||||
src_pin->SetAlt( model_pin.GetAlt() );
|
src_pin->SetAlt( model_pin.GetAlt() );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
currentScreen->Append( m_comp );
|
currentScreen->Append( m_comp );
|
||||||
GetParent()->TestDanglingEnds();
|
GetParent()->TestDanglingEnds();
|
||||||
|
|
Loading…
Reference in New Issue