Loading bitmaps/fill_zone.xpm 0 → 100644 +41 −0 Original line number Original line Diff line number Diff line /* XPM */ #ifndef XPMMAIN extern const char *fill_zone_xpm[]; #else const char *fill_zone_xpm[] = { /* columns rows colors chars-per-pixel */ "16 16 15 1", "# c #FCFEFC", "@ c #ACBEFC", "O c #444A5C", "$ c #645AEC", "X c #040204", "o c #ECEAEC", ". c #F4F2F4", " c None", "+ c #C4C6CC", "& c #6476C4", "* c #A4A2AC", "= c #848A9C", "; c #646674", "% c #8496F4", "- c #7C7E8C", /* pixels */ " . XX . .. .", " oX X o o ", " X OXX o ", "oo oXO+X X@@ooo ", " O+.X#.X$%@oo", " o O+.#X..+X$%@o", "o O+.##..+*=X$%@", "&O+.##..+*=-;$%@", "O+.##..+*=-;X$%@", " X+#. +*=-;X&$%@", " X+.+*=-;X &$%@", " X=*=-;X &$%@", " X;-;X &$%&", " X;X &$% ", " X $% ", " $% " }; #endif change_log.txt +5 −0 Original line number Original line Diff line number Diff line Loading @@ -4,6 +4,11 @@ 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-Dec-17 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr> ================================================================================ +pcbnew: some changes about zones: enhanced dialog, and files reorganisation. 2007-Dec-14 UPDATE Dick Hollenbeck <dick@softplc.com> 2007-Dec-14 UPDATE Dick Hollenbeck <dick@softplc.com> ================================================================================ ================================================================================ Loading cvpcb/listboxes.cpp +12 −6 Original line number Original line Diff line number Diff line Loading @@ -155,6 +155,8 @@ void FootprintListBox::SetSelection( unsigned index, bool State ) if( (int) index >= GetCount() ) if( (int) index >= GetCount() ) index = GetCount() - 1; index = GetCount() - 1; if ( (index >= 0) && (GetCount() > 0) ) { #ifndef __WXMAC__ #ifndef __WXMAC__ Select( index, State ); Select( index, State ); #endif #endif Loading @@ -163,6 +165,7 @@ void FootprintListBox::SetSelection( unsigned index, bool State ) Refresh(); Refresh(); #endif #endif } } } /**************************************************/ /**************************************************/ Loading Loading @@ -256,6 +259,8 @@ void ListBoxCmp::SetSelection( unsigned index, bool State ) if( (int) index >= GetCount() ) if( (int) index >= GetCount() ) index = GetCount() - 1; index = GetCount() - 1; if ( (index >= 0) && (GetCount() > 0) ) { #ifndef __WXMAC__ #ifndef __WXMAC__ Select( index, State ); Select( index, State ); #endif #endif Loading @@ -264,6 +269,7 @@ void ListBoxCmp::SetSelection( unsigned index, bool State ) Refresh(); Refresh(); #endif #endif } } } /********************************************/ /********************************************/ Loading cvpcb/readschematicnetlist.cpp +360 −318 Original line number Original line Diff line number Diff line /***************************/ /****************************/ /* readschematicnetlist.cpp */ /* readschematicnetlist.cpp */ /***************************/ /****************************/ /* convertit la netliste ORCADPCB en netliste ORCADPCB (fichier temporaire) /* Read a nelist type Eeschema or OrcadPCB2 and buid the component list assure la raffectation des alimentations selon le format : * Manages the lines like : ( XXXXXX VALEUR|(pin1,pin2,...=newalim) ID VALEUR * ( XXXXXX VALEUR|(pin1,pin2,...=newalim) ID VALEUR */ */ #include "fctsys.h" #include "fctsys.h" Loading @@ -19,8 +19,9 @@ assure la r /* routines locales : */ /* routines locales : */ static int pin_orcad(STORECMP * CurrentCmp); static int ReadPinConnection( STORECMP* CurrentCmp ); #define BUFFER_CHAR_SIZE 1024 // Size of buffers used to store netlist datas /************************************************/ /************************************************/ int WinEDA_CvpcbFrame::ReadSchematicNetlist() int WinEDA_CvpcbFrame::ReadSchematicNetlist() Loading @@ -28,11 +29,11 @@ int WinEDA_CvpcbFrame::ReadSchematicNetlist() { { int i, j, k, l; int i, j, k, l; char* LibName; char* LibName; char Line[1024]; char Line[BUFFER_CHAR_SIZE + 1]; char component_reference[80] ; /* buffer des references composants */ char component_reference[BUFFER_CHAR_SIZE + 1]; /* buffer for component reference (U1, R4...) */ char ref_schema[80] ; /* buffer de la ref schematique */ char schematic_timestamp[BUFFER_CHAR_SIZE + 1]; /* buffer for component time stamp */ char footprint_name[80] ; /* buffer des ref.lib */ char footprint_name[BUFFER_CHAR_SIZE + 1]; /* buffer for component footprint field */ char component_value[80] ; /* buffer des valeurs */ char component_value[BUFFER_CHAR_SIZE + 1]; /* buffer for component values (470K, 22nF ...) */ char* ptchar; /* pointeur de service */ char* ptchar; /* pointeur de service */ STORECMP* Cmp; STORECMP* Cmp; Loading @@ -41,7 +42,8 @@ STORECMP * Cmp; g_FlagEESchema = FALSE; g_FlagEESchema = FALSE; /* Raz buffer et variable de gestion */ /* Raz buffer et variable de gestion */ if( g_BaseListeCmp ) FreeMemoryComponants(); if( g_BaseListeCmp ) FreeMemoryComponants(); /* Ouverture du fichier source */ /* Ouverture du fichier source */ source = wxFopen( FFileName, wxT( "rt" ) ); source = wxFopen( FFileName, wxT( "rt" ) ); Loading @@ -49,11 +51,12 @@ STORECMP * Cmp; { { wxString msg; wxString msg; msg.Printf( _( "File <%s> not found" ), FFileName.GetData() ); msg.Printf( _( "File <%s> not found" ), FFileName.GetData() ); DisplayError(this, msg); return(-1); DisplayError( this, msg ); return -1; } } /* Read the file header (must be "( { OrCAD PCB" or "({ OrCAD PCB" ) */ /* Read the file header (must be "( { OrCAD PCB" or "({ OrCAD PCB" ) /* or "# EESchema Netliste"*/ * or "# EESchema Netliste" */ fgets( Line, 255, source ); fgets( Line, 255, source ); /* test for netlist type PCB2 */ /* test for netlist type PCB2 */ i = strnicmp( Line, "( {", 3 ); i = strnicmp( Line, "( {", 3 ); Loading @@ -62,7 +65,8 @@ STORECMP * Cmp; if( i != 0 ) if( i != 0 ) { { i = strnicmp( Line, "# EESchema", 7 ); /* net type EESchema */ i = strnicmp( Line, "# EESchema", 7 ); /* net type EESchema */ if( i == 0 ) g_FlagEESchema = TRUE; if( i == 0 ) g_FlagEESchema = TRUE; } } if( i != 0 ) if( i != 0 ) Loading @@ -70,24 +74,27 @@ STORECMP * Cmp; wxString msg, Lineconv = CONV_FROM_UTF8( Line ); wxString msg, Lineconv = CONV_FROM_UTF8( Line ); msg.Printf( _( "Unknown file format <%s>" ), Lineconv.GetData() ); msg.Printf( _( "Unknown file format <%s>" ), Lineconv.GetData() ); DisplayError( this, msg ); DisplayError( this, msg ); fclose(source); return(-3) ; fclose( source ); return -3; } } SetStatusText( _( "Netlist Format: EESchema" ), 0 ); SetStatusText( _( "Netlist Format: EESchema" ), 0 ); /* Lecture de la liste */ /* Read the netlit */ for( ; ; ) for( ; ; ) { { /* recherche du debut de la description d'un composant */ /* Search the beginning of a component description */ if( fgets(Line,255,source) == 0 ) break; if( fgets( Line, BUFFER_CHAR_SIZE, source ) == 0 ) break; /* Remove blanks */ /* Remove blanks */ i = 0 ; while (Line[i] == ' ') i++ ; i = 0; while( Line[i] == ' ' ) i++; /* elimination des lignes vides : */ /* remove empty lines : */ if (Line[i] < ' ') continue ; if( Line[i] < ' ' ) continue; if( strnicmp( &Line[i], "{ Allowed footprints", 20 ) == 0 ) if( strnicmp( &Line[i], "{ Allowed footprints", 20 ) == 0 ) { { Loading @@ -95,31 +102,41 @@ STORECMP * Cmp; continue; continue; } } if (strnicmp(&Line[i],"( ",2) != 0) continue ; if( strnicmp( &Line[i], "( ", 2 ) != 0 ) continue; /****************************/ /*******************************/ /* debut description trouve */ /* Component description found */ /****************************/ /*******************************/ /* memo ident schema */ while( Line[i] != ' ' ) while ( Line[i] != ' ') i++ ; i++; while ( Line[i] == ' ') i++ ; /* i pointe 1er caractere de l'ident schema */ j = 0 ; while ( Line[i] != ' ') ref_schema[j++] = Line[i++] ; while( Line[i] == ' ' ) ref_schema[j] = 0 ; i++; /* recherche val/ref.lib */ /* i points the beginning of the schematic time stamp */ while ( Line[i] == ' ') i++ ; /* i pointe la valeur du composant */ j = 0; while( Line[i] != ' ' ) schematic_timestamp[j++] = Line[i++]; schematic_timestamp[j] = 0; /* search val/ref.lib */ while( Line[i] == ' ' ) i++; /* i points the component value */ LibName = Line + i; LibName = Line + i; memset( schematic_timestamp, 0, sizeof(schematic_timestamp) ); memset( component_reference, 0, sizeof(component_reference) ); memset( component_reference, 0, sizeof(component_reference) ); memset( footprint_name, 0, sizeof(footprint_name) ); memset( footprint_name, 0, sizeof(footprint_name) ); memset( component_value, 0, sizeof(component_value) ); memset( component_value, 0, sizeof(component_value) ); memset( alim, 0, sizeof(alim) ); memset( alim, 0, sizeof(alim) ); /* lecture valeur du composant */ /* Read value */ /* recherche fin de valeur (' ') */ ptchar = strstr( &Line[i], " " ); // Search end of value field (space) ptchar = strstr(&Line[i]," ") ; if( ptchar == 0 ) if( ptchar == 0 ) { { wxString msg; wxString msg; Loading @@ -127,52 +144,64 @@ STORECMP * Cmp; DisplayError( NULL, msg ); DisplayError( NULL, msg ); k = 0; k = 0; } } else k = ptchar - Line ; else k = ptchar - Line; for( j = 0; i < k; i++ ) for( j = 0; i < k; i++ ) { { if ( Line[i] == SEPARATEUR ) break ; if( Line[i] == SEPARATEUR ) break; if( j < (int) (sizeof(footprint_name) - 1) ) if( j < (int) (sizeof(footprint_name) - 1) ) footprint_name[j++] = Line[i]; footprint_name[j++] = Line[i]; } } if( (Line[++i] == '(') && (Line[k - 1] == ')' ) ) if( (Line[++i] == '(') && (Line[k - 1] == ')' ) ) { { i++ ; l = 0 ; while ( k-1 > i ) alim[l++] = Line[i++] ; i++; l = 0; while( k - 1 > i ) alim[l++] = Line[i++]; } } else i = k; else i = k ; /* Search component reference */ while( Line[i] != ' ' ) i++; /* recherche reference du composant */ /* goto end of value field */ while(Line[i] != ' ') i++ ; /* elimination fin valeur */ while( Line[i] == ' ' ) while(Line[i] == ' ') i++ ; /* recherche debut reference */ i++; /* goto beginning of reference */ /* debut reference trouv */ /* debut reference trouv */ for( k = 0; k < (int) (sizeof(component_reference) - 1); i++, k++ ) for( k = 0; k < (int) (sizeof(component_reference) - 1); i++, k++ ) { { if ( Line[i] <= ' ' ) break ; if( Line[i] <= ' ' ) break; component_reference[k] = Line[i]; component_reference[k] = Line[i]; } } /* recherche valeur du composant */ /* Search component value */ while(Line[i] == ' ') i++ ; /* recherche debut valeur */ while( Line[i] == ' ' ) i++; /** goto beginning of value */ /* debut vraie valeur trouvee */ for( k = 0; k < (int) (sizeof(component_value) - 1); i++, k++ ) for( k = 0; k < (int) (sizeof(component_value) - 1); i++, k++ ) { { if ( Line[i] <= ' ' ) break ; if( Line[i] <= ' ' ) break; component_value[k] = Line[i]; component_value[k] = Line[i]; } } /* Store info for this component */ /* classement du composant ,suivi de sa valeur */ Cmp = new STORECMP(); Cmp = new STORECMP(); Cmp->Pnext = g_BaseListeCmp; Cmp->Pnext = g_BaseListeCmp; g_BaseListeCmp = Cmp; g_BaseListeCmp = Cmp; Cmp->m_Reference = CONV_FROM_UTF8( component_reference ); Cmp->m_Reference = CONV_FROM_UTF8( component_reference ); Cmp->m_Valeur = CONV_FROM_UTF8( component_value ); Cmp->m_Valeur = CONV_FROM_UTF8( component_value ); if( g_FlagEESchema ) /* Copie du nom module: */ if( g_FlagEESchema ) /* copy footprint name: */ { { if( strnicmp( LibName, "$noname", 7 ) != 0 ) if( strnicmp( LibName, "$noname", 7 ) != 0 ) { { Loading @@ -183,38 +212,41 @@ STORECMP * Cmp; } } } } } } /* classement du TimeStamp */ Cmp->m_TimeStamp = CONV_FROM_UTF8( schematic_timestamp ); Cmp->m_TimeStamp = CONV_FROM_UTF8(ref_schema); pin_orcad( Cmp) ; ReadPinConnection( Cmp ); nbcomp++; nbcomp++; } } fclose( source ); fclose( source ); /* reclassement alpabetique : */ /* Alpabetic sorting : */ g_BaseListeCmp = TriListeComposantss( g_BaseListeCmp, nbcomp ); g_BaseListeCmp = TriListeComposantss( g_BaseListeCmp, nbcomp ); return(0); return 0; } } /********************************************************/ /********************************************************/ int WinEDA_CvpcbFrame::ReadFootprintFilterList( FILE* f ) int WinEDA_CvpcbFrame::ReadFootprintFilterList( FILE* f ) /********************************************************/ /********************************************************/ { { char Line[1024]; char Line[BUFFER_CHAR_SIZE + 1]; wxString CmpRef; wxString CmpRef; STORECMP* Cmp = NULL; STORECMP* Cmp = NULL; for( ; ; ) for( ; ; ) { { if( fgets(Line,255,source) == 0 ) break; if( fgets( Line, BUFFER_CHAR_SIZE, source ) == 0 ) break; if( strnicmp( Line, "$endlist", 8 ) == 0 ) if( strnicmp( Line, "$endlist", 8 ) == 0 ) { { Cmp = NULL; Cmp = NULL; continue; continue; } } if (strnicmp(Line,"$endfootprintlist", 4 ) == 0 ) return 0; if( strnicmp( Line, "$endfootprintlist", 4 ) == 0 ) return 0; if( strnicmp( Line, "$component", 10 ) == 0 ) // New component ref found if( strnicmp( Line, "$component", 10 ) == 0 ) // New component ref found { { Loading @@ -223,10 +255,10 @@ STORECMP * Cmp = NULL; /* Search the new component in list */ /* Search the new component in list */ for( Cmp = g_BaseListeCmp; Cmp != NULL; Cmp = Cmp->Pnext ) for( Cmp = g_BaseListeCmp; Cmp != NULL; Cmp = Cmp->Pnext ) { { if ( Cmp->m_Reference == CmpRef) break; if( Cmp->m_Reference == CmpRef ) break; } } } } else if( Cmp ) else if( Cmp ) { { wxString fp = CONV_FROM_UTF8( Line + 1 ); wxString fp = CONV_FROM_UTF8( Line + 1 ); Loading @@ -240,12 +272,12 @@ STORECMP * Cmp = NULL; /***********************************/ /***********************************/ int pin_orcad(STORECMP * Cmp) int ReadPinConnection( STORECMP* Cmp ) /***********************************/ /***********************************/ { { int i, jj; int i, jj; char numpin[9] , net[1024] ; char numpin[BUFFER_CHAR_SIZE + 1], net[BUFFER_CHAR_SIZE + 1]; char Line[1024]; char Line[BUFFER_CHAR_SIZE + 1]; STOREPIN* Pin = NULL; STOREPIN* Pin = NULL; STOREPIN** LastPin = &Cmp->m_Pins; STOREPIN** LastPin = &Cmp->m_Pins; Loading @@ -254,30 +286,39 @@ for ( ;; ) /* debut description trouv */ /* debut description trouv */ for( ; ; ) for( ; ; ) { { if ( fgets(Line,80,source) == 0 ) return(-1) ; if( fgets( Line, BUFFER_CHAR_SIZE, source ) == 0 ) return -1; /* remove blanks from the beginning of the line */ i = 0; while( Line[i] == ' ' ) i++; /* suppression des blancs en dbut de ligne */ while( Line[i] == '(' ) i = 0 ; while (Line[i] == ' ') i++ ; i++; while (Line[i] == '(') i++ ; while (Line[i] == ' ') i++ ; /* elimination des lignes vides : */ while( Line[i] == ' ' ) if (Line[i] < ' ') continue ; i++; /* remove empty lines : */ if( Line[i] < ' ' ) continue; /* fin de description ? */ /* fin de description ? */ if (Line[i] == ')' ) return(0) ; if( Line[i] == ')' ) return 0; memset( net, 0, sizeof(net) ); memset( net, 0, sizeof(net) ); memset( numpin, 0, sizeof(numpin) ); memset( numpin, 0, sizeof(numpin) ); /* lecture name pin , 4 lettres */ /* Read pi name , 4 letters */ for( jj = 0; jj < 4; jj++, i++ ) for( jj = 0; jj < 4; jj++, i++ ) { { if ( Line[i] == ' ' ) break ; if( Line[i] == ' ' ) break; numpin[jj] = Line[i]; numpin[jj] = Line[i]; } } /* recherche affectation force de net */ /* Search for a net attribute */ if( reaffect( numpin, net ) != 0 ) if( reaffect( numpin, net ) != 0 ) { { Pin = new STOREPIN(); Pin = new STOREPIN(); Loading @@ -287,13 +328,14 @@ for ( ;; ) continue; continue; } } /* recherche netname */ /* Read netname */ while(Line[i] == ' ') i++ ; /* recherche debut reference */ while( Line[i] == ' ' ) i++; /* debut netname trouv */ for( jj = 0; jj < (int) sizeof(net) - 1; i++, jj++ ) for( jj = 0; jj < (int) sizeof(net) - 1; i++, jj++ ) { { if ( Line[i] <= ' ' ) break ; if( Line[i] <= ' ' ) break; net[jj] = Line[i]; net[jj] = Line[i]; } } Loading @@ -309,15 +351,16 @@ for ( ;; ) /****************************************************************/ /****************************************************************/ STORECMP* TriListeComposantss( STORECMP* BaseListe, int nbitems ) STORECMP* TriListeComposantss( STORECMP* BaseListe, int nbitems ) /****************************************************************/ /****************************************************************/ /* Tri la liste des composants par ordre alphabetique et me a jour le nouveau chainage avant/arriere /* Sort the component list( this is a linked list) retourne un pointeur sur le 1er element de la liste * retourn the beginning of the list */ */ { { STORECMP** bufferptr, * Item; STORECMP** bufferptr, * Item; int ii; int ii; if (nbitems <= 0 ) return(NULL); if( nbitems <= 0 ) return NULL; bufferptr = (STORECMP**) MyZMalloc( (nbitems + 2) * sizeof(STORECMP*) ); bufferptr = (STORECMP**) MyZMalloc( (nbitems + 2) * sizeof(STORECMP*) ); for( ii = 1, Item = BaseListe; Item != NULL; Item = Item->Pnext, ii++ ) for( ii = 1, Item = BaseListe; Item != NULL; Item = Item->Pnext, ii++ ) Loading @@ -325,13 +368,13 @@ int ii; bufferptr[ii] = Item; bufferptr[ii] = Item; } } /* ici bufferptr[0] = NULL et bufferptr[nbitem+1] = NULL et ces 2 valeurs /* Here: bufferptr[0] = NULL and bufferptr[nbitem+1] = NULL. representent le chainage arriere du 1er element, et le chainage avant * These 2 values are the first item back link, and the last item forward link du dernier element */ */ qsort( bufferptr + 1, nbitems, sizeof(STORECMP*), qsort( bufferptr + 1, nbitems, sizeof(STORECMP*), ( int( * ) ( const void*, const void* ) )CmpCompare ); ( int( * ) ( const void*, const void* ) )CmpCompare ); /* Mise a jour du chainage */ /* Update linked list */ for( ii = 1; ii <= nbitems; ii++ ) for( ii = 1; ii <= nbitems; ii++ ) { { Item = bufferptr[ii]; Item = bufferptr[ii]; Loading @@ -339,15 +382,17 @@ int ii; Item->Pnext = bufferptr[ii + 1]; Item->Pnext = bufferptr[ii + 1]; Item->Pback = bufferptr[ii - 1]; Item->Pback = bufferptr[ii - 1]; } } return(bufferptr[1]); return bufferptr[1]; } } /****************************************/ /****************************************/ int CmpCompare( void* mod1, void* mod2 ) int CmpCompare( void* mod1, void* mod2 ) /****************************************/ /****************************************/ /* /* routine compare() pour qsort() en classement alphabetique des composants * Function compare() for qsort() : alphabetic sorting, with numbering order */ */ { { int ii; int ii; Loading @@ -358,8 +403,5 @@ STORECMP *pt1 , *pt2 ; //FIXME: //FIXME: ii = StrNumICmp( (const wxChar*) pt1->m_Reference, (const wxChar*) pt2->m_Reference ); ii = StrNumICmp( (const wxChar*) pt1->m_Reference, (const wxChar*) pt2->m_Reference ); return(ii); return ii; } } include/bitmaps.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -183,6 +183,7 @@ #include "../bitmaps/transistor.xpm" #include "../bitmaps/transistor.xpm" #include "../bitmaps/kicad_icon_small.xpm" #include "../bitmaps/kicad_icon_small.xpm" #include "../bitmaps/general_ratsnet.xpm" #include "../bitmaps/general_ratsnet.xpm" #include "../bitmaps/fill_zone.xpm" // Largeur du toolbar vertical // Largeur du toolbar vertical #define VTOOLBAR_WIDTH 26 #define VTOOLBAR_WIDTH 26 Loading Loading
bitmaps/fill_zone.xpm 0 → 100644 +41 −0 Original line number Original line Diff line number Diff line /* XPM */ #ifndef XPMMAIN extern const char *fill_zone_xpm[]; #else const char *fill_zone_xpm[] = { /* columns rows colors chars-per-pixel */ "16 16 15 1", "# c #FCFEFC", "@ c #ACBEFC", "O c #444A5C", "$ c #645AEC", "X c #040204", "o c #ECEAEC", ". c #F4F2F4", " c None", "+ c #C4C6CC", "& c #6476C4", "* c #A4A2AC", "= c #848A9C", "; c #646674", "% c #8496F4", "- c #7C7E8C", /* pixels */ " . XX . .. .", " oX X o o ", " X OXX o ", "oo oXO+X X@@ooo ", " O+.X#.X$%@oo", " o O+.#X..+X$%@o", "o O+.##..+*=X$%@", "&O+.##..+*=-;$%@", "O+.##..+*=-;X$%@", " X+#. +*=-;X&$%@", " X+.+*=-;X &$%@", " X=*=-;X &$%@", " X;-;X &$%&", " X;X &$% ", " X $% ", " $% " }; #endif
change_log.txt +5 −0 Original line number Original line Diff line number Diff line Loading @@ -4,6 +4,11 @@ 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-Dec-17 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr> ================================================================================ +pcbnew: some changes about zones: enhanced dialog, and files reorganisation. 2007-Dec-14 UPDATE Dick Hollenbeck <dick@softplc.com> 2007-Dec-14 UPDATE Dick Hollenbeck <dick@softplc.com> ================================================================================ ================================================================================ Loading
cvpcb/listboxes.cpp +12 −6 Original line number Original line Diff line number Diff line Loading @@ -155,6 +155,8 @@ void FootprintListBox::SetSelection( unsigned index, bool State ) if( (int) index >= GetCount() ) if( (int) index >= GetCount() ) index = GetCount() - 1; index = GetCount() - 1; if ( (index >= 0) && (GetCount() > 0) ) { #ifndef __WXMAC__ #ifndef __WXMAC__ Select( index, State ); Select( index, State ); #endif #endif Loading @@ -163,6 +165,7 @@ void FootprintListBox::SetSelection( unsigned index, bool State ) Refresh(); Refresh(); #endif #endif } } } /**************************************************/ /**************************************************/ Loading Loading @@ -256,6 +259,8 @@ void ListBoxCmp::SetSelection( unsigned index, bool State ) if( (int) index >= GetCount() ) if( (int) index >= GetCount() ) index = GetCount() - 1; index = GetCount() - 1; if ( (index >= 0) && (GetCount() > 0) ) { #ifndef __WXMAC__ #ifndef __WXMAC__ Select( index, State ); Select( index, State ); #endif #endif Loading @@ -264,6 +269,7 @@ void ListBoxCmp::SetSelection( unsigned index, bool State ) Refresh(); Refresh(); #endif #endif } } } /********************************************/ /********************************************/ Loading
cvpcb/readschematicnetlist.cpp +360 −318 Original line number Original line Diff line number Diff line /***************************/ /****************************/ /* readschematicnetlist.cpp */ /* readschematicnetlist.cpp */ /***************************/ /****************************/ /* convertit la netliste ORCADPCB en netliste ORCADPCB (fichier temporaire) /* Read a nelist type Eeschema or OrcadPCB2 and buid the component list assure la raffectation des alimentations selon le format : * Manages the lines like : ( XXXXXX VALEUR|(pin1,pin2,...=newalim) ID VALEUR * ( XXXXXX VALEUR|(pin1,pin2,...=newalim) ID VALEUR */ */ #include "fctsys.h" #include "fctsys.h" Loading @@ -19,8 +19,9 @@ assure la r /* routines locales : */ /* routines locales : */ static int pin_orcad(STORECMP * CurrentCmp); static int ReadPinConnection( STORECMP* CurrentCmp ); #define BUFFER_CHAR_SIZE 1024 // Size of buffers used to store netlist datas /************************************************/ /************************************************/ int WinEDA_CvpcbFrame::ReadSchematicNetlist() int WinEDA_CvpcbFrame::ReadSchematicNetlist() Loading @@ -28,11 +29,11 @@ int WinEDA_CvpcbFrame::ReadSchematicNetlist() { { int i, j, k, l; int i, j, k, l; char* LibName; char* LibName; char Line[1024]; char Line[BUFFER_CHAR_SIZE + 1]; char component_reference[80] ; /* buffer des references composants */ char component_reference[BUFFER_CHAR_SIZE + 1]; /* buffer for component reference (U1, R4...) */ char ref_schema[80] ; /* buffer de la ref schematique */ char schematic_timestamp[BUFFER_CHAR_SIZE + 1]; /* buffer for component time stamp */ char footprint_name[80] ; /* buffer des ref.lib */ char footprint_name[BUFFER_CHAR_SIZE + 1]; /* buffer for component footprint field */ char component_value[80] ; /* buffer des valeurs */ char component_value[BUFFER_CHAR_SIZE + 1]; /* buffer for component values (470K, 22nF ...) */ char* ptchar; /* pointeur de service */ char* ptchar; /* pointeur de service */ STORECMP* Cmp; STORECMP* Cmp; Loading @@ -41,7 +42,8 @@ STORECMP * Cmp; g_FlagEESchema = FALSE; g_FlagEESchema = FALSE; /* Raz buffer et variable de gestion */ /* Raz buffer et variable de gestion */ if( g_BaseListeCmp ) FreeMemoryComponants(); if( g_BaseListeCmp ) FreeMemoryComponants(); /* Ouverture du fichier source */ /* Ouverture du fichier source */ source = wxFopen( FFileName, wxT( "rt" ) ); source = wxFopen( FFileName, wxT( "rt" ) ); Loading @@ -49,11 +51,12 @@ STORECMP * Cmp; { { wxString msg; wxString msg; msg.Printf( _( "File <%s> not found" ), FFileName.GetData() ); msg.Printf( _( "File <%s> not found" ), FFileName.GetData() ); DisplayError(this, msg); return(-1); DisplayError( this, msg ); return -1; } } /* Read the file header (must be "( { OrCAD PCB" or "({ OrCAD PCB" ) */ /* Read the file header (must be "( { OrCAD PCB" or "({ OrCAD PCB" ) /* or "# EESchema Netliste"*/ * or "# EESchema Netliste" */ fgets( Line, 255, source ); fgets( Line, 255, source ); /* test for netlist type PCB2 */ /* test for netlist type PCB2 */ i = strnicmp( Line, "( {", 3 ); i = strnicmp( Line, "( {", 3 ); Loading @@ -62,7 +65,8 @@ STORECMP * Cmp; if( i != 0 ) if( i != 0 ) { { i = strnicmp( Line, "# EESchema", 7 ); /* net type EESchema */ i = strnicmp( Line, "# EESchema", 7 ); /* net type EESchema */ if( i == 0 ) g_FlagEESchema = TRUE; if( i == 0 ) g_FlagEESchema = TRUE; } } if( i != 0 ) if( i != 0 ) Loading @@ -70,24 +74,27 @@ STORECMP * Cmp; wxString msg, Lineconv = CONV_FROM_UTF8( Line ); wxString msg, Lineconv = CONV_FROM_UTF8( Line ); msg.Printf( _( "Unknown file format <%s>" ), Lineconv.GetData() ); msg.Printf( _( "Unknown file format <%s>" ), Lineconv.GetData() ); DisplayError( this, msg ); DisplayError( this, msg ); fclose(source); return(-3) ; fclose( source ); return -3; } } SetStatusText( _( "Netlist Format: EESchema" ), 0 ); SetStatusText( _( "Netlist Format: EESchema" ), 0 ); /* Lecture de la liste */ /* Read the netlit */ for( ; ; ) for( ; ; ) { { /* recherche du debut de la description d'un composant */ /* Search the beginning of a component description */ if( fgets(Line,255,source) == 0 ) break; if( fgets( Line, BUFFER_CHAR_SIZE, source ) == 0 ) break; /* Remove blanks */ /* Remove blanks */ i = 0 ; while (Line[i] == ' ') i++ ; i = 0; while( Line[i] == ' ' ) i++; /* elimination des lignes vides : */ /* remove empty lines : */ if (Line[i] < ' ') continue ; if( Line[i] < ' ' ) continue; if( strnicmp( &Line[i], "{ Allowed footprints", 20 ) == 0 ) if( strnicmp( &Line[i], "{ Allowed footprints", 20 ) == 0 ) { { Loading @@ -95,31 +102,41 @@ STORECMP * Cmp; continue; continue; } } if (strnicmp(&Line[i],"( ",2) != 0) continue ; if( strnicmp( &Line[i], "( ", 2 ) != 0 ) continue; /****************************/ /*******************************/ /* debut description trouve */ /* Component description found */ /****************************/ /*******************************/ /* memo ident schema */ while( Line[i] != ' ' ) while ( Line[i] != ' ') i++ ; i++; while ( Line[i] == ' ') i++ ; /* i pointe 1er caractere de l'ident schema */ j = 0 ; while ( Line[i] != ' ') ref_schema[j++] = Line[i++] ; while( Line[i] == ' ' ) ref_schema[j] = 0 ; i++; /* recherche val/ref.lib */ /* i points the beginning of the schematic time stamp */ while ( Line[i] == ' ') i++ ; /* i pointe la valeur du composant */ j = 0; while( Line[i] != ' ' ) schematic_timestamp[j++] = Line[i++]; schematic_timestamp[j] = 0; /* search val/ref.lib */ while( Line[i] == ' ' ) i++; /* i points the component value */ LibName = Line + i; LibName = Line + i; memset( schematic_timestamp, 0, sizeof(schematic_timestamp) ); memset( component_reference, 0, sizeof(component_reference) ); memset( component_reference, 0, sizeof(component_reference) ); memset( footprint_name, 0, sizeof(footprint_name) ); memset( footprint_name, 0, sizeof(footprint_name) ); memset( component_value, 0, sizeof(component_value) ); memset( component_value, 0, sizeof(component_value) ); memset( alim, 0, sizeof(alim) ); memset( alim, 0, sizeof(alim) ); /* lecture valeur du composant */ /* Read value */ /* recherche fin de valeur (' ') */ ptchar = strstr( &Line[i], " " ); // Search end of value field (space) ptchar = strstr(&Line[i]," ") ; if( ptchar == 0 ) if( ptchar == 0 ) { { wxString msg; wxString msg; Loading @@ -127,52 +144,64 @@ STORECMP * Cmp; DisplayError( NULL, msg ); DisplayError( NULL, msg ); k = 0; k = 0; } } else k = ptchar - Line ; else k = ptchar - Line; for( j = 0; i < k; i++ ) for( j = 0; i < k; i++ ) { { if ( Line[i] == SEPARATEUR ) break ; if( Line[i] == SEPARATEUR ) break; if( j < (int) (sizeof(footprint_name) - 1) ) if( j < (int) (sizeof(footprint_name) - 1) ) footprint_name[j++] = Line[i]; footprint_name[j++] = Line[i]; } } if( (Line[++i] == '(') && (Line[k - 1] == ')' ) ) if( (Line[++i] == '(') && (Line[k - 1] == ')' ) ) { { i++ ; l = 0 ; while ( k-1 > i ) alim[l++] = Line[i++] ; i++; l = 0; while( k - 1 > i ) alim[l++] = Line[i++]; } } else i = k; else i = k ; /* Search component reference */ while( Line[i] != ' ' ) i++; /* recherche reference du composant */ /* goto end of value field */ while(Line[i] != ' ') i++ ; /* elimination fin valeur */ while( Line[i] == ' ' ) while(Line[i] == ' ') i++ ; /* recherche debut reference */ i++; /* goto beginning of reference */ /* debut reference trouv */ /* debut reference trouv */ for( k = 0; k < (int) (sizeof(component_reference) - 1); i++, k++ ) for( k = 0; k < (int) (sizeof(component_reference) - 1); i++, k++ ) { { if ( Line[i] <= ' ' ) break ; if( Line[i] <= ' ' ) break; component_reference[k] = Line[i]; component_reference[k] = Line[i]; } } /* recherche valeur du composant */ /* Search component value */ while(Line[i] == ' ') i++ ; /* recherche debut valeur */ while( Line[i] == ' ' ) i++; /** goto beginning of value */ /* debut vraie valeur trouvee */ for( k = 0; k < (int) (sizeof(component_value) - 1); i++, k++ ) for( k = 0; k < (int) (sizeof(component_value) - 1); i++, k++ ) { { if ( Line[i] <= ' ' ) break ; if( Line[i] <= ' ' ) break; component_value[k] = Line[i]; component_value[k] = Line[i]; } } /* Store info for this component */ /* classement du composant ,suivi de sa valeur */ Cmp = new STORECMP(); Cmp = new STORECMP(); Cmp->Pnext = g_BaseListeCmp; Cmp->Pnext = g_BaseListeCmp; g_BaseListeCmp = Cmp; g_BaseListeCmp = Cmp; Cmp->m_Reference = CONV_FROM_UTF8( component_reference ); Cmp->m_Reference = CONV_FROM_UTF8( component_reference ); Cmp->m_Valeur = CONV_FROM_UTF8( component_value ); Cmp->m_Valeur = CONV_FROM_UTF8( component_value ); if( g_FlagEESchema ) /* Copie du nom module: */ if( g_FlagEESchema ) /* copy footprint name: */ { { if( strnicmp( LibName, "$noname", 7 ) != 0 ) if( strnicmp( LibName, "$noname", 7 ) != 0 ) { { Loading @@ -183,38 +212,41 @@ STORECMP * Cmp; } } } } } } /* classement du TimeStamp */ Cmp->m_TimeStamp = CONV_FROM_UTF8( schematic_timestamp ); Cmp->m_TimeStamp = CONV_FROM_UTF8(ref_schema); pin_orcad( Cmp) ; ReadPinConnection( Cmp ); nbcomp++; nbcomp++; } } fclose( source ); fclose( source ); /* reclassement alpabetique : */ /* Alpabetic sorting : */ g_BaseListeCmp = TriListeComposantss( g_BaseListeCmp, nbcomp ); g_BaseListeCmp = TriListeComposantss( g_BaseListeCmp, nbcomp ); return(0); return 0; } } /********************************************************/ /********************************************************/ int WinEDA_CvpcbFrame::ReadFootprintFilterList( FILE* f ) int WinEDA_CvpcbFrame::ReadFootprintFilterList( FILE* f ) /********************************************************/ /********************************************************/ { { char Line[1024]; char Line[BUFFER_CHAR_SIZE + 1]; wxString CmpRef; wxString CmpRef; STORECMP* Cmp = NULL; STORECMP* Cmp = NULL; for( ; ; ) for( ; ; ) { { if( fgets(Line,255,source) == 0 ) break; if( fgets( Line, BUFFER_CHAR_SIZE, source ) == 0 ) break; if( strnicmp( Line, "$endlist", 8 ) == 0 ) if( strnicmp( Line, "$endlist", 8 ) == 0 ) { { Cmp = NULL; Cmp = NULL; continue; continue; } } if (strnicmp(Line,"$endfootprintlist", 4 ) == 0 ) return 0; if( strnicmp( Line, "$endfootprintlist", 4 ) == 0 ) return 0; if( strnicmp( Line, "$component", 10 ) == 0 ) // New component ref found if( strnicmp( Line, "$component", 10 ) == 0 ) // New component ref found { { Loading @@ -223,10 +255,10 @@ STORECMP * Cmp = NULL; /* Search the new component in list */ /* Search the new component in list */ for( Cmp = g_BaseListeCmp; Cmp != NULL; Cmp = Cmp->Pnext ) for( Cmp = g_BaseListeCmp; Cmp != NULL; Cmp = Cmp->Pnext ) { { if ( Cmp->m_Reference == CmpRef) break; if( Cmp->m_Reference == CmpRef ) break; } } } } else if( Cmp ) else if( Cmp ) { { wxString fp = CONV_FROM_UTF8( Line + 1 ); wxString fp = CONV_FROM_UTF8( Line + 1 ); Loading @@ -240,12 +272,12 @@ STORECMP * Cmp = NULL; /***********************************/ /***********************************/ int pin_orcad(STORECMP * Cmp) int ReadPinConnection( STORECMP* Cmp ) /***********************************/ /***********************************/ { { int i, jj; int i, jj; char numpin[9] , net[1024] ; char numpin[BUFFER_CHAR_SIZE + 1], net[BUFFER_CHAR_SIZE + 1]; char Line[1024]; char Line[BUFFER_CHAR_SIZE + 1]; STOREPIN* Pin = NULL; STOREPIN* Pin = NULL; STOREPIN** LastPin = &Cmp->m_Pins; STOREPIN** LastPin = &Cmp->m_Pins; Loading @@ -254,30 +286,39 @@ for ( ;; ) /* debut description trouv */ /* debut description trouv */ for( ; ; ) for( ; ; ) { { if ( fgets(Line,80,source) == 0 ) return(-1) ; if( fgets( Line, BUFFER_CHAR_SIZE, source ) == 0 ) return -1; /* remove blanks from the beginning of the line */ i = 0; while( Line[i] == ' ' ) i++; /* suppression des blancs en dbut de ligne */ while( Line[i] == '(' ) i = 0 ; while (Line[i] == ' ') i++ ; i++; while (Line[i] == '(') i++ ; while (Line[i] == ' ') i++ ; /* elimination des lignes vides : */ while( Line[i] == ' ' ) if (Line[i] < ' ') continue ; i++; /* remove empty lines : */ if( Line[i] < ' ' ) continue; /* fin de description ? */ /* fin de description ? */ if (Line[i] == ')' ) return(0) ; if( Line[i] == ')' ) return 0; memset( net, 0, sizeof(net) ); memset( net, 0, sizeof(net) ); memset( numpin, 0, sizeof(numpin) ); memset( numpin, 0, sizeof(numpin) ); /* lecture name pin , 4 lettres */ /* Read pi name , 4 letters */ for( jj = 0; jj < 4; jj++, i++ ) for( jj = 0; jj < 4; jj++, i++ ) { { if ( Line[i] == ' ' ) break ; if( Line[i] == ' ' ) break; numpin[jj] = Line[i]; numpin[jj] = Line[i]; } } /* recherche affectation force de net */ /* Search for a net attribute */ if( reaffect( numpin, net ) != 0 ) if( reaffect( numpin, net ) != 0 ) { { Pin = new STOREPIN(); Pin = new STOREPIN(); Loading @@ -287,13 +328,14 @@ for ( ;; ) continue; continue; } } /* recherche netname */ /* Read netname */ while(Line[i] == ' ') i++ ; /* recherche debut reference */ while( Line[i] == ' ' ) i++; /* debut netname trouv */ for( jj = 0; jj < (int) sizeof(net) - 1; i++, jj++ ) for( jj = 0; jj < (int) sizeof(net) - 1; i++, jj++ ) { { if ( Line[i] <= ' ' ) break ; if( Line[i] <= ' ' ) break; net[jj] = Line[i]; net[jj] = Line[i]; } } Loading @@ -309,15 +351,16 @@ for ( ;; ) /****************************************************************/ /****************************************************************/ STORECMP* TriListeComposantss( STORECMP* BaseListe, int nbitems ) STORECMP* TriListeComposantss( STORECMP* BaseListe, int nbitems ) /****************************************************************/ /****************************************************************/ /* Tri la liste des composants par ordre alphabetique et me a jour le nouveau chainage avant/arriere /* Sort the component list( this is a linked list) retourne un pointeur sur le 1er element de la liste * retourn the beginning of the list */ */ { { STORECMP** bufferptr, * Item; STORECMP** bufferptr, * Item; int ii; int ii; if (nbitems <= 0 ) return(NULL); if( nbitems <= 0 ) return NULL; bufferptr = (STORECMP**) MyZMalloc( (nbitems + 2) * sizeof(STORECMP*) ); bufferptr = (STORECMP**) MyZMalloc( (nbitems + 2) * sizeof(STORECMP*) ); for( ii = 1, Item = BaseListe; Item != NULL; Item = Item->Pnext, ii++ ) for( ii = 1, Item = BaseListe; Item != NULL; Item = Item->Pnext, ii++ ) Loading @@ -325,13 +368,13 @@ int ii; bufferptr[ii] = Item; bufferptr[ii] = Item; } } /* ici bufferptr[0] = NULL et bufferptr[nbitem+1] = NULL et ces 2 valeurs /* Here: bufferptr[0] = NULL and bufferptr[nbitem+1] = NULL. representent le chainage arriere du 1er element, et le chainage avant * These 2 values are the first item back link, and the last item forward link du dernier element */ */ qsort( bufferptr + 1, nbitems, sizeof(STORECMP*), qsort( bufferptr + 1, nbitems, sizeof(STORECMP*), ( int( * ) ( const void*, const void* ) )CmpCompare ); ( int( * ) ( const void*, const void* ) )CmpCompare ); /* Mise a jour du chainage */ /* Update linked list */ for( ii = 1; ii <= nbitems; ii++ ) for( ii = 1; ii <= nbitems; ii++ ) { { Item = bufferptr[ii]; Item = bufferptr[ii]; Loading @@ -339,15 +382,17 @@ int ii; Item->Pnext = bufferptr[ii + 1]; Item->Pnext = bufferptr[ii + 1]; Item->Pback = bufferptr[ii - 1]; Item->Pback = bufferptr[ii - 1]; } } return(bufferptr[1]); return bufferptr[1]; } } /****************************************/ /****************************************/ int CmpCompare( void* mod1, void* mod2 ) int CmpCompare( void* mod1, void* mod2 ) /****************************************/ /****************************************/ /* /* routine compare() pour qsort() en classement alphabetique des composants * Function compare() for qsort() : alphabetic sorting, with numbering order */ */ { { int ii; int ii; Loading @@ -358,8 +403,5 @@ STORECMP *pt1 , *pt2 ; //FIXME: //FIXME: ii = StrNumICmp( (const wxChar*) pt1->m_Reference, (const wxChar*) pt2->m_Reference ); ii = StrNumICmp( (const wxChar*) pt1->m_Reference, (const wxChar*) pt2->m_Reference ); return(ii); return ii; } }
include/bitmaps.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -183,6 +183,7 @@ #include "../bitmaps/transistor.xpm" #include "../bitmaps/transistor.xpm" #include "../bitmaps/kicad_icon_small.xpm" #include "../bitmaps/kicad_icon_small.xpm" #include "../bitmaps/general_ratsnet.xpm" #include "../bitmaps/general_ratsnet.xpm" #include "../bitmaps/fill_zone.xpm" // Largeur du toolbar vertical // Largeur du toolbar vertical #define VTOOLBAR_WIDTH 26 #define VTOOLBAR_WIDTH 26 Loading