Commit f3c324d5 authored by dickelbeck's avatar dickelbeck
Browse files

EDA_BaseStruct::m_StructType is now type KICAD_T

parent 908f6d93
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -26,7 +26,7 @@ S3D_Vertex::S3D_Vertex(void)


/**************************************************************************/
/**************************************************************************/
S3D_Material::S3D_Material( Struct3D_Master * father, const wxString & name ):
S3D_Material::S3D_Material( Struct3D_Master * father, const wxString & name ):
		EDA_BaseStruct( father, -1)
		EDA_BaseStruct( father, NOT_USED )
/**************************************************************************/
/**************************************************************************/
{
{
	m_DiffuseColor.x = m_DiffuseColor.y = m_DiffuseColor.z = 1.0;
	m_DiffuseColor.x = m_DiffuseColor.y = m_DiffuseColor.z = 1.0;
@@ -67,7 +67,7 @@ void Struct3D_Master::Copy(Struct3D_Master * pattern)


/***************************************************************/
/***************************************************************/
Struct3D_Master::Struct3D_Master(EDA_BaseStruct * StructFather):
Struct3D_Master::Struct3D_Master(EDA_BaseStruct * StructFather):
		EDA_BaseStruct( StructFather, -1)
		EDA_BaseStruct( StructFather, NOT_USED )
/***************************************************************/
/***************************************************************/
{
{
	m_MatScale.x = m_MatScale.y = m_MatScale.z = 1.0;
	m_MatScale.x = m_MatScale.y = m_MatScale.z = 1.0;
@@ -100,7 +100,7 @@ S3D_Material * nextmat;


/***************************************************************/
/***************************************************************/
Struct3D_Shape::Struct3D_Shape(EDA_BaseStruct * StructFather):
Struct3D_Shape::Struct3D_Shape(EDA_BaseStruct * StructFather):
		EDA_BaseStruct( StructFather, -1)
		EDA_BaseStruct( StructFather, NOT_USED )
/***************************************************************/
/***************************************************************/
{
{
	m_3D_Coord = NULL;
	m_3D_Coord = NULL;
+12 −3
Original line number Original line Diff line number Diff line
@@ -5,6 +5,18 @@ Please add newer entries at the top, list the date and your name with
email address.
email address.




2007-Aug-23 UPDATE   Dick Hollenbeck <dick@softplc.com>
================================================================================
+ eeschema & pcbnew
  * Removed class EDA_BaseLineStruct, which brought no behavioral advantage, only data.
    Classes which were based on got its data members added and their initializers.
  * Changed type of EDA_BaseStruct::m_StructType from int to KICAD_T which is an
    enum.  This makes debugging easier since gdb will show the name of the
    KICAD_T rather than simply a number.  Added NOT_USED = -1 to KICAD_T enum for
    3d which was using -1.
  * More beautification using latest uncrustify and the committed uncrustify.cfg
  

2007-Aug-24 UPDATE   Geoff Harland <gharlandau@yahoo.com.au>
2007-Aug-24 UPDATE   Geoff Harland <gharlandau@yahoo.com.au>
================================================================================
================================================================================
+ pcbnew
+ pcbnew
@@ -27,9 +39,6 @@ email address.
    tomorrow I will add a new class COLLECTORS_GUIDE which can be used by a
    tomorrow I will add a new class COLLECTORS_GUIDE which can be used by a
    COLLECTOR to control its operation. It adds the concept of layer
    COLLECTOR to control its operation. It adds the concept of layer
    locking, even though PCBNEW does not support that in the UI yet.
    locking, even though PCBNEW does not support that in the UI yet.
    @todo:
    add constructor initializers for classes that were derived from
    EDA_BaseLineStruct but are now not. Its late, will do tomorrow.




2007-Aug-22 UPDATE   Dick Hollenbeck <dick@softplc.com>
2007-Aug-22 UPDATE   Dick Hollenbeck <dick@softplc.com>
+5 −15
Original line number Original line Diff line number Diff line
@@ -17,8 +17,8 @@
#include "macros.h"
#include "macros.h"




// DrawStructureType names for error messages only:
// KICAD_T names for error messages only:
static wxString DrawStructureTypeName[MAX_STRUCT_TYPE_ID + 1] = {
static wxString KICAD_TName[MAX_STRUCT_TYPE_ID + 1] = {
    wxT( "Not init" ),
    wxT( "Not init" ),


    wxT( "Pcb" ),
    wxT( "Pcb" ),
@@ -74,7 +74,7 @@ enum textbox {




/******************************************************************************/
/******************************************************************************/
EDA_BaseStruct::EDA_BaseStruct( EDA_BaseStruct* parent, int idType )
EDA_BaseStruct::EDA_BaseStruct( EDA_BaseStruct* parent, KICAD_T idType )
/******************************************************************************/
/******************************************************************************/
{
{
    InitVars();
    InitVars();
@@ -84,7 +84,7 @@ EDA_BaseStruct::EDA_BaseStruct( EDA_BaseStruct* parent, int idType )




/********************************************/
/********************************************/
EDA_BaseStruct::EDA_BaseStruct( int idType )
EDA_BaseStruct::EDA_BaseStruct( KICAD_T idType )
/********************************************/
/********************************************/
{
{
    InitVars();
    InitVars();
@@ -183,7 +183,7 @@ wxString EDA_BaseStruct::ReturnClassName() const


    if( (ii < 0) || (ii > MAX_STRUCT_TYPE_ID) )
    if( (ii < 0) || (ii > MAX_STRUCT_TYPE_ID) )
        ii = MAX_STRUCT_TYPE_ID;
        ii = MAX_STRUCT_TYPE_ID;
    classname = DrawStructureTypeName[ii];
    classname = KICAD_TName[ii];


    return classname;
    return classname;
}
}
@@ -287,16 +287,6 @@ std::ostream& EDA_BaseStruct::NestedSpace( int nestLevel, std::ostream& os )






/**********************************************************************************************/
EDA_BaseLineStruct::EDA_BaseLineStruct( EDA_BaseStruct* StructFather, DrawStructureType idtype ) :
    EDA_BaseStruct( StructFather, idtype )
/**********************************************************************************************/
{
    m_Layer = 0;
    m_Width = 0;                // 0 = line, > 0 = tracks, bus ...
};


/*********************************************************/
/*********************************************************/
/* EDA_TextStruct (classe de base, non utilis� seule */
/* EDA_TextStruct (classe de base, non utilis� seule */
/*********************************************************/
/*********************************************************/
+139 −100
Original line number Original line Diff line number Diff line
@@ -23,11 +23,13 @@ void DrawSheetStruct::Display_Infos(WinEDA_DrawFrame * frame)
    Affiche_1_Parametre( frame, 30, _( "FileName" ), m_FileName, BROWN );
    Affiche_1_Parametre( frame, 30, _( "FileName" ), m_FileName, BROWN );
}
}



/***************************************************************/
/***************************************************************/
void EDA_SchComponentStruct::Display_Infos( WinEDA_DrawFrame* frame )
void EDA_SchComponentStruct::Display_Infos( WinEDA_DrawFrame* frame )
/***************************************************************/
/***************************************************************/
{
{
    EDA_LibComponentStruct* Entry = FindLibPart( m_ChipName.GetData(), wxEmptyString, FIND_ROOT );;
    EDA_LibComponentStruct* Entry = FindLibPart( m_ChipName.GetData(), wxEmptyString, FIND_ROOT );;

    wxString msg;
    wxString msg;


    frame->MsgPanel->EraseMsgBox();
    frame->MsgPanel->EraseMsgBox();
@@ -37,7 +39,8 @@ wxString msg;


    if( Entry && Entry->m_Options == ENTRY_POWER )
    if( Entry && Entry->m_Options == ENTRY_POWER )
        msg = _( "Pwr Symb" );
        msg = _( "Pwr Symb" );
	else msg = _("Val");
    else
        msg = _( "Val" );
    Affiche_1_Parametre( frame, 10, msg, m_Field[VALUE].m_Text, DARKCYAN );
    Affiche_1_Parametre( frame, 10, msg, m_Field[VALUE].m_Text, DARKCYAN );


    Affiche_1_Parametre( frame, 28, _( "RefLib" ), m_ChipName.GetData(), BROWN );
    Affiche_1_Parametre( frame, 28, _( "RefLib" ), m_ChipName.GetData(), BROWN );
@@ -53,10 +56,10 @@ wxString msg;
}
}





/*******************************************************/
/*******************************************************/
void LibDrawPin::Display_Infos( WinEDA_DrawFrame* frame )
void LibDrawPin::Display_Infos( WinEDA_DrawFrame* frame )
/*******************************************************/
/*******************************************************/

/* Affiche en bas d'ecran les caracteristiques de la pin
/* Affiche en bas d'ecran les caracteristiques de la pin
 */
 */
{
{
@@ -69,8 +72,10 @@ int ii;
    Affiche_1_Parametre( frame, 24, _( "PinName" ), m_PinName, DARKCYAN );
    Affiche_1_Parametre( frame, 24, _( "PinName" ), m_PinName, DARKCYAN );


    /* Affichage du numero */
    /* Affichage du numero */
	if(m_PinNum == 0)  Text = wxT("?" );
    if( m_PinNum == 0 )
	else ReturnPinStringNum(Text);
        Text = wxT( "?" );
    else
        ReturnPinStringNum( Text );


    Affiche_1_Parametre( frame, 40, _( "PinNum" ), Text, DARKCYAN );
    Affiche_1_Parametre( frame, 40, _( "PinNum" ), Text, DARKCYAN );


@@ -80,8 +85,10 @@ int ii;


    /* Affichage de la visiblite */
    /* Affichage de la visiblite */
    ii = m_Attributs;
    ii = m_Attributs;
	if( ii & 1 ) Text = _("no");
    if( ii & 1 )
	else Text = _("yes");
        Text = _( "no" );
    else
        Text = _( "yes" );
    Affiche_1_Parametre( frame, 58, _( "Display" ), Text, DARKGREEN );
    Affiche_1_Parametre( frame, 58, _( "Display" ), Text, DARKGREEN );


    /* Affichage de la longueur */
    /* Affichage de la longueur */
@@ -91,11 +98,20 @@ int ii;
    /* Affichage de l'orientation */
    /* Affichage de l'orientation */
    switch( m_Orient )
    switch( m_Orient )
    {
    {
		case PIN_UP: Text = _("Up"); break;
    case PIN_UP:
		case PIN_DOWN: Text = _("Down"); break;
        Text = _( "Up" ); break;
		case PIN_LEFT: Text = _("Left"); break;

		case PIN_RIGHT: Text = _("Right"); break;
    case PIN_DOWN:
		default: Text = wxT("??"); break;
        Text = _( "Down" ); break;

    case PIN_LEFT:
        Text = _( "Left" ); break;

    case PIN_RIGHT:
        Text = _( "Right" ); break;

    default:
        Text = wxT( "??" ); break;
    }
    }


    Affiche_1_Parametre( frame, 72, _( "Orient" ), Text, MAGENTA );
    Affiche_1_Parametre( frame, 72, _( "Orient" ), Text, MAGENTA );
@@ -105,6 +121,7 @@ int ii;
/***********************************************************************/
/***********************************************************************/
void LibEDA_BaseStruct::Display_Infos_DrawEntry( WinEDA_DrawFrame* frame )
void LibEDA_BaseStruct::Display_Infos_DrawEntry( WinEDA_DrawFrame* frame )
/***********************************************************************/
/***********************************************************************/

/* Affiche en bas d'ecran les caracteristiques de l'element
/* Affiche en bas d'ecran les caracteristiques de l'element
 */
 */
{
{
@@ -114,37 +131,59 @@ wxString msg;


    /* affichage du type */
    /* affichage du type */
    msg = wxT( "??" );
    msg = wxT( "??" );

    switch( m_StructType )
    switch( m_StructType )
    {
    {
		case COMPONENT_ARC_DRAW_TYPE: msg = wxT("Arc"); break;
    case COMPONENT_ARC_DRAW_TYPE:
		case COMPONENT_CIRCLE_DRAW_TYPE: msg = wxT("Circle"); break;
        msg = wxT( "Arc" ); break;
		case COMPONENT_GRAPHIC_TEXT_DRAW_TYPE: msg = wxT("Text"); break;

		case COMPONENT_RECT_DRAW_TYPE: msg = wxT("Rect"); break;
    case COMPONENT_CIRCLE_DRAW_TYPE:
		case COMPONENT_POLYLINE_DRAW_TYPE: msg = wxT("PolyLine"); break;
        msg = wxT( "Circle" ); break;
		case COMPONENT_LINE_DRAW_TYPE: msg = wxT("Segment"); break;

    case COMPONENT_GRAPHIC_TEXT_DRAW_TYPE:
        msg = wxT( "Text" ); break;

    case COMPONENT_RECT_DRAW_TYPE:
        msg = wxT( "Rect" ); break;

    case COMPONENT_POLYLINE_DRAW_TYPE:
        msg = wxT( "PolyLine" ); break;

    case COMPONENT_LINE_DRAW_TYPE:
        msg = wxT( "Segment" ); break;

    case COMPONENT_PIN_DRAW_TYPE:
    case COMPONENT_PIN_DRAW_TYPE:
        ( (LibDrawPin*) this )->Display_Infos( frame );
        ( (LibDrawPin*) this )->Display_Infos( frame );
        msg = wxT( "Pin" );
        msg = wxT( "Pin" );
        break;
        break;

    default:
        ;
    }
    }


    Affiche_1_Parametre( frame, 1, wxT( "Type" ), msg, CYAN );
    Affiche_1_Parametre( frame, 1, wxT( "Type" ), msg, CYAN );




    /* Affichage de l'appartenance */
    /* Affichage de l'appartenance */
	if( m_Unit == 0 ) msg = _("All");
    if( m_Unit == 0 )
	else msg.Printf( wxT("%d"), m_Unit );
        msg = _( "All" );
    else
        msg.Printf( wxT( "%d" ), m_Unit );
    Affiche_1_Parametre( frame, 10, _( "Unit" ), msg, BROWN );
    Affiche_1_Parametre( frame, 10, _( "Unit" ), msg, BROWN );


	if( m_Convert == 0 ) msg = _("All" );
    if( m_Convert == 0 )
	else if( m_Convert == 1 ) msg = _("no");
        msg = _( "All" );
	else if( m_Convert == 2 ) msg = _("yes");
    else if( m_Convert == 1 )
	else msg = wxT("?");
        msg = _( "no" );
    else if( m_Convert == 2 )
        msg = _( "yes" );
    else
        msg = wxT( "?" );
    Affiche_1_Parametre( frame, 16, _( "Convert" ), msg, BROWN );
    Affiche_1_Parametre( frame, 16, _( "Convert" ), msg, BROWN );


	if ( m_Width ) valeur_param(m_Width, msg);
    if( m_Width )
	else msg = _("default");
        valeur_param( m_Width, msg );
    else
        msg = _( "default" );
    Affiche_1_Parametre( frame, 24, _( "Width" ), msg, BLUE );
    Affiche_1_Parametre( frame, 24, _( "Width" ), msg, BLUE );
}
}

+3 −0
Original line number Original line Diff line number Diff line
@@ -841,6 +841,9 @@ static EDA_BaseStruct* CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREE
                sheet->m_FileName = sheet->m_SheetName + wxT( ".sch" );
                sheet->m_FileName = sheet->m_SheetName + wxT( ".sch" );
                break;
                break;
            }
            }
            
            default:
                ;
            }
            }


            SetStructFather( Struct, screen );
            SetStructFather( Struct, screen );
Loading