Commit cfc3d6df authored by Wayne Stambaugh's avatar Wayne Stambaugh
Browse files

EESchema sheet pin code improvements.

* Change all code references to pin sheet and sheet label to sheet pin to
  more closely match the sheet pin object for improved code readability.
* Change menu and tool bar text from pin sheet to sheet pin for improved
  user readability.
* Moved sheet pin place method to sheet pin object source file.
* Move last sheet pin stored state information into schematic frame object.
* Add Doxygen comments for the sheet pin editing methods.
parent c38d59a6
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -46,11 +46,11 @@ void GenListeGLabels( LABEL_OBJECT_LIST& aList )
            {
                SCH_SHEET* sheet = (SCH_SHEET*) schItem;

                BOOST_FOREACH( SCH_SHEET_PIN& sheetLabel, sheet->GetSheetPins() )
                BOOST_FOREACH( SCH_SHEET_PIN& sheetPin, sheet->GetPins() )
                {
                    label.m_LabelType = SCH_SHEET_LABEL_T;
                    label.m_LabelType = SCH_SHEET_PIN_T;
                    label.m_SheetPath = *path;
                    label.m_Label     = &sheetLabel;
                    label.m_Label     = &sheetPin;
                    aList.push_back( label );
                }
            }
@@ -75,12 +75,12 @@ bool SortLabelsByValue( const LABEL_OBJECT& obj1, const LABEL_OBJECT& obj2 )
    int       ii;
    wxString* Text1, * Text2;

    if( obj1.m_LabelType == SCH_SHEET_LABEL_T )
    if( obj1.m_LabelType == SCH_SHEET_PIN_T )
        Text1 = &( (SCH_SHEET_PIN*)(obj1.m_Label) )->m_Text;
    else
        Text1 = &( (SCH_TEXT*)(obj1.m_Label) )->m_Text;

    if( obj2.m_LabelType == SCH_SHEET_LABEL_T )
    if( obj2.m_LabelType == SCH_SHEET_PIN_T )
        Text2 = &( (SCH_SHEET_PIN*)(obj2.m_Label) )->m_Text;
    else
        Text2 = &( (SCH_TEXT*)(obj2.m_Label) )->m_Text;
@@ -109,12 +109,12 @@ bool SortLabelsBySheet( const LABEL_OBJECT& obj1, const LABEL_OBJECT& obj2 )

    if( ii == 0 )
    {
        if( obj1.m_LabelType == SCH_SHEET_LABEL_T )
        if( obj1.m_LabelType == SCH_SHEET_PIN_T )
            Text1 = ( (SCH_SHEET_PIN*) obj1.m_Label )->m_Text;
        else
            Text1 = ( (SCH_TEXT*) obj1.m_Label )->m_Text;

        if( obj2.m_LabelType == SCH_SHEET_LABEL_T )
        if( obj2.m_LabelType == SCH_SHEET_PIN_T )
            Text2 = ( (SCH_SHEET_PIN*) obj2.m_Label )->m_Text;
        else
            Text2 = ( (SCH_TEXT*) obj2.m_Label )->m_Text;
@@ -157,7 +157,7 @@ int PrintListeGLabel( FILE* f, LABEL_OBJECT_LIST& aList )
            fputs( TO_UTF8( msg ), f );
            break;

        case SCH_SHEET_LABEL_T:
        case SCH_SHEET_PIN_T:
        {
            pinsheet = (SCH_SHEET_PIN*) aList[ii].m_Label;
            int jj = pinsheet->m_Shape;
+1 −1
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ void DialogLabelEditor::InitDialog()
        SetTitle( _( "Label Properties" ) );
        break;

    case SCH_SHEET_LABEL_T:
    case SCH_SHEET_PIN_T:
        SetTitle( _( "Hierarchical Sheet Pin Properties." ) );
        break;

+3 −3
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ enum id_eeschema_frm
    ID_GLABEL_BUTT,
    ID_HIERLABEL_BUTT,
    ID_IMPORT_HLABEL_BUTT,
    ID_SHEET_LABEL_BUTT,
    ID_SHEET_PIN_BUTT,
    ID_NOCONN_BUTT,
    ID_JUNCTION_BUTT,
    ID_SHEET_SYMBOL_BUTT,
@@ -84,8 +84,8 @@ enum id_eeschema_frm
    ID_POPUP_SCH_EDIT_SHEET,
    ID_POPUP_SCH_RESIZE_SHEET,
    ID_POPUP_SCH_CLEANUP_SHEET,
    ID_POPUP_SCH_EDIT_PINSHEET,
    ID_POPUP_SCH_MOVE_PINSHEET,
    ID_POPUP_SCH_EDIT_SHEET_PIN,
    ID_POPUP_SCH_MOVE_SHEET_PIN,
    ID_POPUP_IMPORT_GLABEL,
    ID_POPUP_SCH_GENERIC_ORIENT_CMP,
    ID_POPUP_SCH_GENERIC_EDIT_CMP,
+4 −4
Original line number Diff line number Diff line
@@ -39,13 +39,13 @@
    _(\
        "Place a global label.\nWarning: all global labels with the same name are connected in whole hierarchy" )
#define HELP_PLACE_HIER_LABEL \
    _( "Place a hierarchical label. This label will be seen as a pin sheet in the sheet symbol" )
    _( "Place a hierarchical label. This label will be seen as a hierarchical pin in the sheet symbol" )

#define HELP_PLACE_JUNCTION     _( "Place a junction" )
#define HELP_PLACE_SHEET        _( "Create a hierarchical sheet" )
#define HELP_IMPORT_PINSHEET    _( \
        "Place a pin sheet, imported from the corresponding hierarchical label in sheet" )
#define HELP_PLACE_PINSHEET     _( "Place a hierarchical pin to sheet" )
#define HELP_IMPORT_SHEETPIN    _( \
        "Place a hierarchical pin imported from the corresponding hierarchical label in sheet" )
#define HELP_PLACE_SHEETPIN     _( "Place a hierarchical pin in sheet" )
#define HELP_PLACE_GRAPHICLINES _( "Place graphic lines or polygons" )
#define HELP_PLACE_GRAPHICTEXTS _( "Place graphic text (comment)" )

+4 −4
Original line number Diff line number Diff line
@@ -743,8 +743,8 @@ void SCH_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
                wxPostEvent( this, cmd );
                break;

            case SCH_SHEET_LABEL_T:
                cmd.SetId( ID_POPUP_SCH_MOVE_PINSHEET );
            case SCH_SHEET_PIN_T:
                cmd.SetId( ID_POPUP_SCH_MOVE_SHEET_PIN );
                wxPostEvent( this, cmd );
                break;

@@ -791,8 +791,8 @@ void SCH_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
            wxPostEvent( this, cmd );
            break;

        case SCH_SHEET_LABEL_T:
            cmd.SetId( ID_POPUP_SCH_EDIT_PINSHEET );
        case SCH_SHEET_PIN_T:
            cmd.SetId( ID_POPUP_SCH_EDIT_SHEET_PIN );
            wxPostEvent( this, cmd );
            break;

Loading