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
0dff6b9b
Commit
0dff6b9b
authored
Oct 13, 2011
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pcbnew: Fix an issue when try to importing gpcb footprints
parent
31ed2c28
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
7 deletions
+20
-7
richio.h
include/richio.h
+3
-0
gpcb_exchange.cpp
pcbnew/gpcb_exchange.cpp
+14
-6
librairi.cpp
pcbnew/librairi.cpp
+3
-1
No files found.
include/richio.h
View file @
0dff6b9b
...
...
@@ -56,6 +56,9 @@
// use one of the following __LOC__ defs, depending on whether your
// compiler supports __func__ or not, and how it handles __LINE__
#if defined ( _MSC_VER )
#define __func__ __FUNCTION__
#endif
#define __LOC__ ((std::string(__func__) + "() : line ") + TOSTRING(__LINE__)).c_str()
//#define __LOC__ TOSTRING(__LINE__)
...
...
pcbnew/gpcb_exchange.cpp
View file @
0dff6b9b
...
...
@@ -331,7 +331,7 @@ bool MODULE::Read_GPCB_Descr( const wxString& CmpFullFileName )
}
if
(
params
[
0
].
CmpNoCase
(
wxT
(
"Pad"
)
)
==
0
)
// Pad with no hole (smd pad)
{
// format: Pad [x1 y1 x2 y2 thickness clearance mask "name" "pad_number" flags]
{
// format: Pad [x1 y1 x2 y2 thickness clearance mask "name" "pad_number" flags]
Pad
=
new
D_PAD
(
this
);
Pad
->
m_PadShape
=
PAD_RECT
;
Pad
->
m_layerMask
=
LAYER_FRONT
|
SOLDERMASK_LAYER_FRONT
|
SOLDERPASTE_LAYER_FRONT
;
...
...
@@ -361,9 +361,13 @@ bool MODULE::Read_GPCB_Descr( const wxString& CmpFullFileName )
// Currently unused
// Read pad number:
if
(
params
.
GetCount
()
>
10
)
if
(
params
[
1
]
==
wxT
(
"("
)
)
{
Pad
->
SetPadName
(
params
[
8
]
);
}
else
{
strncpy
(
Pad
->
m_Padname
,
TO_UTF8
(
params
[
10
]
),
4
);
Pad
->
SetPadName
(
params
[
10
]
);
}
Pad
->
m_Pos
.
x
=
(
ibuf
[
0
]
+
ibuf
[
2
])
/
2
;
Pad
->
m_Pos
.
y
=
(
ibuf
[
1
]
+
ibuf
[
3
])
/
2
;
...
...
@@ -385,7 +389,7 @@ bool MODULE::Read_GPCB_Descr( const wxString& CmpFullFileName )
}
if
(
params
[
0
].
CmpNoCase
(
wxT
(
"Pin"
)
)
==
0
)
// Pad with hole (trough pad)
{
// format: Pin[x y Thickness Clearance Mask DrillHole Name Number Flags]
{
// format: Pin[x y Thickness Clearance Mask DrillHole Name Number Flags]
Pad
=
new
D_PAD
(
this
);
Pad
->
m_PadShape
=
PAD_ROUND
;
Pad
->
m_layerMask
=
ALL_CU_LAYERS
|
...
...
@@ -415,9 +419,13 @@ bool MODULE::Read_GPCB_Descr( const wxString& CmpFullFileName )
// Currently unused
// Read pad number:
if
(
params
.
GetCount
()
>
9
)
if
(
params
[
1
]
==
wxT
(
"("
)
)
{
Pad
->
SetPadName
(
params
[
7
]
);
}
else
{
strncpy
(
Pad
->
m_Padname
,
TO_UTF8
(
params
[
9
]
),
4
);
Pad
->
SetPadName
(
params
[
9
]
);
}
Pad
->
m_Pos
.
x
=
ibuf
[
0
];
...
...
pcbnew/librairi.cpp
View file @
0dff6b9b
...
...
@@ -40,6 +40,7 @@
const
wxString
ModExportFileExtension
(
wxT
(
"emp"
)
);
static
const
wxString
ModExportFileWildcard
(
_
(
"KiCad foot print export files (*.emp)|*.emp"
)
);
static
const
wxString
ModImportFileWildcard
(
_
(
"GPcb foot print files (*)|*"
)
);
MODULE
*
FOOTPRINT_EDIT_FRAME
::
Import_Module
()
...
...
@@ -55,9 +56,10 @@ MODULE* FOOTPRINT_EDIT_FRAME::Import_Module()
if
(
Config
)
Config
->
Read
(
EXPORT_IMPORT_LASTPATH_KEY
,
&
LastOpenedPathForLoading
);
wxString
importWildCard
=
ModExportFileWildcard
+
wxT
(
"|"
)
+
ModImportFileWildcard
;
wxFileDialog
dlg
(
this
,
_
(
"Import Footprint Module"
),
LastOpenedPathForLoading
,
wxEmptyString
,
ModExportFileWildc
ard
,
wxFD_OPEN
|
wxFD_FILE_MUST_EXIST
);
importWildC
ard
,
wxFD_OPEN
|
wxFD_FILE_MUST_EXIST
);
if
(
dlg
.
ShowModal
()
==
wxID_CANCEL
)
return
NULL
;
...
...
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