46 unsigned aNetlistOptions,
REPORTER* aReporter )
54 if( !
ReadyToNetlist(
_(
"Exporting netlist requires a fully annotated schematic." ) ) )
58 bool executeCommandLine =
false;
60 wxString fileName = aFullFileName;
86 wxFileName tmpFile = fileName;
88 fileName = tmpFile.GetFullPath();
91 executeCommandLine =
true;
105 prj_dir = prj_dir.SubString( 0, prj_dir.Len() - 2 );
112 fileName, aFullFileName,
117 wxArrayString output, errors;
118 int diag = wxExecute( commandLine, output, errors,
m_exec_flags );
122 msg <<
_(
"Run command:" ) << wxT(
"\n" ) << commandLine << wxT(
"\n\n" );
128 _(
"Command error. Return code %d" ), diag ),
133 if( output.GetCount() )
136 msg << wxT(
"\n" ) <<
_(
"Info messages:" ) << wxT(
"\n" );
139 for(
unsigned ii = 0; ii < output.GetCount(); ii++ )
143 if( errors.GetCount() )
146 msg << wxT(
"\n") <<
_(
"Error messages:" ) << wxT(
"\n" );
149 for(
unsigned ii = 0; ii < errors.GetCount(); ii++ )
183 if( !
IsOK(
this,
_(
"Error: duplicate sheet names. Continue?" ) ) )
bool ReadyToNetlist(const wxString &aAnnotateMessage)
Checks if we are ready to write a netlist file for the current schematic.
wxString m_netListerCommand
Command line to call a custom net list generator.
int CheckAnnotate(ANNOTATION_ERROR_HANDLER aErrorHandler, bool aOneSheetOnly=false)
Check for annotation errors.
void DefaultExecFlags()
Reset the execution flags to defaults for external netlist and bom generators.
int ProcessExecute(const wxString &aCommandLine, int aFlags, wxProcess *callback)
Run a command in a child process.
virtual bool WriteNetlist(const wxString &aOutFileName, unsigned aNetlistOptions)
Function WriteNetlist writes to specified output file.
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
bool WriteNetListFile(int aFormat, const wxString &aFullFileName, unsigned aNetlistOptions, REPORTER *aReporter=NULL)
Create a netlist file.
This file is part of the common library TODO brief description.
void RecalculateConnections(SCH_CLEANUP_FLAGS aCleanupFlags)
Generates the connection data for the entire schematic hierarchy.
Holds all the data relating to one schematic A schematic may consist of one or more sheets (and one r...
This file is part of the common library.
virtual REPORTER & ReportTail(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Places the report at the end of the list, for objects that support report ordering.
virtual void ExpressMail(FRAME_T aDestination, MAIL_T aCommand, std::string &aPayload, wxWindow *aSource=nullptr)
Send aPayload to aDestination from aSource.
A pure virtual class used to derive REPORTER objects from.
void Format(OUTPUTFORMATTER *aOutputFormatter, int aCtl)
Output this s-expression netlist into aOutputFormatter.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
virtual const wxString GetProjectPath() const
Return the full path of the project.
static wxString MakeCommandLine(const wxString &aFormatString, const wxString &aNetlistFile, const wxString &aFinalFile, const wxString &aProjectDirectory)
Function MakeCommandLine builds up a string that describes a command line for executing a child proce...
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
Generate the KiCad netlist format supported by Pcbnew.
SCHEMATIC & Schematic() const
NETLIST_EXPORTER_BASE is a abstract class used for the netlist exporters that eeschema supports.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
virtual REPORTER & ReportHead(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Places the report at the beginning of the list for objects that support ordering.
NETLIST_EXPORTER_CADSTAR generates a netlist compatible with CADSTAR.
SCH_SHEET_LIST GetSheets() const override
Builds and returns an updated schematic hierarchy TODO: can this be cached?
NETLIST_EXPORTER_ORCADPCB2 generates a netlist compatible with OrCAD.
int ModalAnnotate(const wxString &aMessage)
Run a modal version of the Annotate dialog for a specific purpose.
Generate a PSPICE compatible netlist.
void AnnotatePowerSymbols()
Silently annotate the not yet annotated power symbols of the entire hierarchy of the sheet path list.
#define GENERIC_INTERMEDIATE_NETLIST_EXT
int m_exec_flags
Flags of the wxExecute() function to call a custom net list generator.
Generate a generic XML based netlist file.
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
A helper to define a symbol's reference designator in a schematic.
void sendNetlistToCvpcb()
Send the kicad netlist over to CVPCB.
int TestDuplicateSheetNames(bool aCreateMarker)
Inside a given sheet, one cannot have sheets with duplicate names (file names can be duplicated).