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
aac10106
Commit
aac10106
authored
May 22, 2012
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more eagle_plugin work
parent
cb210042
Changes
13
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
695 additions
and
137 deletions
+695
-137
wxPcbStruct.h
include/wxPcbStruct.h
+1
-1
class_drawsegment.cpp
pcbnew/class_drawsegment.cpp
+45
-35
class_drawsegment.h
pcbnew/class_drawsegment.h
+14
-14
class_module.h
pcbnew/class_module.h
+5
-0
class_text_mod.h
pcbnew/class_text_mod.h
+5
-5
eagle_plugin.cpp
pcbnew/eagle_plugin.cpp
+556
-27
eagle_plugin.h
pcbnew/eagle_plugin.h
+33
-22
edgemod.cpp
pcbnew/edgemod.cpp
+1
-1
editedge.cpp
pcbnew/editedge.cpp
+1
-1
legacy_plugin.cpp
pcbnew/legacy_plugin.cpp
+6
-3
modedit_onclick.cpp
pcbnew/modedit_onclick.cpp
+2
-2
module_editor_frame.h
pcbnew/module_editor_frame.h
+1
-1
onleftclick.cpp
pcbnew/onleftclick.cpp
+25
-25
No files found.
include/wxPcbStruct.h
View file @
aac10106
...
...
@@ -1340,7 +1340,7 @@ public:
void
ShowTargetOptionsDialog
(
PCB_TARGET
*
aTarget
,
wxDC
*
DC
);
// Graphic segments type DRAWSEGMENT handling:
DRAWSEGMENT
*
Begin_DrawSegment
(
DRAWSEGMENT
*
Segment
,
int
shape
,
wxDC
*
DC
);
DRAWSEGMENT
*
Begin_DrawSegment
(
DRAWSEGMENT
*
Segment
,
STROKE_T
shape
,
wxDC
*
DC
);
void
End_Edge
(
DRAWSEGMENT
*
Segment
,
wxDC
*
DC
);
void
Delete_Segment_Edge
(
DRAWSEGMENT
*
Segment
,
wxDC
*
DC
);
void
Delete_Drawings_All_Layer
(
int
aLayer
);
...
...
pcbnew/class_drawsegment.cpp
View file @
aac10106
...
...
@@ -124,6 +124,10 @@ const wxPoint DRAWSEGMENT::GetArcEnd() const
// m_Start is the arc centre
endPoint
=
m_End
;
// m_End = start point of arc
RotatePoint
(
&
endPoint
,
m_Start
,
-
m_Angle
);
break
;
default
:
;
}
return
endPoint
;
// after rotation, the end of the arc.
...
...
@@ -429,8 +433,11 @@ EDA_RECT DRAWSEGMENT::GetBoundingBox() const
}
bbox
.
SetEnd
(
p_end
);
break
;
}
break
;
default
:
;
}
bbox
.
Inflate
(
((
m_Width
+
1
)
/
2
)
+
1
);
...
...
@@ -520,6 +527,9 @@ bool DRAWSEGMENT::HitTest( const EDA_RECT& aRect ) const
if
(
aRect
.
Contains
(
GetEnd
()
)
)
return
true
;
break
;
default
:
;
}
return
false
;
}
...
...
pcbnew/class_drawsegment.h
View file @
aac10106
...
...
@@ -47,7 +47,7 @@ protected:
wxPoint
m_Start
;
///< Line start point or Circle and Arc center
wxPoint
m_End
;
///< Line end point or circle and arc start point
int
m_Shape
;
///< Shape: line, Circle, Arc
STROKE_T
m_Shape
;
///< Shape: line, Circle, Arc
int
m_Type
;
///< Used in complex associations ( Dimensions.. )
double
m_Angle
;
///< Used only for Arcs: Arc angle in 1/10 deg
wxPoint
m_BezierC1
;
///< Bezier Control Point 1
...
...
@@ -83,8 +83,8 @@ public:
void
SetType
(
int
aType
)
{
m_Type
=
aType
;
}
int
GetType
()
const
{
return
m_Type
;
}
void
SetShape
(
int
aShape
)
{
m_Shape
=
aShape
;
}
int
GetShape
()
const
{
return
m_Shape
;
}
void
SetShape
(
STROKE_T
aShape
)
{
m_Shape
=
aShape
;
}
STROKE_T
GetShape
()
const
{
return
m_Shape
;
}
void
SetBezControl1
(
const
wxPoint
&
aPoint
)
{
m_BezierC1
=
aPoint
;
}
const
wxPoint
&
GetBezControl1
()
const
{
return
m_BezierC1
;
}
...
...
pcbnew/class_module.h
View file @
aac10106
...
...
@@ -294,6 +294,11 @@ public:
m_Value
->
m_Text
=
aValue
;
}
/// read/write accessors:
TEXTE_MODULE
&
Value
()
{
return
*
m_Value
;
}
TEXTE_MODULE
&
Reference
()
{
return
*
m_Reference
;
}
/**
* Function FindPadByName
* returns a D_PAD* with a matching name. Note that names may not be
...
...
pcbnew/class_text_mod.h
View file @
aac10106
pcbnew/eagle_plugin.cpp
View file @
aac10106
This diff is collapsed.
Click to expand it.
pcbnew/eagle_plugin.h
View file @
aac10106
...
...
@@ -55,15 +55,10 @@ namespace boost {
typedef
boost
::
property_tree
::
ptree
PTREE
;
typedef
const
PTREE
CPTREE
;
struct
EWIRE
///< Eagle wire
{
double
x1
;
double
y1
;
double
x2
;
double
y2
;
double
width
;
int
layer
;
};
struct
EWIRE
;
struct
EROT
;
struct
EATTR
;
struct
ECIRCLE
;
/**
...
...
@@ -104,11 +99,11 @@ public:
EAGLE_PLUGIN
();
~
EAGLE_PLUGIN
();
private
:
MODULE_MAP
m_modules
;
///< is a factory by use of MODULE copy constructor,
///< lookup is based on libname.packagename
MODULE_MAP
m_templates
;
///< is part of a MODULE factory that operates
///< using copy construction.
///< lookup key is libname.packagename
PROPERTIES
*
m_props
;
///< passed via Save() or Load(), no ownership, may be NULL.
...
...
@@ -120,10 +115,10 @@ private:
void
init
(
PROPERTIES
*
aProperties
);
int
kicad
(
double
d
)
const
;
int
kicad_y
(
double
y
)
const
{
return
kicad
(
y
);
}
int
kicad_y
(
double
y
)
const
{
return
-
kicad
(
y
);
}
int
kicad_x
(
double
x
)
const
{
return
kicad
(
x
);
}
int
kicad_layer
(
int
aLayer
)
const
;
static
int
kicad_layer
(
int
aLayer
)
;
double
eagle
(
BIU
d
)
const
{
return
mm_per_biu
*
d
;
}
double
eagle_x
(
BIU
x
)
const
{
return
eagle
(
x
);
}
...
...
@@ -202,16 +197,32 @@ private:
void
loadAllSections
(
CPTREE
&
aEagleBoard
,
const
std
::
string
&
aXpath
,
bool
aAppendToMe
);
void
loadPlain
(
CPTREE
&
aPlain
,
const
std
::
string
&
aXpath
);
void
loadNetsAndTracks
(
CPTREE
&
aSignals
,
const
std
::
string
&
aXpath
);
void
loadModules
(
CPTREE
&
aLibs
,
const
std
::
string
&
aXpath
);
void
loadLibraries
(
CPTREE
&
aLibs
,
const
std
::
string
&
aXpath
);
void
loadElements
(
CPTREE
&
aElements
,
const
std
::
string
&
aXpath
);
/**
* Function wire
* Function
e
wire
* converts a <wire>'s xml attributes to binary without additional conversion.
* @return EWIRE - an Eagle <wire> object in binary.
* @param aResult is an EWIRE to fill in with the <wire> data converted to binary.
*/
EWIRE
ewire
(
CPTREE
&
aWire
)
const
;
ECIRCLE
ecircle
(
CPTREE
&
aCircle
)
const
;
EROT
erot
(
const
std
::
string
&
aRot
)
const
;
/**
* Function eattr
* parses an Eagle "attribute" element. Note that an attribute element
* is different than an XML element attribute. The attribute element is a
* full XML node in and of itself, and has attributes of its own. Blame Eagle.
*/
E
WIRE
wire
(
CPTREE
aWir
e
)
const
;
E
ATTR
eattr
(
CPTREE
&
aAttribut
e
)
const
;
/**
* Function fmtDEG
...
...
pcbnew/edgemod.cpp
View file @
aac10106
...
...
@@ -310,7 +310,7 @@ static void Abort_Move_ModuleOutline( EDA_DRAW_PANEL* Panel, wxDC* DC )
EDGE_MODULE
*
FOOTPRINT_EDIT_FRAME
::
Begin_Edge_Module
(
EDGE_MODULE
*
aEdge
,
wxDC
*
DC
,
int
type_edge
)
STROKE_T
type_edge
)
{
MODULE
*
module
=
GetBoard
()
->
m_Modules
;
int
angle
=
0
;
...
...
pcbnew/editedge.cpp
View file @
aac10106
...
...
@@ -231,7 +231,7 @@ static void Abort_EditEdge( EDA_DRAW_PANEL* Panel, wxDC* DC )
/* Initialize the drawing of a segment of type other than trace.
*/
DRAWSEGMENT
*
PCB_EDIT_FRAME
::
Begin_DrawSegment
(
DRAWSEGMENT
*
Segment
,
int
shape
,
wxDC
*
DC
)
DRAWSEGMENT
*
PCB_EDIT_FRAME
::
Begin_DrawSegment
(
DRAWSEGMENT
*
Segment
,
STROKE_T
shape
,
wxDC
*
DC
)
{
int
s_large
;
DRAWSEGMENT
*
DrawItem
;
...
...
pcbnew/legacy_plugin.cpp
View file @
aac10106
...
...
@@ -1238,7 +1238,7 @@ void LEGACY_PLUGIN::loadPAD( MODULE* aModule )
pos
.
y
=
biuParse
(
data
);
pad
->
SetPos0
(
pos
);
pad
->
SetPosition
(
pos
);
// pad->SetPosition( pos ); set at function return
}
else
if
(
TESTLINE
(
"Le"
)
)
...
...
@@ -1291,7 +1291,10 @@ void LEGACY_PLUGIN::loadPAD( MODULE* aModule )
else
if
(
TESTLINE
(
"$EndPAD"
)
)
{
wxPoint
padpos
=
pad
->
GetPosition
();
// pad's "Position" is not relative to the module's,
// whereas Pos0 is relative to the module's but is the unrotated coordinate.
wxPoint
padpos
=
pad
->
GetPos0
();
RotatePoint
(
&
padpos
,
aModule
->
GetOrientation
()
);
...
...
@@ -1634,7 +1637,7 @@ void LEGACY_PLUGIN::loadPCB_LINE()
if
(
width
<
0
)
width
=
0
;
dseg
->
SetShape
(
shape
);
dseg
->
SetShape
(
STROKE_T
(
shape
)
);
dseg
->
SetWidth
(
width
);
dseg
->
SetStart
(
wxPoint
(
start_x
,
start_y
)
);
dseg
->
SetEnd
(
wxPoint
(
end_x
,
end_y
)
);
...
...
pcbnew/modedit_onclick.cpp
View file @
aac10106
...
...
@@ -81,7 +81,7 @@ void FOOTPRINT_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
case
ID_MODEDIT_LINE_TOOL
:
if
(
!
item
||
item
->
GetFlags
()
==
0
)
{
int
shape
=
S_SEGMENT
;
STROKE_T
shape
=
S_SEGMENT
;
if
(
GetToolId
()
==
ID_MODEDIT_CIRCLE_TOOL
)
shape
=
S_CIRCLE
;
...
...
@@ -107,7 +107,7 @@ void FOOTPRINT_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
}
else
if
(
(
(
EDGE_MODULE
*
)
item
)
->
GetShape
()
==
S_SEGMENT
)
{
SetCurItem
(
Begin_Edge_Module
(
(
EDGE_MODULE
*
)
item
,
DC
,
0
)
);
SetCurItem
(
Begin_Edge_Module
(
(
EDGE_MODULE
*
)
item
,
DC
,
S_SEGMENT
)
);
}
else
{
...
...
pcbnew/module_editor_frame.h
View file @
aac10106
...
...
@@ -319,7 +319,7 @@ public:
* @param type_edge = S_SEGMENT,S_ARC ..
* @return the new created edge.
*/
EDGE_MODULE
*
Begin_Edge_Module
(
EDGE_MODULE
*
Edge
,
wxDC
*
DC
,
int
type_edge
);
EDGE_MODULE
*
Begin_Edge_Module
(
EDGE_MODULE
*
Edge
,
wxDC
*
DC
,
STROKE_T
type_edge
);
/**
* Function End_Edge_Module
...
...
pcbnew/onleftclick.cpp
View file @
aac10106
...
...
@@ -230,7 +230,7 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
case
ID_PCB_ARC_BUTT
:
case
ID_PCB_ADD_LINE_BUTT
:
{
int
shape
=
S_SEGMENT
;
STROKE_T
shape
=
S_SEGMENT
;
if
(
GetToolId
()
==
ID_PCB_CIRCLE_BUTT
)
shape
=
S_CIRCLE
;
...
...
@@ -258,8 +258,8 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
SetCurItem
(
DrawStruct
);
m_canvas
->
SetAutoPanRequest
(
true
);
}
break
;
}
break
;
case
ID_TRACK_BUTT
:
if
(
getActiveLayer
()
>
LAST_COPPER_LAYER
)
...
...
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