Commit 1a4d2389 authored by stambaughw's avatar stambaughw
Browse files

Begin translating comments to English and minor code clean up.

* Translate comments in source files beginning with A-E in eeschema.
* Spell check comments and strings and uncrusified all modified files.
parent d3468dd5
Loading
Loading
Loading
Loading
+42 −40
Original line number Diff line number Diff line
@@ -13,34 +13,35 @@

#include "general.h"

/* Variables Locales */

/*******************************************************************************************/
bool WinEDA_SchematicFrame::FillFootprintFieldForAllInstancesofComponent(
    const wxString& aReference,
    const wxString& aFootPrint,
    bool            aSetVisible )
/********************************************************************************************/

{
/** function FillFootprintFieldForAllInstancesofComponent
 * Search for component "aReference", and place a Footprint in Footprint field
 * @param aReference = reference of the component to initialise
 * @param aReference = reference of the component to initialize
 * @param aFootPrint = new value for the filed Fottprint component
 * @param aSetVisible = true to have the field visible, false to set the invisible flag
 * @param aSetVisible = true to have the field visible, false to set the
 * invisible flag
 * @return true if the given component is found
 * Note:
 * the component is searched in the whole schematic, and because some components
 * the component is searched in the whole schematic, and because some
 * components
 * have more than one instance (multiple parts per package components)
 * the search is not stopped when a reference is found (all instances must be found).
 * the search is not stopped when a reference is found (all instances must be
 * found).
 */
{
    DrawSheetPath* sheet;
    SCH_ITEM*      DrawList = NULL;
    EDA_SheetList  SheetList;
    SCH_COMPONENT* Cmp;
    bool           found = false;

    for( sheet = SheetList.GetFirst(); sheet != NULL; sheet = SheetList.GetNext() )
    for( sheet = SheetList.GetFirst();
        sheet != NULL;
        sheet = SheetList.GetNext() )
    {
        DrawList = (SCH_ITEM*) sheet->LastDrawList();
        for( ; (DrawList != NULL); DrawList = DrawList->Next() )
@@ -52,19 +53,24 @@ bool WinEDA_SchematicFrame::FillFootprintFieldForAllInstancesofComponent(
            if( aReference.CmpNoCase( Cmp->GetRef( sheet ) ) == 0 )
            {
                // Found: Init Footprint Field
                 /* Give a reasonnable value to the fied position and orientation, if
                  * the text is empty at position 0, because it is probably not yet initialised

                /* Give a reasonable value to the field position and
                 * orientation, if the text is empty at position 0, because
                 * it is probably not yet initialized
                 */
                if( Cmp->GetField( FOOTPRINT )->m_Text.IsEmpty()
                   && ( Cmp->GetField( FOOTPRINT )->m_Pos == wxPoint( 0, 0 ) ) )
                {
                    Cmp->GetField(FOOTPRINT)->m_Orient = Cmp->GetField(VALUE)->m_Orient;
                    Cmp->GetField(FOOTPRINT)->m_Pos    = Cmp->GetField(VALUE)->m_Pos;
                    Cmp->GetField( FOOTPRINT )->m_Orient = Cmp->GetField(
                        VALUE )->m_Orient;
                    Cmp->GetField( FOOTPRINT )->m_Pos    = Cmp->GetField(
                        VALUE )->m_Pos;
                    Cmp->GetField( FOOTPRINT )->m_Pos.y -= 100;
                }
                Cmp->GetField( FOOTPRINT )->m_Text = aFootPrint;
                if( aSetVisible )
                    Cmp->GetField(FOOTPRINT)->m_Attributs &= ~TEXT_NO_VISIBLE;
                    Cmp->GetField( FOOTPRINT )->m_Attributs &=
                        ~TEXT_NO_VISIBLE;
                else
                    Cmp->GetField( FOOTPRINT )->m_Attributs |= TEXT_NO_VISIBLE;
                found = true;
@@ -76,11 +82,9 @@ bool WinEDA_SchematicFrame::FillFootprintFieldForAllInstancesofComponent(
}


/***************************************************************************/
bool WinEDA_SchematicFrame::ProcessStuffFile( FILE* aStuffFile, bool
                                              aSetFielsAttributeToVisible  )
/***************************************************************************/

{
/** Function ProcessStuffFile
 * Read a "stuff" file created by cvpcb.
 * That file has lines like:
@@ -91,10 +95,10 @@ bool WinEDA_SchematicFrame::ProcessStuffFile( FILE* aStuffFile, bool
 * "module =" gives the footprint name
 *
 * @param aStuffFile = file (*.stf) to Read.
 * @param aSetFielsAttributeToVisible = true to set the footprint field flag to visible
 * @return true if ok.
 * @param aSetFielsAttributeToVisible = true to set the footprint field flag to
 * visible
 * @return true if OK.
 */
{
    int   LineNum = 0;
    char* cp, Ref[256], FootPrint[256], Line[1024];

@@ -112,7 +116,8 @@ bool WinEDA_SchematicFrame::ProcessStuffFile( FILE* aStuffFile, bool

            wxString reference = CONV_FROM_UTF8( Ref );
            wxString Footprint = CONV_FROM_UTF8( FootPrint );
            FillFootprintFieldForAllInstancesofComponent( reference,
            FillFootprintFieldForAllInstancesofComponent(
                reference,
                Footprint,
                aSetFielsAttributeToVisible );
        }
@@ -122,23 +127,20 @@ bool WinEDA_SchematicFrame::ProcessStuffFile( FILE* aStuffFile, bool
}


/**************************************************************/
bool WinEDA_SchematicFrame::ReadInputStuffFile()
/**************************************************************/

{
/* Backann footprint info to schematic.
 */
{
    wxString Line, filename;
    FILE*    StuffFile;
    wxString msg;
    bool     SetFieldToVisible = true;

    filename = EDA_FileSelector( _( "Load Stuff File" ),
                                 wxEmptyString,             /* Chemin par defaut */
                                 wxEmptyString,             /* nom fichier par defaut */
                                 wxT( ".stf" ),             /* extension par defaut */
                                 wxT( "*.stf" ),            /* Masque d'affichage */
                                 wxEmptyString,
                                 wxEmptyString,
                                 wxT( ".stf" ),
                                 wxT( "*.stf" ),
                                 this,
                                 wxFD_OPEN,
                                 FALSE
+141 −121

File changed.

Preview size limit exceeded, changes collapsed.

+7 −8

File changed.

Preview size limit exceeded, changes collapsed.

+111 −98

File changed.

Preview size limit exceeded, changes collapsed.

+118 −119

File changed.

Preview size limit exceeded, changes collapsed.

Loading