48 unsigned aNetlistOptions,
REPORTER* aReporter )
50 if( !
ReadyToNetlist(
_(
"Exporting netlist requires a fully annotated schematic." ) ) )
56 bool executeCommandLine =
false;
58 wxString fileName = aFullFileName;
100 executeCommandLine =
true;
105 wxFileName tmpFile = fileName;
107 fileName = tmpFile.GetFullPath();
110 executeCommandLine =
true;
133 prj_dir = prj_dir.SubString( 0, prj_dir.Len() - 2 );
140 aFullFileName, prj_dir );
146 wxGetEnvMap( &env.env );
147 env.env.erase( wxS(
"PYTHONHOME" ) );
148 env.env.erase( wxS(
"PYTHONPATH" ) );
152 wxArrayString output, errors;
153 int diag = wxExecute( commandLine, output, errors,
m_exec_flags, &env );
160 msg.Printf(
_(
"Command error. Return code %d." ), diag );
169 if( output.GetCount() )
171 for(
unsigned ii = 0; ii < output.GetCount(); ii++ )
175 if( errors.GetCount() )
177 for(
unsigned ii = 0; ii < errors.GetCount(); ii++ )
183 int diag = wxExecute( commandLine,
m_exec_flags,
nullptr, &env );
198 *aUserCancelled =
false;
219 if(
erc.TestDuplicateSheetNames(
false ) > 0 )
221 if( !
IsOK(
this,
_(
"Error: duplicate sheet names. Continue?" ) ) )
224 *aUserCancelled =
true;
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
Runs the electrical rules checks and adds a SCH_MARKER for each violation.
virtual void ExpressMail(FRAME_T aDestination, MAIL_T aCommand, std::string &aPayload, wxWindow *aSource=nullptr, bool aFromOtherThread=false)
Send aPayload to aDestination from aSource.
Generate a netlist compatible with Allegro.
An abstract class used for the netlist exporters that Eeschema supports.
bool WriteNetlist(const wxString &aOutFileName, unsigned aNetlistOptions, REPORTER &aReporter)
Write to specified output file.
static wxString MakeCommandLine(const wxString &aFormatString, const wxString &aNetlistFile, const wxString &aFinalFile, const wxString &aProjectDirectory)
Build up a string that describes a command line for executing a child process.
Generate a netlist compatible with CADSTAR.
Generate the KiCad netlist format supported by Pcbnew.
void Format(OUTPUTFORMATTER *aOutputFormatter, int aCtl)
Output this s-expression netlist into aOutputFormatter.
Generate a netlist compatible with OrCAD.
Generate a netlist compatible with PADS.
Generate a generic XML based netlist file.
A singleton reporter that reports to nowhere.
virtual const wxString GetProjectPath() const
Return the full path of the project.
A pure virtual class used to derive REPORTER objects from.
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.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Report a string with a given severity.
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.
Holds all the data relating to one schematic.
void DefaultExecFlags()
Reset the execution flags to defaults for external netlist and bom generators.
void RefreshConnectivity(bool aForce=false, const SCH_CONNECTIVITY::CHANGE_SET *aChanges=nullptr)
bool ReadyToNetlist(const wxString &aAnnotateMessage, bool *aUserCancelled=nullptr)
Check if we are ready to write a netlist file for the current schematic.
bool WriteNetListFile(int aFormat, const wxString &aFullFileName, unsigned aNetlistOptions, REPORTER *aReporter=nullptr)
Create a netlist file.
SCHEMATIC & Schematic() const
int m_exec_flags
Flags of the wxExecute() function to call a custom net list generator.
void sendNetlistToCvpcb()
Send the KiCad netlist over to CVPCB.
int CheckAnnotate(ANNOTATION_ERROR_HANDLER aErrorHandler, ANNOTATE_SCOPE_T aAnnotateScope, bool aRecursive)
Check for annotation errors.
int ModalAnnotate(const wxString &aMessage)
Run a modal version of the annotate dialog for a specific purpose.
wxString m_netListerCommand
Command line to call a custom net list generator.
A helper to define a symbol's reference designator in a schematic.
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
This file is part of the common library.
#define GENERIC_INTERMEDIATE_NETLIST_EXT
@ ANNOTATE_ALL
Annotate the full schematic.
KIWAY Kiway(KFCTL_STANDALONE)