Performance for large hierarchies: lookups
Don't bother to sort sheet lists when we're just looking
up a UUID, sheet count, other symbol units, etc.
(cherry picked from commit e543ff0578
)
This commit is contained in:
parent
76a68b1f8d
commit
5ca3414707
|
@ -907,7 +907,7 @@ void SCH_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail )
|
||||||
KIID uuid( payload );
|
KIID uuid( payload );
|
||||||
SCH_SHEET_PATH path;
|
SCH_SHEET_PATH path;
|
||||||
|
|
||||||
if( SCH_ITEM* item = m_schematic->GetSheets().GetItem( uuid, &path ) )
|
if( SCH_ITEM* item = m_schematic->GetItem( uuid, &path ) )
|
||||||
{
|
{
|
||||||
if( item->Type() == SCH_SHEET_T )
|
if( item->Type() == SCH_SHEET_T )
|
||||||
payload = static_cast<SCH_SHEET*>( item )->GetShownName( false );
|
payload = static_cast<SCH_SHEET*>( item )->GetShownName( false );
|
||||||
|
|
|
@ -513,7 +513,7 @@ void DIALOG_ERC::OnERCItemSelected( wxDataViewEvent& aEvent )
|
||||||
{
|
{
|
||||||
const KIID& itemID = RC_TREE_MODEL::ToUUID( aEvent.GetItem() );
|
const KIID& itemID = RC_TREE_MODEL::ToUUID( aEvent.GetItem() );
|
||||||
SCH_SHEET_PATH sheet;
|
SCH_SHEET_PATH sheet;
|
||||||
SCH_ITEM* item = m_parent->Schematic().GetSheets().GetItem( itemID, &sheet );
|
SCH_ITEM* item = m_parent->Schematic().GetItem( itemID, &sheet );
|
||||||
|
|
||||||
if( m_centerMarkerOnIdle )
|
if( m_centerMarkerOnIdle )
|
||||||
{
|
{
|
||||||
|
|
|
@ -677,7 +677,7 @@ void DIALOG_SCH_FIELD_PROPERTIES::UpdateField( SCH_COMMIT* aCommit, SCH_FIELD* a
|
||||||
int unit = symbol->GetUnit();
|
int unit = symbol->GetUnit();
|
||||||
LIB_ID libId = symbol->GetLibId();
|
LIB_ID libId = symbol->GetLibId();
|
||||||
|
|
||||||
for( SCH_SHEET_PATH& sheet : editFrame->Schematic().GetSheets() )
|
for( SCH_SHEET_PATH& sheet : editFrame->Schematic().GetUnorderedSheets() )
|
||||||
{
|
{
|
||||||
SCH_SCREEN* screen = sheet.LastScreen();
|
SCH_SCREEN* screen = sheet.LastScreen();
|
||||||
std::vector<SCH_SYMBOL*> otherUnits;
|
std::vector<SCH_SYMBOL*> otherUnits;
|
||||||
|
|
|
@ -792,7 +792,7 @@ bool DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow()
|
||||||
int unit = m_symbol->GetUnit();
|
int unit = m_symbol->GetUnit();
|
||||||
LIB_ID libId = m_symbol->GetLibId();
|
LIB_ID libId = m_symbol->GetLibId();
|
||||||
|
|
||||||
for( SCH_SHEET_PATH& sheet : GetParent()->Schematic().GetSheets() )
|
for( SCH_SHEET_PATH& sheet : GetParent()->Schematic().GetUnorderedSheets() )
|
||||||
{
|
{
|
||||||
SCH_SCREEN* screen = sheet.LastScreen();
|
SCH_SCREEN* screen = sheet.LastScreen();
|
||||||
std::vector<SCH_SYMBOL*> otherUnits;
|
std::vector<SCH_SYMBOL*> otherUnits;
|
||||||
|
|
|
@ -150,7 +150,7 @@ DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES( SCH_EDIT_FRAME* aParent, SCH_ITE
|
||||||
|
|
||||||
m_separator5->SetIsSeparator();
|
m_separator5->SetIsSeparator();
|
||||||
|
|
||||||
SCH_SHEET_LIST sheetList = m_frame->Schematic().GetSheets();
|
SCH_SHEET_LIST sheetList = m_frame->Schematic().GetUnorderedSheets();
|
||||||
sheetList.SortByPageNumbers( false );
|
sheetList.SortByPageNumbers( false );
|
||||||
|
|
||||||
for( const SCH_SHEET_PATH& sheet : sheetList )
|
for( const SCH_SHEET_PATH& sheet : sheetList )
|
||||||
|
|
|
@ -1075,7 +1075,7 @@ bool SCH_EDIT_FRAME::SaveProject( bool aSaveAs )
|
||||||
// File doesn't exist yet; true if we just imported something
|
// File doesn't exist yet; true if we just imported something
|
||||||
updateFileHistory = true;
|
updateFileHistory = true;
|
||||||
}
|
}
|
||||||
else if( !Schematic().GetSheets().IsModified() )
|
else if( !IsContentModified() )
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -171,7 +171,8 @@ static wxString GetNetNavigatorItemText( const SCH_ITEM* aItem,
|
||||||
|
|
||||||
|
|
||||||
void SCH_EDIT_FRAME::MakeNetNavigatorNode( const wxString& aNetName, wxTreeItemId aParentId,
|
void SCH_EDIT_FRAME::MakeNetNavigatorNode( const wxString& aNetName, wxTreeItemId aParentId,
|
||||||
const NET_NAVIGATOR_ITEM_DATA* aSelection )
|
const NET_NAVIGATOR_ITEM_DATA* aSelection,
|
||||||
|
bool aSingleSheetSchematic )
|
||||||
{
|
{
|
||||||
wxCHECK( !aNetName.IsEmpty(), /* void */ );
|
wxCHECK( !aNetName.IsEmpty(), /* void */ );
|
||||||
wxCHECK( m_schematic, /* void */ );
|
wxCHECK( m_schematic, /* void */ );
|
||||||
|
@ -206,7 +207,7 @@ void SCH_EDIT_FRAME::MakeNetNavigatorNode( const wxString& aNetName, wxTreeItemI
|
||||||
m_netNavigator->SelectItem( sheetId );
|
m_netNavigator->SelectItem( sheetId );
|
||||||
|
|
||||||
// If there is only one sheet in the schematic, always expand the sheet tree.
|
// If there is only one sheet in the schematic, always expand the sheet tree.
|
||||||
if( Schematic().GetSheets().size() == 1 )
|
if( aSingleSheetSchematic )
|
||||||
expandId = sheetId;
|
expandId = sheetId;
|
||||||
|
|
||||||
for( const SCH_ITEM* item : subGraph->GetItems() )
|
for( const SCH_ITEM* item : subGraph->GetItems() )
|
||||||
|
@ -243,6 +244,8 @@ void SCH_EDIT_FRAME::RefreshNetNavigator( const NET_NAVIGATOR_ITEM_DATA* aSelect
|
||||||
if( m_netNavigator->IsEmpty() && m_highlightedConn.IsEmpty() )
|
if( m_netNavigator->IsEmpty() && m_highlightedConn.IsEmpty() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
bool singleSheetSchematic = m_schematic->GetUnorderedSheets().size() == 1;
|
||||||
|
|
||||||
if( !m_netNavigator->IsEmpty() && m_highlightedConn.IsEmpty() )
|
if( !m_netNavigator->IsEmpty() && m_highlightedConn.IsEmpty() )
|
||||||
{
|
{
|
||||||
m_netNavigator->DeleteAllItems();
|
m_netNavigator->DeleteAllItems();
|
||||||
|
@ -259,7 +262,7 @@ void SCH_EDIT_FRAME::RefreshNetNavigator( const NET_NAVIGATOR_ITEM_DATA* aSelect
|
||||||
|
|
||||||
wxTreeItemId rootId = m_netNavigator->AddRoot( UnescapeString( m_highlightedConn ), 0 );
|
wxTreeItemId rootId = m_netNavigator->AddRoot( UnescapeString( m_highlightedConn ), 0 );
|
||||||
|
|
||||||
MakeNetNavigatorNode( m_highlightedConn, rootId, aSelection );
|
MakeNetNavigatorNode( m_highlightedConn, rootId, aSelection, singleSheetSchematic );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -273,14 +276,14 @@ void SCH_EDIT_FRAME::RefreshNetNavigator( const NET_NAVIGATOR_ITEM_DATA* aSelect
|
||||||
m_netNavigator->DeleteAllItems();
|
m_netNavigator->DeleteAllItems();
|
||||||
wxTreeItemId rootId = m_netNavigator->AddRoot( UnescapeString( m_highlightedConn ), 0 );
|
wxTreeItemId rootId = m_netNavigator->AddRoot( UnescapeString( m_highlightedConn ), 0 );
|
||||||
|
|
||||||
MakeNetNavigatorNode( m_highlightedConn, rootId, itemData );
|
MakeNetNavigatorNode( m_highlightedConn, rootId, itemData, singleSheetSchematic );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wxTreeItemId rootId = m_netNavigator->AddRoot( UnescapeString( m_highlightedConn ), 0 );
|
wxTreeItemId rootId = m_netNavigator->AddRoot( UnescapeString( m_highlightedConn ), 0 );
|
||||||
|
|
||||||
MakeNetNavigatorNode( m_highlightedConn, rootId, aSelection );
|
MakeNetNavigatorNode( m_highlightedConn, rootId, aSelection, singleSheetSchematic );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -774,7 +774,7 @@ void SCH_EDIT_FRAME::AddCopyForRepeatItem( const SCH_ITEM* aItem )
|
||||||
|
|
||||||
EDA_ITEM* SCH_EDIT_FRAME::GetItem( const KIID& aId ) const
|
EDA_ITEM* SCH_EDIT_FRAME::GetItem( const KIID& aId ) const
|
||||||
{
|
{
|
||||||
return Schematic().GetSheets().GetItem( aId );
|
return Schematic().GetItem( aId );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -894,7 +894,7 @@ bool SCH_EDIT_FRAME::canCloseWindow( wxCloseEvent& aEvent )
|
||||||
|
|
||||||
// Shutdown blocks must be determined and vetoed as early as possible
|
// Shutdown blocks must be determined and vetoed as early as possible
|
||||||
if( KIPLATFORM::APP::SupportsShutdownBlockReason() && aEvent.GetId() == wxEVT_QUERY_END_SESSION
|
if( KIPLATFORM::APP::SupportsShutdownBlockReason() && aEvent.GetId() == wxEVT_QUERY_END_SESSION
|
||||||
&& Schematic().GetSheets().IsModified() )
|
&& IsContentModified() )
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -942,9 +942,7 @@ bool SCH_EDIT_FRAME::canCloseWindow( wxCloseEvent& aEvent )
|
||||||
if( !Schematic().IsValid() )
|
if( !Schematic().IsValid() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
SCH_SHEET_LIST sheetlist = Schematic().GetSheets();
|
if( IsContentModified() )
|
||||||
|
|
||||||
if( sheetlist.IsModified() )
|
|
||||||
{
|
{
|
||||||
wxFileName fileName = Schematic().RootScreen()->GetFileName();
|
wxFileName fileName = Schematic().RootScreen()->GetFileName();
|
||||||
wxString msg = _( "Save changes to '%s' before closing?" );
|
wxString msg = _( "Save changes to '%s' before closing?" );
|
||||||
|
@ -965,7 +963,7 @@ bool SCH_EDIT_FRAME::canCloseWindow( wxCloseEvent& aEvent )
|
||||||
|
|
||||||
void SCH_EDIT_FRAME::doCloseWindow()
|
void SCH_EDIT_FRAME::doCloseWindow()
|
||||||
{
|
{
|
||||||
SCH_SHEET_LIST sheetlist = Schematic().GetSheets();
|
SCH_SHEET_LIST sheetlist = Schematic().GetUnorderedSheets();
|
||||||
|
|
||||||
// Shutdown all running tools
|
// Shutdown all running tools
|
||||||
if( m_toolManager )
|
if( m_toolManager )
|
||||||
|
@ -2037,7 +2035,7 @@ const BOX2I SCH_EDIT_FRAME::GetDocumentExtents( bool aIncludeAllVisible ) const
|
||||||
|
|
||||||
bool SCH_EDIT_FRAME::IsContentModified() const
|
bool SCH_EDIT_FRAME::IsContentModified() const
|
||||||
{
|
{
|
||||||
return Schematic().GetSheets().IsModified();
|
return Schematic().GetUnorderedSheets().IsModified();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2052,9 +2050,8 @@ void SCH_EDIT_FRAME::FocusOnItem( SCH_ITEM* aItem )
|
||||||
{
|
{
|
||||||
static KIID lastBrightenedItemID( niluuid );
|
static KIID lastBrightenedItemID( niluuid );
|
||||||
|
|
||||||
SCH_SHEET_LIST sheetList = Schematic().GetSheets();
|
|
||||||
SCH_SHEET_PATH dummy;
|
SCH_SHEET_PATH dummy;
|
||||||
SCH_ITEM* lastItem = sheetList.GetItem( lastBrightenedItemID, &dummy );
|
SCH_ITEM* lastItem = Schematic().GetItem( lastBrightenedItemID, &dummy );
|
||||||
|
|
||||||
if( lastItem && lastItem != aItem )
|
if( lastItem && lastItem != aItem )
|
||||||
{
|
{
|
||||||
|
|
|
@ -866,7 +866,8 @@ public:
|
||||||
void RefreshNetNavigator( const NET_NAVIGATOR_ITEM_DATA* aSelection = nullptr );
|
void RefreshNetNavigator( const NET_NAVIGATOR_ITEM_DATA* aSelection = nullptr );
|
||||||
|
|
||||||
void MakeNetNavigatorNode( const wxString& aNetName, wxTreeItemId aParentId,
|
void MakeNetNavigatorNode( const wxString& aNetName, wxTreeItemId aParentId,
|
||||||
const NET_NAVIGATOR_ITEM_DATA* aSelection = nullptr );
|
const NET_NAVIGATOR_ITEM_DATA* aSelection,
|
||||||
|
bool aSingleSheetSchematic );
|
||||||
|
|
||||||
void SelectNetNavigatorItem( const NET_NAVIGATOR_ITEM_DATA* aSelection = nullptr );
|
void SelectNetNavigatorItem( const NET_NAVIGATOR_ITEM_DATA* aSelection = nullptr );
|
||||||
|
|
||||||
|
|
|
@ -740,11 +740,10 @@ void SCH_FIELD::OnScintillaCharAdded( SCINTILLA_TRICKS* aScintillaTricks,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SCH_SHEET_LIST sheets = schematic->GetSheets();
|
|
||||||
SCH_REFERENCE_LIST refs;
|
SCH_REFERENCE_LIST refs;
|
||||||
SCH_SYMBOL* refSymbol = nullptr;
|
SCH_SYMBOL* refSymbol = nullptr;
|
||||||
|
|
||||||
sheets.GetSymbols( refs );
|
schematic->GetUnorderedSheets().GetSymbols( refs );
|
||||||
|
|
||||||
for( size_t jj = 0; jj < refs.GetCount(); jj++ )
|
for( size_t jj = 0; jj < refs.GetCount(); jj++ )
|
||||||
{
|
{
|
||||||
|
|
|
@ -108,7 +108,7 @@ wxString SCH_MARKER::Serialize() const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SCH_MARKER* SCH_MARKER::Deserialize( SCHEMATIC* schematic, const wxString& data )
|
SCH_MARKER* SCH_MARKER::Deserialize( const SCH_SHEET_LIST& aSheetList, const wxString& data )
|
||||||
{
|
{
|
||||||
wxArrayString props = wxSplit( data, '|' );
|
wxArrayString props = wxSplit( data, '|' );
|
||||||
VECTOR2I markerPos( (int) strtol( props[1].c_str(), nullptr, 10 ),
|
VECTOR2I markerPos( (int) strtol( props[1].c_str(), nullptr, 10 ),
|
||||||
|
@ -131,13 +131,11 @@ SCH_MARKER* SCH_MARKER::Deserialize( SCHEMATIC* schematic, const wxString& data
|
||||||
{
|
{
|
||||||
isLegacyMarker = false;
|
isLegacyMarker = false;
|
||||||
|
|
||||||
SCH_SHEET_LIST sheetPaths = schematic->GetSheets();
|
|
||||||
|
|
||||||
if( !props[5].IsEmpty() )
|
if( !props[5].IsEmpty() )
|
||||||
{
|
{
|
||||||
KIID_PATH sheetSpecificKiidPath( props[5] );
|
KIID_PATH sheetSpecificKiidPath( props[5] );
|
||||||
std::optional<SCH_SHEET_PATH> sheetSpecificPath =
|
std::optional<SCH_SHEET_PATH> sheetSpecificPath =
|
||||||
sheetPaths.GetSheetPathByKIIDPath( sheetSpecificKiidPath, true );
|
aSheetList.GetSheetPathByKIIDPath( sheetSpecificKiidPath, true );
|
||||||
if( sheetSpecificPath.has_value() )
|
if( sheetSpecificPath.has_value() )
|
||||||
ercItem->SetSheetSpecificPath( sheetSpecificPath.value() );
|
ercItem->SetSheetSpecificPath( sheetSpecificPath.value() );
|
||||||
}
|
}
|
||||||
|
@ -146,7 +144,7 @@ SCH_MARKER* SCH_MARKER::Deserialize( SCHEMATIC* schematic, const wxString& data
|
||||||
{
|
{
|
||||||
KIID_PATH mainItemKiidPath( props[6] );
|
KIID_PATH mainItemKiidPath( props[6] );
|
||||||
std::optional<SCH_SHEET_PATH> mainItemPath =
|
std::optional<SCH_SHEET_PATH> mainItemPath =
|
||||||
sheetPaths.GetSheetPathByKIIDPath( mainItemKiidPath, true );
|
aSheetList.GetSheetPathByKIIDPath( mainItemKiidPath, true );
|
||||||
if( mainItemPath.has_value() )
|
if( mainItemPath.has_value() )
|
||||||
{
|
{
|
||||||
if( props[7].IsEmpty() )
|
if( props[7].IsEmpty() )
|
||||||
|
@ -157,7 +155,7 @@ SCH_MARKER* SCH_MARKER::Deserialize( SCHEMATIC* schematic, const wxString& data
|
||||||
{
|
{
|
||||||
KIID_PATH auxItemKiidPath( props[7] );
|
KIID_PATH auxItemKiidPath( props[7] );
|
||||||
std::optional<SCH_SHEET_PATH> auxItemPath =
|
std::optional<SCH_SHEET_PATH> auxItemPath =
|
||||||
sheetPaths.GetSheetPathByKIIDPath( auxItemKiidPath, true );
|
aSheetList.GetSheetPathByKIIDPath( auxItemKiidPath, true );
|
||||||
|
|
||||||
if( auxItemPath.has_value() )
|
if( auxItemPath.has_value() )
|
||||||
ercItem->SetItemsSheetPaths( mainItemPath.value(), auxItemPath.value() );
|
ercItem->SetItemsSheetPaths( mainItemPath.value(), auxItemPath.value() );
|
||||||
|
|
|
@ -54,7 +54,7 @@ public:
|
||||||
void SwapData( SCH_ITEM* aItem ) override;
|
void SwapData( SCH_ITEM* aItem ) override;
|
||||||
|
|
||||||
wxString Serialize() const;
|
wxString Serialize() const;
|
||||||
static SCH_MARKER* Deserialize( SCHEMATIC* schematic, const wxString& data );
|
static SCH_MARKER* Deserialize( const SCH_SHEET_LIST& aSheetList, const wxString& data );
|
||||||
|
|
||||||
void ViewGetLayers( int aLayers[], int& aCount ) const override;
|
void ViewGetLayers( int aLayers[], int& aCount ) const override;
|
||||||
|
|
||||||
|
|
|
@ -283,8 +283,7 @@ bool SCH_SHEET::ResolveTextVar( const SCH_SHEET_PATH* aPath, wxString* token, in
|
||||||
}
|
}
|
||||||
else if( token->IsSameAs( wxT( "##" ) ) )
|
else if( token->IsSameAs( wxT( "##" ) ) )
|
||||||
{
|
{
|
||||||
SCH_SHEET_LIST sheetList = schematic->GetSheets();
|
*token = wxString::Format( wxT( "%d" ), (int) schematic->GetUnorderedSheets().size() );
|
||||||
*token = wxString::Format( wxT( "%d" ), (int) sheetList.size() );
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if( token->IsSameAs( wxT( "SHEETPATH" ) ) )
|
else if( token->IsSameAs( wxT( "SHEETPATH" ) ) )
|
||||||
|
|
|
@ -72,7 +72,7 @@ SCHEMATIC::SCHEMATIC( PROJECT* aPrj ) :
|
||||||
int unit = symbol->GetUnit();
|
int unit = symbol->GetUnit();
|
||||||
LIB_ID libId = symbol->GetLibId();
|
LIB_ID libId = symbol->GetLibId();
|
||||||
|
|
||||||
for( SCH_SHEET_PATH& sheet : GetSheets() )
|
for( SCH_SHEET_PATH& sheet : GetUnorderedSheets() )
|
||||||
{
|
{
|
||||||
std::vector<SCH_SYMBOL*> otherUnits;
|
std::vector<SCH_SYMBOL*> otherUnits;
|
||||||
|
|
||||||
|
@ -314,7 +314,7 @@ std::vector<SCH_MARKER*> SCHEMATIC::ResolveERCExclusions()
|
||||||
|
|
||||||
for( auto it = settings.m_ErcExclusions.begin(); it != settings.m_ErcExclusions.end(); )
|
for( auto it = settings.m_ErcExclusions.begin(); it != settings.m_ErcExclusions.end(); )
|
||||||
{
|
{
|
||||||
SCH_MARKER* testMarker = SCH_MARKER::Deserialize( this, *it );
|
SCH_MARKER* testMarker = SCH_MARKER::Deserialize( sheetList, *it );
|
||||||
|
|
||||||
if( testMarker->IsLegacyMarker() )
|
if( testMarker->IsLegacyMarker() )
|
||||||
{
|
{
|
||||||
|
@ -361,7 +361,7 @@ std::vector<SCH_MARKER*> SCHEMATIC::ResolveERCExclusions()
|
||||||
|
|
||||||
for( const wxString& serialized : settings.m_ErcExclusions )
|
for( const wxString& serialized : settings.m_ErcExclusions )
|
||||||
{
|
{
|
||||||
SCH_MARKER* marker = SCH_MARKER::Deserialize( this, serialized );
|
SCH_MARKER* marker = SCH_MARKER::Deserialize( sheetList, serialized );
|
||||||
|
|
||||||
if( marker )
|
if( marker )
|
||||||
{
|
{
|
||||||
|
@ -378,7 +378,7 @@ std::vector<SCH_MARKER*> SCHEMATIC::ResolveERCExclusions()
|
||||||
|
|
||||||
std::shared_ptr<BUS_ALIAS> SCHEMATIC::GetBusAlias( const wxString& aLabel ) const
|
std::shared_ptr<BUS_ALIAS> SCHEMATIC::GetBusAlias( const wxString& aLabel ) const
|
||||||
{
|
{
|
||||||
for( const SCH_SHEET_PATH& sheet : GetSheets() )
|
for( const SCH_SHEET_PATH& sheet : GetUnorderedSheets() )
|
||||||
{
|
{
|
||||||
for( const std::shared_ptr<BUS_ALIAS>& alias : sheet.LastScreen()->GetBusAliases() )
|
for( const std::shared_ptr<BUS_ALIAS>& alias : sheet.LastScreen()->GetBusAliases() )
|
||||||
{
|
{
|
||||||
|
@ -412,11 +412,10 @@ std::set<wxString> SCHEMATIC::GetNetClassAssignmentCandidates()
|
||||||
|
|
||||||
bool SCHEMATIC::ResolveCrossReference( wxString* token, int aDepth ) const
|
bool SCHEMATIC::ResolveCrossReference( wxString* token, int aDepth ) const
|
||||||
{
|
{
|
||||||
SCH_SHEET_LIST sheetList = GetSheets();
|
|
||||||
wxString remainder;
|
wxString remainder;
|
||||||
wxString ref = token->BeforeFirst( ':', &remainder );
|
wxString ref = token->BeforeFirst( ':', &remainder );
|
||||||
SCH_SHEET_PATH sheetPath;
|
SCH_SHEET_PATH sheetPath;
|
||||||
SCH_ITEM* refItem = sheetList.GetItem( KIID( ref ), &sheetPath );
|
SCH_ITEM* refItem = GetItem( KIID( ref ), &sheetPath );
|
||||||
|
|
||||||
if( refItem && refItem->Type() == SCH_SYMBOL_T )
|
if( refItem && refItem->Type() == SCH_SYMBOL_T )
|
||||||
{
|
{
|
||||||
|
@ -449,7 +448,7 @@ std::map<int, wxString> SCHEMATIC::GetVirtualPageToSheetNamesMap() const
|
||||||
{
|
{
|
||||||
std::map<int, wxString> namesMap;
|
std::map<int, wxString> namesMap;
|
||||||
|
|
||||||
for( const SCH_SHEET_PATH& sheet : GetSheets() )
|
for( const SCH_SHEET_PATH& sheet : GetUnorderedSheets() )
|
||||||
{
|
{
|
||||||
if( sheet.size() == 1 )
|
if( sheet.size() == 1 )
|
||||||
namesMap[sheet.GetVirtualPageNumber()] = _( "<root sheet>" );
|
namesMap[sheet.GetVirtualPageNumber()] = _( "<root sheet>" );
|
||||||
|
@ -465,7 +464,7 @@ std::map<int, wxString> SCHEMATIC::GetVirtualPageToSheetPagesMap() const
|
||||||
{
|
{
|
||||||
std::map<int, wxString> pagesMap;
|
std::map<int, wxString> pagesMap;
|
||||||
|
|
||||||
for( const SCH_SHEET_PATH& sheet : GetSheets() )
|
for( const SCH_SHEET_PATH& sheet : GetUnorderedSheets() )
|
||||||
pagesMap[sheet.GetVirtualPageNumber()] = sheet.GetPageNumber();
|
pagesMap[sheet.GetVirtualPageNumber()] = sheet.GetPageNumber();
|
||||||
|
|
||||||
return pagesMap;
|
return pagesMap;
|
||||||
|
@ -509,12 +508,11 @@ wxString SCHEMATIC::ConvertRefsToKIIDs( const wxString& aSource ) const
|
||||||
|
|
||||||
if( isCrossRef )
|
if( isCrossRef )
|
||||||
{
|
{
|
||||||
SCH_SHEET_LIST sheetList = GetSheets();
|
|
||||||
wxString remainder;
|
wxString remainder;
|
||||||
wxString ref = token.BeforeFirst( ':', &remainder );
|
wxString ref = token.BeforeFirst( ':', &remainder );
|
||||||
SCH_REFERENCE_LIST references;
|
SCH_REFERENCE_LIST references;
|
||||||
|
|
||||||
sheetList.GetSymbols( references );
|
GetUnorderedSheets().GetSymbols( references );
|
||||||
|
|
||||||
for( size_t jj = 0; jj < references.GetCount(); jj++ )
|
for( size_t jj = 0; jj < references.GetCount(); jj++ )
|
||||||
{
|
{
|
||||||
|
@ -565,12 +563,11 @@ wxString SCHEMATIC::ConvertKIIDsToRefs( const wxString& aSource ) const
|
||||||
|
|
||||||
if( isCrossRef )
|
if( isCrossRef )
|
||||||
{
|
{
|
||||||
SCH_SHEET_LIST sheetList = GetSheets();
|
wxString remainder;
|
||||||
wxString remainder;
|
wxString ref = token.BeforeFirst( ':', &remainder );
|
||||||
wxString ref = token.BeforeFirst( ':', &remainder );
|
|
||||||
|
|
||||||
SCH_SHEET_PATH refSheetPath;
|
SCH_SHEET_PATH refSheetPath;
|
||||||
SCH_ITEM* refItem = sheetList.GetItem( KIID( ref ), &refSheetPath );
|
SCH_ITEM* refItem = GetItem( KIID( ref ), &refSheetPath );
|
||||||
|
|
||||||
if( refItem && refItem->Type() == SCH_SYMBOL_T )
|
if( refItem && refItem->Type() == SCH_SYMBOL_T )
|
||||||
{
|
{
|
||||||
|
@ -739,10 +736,10 @@ wxString SCHEMATIC::GetOperatingPoint( const wxString& aNetName, int aPrecision,
|
||||||
|
|
||||||
void SCHEMATIC::FixupJunctions()
|
void SCHEMATIC::FixupJunctions()
|
||||||
{
|
{
|
||||||
for( const SCH_SHEET_PATH& sheet : GetSheets() )
|
SCH_SCREENS screens( Root() );
|
||||||
{
|
|
||||||
SCH_SCREEN* screen = sheet.LastScreen();
|
|
||||||
|
|
||||||
|
for( SCH_SCREEN* screen = screens.GetFirst(); screen; screen = screens.GetNext() )
|
||||||
|
{
|
||||||
std::deque<EDA_ITEM*> allItems;
|
std::deque<EDA_ITEM*> allItems;
|
||||||
|
|
||||||
for( auto item : screen->Items() )
|
for( auto item : screen->Items() )
|
||||||
|
@ -836,7 +833,7 @@ void SCHEMATIC::RecordERCExclusions()
|
||||||
|
|
||||||
void SCHEMATIC::ResolveERCExclusionsPostUpdate()
|
void SCHEMATIC::ResolveERCExclusionsPostUpdate()
|
||||||
{
|
{
|
||||||
SCH_SHEET_LIST sheetList = GetSheets();
|
SCH_SHEET_LIST sheetList = GetUnorderedSheets();
|
||||||
|
|
||||||
for( SCH_MARKER* marker : ResolveERCExclusions() )
|
for( SCH_MARKER* marker : ResolveERCExclusions() )
|
||||||
{
|
{
|
||||||
|
|
|
@ -102,6 +102,18 @@ public:
|
||||||
return SCH_SHEET_LIST( m_rootSheet );
|
return SCH_SHEET_LIST( m_rootSheet );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SCH_SHEET_LIST GetUnorderedSheets() const
|
||||||
|
{
|
||||||
|
SCH_SHEET_LIST sheets;
|
||||||
|
sheets.BuildSheetList( m_rootSheet, false );
|
||||||
|
return sheets;
|
||||||
|
}
|
||||||
|
|
||||||
|
SCH_ITEM* GetItem( const KIID& aID, SCH_SHEET_PATH* aPathOut = nullptr ) const
|
||||||
|
{
|
||||||
|
return GetUnorderedSheets().GetItem( aID, aPathOut );
|
||||||
|
}
|
||||||
|
|
||||||
SCH_SHEET& Root() const
|
SCH_SHEET& Root() const
|
||||||
{
|
{
|
||||||
return *m_rootSheet;
|
return *m_rootSheet;
|
||||||
|
|
|
@ -201,7 +201,7 @@ bool SCH_NAVIGATE_TOOL::CanGoPrevious()
|
||||||
bool SCH_NAVIGATE_TOOL::CanGoNext()
|
bool SCH_NAVIGATE_TOOL::CanGoNext()
|
||||||
{
|
{
|
||||||
return m_frame->GetCurrentSheet().GetVirtualPageNumber()
|
return m_frame->GetCurrentSheet().GetVirtualPageNumber()
|
||||||
< (int) m_frame->Schematic().GetSheets().size();
|
< (int) m_frame->Schematic().GetUnorderedSheets().size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue