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
6e78a592
Commit
6e78a592
authored
May 24, 2012
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more amazing free eagle_plugin work
parent
afdf5258
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
324 additions
and
141 deletions
+324
-141
class_module.cpp
pcbnew/class_module.cpp
+5
-5
class_pad.h
pcbnew/class_pad.h
+3
-1
eagle_plugin.cpp
pcbnew/eagle_plugin.cpp
+289
-131
eagle_plugin.h
pcbnew/eagle_plugin.h
+24
-3
legacy_plugin.cpp
pcbnew/legacy_plugin.cpp
+3
-1
No files found.
pcbnew/class_module.cpp
View file @
6e78a592
...
@@ -84,8 +84,6 @@ MODULE::MODULE( BOARD* parent ) :
...
@@ -84,8 +84,6 @@ MODULE::MODULE( BOARD* parent ) :
MODULE
::
MODULE
(
const
MODULE
&
aModule
)
:
MODULE
::
MODULE
(
const
MODULE
&
aModule
)
:
BOARD_ITEM
(
aModule
)
BOARD_ITEM
(
aModule
)
{
{
BOARD_ITEM
*
newItem
;
m_Pos
=
aModule
.
m_Pos
;
m_Pos
=
aModule
.
m_Pos
;
m_LibRef
=
aModule
.
m_LibRef
;
m_LibRef
=
aModule
.
m_LibRef
;
m_Layer
=
aModule
.
m_Layer
;
m_Layer
=
aModule
.
m_Layer
;
...
@@ -116,7 +114,7 @@ MODULE::MODULE( const MODULE& aModule ) :
...
@@ -116,7 +114,7 @@ MODULE::MODULE( const MODULE& aModule ) :
m_Value
->
SetParent
(
this
);
m_Value
->
SetParent
(
this
);
// Copy auxiliary data: Pads
// Copy auxiliary data: Pads
m_Pads
.
DeleteAll
();
//
m_Pads.DeleteAll();
for
(
D_PAD
*
pad
=
aModule
.
m_Pads
;
pad
;
pad
=
pad
->
Next
()
)
for
(
D_PAD
*
pad
=
aModule
.
m_Pads
;
pad
;
pad
=
pad
->
Next
()
)
{
{
...
@@ -126,10 +124,12 @@ MODULE::MODULE( const MODULE& aModule ) :
...
@@ -126,10 +124,12 @@ MODULE::MODULE( const MODULE& aModule ) :
}
}
// Copy auxiliary data: Drawings
// Copy auxiliary data: Drawings
m_Drawings
.
DeleteAll
();
//
m_Drawings.DeleteAll();
for
(
BOARD_ITEM
*
item
=
aModule
.
m_Drawings
;
item
;
item
=
item
->
Next
()
)
for
(
BOARD_ITEM
*
item
=
aModule
.
m_Drawings
;
item
;
item
=
item
->
Next
()
)
{
{
BOARD_ITEM
*
newItem
;
switch
(
item
->
Type
()
)
switch
(
item
->
Type
()
)
{
{
case
PCB_MODULE_TEXT_T
:
case
PCB_MODULE_TEXT_T
:
...
@@ -146,7 +146,7 @@ MODULE::MODULE( const MODULE& aModule ) :
...
@@ -146,7 +146,7 @@ MODULE::MODULE( const MODULE& aModule ) :
}
}
// Copy auxiliary data: 3D_Drawings info
// Copy auxiliary data: 3D_Drawings info
m_3D_Drawings
.
DeleteAll
();
//
m_3D_Drawings.DeleteAll();
for
(
S3D_MASTER
*
item
=
aModule
.
m_3D_Drawings
;
item
;
item
=
item
->
Next
()
)
for
(
S3D_MASTER
*
item
=
aModule
.
m_3D_Drawings
;
item
;
item
=
item
->
Next
()
)
{
{
...
...
pcbnew/class_pad.h
View file @
6e78a592
...
@@ -100,6 +100,7 @@ public:
...
@@ -100,6 +100,7 @@ public:
D_PAD
(
MODULE
*
parent
);
D_PAD
(
MODULE
*
parent
);
// Do not create a copy constructor. The one generated by the compiler is adequate.
// Do not create a copy constructor. The one generated by the compiler is adequate.
// D_PAD( const D_PAD& o );
void
Copy
(
D_PAD
*
source
);
void
Copy
(
D_PAD
*
source
);
...
@@ -478,7 +479,8 @@ private:
...
@@ -478,7 +479,8 @@ private:
double
m_LocalSolderPasteMarginRatio
;
///< Local solder mask margin ratio value of pad size
double
m_LocalSolderPasteMarginRatio
;
///< Local solder mask margin ratio value of pad size
///< The final margin is the sum of these 2 values
///< The final margin is the sum of these 2 values
ZoneConnection
m_ZoneConnection
;
ZoneConnection
m_ZoneConnection
;
int
m_ThermalWidth
,
m_ThermalGap
;
int
m_ThermalWidth
;
int
m_ThermalGap
;
};
};
#endif // PAD_H_
#endif // PAD_H_
pcbnew/eagle_plugin.cpp
View file @
6e78a592
This diff is collapsed.
Click to expand it.
pcbnew/eagle_plugin.h
View file @
6e78a592
...
@@ -34,13 +34,30 @@
...
@@ -34,13 +34,30 @@
#include <boost/property_tree/ptree_fwd.hpp>
#include <boost/property_tree/ptree_fwd.hpp>
#include <boost/ptr_container/ptr_map.hpp>
#include <boost/ptr_container/ptr_map.hpp>
#include <
time.h
>
#include <
map
>
class
MODULE
;
class
MODULE
;
typedef
boost
::
ptr_map
<
std
::
string
,
MODULE
>
MODULE_MAP
;
typedef
boost
::
ptr_map
<
std
::
string
,
MODULE
>
MODULE_MAP
;
struct
ENET
{
int
netcode
;
std
::
string
netname
;
ENET
(
int
aNetCode
,
const
std
::
string
&
aNetName
)
:
netcode
(
aNetCode
),
netname
(
aNetName
)
{}
ENET
()
:
netcode
(
0
)
{}
};
typedef
std
::
map
<
std
::
string
,
ENET
>
NET_MAP
;
/*
/*
#include
#include
namespace boost {
namespace boost {
...
@@ -79,6 +96,9 @@ public:
...
@@ -79,6 +96,9 @@ public:
BOARD
*
Load
(
const
wxString
&
aFileName
,
BOARD
*
aAppendToMe
,
PROPERTIES
*
aProperties
=
NULL
);
BOARD
*
Load
(
const
wxString
&
aFileName
,
BOARD
*
aAppendToMe
,
PROPERTIES
*
aProperties
=
NULL
);
const
wxString
&
GetFileExtension
()
const
;
/*
void Save( const wxString& aFileName, BOARD* aBoard, PROPERTIES* aProperties = NULL );
void Save( const wxString& aFileName, BOARD* aBoard, PROPERTIES* aProperties = NULL );
wxArrayString FootprintEnumerate( const wxString& aLibraryPath, PROPERTIES* aProperties = NULL);
wxArrayString FootprintEnumerate( const wxString& aLibraryPath, PROPERTIES* aProperties = NULL);
...
@@ -94,8 +114,7 @@ public:
...
@@ -94,8 +114,7 @@ public:
void FootprintLibDelete( const wxString& aLibraryPath, PROPERTIES* aProperties = NULL );
void FootprintLibDelete( const wxString& aLibraryPath, PROPERTIES* aProperties = NULL );
bool IsFootprintLibWritable( const wxString& aLibraryPath );
bool IsFootprintLibWritable( const wxString& aLibraryPath );
*/
const
wxString
&
GetFileExtension
()
const
;
//-----</PUBLIC PLUGIN API>-------------------------------------------------
//-----</PUBLIC PLUGIN API>-------------------------------------------------
...
@@ -106,6 +125,8 @@ public:
...
@@ -106,6 +125,8 @@ public:
private
:
private
:
NET_MAP
m_pads_to_nets
;
MODULE_MAP
m_templates
;
///< is part of a MODULE factory that operates
MODULE_MAP
m_templates
;
///< is part of a MODULE factory that operates
///< using copy construction.
///< using copy construction.
///< lookup key is libname.packagename
///< lookup key is libname.packagename
...
...
pcbnew/legacy_plugin.cpp
View file @
6e78a592
...
@@ -1892,7 +1892,8 @@ void LEGACY_PLUGIN::loadTrackList( TRACK* aInsertBeforeMe, int aStructType )
...
@@ -1892,7 +1892,8 @@ void LEGACY_PLUGIN::loadTrackList( TRACK* aInsertBeforeMe, int aStructType )
{
{
// read two lines per loop iteration, each loop is one TRACK or VIA
// read two lines per loop iteration, each loop is one TRACK or VIA
// example first line:
// example first line:
// "Po 0 23994 28800 24400 28800 150 -1\r\n"
// e.g. "Po 0 23994 28800 24400 28800 150 -1" for a track
// e.g. "Po 3 21086 17586 21086 17586 180 -1" for a via (uses sames start and end)
const
char
*
data
;
const
char
*
data
;
char
*
line
=
m_reader
->
Line
();
char
*
line
=
m_reader
->
Line
();
...
@@ -1943,6 +1944,7 @@ void LEGACY_PLUGIN::loadTrackList( TRACK* aInsertBeforeMe, int aStructType )
...
@@ -1943,6 +1944,7 @@ void LEGACY_PLUGIN::loadTrackList( TRACK* aInsertBeforeMe, int aStructType )
int
layer
,
type
,
flags
,
net_code
;
int
layer
,
type
,
flags
,
net_code
;
// parse the 2nd line to determine the type of object
// parse the 2nd line to determine the type of object
// e.g. "De 15 1 7 0 0" for a via
sscanf
(
line
+
SZ
(
"De"
),
" %d %d %d %lX %X"
,
&
layer
,
&
type
,
&
net_code
,
&
timeStamp
,
&
flags
);
sscanf
(
line
+
SZ
(
"De"
),
" %d %d %d %lX %X"
,
&
layer
,
&
type
,
&
net_code
,
&
timeStamp
,
&
flags
);
if
(
aStructType
==
PCB_TRACE_T
&&
type
==
1
)
if
(
aStructType
==
PCB_TRACE_T
&&
type
==
1
)
...
...
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