Make sure HPGL and DXF drill map generators honour origin setting.

ADDED: also adds origin setting to Footprint Position File dialog
and generators.

Fixes https://gitlab.com/kicad/code/kicad/issues/8669
This commit is contained in:
Jeff Young 2021-06-27 17:39:09 +01:00
parent 4aa8318dc2
commit 08fb05e522
15 changed files with 159 additions and 75 deletions

View File

@ -77,6 +77,9 @@ DIALOG_GEN_FOOTPRINT_POSITION_BASE::DIALOG_GEN_FOOTPRINT_POSITION_BASE( wxWindow
m_cbIncludeBoardEdge = new wxCheckBox( this, wxID_ANY, _("Include board edge layer"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerLower->Add( m_cbIncludeBoardEdge, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_useDrillPlaceOrigin = new wxCheckBox( this, wxID_ANY, _("Use drill/place file origin"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerLower->Add( m_useDrillPlaceOrigin, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_messagesPanel = new WX_HTML_REPORT_PANEL( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_messagesPanel->SetMinSize( wxSize( 350,300 ) );

View File

@ -629,6 +629,70 @@
<event name="OnUpdateUI">onUpdateUIincludeBoardEdge</event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Use drill/place file origin</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_useDrillPlaceOrigin</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND | wxALL</property>

View File

@ -51,6 +51,7 @@ class DIALOG_GEN_FOOTPRINT_POSITION_BASE : public DIALOG_SHIM
wxRadioBox* m_radioBoxFilesCount;
wxCheckBox* m_excludeTH;
wxCheckBox* m_cbIncludeBoardEdge;
wxCheckBox* m_useDrillPlaceOrigin;
WX_HTML_REPORT_PANEL* m_messagesPanel;
wxStaticLine* m_staticline;
wxStdDialogButtonSizer* m_sdbSizer;

View File

@ -340,9 +340,9 @@ void DIALOG_GENDRILL::UpdateDrillParams()
m_UseRouteModeForOvalHoles = m_radioBoxOvalHoleMode->GetSelection() == 0;
if( m_Choice_Drill_Offset->GetSelection() == 0 )
m_FileDrillOffset = wxPoint( 0, 0 );
m_DrillFileOffset = wxPoint( 0, 0 );
else
m_FileDrillOffset = m_board->GetDesignSettings().m_AuxOrigin;
m_DrillFileOffset = m_board->GetDesignSettings().m_AuxOrigin;
if( m_UnitDrillIsInch )
m_Precision = precisionListForInches;
@ -366,8 +366,12 @@ void DIALOG_GENDRILL::GenDrillAndMapFiles( bool aGenDrill, bool aGenMap )
const PLOT_FORMAT filefmt[6] = {
// Keep these format ids in the same order than m_Choice_Drill_Map choices
PLOT_FORMAT::HPGL, PLOT_FORMAT::POST, PLOT_FORMAT::GERBER, PLOT_FORMAT::DXF,
PLOT_FORMAT::SVG, PLOT_FORMAT::PDF
PLOT_FORMAT::HPGL,
PLOT_FORMAT::POST,
PLOT_FORMAT::GERBER,
PLOT_FORMAT::DXF,
PLOT_FORMAT::SVG,
PLOT_FORMAT::PDF
};
unsigned choice = (unsigned) m_Choice_Drill_Map->GetSelection();
@ -385,7 +389,7 @@ void DIALOG_GENDRILL::GenDrillAndMapFiles( bool aGenDrill, bool aGenMap )
{
wxString msg;
msg.Printf( _( "Could not write drill and/or map files to folder '%s'." ),
outputDir.GetPath() );
outputDir.GetPath() );
DisplayError( this, msg );
return;
}
@ -395,7 +399,7 @@ void DIALOG_GENDRILL::GenDrillAndMapFiles( bool aGenDrill, bool aGenMap )
EXCELLON_WRITER excellonWriter( m_board );
excellonWriter.SetFormat( !m_UnitDrillIsInch, (EXCELLON_WRITER::ZEROS_FMT) m_ZerosFormat,
m_Precision.m_Lhs, m_Precision.m_Rhs );
excellonWriter.SetOptions( m_Mirror, m_MinimalHeader, m_FileDrillOffset, m_Merge_PTH_NPTH );
excellonWriter.SetOptions( m_Mirror, m_MinimalHeader, m_DrillFileOffset, m_Merge_PTH_NPTH );
excellonWriter.SetRouteModeForOvalHoles( m_UseRouteModeForOvalHoles );
excellonWriter.SetMapFileFormat( filefmt[choice] );
@ -409,11 +413,11 @@ void DIALOG_GENDRILL::GenDrillAndMapFiles( bool aGenDrill, bool aGenMap )
// (SetFormat() accept 5 or 6, and any other value set the precision to 5)
// the integer part precision is always 4, and units always mm
gerberWriter.SetFormat( m_plotOpts.GetGerberPrecision() );
gerberWriter.SetOptions( m_FileDrillOffset );
gerberWriter.SetOptions( m_DrillFileOffset );
gerberWriter.SetMapFileFormat( filefmt[choice] );
gerberWriter.CreateDrillandMapFilesSet( outputDir.GetFullPath(),
aGenDrill, aGenMap, &reporter );
gerberWriter.CreateDrillandMapFilesSet( outputDir.GetFullPath(), aGenDrill, aGenMap,
&reporter );
}
}

View File

@ -99,7 +99,7 @@ public:
static bool m_Mirror;
static bool m_Merge_PTH_NPTH;
DRILL_PRECISION m_Precision; // Precision for drill files, in non decimal format
wxPoint m_FileDrillOffset; // Drill offset: 0,0 for absolute coordinates,
wxPoint m_DrillFileOffset; // Drill offset: 0,0 for absolute coordinates,
// or origin of the auxiliary axis
static bool m_UseRouteModeForOvalHoles; // True to use a G00 route command for oval holes
// False to use a G85 canned mode for oval holes

View File

@ -411,8 +411,13 @@ void DIALOG_PLOT::OnOutputDirectoryBrowseClicked( wxCommandEvent& event )
PLOT_FORMAT DIALOG_PLOT::getPlotFormat()
{
// plot format id's are ordered like displayed in m_plotFormatOpt
static const PLOT_FORMAT plotFmt[] = { PLOT_FORMAT::GERBER, PLOT_FORMAT::POST, PLOT_FORMAT::SVG,
PLOT_FORMAT::DXF, PLOT_FORMAT::HPGL, PLOT_FORMAT::PDF };
static const PLOT_FORMAT plotFmt[] = {
PLOT_FORMAT::GERBER,
PLOT_FORMAT::POST,
PLOT_FORMAT::SVG,
PLOT_FORMAT::DXF,
PLOT_FORMAT::HPGL,
PLOT_FORMAT::PDF };
return plotFmt[m_plotFormatOpt->GetSelection()];
}

View File

@ -74,7 +74,8 @@ enum SELECT_SIDE
};
PLACE_FILE_EXPORTER::PLACE_FILE_EXPORTER( BOARD* aBoard, bool aUnitsMM, bool aExcludeAllTH,
bool aTopSide, bool aBottomSide, bool aFormatCSV )
bool aTopSide, bool aBottomSide, bool aFormatCSV,
bool aUseAuxOrigin )
{
m_board = aBoard;
m_unitsMM = aUnitsMM;
@ -91,6 +92,11 @@ PLACE_FILE_EXPORTER::PLACE_FILE_EXPORTER( BOARD* aBoard, bool aUnitsMM, bool aEx
m_side = PCB_NO_SIDE;
m_formatCSV = aFormatCSV;
if( aUseAuxOrigin )
m_place_Offset = m_board->GetDesignSettings().m_AuxOrigin;
else
m_place_Offset = wxPoint( 0, 0 );
}
@ -105,8 +111,6 @@ std::string PLACE_FILE_EXPORTER::GenPositionData()
int lenValText = 8;
int lenPkgText = 16;
m_place_Offset = m_board->GetDesignSettings().m_AuxOrigin;
// Calculating the number of useful footprints (CMS attribute, not VIRTUAL)
m_fpCount = 0;

View File

@ -61,8 +61,8 @@ public:
* @param aBottomSide true to generate bottom side info
* @param aFormatCSV true to generate a csv format info, false to generate a ascii info
*/
PLACE_FILE_EXPORTER( BOARD* aBoard, bool aUnitsMM,
bool aForceSmdItems, bool aTopSide, bool aBottomSide, bool aFormatCSV );
PLACE_FILE_EXPORTER( BOARD* aBoard, bool aUnitsMM, bool aForceSmdItems, bool aTopSide,
bool aBottomSide, bool aFormatCSV, bool useAuxOrigin );
/**
* build a string filled with the position data

View File

@ -71,10 +71,10 @@ bool GENDRILL_WRITER_BASE::genDrillMapFile( const wxString& aFullFileName, PLOT_
// for the right holes set (PTH, NPTH, buried/blind vias ...)
double scale = 1.0;
wxPoint offset;
wxPoint offset = GetOffset();
PLOTTER* plotter = NULL;
PAGE_INFO dummy( PAGE_INFO::A4, false );
int bottom_limit = 0; // Y coord limit of page. 0 mean do not use
int bottom_limit = 0; // Y coord limit of page. 0 mean do not use
PCB_PLOT_PARAMS plot_opts; // starts plotting with default options
@ -94,7 +94,6 @@ bool GENDRILL_WRITER_BASE::genDrillMapFile( const wxString& aFullFileName, PLOT_
switch( aFormat )
{
case PLOT_FORMAT::GERBER:
offset = GetOffset();
plotter = new GERBER_PLOTTER();
plotter->SetViewport( offset, IU_PER_MILS / 10, scale, false );
plotter->SetGerberCoordinatesFormat( 5 ); // format x.5 unit = mm
@ -251,8 +250,8 @@ bool GENDRILL_WRITER_BASE::genDrillMapFile( const wxString& aFullFileName, PLOT_
// Plot title "Info"
wxString Text = wxT( "Drill Map:" );
plotter->Text( wxPoint( plotX, plotY ), COLOR4D::UNSPECIFIED, Text, 0,
wxSize( KiROUND( charSize * charScale ), KiROUND( charSize * charScale ) ),
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, TextWidth, false, false );
wxSize( KiROUND( charSize * charScale ), KiROUND( charSize * charScale ) ),
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, TextWidth, false, false );
// For some formats (PS, PDF SVG) we plot the drill size list on more than one column
// because the list must be contained inside the printed page
@ -288,7 +287,7 @@ bool GENDRILL_WRITER_BASE::genDrillMapFile( const wxString& aFullFileName, PLOT_
// List the diameter of each drill in mm and inches.
sprintf( line, "%3.3fmm / %2.4f\" ", diameter_in_mm( tool.m_Diameter ),
diameter_in_inches( tool.m_Diameter ) );
diameter_in_inches( tool.m_Diameter ) );
msg = FROM_UTF8( line );
@ -311,8 +310,8 @@ bool GENDRILL_WRITER_BASE::genDrillMapFile( const wxString& aFullFileName, PLOT_
msg += wxT( " (not plated)" );
plotter->Text( wxPoint( plotX, y ), COLOR4D::UNSPECIFIED, msg, 0,
wxSize( KiROUND( charSize * charScale ), KiROUND( charSize * charScale ) ),
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, TextWidth, false, false );
wxSize( KiROUND( charSize * charScale ), KiROUND( charSize * charScale ) ),
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, TextWidth, false, false );
intervalle = KiROUND( ( ( charSize * charScale ) + TextWidth ) * 1.2 );
@ -360,10 +359,9 @@ bool GENDRILL_WRITER_BASE::GenDrillReportFile( const wxString& aFullFileName )
for( LSEQ seq = cu.Seq(); seq; ++seq, ++conventional_layer_num )
{
out.Print( 0, " L%-2d: %-25s %s\n",
conventional_layer_num,
TO_UTF8( m_pcb->GetLayerName( *seq ) ),
layerName( *seq ).c_str() // generic layer name
);
conventional_layer_num,
TO_UTF8( m_pcb->GetLayerName( *seq ) ),
layerName( *seq ).c_str() ); // generic layer name
}
out.Print( 0, "\n\n" );
@ -386,7 +384,7 @@ bool GENDRILL_WRITER_BASE::GenDrillReportFile( const wxString& aFullFileName )
if( pair == DRILL_LAYER_PAIR( F_Cu, B_Cu ) )
{
out.Print( 0, "Drill file '%s' contains\n",
TO_UTF8( getDrillFileName( pair, false, m_merge_PTH_NPTH ) ) );
TO_UTF8( getDrillFileName( pair, false, m_merge_PTH_NPTH ) ) );
out.Print( 0, " plated through holes:\n" );
out.Print( 0, separator );
@ -396,13 +394,12 @@ bool GENDRILL_WRITER_BASE::GenDrillReportFile( const wxString& aFullFileName )
else // blind/buried
{
out.Print( 0, "Drill file '%s' contains\n",
TO_UTF8( getDrillFileName( pair, false, m_merge_PTH_NPTH ) ) );
TO_UTF8( getDrillFileName( pair, false, m_merge_PTH_NPTH ) ) );
out.Print( 0, " holes connecting layer pair: '%s and %s' (%s vias):\n",
TO_UTF8( m_pcb->GetLayerName( ToLAYER_ID( pair.first ) ) ),
TO_UTF8( m_pcb->GetLayerName( ToLAYER_ID( pair.second ) ) ),
pair.first == F_Cu || pair.second == B_Cu ? "blind" : "buried"
);
TO_UTF8( m_pcb->GetLayerName( ToLAYER_ID( pair.first ) ) ),
TO_UTF8( m_pcb->GetLayerName( ToLAYER_ID( pair.second ) ) ),
pair.first == F_Cu || pair.second == B_Cu ? "blind" : "buried" );
out.Print( 0, separator );
totalHoleCount = printToolSummary( out, false );
@ -483,8 +480,8 @@ unsigned GENDRILL_WRITER_BASE::printToolSummary( OUTPUTFORMATTER& out, bool aSum
// in mm then in inches.
int tool_number = ii+1;
out.Print( 0, " T%d %2.3fmm %2.4f\" ", tool_number,
diameter_in_mm( tool.m_Diameter ),
diameter_in_inches( tool.m_Diameter ) );
diameter_in_mm( tool.m_Diameter ),
diameter_in_inches( tool.m_Diameter ) );
// Now list how many holes and ovals are associated with each drill.
if( ( tool.m_TotalCount == 1 ) && ( tool.m_OvalCount == 0 ) )
@ -496,8 +493,7 @@ unsigned GENDRILL_WRITER_BASE::printToolSummary( OUTPUTFORMATTER& out, bool aSum
else if( tool.m_OvalCount == 1 )
out.Print( 0, "(%d holes) (with 1 slot)\n", tool.m_TotalCount );
else // tool.m_OvalCount > 1
out.Print( 0, "(%d holes) (with %d slots)\n",
tool.m_TotalCount, tool.m_OvalCount );
out.Print( 0, "(%d holes) (with %d slots)\n", tool.m_TotalCount, tool.m_OvalCount );
totalHoleCount += tool.m_TotalCount;
}

View File

@ -153,7 +153,7 @@ void DIALOG_GEN_FOOTPRINT_POSITION::initDialog()
{
m_browseButton->SetBitmap( KiBitmap( BITMAPS::small_folder ) );
auto cfg = m_parent->GetPcbNewSettings();
PCBNEW_SETTINGS* cfg = m_parent->GetPcbNewSettings();
m_units = cfg->m_PlaceFile.units == 0 ? EDA_UNITS::INCHES : EDA_UNITS::MILLIMETRES;
m_fileOpt = cfg->m_PlaceFile.file_options;
@ -168,7 +168,7 @@ void DIALOG_GEN_FOOTPRINT_POSITION::initDialog()
m_radioBoxFilesCount->SetSelection( m_fileOpt );
m_rbFormat->SetSelection( m_fileFormat );
m_cbIncludeBoardEdge->SetValue( m_includeBoardEdge );
m_useDrillPlaceOrigin->SetValue( cfg->m_PlaceFile.use_aux_origin );
// Update sizes and sizers:
m_messagesPanel->MsgPanelSetMinSize( wxSize( -1, 160 ) );
@ -217,6 +217,7 @@ void DIALOG_GEN_FOOTPRINT_POSITION::OnGenerate( wxCommandEvent& event )
cfg->m_PlaceFile.file_options = m_fileOpt;
cfg->m_PlaceFile.file_format = m_fileFormat;
cfg->m_PlaceFile.include_board_edge = m_includeBoardEdge;
cfg->m_PlaceFile.use_aux_origin = m_useDrillPlaceOrigin->GetValue();
// Set output directory and replace backslashes with forward ones
// (Keep unix convention in cfg files)
@ -235,10 +236,10 @@ void DIALOG_GEN_FOOTPRINT_POSITION::OnGenerate( wxCommandEvent& event )
bool DIALOG_GEN_FOOTPRINT_POSITION::CreateGerberFiles()
{
BOARD* brd = m_parent->GetBoard();
wxFileName fn;
wxString msg;
int fullcount = 0;
BOARD* brd = m_parent->GetBoard();
wxFileName fn;
wxString msg;
int fullcount = 0;
// Create output directory if it does not exist. Also transform it in absolute path.
// Bail if it fails
@ -315,19 +316,20 @@ bool DIALOG_GEN_FOOTPRINT_POSITION::CreateGerberFiles()
bool DIALOG_GEN_FOOTPRINT_POSITION::CreateAsciiFiles()
{
BOARD * brd = m_parent->GetBoard();
wxFileName fn;
wxString msg;
bool singleFile = OneFileOnly();
bool useCSVfmt = m_fileFormat == 1;
int fullcount = 0;
int top_side = true;
int bottom_side = true;
BOARD * brd = m_parent->GetBoard();
wxFileName fn;
wxString msg;
bool singleFile = OneFileOnly();
bool useCSVfmt = m_fileFormat == 1;
bool useAuxOrigin = m_useDrillPlaceOrigin->GetValue();
int fullcount = 0;
int topSide = true;
int bottomSide = true;
// Test for any footprint candidate in list.
{
PLACE_FILE_EXPORTER exporter( brd, UnitsMM(), ExcludeAllTH(), top_side, bottom_side,
useCSVfmt );
PLACE_FILE_EXPORTER exporter( brd, UnitsMM(), ExcludeAllTH(), topSide, bottomSide,
useCSVfmt, useAuxOrigin );
exporter.GenPositionData();
if( exporter.GetFootprintCount() == 0 )
@ -357,12 +359,12 @@ bool DIALOG_GEN_FOOTPRINT_POSITION::CreateAsciiFiles()
fn.SetPath( outputDir.GetPath() );
// Create the Front or Top side placement file, or a single file
top_side = true;
bottom_side = false;
topSide = true;
bottomSide = false;
if( singleFile )
{
bottom_side = true;
bottomSide = true;
fn.SetName( fn.GetName() + wxT( "-" ) + wxT("all") );
}
else
@ -378,8 +380,8 @@ bool DIALOG_GEN_FOOTPRINT_POSITION::CreateAsciiFiles()
fn.SetExt( FootprintPlaceFileExtension );
int fpcount = m_parent->DoGenFootprintsPositionFile( fn.GetFullPath(), UnitsMM(),
ExcludeAllTH(), top_side, bottom_side,
useCSVfmt );
ExcludeAllTH(), topSide, bottomSide,
useCSVfmt, useAuxOrigin );
if( fpcount < 0 )
{
msg.Printf( _( "Unable to create '%s'." ), fn.GetFullPath() );
@ -406,8 +408,8 @@ bool DIALOG_GEN_FOOTPRINT_POSITION::CreateAsciiFiles()
// Create the Back or Bottom side placement file
fullcount = fpcount;
top_side = false;
bottom_side = true;
topSide = false;
bottomSide = true;
fn = brd->GetFileName();
fn.SetPath( outputDir.GetPath() );
fn.SetName( fn.GetName() + wxT( "-" ) + PLACE_FILE_EXPORTER::GetBackSideName().c_str() );
@ -421,7 +423,7 @@ bool DIALOG_GEN_FOOTPRINT_POSITION::CreateAsciiFiles()
fn.SetExt( FootprintPlaceFileExtension );
fpcount = m_parent->DoGenFootprintsPositionFile( fn.GetFullPath(), UnitsMM(), ExcludeAllTH(),
top_side, bottom_side, useCSVfmt );
topSide, bottomSide, useCSVfmt, useAuxOrigin );
if( fpcount < 0 )
{
@ -467,7 +469,8 @@ int BOARD_EDITOR_CONTROL::GeneratePosFile( const TOOL_EVENT& aEvent )
int PCB_EDIT_FRAME::DoGenFootprintsPositionFile( const wxString& aFullFileName, bool aUnitsMM,
bool aForceSmdItems, bool aTopSide,
bool aBottomSide, bool aFormatCSV )
bool aBottomSide, bool aFormatCSV,
bool aUseAuxOrigin )
{
FILE * file = NULL;
@ -481,7 +484,7 @@ int PCB_EDIT_FRAME::DoGenFootprintsPositionFile( const wxString& aFullFileName,
std::string data;
PLACE_FILE_EXPORTER exporter( GetBoard(), aUnitsMM, aForceSmdItems, aTopSide, aBottomSide,
aFormatCSV );
aFormatCSV, aUseAuxOrigin );
data = exporter.GenPositionData();
// if aFullFileName is empty, the file is not created, only the
@ -541,7 +544,7 @@ bool PCB_EDIT_FRAME::DoGenFootprintsReport( const wxString& aFullFilename, bool
return false;
std::string data;
PLACE_FILE_EXPORTER exporter( GetBoard(), aUnitsMM, false, true, true, false );
PLACE_FILE_EXPORTER exporter( GetBoard(), aUnitsMM, false, true, true, false, true );
data = exporter.GenReportData();
fputs( data.c_str(), rptfile );

View File

@ -71,9 +71,8 @@ EXCELLON_WRITER::EXCELLON_WRITER( BOARD* aPcb )
}
void EXCELLON_WRITER::CreateDrillandMapFilesSet( const wxString& aPlotDirectory,
bool aGenDrill, bool aGenMap,
REPORTER * aReporter )
void EXCELLON_WRITER::CreateDrillandMapFilesSet( const wxString& aPlotDirectory, bool aGenDrill,
bool aGenMap, REPORTER * aReporter )
{
wxFileName fn;
wxString msg;
@ -93,10 +92,11 @@ void EXCELLON_WRITER::CreateDrillandMapFilesSet( const wxString& aPlotDirectory,
buildHolesList( pair, doing_npth );
// The file is created if it has holes, or if it is the non plated drill file
// to be sure the NPTH file is up to date in separate files mode.
// Also a PTH drill/map file is always created, to be sure at least one plated hole drill file
// is created (do not create any PTH drill file can be seen as not working drill generator).
// The file is created if it has holes, or if it is the non plated drill file to be
// sure the NPTH file is up to date in separate files mode.
// Also a PTH drill/map file is always created, to be sure at least one plated hole
// drill file is created (do not create any PTH drill file can be seen as not working
// drill generator).
if( getHolesCount() > 0 || doing_npth || pair == DRILL_LAYER_PAIR( F_Cu, B_Cu ) )
{
fn = getDrillFileName( pair, doing_npth, m_merge_PTH_NPTH );

View File

@ -178,7 +178,7 @@ public:
void SetMergeOption( bool aMerge ) { m_merge_PTH_NPTH = aMerge; }
/**
* Return the plot offset (usually the position of the auxiliary axis.
* Return the plot offset (usually the position of the drill/place origin).
*/
wxPoint GetOffset() { return m_offset; }

View File

@ -292,7 +292,7 @@ public:
*/
int DoGenFootprintsPositionFile( const wxString& aFullFileName, bool aUnitsMM,
bool aForceSmdItems, bool aTopSide, bool aBottomSide,
bool aFormatCSV = false );
bool aFormatCSV, bool aUseAuxOrigin );
/**
* Call #DoGenFootprintsReport to create a footprint report file

View File

@ -402,6 +402,9 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS()
m_params.emplace_back( new PARAM<bool>( "place_file.include_board_edge",
&m_PlaceFile.include_board_edge, false ) );
m_params.emplace_back( new PARAM<bool>( "place_file.use_place_file_origin",
&m_PlaceFile.use_aux_origin, true ) );
m_params.emplace_back( new PARAM<int>( "plot.all_layers_on_one_page",
&m_Plot.all_layers_on_one_page, 1 ) );

View File

@ -177,6 +177,7 @@ public:
int file_options;
int file_format;
bool include_board_edge;
bool use_aux_origin;
};
struct DIALOG_PLOT