Commit cbb398e8 authored by jean-pierre charras's avatar jean-pierre charras
Browse files

Fix compil issue in non debug mode. Minor code enhancement.

parent 2fb2ab0d
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -52,7 +52,7 @@ static void InitKiCadAboutNew( AboutAppInfo& info )
    info.SetAppName( wxT( ".: " ) + wxGetApp().GetTitle() + wxT( " :." ) );
    info.SetAppName( wxT( ".: " ) + wxGetApp().GetTitle() + wxT( " :." ) );


    /* Copyright information */
    /* Copyright information */
    info.SetCopyright( wxT( "(C) 1992-2010 KiCad Developers Team" ) );
    info.SetCopyright( wxT( "(C) 1992-2011 KiCad Developers Team" ) );


    /* KiCad build version */
    /* KiCad build version */
    wxString version;
    wxString version;
+18 −36
Original line number Original line Diff line number Diff line
@@ -605,17 +605,6 @@ void D_PAD::DisplayInfo( EDA_DRAW_FRAME* frame )
    wxString    Line;
    wxString    Line;
    BOARD*      board;
    BOARD*      board;


    /* Pad messages */
    static const wxString Msg_Pad_Shape[6] =
    {
        wxT( "??? " ), wxT( "Circ" ), wxT( "Rect" ), wxT( "Oval" ), wxT( "trap" ),
        wxT( "spec" )
    };

    static const wxString Msg_Pad_Attribut[5] =
    { wxT( "norm" ), wxT( "smd " ), wxT( "conn" ), wxT( "????" ) };


    frame->EraseMsgBox();
    frame->EraseMsgBox();


    module = (MODULE*) m_Parent;
    module = (MODULE*) m_Parent;
@@ -739,12 +728,7 @@ void D_PAD::DisplayInfo( EDA_DRAW_FRAME* frame )


    frame->AppendMsgPanel( _( "Layer" ), layerInfo, DARKGREEN );
    frame->AppendMsgPanel( _( "Layer" ), layerInfo, DARKGREEN );


    int attribut = m_Attribut & 15;
    frame->AppendMsgPanel( ShowPadShape(), ShowPadAttr(), DARKGREEN );
    if( attribut > 3 )
        attribut = 3;

    frame->AppendMsgPanel( Msg_Pad_Shape[m_PadShape],
                           Msg_Pad_Attribut[attribut], DARKGREEN );


    valeur_param( m_Size.x, Line );
    valeur_param( m_Size.x, Line );
    frame->AppendMsgPanel( _( "H Size" ), Line, RED );
    frame->AppendMsgPanel( _( "H Size" ), Line, RED );
@@ -869,49 +853,46 @@ int D_PAD::Compare( const D_PAD* padref, const D_PAD* padcmp )
}
}




#if defined(DEBUG)
wxString D_PAD::ShowPadShape() const

// @todo: could this be usable elsewhere also?
static const char* ShowPadType( int aPadType )
{
{
    switch( aPadType )
    switch( m_PadShape )
    {
    {
    case PAD_CIRCLE:
    case PAD_CIRCLE:
        return "circle";
        return _("Circle");


    case PAD_OVAL:
    case PAD_OVAL:
        return "oval";
        return _("Oval");


    case PAD_RECT:
    case PAD_RECT:
        return "rect";
        return _("Rect");


    case PAD_TRAPEZOID:
    case PAD_TRAPEZOID:
        return "trap";
        return _("Trap");


    default:
    default:
        return "??unknown??";
        return wxT("??Unknown??");
    }
    }
}
}




static const char* ShowPadAttr( int aPadAttr )
wxString D_PAD::ShowPadAttr() const
{
{
    switch( aPadAttr )
    switch( m_Attribut & 0x0F )
    {
    {
    case PAD_STANDARD:
    case PAD_STANDARD:
        return "STD";
        return _("Std");


    case PAD_SMD:
    case PAD_SMD:
        return "SMD";
        return _("Smd");


    case PAD_CONN:
    case PAD_CONN:
        return "CONN";
        return _("Conn");


    case PAD_HOLE_NOT_PLATED:
    case PAD_HOLE_NOT_PLATED:
        return "HOLE";
        return _("Not Plated");


    default:
    default:
        return "??unkown??";
        return wxT("??Unkown??");
    }
    }
}
}


@@ -936,6 +917,7 @@ wxString D_PAD::GetSelectMenuText() const
    return text;
    return text;
}
}


#if defined(DEBUG)


/**
/**
 * Function Show
 * Function Show
@@ -955,8 +937,8 @@ void D_PAD::Show( int nestLevel, std::ostream& os )


    // for now, make it look like XML:
    // for now, make it look like XML:
    NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() <<
    NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() <<
    " shape=\"" << ShowPadType( m_PadShape ) << '"' <<
    " shape=\"" << ShowPadShape() << '"' <<
    " attr=\"" << ShowPadAttr( m_Attribut ) << '"' <<
    " attr=\"" << ShowPadAttr( ) << '"' <<
    " num=\"" << padname << '"' <<
    " num=\"" << padname << '"' <<
    " net=\"" << m_Netname.mb_str() << '"' <<
    " net=\"" << m_Netname.mb_str() << '"' <<
    " netcode=\"" << GetNet() << '"' <<
    " netcode=\"" << GetNet() << '"' <<
+12 −0
Original line number Original line Diff line number Diff line
@@ -359,6 +359,18 @@ public:


    virtual wxString GetSelectMenuText() const;
    virtual wxString GetSelectMenuText() const;


    /**
     * Function ShowPadShape
     * @return the name of the shape
     */
    wxString ShowPadShape() const;

    /**
     * Function ShowPadAttr
     * @return the name of the pad type (attribute) : STD, SMD ...
     */
    wxString ShowPadAttr() const;

#if defined(DEBUG)
#if defined(DEBUG)


    /**
    /**