Commit 89b3eb5a authored by charras's avatar charras

bug fixes and merging my development with svn rep.

parent 13f2e75b
...@@ -4,6 +4,23 @@ Started 2007-June-11 ...@@ -4,6 +4,23 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. email address.
2007-June-13 RELEASE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+All:
merging my development with svn version
+ pcbnew:
bug fix (problem in postscript generation due to the internationalization
of floating point number notation )
added tool to select layer pair and monitor active layer
+ eeschema
bug fix:
crash libedit when loading certain components (linux only)
incomplete generation of erc file list
2007-June-13 UPDATE Richard A Burton <richardaburton@gmail.com> 2007-June-13 UPDATE Richard A Burton <richardaburton@gmail.com>
================================================================================ ================================================================================
+ build: + build:
......
...@@ -117,14 +117,20 @@ bool success = FALSE; ...@@ -117,14 +117,20 @@ bool success = FALSE;
fullfilename.Replace(WIN_STRING_DIR_SEP, UNIX_STRING_DIR_SEP); fullfilename.Replace(WIN_STRING_DIR_SEP, UNIX_STRING_DIR_SEP);
#endif #endif
wxString mask(wxT("*")), extension;
#ifdef __WINDOWS__
mask += wxT(".*");
extension = wxT(".*");
#endif
if ( wxIsWild(fullfilename) ) if ( wxIsWild(fullfilename) )
{ {
fullfilename = fullfilename =
EDA_FileSelector(_("Doc Files"), /* Titre de la fenetre */ EDA_FileSelector(_("Doc Files"), /* Titre de la fenetre */
wxPathOnly(fullfilename), /* Chemin par defaut */ wxPathOnly(fullfilename), /* Chemin par defaut */
fullfilename, /* nom fichier par defaut */ fullfilename, /* nom fichier par defaut */
wxEmptyString, /* extension par defaut */ extension, /* extension par defaut */
wxEmptyString, /* Masque d'affichage */ mask, /* Masque d'affichage */
frame, /* parent frame */ frame, /* parent frame */
wxFD_OPEN, /* wxSAVE, wxFD_OPEN ..*/ wxFD_OPEN, /* wxSAVE, wxFD_OPEN ..*/
TRUE, /* true = ne change pas le repertoire courant */ TRUE, /* true = ne change pas le repertoire courant */
......
...@@ -77,9 +77,6 @@ WinEDA_App::WinEDA_App(void) ...@@ -77,9 +77,6 @@ WinEDA_App::WinEDA_App(void)
m_Locale = NULL; m_Locale = NULL;
m_PdfBrowserIsDefault = TRUE; m_PdfBrowserIsDefault = TRUE;
/* Init de variables globales d'interet general: */
g_FloatSeparator = '.'; // Nombres flottants = 0.1 par exemple
} }
/*****************************/ /*****************************/
...@@ -161,9 +158,6 @@ bool succes = SetLanguage(TRUE); ...@@ -161,9 +158,6 @@ bool succes = SetLanguage(TRUE);
{ {
} }
if ( atof("0,1") ) g_FloatSeparator = ','; // Nombres flottants = 0,1
else g_FloatSeparator = '.';
#ifdef KICAD_PYTHON #ifdef KICAD_PYTHON
PyHandler::GetInstance()->SetAppName( name ); PyHandler::GetInstance()->SetAppName( name );
#endif #endif
...@@ -380,9 +374,6 @@ wxString dic_path; ...@@ -380,9 +374,6 @@ wxString dic_path;
SetLanguageList(NULL); SetLanguageList(NULL);
if ( atof("0,1") ) g_FloatSeparator = ','; // Nombres flottants = 0,1
else g_FloatSeparator = '.';
return m_Locale->IsOk(); return m_Locale->IsOk();
} }
......
...@@ -39,6 +39,7 @@ static wxString s_HelpPathList[] = { ...@@ -39,6 +39,7 @@ static wxString s_HelpPathList[] = {
wxT("d:/kicad/help/"), wxT("d:/kicad/help/"),
#else #else
wxT("/usr/local/kicad/help/"), wxT("/usr/local/kicad/help/"),
wxT("/usr/share/doc/kicad/help"),
wxT("/usr/share/doc/kicad/"), wxT("/usr/share/doc/kicad/"),
#endif #endif
wxT("end_list") // End of list symbol, do not change wxT("end_list") // End of list symbol, do not change
......
...@@ -289,7 +289,7 @@ void ChangeSpaces(char * Text, int NewChar) ...@@ -289,7 +289,7 @@ void ChangeSpaces(char * Text, int NewChar)
char * to_point(char * Text) char * to_point(char * Text)
/**************************/ /**************************/
/* convertit les , en . dans une chaine. utilis pour compenser /* convertit les , en . dans une chaine. utilis pour compenser
l'internalisation imbecile de la fct printf l'internalisationde la fct printf
qui genere les flottants avec une virgule au lieu du point qui genere les flottants avec une virgule au lieu du point
*/ */
{ {
...@@ -297,7 +297,9 @@ char * line = Text; ...@@ -297,7 +297,9 @@ char * line = Text;
if ( Text == NULL ) return NULL; if ( Text == NULL ) return NULL;
for ( ; *Text != 0; Text++ ) for ( ; *Text != 0; Text++ )
if (*Text == g_FloatSeparator) *Text = '.'; {
if (*Text == ',') *Text = '.';
}
return line; return line;
} }
......
/***********************************************************/
/* Module to handle libraries (first part - file and io). */
/***********************************************************/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "trigo.h"
#include "program.h"
#include "libcmp.h"
#include "general.h"
#include "protos.h"
/* Variables Locales */
/* Fonctions locales */
/* pour librairies de composants */
static LibEDA_BaseStruct *GetDrawEntry(WinEDA_DrawFrame * frame, FILE *f,
char *Line, int *LineNum);
static bool GetLibEntryField(EDA_LibComponentStruct *LibEntry, char * line);
static bool AddAliasNames(EDA_LibComponentStruct *LibEntry, char * line);
static void InsertAlias(PriorQue ** PQ,
EDA_LibComponentStruct *LibEntry, int *NumOfParts);
static bool ReadLibEntryDateAndTime(EDA_LibComponentStruct * LibEntry, char * Line);
static int AddFootprintFilterList(EDA_LibComponentStruct *LibEntryLibEntry,
FILE * f, char * Line, int *LineNum);
/* pour doc librairies */
/****************************************************/
/* Routines de lecture des librairies de composants */
/****************************************************/
/*****************************************************************************
* Routine to load the given library name. FullLibName should hold full path *
* of file name to open, while LibName should hold only its name. *
* IF library already exists, it is NOT reloaded. *
* return: new lib or NULL *
*****************************************************************************/
LibraryStruct * LoadLibraryName(WinEDA_DrawFrame * frame,
const wxString & FullLibName, const wxString & LibName)
{
int NumOfParts;
FILE *f;
LibraryStruct *NewLib;
PriorQue *Entries;
wxString FullFileName;
if ( (NewLib = FindLibrary(LibName)) != NULL)
{
if ( NewLib->m_FullFileName == FullLibName )
return NewLib;
FreeCmpLibrary(frame, LibName);
}
NewLib = NULL;
f = wxFopen(FullLibName, wxT("rt") );
if (f == NULL)
{
wxString msg;
msg.Printf( _("Library <%s> not found"), FullLibName.GetData());
DisplayError(frame, msg);
return NULL;
}
NewLib = new LibraryStruct(LIBRARY_TYPE_EESCHEMA, LibName, FullLibName);
Entries = LoadLibraryAux(frame, NewLib, f, &NumOfParts);
if ( Entries != NULL)
{
NewLib->m_Entries = Entries;
NewLib->m_NumOfParts = NumOfParts;
if ( g_LibraryList == NULL ) g_LibraryList = NewLib;
else
{
LibraryStruct *tmplib = g_LibraryList;
while ( tmplib->m_Pnext ) tmplib = tmplib->m_Pnext;
tmplib->m_Pnext = NewLib;
}
FullFileName = FullLibName;
ChangeFileNameExt(FullFileName, DOC_EXT);
LoadDocLib(frame, FullFileName, NewLib->m_Name);
}
else delete NewLib;
fclose(f);
return NewLib;
}
/******************************************/
void LoadLibraries(WinEDA_DrawFrame * frame)
/******************************************/
/* Delete toutes les librairies chargees et recree toutes les librairies
donnes dans la liste g_LibName_List
*/
{
wxString FullLibName, msg;
wxString LibName;
unsigned ii, iimax = g_LibName_List.GetCount();
frame->PrintMsg( _("Start loading schematic libs"));
// Free the unwanted libraries (i.e. not in list) but keep the .cache lib
LibraryStruct *nextlib, *lib = g_LibraryList;
for (; lib != NULL; lib = nextlib )
{
nextlib = lib->m_Pnext;
if ( lib->m_IsLibCache ) continue;
wxString libname = lib->m_Name;
// is this library in "wanted list" g_LibName_List ?
int test = g_LibName_List.Index(libname);
if ( test == wxNOT_FOUND ) FreeCmpLibrary(frame, libname);
}
// Load missing libraries (if any)
for ( ii = 0 ; ii < iimax; ii++)
{
LibName = g_LibName_List[ii];
if( LibName.IsEmpty() ) continue;
FullLibName = MakeFileName(g_RealLibDirBuffer, LibName, g_LibExtBuffer);
msg = wxT("Loading ") + FullLibName;
if ( LoadLibraryName(frame, FullLibName, LibName) )
msg += wxT(" OK");
else
msg += wxT(" ->Error");
frame->PrintMsg( msg );
}
// reorder the linked list to match the order filename list:
int NumOfLibs;
for (NumOfLibs = 0, lib = g_LibraryList; lib != NULL; lib = lib->m_Pnext)
{
lib->m_Flags = 0;
NumOfLibs++;
}
if ( NumOfLibs == 0 ) return;
LibraryStruct ** libs =
(LibraryStruct **) MyZMalloc(sizeof(LibraryStruct *) * (NumOfLibs + 2));
int jj = 0;
for (ii = 0; ii < g_LibName_List.GetCount(); ii++)
{
if ( jj >= NumOfLibs ) break;
lib = FindLibrary(g_LibName_List[ii]);
if ( lib )
{
lib->m_Flags = 1;
libs[jj++] = lib;
}
}
/* Put lib cache at end of list */
for (lib = g_LibraryList; lib != NULL; lib = lib->m_Pnext)
{
if ( lib->m_Flags == 0 ) libs[jj++] = lib;
}
libs[jj] = NULL;
/* Change the linked list pointers */
for (ii = 0; libs[ii] != NULL; ii++)
libs[ii]->m_Pnext = libs[ii+1];
g_LibraryList = libs[0];
MyFree(libs);
for (lib = g_LibraryList; lib != NULL; lib = lib->m_Pnext)
lib->m_Flags = 0;
}
/*****************************************************************************
* Routine to free a library from the current loaded libraries. *
*****************************************************************************/
void FreeCmpLibrary(wxWindow * frame, const wxString & LibName)
{
int NumOfLibs = NumOfLibraries();
LibraryStruct *Lib, *TempLib;
if (NumOfLibs == 0)
{
DisplayError(frame, wxT("No libraries are loaded"),20);
return;
}
/* Search for this library name: */
for (Lib = g_LibraryList; Lib != NULL; Lib = Lib->m_Pnext)
{
if (LibName == Lib->m_Name) break;
}
if (Lib == NULL) return;
if ( Lib == g_LibraryList) g_LibraryList = Lib->m_Pnext;
else
{
for( TempLib = g_LibraryList; TempLib->m_Pnext != Lib; TempLib=TempLib->m_Pnext);
TempLib->m_Pnext = TempLib->m_Pnext->m_Pnext;
}
delete Lib;
/* La librairie supprimee est peut etre celle selectee dans libedit */
if ( Lib == CurrentLib ) CurrentLib = NULL;
}
/******************************/
const wxChar **GetLibNames(void)
/******************************/
/* Routine to return pointers to all library names.
User is responsible to deallocate memory
*/
{
int ii, NumOfLibs = NumOfLibraries();
const wxChar **Names;
LibraryStruct *Lib;
Names = (const wxChar **) MyZMalloc(sizeof(wxChar *) * (NumOfLibs + 1));
for (ii = 0, Lib = g_LibraryList; Lib != NULL; Lib = Lib->m_Pnext, ii++)
{
Names[ii] = Lib->m_Name.GetData();
}
Names[ii] = NULL;
return Names;
}
/*****************************************************************************
* Routine to compare two EDA_LibComponentStruct for the PriorQue module. *
* Comparison (insensitive case) is based on Part name. *
*****************************************************************************/
int LibraryEntryCompare(EDA_LibComponentStruct *LE1, EDA_LibComponentStruct *LE2)
{
return LE1->m_Name.m_Text.CmpNoCase(LE2->m_Name.m_Text);
}
/*****************************************************************************
* Routine to load a library from given open file. *
*****************************************************************************/
PriorQue *LoadLibraryAux(WinEDA_DrawFrame * frame, LibraryStruct * Library, FILE *libfile, int *NumOfParts)
{
int LineNum = 0;
char Line[1024];
PriorQue *PQ = NULL;
EDA_LibComponentStruct *LibEntry;
wxString msg;
wxBusyCursor ShowWait; // Display a Busy Cursor..
*NumOfParts = 0;
if ( GetLine(libfile, Line, &LineNum, sizeof(Line) ) == NULL)
{
msg = _("File <") + Library->m_Name + _("> is empty!");
DisplayError(frame, msg);
return NULL;
}
if( strnicmp(Line, LIBFILE_IDENT, 10) != 0)
{
msg = _("File <") + Library->m_Name + _("> is NOT EESCHEMA library!");
DisplayError(frame, msg);
return NULL;
}
if ( Library ) Library->m_Header = CONV_FROM_UTF8(Line);
PQInit(&PQ);
PQCompFunc((PQCompFuncType) LibraryEntryCompare);
while (GetLine(libfile, Line, &LineNum, sizeof(Line)) )
{
if (strnicmp(Line, "$HEADER", 7) == 0)
{
if ( Library )
{
if ( ! Library->ReadHeader(libfile, &LineNum) )
{
msg = _("Library <") + Library->m_Name + _("> header read error");
DisplayError(frame, msg, 30);
}
}
continue;
}
if (strnicmp(Line, "DEF", 3) == 0)
{
/* Read one DEF/ENDDEF part entry from library: */
LibEntry = Read_Component_Definition(frame, Line, libfile, &LineNum);
if ( LibEntry )
{
/* If we are here, this part is O.k. - put it in: */
++*NumOfParts;
PQInsert(&PQ, LibEntry);
InsertAlias(&PQ, LibEntry, NumOfParts);
}
}
}
return PQ;
}
/*********************************************************************************************/
EDA_LibComponentStruct * Read_Component_Definition(WinEDA_DrawFrame * frame, char * Line,
FILE *f, int *LineNum)
/*********************************************************************************************/
/* Routine to Read a DEF/ENDDEF part entry from given open file.
*/
{
int unused;
char *p, *Name, *Prefix = NULL;
EDA_LibComponentStruct *LibEntry = NULL;
bool Res;
wxString Msg;
p = strtok(Line, " \t\r\n");
if (strcmp(p, "DEF") != 0)
{
Msg.Printf( wxT("DEF command expected in line %d, aborted."), *LineNum);
DisplayError(frame, Msg);
return NULL;
}
/* Read DEF line: */
char drawnum = 0, drawname = 0;
LibEntry = new EDA_LibComponentStruct( NULL);
if ((Name = strtok(NULL, " \t\n")) == NULL || /* Part name: */
(Prefix = strtok(NULL, " \t\n")) == NULL || /* Prefix name: */
(p = strtok(NULL, " \t\n")) == NULL || /* NumOfPins: */
sscanf(p, "%d", &unused) != 1 ||
(p = strtok(NULL, " \t\n")) == NULL || /* TextInside: */
sscanf(p, "%d", &LibEntry->m_TextInside) != 1 ||
(p = strtok(NULL, " \t\n")) == NULL || /* DrawNums: */
sscanf(p, "%c", &drawnum) != 1 ||
(p = strtok(NULL, " \t\n")) == NULL || /* DrawNums: */
sscanf(p, "%c", &drawname) != 1 ||
(p = strtok(NULL, " \t\n")) == NULL || /* m_UnitCount: */
sscanf(p, "%d", &LibEntry->m_UnitCount) != 1 )
{
Msg.Printf( wxT("Wrong DEF format in line %d, skipped."),*LineNum);
DisplayError(frame, Msg);
while (GetLine(f, Line, LineNum, 1024) )
{
p = strtok(Line, " \t\n");
if (stricmp(p, "ENDDEF") == 0) break;
}
return NULL;
}
else /* Mise a jour des infos de la ligne "DEF" */
{
LibEntry->m_DrawPinNum = (drawnum == 'N') ? FALSE : TRUE;
LibEntry->m_DrawPinName = (drawname == 'N') ? FALSE : TRUE;
/* Copy part name and prefix. */
strupper(Name);
if(Name[0] != '~') LibEntry->m_Name.m_Text = CONV_FROM_UTF8(Name);
else
{
LibEntry->m_Name.m_Text = CONV_FROM_UTF8(&Name[1]);
LibEntry->m_Name.m_Attributs |= TEXT_NO_VISIBLE;
}
if (strcmp(Prefix, "~") == 0)
{
LibEntry->m_Prefix.m_Text.Empty();
LibEntry->m_Prefix.m_Attributs |= TEXT_NO_VISIBLE;
}
else LibEntry->m_Prefix.m_Text = CONV_FROM_UTF8(Prefix);
// Copy optional infos
if ( (p = strtok(NULL, " \t\n")) != NULL ) // m_UnitSelectionLocked param
{
if ( *p == 'L') LibEntry->m_UnitSelectionLocked = TRUE;
}
if ( (p = strtok(NULL, " \t\n")) != NULL ) /* Type Of Component */
{
if ( *p == 'P') LibEntry->m_Options = ENTRY_POWER;
}
}
/* Analyse lignes suivantes */
while (GetLine(f, Line, LineNum, 1024) )
{
p = strtok(Line, " \t\n");
Res = TRUE; /* Pour test d'erreur (Res = FALSE = erreur) */
if( (Line[0] == 'T') && (Line[1] == 'i') )
{
Res = ReadLibEntryDateAndTime(LibEntry, Line);
}
else if(Line[0] == 'F')
{
Res = GetLibEntryField(LibEntry, Line);
}
else if (strcmp(p, "ENDDEF") == 0)
{
break;
}
else if (strcmp(p, "DRAW") == 0)
{
LibEntry->m_Drawings = GetDrawEntry(frame, f, Line, LineNum);
}
else if(strncmp(p, "ALIAS", 5) == 0 )
{
p = strtok(NULL, "\r\n");
Res = AddAliasNames(LibEntry, p);
}
else if(strncmp(p, "$FPLIST", 5) == 0 )
{
Res = AddFootprintFilterList(LibEntry, f, Line, LineNum);
}
else
{
Msg.Printf( wxT("Undefined command \"%s\" in line %d, skipped."), p, * LineNum);
frame->PrintMsg(Msg);
}
/* Fin analyse de la ligne ou block: test de l'info lue */
if (!Res)
{ /* Something went wrong there. */
Msg.Printf( wxT(" Error Line %d, Library not loaded"), *LineNum);
DisplayError(frame, Msg);
delete LibEntry;
return NULL;
}
}
/* If we are here, this part is O.k. - put it in: */
LibEntry->SortDrawItems();
return LibEntry;
}
/*****************************************************************************
* Routine to load a DRAW definition from given file. Note "DRAW" line has *
* been read already. Reads upto and include ENDDRAW, or an error (NULL ret). *
*****************************************************************************/
static LibEDA_BaseStruct *GetDrawEntry(WinEDA_DrawFrame * frame, FILE *f, char *Line, int *LineNum)
{
int i = 0, jj, ll, Unit, Convert, size1, size2;
char *p, Buffer[1024], BufName[256],
PinNum[256],
chartmp[256], chartmp1[256];
int ctmp;
wxString MsgLine;
bool Error = FALSE;
LibEDA_BaseStruct *Tail = NULL,
*New = NULL,
*Head = NULL;
while (TRUE)
{
if (GetLine(f, Line, LineNum, 1024 ) == NULL)
{
DisplayError(frame, wxT("File ended prematurely"));
return Head;
}
if (strncmp(Line, "ENDDRAW", 7) == 0)
{
break;
}
New = NULL;
switch (Line[0])
{
case 'A': /* Arc */
{
int startx, starty, endx, endy;
LibDrawArc * Arc = new LibDrawArc();
New = Arc;
ll = 0;
int nbarg = sscanf(&Line[2], "%d %d %d %d %d %d %d %d %c %d %d %d %d",
&Arc->m_Pos.x, &Arc->m_Pos.y, &Arc->m_Rayon,
&Arc->t1, &Arc->t2, &Unit, &Convert,
&Arc->m_Width, &ctmp, &startx, &starty, &endx, &endy);
if ( nbarg < 8 ) Error = TRUE;
Arc->m_Unit = Unit; Arc->m_Convert = Convert;
if ( ctmp == 'F') Arc->m_Fill = FILLED_SHAPE;
if ( ctmp == 'f') Arc->m_Fill = FILLED_WITH_BG_BODYCOLOR;
NORMALIZE_ANGLE(Arc->t1);
NORMALIZE_ANGLE(Arc->t2);
if ( nbarg >= 13 ) // Coord reelles des extremites de l'arc lues
{
Arc->m_Start.x = startx; Arc->m_Start.y = starty;
Arc->m_End.x = endx; Arc->m_End.y = endy;
}
else
{
Arc->m_Start.x = Arc->m_Rayon; Arc->m_Start.y = 0;
Arc->m_End.x = Arc->m_Rayon; Arc->m_End.y = 0;
RotatePoint( &Arc->m_Start.x, &Arc->m_Start.y, -Arc->t1);
Arc->m_Start.x += Arc->m_Pos.x; Arc->m_Start.y +=Arc->m_Pos.y;
RotatePoint( &Arc->m_End.x, &Arc->m_End.y, -Arc->t2);
Arc->m_End.x += Arc->m_Pos.x; Arc->m_End.y +=Arc->m_Pos.y;
}
}
break;
case 'C': /* Circle */
{
LibDrawCircle * Circle = new LibDrawCircle();
New = Circle; ll = 0;
Error = sscanf(&Line[2], "%d %d %d %d %d %d %c",
&Circle->m_Pos.x, &Circle->m_Pos.y, &Circle->m_Rayon,
&Unit, &Convert,&Circle->m_Width, &ctmp) < 6;
Circle->m_Unit = Unit;
Circle->m_Convert = Convert;
if ( ctmp == 'F') Circle->m_Fill = FILLED_SHAPE;
if ( ctmp == 'f') Circle->m_Fill = FILLED_WITH_BG_BODYCOLOR;
}
break;
case 'T': /* Text */
{
LibDrawText * Text = new LibDrawText();
New = Text;
Buffer[0] = 0;
Error = sscanf(&Line[2], "%d %d %d %d %d %d %d %s",
&Text->m_Horiz,
&Text->m_Pos.x, &Text->m_Pos.y,
&Text->m_Size.x, &Text->m_Type,
&Unit, &Convert, Buffer) != 8;
Text->m_Unit = Unit; Text->m_Convert = Convert;
Text->m_Size.y = Text->m_Size.x;
if (!Error)
{ /* Convert '~' to spaces. */
Text->m_Text = CONV_FROM_UTF8(Buffer);
Text->m_Text.Replace(wxT("~"), wxT(" ")); // Les espaces sont restitus
}
}
break;
case 'S': /* Square */
{
LibDrawSquare * Square = new LibDrawSquare();
New = Square; ll = 0;
Error = sscanf(&Line[2], "%d %d %d %d %d %d %d %s",
&Square->m_Start.x, &Square->m_Start.y,
&Square->m_End.x, &Square->m_End.y,
&Unit, &Convert,&Square->m_Width, &ctmp) < 7;
Square->m_Unit = Unit; Square->m_Convert = Convert;
if ( ctmp == 'F') Square->m_Fill = FILLED_SHAPE;
if ( ctmp == 'f') Square->m_Fill = FILLED_WITH_BG_BODYCOLOR;
}
break;
case 'X': /* Pin Description */
{
*Buffer = 0;
LibDrawPin * Pin = new LibDrawPin();
New = Pin;
i = sscanf(Line+2, "%s %s %d %d %d %s %d %d %d %d %s %s",
BufName, PinNum,
&Pin->m_Pos.x, &Pin->m_Pos.y,
&ll, chartmp1,
&size1, &size2,
&Unit, &Convert, chartmp, Buffer);
Pin->m_SizeNum = size1; /* Parametres type short */
Pin->m_SizeName = size2;
Pin->m_PinLen = ll;
Pin->m_Orient = chartmp1[0] & 255;
Pin->m_Unit = Unit; Pin->m_Convert = Convert;
strncpy((char*)&Pin->m_PinNum, PinNum, 4);
Error = (i != 11 && i != 12);
Pin->m_PinName = CONV_FROM_UTF8(BufName);
jj = *chartmp & 255;
switch(jj)
{
case 'I':
Pin->m_PinType = PIN_INPUT; break;
case 'O':
Pin->m_PinType = PIN_OUTPUT; break;
case 'B':
Pin->m_PinType = PIN_BIDI; break;
case 'T':
Pin->m_PinType = PIN_TRISTATE; break;
case 'P':
Pin->m_PinType = PIN_PASSIVE; break;
case 'U':
Pin->m_PinType = PIN_UNSPECIFIED; break;
case 'W':
Pin->m_PinType = PIN_POWER_IN; break;
case 'w':
Pin->m_PinType = PIN_POWER_OUT; break;
case 'C':
Pin->m_PinType = PIN_OPENCOLLECTOR; break;
case 'E':
Pin->m_PinType = PIN_OPENEMITTER; break;
default:
MsgLine.Printf( wxT("Unknown Pin Type [%c] line %d"),
jj, *LineNum);
DisplayError(frame, MsgLine);
}
if( i == 12 ) /* Special Symbole defined */
for( jj = strlen(Buffer); jj > 0 ; )
{
switch(Buffer[--jj])
{
case '~': break;
case 'N': Pin->m_Attributs |= PINNOTDRAW; break;
case 'I': Pin->m_PinShape |= INVERT; break;
case 'C': Pin->m_PinShape |= CLOCK; break;
case 'L': Pin->m_PinShape |= LOWLEVEL_IN; break;
case 'V': Pin->m_PinShape |= LOWLEVEL_OUT; break;
default:
MsgLine.Printf( wxT("Unknown Pin Shape [%c] line %d"),
Buffer[jj], *LineNum);
DisplayError(frame, MsgLine); break;
}
}
}
break;
case 'P': /* Polyline */
{
LibDrawPolyline * Polyl = new LibDrawPolyline();
New = Polyl;
if (sscanf(&Line[2], "%d %d %d %d",
&Polyl->n, &Unit, &Convert,
&Polyl->m_Width) == 4 &&
Polyl->n > 0)
{
Polyl->m_Unit = Unit; Polyl->m_Convert = Convert;
Polyl->PolyList = (int *)
MyZMalloc(sizeof(int) * Polyl->n * 2);
p = strtok(&Line[2], " \t\n");
p = strtok(NULL, " \t\n");
p = strtok(NULL, " \t\n");
p = strtok(NULL, " \t\n");
for (i = 0; i < Polyl->n * 2 && !Error; i++)
{
p = strtok(NULL, " \t\n");
Error = sscanf(p, "%d", &Polyl->PolyList[i]) != 1;
}
Polyl->m_Fill = NO_FILL;
if ( (p = strtok(NULL, " \t\n")) != NULL )
{
if ( p[0] == 'F') Polyl->m_Fill = FILLED_SHAPE;
if ( p[0] == 'f')
Polyl->m_Fill = FILLED_WITH_BG_BODYCOLOR;
}
}
else Error = TRUE;
}
break;
default:
MsgLine.Printf( wxT("Undefined DRAW command in line %d, aborted."),
*LineNum);
DisplayError(frame, MsgLine);
return Head;
}
if (Error)
{
MsgLine.Printf( wxT("Error in %c DRAW command in line %d, aborted."),
Line[0], *LineNum);
DisplayError(frame, MsgLine);
delete New;
/* FLush till end of draw: */
do {
if (GetLine(f, Line, LineNum, 1024 ) == NULL)
{
DisplayError(frame, wxT("File ended prematurely") );
return Head;
}
} while (strncmp(Line, "ENDDRAW", 7) != 0);
return (Head);
}
else
{
if (Head == NULL) Head = Tail = New;
else
{
Tail->Pnext = New; Tail = New;
}
}
}
return Head;
}
/*****************************************************************************
* Routine to find the library given its name. *
*****************************************************************************/
LibraryStruct *FindLibrary(const wxString & Name)
{
LibraryStruct *Lib = g_LibraryList;
while (Lib)
{
if (Lib->m_Name == Name ) return Lib;
Lib = Lib->m_Pnext;
}
return NULL;
}
/*****************************************************************************
* Routine to find the number of libraries currently loaded. *
*****************************************************************************/
int NumOfLibraries(void)
{
int ii;
LibraryStruct *Lib = g_LibraryList;
for (ii = 0; Lib != NULL; Lib = Lib->m_Pnext) ii++;
return ii;
}
/*****************************************************************************/
static bool GetLibEntryField(EDA_LibComponentStruct *LibEntry, char * line)
/*****************************************************************************/
/* Analyse la ligne de description du champ de la forme:
Fn "CA3130" 150 -200 50 H V
ou n = 0 (REFERENCE), 1 (VALUE) , 2 .. 11 = autres champs, facultatifs
*/
{
int posx, posy, size, orient, hjustify, vjustify;
bool draw;
char *Text,
Char1[256], Char2[256],
Char3[256], Char4[256],
FieldUserName[1024];
int NumOfField, nbparam;
LibDrawField * Field = NULL;
if( sscanf(line+1, "%d", &NumOfField) != 1) return(0);
/* Recherche du debut des donnees (debut du texte suivant) */
while(*line != 0) line++;
while(*line == 0) line++;
/* recherche du texte */
while ( *line && (*line != '"') ) line++;
if ( *line == 0 ) return(0);
line ++; Text = line;
/* recherche fin de texte */
while ( *line && (*line != '"') ) line++;
if ( *line == 0 ) return(0);
*line = 0; line++;
FieldUserName[0] = 0;
nbparam = sscanf(line, " %d %d %d %c %c %c %c",
&posx, &posy, &size, Char1, Char2, Char3, Char4);
orient = TEXT_ORIENT_HORIZ; if(Char1[0] == 'V') orient = TEXT_ORIENT_VERT;
draw = TRUE; if(Char2[0] == 'I') draw = FALSE;
hjustify = GR_TEXT_HJUSTIFY_CENTER;
vjustify = GR_TEXT_VJUSTIFY_CENTER;
if ( nbparam >= 6 )
{
if ( *Char3 == 'L' ) hjustify = GR_TEXT_HJUSTIFY_LEFT;
else if ( *Char3 == 'R' ) hjustify = GR_TEXT_HJUSTIFY_RIGHT;
if ( *Char4 == 'B' ) vjustify = GR_TEXT_VJUSTIFY_BOTTOM;
else if ( *Char4 == 'T' ) vjustify = GR_TEXT_VJUSTIFY_TOP;
}
switch(NumOfField)
{
case REFERENCE:
Field = &LibEntry->m_Prefix;
Field->m_FieldId = REFERENCE;
break;
case VALUE:
Field = &LibEntry->m_Name;
Field->m_FieldId = VALUE;
break;
default:
if(NumOfField >= NUMBER_OF_FIELDS ) break;
Field = new LibDrawField(NumOfField);
Field->Pnext = LibEntry->Fields;
LibEntry->Fields = Field;
break;
}
if ( Field == NULL ) return FALSE;
Field->m_Pos.x = posx; Field->m_Pos.y = posy;
Field->m_Orient = orient;
if( draw == FALSE ) Field->m_Attributs |= TEXT_NO_VISIBLE;
Field->m_Size.x = Field->m_Size.y = size;
Field->m_Text = CONV_FROM_UTF8(Text);
if ( NumOfField >= FIELD1 )
{
ReadDelimitedText(FieldUserName,line, sizeof(FieldUserName) );
Field->m_Name = CONV_FROM_UTF8(FieldUserName);
}
Field->m_HJustify = hjustify;
Field->m_VJustify = vjustify;
return(TRUE);
}
/********************************************************************/
static bool AddAliasNames(EDA_LibComponentStruct *LibEntry, char * line)
/********************************************************************/
/* Read the alias names (in buffer line) and add them in alias list
names are separated by spaces
*/
{
char * text;
wxString name;
text = strtok(line, " \t\r\n");
while ( text )
{
name = CONV_FROM_UTF8(text);
LibEntry->m_AliasList.Add(name);
text = strtok(NULL, " \t\r\n");
}
return( TRUE );
}
/********************************************************************/
static void InsertAlias(PriorQue ** PQ, EDA_LibComponentStruct *LibEntry,
int *NumOfParts)
/********************************************************************/
/* create in library (in list PQ) aliases of the "root" component LibEntry*/
{
EDA_LibCmpAliasStruct *AliasEntry;
unsigned ii;
if(LibEntry->m_AliasList.GetCount() == 0)
return; /* No alias for this component */
for( ii = 0; ii < LibEntry->m_AliasList.GetCount(); ii++ )
{
AliasEntry = new EDA_LibCmpAliasStruct(LibEntry->m_AliasList[ii],
LibEntry->m_Name.m_Text.GetData());
++*NumOfParts;
PQInsert(PQ, AliasEntry);
}
}
/*******************************************************/
/* Routines de lecture des Documentation de composants */
/*******************************************************/
/**********************************************************************************************/
int LoadDocLib(WinEDA_DrawFrame * frame, const wxString & FullDocLibName, const wxString & Libname)
/**********************************************************************************************/
/* Routine to load a library from given open file.*/
{
int LineNum = 0;
char Line[1024], *Name, *Text;
EDA_LibComponentStruct * Entry;
FILE * f;
wxString msg;
f = wxFopen(FullDocLibName, wxT("rt") );
if (f == NULL) return(0);
if ( GetLine(f, Line, &LineNum, sizeof(Line) ) == NULL)
{ /* pas de lignes utiles */
fclose(f);
return 0;
}
if( strnicmp(Line, DOCFILE_IDENT, 10) != 0)
{
DisplayError(frame, wxT("File is NOT EESCHEMA doclib!") );
fclose(f);
return 0;
}
while (GetLine(f, Line, &LineNum, sizeof(Line)) )
{
if (strncmp(Line, "$CMP",4) != 0)
{
msg.Printf( wxT("$CMP command expected in line %d, aborted."), LineNum);
DisplayError(frame, msg);
fclose(f);
return 0;
}
/* Read one $CMP/$ENDCMP part entry from library: */
Name = strtok(Line + 5,"\n\r");
wxString cmpname; cmpname = CONV_FROM_UTF8(Name);
Entry = FindLibPart(cmpname.GetData(),Libname,FIND_ALIAS);
while( GetLine(f, Line, &LineNum, sizeof(Line)) )
{
if( strncmp(Line, "$ENDCMP",7) == 0) break;
Text = strtok(Line + 2,"\n\r");
switch ( Line[0] )
{
case 'D':
if(Entry) Entry->m_Doc = CONV_FROM_UTF8(Text);
break;
case 'K':
if(Entry) Entry->m_KeyWord = CONV_FROM_UTF8(Text);
break;
case 'F':
if(Entry) Entry->m_DocFile = CONV_FROM_UTF8(Text);
break;
}
}
}
fclose(f);
return 1;
}
/*********************************************************************************/
static bool ReadLibEntryDateAndTime(EDA_LibComponentStruct * LibEntry, char * Line)
/*********************************************************************************/
/* lit date et time de modif composant sous le format:
"Ti yy/mm/jj hh:mm:ss"
*/
{
int year,mon,day,hour,min,sec;
char * text;
year = mon = day = hour = min = sec = 0;
text = strtok(Line," \r\t\n");
text = strtok(NULL," \r\t\n"); // text pointe donnees utiles
sscanf(Line,"%d/%d/%d %d:%d:%d",&year,&mon,&day,&hour,&min,&sec);
LibEntry->m_LastDate = (sec & 63)
+ ((min & 63) << 6)
+ ((hour & 31) << 12)
+ ((day & 31) << 17)
+ ((mon & 15) << 22)
+ ((year-1990) << 26);
return TRUE;
}
/*******************************************/
static int SortItemsFct(const void * ref, const void * item);
void EDA_LibComponentStruct::SortDrawItems(void)
/*******************************************/
/* Trie les lments graphiques d'un composant lib pour amliorer
le trac:
items remplis en premier, pins en dernier
En cas de superposition d'items, c'est plus lisible
*/
{
LibEDA_BaseStruct ** Bufentry, ** BufentryBase, *Entry = m_Drawings;
int ii, nbitems;
if(Entry == NULL ) return; /* Pas d'alias pour ce composant */
/* calcul du nombre d'items */
for( nbitems = 0; Entry != NULL; Entry = Entry->Next()) nbitems++;
BufentryBase =
(LibEDA_BaseStruct **) MyZMalloc( (nbitems+1) * sizeof(LibEDA_BaseStruct *));
/* memorisation du chainage : */
for( Entry = m_Drawings, ii = 0; Entry != NULL; Entry = Entry->Next())
BufentryBase[ii++] = Entry;
/* Tri du chainage */
qsort(BufentryBase, nbitems, sizeof(LibEDA_BaseStruct *), SortItemsFct);
/* Mise a jour du chainage. Remarque:
le dernier element de BufEntryBase (BufEntryBase[nbitems]) est NULL*/
m_Drawings = * BufentryBase;
Bufentry = BufentryBase;
for (ii = 0 ; ii < nbitems; ii++)
{
(* Bufentry)->Pnext = * (Bufentry+1);
Bufentry++;
}
MyFree(BufentryBase);
}
int SortItemsFct(const void * ref, const void * item)
{
#define Ref (*(LibEDA_BaseStruct **)(ref))
#define Item (*(LibEDA_BaseStruct **)(item))
#define BEFORE -1
#define AFTER 1
int fill_ref = 0, fill_item = 0;
switch (Ref->m_StructType)
{
case COMPONENT_ARC_DRAW_TYPE:
{
const LibDrawArc * draw = (const LibDrawArc *) Ref;
fill_ref = draw->m_Fill;
break;
}
case COMPONENT_CIRCLE_DRAW_TYPE:
{
const LibDrawCircle * draw = (const LibDrawCircle *) Ref;
fill_ref = draw->m_Fill;
break;
}
case COMPONENT_RECT_DRAW_TYPE:
{
const LibDrawSquare * draw = (const LibDrawSquare *) Ref;
fill_ref = draw->m_Fill;
break;
}
case COMPONENT_POLYLINE_DRAW_TYPE:
{
const LibDrawPolyline * draw = (const LibDrawPolyline *) Ref;
fill_ref = draw->m_Fill;
break;
}
case COMPONENT_GRAPHIC_TEXT_DRAW_TYPE:
if ( Item->m_StructType == COMPONENT_PIN_DRAW_TYPE ) return BEFORE;
if ( Item->m_StructType == COMPONENT_GRAPHIC_TEXT_DRAW_TYPE ) return 0;
return 1;
break;
case COMPONENT_PIN_DRAW_TYPE:
if ( Item->m_StructType == COMPONENT_PIN_DRAW_TYPE )
{
int ii;
// We sort the pins by orientation
ii = ((LibDrawPin *) Ref)->m_Orient - ((LibDrawPin *) Item)->m_Orient;
if ( ii ) return ii;
/* We sort the pins by position (x or y).
note: at this point, most of pins have same x pos or y pos,
because they are sorted by orientation and generally are vertically or
horizontally aligned */
wxPoint pos_ref, pos_tst;
pos_ref = ((LibDrawPin *) Ref)->m_Pos;
pos_tst = ((LibDrawPin *) Item)->m_Pos;
if ( (ii = pos_ref.x - pos_tst.x) ) return ii;
ii = pos_ref.y - pos_tst.y;
return ii;
}
else return AFTER;
break;
}
/* Test de l'item */
switch (Item->m_StructType)
{
case COMPONENT_ARC_DRAW_TYPE:
{
const LibDrawArc * draw = (const LibDrawArc *) Item;
fill_item = draw->m_Fill;
break;
}
case COMPONENT_CIRCLE_DRAW_TYPE:
{
const LibDrawCircle * draw = (const LibDrawCircle *) Item;
fill_item = draw->m_Fill;
break;
}
case COMPONENT_RECT_DRAW_TYPE:
{
const LibDrawSquare * draw = (const LibDrawSquare *) Item;
fill_item = draw->m_Fill;
break;
}
case COMPONENT_POLYLINE_DRAW_TYPE:
{
const LibDrawPolyline * draw = (const LibDrawPolyline *) Item;
fill_item = draw->m_Fill;
break;
}
case COMPONENT_GRAPHIC_TEXT_DRAW_TYPE:
return BEFORE;
break;
case COMPONENT_PIN_DRAW_TYPE:
return BEFORE;
break;
}
if ( fill_ref & fill_item ) return 0;
if ( fill_ref ) return BEFORE;
return AFTER;
}
/*****************************************************************************/
int AddFootprintFilterList(EDA_LibComponentStruct *LibEntryLibEntry, FILE * f,
char * Line, int *LineNum)
/******************************************************************************/
/* read the FootprintFilter List stating with:
FPLIST
and ending with:
ENDFPLIST
*/
{
for ( ; ; )
{
if (GetLine(f, Line, LineNum, 1024 ) == NULL)
{
DisplayError(NULL, wxT("File ended prematurely"));
return 0;
}
if ( stricmp(Line, "$ENDFPLIST") == 0 )
{
break; /*normal exit on end of list */
}
LibEntryLibEntry->m_FootprintList.Add(CONV_FROM_UTF8(Line+1));
}
return 1;
}
/********************************************************/
/* Module to handle libraries (second part - drawing ). */
/********************************************************/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "program.h"
#include "libcmp.h"
#include "component_class.h"
#include "general.h"
#include "trigo.h"
#include "protos.h"
#define UNVISIBLE_COLOR DARKGRAY
//#define DRAW_ARC_WITH_ANGLE // pour trace arc avec routine utilsant les angles
/* Fonctions locales */
/* Description du composant <DUMMY> utilis lorsque des composants non trouvs
en librarie doivent etre dessins */
/*
ce composant est un rectangle de 400 mils de cot avec le texte ?? au centre
DEF DUMMY U 0 40 Y Y 1 0 N
F0 "U" 0 -350 60 H V
F1 "DUMMY" 0 350 60 H V
DRAW
T 0 0 0 150 0 0 0 ??
S -200 200 200 -200 0 1 0
ENDDRAW
ENDDEF
*/
static int s_ItemSelectColor = BROWN;
static EDA_LibComponentStruct * DummyCmp;
static int * Buf_Poly_Drawings, Buf_Poly_Size; // Used fo polyline drawings
static void DrawLibPartAux(WinEDA_DrawPanel * panel, wxDC * DC,
EDA_SchComponentStruct *Component,
EDA_LibComponentStruct *Entry,
const wxPoint & Pos,
int TransMat[2][2],
int Multi, int convert,
int DrawMode, int Color = -1, bool DrawPinText = TRUE);
/******************************/
static void CreateDummyCmp(void)
/******************************/
{
DummyCmp = new EDA_LibComponentStruct( NULL);
LibDrawSquare * Square = new LibDrawSquare();
Square->m_Start = wxPoint(- 200,200);
Square->m_End = wxPoint(200, - 200);
Square->m_Width = 4;
LibDrawText * Text = new LibDrawText();
Text->m_Size.x = Text->m_Size.y = 150;
Text->m_Text = wxT("??");
DummyCmp->m_Drawings = Square;
Square->Pnext = Text;
}
/*************************************************************/
void DrawLibEntry(WinEDA_DrawPanel * panel,wxDC * DC,
EDA_LibComponentStruct *LibEntry,
int posX, int posY,
int Multi, int convert,
int DrawMode, int Color)
/**************************************************************/
/* Routine de dessin d'un composant d'une librairie
LibEntry = pointeur sur la description en librairie
posX, posY = position du composant
DrawMode = GrOR ..
Color = 0 : dessin en vraies couleurs, sinon couleur = Color
Une croix symbolise le point d'accrochage (ref position) du composant
Le composant est toujours trace avec orientation 0
*/
{
int color;
int TransMat[2][2];
wxString Prefix;
LibDrawField * Field;
wxPoint text_pos;
/* Orientation normale */
TransMat[0][0] = 1; TransMat[1][1] = -1;
TransMat[1][0] = TransMat[0][1] = 0;
DrawLibPartAux(panel, DC, NULL, LibEntry, wxPoint(posX, posY),
TransMat, Multi,
convert, DrawMode, Color);
/* Trace des 2 champs ref et value (Attention aux coord: la matrice
de transformation change de signe les coord Y */
GRSetDrawMode(DC, DrawMode);
if( LibEntry->m_Prefix.m_Attributs & TEXT_NO_VISIBLE )
{
if( Color >= 0 ) color = Color;
else color = UNVISIBLE_COLOR;
}
else {
if( Color >= 0) color = Color;
else color = ReturnLayerColor(LAYER_REFERENCEPART);
}
if (LibEntry->m_UnitCount > 1)
Prefix.Printf( wxT("%s?%c"),LibEntry->m_Prefix.m_Text.GetData(),Multi + 'A' - 1);
else Prefix = LibEntry->m_Prefix.m_Text + wxT("?");
text_pos.x = LibEntry->m_Prefix.m_Pos.x + posX;
text_pos.y = posY - LibEntry->m_Prefix.m_Pos.y;
DrawGraphicText(panel, DC, text_pos,
color,LibEntry->m_Prefix.m_Text.GetData(),
LibEntry->m_Prefix.m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
LibEntry->m_Prefix.m_Size,
LibEntry->m_Prefix.m_HJustify, LibEntry->m_Prefix.m_VJustify);
if( LibEntry->m_Name.m_Attributs & TEXT_NO_VISIBLE )
{
if( Color >= 0) color = Color;
else color = UNVISIBLE_COLOR;
}
else {
if( Color >= 0 ) color = Color;
else color = ReturnLayerColor(LAYER_VALUEPART);
}
text_pos.x = LibEntry->m_Name.m_Pos.x + posX;
text_pos.y = posY - LibEntry->m_Name.m_Pos.y;
DrawGraphicText(panel, DC, text_pos,
color, LibEntry->m_Name.m_Text.GetData(),
LibEntry->m_Name.m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
LibEntry->m_Name.m_Size,
LibEntry->m_Name.m_HJustify, LibEntry->m_Name.m_VJustify);
for( Field = LibEntry->Fields; Field != NULL; Field = (LibDrawField *)Field->Pnext )
{
if( Field->m_Text.IsEmpty() ) return;
if( Field->m_Attributs & TEXT_NO_VISIBLE )
{
if( Color >= 0) color = Color;
else color = UNVISIBLE_COLOR;
}
else {
if( Color >= 0) color = Color;
else color = ReturnLayerColor(LAYER_FIELDS);
}
text_pos.x = Field->m_Pos.x + posX;
text_pos.y = posY - Field->m_Pos.y;
DrawGraphicText(panel, DC, text_pos,
color, Field->m_Text,
Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
Field->m_Size,
Field->m_HJustify, Field->m_VJustify);
}
// Trac de l'ancre
int len = 3 * panel->GetZoom();
GRLine(&panel->m_ClipBox, DC, posX, posY - len, posX, posY + len, color);
GRLine(&panel->m_ClipBox, DC, posX - len, posY, posX + len, posY, color);
}
/*****************************************************************************
* Routine to draw the given part at given position, transformed/mirror as *
* specified, and in the given drawing mode. Only this one is visible... *
*****************************************************************************/
void EDA_SchComponentStruct::Draw(WinEDA_DrawPanel * panel,wxDC * DC,
const wxPoint & offset, int DrawMode, int Color)
{
EDA_LibComponentStruct *Entry;
int ii;
bool dummy = FALSE;
if( (Entry = FindLibPart(m_ChipName.GetData(),wxEmptyString,FIND_ROOT)) == NULL)
{ /* composant non trouv, on affiche un composant "dummy" */
dummy = TRUE;
if( DummyCmp == NULL ) CreateDummyCmp();
Entry = DummyCmp;
}
DrawLibPartAux(panel, DC, this, Entry, m_Pos + offset,
m_Transform,
dummy ? 0 : m_Multi,
dummy ? 0 : m_Convert,
DrawMode);
/* Trace des champs, avec placement et orientation selon orient. du
composant
*/
if( ((m_Field[REFERENCE].m_Attributs & TEXT_NO_VISIBLE) == 0)
&& ! (m_Field[REFERENCE].m_Flags & IS_MOVED) )
{
if ( Entry->m_UnitCount > 1 )
DrawTextField(panel, DC, &m_Field[REFERENCE],1,DrawMode);
else
DrawTextField(panel, DC, &m_Field[REFERENCE],0,DrawMode);
}
for( ii = VALUE; ii < NUMBER_OF_FIELDS; ii++ )
{
if (m_Field[ii].m_Flags & IS_MOVED) continue;
DrawTextField(panel, DC, &m_Field[ii],0,DrawMode);
}
}
/***********************************************************/
void DrawTextField(WinEDA_DrawPanel * panel,wxDC * DC,
PartTextStruct * Field, int IsMulti, int DrawMode)
/***********************************************************/
/* Routine de trace des textes type Field du composant.
entree:
IsMulti: flag Non Null si il y a plusieurs parts par boitier.
n'est utile que pour le champ reference pour ajouter a celui ci
l'identification de la part ( A, B ... )
DrawMode: mode de trace
*/
{
int orient, color;
wxPoint pos; /* Position des textes */
EDA_SchComponentStruct *DrawLibItem = (EDA_SchComponentStruct *) Field->m_Parent;
int hjustify, vjustify;
if( Field->m_Attributs & TEXT_NO_VISIBLE ) return;
if( Field->IsVoid() ) return;
GRSetDrawMode(DC, DrawMode);
/* Calcul de la position des textes, selon orientation du composant */
orient = Field->m_Orient;
hjustify = Field->m_HJustify; vjustify = Field->m_VJustify;
pos.x = Field->m_Pos.x - DrawLibItem->m_Pos.x;
pos.y = Field->m_Pos.y - DrawLibItem->m_Pos.y;
pos = DrawLibItem->GetScreenCoord(pos);
pos.x += DrawLibItem->m_Pos.x;
pos.y += DrawLibItem->m_Pos.y;
/* Y a t-il rotation (pour l'orientation, la justification)*/
if(DrawLibItem->m_Transform[0][1]) // Rotation du composant de 90deg
{
if ( orient == TEXT_ORIENT_HORIZ) orient = TEXT_ORIENT_VERT;
else orient = TEXT_ORIENT_HORIZ;
/* Y a t-il rotation, miroir (pour les justifications)*/
EXCHG(hjustify, vjustify);
if (DrawLibItem->m_Transform[1][0] < 0 ) vjustify = - vjustify;
if (DrawLibItem->m_Transform[1][0] > 0 ) hjustify = - hjustify;
}
else
{ /* Texte horizontal: Y a t-il miroir (pour les justifications)*/
if (DrawLibItem->m_Transform[0][0] < 0 )
hjustify = - hjustify;
if (DrawLibItem->m_Transform[1][1] > 0 )
vjustify = - vjustify;
}
if( Field->m_FieldId == REFERENCE )
color = ReturnLayerColor(LAYER_REFERENCEPART);
else if( Field->m_FieldId == VALUE )
color = ReturnLayerColor(LAYER_VALUEPART);
else color = ReturnLayerColor(LAYER_FIELDS);
if( !IsMulti || (Field->m_FieldId != REFERENCE) )
{
DrawGraphicText(panel, DC, pos, color, Field->m_Text.GetData(),
orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
Field->m_Size,
hjustify, vjustify);
}
else /* Le champ est la reference, et il y a plusieurs parts par boitier */
{/* On ajoute alors A ou B ... a la reference */
wxString fulltext = Field->m_Text;
fulltext.Append('A' - 1 + DrawLibItem->m_Multi);
DrawGraphicText(panel, DC, pos, color, fulltext.GetData(),
orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
Field->m_Size,
hjustify, vjustify);
}
}
/********************************************************************************/
EDA_LibComponentStruct *FindLibPart(const wxChar *Name, const wxString & LibName, int Alias)
/********************************************************************************/
/*
Routine to find a part in one of the libraries given its name.
Name = Name of part.
LibName = Name of Lib; if "": seach in all libs
Alias = Flag: si flag != 0, retourne un pointeur sur une part ou un alias
si flag = 0, retourne un pointeur sur une part meme si le nom
correspond a un alias
Alias = FIND_ROOT, ou Alias = FIND_ALIAS
*/
{
EDA_LibComponentStruct *Entry;
static EDA_LibComponentStruct DummyEntry(wxEmptyString); /* Used only to call PQFind. */
LibraryStruct *Lib = g_LibraryList;
DummyEntry.m_Drawings = NULL; /* Used only to call PQFind. */
DummyEntry.m_Name.m_Text = Name;
PQCompFunc((PQCompFuncType) LibraryEntryCompare);
Entry = NULL; FindLibName.Empty();
while (Lib)
{
if( ! LibName.IsEmpty() )
{
if( Lib->m_Name != LibName )
{
Lib = Lib->m_Pnext; continue ;
}
}
if( Lib == NULL ) break;
Entry = (EDA_LibComponentStruct*)PQFind(Lib->m_Entries, &DummyEntry);
if( Entry != NULL)
{
FindLibName = Lib->m_Name;
break;
}
Lib = Lib->m_Pnext;
}
/* Si le nom est un alias, recherche du vrai composant */
if( Entry )
{
if( (Entry->Type != ROOT ) && (Alias == FIND_ROOT) )
Entry = FindLibPart( ((EDA_LibCmpAliasStruct*)Entry)->m_RootName.GetData() ,
Lib->m_Name, FIND_ROOT);
}
return (Entry);
}
/*****************************************************************************
* Routine to draw the given part at given position, transformed/mirror as
* specified, and in the given drawing mode.
* if Color < 0: Draw in normal color
* else draw in color = Color
*****************************************************************************/
/* DrawMode = GrXOR, GrOR ..*/
void DrawLibPartAux(WinEDA_DrawPanel * panel,wxDC * DC,
EDA_SchComponentStruct *Component,
EDA_LibComponentStruct *Entry,
const wxPoint & Pos,
int TransMat[2][2],
int Multi, int convert, int DrawMode,
int Color, bool DrawPinText)
{
int i, x1, y1, x2, y2, t1, t2, orient;
LibEDA_BaseStruct *DEntry = NULL;
int CharColor;
int fill_option;
int SetHightColor;
//#define GETCOLOR(l) Color < 0 ? (ReturnLayerColor(l)| SetHightColor) : Color;
#define GETCOLOR(l) Color < 0 ? SetHightColor ? s_ItemSelectColor : (ReturnLayerColor(l)| SetHightColor) : Color;
if (Entry->m_Drawings == NULL) return;
GRSetDrawMode(DC, DrawMode);
for( DEntry = Entry->m_Drawings; DEntry != NULL;DEntry = DEntry->Next())
{
/* Elimination des elements non relatifs a l'unite */
if( Multi && DEntry->m_Unit && (DEntry->m_Unit != Multi) ) continue;
if( convert && DEntry->m_Convert && (DEntry->m_Convert != convert) )
continue;
if ( DEntry->m_Flags & IS_MOVED ) continue; // Element en deplacement non trace
SetHightColor = (DEntry->m_Selected & IS_SELECTED) ? HIGHT_LIGHT_FLAG : 0;
switch (DEntry->m_StructType)
{
case COMPONENT_ARC_DRAW_TYPE:
{
int xc,yc, x2, y2;
LibDrawArc * Arc = (LibDrawArc *) DEntry;
CharColor = GETCOLOR(LAYER_DEVICE);
xc = Pos.x + TransMat[0][0] * Arc->m_Pos.x +
TransMat[0][1] * Arc->m_Pos.y;
yc = Pos.y + TransMat[1][0] * Arc->m_Pos.x +
TransMat[1][1] * Arc->m_Pos.y;
x2 = Pos.x + TransMat[0][0] * Arc->m_Start.x +
TransMat[0][1] * Arc->m_Start.y;;
y2 = Pos.y + TransMat[1][0] * Arc->m_Start.x +
TransMat[1][1] * Arc->m_Start.y;
x1 = Pos.x + TransMat[0][0] * Arc->m_End.x +
TransMat[0][1] * Arc->m_End.y;;
y1 = Pos.y + TransMat[1][0] * Arc->m_End.x +
TransMat[1][1] * Arc->m_End.y;
t1 = Arc->t1; t2 = Arc->t2;
bool swap = MapAngles(&t1, &t2, TransMat);
if ( swap ) { EXCHG(x1,x2); EXCHG(y1, y2) }
fill_option = Arc->m_Fill & (~g_PrintFillMask);
if ( Color < 0 ) // Normal Color Layer
{
if ( (fill_option == FILLED_WITH_BG_BODYCOLOR) && ! g_IsPrinting )
GRFilledArc(&panel->m_ClipBox, DC, xc, yc, t1, t2,
Arc->m_Rayon, CharColor,
ReturnLayerColor(LAYER_DEVICE_BACKGROUND));
else if ( fill_option == FILLED_SHAPE)
GRFilledArc(&panel->m_ClipBox, DC, xc, yc, t1, t2,
Arc->m_Rayon, CharColor, CharColor);
#ifdef DRAW_ARC_WITH_ANGLE
else GRArc(&panel->m_ClipBox, DC, xc, yc, t1, t2,
Arc->m_Rayon, CharColor);
#else
else GRArc1(&panel->m_ClipBox, DC, x1, y1, x2, y2,
xc, yc , CharColor);
#endif
}
#ifdef DRAW_ARC_WITH_ANGLE
else GRArc(&panel->m_ClipBox, DC, xc, yc, t1, t2,
Arc->m_Rayon, CharColor);
#else
else GRArc1(&panel->m_ClipBox, DC, x1, y1, x2, y2,
xc, yc, CharColor);
#endif
}
break;
case COMPONENT_CIRCLE_DRAW_TYPE:
{
LibDrawCircle * Circle = (LibDrawCircle *) DEntry;
CharColor = GETCOLOR(LAYER_DEVICE);
x1 = Pos.x + TransMat[0][0] * Circle->m_Pos.x +
TransMat[0][1] * Circle->m_Pos.y;
y1 = Pos.y + TransMat[1][0] * Circle->m_Pos.x +
TransMat[1][1] * Circle->m_Pos.y;
fill_option = Circle->m_Fill & (~g_PrintFillMask);
if ( Color < 0 )
{
if ( (fill_option == FILLED_WITH_BG_BODYCOLOR) && ! g_IsPrinting )
GRFilledCircle(&panel->m_ClipBox, DC, x1, y1,
Circle->m_Rayon, CharColor,
ReturnLayerColor(LAYER_DEVICE_BACKGROUND));
else if ( fill_option == FILLED_SHAPE)
GRFilledCircle(&panel->m_ClipBox, DC, x1, y1,
Circle->m_Rayon, CharColor, CharColor);
else GRCircle(&panel->m_ClipBox, DC, x1, y1,
Circle->m_Rayon, CharColor);
}
else GRCircle(&panel->m_ClipBox, DC, x1, y1,
Circle->m_Rayon, CharColor);
}
break;
case COMPONENT_GRAPHIC_TEXT_DRAW_TYPE:
{
LibDrawText * Text = (LibDrawText *) DEntry;
CharColor = GETCOLOR(LAYER_DEVICE);
/* The text orientation may need to be flipped if the
transformation matrix cuases xy axes to be flipped. */
t1 = (TransMat[0][0] != 0) ^ (Text->m_Horiz != 0);
x1 = Pos.x + TransMat[0][0] * Text->m_Pos.x
+ TransMat[0][1] * Text->m_Pos.y;
y1 = Pos.y + TransMat[1][0] * Text->m_Pos.x
+ TransMat[1][1] * Text->m_Pos.y;
PutTextInfo(panel, DC, t1 ? TEXT_ORIENT_HORIZ : TEXT_ORIENT_VERT,
wxPoint(x1, y1),
Text->m_Size,
Text->m_Text, DrawMode,CharColor);
}
break;
case COMPONENT_RECT_DRAW_TYPE:
{
LibDrawSquare * Square = (LibDrawSquare *) DEntry;
CharColor = GETCOLOR(LAYER_DEVICE);
x1 = Pos.x + TransMat[0][0] * Square->m_Start.x
+ TransMat[0][1] * Square->m_Start.y;
y1 = Pos.y + TransMat[1][0] * Square->m_Start.x
+ TransMat[1][1] * Square->m_Start.y;
x2 = Pos.x + TransMat[0][0] * Square->m_End.x
+ TransMat[0][1] * Square->m_End.y;
y2 = Pos.y + TransMat[1][0] * Square->m_End.x
+ TransMat[1][1] * Square->m_End.y;
fill_option = Square->m_Fill & (~g_PrintFillMask);
if ( Color < 0 )
{
if ( (fill_option == FILLED_WITH_BG_BODYCOLOR) && ! g_IsPrinting )
GRFilledRect(&panel->m_ClipBox, DC, x1, y1, x2, y2,
CharColor,
ReturnLayerColor(LAYER_DEVICE_BACKGROUND));
else if ( fill_option == FILLED_SHAPE)
GRFilledRect(&panel->m_ClipBox, DC, x1, y1, x2, y2,
CharColor, CharColor);
else GRRect(&panel->m_ClipBox, DC, x1, y1, x2, y2,
CharColor);
}
else GRRect(&panel->m_ClipBox, DC, x1, y1, x2, y2,
CharColor);
}
break;
case COMPONENT_PIN_DRAW_TYPE: /* Trace des Pins */
{
LibDrawPin * Pin = (LibDrawPin *) DEntry;
if(Pin->m_Attributs & PINNOTDRAW)
{
if( (ActiveScreen->m_Type == SCHEMATIC_FRAME) &&
!g_ShowAllPins )
break;
}
/* Calcul de l'orientation reelle de la Pin */
orient = Pin->ReturnPinDrawOrient(TransMat);
/* Calcul de la position du point de reference */
x2 = Pos.x + (TransMat[0][0] * Pin->m_Pos.x)
+ (TransMat[0][1] * Pin->m_Pos.y);
y2 = Pos.y + (TransMat[1][0] * Pin->m_Pos.x)
+ (TransMat[1][1] * Pin->m_Pos.y);
/* Dessin de la pin et du symbole special associe */
CharColor = GETCOLOR(LAYER_PIN);
DrawPinSymbol(panel, DC, x2, y2, Pin->m_PinLen, orient,
Pin->m_PinShape, DrawMode,
CharColor );
if ( DrawPinText )
{
wxPoint pinpos(x2,y2);
CharColor = SetHightColor ? s_ItemSelectColor : Color;
Pin->DrawPinTexts(panel, DC, pinpos, orient,
Entry->m_TextInside,
Entry->m_DrawPinNum,Entry->m_DrawPinName,
CharColor, DrawMode);
}
}
break;
case COMPONENT_POLYLINE_DRAW_TYPE:
{
LibDrawPolyline * polyline = (LibDrawPolyline *) DEntry;
CharColor = GETCOLOR(LAYER_DEVICE);
if ( Buf_Poly_Drawings == NULL )
{
Buf_Poly_Size = polyline->n;
Buf_Poly_Drawings = (int *) MyMalloc(sizeof(int) * 2 * Buf_Poly_Size);
}
else if ( Buf_Poly_Size < polyline->n )
{
Buf_Poly_Size = polyline->n;
Buf_Poly_Drawings = (int *) realloc(Buf_Poly_Drawings,
sizeof(int) * 2 * Buf_Poly_Size);
}
for (i = 0; i < polyline->n; i++)
{
Buf_Poly_Drawings[i * 2] = Pos.x +
TransMat[0][0] * polyline->PolyList[i * 2] +
TransMat[0][1] * polyline->PolyList[i * 2 + 1];
Buf_Poly_Drawings[i * 2 + 1] = Pos.y +
TransMat[1][0] * polyline->PolyList[i * 2] +
TransMat[1][1] * polyline->PolyList[i * 2 + 1];
}
fill_option = polyline->m_Fill & (~g_PrintFillMask);
if ( Color < 0 )
{
if ( (fill_option == FILLED_WITH_BG_BODYCOLOR) && ! g_IsPrinting )
GRPoly(&panel->m_ClipBox, DC, polyline->n,
Buf_Poly_Drawings, 1, CharColor,
ReturnLayerColor(LAYER_DEVICE_BACKGROUND));
else if ( fill_option == FILLED_SHAPE)
GRPoly(&panel->m_ClipBox, DC, polyline->n,
Buf_Poly_Drawings, 1, CharColor, CharColor);
else GRPoly(&panel->m_ClipBox, DC, polyline->n,
Buf_Poly_Drawings, 0, CharColor, CharColor);
}
else GRPoly(&panel->m_ClipBox, DC, polyline->n,
Buf_Poly_Drawings, 0, CharColor, CharColor);
}
break;
default:
wxBell();
break;
} /* Fin Switch */
} /* Fin Boucle de dessin */
if ( g_DebugLevel > 4 ) /* Draw the component boundary box */
{
EDA_Rect BoundaryBox;
if ( Component ) BoundaryBox = Component->GetBoundaryBox();
else BoundaryBox = Entry->GetBoundaryBox(Multi, convert);
x1 = BoundaryBox.GetX();
y1 = BoundaryBox.GetY();
x2 = BoundaryBox.GetRight();
y2 = BoundaryBox.GetBottom();
GRRect(&panel->m_ClipBox, DC, x1, y1, x2, y2, BROWN);
BoundaryBox = Component->m_Field[REFERENCE].GetBoundaryBox();
x1 = BoundaryBox.GetX();
y1 = BoundaryBox.GetY();
x2 = BoundaryBox.GetRight();
y2 = BoundaryBox.GetBottom();
GRRect(&panel->m_ClipBox, DC, x1, y1, x2, y2, BROWN);
BoundaryBox = Component->m_Field[VALUE].GetBoundaryBox();
x1 = BoundaryBox.GetX();
y1 = BoundaryBox.GetY();
x2 = BoundaryBox.GetRight();
y2 = BoundaryBox.GetBottom();
GRRect(&panel->m_ClipBox, DC, x1, y1, x2, y2, BROWN);
}
}
/*******************************************************/
void DrawPinSymbol(WinEDA_DrawPanel * panel, wxDC * DC,
int posX, int posY, int len, int orient,
int Shape, int DrawMode, int Color)
/*******************************************************/
/* Dessine la pin du symbole en cours de trace
si Color != 0 dessin en couleur Color, sinon en couleurs standard.
*/
{
int MapX1, MapY1, x1, y1;
int color;
if( Color >= 0) color = Color;
else color = ReturnLayerColor(LAYER_PIN);
GRSetDrawMode(DC, DrawMode);
MapX1 = MapY1 = 0; x1 = posX; y1 = posY;
switch ( orient )
{
case PIN_UP:
y1 = posY - len; MapY1 = 1;
break;
case PIN_DOWN:
y1 = posY + len; MapY1 = -1;
break;
case PIN_LEFT:
x1 = posX - len, MapX1 = 1;
break;
case PIN_RIGHT:
x1 = posX + len; MapX1 = -1;
break;
}
if( Shape & INVERT)
{
GRCircle(&panel->m_ClipBox, DC, MapX1 * INVERT_PIN_RADIUS + x1,
MapY1 * INVERT_PIN_RADIUS + y1,
INVERT_PIN_RADIUS, color);
GRMoveTo(MapX1 * INVERT_PIN_RADIUS * 2 + x1,
MapY1 * INVERT_PIN_RADIUS * 2 + y1);
GRLineTo(&panel->m_ClipBox, DC, posX, posY, color);
}
else
{
GRMoveTo(x1, y1);
GRLineTo(&panel->m_ClipBox, DC, posX, posY, color);
}
if(Shape & CLOCK)
{
if(MapY1 == 0 ) /* MapX1 = +- 1 */
{
GRMoveTo(x1, y1 + CLOCK_PIN_DIM);
GRLineTo(&panel->m_ClipBox, DC, x1 - MapX1 * CLOCK_PIN_DIM, y1, color);
GRLineTo(&panel->m_ClipBox, DC, x1, y1 - CLOCK_PIN_DIM, color);
}
else /* MapX1 = 0 */
{
GRMoveTo(x1 + CLOCK_PIN_DIM, y1 );
GRLineTo(&panel->m_ClipBox, DC, x1, y1 - MapY1 * CLOCK_PIN_DIM, color);
GRLineTo(&panel->m_ClipBox, DC, x1 - CLOCK_PIN_DIM, y1, color);
}
}
if(Shape & LOWLEVEL_IN) /* IEEE symbol "Active Low Input" */
{
if(MapY1 == 0 ) /* MapX1 = +- 1 */
{
GRMoveTo(x1 + MapX1 * IEEE_SYMBOL_PIN_DIM*2, y1);
GRLineTo(&panel->m_ClipBox, DC, x1 + MapX1 * IEEE_SYMBOL_PIN_DIM*2,
y1 - IEEE_SYMBOL_PIN_DIM, color);
GRLineTo(&panel->m_ClipBox, DC, x1, y1, color);
}
else /* MapX1 = 0 */
{
GRMoveTo(x1, y1 + MapY1 * IEEE_SYMBOL_PIN_DIM*2);
GRLineTo(&panel->m_ClipBox, DC, x1 - IEEE_SYMBOL_PIN_DIM,
y1 + MapY1 * IEEE_SYMBOL_PIN_DIM*2, color);
GRLineTo(&panel->m_ClipBox, DC, x1 , y1, color);
}
}
if(Shape & LOWLEVEL_OUT) /* IEEE symbol "Active Low Output" */
{
if(MapY1 == 0 ) /* MapX1 = +- 1 */
{
GRMoveTo(x1, y1 - IEEE_SYMBOL_PIN_DIM);
GRLineTo(&panel->m_ClipBox, DC, x1 + MapX1 * IEEE_SYMBOL_PIN_DIM*2, y1, color);
}
else /* MapX1 = 0 */
{
GRMoveTo(x1 - IEEE_SYMBOL_PIN_DIM, y1);
GRLineTo(&panel->m_ClipBox, DC, x1 , y1 + MapY1 * IEEE_SYMBOL_PIN_DIM*2, color);
}
}
/* Draw the pin end target (active end of the pin) */
if ( ! g_IsPrinting ) // Draw but do not print the pin end target */
GRCircle(&panel->m_ClipBox, DC, posX,posY,TARGET_PIN_DIAM, color);
}
/*****************************************************************************
* Routine to rotate the given angular direction by the given Transformation. *
* Input (and output) angles must be as follows: *
* Unit is 0.1 degre *
* Angle1 in [0..3600], Angle2 > Angle1 in [0..7200]. Arc is assumed to be less *
* than 180.0 degrees. *
* Algorithm: *
* Map the angles to a point on the unit circle which is mapped using the *
* transform (only mirror and rotate so it remains on the unit circle) to *
* a new point which is used to detect new angle. *
*****************************************************************************/
bool MapAngles(int *Angle1, int *Angle2, int TransMat[2][2])
{
int Angle, Delta;
double x, y, t;
bool swap = FALSE;
Delta = *Angle2 - *Angle1;
if ( Delta >= 1800 )
{
*Angle1 -=1;
*Angle2 +=1;
}
x = cos(*Angle1 * M_PI / 1800.0);
y = sin(*Angle1 * M_PI / 1800.0);
t = x * TransMat[0][0] + y * TransMat[0][1];
y = x * TransMat[1][0] + y * TransMat[1][1];
x = t;
*Angle1 = (int) (atan2(y, x) * 1800.0 / M_PI + 0.5);
x = cos(*Angle2 * M_PI / 1800.0);
y = sin(*Angle2 * M_PI / 1800.0);
t = x * TransMat[0][0] + y * TransMat[0][1];
y = x * TransMat[1][0] + y * TransMat[1][1];
x = t;
*Angle2 = (int) (atan2(y, x) * 1800.0 / M_PI + 0.5);
NORMALIZE_ANGLE(*Angle1);
NORMALIZE_ANGLE(*Angle2);
if (*Angle2 < *Angle1) *Angle2 += 3600;
if (*Angle2 - *Angle1 > 1800)
{ /* Need to swap the two angles. */
Angle = (*Angle1);
*Angle1 = (*Angle2);
*Angle2 = Angle;
NORMALIZE_ANGLE(*Angle1);
NORMALIZE_ANGLE(*Angle2);
if (*Angle2 < *Angle1) *Angle2 += 3600;
swap = TRUE;
}
if ( Delta >= 1800 )
{
*Angle1 +=1;
*Angle2 -=1;
}
return swap;
}
/*****************************************************************************
* Routine to display an outline version of given library entry. *
* This routine is applied by the PlaceLibItem routine above. *
*****************************************************************************/
void DrawingLibInGhost(WinEDA_DrawPanel * panel, wxDC * DC,
EDA_LibComponentStruct *LibEntry,
EDA_SchComponentStruct *DrawLibItem, int PartX, int PartY,
int multi, int convert, int Color, bool DrawPinText)
{
int DrawMode = g_XorMode;
DrawLibPartAux(panel, DC, DrawLibItem, LibEntry, wxPoint(PartX, PartY),
DrawLibItem->m_Transform,
multi, convert, DrawMode, Color, DrawPinText);
}
/************************************************************/
/* Routine to draw One LibraryDrawStruct at given position, */
/* matrice de transformation 1 0 0 -1 (normale) */
/* DrawMode = GrXOR, GrOR .. */
/************************************************************/
/* Utilise en LibEdit et Lib Browse */
void DrawLibraryDrawStruct(WinEDA_DrawPanel * panel, wxDC * DC,
EDA_LibComponentStruct *LibEntry,
int PartX, int PartY,
LibEDA_BaseStruct *DrawItem, int Multi,
int DrawMode, int Color)
{
int i, x1, y1, x2, y2, t1, t2, orient;
int CharColor;
int TransMat[2][2];
int fill_option;
#undef GETCOLOR
#define GETCOLOR(l) Color < 0 ? ReturnLayerColor(l) : Color;
Multi = 0; /* unused */
/* Trace de la structure */
CharColor = GETCOLOR(LAYER_DEVICE);
GRSetDrawMode(DC, DrawMode);
TransMat[0][0] = 1;
TransMat[0][1] = TransMat[1][0] = 0;
TransMat[1][1] = -1;
switch (DrawItem->m_StructType)
{
case COMPONENT_ARC_DRAW_TYPE:
{
int xc,yc, x2,y2;
LibDrawArc * Arc = (LibDrawArc *) DrawItem;
t1 = Arc->t1; t2 = Arc->t2;
bool swap = MapAngles(&t1, &t2, TransMat);
xc = PartX + Arc->m_Pos.x;
yc = PartY - Arc->m_Pos.y;
x2 = PartX + Arc->m_Start.x;
y2 = PartY - Arc->m_Start.y;
x1 = PartX + Arc->m_End.x;
y1 = PartY - Arc->m_End.y;
if ( swap ) { EXCHG(x1,x2); EXCHG(y1, y2)}
fill_option = Arc->m_Fill & (~g_PrintFillMask);
if ( (Arc->m_Fill == FILLED_WITH_BG_BODYCOLOR) && ! g_IsPrinting )
GRFilledArc(&panel->m_ClipBox, DC, xc, yc, t1, t2,
Arc->m_Rayon, CharColor,
ReturnLayerColor(LAYER_DEVICE_BACKGROUND));
else if ( Arc->m_Fill == FILLED_SHAPE)
GRFilledArc(&panel->m_ClipBox, DC, xc, yc, t1, t2,
Arc->m_Rayon, CharColor, CharColor);
#ifdef DRAW_ARC_WITH_ANGLE
else GRArc(&panel->m_ClipBox, DC, xc, yc, t1, t2,
Arc->m_Rayon, CharColor);
#else
else GRArc1(&panel->m_ClipBox, DC, x1, y1, x2, y2,
xc, yc, CharColor);
#endif
}
break;
case COMPONENT_CIRCLE_DRAW_TYPE:
{
LibDrawCircle * Circle = (LibDrawCircle *) DrawItem;
x1 = PartX + Circle->m_Pos.x;
y1 = PartY - Circle->m_Pos.y;
fill_option = Circle->m_Fill & (~g_PrintFillMask);
if ( (fill_option == FILLED_WITH_BG_BODYCOLOR) && ! g_IsPrinting )
GRFilledCircle(&panel->m_ClipBox, DC, x1, y1,
Circle->m_Rayon, CharColor,
ReturnLayerColor(LAYER_DEVICE_BACKGROUND));
else if ( fill_option == FILLED_SHAPE)
GRFilledCircle(&panel->m_ClipBox, DC, x1, y1,
Circle->m_Rayon, CharColor, CharColor);
else GRCircle(&panel->m_ClipBox, DC, x1, y1,
Circle->m_Rayon, CharColor);
}
break;
case COMPONENT_GRAPHIC_TEXT_DRAW_TYPE:
{
LibDrawText * Text = (LibDrawText *) DrawItem;
x1 = PartX + Text->m_Pos.x;
y1 = PartY - Text->m_Pos.y;
PutTextInfo(panel, DC, Text->m_Horiz, wxPoint(x1, y1),
Text->m_Size, Text->m_Text,
DrawMode,CharColor);
}
break;
case COMPONENT_RECT_DRAW_TYPE:
{
LibDrawSquare * Square = (LibDrawSquare *) DrawItem;
x1 = PartX + Square->m_Start.x;
y1 = PartY - Square->m_Start.y;
x2 = PartX + Square->m_End.x;
y2 = PartY - Square->m_End.y;
fill_option = Square->m_Fill & (~g_PrintFillMask);
if ( (fill_option == FILLED_WITH_BG_BODYCOLOR) && ! g_IsPrinting )
GRFilledRect(&panel->m_ClipBox, DC, x1, y1, x2, y2,
CharColor,
ReturnLayerColor(LAYER_DEVICE_BACKGROUND));
else if ( fill_option == FILLED_SHAPE)
GRFilledRect(&panel->m_ClipBox, DC, x1, y1, x2, y2,
CharColor, CharColor);
else GRRect(&panel->m_ClipBox, DC, x1, y1, x2, y2,
CharColor);
}
break;
case COMPONENT_PIN_DRAW_TYPE: /* Trace des Pins */
{
LibDrawPin * Pin = (LibDrawPin *) DrawItem;
x2 = PartX + Pin->m_Pos.x;
y2 = PartY - Pin->m_Pos.y;
/* Compute the real pin orientation, i.e. pin orient + component orient */
orient = Pin->ReturnPinDrawOrient(TransMat);
/* Dessin de la pin et du symbole special associe */
if( Pin->m_Attributs & PINNOTDRAW) CharColor = DARKGRAY;
else CharColor = -1;
DrawPinSymbol(panel, DC, x2, y2, Pin->m_PinLen, orient,
Pin->m_PinShape, DrawMode);
wxPoint pinpos(x2,y2);
Pin->DrawPinTexts(panel, DC, pinpos, orient,
LibEntry->m_TextInside,
LibEntry->m_DrawPinNum,LibEntry->m_DrawPinName,
CharColor, DrawMode);
}
break;
case COMPONENT_POLYLINE_DRAW_TYPE:
{
LibDrawPolyline * polyline = (LibDrawPolyline *) DrawItem;
if ( Buf_Poly_Drawings == NULL )
{
Buf_Poly_Size = polyline->n;
Buf_Poly_Drawings = (int *) MyMalloc(sizeof(int) * 2 * Buf_Poly_Size);
}
else if ( Buf_Poly_Size < polyline->n )
{
Buf_Poly_Size = polyline->n;
Buf_Poly_Drawings = (int *) realloc(Buf_Poly_Drawings,
sizeof(int) * 2 * Buf_Poly_Size);
}
for (i = 0; i < polyline->n; i++)
{
Buf_Poly_Drawings[i * 2] = PartX + polyline->PolyList[i * 2];
Buf_Poly_Drawings[i * 2 + 1] = PartY - polyline->PolyList[i * 2 + 1];
}
fill_option = polyline->m_Fill & (~g_PrintFillMask);
if ( (fill_option == FILLED_WITH_BG_BODYCOLOR) && ! g_IsPrinting )
GRPoly(&panel->m_ClipBox, DC, polyline->n,
Buf_Poly_Drawings, 1, CharColor,
ReturnLayerColor(LAYER_DEVICE_BACKGROUND));
else if ( fill_option == FILLED_SHAPE)
GRPoly(&panel->m_ClipBox, DC, polyline->n,
Buf_Poly_Drawings, 1, CharColor, CharColor);
else GRPoly(&panel->m_ClipBox, DC, polyline->n,
Buf_Poly_Drawings, 0, CharColor, CharColor);
break;
}
}
}
...@@ -161,8 +161,7 @@ void InstallErcFrame(WinEDA_SchematicFrame *parent, wxPoint & pos) ...@@ -161,8 +161,7 @@ void InstallErcFrame(WinEDA_SchematicFrame *parent, wxPoint & pos)
/*********************************************/ /*********************************************/
void WinEDA_ErcFrame::ReBuildMatrixPanel(void) void WinEDA_ErcFrame::ReBuildMatrixPanel(void)
/*********************************************/ /*********************************************/
/* construit ou reconstruit le panel d'affichage de la matrice de /* Build or rebuild the panel showing the ERC matrix
controle ERC
*/ */
{ {
int ii, jj, event_id, text_height; int ii, jj, event_id, text_height;
...@@ -666,10 +665,9 @@ int ref_elect_type, jj, erc = OK, local_minconn; ...@@ -666,10 +665,9 @@ int ref_elect_type, jj, erc = OK, local_minconn;
/********************************************************/ /********************************************************/
static bool WriteDiagnosticERC(const wxString & FullFileName) static bool WriteDiagnosticERC(const wxString & FullFileName)
/*********************************************************/ /*********************************************************/
/* Genere le fichier des diagnostics /* Create the Diagnostic file (<xxx>.erc file)
*/ */
{ {
SCH_SCREEN * Window;
EDA_BaseStruct * DrawStruct; EDA_BaseStruct * DrawStruct;
DrawMarkerStruct * Marker; DrawMarkerStruct * Marker;
char Line[256]; char Line[256];
...@@ -683,22 +681,22 @@ wxString msg; ...@@ -683,22 +681,22 @@ wxString msg;
msg = _("ERC control"); msg = _("ERC control");
fprintf( OutErc, "%s (%s)\n", CONV_TO_UTF8(msg), Line); fprintf( OutErc, "%s (%s)\n", CONV_TO_UTF8(msg), Line);
for( Window = ScreenSch; Window != NULL; Window = (SCH_SCREEN*)Window->Pnext ) EDA_ScreenList ScreenList(NULL);
{ for ( SCH_SCREEN * Screen = ScreenList.GetFirst(); Screen != NULL; Screen = ScreenList.GetNext() )
Sheet = (DrawSheetStruct *) Window->m_Parent; {
Sheet = (DrawSheetStruct*) Screen;
msg.Printf( _("\n***** Sheet %d (%s)\n"), msg.Printf( _("\n***** Sheet %d (%s)\n"),
Window->m_SheetNumber, Sheet->m_SheetNumber,
Sheet ? Sheet->m_SheetName.GetData() : _("Root")); Screen == ScreenSch ? _("Root") : Sheet->m_SheetName.GetData());
fprintf( OutErc, "%s", CONV_TO_UTF8(msg)); fprintf( OutErc, "%s", CONV_TO_UTF8(msg));
DrawStruct = Window->EEDrawList; DrawStruct = Screen->EEDrawList;
for ( ; DrawStruct != NULL; DrawStruct = DrawStruct->Pnext) for ( ; DrawStruct != NULL; DrawStruct = DrawStruct->Pnext)
{ {
if(DrawStruct->m_StructType != DRAW_MARKER_STRUCT_TYPE ) if(DrawStruct->m_StructType != DRAW_MARKER_STRUCT_TYPE )
continue; continue;
/* Marqueur trouve */
/* Marqueur trouve */
Marker = (DrawMarkerStruct * ) DrawStruct; Marker = (DrawMarkerStruct * ) DrawStruct;
if( Marker->m_Type != MARQ_ERC ) continue; if( Marker->m_Type != MARQ_ERC ) continue;
/* Write diag marqueur */ /* Write diag marqueur */
...@@ -707,8 +705,8 @@ wxString msg; ...@@ -707,8 +705,8 @@ wxString msg;
(float)Marker->m_Pos.x / 1000, (float)Marker->m_Pos.x / 1000,
(float)Marker->m_Pos.y / 1000); (float)Marker->m_Pos.y / 1000);
fprintf( OutErc, "%s", CONV_TO_UTF8(msg)); fprintf( OutErc, "%s", CONV_TO_UTF8(msg));
}
} }
}
msg.Printf( _("\n >> Errors ERC: %d\n"), g_EESchemaVar.NbErrorErc); msg.Printf( _("\n >> Errors ERC: %d\n"), g_EESchemaVar.NbErrorErc);
fprintf( OutErc, "%s", CONV_TO_UTF8(msg)); fprintf( OutErc, "%s", CONV_TO_UTF8(msg));
fclose ( OutErc ); fclose ( OutErc );
......
...@@ -174,7 +174,7 @@ void InstallNetlistFrame(WinEDA_SchematicFrame *parent, wxPoint & pos) ...@@ -174,7 +174,7 @@ void InstallNetlistFrame(WinEDA_SchematicFrame *parent, wxPoint & pos)
} }
#define H_SIZE 370 #define H_SIZE 370
#define V_SIZE 260 #define V_SIZE 300
/*************************************************************************************/ /*************************************************************************************/
WinEDA_NetlistFrame::WinEDA_NetlistFrame(WinEDA_SchematicFrame *parent, wxPoint& framepos): WinEDA_NetlistFrame::WinEDA_NetlistFrame(WinEDA_SchematicFrame *parent, wxPoint& framepos):
......
...@@ -528,8 +528,10 @@ int margin; ...@@ -528,8 +528,10 @@ int margin;
PlotFileName = MakeFileName(dirbuf, ShortFileName, wxT(".plt")); PlotFileName = MakeFileName(dirbuf, ShortFileName, wxT(".plt"));
else PlotFileName = MakeFileName(dirbuf, g_DefaultSchematicFileName, wxT(".plt")); else PlotFileName = MakeFileName(dirbuf, g_DefaultSchematicFileName, wxT(".plt"));
setlocale(LC_NUMERIC, "C");
InitPlotParametresHPGL(PlotOffset, g_PlotScaleX, g_PlotScaleY); InitPlotParametresHPGL(PlotOffset, g_PlotScaleX, g_PlotScaleY);
Plot_1_Page_HPGL(PlotFileName,screen); Plot_1_Page_HPGL(PlotFileName,screen);
setlocale(LC_NUMERIC, "");
screen = (BASE_SCREEN*)screen->Pnext; screen = (BASE_SCREEN*)screen->Pnext;
if ( Select_PlotAll == FALSE ) break; if ( Select_PlotAll == FALSE ) break;
} }
......
...@@ -391,6 +391,7 @@ wxPoint StartPos, EndPos; ...@@ -391,6 +391,7 @@ wxPoint StartPos, EndPos;
return ; return ;
} }
setlocale(LC_NUMERIC, "C");
Line.Printf(_("Plot: %s\n"), FileName.GetData()) ; Line.Printf(_("Plot: %s\n"), FileName.GetData()) ;
m_MsgBox->AppendText(Line); m_MsgBox->AppendText(Line);
...@@ -507,6 +508,7 @@ wxPoint StartPos, EndPos; ...@@ -507,6 +508,7 @@ wxPoint StartPos, EndPos;
/* fin */ /* fin */
CloseFilePS(PlotOutput); CloseFilePS(PlotOutput);
setlocale(LC_NUMERIC, "");
m_MsgBox->AppendText( wxT("Ok\n")); m_MsgBox->AppendText( wxT("Ok\n"));
} }
......
...@@ -233,12 +233,14 @@ int ii; ...@@ -233,12 +233,14 @@ int ii;
/* Update the part selection box */ /* Update the part selection box */
int jj = 1; int jj = 1;
if( CurrentLibEntry ) jj = CurrentLibEntry->m_UnitCount; if( CurrentLibEntry ) jj = CurrentLibEntry->m_UnitCount;
for ( ii = 0; ii < jj ; ii ++ ) if ( jj > 1 )
{ for ( ii = 0; ii < jj ; ii ++ )
wxString msg; {
msg.Printf(_("Part %c"), 'A' + ii); wxString msg;
m_SelpartBox->Append(msg); msg.Printf(_("Part %c"), 'A' + ii);
} m_SelpartBox->Append(msg);
}
else m_SelpartBox->Append( wxEmptyString );
m_SelpartBox->SetSelection( ( CurrentUnit > 0 ) ? CurrentUnit-1 : 0); m_SelpartBox->SetSelection( ( CurrentUnit > 0 ) ? CurrentUnit-1 : 0);
if( CurrentLibEntry) if( CurrentLibEntry)
......
/////////////////////////////////////////////////////////////////////////////
// Name: xx.cpp
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 02/03/2006 09:16:35
// RCS-ID:
// Copyright: License GNU
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 02/03/2006 09:16:35
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "xx.h"
#endif
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
////@begin includes
////@end includes
#include "xx.h"
////@begin XPM images
////@end XPM images
/*!
* xx type definition
*/
IMPLEMENT_DYNAMIC_CLASS( xx, wxDialog )
/*!
* xx event table definition
*/
BEGIN_EVENT_TABLE( xx, wxDialog )
////@begin xx event table entries
////@end xx event table entries
END_EVENT_TABLE()
/*!
* xx constructors
*/
xx::xx( )
{
}
xx::xx( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
Create(parent, id, caption, pos, size, style);
}
/*!
* xx creator
*/
bool xx::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
////@begin xx member initialisation
////@end xx member initialisation
////@begin xx creation
SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS);
wxDialog::Create( parent, id, caption, pos, size, style );
CreateControls();
GetSizer()->Fit(this);
GetSizer()->SetSizeHints(this);
Centre();
////@end xx creation
return true;
}
/*!
* Control creation for xx
*/
void xx::CreateControls()
{
////@begin xx content construction
// Generated by DialogBlocks, 02/03/2006 09:16:35 (unregistered)
xx* itemDialog1 = this;
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
itemDialog1->SetSizer(itemBoxSizer2);
////@end xx content construction
}
/*!
* Should we show tooltips?
*/
bool xx::ShowToolTips()
{
return true;
}
/*!
* Get bitmap resources
*/
wxBitmap xx::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin xx bitmap retrieval
wxUnusedVar(name);
return wxNullBitmap;
////@end xx bitmap retrieval
}
/*!
* Get icon resources
*/
wxIcon xx::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin xx icon retrieval
wxUnusedVar(name);
return wxNullIcon;
////@end xx icon retrieval
}
/////////////////////////////////////////////////////////////////////////////
// Name: xx.h
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 02/03/2006 09:16:35
// RCS-ID:
// Copyright: License GNU
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 02/03/2006 09:16:35
#ifndef _XX_H_
#define _XX_H_
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "xx.h"
#endif
/*!
* Includes
*/
////@begin includes
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
#define ID_DIALOG 10015
#define SYMBOL_XX_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
#define SYMBOL_XX_TITLE _("xx")
#define SYMBOL_XX_IDNAME ID_DIALOG
#define SYMBOL_XX_SIZE wxSize(400, 300)
#define SYMBOL_XX_POSITION wxDefaultPosition
////@end control identifiers
/*!
* Compatibility
*/
#ifndef wxCLOSE_BOX
#define wxCLOSE_BOX 0x1000
#endif
/*!
* xx class declaration
*/
class xx: public wxDialog
{
DECLARE_DYNAMIC_CLASS( xx )
DECLARE_EVENT_TABLE()
public:
/// Constructors
xx( );
xx( wxWindow* parent, wxWindowID id = SYMBOL_XX_IDNAME, const wxString& caption = SYMBOL_XX_TITLE, const wxPoint& pos = SYMBOL_XX_POSITION, const wxSize& size = SYMBOL_XX_SIZE, long style = SYMBOL_XX_STYLE );
/// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_XX_IDNAME, const wxString& caption = SYMBOL_XX_TITLE, const wxPoint& pos = SYMBOL_XX_POSITION, const wxSize& size = SYMBOL_XX_SIZE, long style = SYMBOL_XX_STYLE );
/// Creates the controls and sizers
void CreateControls();
////@begin xx event handler declarations
////@end xx event handler declarations
////@begin xx member function declarations
/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end xx member function declarations
/// Should we show tooltips?
static bool ShowToolTips();
////@begin xx member variables
////@end xx member variables
};
#endif
// _XX_H_
...@@ -69,7 +69,6 @@ char text[1024]; ...@@ -69,7 +69,6 @@ char text[1024];
fprintf(File,"$SETUP\n"); fprintf(File,"$SETUP\n");
sprintf(text, "InternalUnit %f INCH\n", 1.0/PCB_INTERNAL_UNIT); sprintf(text, "InternalUnit %f INCH\n", 1.0/PCB_INTERNAL_UNIT);
to_point(text);
fprintf(File, text); fprintf(File, text);
Pcb->m_BoardSettings->m_CopperLayerCount = g_DesignSettings.m_CopperLayerCount; Pcb->m_BoardSettings->m_CopperLayerCount = g_DesignSettings.m_CopperLayerCount;
......
...@@ -109,7 +109,6 @@ bool WinEDA_GerberFrame::Read_GERBER_File(wxDC * DC, ...@@ -109,7 +109,6 @@ bool WinEDA_GerberFrame::Read_GERBER_File(wxDC * DC,
/* Lecture de 1 fichier gerber. /* Lecture de 1 fichier gerber.
Format Format
Imperial Imperial
2.3
Absolu Absolu
fin de bloc = * fin de bloc = *
CrLf apres chaque commande CrLf apres chaque commande
...@@ -148,6 +147,7 @@ int error = 0; ...@@ -148,6 +147,7 @@ int error = 0;
wxSetWorkingDirectory(wxPathOnly(GERBER_FullFileName)); wxSetWorkingDirectory(wxPathOnly(GERBER_FullFileName));
wxBusyCursor show_wait; wxBusyCursor show_wait;
setlocale(LC_NUMERIC, "C");
while( TRUE ) while( TRUE )
{ {
...@@ -237,6 +237,8 @@ wxBusyCursor show_wait; ...@@ -237,6 +237,8 @@ wxBusyCursor show_wait;
} }
fclose(gerber_layer->m_Current_File) ; fclose(gerber_layer->m_Current_File) ;
setlocale(LC_NUMERIC, "");
/* Init tableau des DCodes et Lecture fichier DCODES */ /* Init tableau des DCodes et Lecture fichier DCODES */
if ( !gerber_layer->m_As_DCode ) if ( !gerber_layer->m_As_DCode )
{ {
...@@ -266,7 +268,6 @@ wxBusyCursor show_wait; ...@@ -266,7 +268,6 @@ wxBusyCursor show_wait;
} }
} }
return TRUE; return TRUE;
} }
......
...@@ -101,17 +101,14 @@ char buf[256], * ptchar; ...@@ -101,17 +101,14 @@ char buf[256], * ptchar;
ptchar = buf; ptchar = buf;
while ( text && *text == ' ' ) text++; // Skip blanks before number while ( text && *text == ' ' ) text++; // Skip blanks before number
while ( text && *text) while ( text && *text)
{ {
if ( IsNumber(*text) ) if ( IsNumber(*text) )
{ {
* ptchar = * text; * ptchar = * text;
if ( * ptchar =='.' || *ptchar == ',' ) * ptchar = g_FloatSeparator;
text++; ptchar ++; text++; ptchar ++;
}
else break;
} }
else break;
}
*ptchar = 0; *ptchar = 0;
nb = atof(buf); nb = atof(buf);
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
COMMON_GLOBL wxString g_BuildVersion COMMON_GLOBL wxString g_BuildVersion
#ifdef EDA_BASE #ifdef EDA_BASE
(wxT("(2007-05-25)")) (wxT("(2007-06-12)"))
#endif #endif
; ;
......
...@@ -273,7 +273,6 @@ COMMON_GLOBL wxString g_UserLibDirBuffer; // Chemin des librairies de module don ...@@ -273,7 +273,6 @@ COMMON_GLOBL wxString g_UserLibDirBuffer; // Chemin des librairies de module don
/* variables globales generales */ /* variables globales generales */
COMMON_GLOBL int g_FloatSeparator; // = '.' ou = ',' selon locale pour l'ecriture des nombres flotttant
COMMON_GLOBL int g_DebugLevel; // 0= Pas de debug */ COMMON_GLOBL int g_DebugLevel; // 0= Pas de debug */
COMMON_GLOBL int g_MouseOldButtons; COMMON_GLOBL int g_MouseOldButtons;
COMMON_GLOBL int g_KeyPressed; COMMON_GLOBL int g_KeyPressed;
...@@ -352,7 +351,7 @@ class WinEDA_DrawPanel; ...@@ -352,7 +351,7 @@ class WinEDA_DrawPanel;
/* COMMON.CPP */ /* COMMON.CPP */
wxString ReturnPcbLayerName(int layer_number, bool is_filename = FALSE); wxString ReturnPcbLayerName(int layer_number, bool is_filename = FALSE, bool is_gui = FALSE);
/* Return the name of the layer number "layer_number". /* Return the name of the layer number "layer_number".
if "is_filename" == TRUE, the name can be used for a file name if "is_filename" == TRUE, the name can be used for a file name
(not internatinalized, no space)*/ (not internatinalized, no space)*/
......
...@@ -698,7 +698,7 @@ enum main_id { ...@@ -698,7 +698,7 @@ enum main_id {
ID_AUX_TOOLBAR_PCB_VIA_SIZE, ID_AUX_TOOLBAR_PCB_VIA_SIZE,
ID_AUX_TOOLBAR_PCB_TRACK_WIDTH, ID_AUX_TOOLBAR_PCB_TRACK_WIDTH,
ID_AUX_TOOLBAR_PCB_UNUSED1, ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR,
ID_AUX_TOOLBAR_PCB_UNUSED2, ID_AUX_TOOLBAR_PCB_UNUSED2,
ID_AUX_TOOLBAR_PCB_UNUSED3, ID_AUX_TOOLBAR_PCB_UNUSED3,
ID_AUX_TOOLBAR_PCB_UNUSED4, ID_AUX_TOOLBAR_PCB_UNUSED4,
......
...@@ -479,6 +479,7 @@ public: ...@@ -479,6 +479,7 @@ public:
// Gestion des layers: // Gestion des layers:
int SelectLayer(int default_layer, int min_layer, int max_layer); int SelectLayer(int default_layer, int min_layer, int max_layer);
void SelectLayerPair(void); void SelectLayerPair(void);
void SwitchLayer(wxDC *DC, int layer);
// divers // divers
void AddHistory(int value, DrawStructureType type); // Add value in data list history void AddHistory(int value, DrawStructureType type); // Add value in data list history
...@@ -528,6 +529,7 @@ public: ...@@ -528,6 +529,7 @@ public:
void ReCreateOptToolbar(void); void ReCreateOptToolbar(void);
void ReCreateMenuBar(void); void ReCreateMenuBar(void);
WinEDAChoiceBox * ReCreateLayerBox( WinEDA_Toolbar * parent); WinEDAChoiceBox * ReCreateLayerBox( WinEDA_Toolbar * parent);
void PrepareLayerIndicator(void);
void OnLeftClick(wxDC * DC, const wxPoint& MousePos); void OnLeftClick(wxDC * DC, const wxPoint& MousePos);
void OnLeftDClick(wxDC * DC, const wxPoint& MousePos); void OnLeftDClick(wxDC * DC, const wxPoint& MousePos);
void OnRightClick(const wxPoint& MousePos, wxMenu * PopMenu); void OnRightClick(const wxPoint& MousePos, wxMenu * PopMenu);
...@@ -627,6 +629,7 @@ public: ...@@ -627,6 +629,7 @@ public:
void Start_MoveOneNodeOrSegment(TRACK * track, wxDC * DC, int command); void Start_MoveOneNodeOrSegment(TRACK * track, wxDC * DC, int command);
bool PlaceDraggedTrackSegment(TRACK * Track, wxDC * DC); bool PlaceDraggedTrackSegment(TRACK * Track, wxDC * DC);
void Start_DragTrackSegmentAndKeepSlope(TRACK * track, wxDC * DC); void Start_DragTrackSegmentAndKeepSlope(TRACK * track, wxDC * DC);
void SwitchLayer(wxDC *DC, int layer);
// Edition des zones // Edition des zones
EDGE_ZONE * Del_SegmEdgeZone(wxDC * DC, EDGE_ZONE * edge_zone); EDGE_ZONE * Del_SegmEdgeZone(wxDC * DC, EDGE_ZONE * edge_zone);
......
/////////////////////////////////////////////////////////////////////////////
// Name: cleaningoptions_dialog.cpp
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 25/05/2007 14:24:54
// RCS-ID:
// Copyright: GNU License
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 25/05/2007 14:24:54
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "cleaningoptions_dialog.h"
#endif
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
////@begin includes
////@end includes
#include "cleaningoptions_dialog.h"
////@begin XPM images
////@end XPM images
/*!
* WinEDA_CleaningOptionsFrame type definition
*/
IMPLEMENT_DYNAMIC_CLASS( WinEDA_CleaningOptionsFrame, wxDialog )
/*!
* WinEDA_CleaningOptionsFrame event table definition
*/
BEGIN_EVENT_TABLE( WinEDA_CleaningOptionsFrame, wxDialog )
////@begin WinEDA_CleaningOptionsFrame event table entries
EVT_CLOSE( WinEDA_CleaningOptionsFrame::OnCloseWindow )
EVT_BUTTON( ID_BUTTON_EXECUTE, WinEDA_CleaningOptionsFrame::OnButtonExecuteClick )
////@end WinEDA_CleaningOptionsFrame event table entries
END_EVENT_TABLE()
/*!
* WinEDA_CleaningOptionsFrame constructors
*/
WinEDA_CleaningOptionsFrame::WinEDA_CleaningOptionsFrame()
{
Init();
}
WinEDA_CleaningOptionsFrame::WinEDA_CleaningOptionsFrame( WinEDA_PcbFrame* parent, wxDC * DC, wxWindowID id,
const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
Init();
m_Parent = parent;
m_DC = DC;
Create(parent, id, caption, pos, size, style);
}
/*!
* WinEDA_CleaningOptionsFrame creator
*/
bool WinEDA_CleaningOptionsFrame::Create( wxWindow * parent, wxWindowID id,
const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
////@begin WinEDA_CleaningOptionsFrame creation
SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
wxDialog::Create( parent, id, caption, pos, size, style );
CreateControls();
if (GetSizer())
{
GetSizer()->SetSizeHints(this);
}
Centre();
////@end WinEDA_CleaningOptionsFrame creation
return true;
}
/*!
* WinEDA_CleaningOptionsFrame destructor
*/
WinEDA_CleaningOptionsFrame::~WinEDA_CleaningOptionsFrame()
{
////@begin WinEDA_CleaningOptionsFrame destruction
////@end WinEDA_CleaningOptionsFrame destruction
}
/*!
* Member initialisation
*/
void WinEDA_CleaningOptionsFrame::Init()
{
m_Parent = NULL;
////@begin WinEDA_CleaningOptionsFrame member initialisation
m_CleanViasOpt = NULL;
m_MergetSegmOpt = NULL;
m_DeleteunconnectedOpt = NULL;
m_ConnectToPadsOpt = NULL;
////@end WinEDA_CleaningOptionsFrame member initialisation
}
/*!
* Control creation for WinEDA_CleaningOptionsFrame
*/
void WinEDA_CleaningOptionsFrame::CreateControls()
{
////@begin WinEDA_CleaningOptionsFrame content construction
// Generated by DialogBlocks, 28/05/2007 19:08:46 (unregistered)
WinEDA_CleaningOptionsFrame* itemDialog1 = this;
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
itemDialog1->SetSizer(itemBoxSizer2);
wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
wxStaticBox* itemStaticBoxSizer4Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Static"));
wxStaticBoxSizer* itemStaticBoxSizer4 = new wxStaticBoxSizer(itemStaticBoxSizer4Static, wxVERTICAL);
itemBoxSizer3->Add(itemStaticBoxSizer4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
m_CleanViasOpt = new wxCheckBox( itemDialog1, ID_CHECKBOX_CLEAN_VIAS, _("Delete redundant vias"), wxDefaultPosition, wxDefaultSize, 0 );
m_CleanViasOpt->SetValue(false);
itemStaticBoxSizer4->Add(m_CleanViasOpt, 0, wxALIGN_LEFT|wxALL, 5);
m_MergetSegmOpt = new wxCheckBox( itemDialog1, ID_CHECKBOX_MERGE_SEGMENTS, _("Merge segments"), wxDefaultPosition, wxDefaultSize, 0 );
m_MergetSegmOpt->SetValue(false);
itemStaticBoxSizer4->Add(m_MergetSegmOpt, 0, wxALIGN_LEFT|wxALL, 5);
m_DeleteunconnectedOpt = new wxCheckBox( itemDialog1, ID_CHECKBOX1, _("Delete unconnected tracks"), wxDefaultPosition, wxDefaultSize, 0 );
m_DeleteunconnectedOpt->SetValue(false);
itemStaticBoxSizer4->Add(m_DeleteunconnectedOpt, 0, wxALIGN_LEFT|wxALL, 5);
m_ConnectToPadsOpt = new wxCheckBox( itemDialog1, ID_CHECKBOX, _("Connect stubs to Pads"), wxDefaultPosition, wxDefaultSize, 0 );
m_ConnectToPadsOpt->SetValue(false);
itemStaticBoxSizer4->Add(m_ConnectToPadsOpt, 0, wxALIGN_LEFT|wxALL, 5);
wxBoxSizer* itemBoxSizer9 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer3->Add(itemBoxSizer9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxButton* itemButton10 = new wxButton( itemDialog1, ID_BUTTON_EXECUTE, _("Clean pcb"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton10->SetDefault();
itemBoxSizer9->Add(itemButton10, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
// Set validators
m_CleanViasOpt->SetValidator( wxGenericValidator(& s_CleanVias) );
m_MergetSegmOpt->SetValidator( wxGenericValidator(& s_MergeSegments) );
m_DeleteunconnectedOpt->SetValidator( wxGenericValidator(& s_DeleteUnconnectedSegm) );
////@end WinEDA_CleaningOptionsFrame content construction
}
/*!
* Should we show tooltips?
*/
bool WinEDA_CleaningOptionsFrame::ShowToolTips()
{
return true;
}
/*!
* Get bitmap resources
*/
wxBitmap WinEDA_CleaningOptionsFrame::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin WinEDA_CleaningOptionsFrame bitmap retrieval
wxUnusedVar(name);
return wxNullBitmap;
////@end WinEDA_CleaningOptionsFrame bitmap retrieval
}
/*!
* Get icon resources
*/
wxIcon WinEDA_CleaningOptionsFrame::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin WinEDA_CleaningOptionsFrame icon retrieval
wxUnusedVar(name);
return wxNullIcon;
////@end WinEDA_CleaningOptionsFrame icon retrieval
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_EXECUTE
*/
void WinEDA_CleaningOptionsFrame::OnButtonExecuteClick( wxCommandEvent& event )
{
s_CleanVias = m_CleanViasOpt->GetValue();
s_MergeSegments = m_MergetSegmOpt->GetValue();
s_DeleteUnconnectedSegm = m_DeleteunconnectedOpt->GetValue();
s_ConnectToPads = m_ConnectToPadsOpt->GetValue();
Clean_Pcb_Items(m_Parent, m_DC );
Close(TRUE);
}
/*!
* wxEVT_CLOSE_WINDOW event handler for ID_WIN_EDA_CLEANINGOPTIONSFRAME
*/
void WinEDA_CleaningOptionsFrame::OnCloseWindow( wxCloseEvent& event )
{
s_CleanVias = m_CleanViasOpt->GetValue();
s_MergeSegments = m_MergetSegmOpt->GetValue();
s_DeleteUnconnectedSegm = m_DeleteunconnectedOpt->GetValue();
s_ConnectToPads = m_ConnectToPadsOpt->GetValue();
event.Skip();
}
/////////////////////////////////////////////////////////////////////////////
// Name: cleaningoptions_dialog.h
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 25/05/2007 14:24:54
// RCS-ID:
// Copyright: GNU License
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 25/05/2007 14:24:54
#ifndef _CLEANINGOPTIONS_DIALOG_H_
#define _CLEANINGOPTIONS_DIALOG_H_
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "cleaningoptions_dialog.h"
#endif
/*!
* Includes
*/
////@begin includes
#include "wx/valgen.h"
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
#define ID_WIN_EDA_CLEANINGOPTIONSFRAME 10000
#define ID_CHECKBOX_CLEAN_VIAS 10001
#define ID_CHECKBOX_MERGE_SEGMENTS 10003
#define ID_CHECKBOX1 10005
#define ID_CHECKBOX 10004
#define ID_BUTTON_EXECUTE 10006
#define SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
#define SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_TITLE _("Cleaning options")
#define SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_IDNAME ID_WIN_EDA_CLEANINGOPTIONSFRAME
#define SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_SIZE wxSize(400, 300)
#define SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_POSITION wxDefaultPosition
////@end control identifiers
/*!
* WinEDA_CleaningOptionsFrame class declaration
*/
class WinEDA_CleaningOptionsFrame: public wxDialog
{
DECLARE_DYNAMIC_CLASS( WinEDA_CleaningOptionsFrame )
DECLARE_EVENT_TABLE()
public:
/// Constructors
WinEDA_CleaningOptionsFrame();
WinEDA_CleaningOptionsFrame( WinEDA_PcbFrame * parent, wxDC * DC,
wxWindowID id = SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_SIZE, long style = SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_STYLE );
/// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_SIZE, long style = SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_STYLE );
/// Destructor
~WinEDA_CleaningOptionsFrame();
/// Initialises member variables
void Init();
/// Creates the controls and sizers
void CreateControls();
////@begin WinEDA_CleaningOptionsFrame event handler declarations
/// wxEVT_CLOSE_WINDOW event handler for ID_WIN_EDA_CLEANINGOPTIONSFRAME
void OnCloseWindow( wxCloseEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_EXECUTE
void OnButtonExecuteClick( wxCommandEvent& event );
////@end WinEDA_CleaningOptionsFrame event handler declarations
////@begin WinEDA_CleaningOptionsFrame member function declarations
/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end WinEDA_CleaningOptionsFrame member function declarations
/// Should we show tooltips?
static bool ShowToolTips();
////@begin WinEDA_CleaningOptionsFrame member variables
wxCheckBox* m_CleanViasOpt;
wxCheckBox* m_MergetSegmOpt;
wxCheckBox* m_DeleteunconnectedOpt;
wxCheckBox* m_ConnectToPadsOpt;
////@end WinEDA_CleaningOptionsFrame member variables
WinEDA_PcbFrame * m_Parent;
wxDC * m_DC;
};
#endif
// _CLEANINGOPTIONS_DIALOG_H_
...@@ -134,7 +134,13 @@ int CurrentTime = time(NULL); ...@@ -134,7 +134,13 @@ int CurrentTime = time(NULL);
{ {
wxString tmpFileName = GetScreen()->m_FileName; wxString tmpFileName = GetScreen()->m_FileName;
wxString filename = g_SaveFileName + PcbExtBuffer; wxString filename = g_SaveFileName + PcbExtBuffer;
bool flgmodify = GetScreen()->IsModify();
((WinEDA_PcbFrame*)this)->SavePcbFile(filename); ((WinEDA_PcbFrame*)this)->SavePcbFile(filename);
if( flgmodify ) // Set the flags m_Modify cleared by SavePcbFile()
{
GetScreen()->SetModify();
GetScreen()->SetSave();// Set the flags m_FlagSave cleared by SetModify()
}
GetScreen()->m_FileName = tmpFileName; GetScreen()->m_FileName = tmpFileName;
SetTitle(GetScreen()->m_FileName); SetTitle(GetScreen()->m_FileName);
} }
...@@ -355,19 +361,19 @@ int CurrentTime = time(NULL); ...@@ -355,19 +361,19 @@ int CurrentTime = time(NULL);
OnHotKey(DC, hotkey, NULL); OnHotKey(DC, hotkey, NULL);
} }
} }
/****************************************************************/ /****************************************************************/
void WinEDA_BasePcbFrame::SwitchLayer(wxDC *DC, int layer) void WinEDA_BasePcbFrame::SwitchLayer(wxDC *DC, int layer)
/*****************************************************************/ /*****************************************************************/
{ {
//overridden in WinEDA_PcbFrame; //Note: overridden in WinEDA_PcbFrame;
int preslayer = GetScreen()->m_Active_Layer; int preslayer = GetScreen()->m_Active_Layer;
//if there is only one layer, don't switch. //if there is only one layer, don't switch.
if ( m_Pcb->m_BoardSettings->m_CopperLayerCount <= 1) if ( m_Pcb->m_BoardSettings->m_CopperLayerCount <= 1)
return; layer = LAYER_CUIVRE_N; // Of course we select the copper layer
//otherwise, must be at least 2 layers..see if it is possible. //otherwise, we select the requested layer only if it is possible
if(layer != LAYER_CUIVRE_N || layer != LAYER_CMP_N || if( layer != LAYER_CMP_N && layer >= m_Pcb->m_BoardSettings->m_CopperLayerCount-1 )
layer >= m_Pcb->m_BoardSettings->m_CopperLayerCount-1) return;
return;
if(preslayer == layer) if(preslayer == layer)
return; return;
......
<?xml version="1.0" encoding="UTF-8"?>
<anthemion-project version="1.0.0.0" xmlns="http://www.anthemion.co.uk">
<header>
<long name="name_counter">0</long>
<string name="html_path">""</string>
<string name="title">""</string>
<string name="author">""</string>
<string name="description">""</string>
<string name="xrc_filename">""</string>
<bool name="convert_images_to_xpm">0</bool>
<bool name="inline_images">0</bool>
<bool name="generate_cpp_for_xrc">0</bool>
<bool name="use_help_text_for_tooltips">1</bool>
<bool name="translate_strings">1</bool>
<bool name="extract_strings">0</bool>
<string name="user_name">"jean-pierre Charras"</string>
<string name="copyright_string">"GNU License"</string>
<string name="resource_prefix">""</string>
<bool name="use_two_step_construction">0</bool>
<bool name="use_enums">0</bool>
<string name="current_platform">"&lt;All platforms&gt;"</string>
<string name="target_wx_version">"2.8.3"</string>
<string name="cpp_header_comment">"/////////////////////////////////////////////////////////////////////////////
// Name: %HEADER-FILENAME%
// Purpose:
// Author: %AUTHOR%
// Modified by:
// Created: %DATE%
// RCS-ID:
// Copyright: %COPYRIGHT%
// Licence:
/////////////////////////////////////////////////////////////////////////////
"</string>
<string name="cpp_implementation_comment">"/////////////////////////////////////////////////////////////////////////////
// Name: %SOURCE-FILENAME%
// Purpose:
// Author: %AUTHOR%
// Modified by:
// Created: %DATE%
// RCS-ID:
// Copyright: %COPYRIGHT%
// Licence:
/////////////////////////////////////////////////////////////////////////////
"</string>
<string name="cpp_symbols_file_comment">"/////////////////////////////////////////////////////////////////////////////
// Name: %SYMBOLS-FILENAME%
// Purpose: Symbols file
// Author: %AUTHOR%
// Modified by:
// Created: %DATE%
// RCS-ID:
// Copyright: %COPYRIGHT%
// Licence:
/////////////////////////////////////////////////////////////////////////////
"</string>
<string name="cpp_header_preamble">"#if defined(__GNUG__) &amp;&amp; !defined(NO_GCC_PRAGMA)
#pragma interface &quot;%HEADER-FILENAME%&quot;
#endif
"</string>
<string name="cpp_implementation_preamble">"#if defined(__GNUG__) &amp;&amp; !defined(NO_GCC_PRAGMA)
#pragma implementation &quot;%HEADER-FILENAME%&quot;
#endif
// For compilers that support precompilation, includes &quot;wx/wx.h&quot;.
#include &quot;wx/wxprec.h&quot;
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include &quot;wx/wx.h&quot;
#endif
"</string>
<string name="cpp_function_declaration_comment">" /// %BODY%
"</string>
<string name="cpp_function_implementation_comment">"
/*!
* %BODY%
*/
"</string>
<string name="resource_file_header">"app_resources.h"</string>
<string name="resource_file_implementation">"app_resources.cpp"</string>
<string name="resource_class_name">"AppResources"</string>
<string name="app_file_header">"app.h"</string>
<string name="app_file_implementation">"app.cpp"</string>
<string name="app_class_name">"Application"</string>
<bool name="generate_app_class">0</bool>
<string name="external_symbol_filenames">""</string>
<string name="configuration">"&lt;None&gt;"</string>
<string name="source_encoding">"iso-8859-1"</string>
<string name="xrc_encoding">"utf-8"</string>
<string name="project_encoding">"utf-8"</string>
<string name="resource_archive">""</string>
<long name="text_file_type">0</long>
<bool name="use_tabs">0</bool>
<long name="indent_size">4</long>
<string name="whitespace_after_return_type">" "</string>
<string name="resource_xrc_cpp">""</string>
<bool name="use_resource_archive">0</bool>
<bool name="use_generated_xrc_cpp">0</bool>
<bool name="always_generate_xrc">1</bool>
<bool name="archive_xrc_files">1</bool>
<bool name="archive_image_files">1</bool>
<bool name="archive_all_image_files">0</bool>
<bool name="xrc_retain_relative_paths">1</bool>
</header>
<data>
<document>
<string name="title">""</string>
<string name="type">"data-document"</string>
<string name="filename">""</string>
<string name="icon-name">""</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<document>
<string name="title">"Configurations"</string>
<string name="type">"config-data-document"</string>
<string name="filename">""</string>
<string name="icon-name">""</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="template-name">""</string>
<bool name="dirty">1</bool>
<string name="Compiler name">""</string>
<string name="Build mode">"Debug"</string>
<string name="Unicode mode">"ANSI"</string>
<string name="Shared mode">"Static"</string>
<string name="Modularity">"Modular"</string>
<string name="GUI mode">"GUI"</string>
<string name="Toolkit">"wxMSW"</string>
<string name="Runtime linking">"Dynamic"</string>
<string name="Use exceptions">"Yes"</string>
<string name="Use ODBC">"No"</string>
<string name="Use OpenGL">"No"</string>
<string name="wxWidgets version">"%WXVERSION%"</string>
<string name="Executable name">"%EXECUTABLE%"</string>
<string name="Program arguments">""</string>
<string name="Working path">"%AUTO%"</string>
<string name="Output path">"%AUTO%"</string>
<string name="Objects path">"%AUTO%"</string>
<string name="Compiler location">"%AUTO%"</string>
<string name="wxWidgets location">"%AUTO%"</string>
<string name="C++ command">"%AUTO%"</string>
<string name="Resource compiler">"%AUTO%"</string>
<string name="Make command">"%AUTO%"</string>
<string name="Project makefile">"%AUTO%"</string>
<string name="wxWidgets makefile">"%AUTO%"</string>
<string name="Compiler bin path">"%AUTO%"</string>
<string name="Compiler include path">"%AUTO%"</string>
<string name="Compiler lib path">"%AUTO%"</string>
<string name="Preprocessor flags">"%AUTO%"</string>
<string name="Optimizations">"%AUTO%"</string>
<string name="Warnings">"%AUTO%"</string>
<string name="Debug flags">"%AUTO%"</string>
<string name="Libraries">"%AUTO%"</string>
<string name="Library path">"%AUTO%"</string>
<string name="Linker flags">"%AUTO%"</string>
<string name="Include path">"%AUTO%"</string>
<string name="Resource flags">"%AUTO%"</string>
<string name="Resource path">"%AUTO%"</string>
<string name="wxWidgets build path">"%AUTO%"</string>
<string name="wxWidgets build command">"%AUTO%"</string>
<string name="wxWidgets clean command">"%AUTO%"</string>
<string name="PATH variable">"%AUTO%"</string>
</document>
</document>
</data>
<documents>
<document>
<string name="title">"Projects"</string>
<string name="type">"root-document"</string>
<string name="filename">""</string>
<string name="icon-name">"project"</string>
<long name="is-transient">1</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">1</long>
<document>
<string name="title">"Windows"</string>
<string name="type">"html-document"</string>
<string name="filename">""</string>
<string name="icon-name">"dialogsfolder"</string>
<long name="is-transient">1</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">1</long>
<document>
<string name="title">"Cleaning options"</string>
<string name="type">"dialog-document"</string>
<string name="filename">""</string>
<string name="icon-name">"dialog"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"25/5/2007"</string>
<string name="proxy-type">"wbDialogProxy"</string>
<long name="base-id">10000</long>
<bool name="use-id-prefix">0</bool>
<string name="id-prefix">""</string>
<bool name="use-id-suffix">0</bool>
<string name="id-suffix">""</string>
<long name="use-xrc">0</long>
<string name="event-handler-0">"wxEVT_CLOSE_WINDOW|OnCloseWindow|NONE||"</string>
<string name="proxy-Id name">"ID_WIN_EDA_CLEANINGOPTIONSFRAME"</string>
<long name="proxy-Id value">10000</long>
<string name="proxy-Class">"WinEDA_CleaningOptionsFrame"</string>
<string name="proxy-Base class">"wxDialog"</string>
<string name="proxy-Window kind">"wxDialog"</string>
<string name="proxy-Implementation filename">"cleaningoptions_dialog.cpp"</string>
<string name="proxy-Header filename">"cleaningoptions_dialog.h"</string>
<string name="proxy-XRC filename">""</string>
<string name="proxy-Title">"Cleaning options"</string>
<bool name="proxy-Centre">1</bool>
<string name="proxy-Icon">""</string>
<bool name="proxy-Dialog units">0</bool>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<bool name="proxy-wxDEFAULT_DIALOG_STYLE">0</bool>
<bool name="proxy-wxCAPTION">1</bool>
<bool name="proxy-wxRESIZE_BORDER">1</bool>
<bool name="proxy-wxTHICK_FRAME">0</bool>
<bool name="proxy-wxSYSTEM_MENU">1</bool>
<bool name="proxy-wxSTAY_ON_TOP">0</bool>
<bool name="proxy-wxDIALOG_NO_PARENT">0</bool>
<bool name="proxy-wxCLOSE_BOX">1</bool>
<bool name="proxy-wxMAXIMIZE_BOX">0</bool>
<bool name="proxy-wxMINIMIZE_BOX">0</bool>
<bool name="proxy-wxDIALOG_MODAL">1</bool>
<bool name="proxy-wxNO_BORDER">0</bool>
<bool name="proxy-wxSIMPLE_BORDER">0</bool>
<bool name="proxy-wxDOUBLE_BORDER">0</bool>
<bool name="proxy-wxSUNKEN_BORDER">0</bool>
<bool name="proxy-wxRAISED_BORDER">0</bool>
<bool name="proxy-wxSTATIC_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxCLIP_CHILDREN">0</bool>
<bool name="proxy-wxTAB_TRAVERSAL">0</bool>
<bool name="proxy-wxWS_EX_VALIDATE_RECURSIVELY">0</bool>
<bool name="proxy-wxWS_EX_BLOCK_EVENTS">1</bool>
<bool name="proxy-wxWS_EX_TRANSIENT">0</bool>
<string name="proxy-Custom styles">""</string>
<bool name="proxy-wxDIALOG_EX_CONTEXTHELP">0</bool>
<bool name="proxy-Fit to content">1</bool>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">400</long>
<long name="proxy-Height">300</long>
<bool name="proxy-AUI manager">0</bool>
<string name="proxy-Event sources">""</string>
<document>
<string name="title">"wxBoxSizer V"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"sizer"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="proxy-type">"wbBoxSizerProxy"</string>
<string name="proxy-Orientation">"Vertical"</string>
<string name="proxy-Member variable name">""</string>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<document>
<string name="title">"wxBoxSizer H"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"sizer"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"25/5/2007"</string>
<string name="proxy-type">"wbBoxSizerProxy"</string>
<string name="proxy-Orientation">"Horizontal"</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-AlignH">"Centre"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<document>
<string name="title">"wxStaticBoxSizer V"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"sizer"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"25/5/2007"</string>
<string name="proxy-type">"wbStaticBoxSizerProxy"</string>
<string name="proxy-Id name">"wxID_ANY"</string>
<long name="proxy-Id value">-1</long>
<string name="proxy-Label">"Static"</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-Sizer member variable name">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Static box class">"wxStaticBox"</string>
<string name="proxy-Orientation">"Vertical"</string>
<string name="proxy-AlignH">"Centre"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<document>
<string name="title">"wxCheckBox: ID_CHECKBOX_CLEAN_VIAS"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"checkbox"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"25/5/2007"</string>
<string name="proxy-type">"wbCheckBoxProxy"</string>
<string name="proxy-Id name">"ID_CHECKBOX_CLEAN_VIAS"</string>
<long name="proxy-Id value">10001</long>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Base class">"wxCheckBox"</string>
<bool name="proxy-External implementation">1</bool>
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">"m_CleanViasOpt"</string>
<string name="proxy-Label">"Delete redundant vias"</string>
<bool name="proxy-Initial value">0</bool>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Data variable">"s_CleanVias"</string>
<string name="proxy-Data validator">"wxGenericValidator(&amp; %VARIABLE%)"</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<bool name="proxy-wxALIGN_RIGHT">0</bool>
<bool name="proxy-wxCHK_2STATE">0</bool>
<bool name="proxy-wxCHK_3STATE">0</bool>
<bool name="proxy-wxCHK_ALLOW_3RD_STATE_FOR_USER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Left"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
<document>
<string name="title">"wxCheckBox: ID_CHECKBOX_MERGE_SEGMENTS"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"checkbox"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"25/5/2007"</string>
<string name="proxy-type">"wbCheckBoxProxy"</string>
<string name="proxy-Id name">"ID_CHECKBOX_MERGE_SEGMENTS"</string>
<long name="proxy-Id value">10003</long>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Base class">"wxCheckBox"</string>
<bool name="proxy-External implementation">1</bool>
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">"m_MergetSegmOpt"</string>
<string name="proxy-Label">"Merge segments"</string>
<bool name="proxy-Initial value">0</bool>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Data variable">"s_MergeSegments"</string>
<string name="proxy-Data validator">"wxGenericValidator(&amp; %VARIABLE%)"</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<bool name="proxy-wxALIGN_RIGHT">0</bool>
<bool name="proxy-wxCHK_2STATE">0</bool>
<bool name="proxy-wxCHK_3STATE">0</bool>
<bool name="proxy-wxCHK_ALLOW_3RD_STATE_FOR_USER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Left"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
<document>
<string name="title">"wxCheckBox: ID_CHECKBOX1"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"checkbox"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"25/5/2007"</string>
<string name="proxy-type">"wbCheckBoxProxy"</string>
<string name="proxy-Id name">"ID_CHECKBOX1"</string>
<long name="proxy-Id value">10005</long>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Base class">"wxCheckBox"</string>
<bool name="proxy-External implementation">1</bool>
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">"m_DeleteunconnectedOpt"</string>
<string name="proxy-Label">"Delete unconnected tracks"</string>
<bool name="proxy-Initial value">0</bool>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Data variable">"s_DeleteUnconnectedSegm"</string>
<string name="proxy-Data validator">"wxGenericValidator(&amp; %VARIABLE%)"</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<bool name="proxy-wxALIGN_RIGHT">0</bool>
<bool name="proxy-wxCHK_2STATE">0</bool>
<bool name="proxy-wxCHK_3STATE">0</bool>
<bool name="proxy-wxCHK_ALLOW_3RD_STATE_FOR_USER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Left"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
<document>
<string name="title">"wxCheckBox: ID_CHECKBOX"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"checkbox"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"25/5/2007"</string>
<string name="proxy-type">"wbCheckBoxProxy"</string>
<string name="proxy-Id name">"ID_CHECKBOX"</string>
<long name="proxy-Id value">10004</long>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Base class">"wxCheckBox"</string>
<bool name="proxy-External implementation">1</bool>
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">"m_ConnectToPadsOpt"</string>
<string name="proxy-Label">"Connect to Pads"</string>
<bool name="proxy-Initial value">0</bool>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Data variable">""</string>
<string name="proxy-Data validator">""</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<bool name="proxy-wxALIGN_RIGHT">0</bool>
<bool name="proxy-wxCHK_2STATE">0</bool>
<bool name="proxy-wxCHK_3STATE">0</bool>
<bool name="proxy-wxCHK_ALLOW_3RD_STATE_FOR_USER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Left"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
</document>
<document>
<string name="title">"wxBoxSizer V"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"sizer"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"25/5/2007"</string>
<string name="proxy-type">"wbBoxSizerProxy"</string>
<string name="proxy-Orientation">"Vertical"</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-AlignH">"Centre"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<document>
<string name="title">"wxButton: ID_BUTTON_EXECUTE"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"dialogcontrol"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"25/5/2007"</string>
<string name="proxy-type">"wbButtonProxy"</string>
<string name="event-handler-0">"wxEVT_COMMAND_BUTTON_CLICKED|OnButtonExecuteClick|NONE||"</string>
<string name="proxy-Id name">"ID_BUTTON_EXECUTE"</string>
<long name="proxy-Id value">10006</long>
<string name="proxy-Class">"wxButton"</string>
<string name="proxy-Base class">"wxButton"</string>
<bool name="proxy-External implementation">1</bool>
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-Label">"Clean pcb"</string>
<bool name="proxy-Default">1</bool>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<bool name="proxy-wxBU_LEFT">0</bool>
<bool name="proxy-wxBU_RIGHT">0</bool>
<bool name="proxy-wxBU_TOP">0</bool>
<bool name="proxy-wxBU_BOTTOM">0</bool>
<bool name="proxy-wxBU_EXACTFIT">0</bool>
<bool name="proxy-wxNO_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Centre"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
</document>
</document>
</document>
</document>
</document>
<document>
<string name="title">"Sources"</string>
<string name="type">"html-document"</string>
<string name="filename">""</string>
<string name="icon-name">"sourcesfolder"</string>
<long name="is-transient">1</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">1</long>
<document>
<string name="title">"dialog_clean_pcb.rc"</string>
<string name="type">"source-editor-document"</string>
<string name="filename">"dialog_clean_pcb.rc"</string>
<string name="icon-name">"source-editor"</string>
<long name="is-transient">0</long>
<long name="owns-file">0</long>
<long name="title-mode">1</long>
<long name="locked">0</long>
<string name="created">"25/5/2007"</string>
<string name="language">""</string>
</document>
</document>
<document>
<string name="title">"Images"</string>
<string name="type">"html-document"</string>
<string name="filename">""</string>
<string name="icon-name">"bitmapsfolder"</string>
<long name="is-transient">1</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">1</long>
</document>
</document>
</documents>
</anthemion-project>
...@@ -869,6 +869,10 @@ int itmp; ...@@ -869,6 +869,10 @@ int itmp;
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
break; break;
case ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR:
SelectLayerPair();
break;
case ID_POPUP_PCB_SELECT_NO_CU_LAYER: case ID_POPUP_PCB_SELECT_NO_CU_LAYER:
itmp = SelectLayer(GetScreen()->m_Active_Layer, CMP_N+1, -1); itmp = SelectLayer(GetScreen()->m_Active_Layer, CMP_N+1, -1);
if ( itmp >= 0 ) GetScreen()->m_Active_Layer = itmp; if ( itmp >= 0 ) GetScreen()->m_Active_Layer = itmp;
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
static void Exit_Editrack(WinEDA_DrawPanel * panel, wxDC *DC); static void Exit_Editrack(WinEDA_DrawPanel * panel, wxDC *DC);
void ShowNewTrackWhenMovingCursor(WinEDA_DrawPanel * panel, void ShowNewTrackWhenMovingCursor(WinEDA_DrawPanel * panel,
wxDC * DC, bool erase); wxDC * DC, bool erase);
static int Met_Coude_a_45(WinEDA_BasePcbFrame * frame, wxDC * DC, static int Add_45_degrees_Segment(WinEDA_BasePcbFrame * frame, wxDC * DC,
TRACK * ptfinsegment); TRACK * ptfinsegment);
static void ComputeBreakPoint( TRACK * track, int n ); static void ComputeBreakPoint( TRACK * track, int n );
static TRACK * DeleteNullTrackSegments(BOARD * pcb, TRACK * track, int * segmcount); static TRACK * DeleteNullTrackSegments(BOARD * pcb, TRACK * track, int * segmcount);
...@@ -188,7 +188,7 @@ wxPoint pos = GetScreen()->m_Curseur; ...@@ -188,7 +188,7 @@ wxPoint pos = GetScreen()->m_Curseur;
if( g_Raccord_45_Auto ) if( g_Raccord_45_Auto )
{ {
if( Met_Coude_a_45(this, DC, g_CurrentTrackSegment) != 0 ) if( Add_45_degrees_Segment(this, DC, g_CurrentTrackSegment) != 0 )
g_TrackSegmentCount++; g_TrackSegmentCount++;
} }
Track = g_CurrentTrackSegment->Copy(); Track = g_CurrentTrackSegment->Copy();
...@@ -221,7 +221,7 @@ wxPoint pos = GetScreen()->m_Curseur; ...@@ -221,7 +221,7 @@ wxPoint pos = GetScreen()->m_Curseur;
/**************************************************************************/ /**************************************************************************/
int Met_Coude_a_45(WinEDA_BasePcbFrame * frame, wxDC * DC, TRACK * pt_segm) int Add_45_degrees_Segment(WinEDA_BasePcbFrame * frame, wxDC * DC, TRACK * pt_segm)
/***************************************************************************/ /***************************************************************************/
/* rectifie un virage a 90 et le modifie par 2 coudes a 45 /* rectifie un virage a 90 et le modifie par 2 coudes a 45
n'opere que sur des segments horizontaux ou verticaux. n'opere que sur des segments horizontaux ou verticaux.
...@@ -476,6 +476,15 @@ PCB_SCREEN * screen = (PCB_SCREEN *) panel->GetScreen(); ...@@ -476,6 +476,15 @@ PCB_SCREEN * screen = (PCB_SCREEN *) panel->GetScreen();
/* dessin de la nouvelle piste : mise a jour du point d'arrivee */ /* dessin de la nouvelle piste : mise a jour du point d'arrivee */
g_CurrentTrackSegment->m_Layer = screen->m_Active_Layer; g_CurrentTrackSegment->m_Layer = screen->m_Active_Layer;
g_CurrentTrackSegment->m_Width = g_DesignSettings.m_CurrentTrackWidth; g_CurrentTrackSegment->m_Width = g_DesignSettings.m_CurrentTrackWidth;
if ( g_TwoSegmentTrackBuild )
{
TRACK * previous_track = (TRACK *)g_CurrentTrackSegment->Pback;
if ( previous_track && (previous_track->m_StructType == TYPETRACK) )
{
previous_track->m_Layer = screen->m_Active_Layer;
previous_track->m_Width = g_DesignSettings.m_CurrentTrackWidth;
}
}
if (Track_45_Only) if (Track_45_Only)
{ {
......
...@@ -135,8 +135,11 @@ EDA_BaseStruct * item; ...@@ -135,8 +135,11 @@ EDA_BaseStruct * item;
} }
/* Search for a footprint text */ /* Search for a footprint text */
// First search: locate texts for footprints on copper or component layer
// Priority to the active layer (component or copper.
// this is useful for small smd components when 2 texts overlap but are not on the same layer
if ( (LayerSearch == LAYER_CUIVRE_N) || (LayerSearch == CMP_N )) if ( (LayerSearch == LAYER_CUIVRE_N) || (LayerSearch == CMP_N ))
{ // Search texts for footprints on copper or component layer only {
for (module = m_Pcb->m_Modules; module != NULL; module = (MODULE*)module->Pnext) for (module = m_Pcb->m_Modules; module != NULL; module = (MODULE*)module->Pnext)
{ {
TEXTE_MODULE * pt_texte; TEXTE_MODULE * pt_texte;
...@@ -149,17 +152,16 @@ EDA_BaseStruct * item; ...@@ -149,17 +152,16 @@ EDA_BaseStruct * item;
} }
} }
} }
else // Search footprint texts on all layers
// Now Search footprint texts on all layers
module = NULL;
{ {
module = NULL; TEXTE_MODULE * pt_texte;
pt_texte = LocateTexteModule(m_Pcb, &module, typeloc);
if( pt_texte != NULL )
{ {
TEXTE_MODULE * pt_texte; Affiche_Infos_E_Texte(this, module, pt_texte);
pt_texte = LocateTexteModule(m_Pcb, &module, typeloc); return pt_texte;
if( pt_texte != NULL )
{
Affiche_Infos_E_Texte(this, module, pt_texte);
return pt_texte;
}
} }
} }
...@@ -170,6 +172,7 @@ EDA_BaseStruct * item; ...@@ -170,6 +172,7 @@ EDA_BaseStruct * item;
return module; return module;
} }
/* Search for zones */
if( (TrackLocate = Locate_Zone((TRACK*)m_Pcb->m_Zone, if( (TrackLocate = Locate_Zone((TRACK*)m_Pcb->m_Zone,
GetScreen()->m_Active_Layer,typeloc)) != NULL ) GetScreen()->m_Active_Layer,typeloc)) != NULL )
{ {
......
...@@ -233,7 +233,7 @@ drc.o: drc.cpp dialog_drc.cpp dialog_drc.h autorout.h $(COMMON) ...@@ -233,7 +233,7 @@ drc.o: drc.cpp dialog_drc.cpp dialog_drc.h autorout.h $(COMMON)
block.o: block.cpp $(COMMON) block.o: block.cpp $(COMMON)
clean.o: clean.cpp $(COMMON) clean.o: clean.cpp cleaningoptions_dialog.cpp cleaningoptions_dialog.h $(COMMON)
pcbplot.o: pcbplot.cpp pcbplot.h $(COMMON) pcbplot.o: pcbplot.cpp pcbplot.h $(COMMON)
......
...@@ -869,9 +869,16 @@ wxPoint OldPos = m_Parent->m_CurrentScreen->m_Curseur; ...@@ -869,9 +869,16 @@ wxPoint OldPos = m_Parent->m_CurrentScreen->m_Curseur;
{ {
if( (ii == 0) || ( ref->m_LibName != cmp->m_LibName) ) if( (ii == 0) || ( ref->m_LibName != cmp->m_LibName) )
{ /* Nouveau Module a charger */ { /* Nouveau Module a charger */
Module = m_Parent->Get_Librairie_Module(this, wxEmptyString, cmp->m_LibName, TRUE ); Module = m_Parent->Get_Librairie_Module(this, wxEmptyString, cmp->m_LibName, FALSE );
ref = cmp; ref = cmp;
if ( Module == NULL ) continue; if ( Module == NULL )
{
wxString msg;
msg.Printf(_("Component [%s]: footprint <%s> not found"),
cmp->m_CmpName.GetData(), cmp->m_LibName.GetData());
DisplayError(this, msg);
continue;
}
m_Parent->Place_Module(Module, DC); m_Parent->Place_Module(Module, DC);
/* mise a jour des reperes ( nom et ref "Time Stamp") /* mise a jour des reperes ( nom et ref "Time Stamp")
si module charge */ si module charge */
......
...@@ -109,6 +109,7 @@ BEGIN_EVENT_TABLE(WinEDA_PcbFrame, wxFrame) ...@@ -109,6 +109,7 @@ BEGIN_EVENT_TABLE(WinEDA_PcbFrame, wxFrame)
EVT_TOOL(ID_FIND_ITEMS, WinEDA_PcbFrame::Process_Special_Functions) EVT_TOOL(ID_FIND_ITEMS, WinEDA_PcbFrame::Process_Special_Functions)
EVT_TOOL(ID_GET_NETLIST, WinEDA_PcbFrame::Process_Special_Functions) EVT_TOOL(ID_GET_NETLIST, WinEDA_PcbFrame::Process_Special_Functions)
EVT_TOOL(ID_DRC_CONTROL, WinEDA_PcbFrame::Process_Special_Functions) EVT_TOOL(ID_DRC_CONTROL, WinEDA_PcbFrame::Process_Special_Functions)
EVT_TOOL(ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, WinEDA_PcbFrame::Process_Special_Functions)
EVT_KICAD_CHOICEBOX(ID_TOOLBARH_PCB_SELECT_LAYER, EVT_KICAD_CHOICEBOX(ID_TOOLBARH_PCB_SELECT_LAYER,
WinEDA_PcbFrame::Process_Special_Functions) WinEDA_PcbFrame::Process_Special_Functions)
EVT_KICAD_CHOICEBOX(ID_AUX_TOOLBAR_PCB_TRACK_WIDTH, EVT_KICAD_CHOICEBOX(ID_AUX_TOOLBAR_PCB_TRACK_WIDTH,
...@@ -159,7 +160,7 @@ BEGIN_EVENT_TABLE(WinEDA_PcbFrame, wxFrame) ...@@ -159,7 +160,7 @@ BEGIN_EVENT_TABLE(WinEDA_PcbFrame, wxFrame)
EVT_MENU_RANGE(ID_POPUP_GENERAL_START_RANGE, ID_POPUP_GENERAL_END_RANGE, EVT_MENU_RANGE(ID_POPUP_GENERAL_START_RANGE, ID_POPUP_GENERAL_END_RANGE,
WinEDA_PcbFrame::Process_Special_Functions ) WinEDA_PcbFrame::Process_Special_Functions )
// PopUp Menus pour Zooms traits dans drawpanel.cpp // PopUp Menus pour Zooms traites dans drawpanel.cpp
END_EVENT_TABLE() END_EVENT_TABLE()
...@@ -178,7 +179,7 @@ WinEDA_PcbFrame::WinEDA_PcbFrame(wxWindow * father, WinEDA_App *parent, ...@@ -178,7 +179,7 @@ WinEDA_PcbFrame::WinEDA_PcbFrame(wxWindow * father, WinEDA_App *parent,
m_FrameName = wxT("PcbFrame"); m_FrameName = wxT("PcbFrame");
m_Draw_Axis = TRUE; // TRUE pour avoir les axes dessines m_Draw_Axis = TRUE; // TRUE pour avoir les axes dessines
m_Draw_Grid = g_ShowGrid; // TRUE pour avoir la grille dessinee m_Draw_Grid = g_ShowGrid; // TRUE pour avoir la grille dessinee
m_Draw_Sheet_Ref = TRUE; // TRUE pour avoir le cartouche dessin m_Draw_Sheet_Ref = TRUE; // TRUE pour avoir le cartouche dessine
m_Draw_Auxiliary_Axis = TRUE; m_Draw_Auxiliary_Axis = TRUE;
m_SelTrackWidthBox = NULL; m_SelTrackWidthBox = NULL;
m_SelViaSizeBox = NULL; m_SelViaSizeBox = NULL;
...@@ -275,7 +276,7 @@ PCB_SCREEN * screen; ...@@ -275,7 +276,7 @@ PCB_SCREEN * screen;
} }
/* Reselection de l'ecran de base, /* Reselection de l'ecran de base,
pour les evenements de refresh g�n�r�s par wxWindows */ pour les evenements de refresh generes par wxWindows */
m_CurrentScreen = ActiveScreen = ScreenPcb; m_CurrentScreen = ActiveScreen = ScreenPcb;
SaveSettings(); SaveSettings();
...@@ -483,6 +484,7 @@ int ii, jj; ...@@ -483,6 +484,7 @@ int ii, jj;
} }
ReCreateLayerBox(NULL); ReCreateLayerBox(NULL);
PrepareLayerIndicator();
DisplayUnitsMsg(); DisplayUnitsMsg();
} }
...@@ -66,11 +66,6 @@ int tracevia = 1; ...@@ -66,11 +66,6 @@ int tracevia = 1;
g_PlotOffset = m_Auxiliary_Axis_Position; g_PlotOffset = m_Auxiliary_Axis_Position;
} }
InitPlotParametresGERBER(g_PlotOffset, scale_x, scale_y);
/* Clear the memory used for handle the D_CODE (aperture) list */
Init_ApertureList();
dest = wxFopen(FullFileName, wxT("wt")); dest = wxFopen(FullFileName, wxT("wt"));
if (dest == NULL) if (dest == NULL)
{ {
...@@ -78,6 +73,13 @@ int tracevia = 1; ...@@ -78,6 +73,13 @@ int tracevia = 1;
DisplayError(this, msg); return ; DisplayError(this, msg); return ;
} }
setlocale(LC_NUMERIC, "C");
InitPlotParametresGERBER(g_PlotOffset, scale_x, scale_y);
/* Clear the memory used for handle the D_CODE (aperture) list */
Init_ApertureList();
Affiche_1_Parametre(this, 0, _("File"),FullFileName,CYAN) ; Affiche_1_Parametre(this, 0, _("File"),FullFileName,CYAN) ;
Init_Trace_GERBER(this, dest) ; Init_Trace_GERBER(this, dest) ;
...@@ -124,6 +126,7 @@ int tracevia = 1; ...@@ -124,6 +126,7 @@ int tracevia = 1;
} }
Fin_Trace_GERBER(this, dest) ; Fin_Trace_GERBER(this, dest) ;
setlocale(LC_NUMERIC, "");
} }
......
...@@ -67,6 +67,8 @@ bool Center = FALSE; ...@@ -67,6 +67,8 @@ bool Center = FALSE;
return ; return ;
} }
setlocale(LC_NUMERIC, "C");
Affiche_1_Parametre(this, 0,_("File"),FullFileName,CYAN) ; Affiche_1_Parametre(this, 0,_("File"),FullFileName,CYAN) ;
PrintHeaderHPGL(dest, g_HPGL_Pen_Speed,g_HPGL_Pen_Num); PrintHeaderHPGL(dest, g_HPGL_Pen_Speed,g_HPGL_Pen_Num);
...@@ -168,6 +170,8 @@ bool Center = FALSE; ...@@ -168,6 +170,8 @@ bool Center = FALSE;
} }
/* fin */ /* fin */
CloseFileHPGL(dest) ; CloseFileHPGL(dest) ;
setlocale(LC_NUMERIC, "");
} }
......
...@@ -48,6 +48,8 @@ int PlotMarge_in_mils = 0; ...@@ -48,6 +48,8 @@ int PlotMarge_in_mils = 0;
DisplayError(this, msg); return ; DisplayError(this, msg); return ;
} }
setlocale(LC_NUMERIC, "C");
Affiche_1_Parametre(this, 0,_("File"),FullFileName,CYAN) ; Affiche_1_Parametre(this, 0,_("File"),FullFileName,CYAN) ;
if( g_PlotScaleOpt != 1 ) Center = TRUE; // Echelle != 1 donc trace centree du PCB if( g_PlotScaleOpt != 1 ) Center = TRUE; // Echelle != 1 donc trace centree du PCB
...@@ -201,6 +203,7 @@ int PlotMarge_in_mils = 0; ...@@ -201,6 +203,7 @@ int PlotMarge_in_mils = 0;
} }
/* fin */ /* fin */
CloseFilePS(dest) ; CloseFilePS(dest) ;
setlocale(LC_NUMERIC, "");
} }
......
...@@ -187,6 +187,7 @@ void WinEDA_BasePcbFrame::SelectLayerPair(void) ...@@ -187,6 +187,7 @@ void WinEDA_BasePcbFrame::SelectLayerPair(void)
new WinEDA_SelLayerPairFrame(this); new WinEDA_SelLayerPairFrame(this);
frame->ShowModal(); frame->Destroy(); frame->ShowModal(); frame->Destroy();
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
SetToolbars();
} }
......
...@@ -729,7 +729,6 @@ int w = BUTT_SIZE_X, h = BUTT_SIZE_Y; ...@@ -729,7 +729,6 @@ int w = BUTT_SIZE_X, h = BUTT_SIZE_Y;
iconDC.SelectObject( ButtBitmap ); iconDC.SelectObject( ButtBitmap );
int buttcolor = *laytool_list[ii]->m_Color; int buttcolor = *laytool_list[ii]->m_Color;
wxBrush Brush; wxBrush Brush;
iconDC.SelectObject( ButtBitmap );
iconDC.SetPen(*wxBLACK_PEN); iconDC.SetPen(*wxBLACK_PEN);
Brush.SetColour( Brush.SetColour(
ColorRefs[buttcolor].m_Red, ColorRefs[buttcolor].m_Red,
......
...@@ -46,6 +46,127 @@ ...@@ -46,6 +46,127 @@
#include "general_ratsnet.xpm" #include "general_ratsnet.xpm"
#include "add_cotation.xpm" #include "add_cotation.xpm"
/* Data to build the layer pair indicator button */
static wxBitmap * LayerPairBitmap = NULL;
static char s_BitmapLayerIcon[16][16] = {
{0,0,0,0,0,0,0,3,3,3,1,1,1,1,0,0},
{0,0,0,0,0,0,3,3,3,3,3,1,1,0,0,0},
{0,0,0,0,0,3,3,0,1,1,3,3,0,0,0,0},
{2,2,2,2,3,3,0,1,1,1,1,3,3,2,2,2},
{2,2,2,2,3,3,1,1,1,0,0,3,3,2,2,2},
{2,2,2,2,3,3,1,1,1,1,0,3,3,2,2,2},
{0,0,0,0,0,3,3,1,1,0,3,3,0,0,0,0},
{0,0,0,0,0,1,3,3,3,3,3,0,0,0,0,0},
{0,0,0,0,0,1,1,3,3,3,0,0,0,0,0,0},
{0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0},
{0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0},
{0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0},
{0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0},
{0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0},
{0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0},
{0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0}
};
/************************************************************/
void WinEDA_PcbFrame::PrepareLayerIndicator(void)
/************************************************************/
/* Draw the icon for the "Select layet pair" bitmap tool
*/
{
int ii, jj;
static int previous_active_layer_color, previous_Route_Layer_TOP_color,
previous_Route_Layer_BOTTOM_color, previous_via_color;
int active_layer_color, Route_Layer_TOP_color,
Route_Layer_BOTTOM_color, via_color;
bool change = false;
/* get colors, and redraw bitmap button only on changes */
active_layer_color = g_DesignSettings.m_LayerColor[GetScreen()->m_Active_Layer];
if ( previous_active_layer_color != active_layer_color )
{
previous_active_layer_color = active_layer_color;
change = TRUE;
}
Route_Layer_TOP_color = g_DesignSettings.m_LayerColor[GetScreen()->m_Route_Layer_TOP];
if ( previous_Route_Layer_TOP_color != Route_Layer_TOP_color )
{
previous_Route_Layer_TOP_color = Route_Layer_TOP_color;
change = TRUE;
}
Route_Layer_BOTTOM_color = g_DesignSettings.m_LayerColor[GetScreen()->m_Route_Layer_BOTTOM];
if ( previous_Route_Layer_BOTTOM_color != Route_Layer_BOTTOM_color )
{
previous_Route_Layer_BOTTOM_color = Route_Layer_BOTTOM_color;
change = TRUE;
}
via_color = g_DesignSettings.m_ViaColor[g_DesignSettings.m_CurrentViaType ];
if ( previous_via_color != via_color )
{
previous_via_color = via_color;
change = TRUE;
}
if ( ! change && (LayerPairBitmap != NULL) ) return;
/* Creat the bitmap too and its Memory DC, if not already made */
if ( LayerPairBitmap == NULL )
{
LayerPairBitmap = new wxBitmap(16, 16);
}
/* Draw the icon, witj colors according to the active layer and layer pairs for
via command (change layer) */
wxMemoryDC iconDC;
iconDC.SelectObject( *LayerPairBitmap );
int buttcolor = -1;
wxPen pen;
for ( ii = 0; ii < 16; ii++ )
{
for ( jj = 0; jj < 16; jj++ )
{
if ( s_BitmapLayerIcon[ii][jj] != buttcolor )
{
buttcolor = s_BitmapLayerIcon[ii][jj];
int color;
switch ( buttcolor )
{
default:
case 0:
color = active_layer_color;
break;
case 1:
color = Route_Layer_TOP_color;
break;
case 2:
color = Route_Layer_BOTTOM_color;
break;
case 3:
color = via_color;
break;
}
color &= MASKCOLOR;
pen.SetColour(
ColorRefs[color].m_Red,
ColorRefs[color].m_Green,
ColorRefs[color].m_Blue
);
iconDC.SetPen(pen);
}
iconDC.DrawPoint(jj,ii);
}
}
/* Deselect the Tool Bitmap from DC,
in order to delete the MemoryDC safely without deleting the bitmap */
iconDC.SelectObject( wxNullBitmap );
if ( ! m_HToolBar ) return;
{
m_HToolBar->SetToolNormalBitmap(ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, *LayerPairBitmap);
}
}
/******************************************/ /******************************************/
void WinEDA_PcbFrame::ReCreateHToolbar(void) void WinEDA_PcbFrame::ReCreateHToolbar(void)
/******************************************/ /******************************************/
...@@ -122,6 +243,9 @@ int ii; ...@@ -122,6 +243,9 @@ int ii;
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
ReCreateLayerBox(m_HToolBar); ReCreateLayerBox(m_HToolBar);
PrepareLayerIndicator(); // Initialise the bitmap with current active layer colors for the next tool
m_HToolBar->AddTool(ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, wxEmptyString, * LayerPairBitmap,
_("Show active layer selections\nand select layer pair for route and place via"));
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
m_HToolBar->AddTool(ID_TOOLBARH_PCB_AUTOPLACE, wxEmptyString, BITMAP(mode_module_xpm), m_HToolBar->AddTool(ID_TOOLBARH_PCB_AUTOPLACE, wxEmptyString, BITMAP(mode_module_xpm),
...@@ -409,9 +533,9 @@ wxString msg; ...@@ -409,9 +533,9 @@ wxString msg;
} }
/**********************************************************************/ /**************************************************************************/
WinEDAChoiceBox * WinEDA_PcbFrame::ReCreateLayerBox(WinEDA_Toolbar * parent) WinEDAChoiceBox * WinEDA_PcbFrame::ReCreateLayerBox(WinEDA_Toolbar * parent)
/**********************************************************************/ /**************************************************************************/
{ {
int ii, jj, ll; int ii, jj, ll;
bool rebuild = FALSE; bool rebuild = FALSE;
...@@ -425,7 +549,7 @@ long current_mask_layer; ...@@ -425,7 +549,7 @@ long current_mask_layer;
parent->AddControl(m_SelLayerBox); parent->AddControl(m_SelLayerBox);
} }
// Test si reconstruction de la liste ncessaire // Test si reconstruction de la liste necessaire
current_mask_layer = 0; current_mask_layer = 0;
int Masque_Layer = g_TabAllCopperLayerMask[g_DesignSettings.m_CopperLayerCount-1]; int Masque_Layer = g_TabAllCopperLayerMask[g_DesignSettings.m_CopperLayerCount-1];
Masque_Layer |= ALL_NO_CU_LAYERS; Masque_Layer |= ALL_NO_CU_LAYERS;
......
/////////////////////////////////////////////////////////////////////////////
// Name: win_eda_cleaningoptionsframe.cpp
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 25/05/2007 13:39:29
// RCS-ID:
// Copyright: GNU License
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 25/05/2007 13:39:29
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "win_eda_cleaningoptionsframe.h"
#endif
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
////@begin includes
////@end includes
#include "win_eda_cleaningoptionsframe.h"
////@begin XPM images
////@end XPM images
/*!
* Win_EDA_CleaningOptionsFrame type definition
*/
IMPLEMENT_DYNAMIC_CLASS( Win_EDA_CleaningOptionsFrame, wxDialog )
/*!
* Win_EDA_CleaningOptionsFrame event table definition
*/
BEGIN_EVENT_TABLE( Win_EDA_CleaningOptionsFrame, wxDialog )
////@begin Win_EDA_CleaningOptionsFrame event table entries
////@end Win_EDA_CleaningOptionsFrame event table entries
END_EVENT_TABLE()
/*!
* Win_EDA_CleaningOptionsFrame constructors
*/
Win_EDA_CleaningOptionsFrame::Win_EDA_CleaningOptionsFrame()
{
Init();
}
Win_EDA_CleaningOptionsFrame::Win_EDA_CleaningOptionsFrame( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
Init();
Create(parent, id, caption, pos, size, style);
}
/*!
* Win_EDA_CleaningOptionsFrame creator
*/
bool Win_EDA_CleaningOptionsFrame::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
////@begin Win_EDA_CleaningOptionsFrame creation
SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
wxDialog::Create( parent, id, caption, pos, size, style );
CreateControls();
if (GetSizer())
{
GetSizer()->SetSizeHints(this);
}
Centre();
////@end Win_EDA_CleaningOptionsFrame creation
return true;
}
/*!
* Win_EDA_CleaningOptionsFrame destructor
*/
Win_EDA_CleaningOptionsFrame::~Win_EDA_CleaningOptionsFrame()
{
////@begin Win_EDA_CleaningOptionsFrame destruction
////@end Win_EDA_CleaningOptionsFrame destruction
}
/*!
* Member initialisation
*/
void Win_EDA_CleaningOptionsFrame::Init()
{
////@begin Win_EDA_CleaningOptionsFrame member initialisation
m_CleanViasOpt = NULL;
m_MergetSegmOpt = NULL;
m_DeleteNullSegmOpt = NULL;
m_DeleteunconnectedOpt = NULL;
m_ConnectToPadsOpt = NULL;
////@end Win_EDA_CleaningOptionsFrame member initialisation
}
/*!
* Control creation for Win_EDA_CleaningOptionsFrame
*/
void Win_EDA_CleaningOptionsFrame::CreateControls()
{
////@begin Win_EDA_CleaningOptionsFrame content construction
// Generated by DialogBlocks, 25/05/2007 13:58:52 (unregistered)
Win_EDA_CleaningOptionsFrame* itemDialog1 = this;
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
itemDialog1->SetSizer(itemBoxSizer2);
wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
wxStaticBox* itemStaticBoxSizer4Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Static"));
wxStaticBoxSizer* itemStaticBoxSizer4 = new wxStaticBoxSizer(itemStaticBoxSizer4Static, wxVERTICAL);
itemBoxSizer3->Add(itemStaticBoxSizer4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
m_CleanViasOpt = new wxCheckBox( itemDialog1, ID_CHECKBOX_CLEAN_VIAS, _("Delete redundant vias"), wxDefaultPosition, wxDefaultSize, 0 );
m_CleanViasOpt->SetValue(true);
itemStaticBoxSizer4->Add(m_CleanViasOpt, 0, wxALIGN_LEFT|wxALL, 5);
m_MergetSegmOpt = new wxCheckBox( itemDialog1, ID_CHECKBOX_MERGE_SEGMENTS, _("Merge segments"), wxDefaultPosition, wxDefaultSize, 0 );
m_MergetSegmOpt->SetValue(true);
itemStaticBoxSizer4->Add(m_MergetSegmOpt, 0, wxALIGN_LEFT|wxALL, 5);
m_DeleteNullSegmOpt = new wxCheckBox( itemDialog1, ID_CHECKBOX_DELETE_NULL_SEGM, _("Delete 0 lenght segments"), wxDefaultPosition, wxDefaultSize, 0 );
m_DeleteNullSegmOpt->SetValue(true);
itemStaticBoxSizer4->Add(m_DeleteNullSegmOpt, 0, wxALIGN_LEFT|wxALL, 5);
m_DeleteunconnectedOpt = new wxCheckBox( itemDialog1, ID_CHECKBOX1, _("Delete unconnected tracks"), wxDefaultPosition, wxDefaultSize, 0 );
m_DeleteunconnectedOpt->SetValue(true);
itemStaticBoxSizer4->Add(m_DeleteunconnectedOpt, 0, wxALIGN_LEFT|wxALL, 5);
m_ConnectToPadsOpt = new wxCheckBox( itemDialog1, ID_CHECKBOX, _("Connect to Pads"), wxDefaultPosition, wxDefaultSize, 0 );
m_ConnectToPadsOpt->SetValue(false);
itemStaticBoxSizer4->Add(m_ConnectToPadsOpt, 0, wxALIGN_LEFT|wxALL, 5);
wxStaticBox* itemStaticBoxSizer10Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Static"));
wxStaticBoxSizer* itemStaticBoxSizer10 = new wxStaticBoxSizer(itemStaticBoxSizer10Static, wxVERTICAL);
itemBoxSizer3->Add(itemStaticBoxSizer10, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxButton* itemButton11 = new wxButton( itemDialog1, ID_BUTTON_EXECUTE, _("Clean pcb"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton11->SetDefault();
itemStaticBoxSizer10->Add(itemButton11, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
itemBoxSizer2->Add(5, 5, 0, wxGROW|wxALL, 5);
wxStaticText* itemStaticText13 = new wxStaticText( itemDialog1, wxID_STATIC, _("Infos:"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer2->Add(itemStaticText13, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
wxTextCtrl* itemTextCtrl14 = new wxTextCtrl( itemDialog1, ID_TEXTCTRL1, _T(""), wxDefaultPosition, wxSize(-1, 120), wxTE_MULTILINE );
itemBoxSizer2->Add(itemTextCtrl14, 0, wxGROW|wxALL, 5);
// Set validators
m_CleanViasOpt->SetValidator( wxGenericValidator(& s_CleanVias) );
m_MergetSegmOpt->SetValidator( wxGenericValidator(& s_MergeSegments) );
m_DeleteNullSegmOpt->SetValidator( wxGenericValidator(& s_Delete0lenSegm) );
m_DeleteunconnectedOpt->SetValidator( wxGenericValidator(& s_DeleteUnconnectedSegm) );
////@end Win_EDA_CleaningOptionsFrame content construction
}
/*!
* Should we show tooltips?
*/
bool Win_EDA_CleaningOptionsFrame::ShowToolTips()
{
return true;
}
/*!
* Get bitmap resources
*/
wxBitmap Win_EDA_CleaningOptionsFrame::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin Win_EDA_CleaningOptionsFrame bitmap retrieval
wxUnusedVar(name);
return wxNullBitmap;
////@end Win_EDA_CleaningOptionsFrame bitmap retrieval
}
/*!
* Get icon resources
*/
wxIcon Win_EDA_CleaningOptionsFrame::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin Win_EDA_CleaningOptionsFrame icon retrieval
wxUnusedVar(name);
return wxNullIcon;
////@end Win_EDA_CleaningOptionsFrame icon retrieval
}
/////////////////////////////////////////////////////////////////////////////
// Name: win_eda_cleaningoptionsframe.h
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 25/05/2007 13:39:29
// RCS-ID:
// Copyright: GNU License
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 25/05/2007 13:39:29
#ifndef _WIN_EDA_CLEANINGOPTIONSFRAME_H_
#define _WIN_EDA_CLEANINGOPTIONSFRAME_H_
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "win_eda_cleaningoptionsframe.h"
#endif
/*!
* Includes
*/
////@begin includes
#include "wx/valgen.h"
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
#define ID_WIN_EDA_CLEANINGOPTIONSFRAME 10000
#define ID_CHECKBOX_CLEAN_VIAS 10001
#define ID_CHECKBOX_MERGE_SEGMENTS 10003
#define ID_CHECKBOX_DELETE_NULL_SEGM 10002
#define ID_CHECKBOX1 10005
#define ID_CHECKBOX 10004
#define ID_BUTTON_EXECUTE 10006
#define ID_TEXTCTRL1 10007
#define SYMBOL_WIN_EDA_CLEANINGOPTIONSFRAME_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
#define SYMBOL_WIN_EDA_CLEANINGOPTIONSFRAME_TITLE _("Cleaning options")
#define SYMBOL_WIN_EDA_CLEANINGOPTIONSFRAME_IDNAME ID_WIN_EDA_CLEANINGOPTIONSFRAME
#define SYMBOL_WIN_EDA_CLEANINGOPTIONSFRAME_SIZE wxSize(400, 300)
#define SYMBOL_WIN_EDA_CLEANINGOPTIONSFRAME_POSITION wxDefaultPosition
////@end control identifiers
/*!
* Win_EDA_CleaningOptionsFrame class declaration
*/
class Win_EDA_CleaningOptionsFrame: public wxDialog
{
DECLARE_DYNAMIC_CLASS( Win_EDA_CleaningOptionsFrame )
DECLARE_EVENT_TABLE()
public:
/// Constructors
Win_EDA_CleaningOptionsFrame();
Win_EDA_CleaningOptionsFrame( wxWindow* parent, wxWindowID id = SYMBOL_WIN_EDA_CLEANINGOPTIONSFRAME_IDNAME, const wxString& caption = SYMBOL_WIN_EDA_CLEANINGOPTIONSFRAME_TITLE, const wxPoint& pos = SYMBOL_WIN_EDA_CLEANINGOPTIONSFRAME_POSITION, const wxSize& size = SYMBOL_WIN_EDA_CLEANINGOPTIONSFRAME_SIZE, long style = SYMBOL_WIN_EDA_CLEANINGOPTIONSFRAME_STYLE );
/// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WIN_EDA_CLEANINGOPTIONSFRAME_IDNAME, const wxString& caption = SYMBOL_WIN_EDA_CLEANINGOPTIONSFRAME_TITLE, const wxPoint& pos = SYMBOL_WIN_EDA_CLEANINGOPTIONSFRAME_POSITION, const wxSize& size = SYMBOL_WIN_EDA_CLEANINGOPTIONSFRAME_SIZE, long style = SYMBOL_WIN_EDA_CLEANINGOPTIONSFRAME_STYLE );
/// Destructor
~Win_EDA_CleaningOptionsFrame();
/// Initialises member variables
void Init();
/// Creates the controls and sizers
void CreateControls();
////@begin Win_EDA_CleaningOptionsFrame event handler declarations
////@end Win_EDA_CleaningOptionsFrame event handler declarations
////@begin Win_EDA_CleaningOptionsFrame member function declarations
/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end Win_EDA_CleaningOptionsFrame member function declarations
/// Should we show tooltips?
static bool ShowToolTips();
////@begin Win_EDA_CleaningOptionsFrame member variables
wxCheckBox* m_CleanViasOpt;
wxCheckBox* m_MergetSegmOpt;
wxCheckBox* m_DeleteNullSegmOpt;
wxCheckBox* m_DeleteunconnectedOpt;
wxCheckBox* m_ConnectToPadsOpt;
////@end Win_EDA_CleaningOptionsFrame member variables
};
#endif
// _WIN_EDA_CLEANINGOPTIONSFRAME_H_
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