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
c8584436
Commit
c8584436
authored
Feb 07, 2008
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
specctra import work
parent
cf460637
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
112 additions
and
11 deletions
+112
-11
initpcb.cpp
pcbnew/initpcb.cpp
+1
-1
ioascii.cpp
pcbnew/ioascii.cpp
+1
-0
specctra.h
pcbnew/specctra.h
+12
-1
specctra_export.cpp
pcbnew/specctra_export.cpp
+2
-9
specctra_import.cpp
pcbnew/specctra_import.cpp
+96
-0
No files found.
pcbnew/initpcb.cpp
View file @
c8584436
...
@@ -119,7 +119,7 @@ bool WinEDA_BasePcbFrame::Clear_Pcb( bool query )
...
@@ -119,7 +119,7 @@ bool WinEDA_BasePcbFrame::Clear_Pcb( bool query )
if
(
query
&&
GetScreen
()
->
IsModify
()
)
if
(
query
&&
GetScreen
()
->
IsModify
()
)
{
{
if
(
m_Pcb
->
m_Drawings
||
m_Pcb
->
m_Modules
if
(
m_Pcb
->
m_Drawings
||
m_Pcb
->
m_Modules
||
m_Pcb
->
m_Track
||
m_Pcb
->
m_Zone
)
||
m_Pcb
->
m_Track
||
m_Pcb
->
m_Zone
)
{
{
if
(
!
IsOK
(
this
,
_
(
"Current Board will be lost ?"
)
)
)
if
(
!
IsOK
(
this
,
_
(
"Current Board will be lost ?"
)
)
)
...
...
pcbnew/ioascii.cpp
View file @
c8584436
...
@@ -844,6 +844,7 @@ int WinEDA_PcbFrame::ReadPcbFile( wxDC* DC, FILE* File, bool Append )
...
@@ -844,6 +844,7 @@ int WinEDA_PcbFrame::ReadPcbFile( wxDC* DC, FILE* File, bool Append )
ZONE_CONTAINER
*
zone_descr
=
new
ZONE_CONTAINER
(
m_Pcb
);
ZONE_CONTAINER
*
zone_descr
=
new
ZONE_CONTAINER
(
m_Pcb
);
zone_descr
->
ReadDescr
(
File
,
&
LineNum
);
zone_descr
->
ReadDescr
(
File
,
&
LineNum
);
m_Pcb
->
Add
(
zone_descr
);
m_Pcb
->
Add
(
zone_descr
);
continue
;
}
}
if
(
strnicmp
(
Line
,
"$MODULE"
,
7
)
==
0
)
if
(
strnicmp
(
Line
,
"$MODULE"
,
7
)
==
0
)
...
...
pcbnew/specctra.h
View file @
c8584436
...
@@ -1782,6 +1782,7 @@ public:
...
@@ -1782,6 +1782,7 @@ public:
i
->
Format
(
out
,
nestLevel
);
i
->
Format
(
out
,
nestLevel
);
}
}
};
};
typedef
boost
::
ptr_vector
<
COMPONENT
>
COMPONENTS
;
class
PLACEMENT
:
public
ELEM
class
PLACEMENT
:
public
ELEM
...
@@ -1792,7 +1793,6 @@ class PLACEMENT : public ELEM
...
@@ -1792,7 +1793,6 @@ class PLACEMENT : public ELEM
DSN_T
flip_style
;
DSN_T
flip_style
;
typedef
boost
::
ptr_vector
<
COMPONENT
>
COMPONENTS
;
COMPONENTS
components
;
COMPONENTS
components
;
public
:
public
:
...
@@ -3814,6 +3814,17 @@ public:
...
@@ -3814,6 +3814,17 @@ public:
void
FromBOARD
(
BOARD
*
aBoard
);
void
FromBOARD
(
BOARD
*
aBoard
);
/**
* Function FromSESSION
* adds the entire SESSION info to a BOARD but does not write it out. The
* the BOARD given to this function will have all its tracks and via's replaced,
* and all its components are subject to being moved.
*
* @param aBoard The BOARD to merge the SESSION information into.
*/
void
FromSESSION
(
BOARD
*
aBoard
)
throw
(
IOError
);
/**
/**
* Function ExportSESSION
* Function ExportSESSION
* writes the internal SESSION instance out as a SPECTRA DSN format file.
* writes the internal SESSION instance out as a SPECTRA DSN format file.
...
...
pcbnew/specctra_export.cpp
View file @
c8584436
...
@@ -63,13 +63,6 @@ void WinEDA_PcbFrame::ExportToSpecctra( wxCommandEvent& event )
...
@@ -63,13 +63,6 @@ void WinEDA_PcbFrame::ExportToSpecctra( wxCommandEvent& event )
if
(
fullFileName
==
wxEmptyString
)
if
(
fullFileName
==
wxEmptyString
)
return
;
return
;
// prepare the EQUIPOTs
if
(
!
(
m_Pcb
->
m_Status_Pcb
&
NET_CODES_OK
)
)
{
//m_Pcb->m_Status_Pcb &= ~(LISTE_PAD_OK);
recalcule_pad_net_code
();
}
SPECCTRA_DB
db
;
SPECCTRA_DB
db
;
bool
ok
=
true
;
bool
ok
=
true
;
wxString
errorText
;
wxString
errorText
;
...
@@ -172,8 +165,8 @@ static POINT mapPt( const wxPoint& pt )
...
@@ -172,8 +165,8 @@ static POINT mapPt( const wxPoint& pt )
/**
/**
* Function findPOINT
* Function findPOINT
* searches the list of POINT_PAIRS for a matching end to the given POINT.
* searches the list of POINT_PAIRS for a matching end to the given POINT.
* @return int - 0 if no match, or
+
one based index of a POINT_PAIR with a matching ".start",
* @return int - 0 if no match, or
positive
one based index of a POINT_PAIR with a matching ".start",
* or a
-
one based index of a POINT_PAIR with a matching ".end".
* or a
negated
one based index of a POINT_PAIR with a matching ".end".
*/
*/
static
int
findPOINT
(
const
POINT
&
pt
,
const
POINT_PAIR
source
[],
int
count
)
static
int
findPOINT
(
const
POINT
&
pt
,
const
POINT_PAIR
source
[],
int
count
)
{
{
...
...
pcbnew/specctra_import.cpp
View file @
c8584436
...
@@ -34,17 +34,113 @@
...
@@ -34,17 +34,113 @@
#include "specctra.h"
#include "specctra.h"
#include "common.h" // IsOK() & EDA_FileSelector()
using
namespace
DSN
;
using
namespace
DSN
;
void
WinEDA_PcbFrame
::
ImportSpecctraDesign
(
wxCommandEvent
&
event
)
void
WinEDA_PcbFrame
::
ImportSpecctraDesign
(
wxCommandEvent
&
event
)
{
{
if
(
!
Clear_Pcb
(
true
)
)
return
;
}
}
void
WinEDA_PcbFrame
::
ImportSpecctraSession
(
wxCommandEvent
&
event
)
void
WinEDA_PcbFrame
::
ImportSpecctraSession
(
wxCommandEvent
&
event
)
{
{
if
(
GetScreen
()
->
IsModify
()
)
{
if
(
!
IsOK
(
this
,
_
(
"Board Modified: Continue ?"
)
)
)
return
;
}
wxString
sessionExt
(
wxT
(
".ses"
)
);
wxString
fileName
=
GetScreen
()
->
m_FileName
;
wxString
mask
=
wxT
(
"*"
)
+
sessionExt
;
ChangeFileNameExt
(
fileName
,
sessionExt
);
fileName
=
EDA_FileSelector
(
_
(
"Merge Specctra Session file:"
),
wxEmptyString
,
fileName
,
sessionExt
,
mask
,
this
,
wxFD_OPEN
,
FALSE
);
if
(
fileName
==
wxEmptyString
)
return
;
SPECCTRA_DB
db
;
try
{
db
.
LoadSESSION
(
fileName
);
db
.
FromSESSION
(
m_Pcb
);
}
catch
(
IOError
ioe
)
{
DisplayError
(
this
,
ioe
.
errorText
);
return
;
}
m_SelTrackWidthBox_Changed
=
TRUE
;
m_SelViaSizeBox_Changed
=
TRUE
;
GetScreen
()
->
SetModify
();
m_Pcb
->
m_Status_Pcb
=
0
;
Affiche_Message
(
wxString
(
_
(
"Session file imported and merged OK."
))
);
DrawPanel
->
Refresh
(
TRUE
);
}
namespace
DSN
{
// no UI code in this function, throw exception to report problems to the
// UI handler: void WinEDA_PcbFrame::ImportSpecctraSession( wxCommandEvent& event )
void
SPECCTRA_DB
::
FromSESSION
(
BOARD
*
aBoard
)
throw
(
IOError
)
{
wxASSERT
(
session
);
// delete all the old tracks and vias
aBoard
->
m_Track
->
DeleteStructList
();
aBoard
->
m_Track
=
NULL
;
aBoard
->
m_NbSegmTrack
=
0
;
aBoard
->
DeleteMARKERs
();
if
(
!
session
->
placement
)
ThrowIOError
(
_
(
"Session file is missing the
\"
placement
\"
section"
)
);
if
(
!
session
->
route
)
ThrowIOError
(
_
(
"Session file is missing the
\"
routes
\"
section"
)
);
if
(
!
session
->
route
->
library
)
ThrowIOError
(
_
(
"Session file is missing the
\"
library_out
\"
section"
)
);
// Walk the PLACEMENT object's components list.
COMPONENTS
&
components
=
session
->
placement
->
components
;
for
(
COMPONENTS
::
iterator
i
=
components
.
begin
();
i
!=
components
.
end
();
++
i
)
{
// reposition and re-orient each component and put on correct side of the board.
}
// Walk the NET_OUTs and create tracks and vias anew.
NET_OUTS
&
net_outs
=
session
->
route
->
net_outs
;
for
(
NET_OUTS
::
iterator
i
=
net_outs
.
begin
();
i
!=
net_outs
.
end
();
++
i
)
{
// create a track or via and position it.
}
}
}
}
// namespace DSN
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