Undo commit -r 6595.

This commit is contained in:
Wayne Stambaugh 2016-02-15 15:15:51 -05:00
parent 27b587025d
commit 8587488984
5 changed files with 28 additions and 27 deletions

View File

@ -187,7 +187,7 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateItem( const wxPoint& aPosition, const KICAD_T aF
if( item )
{
if( item->Type() == SCH_COMPONENT_T )
( (SCH_COMPONENT*) item )->SetCurrentSheet( GetCurrentSheet().Last() );
( (SCH_COMPONENT*) item )->SetCurrentSheetPath( &GetCurrentSheet() );
MSG_PANEL_ITEMS items;
item->GetMsgPanelInfo( items );

View File

@ -146,7 +146,7 @@ void SCH_EDIT_FRAME::EditComponentFieldText( SCH_FIELD* aField )
}
MSG_PANEL_ITEMS items;
component->SetCurrentSheet( GetCurrentSheet().Last() );
component->SetCurrentSheetPath( &GetCurrentSheet() );
component->GetMsgPanelInfo( items );
SetMsgPanel( items );
}

View File

@ -221,7 +221,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* aDC,
return NULL;
}
SCH_COMPONENT* component = new SCH_COMPONENT( *part, m_CurrentSheet->Last(), unit, convert,
SCH_COMPONENT* component = new SCH_COMPONENT( *part, m_CurrentSheet, unit, convert,
GetCrossHairPosition(), true );
// Set the m_ChipName value, from component name in lib, for aliases
@ -237,7 +237,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* aDC,
MSG_PANEL_ITEMS items;
component->SetCurrentSheet( GetCurrentSheet().Last() );
component->SetCurrentSheetPath( &GetCurrentSheet() );
component->GetMsgPanelInfo( items );
SetMsgPanel( items );

View File

@ -118,12 +118,12 @@ SCH_COMPONENT::SCH_COMPONENT( const wxPoint& aPos, SCH_ITEM* aParent ) :
SCH_ITEM( aParent, SCH_COMPONENT_T )
{
Init( aPos );
m_currentSheet = NULL;
m_currentSheetPath = NULL;
m_fieldsAutoplaced = AUTOPLACED_NO;
}
SCH_COMPONENT::SCH_COMPONENT( LIB_PART& aPart, SCH_SHEET* aSheet, int unit,
SCH_COMPONENT::SCH_COMPONENT( LIB_PART& aPart, SCH_SHEET_PATH* sheet, int unit,
int convert, const wxPoint& pos, bool setNewItemFlag ) :
SCH_ITEM( NULL, SCH_COMPONENT_T )
{
@ -133,7 +133,7 @@ SCH_COMPONENT::SCH_COMPONENT( LIB_PART& aPart, SCH_SHEET* aSheet, int unit,
m_convert = convert;
m_part_name = aPart.GetName();
m_part = aPart.SharedPtr();
m_currentSheet = aSheet;
m_currentSheetPath = NULL;
m_fieldsAutoplaced = AUTOPLACED_NO;
SetTimeStamp( GetNewTimeStamp() );
@ -186,7 +186,7 @@ SCH_COMPONENT::SCH_COMPONENT( LIB_PART& aPart, SCH_SHEET* aSheet, int unit,
// update the reference -- just the prefix for now.
msg += wxT( "?" );
SetRef( aSheet, msg );
SetRef( sheet->Last(), msg );
// Use the schematic component name instead of the library value field
// name.
@ -197,7 +197,7 @@ SCH_COMPONENT::SCH_COMPONENT( LIB_PART& aPart, SCH_SHEET* aSheet, int unit,
SCH_COMPONENT::SCH_COMPONENT( const SCH_COMPONENT& aComponent ) :
SCH_ITEM( aComponent )
{
m_currentSheet = NULL;
m_currentSheetPath = NULL;
m_Parent = aComponent.m_Parent;
m_Pos = aComponent.m_Pos;
m_unit = aComponent.m_unit;
@ -1528,8 +1528,9 @@ void SCH_COMPONENT::GetMsgPanelInfo( MSG_PANEL_ITEMS& aList )
if( !alias )
return;
if( m_currentSheet )
aList.push_back( MSG_PANEL_ITEM( _( "Reference" ), GetRef( m_currentSheet ),
if( m_currentSheetPath )
aList.push_back( MSG_PANEL_ITEM( _( "Reference" ),
GetRef( m_currentSheetPath->Last() ),
DARKCYAN ) );
wxString msg = part->IsPower() ? _( "Power symbol" ) : _( "Value" );

View File

@ -89,12 +89,12 @@ private:
AUTOPLACED m_fieldsAutoplaced; ///< indicates status of field autoplacement
/**
* A temporary sheet is required to generate the correct reference designator string
* A temporary sheet path is required to generate the correct reference designator string
* in complex heirarchies. Hopefully this is only a temporary hack to decouple schematic
* objects from the drawing window until a better design for handling complex heirarchies
* can be implemented.
*/
const SCH_SHEET* m_currentSheet;
const SCH_SHEET_PATH* m_currentSheetPath;
/**
* Defines the hierarchical path and reference of the component. This allows support
@ -121,7 +121,7 @@ public:
* @param pos - Position to place new component.
* @param setNewItemFlag - Set the component IS_NEW and IS_MOVED flags.
*/
SCH_COMPONENT( LIB_PART& aPart, SCH_SHEET* aSheet,
SCH_COMPONENT( LIB_PART& aPart, SCH_SHEET_PATH* aSheet,
int unit = 0, int convert = 0,
const wxPoint& pos = wxPoint( 0, 0 ),
bool setNewItemFlag = false );
@ -404,9 +404,9 @@ public:
*/
static bool IsReferenceStringValid( const wxString& aReferenceString );
void SetCurrentSheet( const SCH_SHEET* aSheet )
void SetCurrentSheetPath( const SCH_SHEET_PATH* aSheetPath )
{
m_currentSheet = aSheet;
m_currentSheetPath = aSheetPath;
}
/**