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() )
......@@ -51,22 +52,27 @@ bool WinEDA_SchematicFrame::FillFootprintFieldForAllInstancesofComponent(
Cmp = (SCH_COMPONENT*) DrawList;
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
*/
if( Cmp->GetField(FOOTPRINT)->m_Text.IsEmpty()
&& ( Cmp->GetField(FOOTPRINT)->m_Pos == wxPoint( 0, 0 ) ) )
// Found: Init Footprint Field
/* 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_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,9 +116,10 @@ bool WinEDA_SchematicFrame::ProcessStuffFile( FILE* aStuffFile, bool
wxString reference = CONV_FROM_UTF8( Ref );
wxString Footprint = CONV_FROM_UTF8( FootPrint );
FillFootprintFieldForAllInstancesofComponent( reference,
Footprint,
aSetFielsAttributeToVisible );
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 */
/* block_libedit.cpp */
/****************************************************/
#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();
......@@ -126,13 +124,13 @@ void WinEDA_SchematicFrame::StartMoveBusEntry( DrawBusEntryStruct* BusEntry,
/************************************************************/
void WinEDA_SchematicFrame::SetBusEntryShape( wxDC* DC,
DrawBusEntryStruct* BusEntry, int entry_shape )
void WinEDA_SchematicFrame::SetBusEntryShape( wxDC* DC,
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.
/////////////////////////////////////////////////////////////////////////////
// Name: class_hierarchical_PIN_sheet.cpp
// Purpose: member functions Hierarchical_PIN_Sheet_Struct
// header = class_drawsheet.h
// Purpose: member functions Hierarchical_PIN_Sheet_Struct
// header = class_drawsheet.h
// Author: jean-pierre Charras
// Modified by:
// 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,
const wxPoint& pos,
const wxString& text ) :
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 )
{
GRTextHorizJustifyType side;
EDA_Colors txtcolor;
/*****************************************************************************/
/* 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;
......@@ -85,8 +90,8 @@ void Hierarchical_PIN_Sheet_Struct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, con
txtcolor = ReturnLayerColor( m_Layer );
GRSetDrawMode( DC, DrawMode );
posx = m_Pos.x + offset.x;
posy = m_Pos.y + offset.y;
posx = m_Pos.x + offset.x;
posy = m_Pos.y + offset.y;
wxSize size = m_Size;
if( !m_Text.IsEmpty() )
......@@ -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,8 +124,9 @@ 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,
const wxPoint& Pos )
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 );
......
/**************************************************************/
/* Lib component definitions (libentry) definition of fields */
/* Lib component definitions (libentry) definition of fields */
/**************************************************************/
#ifndef CLASS_LIBENTRY_FIELDS_H
......
......@@ -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.
*/
......@@ -202,7 +202,7 @@ bool DrawJunctionStruct::HitTest( const wxPoint& aPosRef )
wxPoint dist = aPosRef - m_Pos;
return sqrt( ( (double) ( dist.x * dist.x ) ) +
( (double) ( dist.y * dist.y ) ) ) < (DRAWJUNCTION_DIAMETER/2);
( (double) ( dist.y * dist.y ) ) ) < (DRAWJUNCTION_DIAMETER/2);
}
......@@ -217,7 +217,7 @@ int DrawJunctionStruct::GetPenSize()
/*****************************************************************************
* Routine to redraw connection struct. *
* Routine to redraw connection struct. *
*****************************************************************************/
void DrawJunctionStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
const wxPoint& offset, int DrawMode, int Color )
......@@ -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 );
}
......@@ -274,7 +275,7 @@ EDA_Rect DrawNoConnectStruct::GetBoundingBox()
{
const int DELTA = DRAWNOCONNECT_SIZE / 2;
EDA_Rect box( wxPoint( m_Pos.x - DELTA, m_Pos.y - DELTA ),
wxSize( 2 * DELTA, 2 * DELTA ) );
wxSize( 2 * DELTA, 2 * DELTA ) );
box.Normalize();
return box;
......@@ -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:
......@@ -435,7 +436,7 @@ EDA_Rect EDA_DrawLineStruct::GetBoundingBox()
// return a rectangle which is [pos,dim) in nature. therefore the +1
EDA_Rect ret( wxPoint( xmin, ymin ),
wxSize( xmax - xmin + 1, ymax - ymin + 1 ) );
wxSize( xmax - xmin + 1, ymax - ymin + 1 ) );
return ret;
}
......@@ -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.
*/
......@@ -575,7 +576,7 @@ bool DrawPolylineStruct::Save( FILE* aFile ) const
if( GetLayer() == LAYER_BUS )
layer = "Bus";
if( fprintf( aFile, "Poly %s %s %d\n",
width, layer, GetCornerCount() ) == EOF )
width, layer, GetCornerCount() ) == EOF )
{
return 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.
This diff is collapsed.
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,16 +18,16 @@
/*
* 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
* BufName
* 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,
wxString& BufName )
......@@ -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 );
......
This diff is collapsed.
/*******************************************************/
/* delsheet.cpp Routine d'effacement d'une hierarchie */
/*******************************************************/
/****************/
/* delsheet.cpp */
/****************/
#include "fctsys.h"
#include "appl_wxstruct.h"
......@@ -38,7 +38,6 @@ void DeleteSubHierarchy( DrawSheetStruct* FirstSheet, bool confirm_deletion )
return;
}
/* effacement du sous schema correspondant */
if( FirstSheet->m_AssociatedScreen->IsModify() && confirm_deletion )
{
msg.Printf( _( "Sheet %s (file %s) modified. Save it?" ),
......@@ -65,7 +64,6 @@ void DeleteSubHierarchy( DrawSheetStruct* FirstSheet, bool confirm_deletion )
}
}
/* Effacement des elements de la feuille courante */
FirstSheet->m_AssociatedScreen->FreeDrawList();
}
}
......
This diff is collapsed.
This diff is collapsed.
/**********************************************/
/* EESchema - symbtext.cpp for Library Editor */
/**********************************************/
/**********************************/
/* edit_graphic_bodyitem_text.cpp */
/**********************************/
/* Menu et routines de creation, modification, suppression de textes
du type symbole
(textes autres que Fields)
*/
/* Code for editing component library text items, not fields. */
#include "fctsys.h"
#include "gr_basic.h"
......@@ -143,8 +140,7 @@ void Dialog_BodyGraphicText_Properties::OnCancelClick( wxCommandEvent& event )
/***************************************************************************/
void Dialog_BodyGraphicText_Properties::OnOkClick( wxCommandEvent& event )
/***************************************************************************/
/* Met a jour les differents parametres pour le composant en cours d'edition
*/
/* Updates the different parameters for the component being edited */
{
wxString Line;
......@@ -234,7 +230,7 @@ void WinEDA_LibeditFrame::EditSymbolText(wxDC* DC, LIB_DRAW_ITEM* DrawItem)
|| ( DrawItem->Type() != COMPONENT_GRAPHIC_TEXT_DRAW_TYPE ) )
return;
/* Effacement ancien texte */
/* Deleting old text. */
if( DC)
DrawItem->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, DrawMode, NULL,
DefaultTransformMatrix );
......@@ -247,7 +243,7 @@ void WinEDA_LibeditFrame::EditSymbolText(wxDC* DC, LIB_DRAW_ITEM* DrawItem)
frame->Destroy();
GetScreen()->SetModify();
/* Affichage nouveau texte */
/* Display new text. */
if( DC )
{
if ( ( DrawItem->m_Flags & IS_MOVED ) == 0 )
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/************************************************************/
/** eeconfig.h : configuration: definition des structures **/
/************************************************************/
/*****************/
/** eeconfig.h **/
/*****************/
#include "param_config.h"
......@@ -8,11 +8,11 @@
#define GROUPCOMMON wxT( "/common" )
#define GROUPLIB wxT( "libraries" )
#include "netlist.h" /* Definitions generales liees au calcul de netliste */
#include "netlist.h"
/* variables importees */
extern int g_PenMinWidth;
/* saving parameters option : */
#define INSETUP TRUE // used when the parameter is saved in general config
// if not used, the parameter is saved in the loca config (project config)
#define INSETUP TRUE /* used when the parameter is saved in general config
* if not used, the parameter is saved in the local
* config (project config) */
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