Eeschema: fix netlist creation crash when opening spice simulator.
This commit is contained in:
parent
590a101a88
commit
aa9e74493f
|
@ -352,6 +352,8 @@ public:
|
||||||
*/
|
*/
|
||||||
LIB_ITEM* GetNextDrawItem( LIB_ITEM* aItem = NULL, KICAD_T aType = TYPE_NOT_INIT );
|
LIB_ITEM* GetNextDrawItem( LIB_ITEM* aItem = NULL, KICAD_T aType = TYPE_NOT_INIT );
|
||||||
|
|
||||||
|
size_t GetPinCount() const { return m_drawings.size( LIB_PIN_T ); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the next pin object from the draw list.
|
* Return the next pin object from the draw list.
|
||||||
*
|
*
|
||||||
|
|
|
@ -281,8 +281,9 @@ void SCH_COMPONENT::UpdatePins()
|
||||||
m_pins.clear();
|
m_pins.clear();
|
||||||
m_pinMap.clear();
|
m_pinMap.clear();
|
||||||
|
|
||||||
if( m_part )
|
if( !m_part )
|
||||||
{
|
return;
|
||||||
|
|
||||||
unsigned i = 0;
|
unsigned i = 0;
|
||||||
|
|
||||||
for( LIB_PIN* libPin = m_part->GetNextPin(); libPin; libPin = m_part->GetNextPin( libPin ) )
|
for( LIB_PIN* libPin = m_part->GetNextPin(); libPin; libPin = m_part->GetNextPin( libPin ) )
|
||||||
|
@ -297,7 +298,6 @@ void SCH_COMPONENT::UpdatePins()
|
||||||
|
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1500,8 +1500,13 @@ SEARCH_RESULT SCH_COMPONENT::Visit( INSPECTOR aInspector, void* aTestData,
|
||||||
void SCH_COMPONENT::GetNetListItem( NETLIST_OBJECT_LIST& aNetListItems,
|
void SCH_COMPONENT::GetNetListItem( NETLIST_OBJECT_LIST& aNetListItems,
|
||||||
SCH_SHEET_PATH* aSheetPath )
|
SCH_SHEET_PATH* aSheetPath )
|
||||||
{
|
{
|
||||||
if( m_part )
|
if( !m_part )
|
||||||
{
|
return;
|
||||||
|
|
||||||
|
// This should not happen but just in case the pin map size doesn't match the number of
|
||||||
|
// pins in the symbol, update the pin map.
|
||||||
|
wxCHECK2( m_part->GetPinCount() == m_pins.size(), UpdatePins() );
|
||||||
|
|
||||||
for( LIB_PIN* pin = m_part->GetNextPin(); pin; pin = m_part->GetNextPin( pin ) )
|
for( LIB_PIN* pin = m_part->GetNextPin(); pin; pin = m_part->GetNextPin( pin ) )
|
||||||
{
|
{
|
||||||
wxASSERT( pin->Type() == LIB_PIN_T );
|
wxASSERT( pin->Type() == LIB_PIN_T );
|
||||||
|
@ -1542,7 +1547,6 @@ void SCH_COMPONENT::GetNetListItem( NETLIST_OBJECT_LIST& aNetListItems,
|
||||||
aNetListItems.push_back( item );
|
aNetListItems.push_back( item );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -617,8 +617,8 @@ void SCH_SCREEN::UpdateSymbolLinks( REPORTER* aReporter )
|
||||||
aReporter->ReportTail( msg, RPT_SEVERITY_INFO );
|
aReporter->ReportTail( msg, RPT_SEVERITY_INFO );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Internal library symbols are flattens so just make a copy.
|
// Internal library symbols are already flattened so just make a copy.
|
||||||
symbol->GetPartRef().reset( new LIB_PART( *it->second ) );
|
symbol->SetLibSymbol( new LIB_PART( *it->second ) );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue