26#include <wx/filename.h>
43 wxCHECK( aBoard,
false );
54 std::map<std::string, UTF8> props;
56 props[
"sigfig"] = wxString::Format(
"%d", aJob.
m_precision );
81 props[
"netnames"] =
"anonymize";
84 props[
"refdes"] =
"omit";
91 bomRev = bomSettings.
bomRev;
93 if( bomRev.IsEmpty() )
97 if( !bomRev.IsEmpty() )
98 props[
"bomrev"] = bomRev;
106 wxFileName xmlName = outPath;
110 tempFile = wxFileName( temporary.
Path(), xmlName.GetFullName() ).GetFullPath();
112 else if( temporary.
MakeFile( wxS(
"pcbnew_ipc" ) ) )
114 tempFile = temporary.
Path();
117 if( tempFile.IsEmpty() )
130 plugin.
SaveBoard( tempFile, *aBoard, &props );
136 aReporter->
Report( wxString::Format(
_(
"Error generating IPC-2581 file '%s'.\n%s" ),
153 aReporter->
Report( wxString::Format(
_(
"Cannot write IPC-2581 archive '%s'.\n%s" ),
165 if( !wxRenameFile( tempFile, outPath ) )
169 aReporter->
Report( wxString::Format(
_(
"Error generating IPC-2581 file '%s'.\n"
170 "Failed to rename temporary file '%s'." ),
Information pertinent to a Pcbnew printed circuit board.
PROJECT * GetProject() const
virtual void SetReporter(REPORTER *aReporter)
Set an optional reporter for warnings/errors.
virtual void SetProgressReporter(PROGRESS_REPORTER *aReporter)
Set an optional progress reporter.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
virtual const wxString What() const
A composite of Problem() and Where()
std::optional< wxString > m_sections
Section key that replaces the optional sections of the data set Unset lets the data set select them a...
std::vector< wxString > m_variantNames
bool SupportsDataSet(DATA_SET aDataSet) const override
IPC2581_VERSION m_version
void AddOutput(wxString aOutputPath)
wxString GetFullOutputPath(PROJECT *aProject) const
Returns the full output path for the job, taking into account the configured output path,...
static bool EnsurePathExists(const wxString &aPath, bool aPathToFile=false)
Attempts to create a given path if it does not exist.
void SaveBoard(const wxString &aFileName, BOARD &aBoard, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Write aBoard to a storage file in a format that this PCB_IO implementation knows about or it can be u...
A progress reporter interface for use in multi-threaded environments.
struct IP2581_BOM m_IP2581Bom
Layer pair list for the board.
virtual PROJECT_FILE & GetProjectFile() const
A pure virtual class used to derive REPORTER objects from.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Report a string with a given severity.
A temporary file or directory that is removed when the object goes out of scope.
bool MakeFile(const wxString &aPrefix)
Create an empty file with a unique name after aPrefix.
bool MakeDirectory(const wxString &aPrefix)
Create an empty directory with a unique name after aPrefix.
const wxString & Path() const
bool WriteDirectoryArchive(const wxString &aSourceDir, wxOutputStream &aOut, ARCHIVE_FORMAT aFormat, const wxString &aTopDir)
Write directory entries in sorted archive path order, using the archive root when aTopDir is empty.
static const std::string Ipc2581FileExtension
bool GenerateIpc2581File(JOB_EXPORT_PCB_IPC2581 &aJob, BOARD *aBoard, PROGRESS_REPORTER *aProgressReporter, REPORTER *aReporter)
Write the IPC-2581 file or archive of aJob and record it as a job output.
wxString ModeToken(MODE aMode)
Table 4 function mode token such as FABRICATION.
BOM Data choices for IPC2581 export.
wxString bomRev
Explicit BOM revision override set by user.
wxString schRevision
Auto-propagated schematic title block revision.
Definition of file extensions used in Kicad.