mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-04 23:55:30 +00:00
Show UUIDs in msg panel with an advanced config
This is useful when confirming matches for items in the debugger or from a file without having to carefully check individual parameters.
This commit is contained in:
parent
e94449df81
commit
4765d17d0c
common
eeschema/tools
include
pagelayout_editor/tools
pcbnew/tools
@ -123,6 +123,7 @@ static const wxChar ExtensionSnapActivateOnHover[] = wxT( "ExtensionSnapActivate
|
||||
static const wxChar EnableSnapAnchorsDebug[] = wxT( "EnableSnapAnchorsDebug" );
|
||||
static const wxChar MinParallelAngle[] = wxT( "MinParallelAngle" );
|
||||
static const wxChar HoleWallPaintingMultiplier[] = wxT( "HoleWallPaintingMultiplier" );
|
||||
static const wxChar MsgPanelShowUuids[] = wxT( "MsgPanelShowUuids" );
|
||||
|
||||
} // namespace KEYS
|
||||
|
||||
@ -240,6 +241,7 @@ ADVANCED_CFG::ADVANCED_CFG()
|
||||
m_SmallDrillMarkSize = 0.35;
|
||||
m_HotkeysDumper = false;
|
||||
m_DrawBoundingBoxes = false;
|
||||
m_MsgPanelShowUuids = 0;
|
||||
m_ShowPcbnewExportNetlist = false;
|
||||
m_Skip3DModelFileCache = false;
|
||||
m_Skip3DModelMemoryCache = false;
|
||||
@ -564,6 +566,10 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
|
||||
&m_HoleWallPaintingMultiplier, m_HoleWallPaintingMultiplier,
|
||||
0.1, 100.0 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::MsgPanelShowUuids,
|
||||
&m_MsgPanelShowUuids,
|
||||
m_MsgPanelShowUuids ) );
|
||||
|
||||
// Special case for trace mask setting...we just grab them and set them immediately
|
||||
// Because we even use wxLogTrace inside of advanced config
|
||||
wxString traceMasks;
|
||||
|
@ -30,6 +30,9 @@
|
||||
#include <wx/settings.h>
|
||||
#include <wx/toplevel.h>
|
||||
|
||||
#include <advanced_config.h>
|
||||
#include <kiid.h>
|
||||
|
||||
#include <widgets/ui_common.h>
|
||||
|
||||
|
||||
@ -237,3 +240,20 @@ void EDA_MSG_PANEL::erase( wxDC* aDC )
|
||||
aDC->SetBrush( brush );
|
||||
aDC->DrawRectangle( 0, 0, size.x, size.y );
|
||||
}
|
||||
|
||||
|
||||
std::optional<wxString> GetMsgPanelDisplayUuid( const KIID& aKiid )
|
||||
{
|
||||
const static int showUuids = ADVANCED_CFG::GetCfg().m_MsgPanelShowUuids;
|
||||
std::optional<wxString> uuid;
|
||||
|
||||
if( showUuids > 0 )
|
||||
{
|
||||
uuid = aKiid.AsString();
|
||||
|
||||
if( showUuids == 2 )
|
||||
uuid = uuid->SubString( 0, 7 );
|
||||
}
|
||||
|
||||
return uuid;
|
||||
}
|
||||
|
@ -567,9 +567,12 @@ int EE_INSPECTION_TOOL::UpdateMessagePanel( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
if( selection.GetSize() == 1 )
|
||||
{
|
||||
EDA_ITEM* item = (EDA_ITEM*) selection.Front();
|
||||
|
||||
EDA_ITEM* item = (EDA_ITEM*) selection.Front();
|
||||
std::vector<MSG_PANEL_ITEM> msgItems;
|
||||
|
||||
if( std::optional<wxString> uuid = GetMsgPanelDisplayUuid( item->m_Uuid ) )
|
||||
msgItems.emplace_back( _( "UUID" ), *uuid );
|
||||
|
||||
item->GetMsgPanelInfo( m_frame, msgItems );
|
||||
m_frame->SetMsgPanel( msgItems );
|
||||
}
|
||||
|
@ -396,6 +396,21 @@ public:
|
||||
*/
|
||||
bool m_ShowEventCounters;
|
||||
|
||||
/**
|
||||
* Show UUIDs of items in the message panel.
|
||||
*
|
||||
* Can be useful when debugging against a specific item
|
||||
* saved in a file.
|
||||
*
|
||||
* 0: do not show (default)
|
||||
* 1: show full UUID
|
||||
* 2: show only first 8 characters of UUID
|
||||
*
|
||||
* Setting name: "MsgPanelShowUuids"
|
||||
* Default value: 0
|
||||
*/
|
||||
int m_MsgPanelShowUuids;
|
||||
|
||||
/**
|
||||
* Allow manual scaling of canvas.
|
||||
*
|
||||
|
@ -28,23 +28,23 @@
|
||||
* @brief Message panel definition file.
|
||||
*/
|
||||
|
||||
#ifndef _MSGPANEL_H_
|
||||
#define _MSGPANEL_H_
|
||||
#pragma once
|
||||
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
#include <gal/color4d.h>
|
||||
|
||||
#include <wx/window.h>
|
||||
#include <wx/panel.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
using KIGFX::COLOR4D;
|
||||
|
||||
#define MSG_PANEL_DEFAULT_PAD 6 ///< The default number of spaces between each text string.
|
||||
|
||||
|
||||
class EDA_MSG_PANEL;
|
||||
class KIID;
|
||||
|
||||
|
||||
/**
|
||||
@ -164,4 +164,10 @@ protected:
|
||||
};
|
||||
|
||||
|
||||
#endif // _MSGPANEL_H_
|
||||
/**
|
||||
* Get a formatted UUID string for display in the message panel,
|
||||
* according to the current advanced configuration setting.
|
||||
*
|
||||
* This will be std::nullopt if the configuration setting disables UUID display.
|
||||
*/
|
||||
std::optional<wxString> GetMsgPanelDisplayUuid( const KIID& aKiid );
|
||||
|
@ -153,9 +153,12 @@ int PL_EDITOR_CONTROL::UpdateMessagePanel( const TOOL_EVENT& aEvent )
|
||||
|
||||
if( selection.GetSize() == 1 )
|
||||
{
|
||||
EDA_ITEM* item = (EDA_ITEM*) selection.Front();
|
||||
|
||||
EDA_ITEM* item = (EDA_ITEM*) selection.Front();
|
||||
std::vector<MSG_PANEL_ITEM> msgItems;
|
||||
|
||||
if( std::optional<wxString> uuid = GetMsgPanelDisplayUuid( item->m_Uuid ) )
|
||||
msgItems.emplace_back( _( "UUID" ), *uuid );
|
||||
|
||||
item->GetMsgPanelInfo( m_frame, msgItems );
|
||||
m_frame->SetMsgPanel( msgItems );
|
||||
|
||||
|
@ -23,13 +23,14 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "pcb_control.h"
|
||||
|
||||
#include <kiplatform/ui.h>
|
||||
#include <tools/edit_tool.h>
|
||||
#include <tools/board_inspection_tool.h>
|
||||
#include <router/router_tool.h>
|
||||
#include <pgm_base.h>
|
||||
#include <tools/pcb_actions.h>
|
||||
#include <tools/pcb_control.h>
|
||||
#include <tools/pcb_picker_tool.h>
|
||||
#include <tools/pcb_selection_tool.h>
|
||||
#include <tools/board_reannotate_tool.h>
|
||||
@ -1656,6 +1657,9 @@ int PCB_CONTROL::UpdateMessagePanel( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
EDA_ITEM* item = selection.Front();
|
||||
|
||||
if( std::optional<wxString> uuid = GetMsgPanelDisplayUuid( item->m_Uuid ) )
|
||||
msgItems.emplace_back( _( "UUID" ), *uuid );
|
||||
|
||||
item->GetMsgPanelInfo( m_frame, msgItems );
|
||||
|
||||
PCB_TRACK* track = dynamic_cast<PCB_TRACK*>( item );
|
||||
|
Loading…
Reference in New Issue
Block a user