Commit 0a2ed094 authored by dickelbeck's avatar dickelbeck
Browse files

see todays change_log.txt

parent eb660b7c
Loading
Loading
Loading
Loading
+39 −26
Original line number Original line Diff line number Diff line
@@ -9,7 +9,7 @@


/* fonctions exportees */
/* fonctions exportees */
int         ListeComposants( CmpListStruct* BaseListeCmp, SCH_SCREEN* screen, int NumSheet );
int         ListeComposants( CmpListStruct* BaseListeCmp, SCH_SCREEN* screen, int NumSheet );
int         AnnotTriComposant( CmpListStruct* Objet1, CmpListStruct* Objet2 );
int         AnnotTriComposant( const void* o1, const void* o2 );
void        BreakReference( CmpListStruct* BaseListeCmp, int NbOfCmp );
void        BreakReference( CmpListStruct* BaseListeCmp, int NbOfCmp );


/* fonctions locales */
/* fonctions locales */
@@ -236,8 +236,7 @@ int ListeComposants( CmpListStruct* BaseListeCmp, SCH_SCREEN* screen, int NumShe
    EDA_LibComponentStruct* Entry;
    EDA_LibComponentStruct* Entry;


    DrawList = screen->EEDrawList;
    DrawList = screen->EEDrawList;

    for(  ; DrawList;   DrawList = DrawList->Pnext )
    while( DrawList )
    {
    {
        switch( DrawList->Type() )
        switch( DrawList->Type() )
        {
        {
@@ -253,10 +252,13 @@ int ListeComposants( CmpListStruct* BaseListeCmp, SCH_SCREEN* screen, int NumShe
            Entry = FindLibPart( DrawLibItem->m_ChipName.GetData(), wxEmptyString, FIND_ROOT );
            Entry = FindLibPart( DrawLibItem->m_ChipName.GetData(), wxEmptyString, FIND_ROOT );
            if( Entry == NULL )
            if( Entry == NULL )
                break;
                break;
            
            if( BaseListeCmp == NULL )      /* Items counting only */
            if( BaseListeCmp == NULL )      /* Items counting only */
            {
            {
                NbrCmp++; break;
                NbrCmp++; 
                break;
            }
            }
            
            BaseListeCmp[NbrCmp].m_Cmp         = DrawLibItem;
            BaseListeCmp[NbrCmp].m_Cmp         = DrawLibItem;
            BaseListeCmp[NbrCmp].m_NbParts     = Entry->m_UnitCount;
            BaseListeCmp[NbrCmp].m_NbParts     = Entry->m_UnitCount;
            BaseListeCmp[NbrCmp].m_Unit        = DrawLibItem->m_Multi;
            BaseListeCmp[NbrCmp].m_Unit        = DrawLibItem->m_Multi;
@@ -265,8 +267,10 @@ int ListeComposants( CmpListStruct* BaseListeCmp, SCH_SCREEN* screen, int NumShe
            BaseListeCmp[NbrCmp].m_IsNew       = FALSE;
            BaseListeCmp[NbrCmp].m_IsNew       = FALSE;
            BaseListeCmp[NbrCmp].m_Pos         = DrawLibItem->m_Pos;
            BaseListeCmp[NbrCmp].m_Pos         = DrawLibItem->m_Pos;
            BaseListeCmp[NbrCmp].m_TimeStamp   = DrawLibItem->m_TimeStamp;
            BaseListeCmp[NbrCmp].m_TimeStamp   = DrawLibItem->m_TimeStamp;
            
            if( DrawLibItem->m_Field[REFERENCE].m_Text.IsEmpty() )
            if( DrawLibItem->m_Field[REFERENCE].m_Text.IsEmpty() )
                DrawLibItem->m_Field[REFERENCE].m_Text = wxT( "DefRef?" );
                DrawLibItem->m_Field[REFERENCE].m_Text = wxT( "DefRef?" );
            
            strncpy( BaseListeCmp[NbrCmp].m_TextRef,
            strncpy( BaseListeCmp[NbrCmp].m_TextRef,
                     CONV_TO_UTF8( DrawLibItem->m_Field[REFERENCE].m_Text ), 32 );
                     CONV_TO_UTF8( DrawLibItem->m_Field[REFERENCE].m_Text ), 32 );


@@ -274,6 +278,7 @@ int ListeComposants( CmpListStruct* BaseListeCmp, SCH_SCREEN* screen, int NumShe


            if( DrawLibItem->m_Field[VALUE].m_Text.IsEmpty() )
            if( DrawLibItem->m_Field[VALUE].m_Text.IsEmpty() )
                DrawLibItem->m_Field[VALUE].m_Text = wxT( "~" );
                DrawLibItem->m_Field[VALUE].m_Text = wxT( "~" );
            
            strncpy( BaseListeCmp[NbrCmp].m_TextValue,
            strncpy( BaseListeCmp[NbrCmp].m_TextValue,
                     CONV_TO_UTF8( DrawLibItem->m_Field[VALUE].m_Text ), 32 );
                     CONV_TO_UTF8( DrawLibItem->m_Field[VALUE].m_Text ), 32 );
            NbrCmp++;
            NbrCmp++;
@@ -291,8 +296,6 @@ int ListeComposants( CmpListStruct* BaseListeCmp, SCH_SCREEN* screen, int NumShe
        default:
        default:
            break;
            break;
        }
        }

        DrawList = DrawList->Pnext;
    }
    }


    return NbrCmp;
    return NbrCmp;
@@ -300,7 +303,7 @@ int ListeComposants( CmpListStruct* BaseListeCmp, SCH_SCREEN* screen, int NumShe




/*****************************************************************/
/*****************************************************************/
int AnnotTriComposant( CmpListStruct* Objet1, CmpListStruct* Objet2 )
int AnnotTriComposant( const void* o1, const void* o2 )
/****************************************************************/
/****************************************************************/


/* function used par qsort() for sorting the list
/* function used par qsort() for sorting the list
@@ -312,9 +315,11 @@ int AnnotTriComposant( CmpListStruct* Objet1, CmpListStruct* Objet2 )
 *                  if same sheet, by time stamp
 *                  if same sheet, by time stamp
 **/
 **/
{
{
    int ii;
    CmpListStruct* Objet1 = (CmpListStruct*) o1; 
    CmpListStruct* Objet2 = (CmpListStruct*) o2;

    int ii = strnicmp( Objet1->m_TextRef, Objet2->m_TextRef, 32 );
    
    
    ii = strnicmp( Objet1->m_TextRef, Objet2->m_TextRef, 32 );
    if( SortByPosition == TRUE )
    if( SortByPosition == TRUE )
    {
    {
        if( ii == 0 )
        if( ii == 0 )
@@ -401,7 +406,8 @@ void BreakReference( CmpListStruct* BaseListeCmp, int NbOfCmp )
            BaseListeCmp[ii].m_IsNew = TRUE;
            BaseListeCmp[ii].m_IsNew = TRUE;
            if( !BaseListeCmp[ii].m_PartsLocked )
            if( !BaseListeCmp[ii].m_PartsLocked )
                BaseListeCmp[ii].m_Unit = 0x7FFFFFFF;
                BaseListeCmp[ii].m_Unit = 0x7FFFFFFF;
            Text[ll] = 0; continue;
            Text[ll] = 0; 
            continue;
        }
        }


        if( isdigit( Text[ll] ) == 0 )
        if( isdigit( Text[ll] ) == 0 )
@@ -646,7 +652,8 @@ int CheckAnnotate( WinEDA_SchematicFrame* frame, bool OneSheetOnly )
    /* 2eme passe : Remplissage du tableau des caracteristiques */
    /* 2eme passe : Remplissage du tableau des caracteristiques */
    if( OneSheetOnly == 0 )
    if( OneSheetOnly == 0 )
    {
    {
        ii = 0; screen = ScreenSch;
        ii = 0; 
        screen = ScreenSch;
        for( screen = ScreenList.GetFirst(); screen != NULL; screen = ScreenList.GetNext() )
        for( screen = ScreenList.GetFirst(); screen != NULL; screen = ScreenList.GetNext() )
        {
        {
            ii += ListeComposants( ListeCmp + ii, screen, NumSheet );
            ii += ListeComposants( ListeCmp + ii, screen, NumSheet );
@@ -658,9 +665,7 @@ int CheckAnnotate( WinEDA_SchematicFrame* frame, bool OneSheetOnly )
        ListeComposants( ListeCmp, screen, NumSheet );
        ListeComposants( ListeCmp, screen, NumSheet );
    }
    }


    qsort( ListeCmp, NbOfCmp, sizeof(CmpListStruct),
    qsort( ListeCmp, NbOfCmp, sizeof(CmpListStruct), AnnotTriComposant );
           ( int( * ) ( const void*, const void* ) )AnnotTriComposant );



    /* Separation des Numeros de la reference: IC1 -> IC, et 1 dans .m_NumRef */
    /* Separation des Numeros de la reference: IC1 -> IC, et 1 dans .m_NumRef */
    BreakReference( ListeCmp, NbOfCmp );
    BreakReference( ListeCmp, NbOfCmp );
@@ -669,13 +674,16 @@ int CheckAnnotate( WinEDA_SchematicFrame* frame, bool OneSheetOnly )
    error = 0;
    error = 0;
    for( ii = 0; ii < NbOfCmp - 1; ii++ )
    for( ii = 0; ii < NbOfCmp - 1; ii++ )
    {
    {
        msg.Empty(); Buff.Empty();
        msg.Empty(); 
        Buff.Empty();
        
        if( ListeCmp[ii].m_IsNew )
        if( ListeCmp[ii].m_IsNew )
        {
        {
            if( ListeCmp[ii].m_NumRef >= 0 )
            if( ListeCmp[ii].m_NumRef >= 0 )
                Buff << ListeCmp[ii].m_NumRef;
                Buff << ListeCmp[ii].m_NumRef;
            else
            else
                Buff = wxT( "?" );
                Buff = wxT( "?" );
            
            cmpref = CONV_FROM_UTF8( ListeCmp[ii].m_TextRef );
            cmpref = CONV_FROM_UTF8( ListeCmp[ii].m_TextRef );
            msg.Printf( _( "item not annotated: %s%s" ), cmpref.GetData(), Buff.GetData() );
            msg.Printf( _( "item not annotated: %s%s" ), cmpref.GetData(), Buff.GetData() );


@@ -685,7 +693,8 @@ int CheckAnnotate( WinEDA_SchematicFrame* frame, bool OneSheetOnly )
                msg << Buff;
                msg << Buff;
            }
            }
            DisplayError( NULL, msg );
            DisplayError( NULL, msg );
            error++; break;
            error++; 
            break;
        }
        }


        if( MAX( ListeCmp[ii].m_NbParts, 1 ) < ListeCmp[ii].m_Unit  ) // Annotate error
        if( MAX( ListeCmp[ii].m_NbParts, 1 ) < ListeCmp[ii].m_Unit  ) // Annotate error
@@ -702,17 +711,20 @@ int CheckAnnotate( WinEDA_SchematicFrame* frame, bool OneSheetOnly )
                         ListeCmp[ii].m_Unit, ListeCmp[ii].m_NbParts );
                         ListeCmp[ii].m_Unit, ListeCmp[ii].m_NbParts );
            msg << Buff;
            msg << Buff;
            DisplayError( frame, msg );
            DisplayError( frame, msg );
            error++; break;
            error++; 
            break;
        }
        }
    }
    }


    if( error )
    if( error )
        return error;
        return error;


    /* comptage des elements doubls (si tous sont annots) */
    // count the duplicated elements (if all are annotated)
    for( ii = 0; (ii < NbOfCmp - 1) && (error < 4); ii++ )
    for( ii = 0; (ii < NbOfCmp - 1) && (error < 4); ii++ )
    {
    {
        msg.Empty(); Buff.Empty();
        msg.Empty(); 
        Buff.Empty();
        
        if( (stricmp( ListeCmp[ii].m_TextRef, ListeCmp[ii + 1].m_TextRef ) != 0)
        if( (stricmp( ListeCmp[ii].m_TextRef, ListeCmp[ii + 1].m_TextRef ) != 0)
           || ( ListeCmp[ii].m_NumRef != ListeCmp[ii + 1].m_NumRef ) )
           || ( ListeCmp[ii].m_NumRef != ListeCmp[ii + 1].m_NumRef ) )
            continue;
            continue;
@@ -736,7 +748,8 @@ int CheckAnnotate( WinEDA_SchematicFrame* frame, bool OneSheetOnly )
                msg << Buff;
                msg << Buff;
            }
            }
            DisplayError( frame, msg );
            DisplayError( frame, msg );
            error++; continue;
            error++; 
            continue;
        }
        }


        /* Il y a erreur si unites differentes mais nombre de parts differentes
        /* Il y a erreur si unites differentes mais nombre de parts differentes
@@ -771,9 +784,9 @@ int CheckAnnotate( WinEDA_SchematicFrame* frame, bool OneSheetOnly )
            nextcmpvalue = CONV_FROM_UTF8( ListeCmp[ii + 1].m_TextValue );
            nextcmpvalue = CONV_FROM_UTF8( ListeCmp[ii + 1].m_TextValue );
            msg.Printf( _( "Diff values for %s%d%c (%s) and %s%d%c (%s)" ),
            msg.Printf( _( "Diff values for %s%d%c (%s) and %s%d%c (%s)" ),
                       cmpref.GetData(), ListeCmp[ii].m_NumRef, ListeCmp[ii].m_Unit + 'A' - 1,
                       cmpref.GetData(), ListeCmp[ii].m_NumRef, ListeCmp[ii].m_Unit + 'A' - 1,
                       cmpvalue.GetData(),
                       cmpvalue.GetData(), nextcmpref.GetData(), 
                       nextcmpref.GetData(
                       ListeCmp[ii + 1].m_NumRef, 
                           ), ListeCmp[ii + 1].m_NumRef, ListeCmp[ii + 1].m_Unit + 'A' - 1,
                       ListeCmp[ii + 1].m_Unit + 'A' - 1,
                       nextcmpvalue.GetData() );
                       nextcmpvalue.GetData() );


            DisplayError( frame, msg );
            DisplayError( frame, msg );
+14 −14
Original line number Original line Diff line number Diff line
@@ -49,20 +49,20 @@ const wxString& ReturnDefaultFieldName( int aFieldNdx )
 *  for I18n
 *  for I18n
 */
 */
{
{
    // avoid unnecessarily copying wxStrings.
    // avoid unnecessarily copying wxStrings at runtime.
    static const wxString FieldDefaultNameList[] = {
    static const wxString FieldDefaultNameList[] = {
        _( "Ref" ),             /* Reference of part, i.e. "IC21" */
        _( "Ref" ),             /* Reference of part, i.e. "IC21" */
        _( "Value" ),           /* Value of part, i.e. "3.3K" */
        _( "Value" ),           /* Value of part, i.e. "3.3K" */
        _( "Footprint" ),       /* Footprint, used by cvpcb or pcbnew, i.e. "16DIP300" */
        _( "Footprint" ),       /* Footprint, used by cvpcb or pcbnew, i.e. "16DIP300" */
        _( "Sheet" ),           /* for components which are a schematic file, schematic file name, i.e. "cnt16.sch" */
        _( "Sheet" ),           /* for components which are a schematic file, schematic file name, i.e. "cnt16.sch" */
        _( "Field1" ),      /* User fields (1 to n) have an editable name*/
        wxString(_( "Field" ))+wxT("1"),
        _( "Field2" ),
        wxString(_( "Field" ))+wxT("2"),
        _( "Field3" ),
        wxString(_( "Field" ))+wxT("3"),
        _( "Field4" ),
        wxString(_( "Field" ))+wxT("4"),
        _( "Field5" ),
        wxString(_( "Field" ))+wxT("5"),
        _( "Field6" ),
        wxString(_( "Field" ))+wxT("6"),
        _( "Field7" ),
        wxString(_( "Field" ))+wxT("7"),
        _( "Field8" ),
        wxString(_( "Field" ))+wxT("8"),
        wxT( "badFieldNdx!" )               // error, and "sentinel" value
        wxT( "badFieldNdx!" )               // error, and "sentinel" value
    };
    };
    
    
+16 −3
Original line number Original line Diff line number Diff line
@@ -357,24 +357,30 @@ EDA_LibComponentStruct* FindLibPart( const wxChar* Name, const wxString& LibName


    PQCompFunc( (PQCompFuncType) LibraryEntryCompare );
    PQCompFunc( (PQCompFuncType) LibraryEntryCompare );


    Entry = NULL; FindLibName.Empty();
    Entry = NULL; 
    FindLibName.Empty();
    
    while( Lib )
    while( Lib )
    {
    {
        if( !LibName.IsEmpty() )
        if( !LibName.IsEmpty() )
        {
        {
            if( Lib->m_Name != LibName )
            if( Lib->m_Name != LibName )
            {
            {
                Lib = Lib->m_Pnext; continue;
                Lib = Lib->m_Pnext; 
                continue;
            }
            }
        }
        }
        
        if( Lib == NULL )
        if( Lib == NULL )
            break;
            break;
        
        Entry = (EDA_LibComponentStruct*) PQFind( Lib->m_Entries, &DummyEntry );
        Entry = (EDA_LibComponentStruct*) PQFind( Lib->m_Entries, &DummyEntry );
        if( Entry != NULL )
        if( Entry != NULL )
        {
        {
            FindLibName = Lib->m_Name;
            FindLibName = Lib->m_Name;
            break;
            break;
        }
        }
        
        Lib = Lib->m_Pnext;
        Lib = Lib->m_Pnext;
    }
    }


@@ -425,11 +431,13 @@ void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC,
        /* Elimination des elements non relatifs a l'unite */
        /* Elimination des elements non relatifs a l'unite */
        if( Multi && DEntry->m_Unit && (DEntry->m_Unit != Multi) )
        if( Multi && DEntry->m_Unit && (DEntry->m_Unit != Multi) )
            continue;
            continue;
        
        if( convert && DEntry->m_Convert && (DEntry->m_Convert != convert) )
        if( convert && DEntry->m_Convert && (DEntry->m_Convert != convert) )
            continue;
            continue;


        if( DEntry->m_Flags & IS_MOVED )
        if( DEntry->m_Flags & IS_MOVED )
            continue;                               // Element en deplacement non trace
            continue;                               // Element en deplacement non trace
        
        SetHightColor = (DEntry->m_Selected & IS_SELECTED) ? HIGHT_LIGHT_FLAG : 0;
        SetHightColor = (DEntry->m_Selected & IS_SELECTED) ? HIGHT_LIGHT_FLAG : 0;
        LineWidth = MAX( DEntry->m_Width, g_DrawMinimunLineWidth );
        LineWidth = MAX( DEntry->m_Width, g_DrawMinimunLineWidth );


@@ -494,10 +502,12 @@ void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC,
        {
        {
            LibDrawCircle* Circle = (LibDrawCircle*) DEntry;
            LibDrawCircle* Circle = (LibDrawCircle*) DEntry;
            CharColor = GETCOLOR( LAYER_DEVICE );
            CharColor = GETCOLOR( LAYER_DEVICE );
            
            x1 = Pos.x + TransMat[0][0] * Circle->m_Pos.x +
            x1 = Pos.x + TransMat[0][0] * Circle->m_Pos.x +
                 TransMat[0][1] * Circle->m_Pos.y;
                 TransMat[0][1] * Circle->m_Pos.y;
            y1 = Pos.y + TransMat[1][0] * Circle->m_Pos.x +
            y1 = Pos.y + TransMat[1][0] * Circle->m_Pos.x +
                 TransMat[1][1] * Circle->m_Pos.y;
                 TransMat[1][1] * Circle->m_Pos.y;
                 
            fill_option = Circle->m_Fill & (~g_PrintFillMask);
            fill_option = Circle->m_Fill & (~g_PrintFillMask);
            if( Color < 0 )
            if( Color < 0 )
            {
            {
@@ -526,10 +536,12 @@ void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC,
            /* The text orientation may need to be flipped if the
            /* The text orientation may need to be flipped if the
             *  transformation matrix cuases xy axes to be flipped. */
             *  transformation matrix cuases xy axes to be flipped. */
            t1 = (TransMat[0][0] != 0) ^ (Text->m_Horiz != 0);
            t1 = (TransMat[0][0] != 0) ^ (Text->m_Horiz != 0);
            
            x1 = Pos.x + TransMat[0][0] * Text->m_Pos.x
            x1 = Pos.x + TransMat[0][0] * Text->m_Pos.x
                 + TransMat[0][1] * Text->m_Pos.y;
                 + TransMat[0][1] * Text->m_Pos.y;
            y1 = Pos.y + TransMat[1][0] * Text->m_Pos.x
            y1 = Pos.y + TransMat[1][0] * Text->m_Pos.x
                 + TransMat[1][1] * Text->m_Pos.y;
                 + TransMat[1][1] * Text->m_Pos.y;
                 
            DrawGraphicText( panel, DC, wxPoint( x1, y1 ), CharColor, Text->m_Text,
            DrawGraphicText( panel, DC, wxPoint( x1, y1 ), CharColor, Text->m_Text,
                             t1 ? TEXT_ORIENT_HORIZ : TEXT_ORIENT_VERT,
                             t1 ? TEXT_ORIENT_HORIZ : TEXT_ORIENT_VERT,
                             Text->m_Size,
                             Text->m_Size,
@@ -579,6 +591,7 @@ void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC,
                   && !g_ShowAllPins )
                   && !g_ShowAllPins )
                    break;
                    break;
            }
            }
            
            /* Calcul de l'orientation reelle de la Pin */
            /* Calcul de l'orientation reelle de la Pin */
            orient = Pin->ReturnPinDrawOrient( TransMat );
            orient = Pin->ReturnPinDrawOrient( TransMat );


eeschema/fieldedi.cpp

deleted100644 → 0
+0 −1118

File deleted.

Preview size limit exceeded, changes collapsed.

+1230 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading