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
eb396a5e
Commit
eb396a5e
authored
Jul 02, 2014
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix footprint wizard issues. Fix export vrml incorrect Z position of items.
parent
39216b4b
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
34 additions
and
36 deletions
+34
-36
class_pad.cpp
pcbnew/class_pad.cpp
+1
-3
class_pad.h
pcbnew/class_pad.h
+15
-4
dialog_pad_properties.cpp
pcbnew/dialogs/dialog_pad_properties.cpp
+1
-1
export_vrml.cpp
pcbnew/exporters/export_vrml.cpp
+2
-2
FPC_(SMD_type)_footprintwizard.py
pcbnew/scripting/plugins/FPC_(SMD_type)_footprintwizard.py
+2
-2
PadArray.py
pcbnew/scripting/plugins/PadArray.py
+4
-18
qfp_wizard.py
pcbnew/scripting/plugins/qfp_wizard.py
+5
-2
touch_slider_wizard.py
pcbnew/scripting/plugins/touch_slider_wizard.py
+3
-3
kicad.i
scripting/kicad.i
+1
-1
No files found.
pcbnew/class_pad.cpp
View file @
eb396a5e
...
@@ -95,15 +95,13 @@ LSET D_PAD::StandardMask()
...
@@ -95,15 +95,13 @@ LSET D_PAD::StandardMask()
LSET
D_PAD
::
SMDMask
()
LSET
D_PAD
::
SMDMask
()
{
{
// was: #define PAD_SMD_DEFAULT_LAYERS LAYER_FRONT | SOLDERPASTE_LAYER_FRONT | SOLDERMASK_LAYER_FRONT
static
LSET
saved
(
3
,
F_Cu
,
F_Paste
,
F_Mask
);
static
LSET
saved
(
3
,
F_Cu
,
F_Paste
,
F_Mask
);
return
saved
;
return
saved
;
}
}
LSET
D_PAD
::
ConnMask
()
LSET
D_PAD
::
Conn
SMD
Mask
()
{
{
// was: #define PAD_CONN_DEFAULT_LAYERS LAYER_FRONT | SOLDERMASK_LAYER_FRONT
static
LSET
saved
(
2
,
F_Cu
,
F_Mask
);
static
LSET
saved
(
2
,
F_Cu
,
F_Mask
);
return
saved
;
return
saved
;
}
}
...
...
pcbnew/class_pad.h
View file @
eb396a5e
...
@@ -88,10 +88,11 @@ public:
...
@@ -88,10 +88,11 @@ public:
/* Default layers used for pads, according to the pad type.
/* Default layers used for pads, according to the pad type.
* this is default values only, they can be changed for a given pad
* this is default values only, they can be changed for a given pad
*/
*/
static
LSET
StandardMask
();
static
LSET
StandardMask
();
///< layer set for a through hole pad
static
LSET
ConnMask
();
static
LSET
SMDMask
();
///< layer set for a SMD pad on Front layer
static
LSET
SMDMask
();
static
LSET
ConnSMDMask
();
///< layer set for a SMD pad on Front layer
static
LSET
UnplatedHoleMask
();
///< used for edge board connectors
static
LSET
UnplatedHoleMask
();
///< layer set for a mechanical unplated through hole pad
void
Copy
(
D_PAD
*
source
);
void
Copy
(
D_PAD
*
source
);
...
@@ -419,6 +420,16 @@ public:
...
@@ -419,6 +420,16 @@ public:
EDA_ITEM
*
Clone
()
const
;
EDA_ITEM
*
Clone
()
const
;
/**
* same as Clone, but returns a D_PAD item.
* Useful mainly for pythons scripts, because Clone (virtual function)
* returns an EDA_ITEM.
*/
D_PAD
*
Duplicate
()
const
{
return
(
D_PAD
*
)
Clone
();
}
/// @copydoc VIEW_ITEM::ViewGetLayers()
/// @copydoc VIEW_ITEM::ViewGetLayers()
virtual
void
ViewGetLayers
(
int
aLayers
[],
int
&
aCount
)
const
;
virtual
void
ViewGetLayers
(
int
aLayers
[],
int
&
aCount
)
const
;
...
...
pcbnew/dialogs/dialog_pad_properties.cpp
View file @
eb396a5e
...
@@ -76,7 +76,7 @@ static const LSET std_pad_layers[] = {
...
@@ -76,7 +76,7 @@ static const LSET std_pad_layers[] = {
D_PAD
::
SMDMask
(),
D_PAD
::
SMDMask
(),
// PAD_CONN:
// PAD_CONN:
D_PAD
::
ConnMask
(),
D_PAD
::
Conn
SMD
Mask
(),
// PAD_HOLE_NOT_PLATED:
// PAD_HOLE_NOT_PLATED:
D_PAD
::
UnplatedHoleMask
()
D_PAD
::
UnplatedHoleMask
()
...
...
pcbnew/exporters/export_vrml.cpp
View file @
eb396a5e
...
@@ -473,9 +473,9 @@ static void compute_layer_Zs( MODEL_VRML& aModel, BOARD* pcb )
...
@@ -473,9 +473,9 @@ static void compute_layer_Zs( MODEL_VRML& aModel, BOARD* pcb )
LAYER_ID
i
=
*
seq
;
LAYER_ID
i
=
*
seq
;
if
(
i
<
copper_layers
)
if
(
i
<
copper_layers
)
aModel
.
SetLayerZ
(
i
,
aModel
.
board_thickness
*
i
/
(
copper_layers
-
1
)
-
half_thickness
);
aModel
.
SetLayerZ
(
i
,
half_thickness
-
aModel
.
board_thickness
*
i
/
(
copper_layers
-
1
)
);
else
else
aModel
.
SetLayerZ
(
i
,
half_thickness
);
// component
layer
aModel
.
SetLayerZ
(
i
,
-
half_thickness
);
// bottom
layer
}
}
/* To avoid rounding interference, we apply an epsilon to each
/* To avoid rounding interference, we apply an epsilon to each
...
...
pcbnew/scripting/plugins/FPC_(SMD_type)_footprintwizard.py
View file @
eb396a5e
...
@@ -30,7 +30,7 @@ class FPCFootprintWizard(FootprintWizardPlugin):
...
@@ -30,7 +30,7 @@ class FPCFootprintWizard(FootprintWizardPlugin):
pad
.
SetSize
(
size
)
pad
.
SetSize
(
size
)
pad
.
SetShape
(
PAD_RECT
)
pad
.
SetShape
(
PAD_RECT
)
pad
.
SetAttribute
(
PAD_SMD
)
pad
.
SetAttribute
(
PAD_SMD
)
pad
.
SetLayer
Mask
(
PAD_SMD_DEFAULT_LAYERS
)
pad
.
SetLayer
Set
(
pad
.
StandardMask
()
)
pad
.
SetPos0
(
pos
)
pad
.
SetPos0
(
pos
)
pad
.
SetPosition
(
pos
)
pad
.
SetPosition
(
pos
)
pad
.
SetPadName
(
name
)
pad
.
SetPadName
(
name
)
...
@@ -126,7 +126,7 @@ class FPCFootprintWizard(FootprintWizardPlugin):
...
@@ -126,7 +126,7 @@ class FPCFootprintWizard(FootprintWizardPlugin):
xstart
=
-
pad_pitch
*
0.5
-
offsetX
xstart
=
-
pad_pitch
*
0.5
-
offsetX
xend
=
pad_pitch
*
pads
+
xstart
;
xend
=
pad_pitch
*
pads
+
xstart
;
outline
.
SetStartEnd
(
wxPoint
(
xstart
,
posy
),
wxPoint
(
xend
,
posy
)
)
outline
.
SetStartEnd
(
wxPoint
(
xstart
,
posy
),
wxPoint
(
xend
,
posy
)
)
outline
.
SetLayer
(
SILKSCREEN_N_FRONT
)
#default: not needed
outline
.
SetLayer
(
F_SilkS
)
#default: not needed
outline
.
SetShape
(
S_SEGMENT
)
outline
.
SetShape
(
S_SEGMENT
)
module
.
Add
(
outline
)
module
.
Add
(
outline
)
...
...
pcbnew/scripting/plugins/PadArray.py
View file @
eb396a5e
...
@@ -17,7 +17,7 @@ class PadMaker:
...
@@ -17,7 +17,7 @@ class PadMaker:
pad
.
SetShape
(
shape
)
pad
.
SetShape
(
shape
)
pad
.
SetAttribute
(
pcbnew
.
PAD_STANDARD
)
pad
.
SetAttribute
(
pcbnew
.
PAD_STANDARD
)
pad
.
SetLayer
Mask
(
pcbnew
.
PAD_STANDARD_DEFAULT_LAYERS
)
pad
.
SetLayer
Set
(
pad
.
StandardMask
()
)
pad
.
SetDrillSize
(
pcbnew
.
wxSize
(
drill
,
drill
))
pad
.
SetDrillSize
(
pcbnew
.
wxSize
(
drill
,
drill
))
return
pad
return
pad
...
@@ -29,7 +29,7 @@ class PadMaker:
...
@@ -29,7 +29,7 @@ class PadMaker:
pad
.
SetShape
(
shape
)
pad
.
SetShape
(
shape
)
pad
.
SetAttribute
(
pcbnew
.
PAD_SMD
)
pad
.
SetAttribute
(
pcbnew
.
PAD_SMD
)
pad
.
SetLayer
Mask
(
pcbnew
.
PAD_SMD_DEFAULT_LAYERS
)
pad
.
SetLayer
Set
(
pad
.
SMDMask
()
)
return
pad
return
pad
...
@@ -45,19 +45,6 @@ class PadArray:
...
@@ -45,19 +45,6 @@ class PadArray:
def
SetFirstPadInArray
(
self
,
fpNum
):
def
SetFirstPadInArray
(
self
,
fpNum
):
self
.
firstPad
=
fpNum
self
.
firstPad
=
fpNum
# HACK! pad should one day have its own clone method
def
ClonePad
(
self
):
pad
=
pcbnew
.
D_PAD
(
self
.
pad
.
GetParent
())
pad
.
SetSize
(
self
.
pad
.
GetSize
())
pad
.
SetShape
(
self
.
pad
.
GetShape
())
pad
.
SetAttribute
(
self
.
pad
.
GetAttribute
())
pad
.
SetLayerMask
(
self
.
pad
.
GetLayerMask
())
pad
.
SetDrillSize
(
self
.
pad
.
GetDrillSize
())
return
pad
def
AddPad
(
self
,
pad
):
def
AddPad
(
self
,
pad
):
self
.
pad
.
GetParent
()
.
Add
(
pad
)
self
.
pad
.
GetParent
()
.
Add
(
pad
)
...
@@ -100,9 +87,8 @@ class PadGridArray(PadArray):
...
@@ -100,9 +87,8 @@ class PadGridArray(PadArray):
pos
=
pcbnew
.
wxPoint
(
posX
,
posY
)
pos
=
pcbnew
.
wxPoint
(
posX
,
posY
)
# THIS DOESN'T WORK yet!
# create a new pad with same characteristics
#pad = self.pad.Clone()
pad
=
self
.
pad
.
Duplicate
()
pad
=
self
.
ClonePad
()
pad
.
SetPos0
(
pos
)
pad
.
SetPos0
(
pos
)
pad
.
SetPosition
(
pos
)
pad
.
SetPosition
(
pos
)
...
...
pcbnew/scripting/plugins/qfp_wizard.py
View file @
eb396a5e
...
@@ -27,6 +27,7 @@ class QFPWizard(HelpfulFootprintWizardPlugin.HelpfulFootprintWizardPlugin):
...
@@ -27,6 +27,7 @@ class QFPWizard(HelpfulFootprintWizardPlugin.HelpfulFootprintWizardPlugin):
def
CheckParameters
(
self
):
def
CheckParameters
(
self
):
self
.
CheckParamPositiveInt
(
"Pads"
,
"*n"
,
is_multiple_of
=
4
)
self
.
CheckParamPositiveInt
(
"Pads"
,
"*n"
,
is_multiple_of
=
4
)
self
.
CheckParamBool
(
"Pads"
,
"*oval"
)
def
GetReference
(
self
):
def
GetReference
(
self
):
return
"QFP
%
d"
%
self
.
parameters
[
"Pads"
][
"*n"
]
return
"QFP
%
d"
%
self
.
parameters
[
"Pads"
][
"*n"
]
...
@@ -46,8 +47,10 @@ class QFPWizard(HelpfulFootprintWizardPlugin.HelpfulFootprintWizardPlugin):
...
@@ -46,8 +47,10 @@ class QFPWizard(HelpfulFootprintWizardPlugin.HelpfulFootprintWizardPlugin):
row_len
=
(
pads_per_row
-
1
)
*
pad_pitch
row_len
=
(
pads_per_row
-
1
)
*
pad_pitch
h_pad
=
PA
.
PadMaker
(
self
.
module
)
.
SMDPad
(
pad_width
,
pad_length
,
shape
=
pcbnew
.
PAD_OVAL
)
pad_shape
=
pcbnew
.
PAD_OVAL
if
pads
[
"*oval"
]
else
pcbnew
.
PAD_RECT
v_pad
=
PA
.
PadMaker
(
self
.
module
)
.
SMDPad
(
pad_length
,
pad_width
,
shape
=
pcbnew
.
PAD_OVAL
)
h_pad
=
PA
.
PadMaker
(
self
.
module
)
.
SMDPad
(
pad_width
,
pad_length
,
shape
=
pad_shape
)
v_pad
=
PA
.
PadMaker
(
self
.
module
)
.
SMDPad
(
pad_length
,
pad_width
,
shape
=
pad_shape
)
#left row
#left row
pin1Pos
=
pcbnew
.
wxPoint
(
-
h_pitch
/
2
,
-
row_len
/
2
)
pin1Pos
=
pcbnew
.
wxPoint
(
-
h_pitch
/
2
,
-
row_len
/
2
)
...
...
pcbnew/scripting/plugins/touch_slider_wizard.py
View file @
eb396a5e
...
@@ -25,7 +25,7 @@ class TouchSliderWizard(FootprintWizardPlugin):
...
@@ -25,7 +25,7 @@ class TouchSliderWizard(FootprintWizardPlugin):
pad
.
SetSize
(
size
)
pad
.
SetSize
(
size
)
pad
.
SetShape
(
PAD_RECT
)
pad
.
SetShape
(
PAD_RECT
)
pad
.
SetAttribute
(
PAD_SMD
)
pad
.
SetAttribute
(
PAD_SMD
)
pad
.
SetLayer
Mask
(
PAD_SMD_DEFAULT_LAYERS
)
pad
.
SetLayer
Set
(
pad
.
ConnSMDMask
()
)
pad
.
SetPos0
(
pos
)
pad
.
SetPos0
(
pos
)
pad
.
SetPosition
(
pos
)
pad
.
SetPosition
(
pos
)
pad
.
SetPadName
(
name
)
pad
.
SetPadName
(
name
)
...
@@ -36,8 +36,8 @@ class TouchSliderWizard(FootprintWizardPlugin):
...
@@ -36,8 +36,8 @@ class TouchSliderWizard(FootprintWizardPlugin):
pad
=
D_PAD
(
module
)
pad
=
D_PAD
(
module
)
pad
.
SetSize
(
wxSize
(
size
[
0
],
size
[
1
]))
pad
.
SetSize
(
wxSize
(
size
[
0
],
size
[
1
]))
pad
.
SetShape
(
PAD_TRAPEZOID
)
pad
.
SetShape
(
PAD_TRAPEZOID
)
pad
.
SetAttribute
(
PAD_
CONN
)
pad
.
SetAttribute
(
PAD_
SMD
)
pad
.
SetLayer
Mask
(
PAD_CONN_DEFAULT_LAYERS
)
pad
.
SetLayer
Set
(
pad
.
ConnSMDMask
()
)
pad
.
SetPos0
(
pos
)
pad
.
SetPos0
(
pos
)
pad
.
SetPosition
(
pos
)
pad
.
SetPosition
(
pos
)
pad
.
SetPadName
(
name
)
pad
.
SetPadName
(
name
)
...
...
scripting/kicad.i
View file @
eb396a5e
...
@@ -66,7 +66,7 @@
...
@@ -66,7 +66,7 @@
#include <class_title_block.h>
#include <class_title_block.h>
#include <class_colors_design_settings.h>
#include <class_colors_design_settings.h>
#include <class_marker_base.h>
#include <class_marker_base.h>
#include <eda_text.h>
#include <eda_text.h>
#include <convert_from_iu.h>
#include <convert_from_iu.h>
#include <convert_to_biu.h>
#include <convert_to_biu.h>
...
...
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