Eeschema: Display the root sheet name to the user

Instead of just `/` denoting the root sheet, use the filename
in preparation for non-hierarchical multi-sheet schematics
This commit is contained in:
Michael Kavanagh 2020-10-27 19:57:56 +00:00 committed by Jeff Young
parent 644546cd83
commit 20bb3b194f
5 changed files with 12 additions and 6 deletions

View File

@ -768,7 +768,7 @@ void DIALOG_SHEET_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& event )
// Propagate changes in sheetname to displayed hierarchical path
wxString hierarchicalPath = _( "Hierarchical path: " );
hierarchicalPath += m_frame->GetCurrentSheet().PathHumanReadable();
hierarchicalPath += m_frame->GetCurrentSheet().PathHumanReadable( false );
if( hierarchicalPath.Last() != '/' )
hierarchicalPath.Append( '/' );

View File

@ -1206,7 +1206,7 @@ void SCH_EDIT_FRAME::UpdateTitle()
title.Printf( wxT( "%s [%s] %s\u2014 " ) + app,
fn.GetName(),
GetCurrentSheet().PathHumanReadable(),
GetCurrentSheet().PathHumanReadable( false ),
append );
}

View File

@ -712,7 +712,7 @@ void SCH_SHEET::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList
SCH_SHEET_PATH path = schframe->GetCurrentSheet();
path.push_back( this );
aList.emplace_back( _( "Hierarchical Path" ), path.PathHumanReadable(), BLUE );
aList.emplace_back( _( "Hierarchical Path" ), path.PathHumanReadable( false ), BLUE );
}
aList.emplace_back( _( "File Name" ), m_fields[ SHEETFILENAME ].GetText(), BROWN );

View File

@ -224,11 +224,17 @@ KIID_PATH SCH_SHEET_PATH::PathWithoutRootUuid() const
}
wxString SCH_SHEET_PATH::PathHumanReadable() const
wxString SCH_SHEET_PATH::PathHumanReadable( bool aUseShortRootName ) const
{
wxString s;
s = wxT( "/" );
wxString fileName = at( 0 )->GetScreen()->GetFileName();
wxFileName fn = fileName;
if( aUseShortRootName )
s = wxT( "/" ); // Use only the short name in netlists
else
s = fn.GetName() + wxT( "/" );
// Start at 1 since we've already processed the root sheet.
for( unsigned i = 1; i < size(); i++ )

View File

@ -273,7 +273,7 @@ public:
* The the "normal" path instead uses the #KIID objects in the path that do not change
* even when editing sheet parameters.
*/
wxString PathHumanReadable() const;
wxString PathHumanReadable( bool aUseShortRootName = true ) const;
/**
* Update all the symbol references for this sheet path.