Exemplo n.º 1
0
wxString LIB_CIRCLE::GetSelectMenuText( EDA_UNITS_T aUnits ) const
{
    return wxString::Format( _( "Circle center (%s, %s), radius %s" ),
                             MessageTextFromValue( aUnits, m_Pos.x ),
                             MessageTextFromValue( aUnits, m_Pos.y ),
                             MessageTextFromValue( aUnits, m_Radius ) );
}
void TEXTE_PCB::GetMsgPanelInfo( EDA_UNITS_T aUnits, std::vector< MSG_PANEL_ITEM >& aList )
{
    wxString    msg;

    wxCHECK_RET( m_Parent != NULL, wxT( "TEXTE_PCB::GetMsgPanelInfo() m_Parent is NULL." ) );

    if( m_Parent->Type() == PCB_DIMENSION_T )
        aList.push_back( MSG_PANEL_ITEM( _( "Dimension" ), GetShownText(), DARKGREEN ) );
    else
        aList.push_back( MSG_PANEL_ITEM( _( "PCB Text" ), GetShownText(), DARKGREEN ) );

    aList.push_back( MSG_PANEL_ITEM( _( "Layer" ), GetLayerName(), BLUE ) );

    if( !IsMirrored() )
        aList.push_back( MSG_PANEL_ITEM( _( "Mirror" ), _( "No" ), DARKGREEN ) );
    else
        aList.push_back( MSG_PANEL_ITEM( _( "Mirror" ), _( "Yes" ), DARKGREEN ) );

    msg.Printf( wxT( "%.1f" ), GetTextAngle() / 10.0 );
    aList.push_back( MSG_PANEL_ITEM( _( "Angle" ), msg, DARKGREEN ) );

    msg = MessageTextFromValue( aUnits, GetThickness() );
    aList.push_back( MSG_PANEL_ITEM( _( "Thickness" ), msg, MAGENTA ) );

    msg = MessageTextFromValue( aUnits, GetTextWidth() );
    aList.push_back( MSG_PANEL_ITEM( _( "Width" ), msg, RED ) );

    msg = MessageTextFromValue( aUnits, GetTextHeight() );
    aList.push_back( MSG_PANEL_ITEM( _( "Height" ), msg, RED ) );
}
Exemplo n.º 3
0
void LIB_CIRCLE::GetMsgPanelInfo( EDA_UNITS_T aUnits, MSG_PANEL_ITEMS& aList )
{
    wxString msg;
    EDA_RECT bBox = GetBoundingBox();

    LIB_ITEM::GetMsgPanelInfo( aUnits, aList );

    msg = MessageTextFromValue( aUnits, m_Width, true );

    aList.push_back( MSG_PANEL_ITEM(  _( "Line Width" ), msg, BLUE ) );

    msg = MessageTextFromValue( aUnits, m_Radius, true );
    aList.push_back( MSG_PANEL_ITEM( _( "Radius" ), msg, RED ) );

    msg.Printf( wxT( "(%d, %d, %d, %d)" ), bBox.GetOrigin().x,
                bBox.GetOrigin().y, bBox.GetEnd().x, bBox.GetEnd().y );

    aList.push_back( MSG_PANEL_ITEM( _( "Bounding Box" ), msg, BROWN ) );
}
Exemplo n.º 4
0
void SCH_TEXT::GetMsgPanelInfo( EDA_UNITS_T aUnits, MSG_PANEL_ITEMS& aList )
{
    wxString msg;

    switch( Type() )
    {
    case SCH_TEXT_T:               msg = _( "Graphic Text" );           break;
    case SCH_LABEL_T:              msg = _( "Label" );                  break;
    case SCH_GLOBAL_LABEL_T:       msg = _( "Global Label" );           break;
    case SCH_HIERARCHICAL_LABEL_T: msg = _( "Hierarchical Label" );     break;
    case SCH_SHEET_PIN_T:          msg = _( "Hierarchical Sheet Pin" ); break;
    default: return;
    }

    aList.push_back( MSG_PANEL_ITEM( msg, GetShownText(), DARKCYAN ) );

    switch( GetLabelSpinStyle() )
    {
    case 0:  msg = _( "Horizontal" );        break;
    case 1:  msg = _( "Vertical up" );       break;
    case 2:  msg = _( "Horizontal invert" ); break;
    case 3:  msg = _( "Vertical down" );     break;
    default: msg = wxT( "???" );             break;
    }

    aList.push_back( MSG_PANEL_ITEM( _( "Orientation" ), msg, BROWN ) );

    wxString textStyle[] = { _( "Normal" ), _( "Italic" ), _( "Bold" ), _( "Bold Italic" ) };
    int style = 0;

    if( IsItalic() )
        style = 1;

    if( IsBold() )
        style += 2;

    aList.push_back( MSG_PANEL_ITEM( _( "Style" ), textStyle[style], BROWN ) );


    // Display electricat type if it is relevant
    if( (Type() == SCH_GLOBAL_LABEL_T) ||
        (Type() == SCH_HIERARCHICAL_LABEL_T ) ||
        (Type() == SCH_SHEET_PIN_T ) )
    {
        switch( GetShape() )
        {
        case NET_INPUT:        msg = _( "Input" );           break;
        case NET_OUTPUT:       msg = _( "Output" );          break;
        case NET_BIDI:         msg = _( "Bidirectional" );   break;
        case NET_TRISTATE:     msg = _( "Tri-State" );       break;
        case NET_UNSPECIFIED:  msg = _( "Passive" );         break;
        default:               msg = wxT( "???" );           break;
        }

        aList.push_back( MSG_PANEL_ITEM( _( "Type" ), msg, BLUE ) );
    }

    // Display text size (X or Y value, with are the same value in Eeschema)
    msg = MessageTextFromValue( aUnits, GetTextWidth(), true );
    aList.push_back( MSG_PANEL_ITEM( _( "Size" ), msg, RED ) );

#if defined(DEBUG)

    if( auto conn = Connection( *g_CurrentSheet ) )
    {
        conn->AppendDebugInfoToMsgPanel( aList );
    }

    msg.Printf( "%p", this );
    aList.push_back( MSG_PANEL_ITEM( "Object Address", msg, RED ) );

#endif
}
Exemplo n.º 5
0
void D_PAD::GetMsgPanelInfo( EDA_UNITS_T aUnits, std::vector< MSG_PANEL_ITEM>& aList )
{
    MODULE*     module;
    wxString    msg;
    BOARD*      board;

    module = (MODULE*) m_Parent;

    if( module )
    {
        aList.push_back( MSG_PANEL_ITEM( _( "Footprint" ), module->GetReference(), DARKCYAN ) );
        aList.push_back( MSG_PANEL_ITEM( _( "Pad" ), m_name, BROWN ) );
    }

    aList.push_back( MSG_PANEL_ITEM( _( "Net" ), UnescapeString( GetNetname() ), DARKCYAN ) );

    board = GetBoard();

    aList.push_back( MSG_PANEL_ITEM( _( "Layer" ),
                     LayerMaskDescribe( board, m_layerMask ), DARKGREEN ) );

    aList.push_back( MSG_PANEL_ITEM( ShowPadShape(), ShowPadAttr(), DARKGREEN ) );

    msg = MessageTextFromValue( aUnits, m_Size.x, true );
    aList.push_back( MSG_PANEL_ITEM( _( "Width" ), msg, RED ) );

    msg = MessageTextFromValue( aUnits, m_Size.y, true );
    aList.push_back( MSG_PANEL_ITEM( _( "Height" ), msg, RED ) );

    msg = MessageTextFromValue( aUnits, m_Drill.x, true );

    if( GetDrillShape() == PAD_DRILL_SHAPE_CIRCLE )
    {
        aList.push_back( MSG_PANEL_ITEM( _( "Drill" ), msg, RED ) );
    }
    else
    {
        msg = MessageTextFromValue( aUnits, m_Drill.x, true )
               + wxT( "/" )
               + MessageTextFromValue( aUnits, m_Drill.y, true );
        aList.push_back( MSG_PANEL_ITEM( _( "Drill X / Y" ), msg, RED ) );
    }

    double module_orient_degrees = module ? module->GetOrientationDegrees() : 0;

    if( module_orient_degrees != 0.0 )
        msg.Printf( wxT( "%3.1f(+%3.1f)" ),
                    GetOrientationDegrees() - module_orient_degrees,
                    module_orient_degrees );
    else
        msg.Printf( wxT( "%3.1f" ), GetOrientationDegrees() );

    aList.push_back( MSG_PANEL_ITEM( _( "Angle" ), msg, LIGHTBLUE ) );

    msg = MessageTextFromValue( aUnits, m_Pos.x )
           + wxT( ", " )
           + MessageTextFromValue( aUnits, m_Pos.y );
    aList.push_back( MSG_PANEL_ITEM( _( "Position" ), msg, LIGHTBLUE ) );

    if( GetPadToDieLength() )
    {
        msg = MessageTextFromValue( aUnits, GetPadToDieLength(), true );
        aList.push_back( MSG_PANEL_ITEM( _( "Length in package" ), msg, CYAN ) );
    }
}