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:
parent
4aa8318dc2
commit
08fb05e522
|
@ -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 );
|
m_cbIncludeBoardEdge = new wxCheckBox( this, wxID_ANY, _("Include board edge layer"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
bSizerLower->Add( m_cbIncludeBoardEdge, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
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 = new WX_HTML_REPORT_PANEL( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||||
m_messagesPanel->SetMinSize( wxSize( 350,300 ) );
|
m_messagesPanel->SetMinSize( wxSize( 350,300 ) );
|
||||||
|
|
||||||
|
|
|
@ -629,6 +629,70 @@
|
||||||
<event name="OnUpdateUI">onUpdateUIincludeBoardEdge</event>
|
<event name="OnUpdateUI">onUpdateUIincludeBoardEdge</event>
|
||||||
</object>
|
</object>
|
||||||
</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">
|
<object class="sizeritem" expanded="1">
|
||||||
<property name="border">5</property>
|
<property name="border">5</property>
|
||||||
<property name="flag">wxEXPAND | wxALL</property>
|
<property name="flag">wxEXPAND | wxALL</property>
|
||||||
|
|
|
@ -51,6 +51,7 @@ class DIALOG_GEN_FOOTPRINT_POSITION_BASE : public DIALOG_SHIM
|
||||||
wxRadioBox* m_radioBoxFilesCount;
|
wxRadioBox* m_radioBoxFilesCount;
|
||||||
wxCheckBox* m_excludeTH;
|
wxCheckBox* m_excludeTH;
|
||||||
wxCheckBox* m_cbIncludeBoardEdge;
|
wxCheckBox* m_cbIncludeBoardEdge;
|
||||||
|
wxCheckBox* m_useDrillPlaceOrigin;
|
||||||
WX_HTML_REPORT_PANEL* m_messagesPanel;
|
WX_HTML_REPORT_PANEL* m_messagesPanel;
|
||||||
wxStaticLine* m_staticline;
|
wxStaticLine* m_staticline;
|
||||||
wxStdDialogButtonSizer* m_sdbSizer;
|
wxStdDialogButtonSizer* m_sdbSizer;
|
||||||
|
|
|
@ -340,9 +340,9 @@ void DIALOG_GENDRILL::UpdateDrillParams()
|
||||||
m_UseRouteModeForOvalHoles = m_radioBoxOvalHoleMode->GetSelection() == 0;
|
m_UseRouteModeForOvalHoles = m_radioBoxOvalHoleMode->GetSelection() == 0;
|
||||||
|
|
||||||
if( m_Choice_Drill_Offset->GetSelection() == 0 )
|
if( m_Choice_Drill_Offset->GetSelection() == 0 )
|
||||||
m_FileDrillOffset = wxPoint( 0, 0 );
|
m_DrillFileOffset = wxPoint( 0, 0 );
|
||||||
else
|
else
|
||||||
m_FileDrillOffset = m_board->GetDesignSettings().m_AuxOrigin;
|
m_DrillFileOffset = m_board->GetDesignSettings().m_AuxOrigin;
|
||||||
|
|
||||||
if( m_UnitDrillIsInch )
|
if( m_UnitDrillIsInch )
|
||||||
m_Precision = precisionListForInches;
|
m_Precision = precisionListForInches;
|
||||||
|
@ -366,8 +366,12 @@ void DIALOG_GENDRILL::GenDrillAndMapFiles( bool aGenDrill, bool aGenMap )
|
||||||
|
|
||||||
const PLOT_FORMAT filefmt[6] = {
|
const PLOT_FORMAT filefmt[6] = {
|
||||||
// Keep these format ids in the same order than m_Choice_Drill_Map choices
|
// 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::HPGL,
|
||||||
PLOT_FORMAT::SVG, PLOT_FORMAT::PDF
|
PLOT_FORMAT::POST,
|
||||||
|
PLOT_FORMAT::GERBER,
|
||||||
|
PLOT_FORMAT::DXF,
|
||||||
|
PLOT_FORMAT::SVG,
|
||||||
|
PLOT_FORMAT::PDF
|
||||||
};
|
};
|
||||||
|
|
||||||
unsigned choice = (unsigned) m_Choice_Drill_Map->GetSelection();
|
unsigned choice = (unsigned) m_Choice_Drill_Map->GetSelection();
|
||||||
|
@ -395,7 +399,7 @@ void DIALOG_GENDRILL::GenDrillAndMapFiles( bool aGenDrill, bool aGenMap )
|
||||||
EXCELLON_WRITER excellonWriter( m_board );
|
EXCELLON_WRITER excellonWriter( m_board );
|
||||||
excellonWriter.SetFormat( !m_UnitDrillIsInch, (EXCELLON_WRITER::ZEROS_FMT) m_ZerosFormat,
|
excellonWriter.SetFormat( !m_UnitDrillIsInch, (EXCELLON_WRITER::ZEROS_FMT) m_ZerosFormat,
|
||||||
m_Precision.m_Lhs, m_Precision.m_Rhs );
|
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.SetRouteModeForOvalHoles( m_UseRouteModeForOvalHoles );
|
||||||
excellonWriter.SetMapFileFormat( filefmt[choice] );
|
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)
|
// (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
|
// the integer part precision is always 4, and units always mm
|
||||||
gerberWriter.SetFormat( m_plotOpts.GetGerberPrecision() );
|
gerberWriter.SetFormat( m_plotOpts.GetGerberPrecision() );
|
||||||
gerberWriter.SetOptions( m_FileDrillOffset );
|
gerberWriter.SetOptions( m_DrillFileOffset );
|
||||||
gerberWriter.SetMapFileFormat( filefmt[choice] );
|
gerberWriter.SetMapFileFormat( filefmt[choice] );
|
||||||
|
|
||||||
gerberWriter.CreateDrillandMapFilesSet( outputDir.GetFullPath(),
|
gerberWriter.CreateDrillandMapFilesSet( outputDir.GetFullPath(), aGenDrill, aGenMap,
|
||||||
aGenDrill, aGenMap, &reporter );
|
&reporter );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,7 @@ public:
|
||||||
static bool m_Mirror;
|
static bool m_Mirror;
|
||||||
static bool m_Merge_PTH_NPTH;
|
static bool m_Merge_PTH_NPTH;
|
||||||
DRILL_PRECISION m_Precision; // Precision for drill files, in non decimal format
|
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
|
// or origin of the auxiliary axis
|
||||||
static bool m_UseRouteModeForOvalHoles; // True to use a G00 route command for oval holes
|
static bool m_UseRouteModeForOvalHoles; // True to use a G00 route command for oval holes
|
||||||
// False to use a G85 canned mode for oval holes
|
// False to use a G85 canned mode for oval holes
|
||||||
|
|
|
@ -411,8 +411,13 @@ void DIALOG_PLOT::OnOutputDirectoryBrowseClicked( wxCommandEvent& event )
|
||||||
PLOT_FORMAT DIALOG_PLOT::getPlotFormat()
|
PLOT_FORMAT DIALOG_PLOT::getPlotFormat()
|
||||||
{
|
{
|
||||||
// plot format id's are ordered like displayed in m_plotFormatOpt
|
// 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,
|
static const PLOT_FORMAT plotFmt[] = {
|
||||||
PLOT_FORMAT::DXF, PLOT_FORMAT::HPGL, PLOT_FORMAT::PDF };
|
PLOT_FORMAT::GERBER,
|
||||||
|
PLOT_FORMAT::POST,
|
||||||
|
PLOT_FORMAT::SVG,
|
||||||
|
PLOT_FORMAT::DXF,
|
||||||
|
PLOT_FORMAT::HPGL,
|
||||||
|
PLOT_FORMAT::PDF };
|
||||||
|
|
||||||
return plotFmt[m_plotFormatOpt->GetSelection()];
|
return plotFmt[m_plotFormatOpt->GetSelection()];
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,8 @@ enum SELECT_SIDE
|
||||||
};
|
};
|
||||||
|
|
||||||
PLACE_FILE_EXPORTER::PLACE_FILE_EXPORTER( BOARD* aBoard, bool aUnitsMM, bool aExcludeAllTH,
|
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_board = aBoard;
|
||||||
m_unitsMM = aUnitsMM;
|
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_side = PCB_NO_SIDE;
|
||||||
|
|
||||||
m_formatCSV = aFormatCSV;
|
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 lenValText = 8;
|
||||||
int lenPkgText = 16;
|
int lenPkgText = 16;
|
||||||
|
|
||||||
m_place_Offset = m_board->GetDesignSettings().m_AuxOrigin;
|
|
||||||
|
|
||||||
// Calculating the number of useful footprints (CMS attribute, not VIRTUAL)
|
// Calculating the number of useful footprints (CMS attribute, not VIRTUAL)
|
||||||
m_fpCount = 0;
|
m_fpCount = 0;
|
||||||
|
|
||||||
|
|
|
@ -61,8 +61,8 @@ public:
|
||||||
* @param aBottomSide true to generate bottom side info
|
* @param aBottomSide true to generate bottom side info
|
||||||
* @param aFormatCSV true to generate a csv format info, false to generate a ascii info
|
* @param aFormatCSV true to generate a csv format info, false to generate a ascii info
|
||||||
*/
|
*/
|
||||||
PLACE_FILE_EXPORTER( BOARD* aBoard, bool aUnitsMM,
|
PLACE_FILE_EXPORTER( BOARD* aBoard, bool aUnitsMM, bool aForceSmdItems, bool aTopSide,
|
||||||
bool aForceSmdItems, bool aTopSide, bool aBottomSide, bool aFormatCSV );
|
bool aBottomSide, bool aFormatCSV, bool useAuxOrigin );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* build a string filled with the position data
|
* build a string filled with the position data
|
||||||
|
|
|
@ -71,7 +71,7 @@ bool GENDRILL_WRITER_BASE::genDrillMapFile( const wxString& aFullFileName, PLOT_
|
||||||
// for the right holes set (PTH, NPTH, buried/blind vias ...)
|
// for the right holes set (PTH, NPTH, buried/blind vias ...)
|
||||||
|
|
||||||
double scale = 1.0;
|
double scale = 1.0;
|
||||||
wxPoint offset;
|
wxPoint offset = GetOffset();
|
||||||
PLOTTER* plotter = NULL;
|
PLOTTER* plotter = NULL;
|
||||||
PAGE_INFO dummy( PAGE_INFO::A4, false );
|
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
|
||||||
|
@ -94,7 +94,6 @@ bool GENDRILL_WRITER_BASE::genDrillMapFile( const wxString& aFullFileName, PLOT_
|
||||||
switch( aFormat )
|
switch( aFormat )
|
||||||
{
|
{
|
||||||
case PLOT_FORMAT::GERBER:
|
case PLOT_FORMAT::GERBER:
|
||||||
offset = GetOffset();
|
|
||||||
plotter = new GERBER_PLOTTER();
|
plotter = new GERBER_PLOTTER();
|
||||||
plotter->SetViewport( offset, IU_PER_MILS / 10, scale, false );
|
plotter->SetViewport( offset, IU_PER_MILS / 10, scale, false );
|
||||||
plotter->SetGerberCoordinatesFormat( 5 ); // format x.5 unit = mm
|
plotter->SetGerberCoordinatesFormat( 5 ); // format x.5 unit = mm
|
||||||
|
@ -362,8 +361,7 @@ bool GENDRILL_WRITER_BASE::GenDrillReportFile( const wxString& aFullFileName )
|
||||||
out.Print( 0, " L%-2d: %-25s %s\n",
|
out.Print( 0, " L%-2d: %-25s %s\n",
|
||||||
conventional_layer_num,
|
conventional_layer_num,
|
||||||
TO_UTF8( m_pcb->GetLayerName( *seq ) ),
|
TO_UTF8( m_pcb->GetLayerName( *seq ) ),
|
||||||
layerName( *seq ).c_str() // generic layer name
|
layerName( *seq ).c_str() ); // generic layer name
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
out.Print( 0, "\n\n" );
|
out.Print( 0, "\n\n" );
|
||||||
|
@ -401,8 +399,7 @@ bool GENDRILL_WRITER_BASE::GenDrillReportFile( const wxString& aFullFileName )
|
||||||
out.Print( 0, " holes connecting layer pair: '%s and %s' (%s vias):\n",
|
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.first ) ) ),
|
||||||
TO_UTF8( m_pcb->GetLayerName( ToLAYER_ID( pair.second ) ) ),
|
TO_UTF8( m_pcb->GetLayerName( ToLAYER_ID( pair.second ) ) ),
|
||||||
pair.first == F_Cu || pair.second == B_Cu ? "blind" : "buried"
|
pair.first == F_Cu || pair.second == B_Cu ? "blind" : "buried" );
|
||||||
);
|
|
||||||
|
|
||||||
out.Print( 0, separator );
|
out.Print( 0, separator );
|
||||||
totalHoleCount = printToolSummary( out, false );
|
totalHoleCount = printToolSummary( out, false );
|
||||||
|
@ -496,8 +493,7 @@ unsigned GENDRILL_WRITER_BASE::printToolSummary( OUTPUTFORMATTER& out, bool aSum
|
||||||
else if( tool.m_OvalCount == 1 )
|
else if( tool.m_OvalCount == 1 )
|
||||||
out.Print( 0, "(%d holes) (with 1 slot)\n", tool.m_TotalCount );
|
out.Print( 0, "(%d holes) (with 1 slot)\n", tool.m_TotalCount );
|
||||||
else // tool.m_OvalCount > 1
|
else // tool.m_OvalCount > 1
|
||||||
out.Print( 0, "(%d holes) (with %d slots)\n",
|
out.Print( 0, "(%d holes) (with %d slots)\n", tool.m_TotalCount, tool.m_OvalCount );
|
||||||
tool.m_TotalCount, tool.m_OvalCount );
|
|
||||||
|
|
||||||
totalHoleCount += tool.m_TotalCount;
|
totalHoleCount += tool.m_TotalCount;
|
||||||
}
|
}
|
||||||
|
|
|
@ -153,7 +153,7 @@ void DIALOG_GEN_FOOTPRINT_POSITION::initDialog()
|
||||||
{
|
{
|
||||||
m_browseButton->SetBitmap( KiBitmap( BITMAPS::small_folder ) );
|
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_units = cfg->m_PlaceFile.units == 0 ? EDA_UNITS::INCHES : EDA_UNITS::MILLIMETRES;
|
||||||
m_fileOpt = cfg->m_PlaceFile.file_options;
|
m_fileOpt = cfg->m_PlaceFile.file_options;
|
||||||
|
@ -168,7 +168,7 @@ void DIALOG_GEN_FOOTPRINT_POSITION::initDialog()
|
||||||
m_radioBoxFilesCount->SetSelection( m_fileOpt );
|
m_radioBoxFilesCount->SetSelection( m_fileOpt );
|
||||||
m_rbFormat->SetSelection( m_fileFormat );
|
m_rbFormat->SetSelection( m_fileFormat );
|
||||||
m_cbIncludeBoardEdge->SetValue( m_includeBoardEdge );
|
m_cbIncludeBoardEdge->SetValue( m_includeBoardEdge );
|
||||||
|
m_useDrillPlaceOrigin->SetValue( cfg->m_PlaceFile.use_aux_origin );
|
||||||
|
|
||||||
// Update sizes and sizers:
|
// Update sizes and sizers:
|
||||||
m_messagesPanel->MsgPanelSetMinSize( wxSize( -1, 160 ) );
|
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_options = m_fileOpt;
|
||||||
cfg->m_PlaceFile.file_format = m_fileFormat;
|
cfg->m_PlaceFile.file_format = m_fileFormat;
|
||||||
cfg->m_PlaceFile.include_board_edge = m_includeBoardEdge;
|
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
|
// Set output directory and replace backslashes with forward ones
|
||||||
// (Keep unix convention in cfg files)
|
// (Keep unix convention in cfg files)
|
||||||
|
@ -320,14 +321,15 @@ bool DIALOG_GEN_FOOTPRINT_POSITION::CreateAsciiFiles()
|
||||||
wxString msg;
|
wxString msg;
|
||||||
bool singleFile = OneFileOnly();
|
bool singleFile = OneFileOnly();
|
||||||
bool useCSVfmt = m_fileFormat == 1;
|
bool useCSVfmt = m_fileFormat == 1;
|
||||||
|
bool useAuxOrigin = m_useDrillPlaceOrigin->GetValue();
|
||||||
int fullcount = 0;
|
int fullcount = 0;
|
||||||
int top_side = true;
|
int topSide = true;
|
||||||
int bottom_side = true;
|
int bottomSide = true;
|
||||||
|
|
||||||
// Test for any footprint candidate in list.
|
// Test for any footprint candidate in list.
|
||||||
{
|
{
|
||||||
PLACE_FILE_EXPORTER exporter( brd, UnitsMM(), ExcludeAllTH(), top_side, bottom_side,
|
PLACE_FILE_EXPORTER exporter( brd, UnitsMM(), ExcludeAllTH(), topSide, bottomSide,
|
||||||
useCSVfmt );
|
useCSVfmt, useAuxOrigin );
|
||||||
exporter.GenPositionData();
|
exporter.GenPositionData();
|
||||||
|
|
||||||
if( exporter.GetFootprintCount() == 0 )
|
if( exporter.GetFootprintCount() == 0 )
|
||||||
|
@ -357,12 +359,12 @@ bool DIALOG_GEN_FOOTPRINT_POSITION::CreateAsciiFiles()
|
||||||
fn.SetPath( outputDir.GetPath() );
|
fn.SetPath( outputDir.GetPath() );
|
||||||
|
|
||||||
// Create the Front or Top side placement file, or a single file
|
// Create the Front or Top side placement file, or a single file
|
||||||
top_side = true;
|
topSide = true;
|
||||||
bottom_side = false;
|
bottomSide = false;
|
||||||
|
|
||||||
if( singleFile )
|
if( singleFile )
|
||||||
{
|
{
|
||||||
bottom_side = true;
|
bottomSide = true;
|
||||||
fn.SetName( fn.GetName() + wxT( "-" ) + wxT("all") );
|
fn.SetName( fn.GetName() + wxT( "-" ) + wxT("all") );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -378,8 +380,8 @@ bool DIALOG_GEN_FOOTPRINT_POSITION::CreateAsciiFiles()
|
||||||
fn.SetExt( FootprintPlaceFileExtension );
|
fn.SetExt( FootprintPlaceFileExtension );
|
||||||
|
|
||||||
int fpcount = m_parent->DoGenFootprintsPositionFile( fn.GetFullPath(), UnitsMM(),
|
int fpcount = m_parent->DoGenFootprintsPositionFile( fn.GetFullPath(), UnitsMM(),
|
||||||
ExcludeAllTH(), top_side, bottom_side,
|
ExcludeAllTH(), topSide, bottomSide,
|
||||||
useCSVfmt );
|
useCSVfmt, useAuxOrigin );
|
||||||
if( fpcount < 0 )
|
if( fpcount < 0 )
|
||||||
{
|
{
|
||||||
msg.Printf( _( "Unable to create '%s'." ), fn.GetFullPath() );
|
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
|
// Create the Back or Bottom side placement file
|
||||||
fullcount = fpcount;
|
fullcount = fpcount;
|
||||||
top_side = false;
|
topSide = false;
|
||||||
bottom_side = true;
|
bottomSide = true;
|
||||||
fn = brd->GetFileName();
|
fn = brd->GetFileName();
|
||||||
fn.SetPath( outputDir.GetPath() );
|
fn.SetPath( outputDir.GetPath() );
|
||||||
fn.SetName( fn.GetName() + wxT( "-" ) + PLACE_FILE_EXPORTER::GetBackSideName().c_str() );
|
fn.SetName( fn.GetName() + wxT( "-" ) + PLACE_FILE_EXPORTER::GetBackSideName().c_str() );
|
||||||
|
@ -421,7 +423,7 @@ bool DIALOG_GEN_FOOTPRINT_POSITION::CreateAsciiFiles()
|
||||||
fn.SetExt( FootprintPlaceFileExtension );
|
fn.SetExt( FootprintPlaceFileExtension );
|
||||||
|
|
||||||
fpcount = m_parent->DoGenFootprintsPositionFile( fn.GetFullPath(), UnitsMM(), ExcludeAllTH(),
|
fpcount = m_parent->DoGenFootprintsPositionFile( fn.GetFullPath(), UnitsMM(), ExcludeAllTH(),
|
||||||
top_side, bottom_side, useCSVfmt );
|
topSide, bottomSide, useCSVfmt, useAuxOrigin );
|
||||||
|
|
||||||
if( fpcount < 0 )
|
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,
|
int PCB_EDIT_FRAME::DoGenFootprintsPositionFile( const wxString& aFullFileName, bool aUnitsMM,
|
||||||
bool aForceSmdItems, bool aTopSide,
|
bool aForceSmdItems, bool aTopSide,
|
||||||
bool aBottomSide, bool aFormatCSV )
|
bool aBottomSide, bool aFormatCSV,
|
||||||
|
bool aUseAuxOrigin )
|
||||||
{
|
{
|
||||||
FILE * file = NULL;
|
FILE * file = NULL;
|
||||||
|
|
||||||
|
@ -481,7 +484,7 @@ int PCB_EDIT_FRAME::DoGenFootprintsPositionFile( const wxString& aFullFileName,
|
||||||
|
|
||||||
std::string data;
|
std::string data;
|
||||||
PLACE_FILE_EXPORTER exporter( GetBoard(), aUnitsMM, aForceSmdItems, aTopSide, aBottomSide,
|
PLACE_FILE_EXPORTER exporter( GetBoard(), aUnitsMM, aForceSmdItems, aTopSide, aBottomSide,
|
||||||
aFormatCSV );
|
aFormatCSV, aUseAuxOrigin );
|
||||||
data = exporter.GenPositionData();
|
data = exporter.GenPositionData();
|
||||||
|
|
||||||
// if aFullFileName is empty, the file is not created, only the
|
// 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;
|
return false;
|
||||||
|
|
||||||
std::string data;
|
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();
|
data = exporter.GenReportData();
|
||||||
|
|
||||||
fputs( data.c_str(), rptfile );
|
fputs( data.c_str(), rptfile );
|
||||||
|
|
|
@ -71,9 +71,8 @@ EXCELLON_WRITER::EXCELLON_WRITER( BOARD* aPcb )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void EXCELLON_WRITER::CreateDrillandMapFilesSet( const wxString& aPlotDirectory,
|
void EXCELLON_WRITER::CreateDrillandMapFilesSet( const wxString& aPlotDirectory, bool aGenDrill,
|
||||||
bool aGenDrill, bool aGenMap,
|
bool aGenMap, REPORTER * aReporter )
|
||||||
REPORTER * aReporter )
|
|
||||||
{
|
{
|
||||||
wxFileName fn;
|
wxFileName fn;
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
@ -93,10 +92,11 @@ void EXCELLON_WRITER::CreateDrillandMapFilesSet( const wxString& aPlotDirectory,
|
||||||
|
|
||||||
buildHolesList( pair, doing_npth );
|
buildHolesList( pair, doing_npth );
|
||||||
|
|
||||||
// The file is created if it has holes, or if it is the non plated drill file
|
// The file is created if it has holes, or if it is the non plated drill file to be
|
||||||
// to be sure the NPTH file is up to date in separate files mode.
|
// 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
|
// Also a PTH drill/map file is always created, to be sure at least one plated hole
|
||||||
// is created (do not create any PTH drill file can be seen as not working drill generator).
|
// 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 ) )
|
if( getHolesCount() > 0 || doing_npth || pair == DRILL_LAYER_PAIR( F_Cu, B_Cu ) )
|
||||||
{
|
{
|
||||||
fn = getDrillFileName( pair, doing_npth, m_merge_PTH_NPTH );
|
fn = getDrillFileName( pair, doing_npth, m_merge_PTH_NPTH );
|
||||||
|
|
|
@ -178,7 +178,7 @@ public:
|
||||||
void SetMergeOption( bool aMerge ) { m_merge_PTH_NPTH = aMerge; }
|
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; }
|
wxPoint GetOffset() { return m_offset; }
|
||||||
|
|
||||||
|
|
|
@ -292,7 +292,7 @@ public:
|
||||||
*/
|
*/
|
||||||
int DoGenFootprintsPositionFile( const wxString& aFullFileName, bool aUnitsMM,
|
int DoGenFootprintsPositionFile( const wxString& aFullFileName, bool aUnitsMM,
|
||||||
bool aForceSmdItems, bool aTopSide, bool aBottomSide,
|
bool aForceSmdItems, bool aTopSide, bool aBottomSide,
|
||||||
bool aFormatCSV = false );
|
bool aFormatCSV, bool aUseAuxOrigin );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Call #DoGenFootprintsReport to create a footprint report file
|
* Call #DoGenFootprintsReport to create a footprint report file
|
||||||
|
|
|
@ -402,6 +402,9 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS()
|
||||||
m_params.emplace_back( new PARAM<bool>( "place_file.include_board_edge",
|
m_params.emplace_back( new PARAM<bool>( "place_file.include_board_edge",
|
||||||
&m_PlaceFile.include_board_edge, false ) );
|
&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_params.emplace_back( new PARAM<int>( "plot.all_layers_on_one_page",
|
||||||
&m_Plot.all_layers_on_one_page, 1 ) );
|
&m_Plot.all_layers_on_one_page, 1 ) );
|
||||||
|
|
||||||
|
|
|
@ -177,6 +177,7 @@ public:
|
||||||
int file_options;
|
int file_options;
|
||||||
int file_format;
|
int file_format;
|
||||||
bool include_board_edge;
|
bool include_board_edge;
|
||||||
|
bool use_aux_origin;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct DIALOG_PLOT
|
struct DIALOG_PLOT
|
||||||
|
|
Loading…
Reference in New Issue