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
b3f13be3
Commit
b3f13be3
authored
Aug 11, 2010
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
https://lists.launchpad.net/kicad-developers/msg05157.html
parent
fa863b08
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
17 deletions
+65
-17
netform.cpp
eeschema/netform.cpp
+57
-15
netlist_control.cpp
eeschema/netlist_control.cpp
+8
-2
No files found.
eeschema/netform.cpp
View file @
b3f13be3
...
...
@@ -230,7 +230,6 @@ class EXPORT_HELP
*/
XNODE
*
makeGenericLibraries
();
public
:
/**
...
...
@@ -293,9 +292,56 @@ public:
*/
bool
WriteNetListPspice
(
WinEDA_SchematicFrame
*
frame
,
FILE
*
f
,
bool
use_netnames
);
/**
* Function MakeCommandLine
* builds up a string that describes a command line for
* executing a child process. The input and output file names
* along with any options to the executable are all possibly
* in the returned string.
*
* @param aFormatString holds:
* <ul>
* <li>the name of the external program
* <li>any options needed by that program
* <li>formatting sequences, see below.
* </ul>
*
* @param aTempfile is the name of an input file to the
* external program.
* @param aFinalFile is the name of an output file that
* the user expects.
*
* <p> Supported formatting sequences and their meaning:
* <ul>
* <li> %B => base filename of selected output file, minus
* path and extension.
* <li> %I => complete filename and path of the temporary
* input file.
* <li> %O => complete filename and path of the user chosen
* output file.
* </ul>
*/
static
wxString
MakeCommandLine
(
const
wxString
&
aFormatString
,
const
wxString
&
aTempfile
,
const
wxString
&
aFinalFile
);
};
wxString
EXPORT_HELP
::
MakeCommandLine
(
const
wxString
&
aFormatString
,
const
wxString
&
aTempfile
,
const
wxString
&
aFinalFile
)
{
wxString
ret
=
aFormatString
;
wxFileName
in
=
aTempfile
;
wxFileName
out
=
aFinalFile
;
ret
.
Replace
(
wxT
(
"%B"
),
out
.
GetName
().
GetData
(),
true
);
ret
.
Replace
(
wxT
(
"%I"
),
in
.
GetFullName
().
GetData
(),
true
);
ret
.
Replace
(
wxT
(
"%O"
),
out
.
GetFullName
().
GetData
(),
true
);
return
ret
;
}
/**
* Function WriteNetListFile
* creates the netlist file. Netlist info must be existing
...
...
@@ -356,22 +402,18 @@ bool WinEDA_SchematicFrame::WriteNetListFile( int aFormat, const wxString& aFull
if
(
!
ret
)
break
;
//
Call the external module (plug in )
//
If user provided no plugin command line, return now.
if
(
g_NetListerCommandLine
.
IsEmpty
()
)
break
;
wxString
commandLine
;
if
(
wxIsAbsolutePath
(
g_NetListerCommandLine
)
)
commandLine
=
g_NetListerCommandLine
;
else
commandLine
=
FindKicadFile
(
g_NetListerCommandLine
);
// this is the input file to the plugin
commandLine
+=
wxT
(
" "
)
+
tmpFile
.
GetFullPath
();
// this is the output file to the plugin
commandLine
+=
wxT
(
" "
)
+
aFullFileName
;
// build full command line from user's format string, e.g.:
// "xsltproc -o %O /usr/local/lib/kicad/plugins/netlist_form_pads-pcb.xsl %I"
// becomes, after the user selects /tmp/s1.net as the output file from the file dialog:
// "xsltproc -o /tmp/s1.net /usr/local/lib/kicad/plugins/netlist_form_pads-pcb.xsl /tmp/s1.tmp"
wxString
commandLine
=
EXPORT_HELP
::
MakeCommandLine
(
g_NetListerCommandLine
,
tmpFile
.
GetFullPath
(),
aFullFileName
);
ProcessExecute
(
commandLine
,
wxEXEC_SYNC
);
...
...
@@ -1614,7 +1656,7 @@ bool EXPORT_HELP::writeGENERICListOfNets( FILE* f, NETLIST_OBJECT_LIST& aObjects
/* Generate CADSTAR net list. */
wxString
StartLine
(
wxT
(
"."
)
);
static
wxString
StartLine
(
wxT
(
"."
)
);
void
EXPORT_HELP
::
WriteNetListCADSTAR
(
WinEDA_SchematicFrame
*
frame
,
FILE
*
f
)
...
...
eeschema/netlist_control.cpp
View file @
b3f13be3
...
...
@@ -445,6 +445,7 @@ void WinEDA_NetlistFrame::GenNetlist( wxCommandEvent& event )
wxFileName
fn
;
wxString
FileWildcard
,
FileExt
;
wxString
msg
,
Command
;
wxString
title
=
_
(
"Save Netlist File"
);
NetlistUpdateOpt
();
...
...
@@ -466,15 +467,20 @@ void WinEDA_NetlistFrame::GenNetlist( wxCommandEvent& event )
FileWildcard
=
_
(
"CadStar netlist file (.frp)|*.frp"
);
break
;
default
:
case
NET_TYPE_PCBNEW
:
FileExt
=
NetlistFileExtension
;
FileWildcard
=
NetlistFileWildcard
;
break
;
default
:
// custom
FileExt
=
wxT
(
"*"
);
FileWildcard
=
AllFilesWildcard
;
title
=
_
(
"Generic Export"
);
}
fn
.
SetExt
(
FileExt
);
wxFileDialog
dlg
(
this
,
_
(
"Save Netlist Files"
)
,
fn
.
GetPath
(),
wxFileDialog
dlg
(
this
,
title
,
fn
.
GetPath
(),
fn
.
GetFullName
(),
FileWildcard
,
wxFD_SAVE
);
...
...
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