From 863db59a3de4dfb4569f750ac3034c4103601d82 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Tue, 1 Aug 2017 15:34:34 -0400 Subject: [PATCH] Eeschema: improve schematic symbol message panel information. Add information when dummy symbol is used for library symbols that could not be found to give the user some useful information to help track down the broken link rather than display an empty message panel. --- eeschema/sch_component.cpp | 70 +++++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 27 deletions(-) diff --git a/eeschema/sch_component.cpp b/eeschema/sch_component.cpp index 005f2768ef..d9eb6978d8 100644 --- a/eeschema/sch_component.cpp +++ b/eeschema/sch_component.cpp @@ -1721,39 +1721,55 @@ void SCH_COMPONENT::GetMsgPanelInfo( MSG_PANEL_ITEMS& aList ) // part and alias can differ if alias is not the root if( PART_SPTR part = m_part.lock() ) { - LIB_ALIAS* alias = part->GetAlias( GetLibId().GetLibItemName() ); + if( part.get() != dummy ) + { + LIB_ALIAS* alias = part->GetAlias( GetLibId().GetLibItemName() ); - if( !alias ) - return; + if( !alias ) + return; + if( m_currentSheetPath ) + aList.push_back( MSG_PANEL_ITEM( _( "Reference" ), + GetRef( m_currentSheetPath ), + DARKCYAN ) ); + + wxString msg = part->IsPower() ? _( "Power symbol" ) : _( "Value" ); + + aList.push_back( MSG_PANEL_ITEM( msg, GetField( VALUE )->GetShownText(), DARKCYAN ) ); + + // Display component reference in library and library + aList.push_back( MSG_PANEL_ITEM( _( "Component" ), GetLibId().GetLibItemName(), + BROWN ) ); + + if( alias->GetName() != part->GetName() ) + aList.push_back( MSG_PANEL_ITEM( _( "Alias of" ), part->GetName(), BROWN ) ); + + aList.push_back( MSG_PANEL_ITEM( _( "Library" ), alias->GetLibraryName(), BROWN ) ); + + // Display the current associated footprint, if exists. + if( !GetField( FOOTPRINT )->IsVoid() ) + msg = GetField( FOOTPRINT )->GetShownText(); + else + msg = _( "" ); + + aList.push_back( MSG_PANEL_ITEM( _( "Footprint" ), msg, DARKRED ) ); + + // Display description of the component, and keywords found in lib + aList.push_back( MSG_PANEL_ITEM( _( "Description" ), alias->GetDescription(), + DARKCYAN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Key Words" ), alias->GetKeyWords(), DARKCYAN ) ); + } + } + else + { if( m_currentSheetPath ) - aList.push_back( MSG_PANEL_ITEM( _( "Reference" ), - GetRef( m_currentSheetPath ), + aList.push_back( MSG_PANEL_ITEM( _( "Reference" ), GetRef( m_currentSheetPath ), DARKCYAN ) ); - wxString msg = part->IsPower() ? _( "Power symbol" ) : _( "Value" ); - - aList.push_back( MSG_PANEL_ITEM( msg, GetField( VALUE )->GetShownText(), DARKCYAN ) ); - - // Display component reference in library and library + aList.push_back( MSG_PANEL_ITEM( _( "Value" ), GetField( VALUE )->GetShownText(), + DARKCYAN ) ); aList.push_back( MSG_PANEL_ITEM( _( "Component" ), GetLibId().GetLibItemName(), BROWN ) ); - - if( alias->GetName() != part->GetName() ) - aList.push_back( MSG_PANEL_ITEM( _( "Alias of" ), part->GetName(), BROWN ) ); - - aList.push_back( MSG_PANEL_ITEM( _( "Library" ), alias->GetLibraryName(), BROWN ) ); - - // Display the current associated footprint, if exists. - if( !GetField( FOOTPRINT )->IsVoid() ) - msg = GetField( FOOTPRINT )->GetShownText(); - else - msg = _( "" ); - - aList.push_back( MSG_PANEL_ITEM( _( "Footprint" ), msg, DARKRED ) ); - - // Display description of the component, and keywords found in lib - aList.push_back( MSG_PANEL_ITEM( _( "Description" ), alias->GetDescription(), DARKCYAN ) ); - aList.push_back( MSG_PANEL_ITEM( _( "Key Words" ), alias->GetKeyWords(), DARKCYAN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Library" ), _( "Error: symbol not found!!!" ), RED ) ); } }