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
597833b5
Commit
597833b5
authored
Apr 17, 2012
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
touch ups
parent
e88bc8e5
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
78 additions
and
49 deletions
+78
-49
common.cpp
common/common.cpp
+6
-4
footprint_info.cpp
common/footprint_info.cpp
+43
-34
common.h
include/common.h
+16
-2
legacy_plugin.cpp
pcbnew/legacy_plugin.cpp
+11
-0
legacy_plugin.h
pcbnew/legacy_plugin.h
+2
-9
No files found.
common/common.cpp
View file @
597833b5
...
...
@@ -120,15 +120,17 @@ StructColors ColorRefs[NBCOLOR] =
bool
g_DisableFloatingPointLocalNotation
=
false
;
void
SetLocaleTo_C_standard
(
void
)
int
LOCALE_IO
::
C_count
;
void
SetLocaleTo_C_standard
()
{
setlocale
(
LC_NUMERIC
,
"C"
);
// Switch the locale to standard C
}
void
SetLocaleTo_Default
(
void
)
void
SetLocaleTo_Default
()
{
if
(
!
g_DisableFloatingPointLocalNotation
)
if
(
!
g_DisableFloatingPointLocalNotation
)
setlocale
(
LC_NUMERIC
,
""
);
// revert to the current locale
}
...
...
common/footprint_info.cpp
View file @
597833b5
...
...
@@ -16,8 +16,6 @@
#include <pcbcommon.h>
#include <pcbstruct.h>
#include <richio.h>
#include <filter_reader.h>
#include <footprint_info.h>
#include <io_mgr.h>
...
...
@@ -42,25 +40,25 @@
*/
bool
FOOTPRINT_LIST
::
ReadFootprintFiles
(
wxArrayString
&
aFootprintsLibNames
)
{
wxFileName
filename
;
wxString
libname
;
// Clear data before reading files
m_filesNotFound
.
Empty
();
m_filesInvalid
.
Empty
();
m_List
.
clear
();
// try
{
PLUGIN
::
RELEASER
pi
(
IO_MGR
::
PluginFind
(
IO_MGR
::
LEGACY
)
);
// Parse Libraries Listed
for
(
unsigned
ii
=
0
;
ii
<
aFootprintsLibNames
.
GetCount
();
ii
++
)
{
filename
=
aFootprintsLibNames
[
ii
];
wxFileName
filename
=
aFootprintsLibNames
[
ii
];
filename
.
SetExt
(
FootprintLibFileExtension
);
libname
=
wxGetApp
().
FindLibraryPath
(
filename
);
wxString
libPath
=
wxGetApp
().
FindLibraryPath
(
filename
);
if
(
libname
.
IsEmpty
()
)
if
(
!
libPath
)
{
m_filesNotFound
<<
filename
.
GetFullName
()
<<
wxT
(
"
\n
"
);
continue
;
...
...
@@ -68,16 +66,19 @@ bool FOOTPRINT_LIST::ReadFootprintFiles( wxArrayString& aFootprintsLibNames )
try
{
wxArrayString
fpnames
=
pi
->
FootprintEnumerate
(
libname
);
wxArrayString
fpnames
=
pi
->
FootprintEnumerate
(
libPath
);
for
(
unsigned
i
=
0
;
i
<
fpnames
.
GetCount
();
++
i
)
{
std
::
auto_ptr
<
MODULE
>
m
(
pi
->
FootprintLoad
(
libname
,
fpnames
[
i
]
)
);
auto_ptr
<
MODULE
>
m
(
pi
->
FootprintLoad
(
libPath
,
fpnames
[
i
]
)
);
// we're loading what we enumerated, all must be there.
wxASSERT
(
m
.
get
()
);
FOOTPRINT_INFO
*
fpinfo
=
new
FOOTPRINT_INFO
();
fpinfo
->
m_Module
=
fpnames
[
i
];
fpinfo
->
m_LibName
=
libname
;
fpinfo
->
m_LibName
=
libPath
;
fpinfo
->
m_padCount
=
m
->
GetPadCount
();
fpinfo
->
m_KeyWord
=
m
->
GetKeywords
();
fpinfo
->
m_Doc
=
m
->
GetDescription
();
...
...
@@ -90,9 +91,17 @@ bool FOOTPRINT_LIST::ReadFootprintFiles( wxArrayString& aFootprintsLibNames )
m_filesInvalid
<<
ioe
.
errorText
<<
wxT
(
"
\n
"
);
}
}
}
/* caller should catch this, UI seems not wanted here.
catch( IO_ERROR ioe )
{
DisplayError( NULL, ioe.errorText );
return false;
}
*/
m_List
.
sort
();
return
true
;
}
include/common.h
View file @
597833b5
...
...
@@ -454,6 +454,7 @@ void SetLocaleTo_C_standard();
*/
void
SetLocaleTo_Default
();
/**
* Class LOCALE_IO
* is a class that can be instantiated within a scope in which you are expecting
...
...
@@ -464,10 +465,23 @@ void SetLocaleTo_Default();
class
LOCALE_IO
{
public
:
LOCALE_IO
()
{
SetLocaleTo_C_standard
();
}
~
LOCALE_IO
()
{
SetLocaleTo_Default
();
}
LOCALE_IO
()
{
if
(
C_count
++
==
0
)
SetLocaleTo_C_standard
();
}
~
LOCALE_IO
()
{
if
(
--
C_count
==
0
)
SetLocaleTo_Default
();
}
private
:
static
int
C_count
;
// allow for nesting of LOCALE_IO instantiations
};
/**
* Function EnsureTextCtrlWidth
* sets the minimum pixel width on a text control in order to make a text
...
...
pcbnew/legacy_plugin.cpp
View file @
597833b5
...
...
@@ -4186,6 +4186,17 @@ bool LEGACY_PLUGIN::IsFootprintLibWritable( const wxString& aLibraryPath )
}
LEGACY_PLUGIN
::
LEGACY_PLUGIN
()
:
m_board
(
0
),
m_props
(
0
),
m_reader
(
0
),
m_fp
(
0
),
m_cache
(
0
)
{
init
(
NULL
);
}
LEGACY_PLUGIN
::~
LEGACY_PLUGIN
()
{
delete
m_cache
;
...
...
pcbnew/legacy_plugin.h
View file @
597833b5
...
...
@@ -55,7 +55,7 @@ struct FPL_CACHE;
/**
* Class LEGACY_PLUGIN
* is a PLUGIN derivation which could possibly be put into a DLL/DSO.
*
It is not thread safe, but it is re-entrant multiple times in sequence
.
*
As with any PLUGIN, there is no UI, i.e. windowing calls allowed
.
*/
class
LEGACY_PLUGIN
:
public
PLUGIN
{
...
...
@@ -99,14 +99,7 @@ public:
//-----</PLUGIN IMPLEMENTATION>---------------------------------------------
LEGACY_PLUGIN
()
:
m_board
(
0
),
m_props
(
0
),
m_reader
(
0
),
m_fp
(
0
),
m_cache
(
0
)
{}
LEGACY_PLUGIN
();
~
LEGACY_PLUGIN
();
void
SetReader
(
LINE_READER
*
aReader
)
{
m_reader
=
aReader
;
}
...
...
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