From 3e784035765bd025b766f16d2ee0eb0d545a81de Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 5 Mar 2020 13:20:38 +0100 Subject: [PATCH] Eeschema: cosmetic enhancement: display sheet UUID and path in dialog and bottom frame. --- eeschema/dialogs/dialog_sch_sheet_props.cpp | 3 + .../dialogs/dialog_sch_sheet_props_base.cpp | 50 ++- .../dialogs/dialog_sch_sheet_props_base.fbp | 324 +++++++++++++++++- .../dialogs/dialog_sch_sheet_props_base.h | 7 +- eeschema/sch_sheet.cpp | 8 +- 5 files changed, 372 insertions(+), 20 deletions(-) diff --git a/eeschema/dialogs/dialog_sch_sheet_props.cpp b/eeschema/dialogs/dialog_sch_sheet_props.cpp index c9a26f1795..baa2f62ad5 100644 --- a/eeschema/dialogs/dialog_sch_sheet_props.cpp +++ b/eeschema/dialogs/dialog_sch_sheet_props.cpp @@ -96,6 +96,9 @@ bool DIALOG_SCH_SHEET_PROPS::TransferDataToWindow() m_filenameTextSize.SetValue( m_sheet->GetFileNameSize() ); m_sheetnameTextSize.SetValue( m_sheet->GetSheetNameSize() ); + m_textCtrlUuid->SetValue( m_sheet->m_Uuid.AsString() ); + m_textCtrlHpath->SetValue( g_CurrentSheet->PathHumanReadable() ); + return true; } diff --git a/eeschema/dialogs/dialog_sch_sheet_props_base.cpp b/eeschema/dialogs/dialog_sch_sheet_props_base.cpp index 4187d726ce..acfe646d5a 100644 --- a/eeschema/dialogs/dialog_sch_sheet_props_base.cpp +++ b/eeschema/dialogs/dialog_sch_sheet_props_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 26 2018) +// C++ code generated with wxFormBuilder (version Jul 10 2019) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -43,25 +43,25 @@ DIALOG_SCH_SHEET_PROPS_BASE::DIALOG_SCH_SHEET_PROPS_BASE( wxWindow* parent, wxWi bupperSizer->Add( bSizer3, 0, wxEXPAND, 5 ); - wxBoxSizer* bSizer4; - bSizer4 = new wxBoxSizer( wxHORIZONTAL ); + wxBoxSizer* bSizerFilenameSettings; + bSizerFilenameSettings = new wxBoxSizer( wxHORIZONTAL ); m_filenameVisible = new wxCheckBox( this, wxID_ANY, _("Visible"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer4->Add( m_filenameVisible, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 36 ); + bSizerFilenameSettings->Add( m_filenameVisible, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 36 ); m_filenameSizeLabel = new wxStaticText( this, wxID_ANY, _("Text size:"), wxDefaultPosition, wxDefaultSize, 0 ); m_filenameSizeLabel->Wrap( -1 ); - bSizer4->Add( m_filenameSizeLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + bSizerFilenameSettings->Add( m_filenameSizeLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_filenameSizeCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - bSizer4->Add( m_filenameSizeCtrl, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizerFilenameSettings->Add( m_filenameSizeCtrl, 0, wxALIGN_CENTER_VERTICAL, 5 ); m_filenameSizeUnits = new wxStaticText( this, wxID_ANY, _("units"), wxDefaultPosition, wxDefaultSize, 0 ); m_filenameSizeUnits->Wrap( -1 ); - bSizer4->Add( m_filenameSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + bSizerFilenameSettings->Add( m_filenameSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - bupperSizer->Add( bSizer4, 0, wxEXPAND, 5 ); + bupperSizer->Add( bSizerFilenameSettings, 0, wxEXPAND, 5 ); bupperSizer->Add( 0, 15, 0, wxEXPAND, 5 ); @@ -79,25 +79,45 @@ DIALOG_SCH_SHEET_PROPS_BASE::DIALOG_SCH_SHEET_PROPS_BASE( wxWindow* parent, wxWi bupperSizer->Add( bSizer5, 0, wxEXPAND, 5 ); - wxBoxSizer* bSizer6; - bSizer6 = new wxBoxSizer( wxHORIZONTAL ); + wxBoxSizer* bSizerSheetnameSettings; + bSizerSheetnameSettings = new wxBoxSizer( wxHORIZONTAL ); m_sheetnameVisible = new wxCheckBox( this, wxID_ANY, _("Visible"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer6->Add( m_sheetnameVisible, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 36 ); + bSizerSheetnameSettings->Add( m_sheetnameVisible, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 36 ); m_sheetnameSizeLabel = new wxStaticText( this, wxID_ANY, _("Text size:"), wxDefaultPosition, wxDefaultSize, 0 ); m_sheetnameSizeLabel->Wrap( -1 ); - bSizer6->Add( m_sheetnameSizeLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + bSizerSheetnameSettings->Add( m_sheetnameSizeLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_sheetnameSizeCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - bSizer6->Add( m_sheetnameSizeCtrl, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizerSheetnameSettings->Add( m_sheetnameSizeCtrl, 0, wxALIGN_CENTER_VERTICAL, 5 ); m_sheetnameSizeUnits = new wxStaticText( this, wxID_ANY, _("units"), wxDefaultPosition, wxDefaultSize, 0 ); m_sheetnameSizeUnits->Wrap( -1 ); - bSizer6->Add( m_sheetnameSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + bSizerSheetnameSettings->Add( m_sheetnameSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - bupperSizer->Add( bSizer6, 0, wxEXPAND, 5 ); + bupperSizer->Add( bSizerSheetnameSettings, 0, wxEXPAND, 5 ); + + + bupperSizer->Add( 0, 20, 0, 0, 5 ); + + m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bupperSizer->Add( m_staticline2, 0, wxEXPAND | wxALL, 5 ); + + m_staticTextUuid = new wxStaticText( this, wxID_ANY, _("UUID:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextUuid->Wrap( -1 ); + bupperSizer->Add( m_staticTextUuid, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_textCtrlUuid = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY ); + bupperSizer->Add( m_textCtrlUuid, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + m_staticTextHpath = new wxStaticText( this, wxID_ANY, _("Hierarchical Path:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextHpath->Wrap( -1 ); + bupperSizer->Add( m_staticTextHpath, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_textCtrlHpath = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY ); + bupperSizer->Add( m_textCtrlHpath, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); mainSizer->Add( bupperSizer, 0, wxEXPAND|wxALL, 5 ); diff --git a/eeschema/dialogs/dialog_sch_sheet_props_base.fbp b/eeschema/dialogs/dialog_sch_sheet_props_base.fbp index c8153ae249..cad70c98de 100644 --- a/eeschema/dialogs/dialog_sch_sheet_props_base.fbp +++ b/eeschema/dialogs/dialog_sch_sheet_props_base.fbp @@ -14,6 +14,7 @@ dialog_sch_sheet_props_base 1000 none + 1 dialog_sch_sheet_props @@ -25,6 +26,7 @@ 1 1 UI + 0 1 0 @@ -282,7 +284,7 @@ 0 - bSizer4 + bSizerFilenameSettings wxHORIZONTAL none @@ -689,7 +691,7 @@ 0 - bSizer6 + bSizerSheetnameSettings wxHORIZONTAL none @@ -944,6 +946,324 @@ + + 5 + + 0 + + 20 + protected + 0 + + + + 5 + wxEXPAND | wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_staticline2 + 1 + + + protected + 1 + + Resizable + 1 + + wxLI_HORIZONTAL + ; ; forward_declare + 0 + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + UUID: + 0 + + 0 + + + 0 + + 1 + m_staticTextUuid + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_textCtrlUuid + 1 + + + protected + 1 + + Resizable + 1 + + wxTE_READONLY + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Hierarchical Path: + 0 + + 0 + + + 0 + + 1 + m_staticTextHpath + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_textCtrlHpath + 1 + + + protected + 1 + + Resizable + 1 + + wxTE_READONLY + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + diff --git a/eeschema/dialogs/dialog_sch_sheet_props_base.h b/eeschema/dialogs/dialog_sch_sheet_props_base.h index b461630abe..eb3d7d9564 100644 --- a/eeschema/dialogs/dialog_sch_sheet_props_base.h +++ b/eeschema/dialogs/dialog_sch_sheet_props_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 26 2018) +// C++ code generated with wxFormBuilder (version Jul 10 2019) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -61,6 +61,11 @@ class DIALOG_SCH_SHEET_PROPS_BASE : public DIALOG_SHIM wxStaticText* m_sheetnameSizeLabel; wxTextCtrl* m_sheetnameSizeCtrl; wxStaticText* m_sheetnameSizeUnits; + wxStaticLine* m_staticline2; + wxStaticText* m_staticTextUuid; + wxTextCtrl* m_textCtrlUuid; + wxStaticText* m_staticTextHpath; + wxTextCtrl* m_textCtrlHpath; wxStaticLine* m_staticline1; wxStdDialogButtonSizer* m_sdbSizer1; wxButton* m_sdbSizer1OK; diff --git a/eeschema/sch_sheet.cpp b/eeschema/sch_sheet.cpp index 491e3f877b..9a0c773854 100644 --- a/eeschema/sch_sheet.cpp +++ b/eeschema/sch_sheet.cpp @@ -649,8 +649,12 @@ void SCH_SHEET::GetMsgPanelInfo( EDA_UNITS aUnits, MSG_PANEL_ITEMS& aList ) aList.push_back( MSG_PANEL_ITEM( _( "Sheet Name" ), m_name, CYAN ) ); aList.push_back( MSG_PANEL_ITEM( _( "File Name" ), m_fileName, BROWN ) ); -#if 0 // Set to 1 to display the sheet time stamp (mainly for test) - aList.push_back( MSG_PANEL_ITEM( _( "UUID" ), m_Uuid.AsString(), BLUE ) ); +#if 1 // Set to 1 to display the sheet UUID and hierarchical path + wxString msgU, msgL; + msgU << _( "UUID" ) << ": " << m_Uuid.AsString(); + msgL << _( "Path" ) << ": " <PathHumanReadable(); + + aList.push_back( MSG_PANEL_ITEM( msgU, msgL, BLUE ) ); #endif }