81 if( aStepJob ==
nullptr )
85 wxPrintf(
_(
"Loading board\n" ) );
92 fn.SetName( fn.GetName() );
93 fn.SetExt( wxS(
"step" ) );
113 if( !stepExporter.
Export() )
126 if( aSvgJob ==
nullptr )
139 wxPrintf(
_(
"Loading board\n" ) );
146 wxPrintf(
_(
"Successfully created svg file" ) );
148 wxPrintf(
_(
"Error creating svg file" ) );
159 if( aDxfJob ==
nullptr )
163 wxPrintf(
_(
"Loading board\n" ) );
170 fn.SetName( fn.GetName() );
214 if( aPdfJob ==
nullptr )
218 wxPrintf(
_(
"Loading board\n" ) );
225 fn.SetName( fn.GetName() );
265 if( aGerberJob ==
nullptr )
269 wxPrintf(
_(
"Loading board\n" ) );
298 plotSequence.push_back( *seq );
304 if(
find( plotSequence.begin(), plotSequence.end(), *seqAll ) != plotSequence.end() )
307 plotSequence.push_back( *seqAll );
318 plotOpts = boardPlotOptions;
323 wxString fullname = fn.GetFullName();
329 brd, &plotOpts, layer, fn.GetFullPath(), wxEmptyString, wxEmptyString );
333 wxPrintf(
_(
"Plotted to '%s'.\n" ), fn.GetFullPath() );
339 wxFprintf( stderr,
_(
"Failed to plot to '%s'.\n" ), fn.GetFullPath() );
358 aPlotOpts.
SetFormat( PLOT_FORMAT::GERBER );
383 if( aGerberJob ==
nullptr )
387 wxPrintf(
_(
"Loading board\n" ) );
394 fn.SetName( fn.GetName() );
407 wxEmptyString, wxEmptyString );
417 wxFprintf( stderr,
_(
"Failed to plot to '%s'.\n" ), aGerberJob->
m_outputFile );
434 if( aDrillJob ==
nullptr )
438 wxPrintf(
_(
"Loading board\n" ) );
442 std::unique_ptr<GENDRILL_WRITER_BASE> drillWriter;
446 drillWriter = std::make_unique<EXCELLON_WRITER>( brd );
450 drillWriter = std::make_unique<GERBER_WRITER>( brd );
501 if( excellonWriter ==
nullptr )
523 if( gerberWriter ==
nullptr )
548 if( aPosJob ==
nullptr )
552 wxPrintf(
_(
"Loading board\n" ) );
559 fn.SetName( fn.GetName() );
574 FILE* file =
nullptr;
577 if( file ==
nullptr )
597 fputs( data.c_str(), file );
616 const wxString& aName );
623 if( upgradeJob ==
nullptr )
627 wxPrintf(
_(
"Loading footprint library\n" ) );
634 wxFprintf( stderr,
_(
"Output path must not conflict with existing path\n" ) );
648 wxFprintf( stderr,
_(
"Unable to load library\n" ) );
652 bool shouldSave = upgradeJob->
m_force;
664 wxPrintf(
_(
"Saving footprint library\n" ) );
677 wxFprintf( stderr,
_(
"Unable to save library\n" ) );
683 wxPrintf(
_(
"Footprint library was not updated\n" ) );
694 if( svgJob ==
nullptr )
698 wxPrintf(
_(
"Loading footprint library\n" ) );
709 wxFprintf( stderr,
_(
"Unable to load library\n" ) );
723 bool singleFpPlotted =
false;
724 for( FP_CACHE_FOOTPRINT_MAP::iterator it = footprintMap.begin(); it != footprintMap.end();
727 const FOOTPRINT* fp = it->second->GetFootprint();
737 singleFpPlotted =
true;
746 if( !svgJob->
m_footprint.IsEmpty() && !singleFpPlotted )
747 wxFprintf( stderr,
_(
"The given footprint could not be found to export." ) );
757 std::unique_ptr<BOARD> brd;
771 pad->SetLocalRatsnestVisible(
false );
772 pad->SetNetCode( 0 );
778 brd->Add( fp, ADD_MODE::INSERT,
true );
780 wxFileName outputFile;
785 wxPrintf(
_(
"Plotting footprint '%s' to '%s'\n" ),
799 wxFprintf( stderr,
_(
"Error creating svg file" ) );
809 wxFprintf( stderr, wxS(
"%s\n" ), aText );
811 wxPrintf( wxS(
"%s\n" ), aText );
const VECTOR2I & GetAuxOrigin()
Information pertinent to a Pcbnew printed circuit board.
LSET GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
const wxString & GetFileName() const
const PCB_PLOT_PARAMS & GetPlotOptions() const
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Helper to handle drill precision format in excellon files.
virtual bool EndPlot() override
void SetFlags(EDA_ITEM_FLAGS aMask)
virtual void SetParent(EDA_ITEM *aParent)
Create Excellon drill, drill map, and drill report files.
void SetFormat(bool aMetric, ZEROS_FMT aZerosFmt=DECIMAL_FORMAT, int aLeftDigits=0, int aRightDigits=0)
Initialize internal parameters to match the given format.
bool CreateDrillandMapFilesSet(const wxString &aPlotDirectory, bool aGenDrill, bool aGenMap, REPORTER *aReporter=nullptr)
Create the full set of Excellon drill file for the board.
void SetOptions(bool aMirror, bool aMinimalHeader, const VECTOR2I &aOffset, bool aMerge_PTH_NPTH)
Initialize internal parameters to match drill options.
void SetRouteModeForOvalHoles(bool aUseRouteModeForOvalHoles)
double m_BoardOutlinesChainingEpsilon
bool m_includeUnspecified
FP_CACHE_FOOTPRINT_MAP & GetFootprints()
void Save(FOOTPRINT *aFootprint=nullptr)
Save the footprint cache or a single footprint from it to disk.
void SetPath(const wxString &aPath)
void SetMapFileFormat(PLOT_FORMAT aMapFmt)
Initialize the format for the drill map file.
GERBER_JOBFILE_WRITER is a class used to create Gerber job file a Gerber job file stores info to make...
bool CreateJobFile(const wxString &aFullFilename)
Creates a Gerber job file.
void AddGbrFile(PCB_LAYER_ID aLayer, wxString &aFilename)
add a gerber file name and type in job file list
virtual bool EndPlot() override
Used to create Gerber drill files.
bool CreateDrillandMapFilesSet(const wxString &aPlotDirectory, bool aGenDrill, bool aGenMap, REPORTER *aReporter=nullptr)
Create the full set of Excellon drill file for the board filenames are computed from the board name,...
void SetOptions(const VECTOR2I &aOffset)
Initialize internal parameters to match drill options.
void SetFormat(int aRightDigits=6)
Initialize internal parameters to match the given format.
PCB_FILE_T
The set of file types that the IO_MGR knows about, and for which there has been a plugin written.
void Register(const std::string &aJobTypeName, std::function< int(JOB *job)> aHandler)
ZEROS_FORMAT m_zeroFormat
bool m_excellonOvalDrillRoute
DRILL_ORIGIN m_drillOrigin
bool m_excellonCombinePTHNPTH
bool m_excellonMinimalHeader
bool m_plotGraphicItemsUsingContours
bool m_plotBorderTitleBlocks
bool m_plotFootprintValues
bool m_useBoardPlotParams
bool m_layersIncludeOnAllSet
LSET m_layersIncludeOnAll
bool m_includeNetlistAttributes
bool m_disableApertureMacros
bool m_plotFootprintValues
bool m_plotBorderTitleBlocks
bool m_subtractSolderMaskFromSilk
bool m_plotBorderTitleBlocks
bool m_plotFootprintValues
bool m_useDrillPlaceFileOrigin
bool m_excludeFootprintsWithTh
double m_BoardOutlinesChainingEpsilon
bool m_includeUnspecified
wxString m_outputDirectory
wxString m_outputLibraryPath
An simple container class that lets us dispatch output jobs to kifaces.
const UTF8 & GetLibItemName() const
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
LSET is a set of PCB_LAYER_IDs.
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Return an LSEQ from the union of this LSET and a desired sequence.
LSEQ SeqStackupBottom2Top() const
Return the sequence that is typical for a bottom-to-top stack-up.
int JobExportStep(JOB *aJob)
int JobExportPos(JOB *aJob)
int JobExportFpSvg(JOB *aJob)
void populateGerberPlotOptionsFromJob(PCB_PLOT_PARAMS &aPlotOpts, JOB_EXPORT_PCB_GERBER *aJob)
int JobExportFpUpgrade(JOB *aJob)
int JobExportGerber(JOB *aJob)
int JobExportDxf(JOB *aJob)
int JobExportPdf(JOB *aJob)
int JobExportDrill(JOB *aJob)
int JobExportSvg(JOB *aJob)
int JobExportGerbers(JOB *aJob)
REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) override
Report a string with a given severity.
int doFpExportSvg(JOB_FP_EXPORT_SVG *aSvgJob, const FOOTPRINT *aFootprint)
Parameters and options when plotting/printing a board.
void SetDrillMarksType(DRILL_MARKS aVal)
void SetLayerSelection(LSET aSelection)
void SetPlotReference(bool aFlag)
void SetUseGerberX2format(bool aUse)
void SetDXFPlotPolygonMode(bool aFlag)
void SetPlotFrameRef(bool aFlag)
LSET GetLayerSelection() const
LSET GetPlotOnAllLayersSelection() const
void SetDisableGerberMacros(bool aDisable)
void SetBlackAndWhite(bool blackAndWhite)
void SetGerberPrecision(int aPrecision)
void SetSubtractMaskFromSilk(bool aSubtract)
void SetPlotValue(bool aFlag)
void SetDXFPlotUnits(DXF_UNITS aUnit)
void SetColorSettings(COLOR_SETTINGS *aSettings)
void SetIncludeGerberNetlistInfo(bool aUse)
void SetUseAuxOrigin(bool aAux)
void SetFormat(PLOT_FORMAT aFormat)
static bool Plot(BOARD *aBoard, const PCB_PLOT_SVG_OPTIONS &aSvgPlotOptions)
A PLUGIN derivation for saving and loading Pcbnew s-expression formatted files.
virtual bool EndPlot() override
Used to create Gerber drill files.
int CreatePlaceFile(wxString &aFullFilename, PCB_LAYER_ID aLayer, bool aIncludeBrdEdges)
Create an pnp gerber file.
The ASCII format of the kicad place file is:
std::string GenPositionData()
build a string filled with the position data
A pure virtual class used to derive REPORTER objects from.
COLOR_SETTINGS * GetColorSettings(const wxString &aName="user")
Retrieves a color settings object that applications can read colors from.
wxString GetDefaultPlotExtension(PLOT_FORMAT aFormat)
Returns the default plot extension for a format.
static DRILL_PRECISION precisionListForInches(2, 4)
static DRILL_PRECISION precisionListForMetric(3, 3)
static constexpr EDA_ANGLE & ANGLE_0
#define IS_NEW
New item, just created.
Classes used in drill files, map files and report files generation.
Classes used in drill files, map files and report files generation.
Classes used to generate a Gerber job file in JSON.
Classes used in place file generation.
const std::string FootprintPlaceFileExtension
const std::string GerberJobFileExtension
const std::string SVGFileExtension
const std::string CsvFileExtension
const std::string GerberFileExtension
PCB_LAYER_ID
A quick note on layer IDs:
static const int ERR_INVALID_OUTPUT_CONFLICT
static const int ERR_UNKNOWN
#define SEXPR_BOARD_FILE_VERSION
Current s-expression file format version. 2 was the last legacy format version.
boost::ptr_map< wxString, FP_CACHE_ITEM > FP_CACHE_FOOTPRINT_MAP
#define CTL_FOR_LIBRARY
Format output for a footprint library instead of clipboard or BOARD.
static DRILL_PRECISION precisionListForInches(2, 4)
static DRILL_PRECISION precisionListForMetric(3, 3)
FOOTPRINT * try_load_footprint(const wxFileName &aFileName, IO_MGR::PCB_FILE_T aFileType, const wxString &aName)
Try to load a footprint, returning nullptr if the file couldn't be accessed.
BOARD * CreateEmptyBoard()
Construct a default BOARD with a temporary (no filename) project.
BOARD * LoadBoard(wxString &aFileName)
const wxString GetGerberProtelExtension(int aLayer)
void BuildPlotFileName(wxFileName *aFilename, const wxString &aOutputDir, const wxString &aSuffix, const wxString &aExtension)
Complete a plot filename.
PLOTTER * StartPlotBoard(BOARD *aBoard, const PCB_PLOT_PARAMS *aPlotOpts, int aLayer, const wxString &aFullFileName, const wxString &aSheetName, const wxString &aSheetPath)
Open a new plotfile using the options (and especially the format) specified in the options and prepar...
void PlotBoardLayers(BOARD *aBoard, PLOTTER *aPlotter, const LSEQ &aLayerSequence, const PCB_PLOT_PARAMS &aPlotOptions)
Plot a sequence of board layer IDs.
void PlotInteractiveLayer(BOARD *aBoard, PLOTTER *aPlotter, const PCB_PLOT_PARAMS &aPlotOpt)
Plot interactive items (hypertext links, properties, etc.).
PLOT_FORMAT
The set of supported output plot formats.
Plotting engines similar to ps (PostScript, Gerber, svg)
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
VECTOR2< double > VECTOR2D
Definition of file extensions used in Kicad.