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
9929919b
Commit
9929919b
authored
Jun 07, 2013
by
Wayne Stambaugh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix CvPcb library filtering bug. (fixes lp:1188321)
parent
aaab12d3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
8 deletions
+43
-8
footprint_info.cpp
common/footprint_info.cpp
+23
-0
class_footprints_listbox.cpp
cvpcb/class_footprints_listbox.cpp
+1
-1
footprint_info.h
include/footprint_info.h
+19
-7
No files found.
common/footprint_info.cpp
View file @
9929919b
...
...
@@ -180,3 +180,26 @@ bool FOOTPRINT_LIST::ReadFootprintFiles( FP_LIB_TABLE& aTable )
return
true
;
}
bool
FOOTPRINT_INFO
::
InLibrary
(
const
wxString
&
aLibrary
)
const
{
if
(
aLibrary
.
IsEmpty
()
)
return
false
;
if
(
aLibrary
==
m_libName
||
aLibrary
==
m_libPath
)
return
true
;
wxFileName
filename
=
aLibrary
;
if
(
filename
.
GetExt
().
IsEmpty
()
)
filename
.
SetExt
(
LegacyFootprintLibPathExtension
);
if
(
filename
.
GetFullPath
()
==
m_libPath
)
return
true
;
if
(
filename
.
GetPath
().
IsEmpty
()
)
filename
=
wxGetApp
().
FindLibraryPath
(
filename
.
GetFullName
()
);
return
filename
.
GetFullPath
()
==
m_libPath
;
}
cvpcb/class_footprints_listbox.cpp
View file @
9929919b
...
...
@@ -142,7 +142,7 @@ void FOOTPRINTS_LISTBOX::SetFootprints( FOOTPRINT_LIST& aList, const wxString& a
}
if
(
(
aFilterType
&
BY_LIBRARY
)
&&
!
aLibName
.
IsEmpty
()
&&
(
aList
.
GetItem
(
ii
).
m_libName
!=
aLibName
)
)
&&
!
aList
.
GetItem
(
ii
).
InLibrary
(
aLibName
)
)
continue
;
if
(
(
aFilterType
&
BY_COMPONENT
)
&&
(
aComponent
!=
NULL
)
...
...
include/footprint_info.h
View file @
9929919b
...
...
@@ -29,6 +29,7 @@
#ifndef FOOTPRINT_INFO_H_
#define FOOTPRINT_INFO_H_
#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/foreach.hpp>
...
...
@@ -46,13 +47,13 @@ class FP_LIB_TABLE;
class
FOOTPRINT_INFO
{
public
:
wxString
m_libName
;
///< Name of the library containing this module excluding path and ext.
wxString
m_libPath
;
///< The full library name and path associated the footprint.
wxString
m_Module
;
///< Module name.
int
m_Num
;
///< Order number in the display list.
wxString
m_Doc
;
///< Footprint description.
wxString
m_KeyWord
;
///< Footprint key words.
unsigned
m_padCount
;
///< Number of pads
wxString
m_libName
;
///< Name of the library containing this module excluding path and ext.
wxString
m_libPath
;
///< The full library name and path associated the footprint.
wxString
m_Module
;
///< Module name.
int
m_Num
;
///< Order number in the display list.
wxString
m_Doc
;
///< Footprint description.
wxString
m_KeyWord
;
///< Footprint key words.
unsigned
m_padCount
;
///< Number of pads
FOOTPRINT_INFO
()
{
...
...
@@ -67,6 +68,17 @@ public:
void
SetLibraryPath
(
const
wxString
&
aLibPath
)
{
m_libPath
=
aLibPath
;
}
const
wxString
&
GetLibraryPath
()
const
{
return
m_libPath
;
}
/**
* Function InLibrary
* tests if the #FOOTPRINT_INFO object was loaded from \a aLibrary.
*
* @param aLibrary is the file name or the fully qualified path and file name
* to test.
* @return true if the #FOOTPRINT_INFO object was loaded from \a aLibrary. Otherwise
* false.
*/
bool
InLibrary
(
const
wxString
&
aLibrary
)
const
;
};
...
...
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