Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
d1e44864
Commit
d1e44864
authored
Jul 05, 2009
by
jerryjacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Closed bug 2802441, see CHANGELOG.txt
parent
f7265b0a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
149 additions
and
100 deletions
+149
-100
CHANGELOG.txt
CHANGELOG.txt
+7
-0
Doxyfile
Doxyfile
+1
-0
listlib.cpp
cvpcb/listlib.cpp
+127
-98
eelibs_read_libraryfiles.cpp
eeschema/eelibs_read_libraryfiles.cpp
+14
-2
No files found.
CHANGELOG.txt
View file @
d1e44864
...
...
@@ -4,6 +4,13 @@ KiCad ChangeLog 2009
Please add newer entries at the top, list the date and your name with
email address.
2009-july-05 UPDATE Jerry Jacobs <jerkejacobs@gmail.com
================================================================================
+ Closing bug 2802441, No single error messages any more, 2009-06-07 over2there.
Fixed this both in eeschema and cvpcb, for now printing wxstring in a
messagebox. Should make a nice textctrl dialog.
+ Added cvpcb directory to Doxyfile
2009-june-19 UPDATE Jerry Jacobs <jerkejacobs@gmail.com>
================================================================================
Added Hauptmech patch.
...
...
Doxyfile
View file @
d1e44864
...
...
@@ -78,6 +78,7 @@ WARN_LOGFILE =
#---------------------------------------------------------------------------
INPUT = kicad \
pcbnew \
cvpcb \
eeschema \
3d-viewer \
common \
...
...
cvpcb/listlib.cpp
View file @
d1e44864
...
...
@@ -20,6 +20,12 @@
#include "protos.h"
/* Bla */
wxString
mdc_files_not_found
;
wxString
mdc_files_invalid
;
/* routines locales : */
static
void
ReadDocLib
(
const
wxString
&
ModLibName
,
FOOTPRINT_LIST
&
list
);
...
...
@@ -39,19 +45,19 @@ static void ReadDocLib( const wxString& ModLibName, FOOTPRINT_LIST& list );
bool
LoadFootprintFiles
(
const
wxArrayString
&
libNames
,
FOOTPRINT_LIST
&
list
)
{
FILE
*
file
;
/* pour lecture librairie */
char
buffer
[
1024
];
wxFileName
fn
;
int
end
;
FOOTPRINT
*
ItemLib
;
unsigned
i
i
;
wxString
tmp
,
msg
;
if
(
!
list
.
empty
()
)
{
list
.
clear
();
}
FILE
*
file
;
/* pour lecture librairie */
char
buffer
[
1024
];
wxFileName
filename
;
int
end
;
FOOTPRINT
*
ItemLib
;
unsigned
i
;
wxString
tmp
,
msg
;
/* Check if footprint list is not empty */
if
(
!
list
.
empty
()
)
list
.
clear
();
/* Check if there are footprint libraries in project file */
if
(
libNames
.
GetCount
()
==
0
)
{
wxMessageBox
(
_
(
"No PCB foot print libraries are listed in the current project file."
),
...
...
@@ -59,24 +65,25 @@ bool LoadFootprintFiles( const wxArrayString& libNames,
return
false
;
}
/*
Lecture des Librairies
*/
for
(
i
i
=
0
;
ii
<
libNames
.
GetCount
();
i
i
++
)
/*
Parse Libraries Listed
*/
for
(
i
=
0
;
i
<
libNames
.
GetCount
();
i
++
)
{
/* Calcul du nom complet de la librairie */
fn
=
libNames
[
ii
];
fn
.
SetExt
(
ModuleFileExtension
);
filename
=
libNames
[
i
];
filename
.
SetExt
(
ModuleFileExtension
);
tmp
=
wxGetApp
().
FindLibraryPath
(
filename
);
tmp
=
wxGetApp
().
FindLibraryPath
(
fn
);
if
(
!
tmp
)
{
msg
.
Printf
(
_
(
"PCB foot print library file <%s> could not be found in the default search paths."
),
f
n
.
GetFullName
().
c_str
()
);
f
ilename
.
GetFullName
().
c_str
()
);
wxMessageBox
(
msg
,
titleLibLoadError
,
wxOK
|
wxICON_ERROR
);
continue
;
}
/*
acces a une librairi
e */
/*
Open library fil
e */
file
=
wxFopen
(
tmp
,
wxT
(
"rt"
)
);
if
(
file
==
NULL
)
...
...
@@ -87,7 +94,7 @@ bool LoadFootprintFiles( const wxArrayString& libNames,
continue
;
}
/* C
ontrole du type de la librairie :
*/
/* C
heck if library type is valid
*/
fgets
(
buffer
,
32
,
file
);
if
(
strncmp
(
buffer
,
ENTETE_LIBRAIRIE
,
L_ENTETE_LIB
)
!=
0
)
{
...
...
@@ -98,10 +105,10 @@ bool LoadFootprintFiles( const wxArrayString& libNames,
continue
;
}
/* Lecture du nombre de composants */
/*
TODO
Lecture du nombre de composants */
fseek
(
file
,
0
,
0
);
/* lecture nom des composants : */
/*
TODO
lecture nom des composants : */
end
=
0
;
while
(
!
end
&&
fgets
(
buffer
,
255
,
file
)
!=
NULL
)
{
...
...
@@ -134,86 +141,108 @@ bool LoadFootprintFiles( const wxArrayString& libNames,
ReadDocLib
(
tmp
,
list
);
}
list
.
sort
();
return
true
;
/* Display if there are mdc files not found */
if
(
mdc_files_not_found
!=
wxT
(
""
))
{
wxString
message
=
_
(
"The following mdc files could not be found:
\n\n
"
);
message
+=
mdc_files_not_found
;
wxMessageBox
(
message
,
_
(
"Load error!"
),
wxOK
|
wxICON_ERROR
);
}
/* Display if there are mdc files invalid */
if
(
mdc_files_invalid
!=
wxT
(
""
))
{
wxString
message
=
_
(
"The following mdc files are invalid:
\n\n
"
);
message
+=
mdc_files_invalid
;
wxMessageBox
(
message
,
_
(
"Load error!"
),
wxOK
|
wxICON_ERROR
);
}
list
.
sort
();
return
true
;
}
/* Routine de lecture du fichier Doc associe a la librairie ModLibName.
/**
* Routine de lecture du fichier Doc associe a la librairie ModLibName.
* Cree en memoire la chaine liste des docs pointee par MList
* ModLibName = full file Name de la librairie Modules
*/
static
void
ReadDocLib
(
const
wxString
&
ModLibName
,
FOOTPRINT_LIST
&
list
)
static
void
ReadDocLib
(
const
wxString
&
ModLibName
,
FOOTPRINT_LIST
&
list
)
{
FOOTPRINT
*
NewMod
;
char
Line
[
1024
];
wxString
ModuleName
;
wxString
msg
;
FILE
*
LibDoc
;
wxFileName
fn
=
ModLibName
;
fn
.
SetExt
(
wxT
(
"mdc"
)
);
if
(
(
LibDoc
=
wxFopen
(
fn
.
GetFullPath
(),
wxT
(
"rt"
)
)
)
==
NULL
)
{
msg
.
Printf
(
_
(
"Could not open PCB foot print library document file <%s>."
),
fn
.
GetFullPath
().
c_str
()
);
wxMessageBox
(
msg
,
titleLibLoadError
,
wxOK
|
wxICON_ERROR
);
return
;
}
GetLine
(
LibDoc
,
Line
,
NULL
,
sizeof
(
Line
)
-
1
);
if
(
strnicmp
(
Line
,
ENTETE_LIBDOC
,
L_ENTETE_LIB
)
!=
0
)
{
msg
.
Printf
(
_
(
"<%s> is not a valid PCB foot print library document file."
),
fn
.
GetFullPath
().
c_str
()
);
wxMessageBox
(
msg
,
titleLibLoadError
,
wxOK
|
wxICON_ERROR
);
return
;
}
/* Lecture de la librairie */
while
(
GetLine
(
LibDoc
,
Line
,
NULL
,
sizeof
(
Line
)
-
1
)
)
{
NewMod
=
NULL
;
if
(
Line
[
0
]
!=
'$'
)
continue
;
if
(
Line
[
1
]
==
'E'
)
break
;;
if
(
Line
[
1
]
==
'M'
)
/* Debut decription 1 module */
{
while
(
GetLine
(
LibDoc
,
Line
,
NULL
,
sizeof
(
Line
)
-
1
)
)
{
if
(
Line
[
0
]
==
'$'
)
/* $EndMODULE */
break
;
switch
(
Line
[
0
]
)
{
case
'L'
:
/* LibName */
ModuleName
=
CONV_FROM_UTF8
(
StrPurge
(
Line
+
3
)
);
BOOST_FOREACH
(
FOOTPRINT
&
footprint
,
list
)
{
if
(
ModuleName
==
footprint
.
m_Module
)
{
NewMod
=
&
footprint
;
break
;
}
}
break
;
case
'K'
:
/* KeyWords */
if
(
NewMod
&&
(
!
NewMod
->
m_KeyWord
)
)
NewMod
->
m_KeyWord
=
CONV_FROM_UTF8
(
StrPurge
(
Line
+
3
)
);
break
;
case
'C'
:
/* Doc */
if
(
NewMod
&&
(
!
NewMod
->
m_Doc
)
)
NewMod
->
m_Doc
=
CONV_FROM_UTF8
(
StrPurge
(
Line
+
3
)
);
break
;
}
}
}
/* lecture 1 descr module */
}
/* Fin lecture librairie */
fclose
(
LibDoc
);
FOOTPRINT
*
NewMod
;
char
Line
[
1024
];
wxString
ModuleName
;
FILE
*
mdc_file
;
wxFileName
mdc_filename
=
ModLibName
;
/* Set mdc filename extension */
mdc_filename
.
SetExt
(
wxT
(
"mdc"
)
);
/* Check if mdc file exists and can be opened */
if
(
(
mdc_file
=
wxFopen
(
mdc_filename
.
GetFullPath
(),
wxT
(
"rt"
)
)
)
==
NULL
)
{
mdc_files_not_found
+=
mdc_filename
.
GetFullPath
()
+
wxT
(
"
\n
"
);
return
;
}
/* Check if mdc file is valid */
GetLine
(
mdc_file
,
Line
,
NULL
,
sizeof
(
Line
)
-
1
);
if
(
strnicmp
(
Line
,
ENTETE_LIBDOC
,
L_ENTETE_LIB
)
!=
0
)
{
mdc_files_invalid
+=
mdc_filename
.
GetFullPath
()
+
wxT
(
"
\n
"
);
return
;
}
/* Read the mdc file */
while
(
GetLine
(
mdc_file
,
Line
,
NULL
,
sizeof
(
Line
)
-
1
)
)
{
NewMod
=
NULL
;
if
(
Line
[
0
]
!=
'$'
)
continue
;
if
(
Line
[
1
]
==
'E'
)
break
;
if
(
Line
[
1
]
==
'M'
)
/* 1 module description */
{
/* Parse file line by line */
while
(
GetLine
(
mdc_file
,
Line
,
NULL
,
sizeof
(
Line
)
-
1
)
)
{
/* $EndMODULE */
if
(
Line
[
0
]
==
'$'
)
break
;
switch
(
Line
[
0
]
)
{
/* LibName */
case
'L'
:
/* LibName */
ModuleName
=
CONV_FROM_UTF8
(
StrPurge
(
Line
+
3
)
);
BOOST_FOREACH
(
FOOTPRINT
&
footprint
,
list
)
{
if
(
ModuleName
==
footprint
.
m_Module
)
{
NewMod
=
&
footprint
;
break
;
}
}
break
;
/* KeyWords */
case
'K'
:
if
(
NewMod
&&
(
!
NewMod
->
m_KeyWord
)
)
NewMod
->
m_KeyWord
=
CONV_FROM_UTF8
(
StrPurge
(
Line
+
3
)
);
break
;
/* Doc */
case
'C'
:
if
(
NewMod
&&
(
!
NewMod
->
m_Doc
)
)
NewMod
->
m_Doc
=
CONV_FROM_UTF8
(
StrPurge
(
Line
+
3
)
);
break
;
}
}
}
/* Parsed one module documentation */
}
/* Parsed complete library documentation */
fclose
(
mdc_file
);
}
eeschema/eelibs_read_libraryfiles.cpp
View file @
d1e44864
...
...
@@ -2,6 +2,8 @@
/* Functions to handle component library files : read functions */
/*****************************************************************/
#include <iostream>
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
...
...
@@ -109,6 +111,7 @@ void LoadLibraries( WinEDA_SchematicFrame* frame )
{
wxFileName
fn
;
wxString
msg
,
tmp
;
wxString
libraries_not_found
;
unsigned
ii
,
iimax
=
frame
->
m_ComponentLibFiles
.
GetCount
();
// Free the unwanted libraries (i.e. not in list) but keep the cache lib
...
...
@@ -139,8 +142,7 @@ void LoadLibraries( WinEDA_SchematicFrame* frame )
tmp
=
wxGetApp
().
FindLibraryPath
(
fn
);
if
(
!
tmp
)
{
msg
.
Printf
(
_
(
"Library file <%s> not found."
),
fn
.
GetName
().
c_str
()
);
wxMessageBox
(
msg
,
_
(
"Library Load Error"
),
wxOK
|
wxICON_ERROR
,
frame
);
libraries_not_found
+=
fn
.
GetName
()
+
_
(
"
\n
"
);
continue
;
}
}
...
...
@@ -161,6 +163,16 @@ void LoadLibraries( WinEDA_SchematicFrame* frame )
frame
->
PrintMsg
(
msg
);
}
/* Print the libraries not found */
if
(
libraries_not_found
!=
_
(
""
))
{
wxString
message
=
_
(
"The following libraries could not be found:
\n\n
"
);
message
+=
libraries_not_found
;
wxMessageBox
(
message
,
_
(
"Load error!"
),
wxOK
|
wxICON_ERROR
,
frame
);
}
// reorder the linked list to match the order filename list:
int
NumOfLibs
;
for
(
NumOfLibs
=
0
,
lib
=
g_LibraryList
;
lib
!=
NULL
;
lib
=
lib
->
m_Pnext
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment