Commit 1a4d2389 authored by stambaughw's avatar stambaughw

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
......@@ -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,21 +53,26 @@ 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 ) ) )
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_Pos.y -= 100;
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;
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;
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
......@@ -156,7 +158,7 @@ bool WinEDA_SchematicFrame::ReadInputStuffFile()
int diag = wxMessageBox(
_( "Set the Footprint Field to Visible ?" ),
_ ("Field Display Option"),
_( "Field Display Option" ),
wxYES_NO | wxICON_QUESTION | wxCANCEL, this );
if( diag == wxCANCEL )
......
This diff is collapsed.
/****************************************************/
/* block_libedit.cpp */
/* Gestion des Operations sur Blocks et Effacements */
/****************************************************/
#include "fctsys.h"
......@@ -191,10 +190,10 @@ int WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC )
/*
* Routine to handle the BLOCK PLACE commande
* Routine to handle the BLOCK PLACE command
* Last routine for block operation for:
* - block move & drag
* - block copie & paste
* - block copy & paste
*/
void WinEDA_LibeditFrame::HandleBlockPlace( wxDC* DC )
{
......@@ -238,7 +237,7 @@ void WinEDA_LibeditFrame::HandleBlockPlace( wxDC* DC )
m_component->CopySelectedItems( pt );
break;
case BLOCK_PASTE: /* Paste (recopie du dernier bloc sauve */
case BLOCK_PASTE: /* Paste (recopy the last block saved) */
GetScreen()->m_BlockLocate.ClearItemsList();
break;
......@@ -276,8 +275,8 @@ void WinEDA_LibeditFrame::HandleBlockPlace( wxDC* DC )
/*
* Retrace le contour du block de recherche de structures
* L'ensemble du block suit le curseur
* Traces the outline of the search block structures
* The entire block follows the cursor
*/
void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
{
......@@ -307,7 +306,7 @@ void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
true, true, true );
}
/* Redessin nouvel affichage */
/* Repaint new view */
PtBlock->m_MoveVector.x =
screen->m_Curseur.x - PtBlock->m_BlockLastCursorPosition.x;
PtBlock->m_MoveVector.y =
......
This diff is collapsed.
This diff is collapsed.
/*************************************/
/* Modules de creations de Bus Entry */
/*************************************/
/*****************************************************/
/* Code to handle manipulation on bus entry objects. */
/*****************************************************/
#include "fctsys.h"
#include "gr_basic.h"
......@@ -13,21 +13,18 @@
#include "general.h"
#include "protos.h"
/* Routines Locales */
/* Variables locales */
static int s_LastShape = '\\';
static wxPoint ItemInitialPosition;
/**************************************************************/
static void ExitBusEntry( WinEDA_DrawPanel* Panel, wxDC* DC )
/**************************************************************/
/* Routine de sortie des menus de trace */
{
/**************************************************************/
/* Exit bus entry mode. */
DrawBusEntryStruct* BusEntry =
(DrawBusEntryStruct*) Panel->GetScreen()->GetCurItem();
if( BusEntry ) /* trace en cours */
if( BusEntry )
{
RedrawOneStruct( Panel, DC, BusEntry, g_XorMode );
if( BusEntry->m_Flags & IS_NEW )
......@@ -51,36 +48,36 @@ static void ExitBusEntry( WinEDA_DrawPanel* Panel, wxDC* DC )
/************************************************************************/
static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
/************************************************************************/
/* Dessin du Segment "BusEntry" lors des deplacements du curseur
*/
{
/************************************************************************/
/* Drawing of the bus entry segment" while moving the cursor. */
BASE_SCREEN* screen = panel->GetScreen();
DrawBusEntryStruct* BusEntry = (DrawBusEntryStruct*) screen->GetCurItem();
if( BusEntry == NULL )
return;
/* effacement apres deplacement curseur */
/* Erase the last segment position. */
if( erase )
RedrawOneStruct( panel, DC, BusEntry, g_XorMode );
/* Reaffichage au bon endroit */
/* Redraw at the new position. */
BusEntry->m_Pos = screen->m_Curseur;
RedrawOneStruct( panel, DC, BusEntry, g_XorMode );
}
/**********************************************************************************/
DrawBusEntryStruct* WinEDA_SchematicFrame::CreateBusEntry( wxDC* DC, int entry_type )
DrawBusEntryStruct* WinEDA_SchematicFrame::CreateBusEntry( wxDC* DC,
int entry_type )
{
/**********************************************************************************/
/* Create a new bus entry, and prepare moving function (for later place it)
*/
{
DrawBusEntryStruct* BusEntry = new DrawBusEntryStruct( GetScreen()->m_Curseur,
s_LastShape, entry_type );
DrawBusEntryStruct* BusEntry = new DrawBusEntryStruct(
GetScreen()->m_Curseur,
s_LastShape,
entry_type );
BusEntry->m_Flags = IS_NEW;
......@@ -98,12 +95,13 @@ DrawBusEntryStruct* WinEDA_SchematicFrame::CreateBusEntry( wxDC* DC, int entry_t
/**************************************************************************/
void WinEDA_SchematicFrame::StartMoveBusEntry( DrawBusEntryStruct* BusEntry,
wxDC* DC )
/**************************************************************************/
{
/**************************************************************************/
if( BusEntry == NULL )
return;
if( (BusEntry->m_Flags & IS_NEW) == 0 ) // => not already in edit, save shape */
if( (BusEntry->m_Flags & IS_NEW) == 0 ) // => not already in edit, save
// shape */
{
delete g_ItemToUndoCopy;
g_ItemToUndoCopy = BusEntry->GenCopy();
......@@ -127,12 +125,12 @@ void WinEDA_SchematicFrame::StartMoveBusEntry( DrawBusEntryStruct* BusEntry,
/************************************************************/
void WinEDA_SchematicFrame::SetBusEntryShape( wxDC* DC,
DrawBusEntryStruct* BusEntry, int entry_shape )
DrawBusEntryStruct* BusEntry,
int entry_shape )
{
/************************************************************/
/* set the shape of BusEntry (shape = / or \ )
*/
{
if( BusEntry == NULL )
return;
......@@ -169,8 +167,8 @@ void WinEDA_SchematicFrame::SetBusEntryShape( wxDC* DC,
/************************************************************************/
int WinEDA_SchematicFrame::GetBusEntryShape( DrawBusEntryStruct* BusEntry )
/************************************************************************/
{
/************************************************************************/
int entry_shape = '\\';
if( BusEntry->m_Size.y < 0 )
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -8,7 +8,7 @@
// Created: 08/02/2006 18:37:02
// RCS-ID:
// Copyright: License GNU
// Licence:
// License:
/////////////////////////////////////////////////////////////////////////////
#include "fctsys.h"
......@@ -23,13 +23,14 @@
/*******************************************************************/
Hierarchical_PIN_Sheet_Struct::Hierarchical_PIN_Sheet_Struct( DrawSheetStruct* parent,
Hierarchical_PIN_Sheet_Struct::Hierarchical_PIN_Sheet_Struct(
DrawSheetStruct* parent,
const wxPoint& pos,
const wxString& text ) :
SCH_ITEM( parent, DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE ),
EDA_TextStruct( text )
/*******************************************************************/
{
/*******************************************************************/
wxASSERT( parent );
wxASSERT( Pnext == NULL );
m_Layer = LAYER_SHEETLABEL;
......@@ -43,10 +44,11 @@ Hierarchical_PIN_Sheet_Struct::Hierarchical_PIN_Sheet_Struct( DrawSheetStruct* p
/***********************************************************/
Hierarchical_PIN_Sheet_Struct* Hierarchical_PIN_Sheet_Struct::GenCopy()
/***********************************************************/
{
/***********************************************************/
Hierarchical_PIN_Sheet_Struct* newitem =
new Hierarchical_PIN_Sheet_Struct( (DrawSheetStruct*) m_Parent, m_Pos, m_Text );
new Hierarchical_PIN_Sheet_Struct( (DrawSheetStruct*) m_Parent, m_Pos,
m_Text );
newitem->m_Edge = m_Edge;
newitem->m_Shape = m_Shape;
......@@ -59,25 +61,28 @@ Hierarchical_PIN_Sheet_Struct* Hierarchical_PIN_Sheet_Struct::GenCopy()
/** Function GetPenSize
* @return the size of the "pen" that be used to draw or plot this item
*/
int Hierarchical_PIN_Sheet_Struct::GetPenSize( )
int Hierarchical_PIN_Sheet_Struct::GetPenSize()
{
return g_DrawDefaultLineThickness;
}
/********************************************************************************************/
void Hierarchical_PIN_Sheet_Struct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
int DrawMode, int Color )
/********************************************************************************************/
/* Routine de dessin des Labels type hierarchie */
/*****************************************************************************/
void Hierarchical_PIN_Sheet_Struct::Draw( WinEDA_DrawPanel* panel,
wxDC* DC,
const wxPoint& offset,
int DrawMode,
int Color )
{
/*****************************************************************************/
/* Routine to create hierarchical labels */
GRTextHorizJustifyType side;
EDA_Colors txtcolor;
int posx, tposx, posy;
static std::vector <wxPoint> Poly;
int LineWidth = GetPenSize( );
int LineWidth = GetPenSize();
if( Color >= 0 )
txtcolor = (EDA_Colors) Color;
......@@ -102,15 +107,15 @@ void Hierarchical_PIN_Sheet_Struct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, con
side = GR_TEXT_HJUSTIFY_LEFT;
}
DrawGraphicText( panel, DC, wxPoint( tposx, posy ), txtcolor,
m_Text, TEXT_ORIENT_HORIZ, size,
side, GR_TEXT_VJUSTIFY_CENTER, LineWidth, false, false );
m_Text, TEXT_ORIENT_HORIZ, size, side,
GR_TEXT_VJUSTIFY_CENTER, LineWidth, false, false );
}
/* Draw the graphic symbol */
CreateGraphicShape( Poly, m_Pos + offset );
int FillShape = false;
GRPoly( &panel->m_ClipBox, DC, Poly.size(), &Poly[0],
FillShape, LineWidth, txtcolor, txtcolor ); /* Poly Non rempli */
FillShape, LineWidth, txtcolor, txtcolor );
}
......@@ -119,7 +124,8 @@ void Hierarchical_PIN_Sheet_Struct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, con
* @param aCorner_list = list to fill with polygon corners coordinates
* @param Pos = Position of the shape
*/
void Hierarchical_PIN_Sheet_Struct::CreateGraphicShape( std::vector <wxPoint>& aCorner_list,
void Hierarchical_PIN_Sheet_Struct::CreateGraphicShape(
std::vector <wxPoint>& aCorner_list,
const wxPoint& Pos )
{
wxSize size = m_Size;
......@@ -206,8 +212,7 @@ bool Hierarchical_PIN_Sheet_Struct::Save( FILE* aFile ) const
}
if( fprintf( aFile, "F%d \"%s\" %c %c %-3d %-3d %-3d\n", m_Number,
CONV_TO_UTF8( m_Text ), type, side,
m_Pos.x, m_Pos.y,
CONV_TO_UTF8( m_Text ), type, side, m_Pos.x, m_Pos.y,
m_Size.x ) == EOF )
{
return false;
......@@ -224,9 +229,8 @@ void Hierarchical_PIN_Sheet_Struct::Show( int nestLevel, std::ostream& os )
wxString s = GetClass();
NestedSpace( nestLevel, os ) << '<' << s.Lower().mb_str() << ">"
<< " pin_name=\"" << CONV_TO_UTF8( m_Text ) << '"'
<< "/>\n"
<< std::flush;
<< " pin_name=\"" << CONV_TO_UTF8( m_Text )
<< '"' << "/>\n" << std::flush;
// NestedSpace( nestLevel, os ) << "</" << s.Lower().mb_str() << ">\n";
}
......
......@@ -393,7 +393,6 @@ bool LIB_FIELD::HitTest( wxPoint aPosRef, int aThreshold,
return hit;
}
// Creation et Duplication d'un field
LIB_DRAW_ITEM* LIB_FIELD::DoGenCopy()
{
LIB_FIELD* newfield = new LIB_FIELD( m_FieldId );
......
......@@ -76,7 +76,7 @@ bool operator<( const CMP_LIBRARY& item1, const CMP_LIBRARY& item2 )
CMP_LIBRARY::CMP_LIBRARY( int type, const wxFileName& fileName )
{
m_Type = type; /* type indicator */
m_IsModified = false; /* flag indicateur d'edition */
m_IsModified = false; /* modified indicator */
m_TimeStamp = 0;
m_Flags = 0;
m_IsCache = false;
......@@ -505,7 +505,7 @@ bool CMP_LIBRARY::Load( wxString& errMsg )
* apparently started with EESchema-LIB. Sometime after 2.0, it
* was changed to EESchema-LIBRARY. Therefore, the test for
* EESchema-LIB will work in both cases. Don't change this unless
* backwards compatability is no longer required.
* backwards compatibility is no longer required.
*/
if( !tkn.HasMoreTokens()
|| !tkn.GetNextToken().Upper().StartsWith(wxT( "EESCHEMA-LIB" ) ) )
......@@ -559,7 +559,7 @@ the current schematic." ),
{
if( !LoadHeader( f, &LineNum ) )
{
errMsg = _( "An error occured attempting to read the header." );
errMsg = _( "An error occurred attempting to read the header." );
return false;
}
......@@ -659,14 +659,14 @@ bool CMP_LIBRARY::LoadDocs( wxString& errMsg )
if( f == NULL )
{
errMsg.Printf( _( "Could not open component document libray file <%s>." ),
errMsg.Printf( _( "Could not open component document library file <%s>." ),
GetChars( fn.GetFullPath() ) );
return false;
}
if( GetLine( f, Line, &LineNum, sizeof(Line) ) == NULL )
{
errMsg.Printf( _( "Component document libray file <%s> is empty." ),
errMsg.Printf( _( "Component document library file <%s> is empty." ),
GetChars( fn.GetFullPath() ) );
fclose( f );
return false;
......@@ -765,7 +765,6 @@ bool CMP_LIBRARY::Save( const wxString& FullFileName, bool oldDocFormat )
m_IsModified = false;
/* Creation de l'entete de la librairie */
m_TimeStamp = GetTimeStamp();
if( !SaveHeader( libfile ) )
{
......
......@@ -89,8 +89,7 @@ public:
* @param oldDocFormat - Save the document information in a separate
* file if true. The default is to save as the
* current library file format.
*
* @return bool - true if success writing else false.
* @return True if success writing else false.
*/
bool Save( const wxString& aFullFileName, bool oldDocFormat = false );
......@@ -101,8 +100,7 @@ public:
* file *.bck.
*
* @param aFullFileName - The library filename with path.
*
* @return bool - true if success writing else false.
* @return True if success writing else false.
*/
bool SaveDocFile( const wxString& FullFileName );
......@@ -110,8 +108,7 @@ public:
* Load library from file.
*
* @param errMsg - Error message if load fails.
*
* @return bool - True if load was successful otherwise false.
* @return True if load was successful otherwise false.
*/
bool Load( wxString& errMsg );
......@@ -129,7 +126,7 @@ public:
/**
* Get library entry status.
*
* @return true if there are no entries in the library.
* @return True if there are no entries in the library.
*/
bool IsEmpty() const
{
......@@ -151,16 +148,12 @@ public:
return m_IsModified;
}
bool IsCache() const { return m_IsCache; }
void SetModified( void ) { m_IsModified = true; }
void SetCache( void ) { m_IsCache = true; }
/**
* Load a string array with the names of all the entries in this library.
*
......@@ -202,7 +195,6 @@ public:
* Find entry by name.
*
* @param name - Name of entry, case insensitive.
*
* @return Pointer to entry if found. NULL if not found.
*/
CMP_LIB_ENTRY* FindEntry( const wxChar* name );
......@@ -212,7 +204,6 @@ public:
*
* @param name - Name of entry, case insensitive.
* @param type - Type of entry, root or alias.
*
* @return Pointer to entry if found. NULL if not found.
*/
CMP_LIB_ENTRY* FindEntry( const wxChar* name, LibrEntryType type );
......@@ -226,7 +217,6 @@ public:
* @param name - Name of component, case insensitive.
* @param searchAliases - Searches for component by alias name as well as
* component name if true.
*
* @return Pointer to component if found. NULL if not found.
*/
LIB_COMPONENT* FindComponent( const wxChar* name );
......@@ -238,7 +228,6 @@ public:
* a LIB_ALIAS pointer is not required.
*
* @param name - Name of alias, case insensitive.
*
* @return Pointer to alias if found. NULL if not found.
*/
LIB_ALIAS* FindAlias( const wxChar* name )
......@@ -256,9 +245,7 @@ public:
* remove the alias from the library.
*
* @param alias - Alias to add to library.
*
* @return bool - True if alias added to library. False if conflict
* exists.
* @return True if alias added to library. False if conflict exists.
*/
bool AddAlias( LIB_ALIAS* alias );
......@@ -266,7 +253,6 @@ public:
* Add component entry to library.
*
* @param cmp - Component to add.
*
* @return Pointer to added component if successful.
*/
LIB_COMPONENT* AddComponent( LIB_COMPONENT* cmp );
......@@ -311,9 +297,7 @@ public:
* entry in the list is returned.
*
* @param name - Name of current entry.
*
* @return CMP_LIB_ENTRY - Pointer to next entry if entry name is found.
* Otherwise NULL.
* @return Pointer to next entry if entry name is found. Otherwise NULL.
*/
CMP_LIB_ENTRY* GetNextEntry( const wxChar* name );
......@@ -325,23 +309,21 @@ public:
* entry in the list is returned.
*
* @param name - Name of current entry.
*
* @return CMP_LIB_ENTRY - Pointer to previous entry if entry name is found.
* Otherwise NULL.
* @return Previous entry if entry name is found, otherwise NULL.
*/
CMP_LIB_ENTRY* GetPreviousEntry( const wxChar* name );
/**
* Return the file name without path or extension.
*
* @return wxString - Name of library file.
* @return Name of library file.
*/
wxString GetName() const { return m_fileName.GetName(); }
/**
* Return the full file library name with path and extension.
*
* @return wxString - Full library file name with path and extension.
* @return Full library file name with path and extension.
*/
wxString GetFullFileName() { return m_fileName.GetFullPath(); }
......@@ -368,9 +350,8 @@ public:
*
* @param fileName - File name of the component library to load.
* @param errMsg - Error message if the component library failed to load.
*
* @return Pointer to library object if library file loaded successfully.
* Otherwise NULL.
* @return Library object if library file loaded successfully,
* otherwise NULL.
*/
static CMP_LIBRARY* LoadLibrary( const wxFileName& fileName,
wxString& errMsg );
......@@ -380,8 +361,7 @@ public:
*
* @param fileName - File name object of component library.
* @param errMsg - Error message if the component library failed to load.
*
* @return bool - True if library loaded properly otherwise false.
* @return True if library loaded properly otherwise false.
*/
static bool AddLibrary( const wxFileName& fileName, wxString& errMsg );
......@@ -391,8 +371,7 @@ public:
* @param fileName - File name object of component library.
* @param errMsg - Error message if the component library failed to load.
* @param i - Iterator to insert library in front of.
*
* @return bool - True if library loaded properly otherwise false.
* @return True if library loaded properly otherwise false.
*/
static bool AddLibrary( const wxFileName& fileName, wxString& errMsg,
CMP_LIBRARY_LIST::iterator& i );
......@@ -408,9 +387,7 @@ public:
* Find component library by name.
*
* @param name - Library file name without path or extension to find.
*
* @return CMP_LIBRARY* - Pointer to component library if found,
* otherwise NULL.
* @return Pointer to component library if found, otherwise NULL.
*/
static CMP_LIBRARY* FindLibrary( const wxString& name );
......@@ -419,8 +396,7 @@ public:
*
* @param sorted - Sort the list of name if true. Otherwise use the
* library load order.
*
* @return wxArrayString - The list of library names.
* @return The list of library names.
*/
static wxArrayString GetLibraryNames( bool sorted = true );
......@@ -432,8 +408,7 @@ public:
*
* @param name - Name of component to search for.
* @param libNaem - Name of the library to search for component.
*
* @return Pointer to a valid component object if found. Otherwise NULL.
* @return The component object if found, otherwise NULL.
*/
static LIB_COMPONENT* FindLibraryComponent(
const wxString& name, const wxString& libName = wxEmptyString );
......@@ -445,8 +420,7 @@ public:
*
* @param name - Name of component to search for.
* @param libNaem - Name of the library to search for entry.
*
* @return Pointer to a valid entry object if found. Otherwise NULL.
* @return The entry object if found, otherwise NULL.
*/
static CMP_LIB_ENTRY* FindLibraryEntry(
const wxString& name,
......
......@@ -66,9 +66,7 @@ int SCH_CMP_FIELD::GetPenSize()
/**
* Routine de trace des textes type Field du composant.
* entree:
* DrawMode: mode de trace
* Draw schematic component fields.
*/
void SCH_CMP_FIELD::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
const wxPoint& offset, int DrawMode, int Color )
......@@ -98,7 +96,7 @@ void SCH_CMP_FIELD::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
/* Calculate the text orientation, according to the component orientation/mirror */
orient = m_Orient;
if( parentComponent->m_Transform[0][1] ) // Rotation du composant de 90deg
if( parentComponent->m_Transform[0][1] ) // Rotate component 90 degrees.
{
if( orient == TEXT_ORIENT_HORIZ )
orient = TEXT_ORIENT_VERT;
......
/***********************************************************************/
/* Methodes de base de gestion des classes des elements de schematique */
/***********************************************************************/
/*****************************/
/* class_schematic_items.cpp */
/*****************************/
#include "fctsys.h"
#include "gr_basic.h"
......@@ -60,7 +60,7 @@ DrawBusEntryStruct* DrawBusEntryStruct::GenCopy()
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* writes the data structures for this object out to a FILE in "*.sch" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
......@@ -162,7 +162,7 @@ DrawJunctionStruct* DrawJunctionStruct::GenCopy()
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* writes the data structures for this object out to a FILE in "*.sch" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
......@@ -231,7 +231,8 @@ void DrawJunctionStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
GRSetDrawMode( DC, DrawMode );
GRFilledCircle( &panel->m_ClipBox, DC, m_Pos.x + offset.x,
m_Pos.y + offset.y, (DRAWJUNCTION_DIAMETER/2), 0, color, color );
m_Pos.y + offset.y, (DRAWJUNCTION_DIAMETER/2), 0, color,
color );
}
......@@ -301,7 +302,7 @@ bool DrawNoConnectStruct::HitTest( const wxPoint& aPosRef )
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* writes the data structures for this object out to a FILE in "*.sch" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
......@@ -364,7 +365,7 @@ EDA_DrawLineStruct::EDA_DrawLineStruct( const wxPoint& pos, int layer ) :
switch( layer )
{
default:
m_Layer = LAYER_NOTES; /* Mettre ds Notes */
m_Layer = LAYER_NOTES;
break;
case LAYER_WIRE:
......@@ -443,7 +444,7 @@ EDA_Rect EDA_DrawLineStruct::GetBoundingBox()
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* writes the data structures for this object out to a FILE in "*.sch" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
......@@ -559,7 +560,7 @@ DrawPolylineStruct* DrawPolylineStruct::GenCopy()
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* writes the data structures for this object out to a FILE in "*.sch" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
......
......@@ -5,17 +5,18 @@
#ifndef CLASS_SCHEMATIC_ITEMS_H
#define CLASS_SCHEMATIC_ITEMS_H
#define DRAWJUNCTION_DIAMETER 32 /* Size (diameter) of junctions between wires */
#define DRAWNOCONNECT_SIZE 48 /* Rayon du symbole No Connexion */
#define DRAWJUNCTION_DIAMETER 32 /* Diameter of junction symbol between
* wires */
#define DRAWNOCONNECT_SIZE 48 /* No symbol connection range. */
/* flags pour BUS ENTRY (bus to bus ou wire to bus */
/* Flags for BUS ENTRY (bus to bus or wire to bus */
#define WIRE_TO_BUS 0
#define BUS_TO_BUS 1
/**
* Class EDA_DrawLineStruct
* is a segment decription base class to describe items which have 2 end
* is a segment description base class to describe items which have 2 end
* points (track, wire, draw line ...)
*/
class EDA_DrawLineStruct : public SCH_ITEM
......@@ -26,7 +27,7 @@ public:
wxPoint m_End; // Line end point
bool m_StartIsDangling;
bool m_EndIsDangling; // TRUE si Start ou End not connected (wires, tracks...)
bool m_EndIsDangling; // TRUE if not connected (wires, tracks...)
public:
EDA_DrawLineStruct( const wxPoint& pos, int layer );
......@@ -57,7 +58,7 @@ public:
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd"
* writes the data structures for this object out to a FILE in "*.sch"
* format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
......@@ -72,7 +73,7 @@ public:
// Geometric transforms (used in block operations):
/** virtual function Move
* move item to a new position.
* @param aMoveVector = the deplacement vector
* @param aMoveVector = the displacement vector
*/
virtual void Move(const wxPoint& aMoveVector)
{
......@@ -102,7 +103,7 @@ public:
};
class DrawNoConnectStruct : public SCH_ITEM /* Symboles de non connexion */
class DrawNoConnectStruct : public SCH_ITEM
{
public:
wxPoint m_Pos; /* XY coordinates of NoConnect. */
......@@ -129,7 +130,7 @@ public:
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd"
* writes the data structures for this object out to a FILE in "*.sch"
* format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
......@@ -146,7 +147,7 @@ public:
// Geometric transforms (used in block operations):
/** virtual function Move
* move item to a new position.
* @param aMoveVector = the deplacement vector
* @param aMoveVector = the displacement vector
*/
virtual void Move(const wxPoint& aMoveVector)
{
......@@ -168,7 +169,8 @@ public:
/**
* Class DrawBusEntryStruct
* Struct de descr 1 raccord a 45 degres de BUS ou WIRE
*
* Defines a bus or wire entry.
*/
class DrawBusEntryStruct : public SCH_ITEM
{
......@@ -188,14 +190,14 @@ public:
DrawBusEntryStruct* GenCopy();
wxPoint m_End() const; // retourne la coord de fin du raccord
wxPoint m_End() const;
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC,
const wxPoint& offset, int draw_mode,
int Color = -1 );
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd"
* writes the data structures for this object out to a FILE in "*.sch"
* format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
......@@ -212,7 +214,7 @@ public:
// Geometric transforms (used in block operations):
/** virtual function Move
* move item to a new position.
* @param aMoveVector = the deplacement vector
* @param aMoveVector = the displacement vector
*/
virtual void Move(const wxPoint& aMoveVector)
{
......@@ -232,10 +234,10 @@ public:
}
};
class DrawPolylineStruct : public SCH_ITEM /* Polyligne (serie de segments) */
class DrawPolylineStruct : public SCH_ITEM
{
public:
int m_Width; /* Tickness */
int m_Width; /* Thickness */
std::vector<wxPoint> m_PolyPoints; // list of points (>= 2)
public:
......@@ -255,7 +257,7 @@ public:
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd"
* writes the data structures for this object out to a FILE in "*.sch"
* format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
......@@ -284,7 +286,7 @@ public:
// Geometric transforms (used in block operations):
/** virtual function Move
* move item to a new position.
* @param aMoveVector = the deplacement vector
* @param aMoveVector = the displacement vector
*/
virtual void Move(const wxPoint& aMoveVector)
{
......@@ -342,7 +344,8 @@ public:
int Color = -1 );
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* writes the data structures for this object out to a FILE in "*.sch"
* format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
......@@ -351,7 +354,7 @@ public:
// Geometric transforms (used in block operations):
/** virtual function Move
* move item to a new position.
* @param aMoveVector = the deplacement vector
* @param aMoveVector = the displacement vector
*/
virtual void Move(const wxPoint& aMoveVector)
{
......
This diff is collapsed.
This diff is collapsed.
/*********************************/
/* Module de nettoyage du schema */
/*********************************/
/**************************************/
/* Code to handle schematic clean up. */
/**************************************/
#include "fctsys.h"
#include "appl_wxstruct.h"
......@@ -15,21 +15,18 @@
#include "netlist.h"
/* Routines locales */
static int TstAlignSegment( EDA_DrawLineStruct* RefSegm, EDA_DrawLineStruct* TstSegm );
/* Variable locales */
static int TstAlignSegment( EDA_DrawLineStruct* RefSegm,
EDA_DrawLineStruct* TstSegm );
/*******************************************/
bool SCH_SCREEN::SchematicCleanUp( wxDC* DC )
{
/*******************************************/
/* Routine de nettoyage:
* - regroupe les segments de fils (ou de bus) alignes en 1 seul segment
* - Detecte les objets identiques superposes
/* Routine cleaning:
* - Includes segments or buses aligned in only 1 segment
* - Detects identical objects superimposed
*/
{
SCH_ITEM* DrawList, * TstDrawList;
int flag;
bool Modify = FALSE;
......@@ -50,9 +47,10 @@ bool SCH_SCREEN::SchematicCleanUp( wxDC* DC )
{
flag = TstAlignSegment( (EDA_DrawLineStruct*) DrawList,
(EDA_DrawLineStruct*) TstDrawList );
if( flag ) /* Suppression de TstSegm */
if( flag )
{
/* keep the bits set in .m_Flags, because the deleted segment can be flagged */
/* keep the bits set in .m_Flags, because the deleted
* segment can be flagged */
DrawList->m_Flags |= TstDrawList->m_Flags;
EraseStruct( TstDrawList, this );
SetRefreshReq();
......@@ -75,12 +73,10 @@ bool SCH_SCREEN::SchematicCleanUp( wxDC* DC )
/***********************************************/
void BreakSegmentOnJunction( SCH_SCREEN* Screen )
{
/************************************************/
/* Routine creant des debuts / fin de segment (BUS ou WIRES) sur les jonctions
* et les raccords
/* Routine to start/end segment (BUS or wires) on junctions.
*/
{
SCH_ITEM* DrawList;
if( Screen == NULL )
......@@ -134,10 +130,12 @@ void BreakSegmentOnJunction( SCH_SCREEN* Screen )
* ( excluding ends)
* fill aPicklist with modified items if non null
*/
void BreakSegment(SCH_SCREEN * aScreen, wxPoint aBreakpoint )
void BreakSegment( SCH_SCREEN* aScreen, wxPoint aBreakpoint )
{
EDA_DrawLineStruct* segment, * NewSegment;
for( SCH_ITEM* DrawList = aScreen->EEDrawList;DrawList; DrawList = DrawList->Next() )
for( SCH_ITEM* DrawList = aScreen->EEDrawList; DrawList;
DrawList = DrawList->Next() )
{
if( DrawList->Type() != DRAW_SEGMENT_STRUCT_TYPE )
continue;
......@@ -147,11 +145,13 @@ void BreakSegment(SCH_SCREEN * aScreen, wxPoint aBreakpoint )
if( !TestSegmentHit( aBreakpoint, segment->m_Start, segment->m_End, 0 ) )
continue;
/* Segment connecte: doit etre coupe en 2 si px,py n'est
/* * JP translate * Segment connecte: doit etre coupe en 2 si px,py
* n'est
* pas une extremite */
if( (segment->m_Start == aBreakpoint) || (segment->m_End == aBreakpoint ) )
if( ( segment->m_Start == aBreakpoint )
|| ( segment->m_End == aBreakpoint ) )
continue;
/* Ici il faut couper le segment en 2 */
/* Here we must cut the segment into 2. */
NewSegment = segment->GenCopy();
NewSegment->m_Start = aBreakpoint;
segment->m_End = NewSegment->m_Start;
......@@ -165,35 +165,36 @@ void BreakSegment(SCH_SCREEN * aScreen, wxPoint aBreakpoint )
/***********************************************************/
static int TstAlignSegment( EDA_DrawLineStruct* RefSegm,
EDA_DrawLineStruct* TstSegm )
{
/***********************************************************/
/* Search if the 2 segments RefSegm and TstSegm are on a line.
* Retourn 0 if no
* Return 0 if no
* 1 if yes, and RefSegm is modified to be the equivalent segment
*/
{
if( RefSegm == TstSegm )
return 0;
if( RefSegm->GetLayer() != TstSegm->GetLayer() )
return 0;
// search for a common end, and modify coordinates to ensure RefSegm->m_End == TstSegm->m_Start
// search for a common end, and modify coordinates to ensure RefSegm->m_End
// == TstSegm->m_Start
if( RefSegm->m_Start == TstSegm->m_Start )
{
if( RefSegm->m_End == TstSegm->m_End ) // trivial case: RefSegm and TstSegm are identical
if( RefSegm->m_End == TstSegm->m_End )
return 1;
EXCHG( RefSegm->m_Start, RefSegm->m_End ); // at this point, RefSegm->m_End == TstSegm->m_Start
EXCHG( RefSegm->m_Start, RefSegm->m_End );
}
else if( RefSegm->m_Start == TstSegm->m_End )
{
EXCHG( RefSegm->m_Start, RefSegm->m_End );
EXCHG( TstSegm->m_Start, TstSegm->m_End ); // at this point, RefSegm->m_End == TstSegm->m_Start
EXCHG( TstSegm->m_Start, TstSegm->m_End );
}
else if( RefSegm->m_End == TstSegm->m_End )
{
EXCHG( TstSegm->m_Start, TstSegm->m_End ); // at this point, RefSegm->m_End == TstSegm->m_Start
EXCHG( TstSegm->m_Start, TstSegm->m_End );
}
else if( RefSegm->m_End != TstSegm->m_Start ) // No common end point, segments cannot be merged
else if( RefSegm->m_End != TstSegm->m_Start )
// No common end point, segments cannot be merged.
return 0;
/* Test alignment: */
......
This diff is collapsed.
This diff is collapsed.
......@@ -2,9 +2,6 @@
/* EESchema - database.cpp */
/****************************/
/* Routine de selection d'un composant en librairie
*/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
......@@ -21,15 +18,15 @@
/*
* Routine de selection du nom d'un composant en librairie pour chargement,
* Keys pointe la liste des mots cles de filtrage
* Si Keys = "", recherche des composants qui correspondent
* au masque BufName( avec * et ? )
* Routine name selection of a component library for loading,
* Keys leading the list of the keywords filter
* If Keys = "", research components that correspond
* BufName mask (with * and?)
*
* Retourne
* TRUE si composant selectionne
* FALSE si commande annulee
* place le nom du composant a charger, selectionne a partir d'une liste dans
* Returns
* TRUE if the selected component
* FALSE canceled order
* Place the name of the component has loaded, select from a list in
* BufName
*/
wxString DataBaseGetName( WinEDA_DrawFrame* frame, wxString& Keys,
......@@ -41,7 +38,7 @@ wxString DataBaseGetName( WinEDA_DrawFrame* frame, wxString& Keys,
BufName.MakeUpper();
Keys.MakeUpper();
/* Examen de la liste des librairies pour comptage */
/* Review the list of libraries for counting. */
BOOST_FOREACH( CMP_LIBRARY& lib, CMP_LIBRARY::GetLibraryList() )
{
lib.SearchEntryNames( nameList, BufName, Keys );
......
/************************************/
/* Delete.cpp: routines d'effacement */
/* delete.cpp */
/************************************/
#include "fctsys.h"
......@@ -41,10 +41,10 @@ static int CountConnectedItems( WinEDA_SchematicFrame* frame,
continue;
if( TstJunction && (Struct->Type() == DRAW_JUNCTION_STRUCT_TYPE) )
if( TstJunction && ( Struct->Type() == DRAW_JUNCTION_STRUCT_TYPE ) )
{
#define JUNCTION ( (DrawJunctionStruct*) Struct )
if( (JUNCTION->m_Pos.x == pos.x) && (JUNCTION->m_Pos.y == pos.y) )
if( JUNCTION->m_Pos == pos )
count++;
#undef JUNCTION
}
......@@ -201,7 +201,7 @@ void WinEDA_SchematicFrame::DeleteConnection( bool DeleteFullConnection )
removed_struct != NULL;
removed_struct = removed_struct->Next() )
{
if( (removed_struct->m_Flags & STRUCT_DELETED) == 0 )
if( ( removed_struct->m_Flags & STRUCT_DELETED ) == 0 )
continue;
if( removed_struct->Type() != DRAW_SEGMENT_STRUCT_TYPE )
......@@ -223,7 +223,7 @@ void WinEDA_SchematicFrame::DeleteConnection( bool DeleteFullConnection )
removed_struct != NULL;
removed_struct = removed_struct->Next() )
{
if( (removed_struct->m_Flags & STRUCT_DELETED) == 0 )
if( ( removed_struct->m_Flags & STRUCT_DELETED ) == 0 )
continue;
if( removed_struct->Type() != DRAW_SEGMENT_STRUCT_TYPE )
continue;
......@@ -324,12 +324,12 @@ void WinEDA_SchematicFrame::DeleteConnection( bool DeleteFullConnection )
/*
* Locate and delete the item found under the mouse cousor
* Locate and delete the item found under the mouse cursor
* If more than one item found: the priority order is:
* 1 : MARKER
* 2 : JUNCTION
* 2 : NOCONNECT
* 3 : WIRE ou BUS
* 3 : WIRE or BUS
* 4 : DRAWITEM
* 5 : TEXT
* 6 : COMPOSANT
......@@ -376,16 +376,15 @@ bool LocateAndDeleteItem( WinEDA_SchematicFrame* frame, wxDC* DC )
/*
* Suppression definitive d'une structure dans une liste chainee
* d'elements de dessin
* DrawStruct = pointeur sur la structure
* Screen = pointeur sur l'ecran d'appartenance
* Le chainage de la liste est modifie.
* Remove definition of a structure in a linked list
* Elements of Drawing
* DrawStruct * = pointer to the structure
* Screen = pointer on the screen of belonging
*
* Remarque:
* pour les structures DRAW_SHEET_STRUCT_TYPE, l'ecran et les structures
* correspondantes ne sont pas touches.
* Ils doivent etre traites separement
* Note:
* DRAW_SHEET_STRUCT_TYPE structures for the screen and structures
* Corresponding keys are not.
* They must be treated separately
*/
void EraseStruct( SCH_ITEM* DrawStruct, SCH_SCREEN* Screen )
{
......@@ -424,7 +423,7 @@ void EraseStruct( SCH_ITEM* DrawStruct, SCH_SCREEN* Screen )
}
else
{
while( SheetLabel->Next() ) /* Examen de la liste dependante */
while( SheetLabel->Next() )
{
NextLabel =
(Hierarchical_PIN_Sheet_Struct*) SheetLabel->Next();
......@@ -468,9 +467,6 @@ void EraseStruct( SCH_ITEM* DrawStruct, SCH_SCREEN* Screen )
}
/*
* Effacement des marqueurs du type "type"
*/
void DeleteAllMarkers( int type )
{
SCH_SCREEN* screen;
......@@ -489,12 +485,11 @@ void DeleteAllMarkers( int type )
if( DrawStruct->Type() != TYPE_MARKER_SCH )
continue;
/* Marqueur trouve */
Marker = (MARKER_SCH*) DrawStruct;
if( Marker->GetMarkerType() != type )
continue;
/* Suppression du marqueur */
/* Remove marker */
EraseStruct( DrawStruct, screen );
}
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment