Browse Source

Cleanup construction vs TransferDataToWindow.

Also fixes capitalization of private member functions.
pcb_db
Jeff Young 9 months ago
parent
commit
b916dfa03a
  1. 2
      eeschema/dialogs/dialog_plot_schematic.cpp
  2. 2
      eeschema/dialogs/dialog_plot_schematic_base.fbp
  3. 2
      pcbnew/dialogs/dialog_gen_footprint_position_file_base.fbp
  4. 240
      pcbnew/dialogs/dialog_gendrill.cpp
  5. 47
      pcbnew/dialogs/dialog_gendrill.h
  6. 20
      pcbnew/dialogs/dialog_gendrill_base.cpp
  7. 12
      pcbnew/dialogs/dialog_gendrill_base.fbp
  8. 8
      pcbnew/dialogs/dialog_gendrill_base.h
  9. 2
      pcbnew/dialogs/dialog_plot_base.fbp

2
eeschema/dialogs/dialog_plot_schematic.cpp

@ -232,7 +232,7 @@ void DIALOG_PLOT_SCHEMATIC::initDlg()
/**
* @todo Copy of DIALOG_PLOT::OnOutputDirectoryBrowseClicked in dialog_plot.cpp, maybe merge to
* @todo Copy of DIALOG_PLOT::onOutputDirectoryBrowseClicked in dialog_plot.cpp, maybe merge to
* a common method.
*/
void DIALOG_PLOT_SCHEMATIC::OnOutputDirectoryBrowseClicked( wxCommandEvent& event )

2
eeschema/dialogs/dialog_plot_schematic_base.fbp

@ -274,7 +274,7 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnOutputDirectoryBrowseClicked</event>
<event name="OnButtonClick">onOutputDirectoryBrowseClicked</event>
</object>
</object>
</object>

2
pcbnew/dialogs/dialog_gen_footprint_position_file_base.fbp

@ -279,7 +279,7 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnOutputDirectoryBrowseClicked</event>
<event name="OnButtonClick">onOutputDirectoryBrowseClicked</event>
</object>
</object>
</object>

240
pcbnew/dialogs/dialog_gendrill.cpp

@ -32,13 +32,10 @@
#include <gendrill_gerber_writer.h>
#include <bitmaps.h>
#include <tools/board_editor_control.h>
#include <board.h>
#include <board_design_settings.h>
#include <footprint.h>
#include <pad.h>
#include <pcb_track.h>
#include <paths.h>
#include <project.h>
#include <dialog_gendrill.h>
#include <wildcards_and_files_ext.h>
#include <reporter.h>
@ -55,6 +52,22 @@ static DRILL_PRECISION precisionListForInches( 2, 4 );
static DRILL_PRECISION precisionListForMetric( 3, 3 );
// Static members of DIALOG_GENDRILL
int DIALOG_GENDRILL::g_unitDrillIsInch = false; // Only for Excellon format
int DIALOG_GENDRILL::g_zerosFormat = EXCELLON_WRITER::DECIMAL_FORMAT;
bool DIALOG_GENDRILL::g_minimalHeader = false; // Only for Excellon format
bool DIALOG_GENDRILL::g_mirror = false; // Only for Excellon format
bool DIALOG_GENDRILL::g_merge_PTH_NPTH = false; // Only for Excellon format
bool DIALOG_GENDRILL::g_generateMap = false;
int DIALOG_GENDRILL::g_mapFileType = 4; // The last choice in m_Choice_Drill_Map
int DIALOG_GENDRILL::g_drillFileType = 0;
bool DIALOG_GENDRILL::g_useRouteModeForOvalHoles = true; // Use G00 route mode to "drill" oval
// holes
DRILL_PRECISION DIALOG_GENDRILL::g_precision;
VECTOR2I DIALOG_GENDRILL::g_drillFileOffset;
/* This function displays the dialog frame for drill tools
*/
int BOARD_EDITOR_CONTROL::GenerateDrillFiles( const TOOL_EVENT& aEvent )
@ -68,56 +81,45 @@ int BOARD_EDITOR_CONTROL::GenerateDrillFiles( const TOOL_EVENT& aEvent )
DIALOG_GENDRILL::DIALOG_GENDRILL( PCB_EDIT_FRAME* aPcbEditFrame, wxWindow* aParent ) :
DIALOG_GENDRILL_BASE( aParent )
DIALOG_GENDRILL_BASE( aParent )
{
m_pcbEditFrame = aPcbEditFrame;
m_board = m_pcbEditFrame->GetBoard();
m_job = nullptr;
m_plotOpts = m_pcbEditFrame->GetPlotSettings();
m_browseButton->SetBitmap( KiBitmapBundle( BITMAPS::small_folder ) );
SetupStandardButtons( { { wxID_OK, _( "Generate" ) },
{ wxID_CANCEL, _( "Close" ) } } );
m_buttonsSizer->Layout();
initDialog();
finishDialogSettings();
}
DIALOG_GENDRILL::DIALOG_GENDRILL( PCB_EDIT_FRAME* aPcbEditFrame, JOB_EXPORT_PCB_DRILL* aJob,
wxWindow* aParent ) :
DIALOG_GENDRILL_BASE( aParent )
DIALOG_GENDRILL_BASE( aParent )
{
m_pcbEditFrame = aPcbEditFrame;
m_board = m_pcbEditFrame->GetBoard();
m_job = aJob;
m_browseButton->SetBitmap( KiBitmapBundle( BITMAPS::small_folder ) );
// hide ui elements that dont belong for job config
m_buttonReport->Hide();
bMainSizer->Remove( bMsgSizer );
m_messagesBox->Hide();
SetupStandardButtons();
m_buttonsSizer->Layout();
initDialog();
finishDialogSettings();
}
// Static members of DIALOG_GENDRILL
int DIALOG_GENDRILL::m_UnitDrillIsInch = false; // Only for Excellon format
int DIALOG_GENDRILL::m_ZerosFormat = EXCELLON_WRITER::DECIMAL_FORMAT;
bool DIALOG_GENDRILL::m_MinimalHeader = false; // Only for Excellon format
bool DIALOG_GENDRILL::m_Mirror = false; // Only for Excellon format
bool DIALOG_GENDRILL::m_Merge_PTH_NPTH = false; // Only for Excellon format
bool DIALOG_GENDRILL::m_GenerateMap = false;
int DIALOG_GENDRILL::m_mapFileType = 4; // The last choice in m_Choice_Drill_Map
int DIALOG_GENDRILL::m_drillFileType = 0;
bool DIALOG_GENDRILL::m_UseRouteModeForOvalHoles = true; // Use G00 route mode to "drill" oval holes
DIALOG_GENDRILL::~DIALOG_GENDRILL()
{
}
@ -127,7 +129,7 @@ bool DIALOG_GENDRILL::TransferDataFromWindow()
{
if( !m_job )
{
GenDrillAndMapFiles( true, m_cbGenerateMap->GetValue() );
genDrillAndMapFiles( true, m_cbGenerateMap->GetValue() );
}
else
{
@ -135,8 +137,8 @@ bool DIALOG_GENDRILL::TransferDataFromWindow()
m_job->m_format = m_rbExcellon->GetValue() ? JOB_EXPORT_PCB_DRILL::DRILL_FORMAT::EXCELLON
: JOB_EXPORT_PCB_DRILL::DRILL_FORMAT::GERBER;
m_job->m_drillUnits = m_units->GetSelection() == 0
? JOB_EXPORT_PCB_DRILL::DRILL_UNITS::MILLIMETERS
: JOB_EXPORT_PCB_DRILL::DRILL_UNITS::INCHES;
? JOB_EXPORT_PCB_DRILL::DRILL_UNITS::MILLIMETERS
: JOB_EXPORT_PCB_DRILL::DRILL_UNITS::INCHES;
m_job->m_drillOrigin = static_cast<JOB_EXPORT_PCB_DRILL::DRILL_ORIGIN>( m_origin->GetSelection() );
m_job->m_excellonCombinePTHNPTH = m_Check_Merge_PTH_NPTH->IsChecked();
m_job->m_excellonMinimalHeader = m_Check_Minimal->IsChecked();
@ -152,67 +154,23 @@ bool DIALOG_GENDRILL::TransferDataFromWindow()
bool DIALOG_GENDRILL::TransferDataToWindow()
{
initDialog();
return true;
}
void DIALOG_GENDRILL::initDialog()
{
if( m_job )
{
SetTitle( m_job->GetSettingsDialogTitle() );
}
else
{
auto cfg = m_pcbEditFrame->GetPcbNewSettings();
m_Merge_PTH_NPTH = cfg->m_GenDrill.merge_pth_npth;
m_MinimalHeader = cfg->m_GenDrill.minimal_header;
m_Mirror = cfg->m_GenDrill.mirror;
m_UnitDrillIsInch = cfg->m_GenDrill.unit_drill_is_inch;
m_UseRouteModeForOvalHoles = cfg->m_GenDrill.use_route_for_oval_holes;
m_drillFileType = cfg->m_GenDrill.drill_file_type;
m_mapFileType = cfg->m_GenDrill.map_file_type;
m_ZerosFormat = cfg->m_GenDrill.zeros_format;
m_GenerateMap = cfg->m_GenDrill.generate_map;
// Ensure validity of m_mapFileType
if( m_mapFileType < 0 || m_mapFileType >= (int) m_choiceDrillMap->GetCount() )
m_mapFileType = m_choiceDrillMap->GetCount() - 1; // last item in list = default = PDF
}
// DIALOG_SHIM needs a unique hash_key because classname will be the same for both job and
// non-job versions (which have different sizes).
m_hash_key = TO_UTF8( GetTitle() );
m_drillOriginIsAuxAxis = m_plotOpts.GetUseAuxOrigin();
InitDisplayParams();
}
void DIALOG_GENDRILL::InitDisplayParams()
{
if( !m_job )
{
m_browseButton->SetBitmap( KiBitmapBundle( BITMAPS::small_folder ) );
m_rbExcellon->SetValue( m_drillFileType == 0 );
m_rbGerberX2->SetValue( m_drillFileType == 1 );
m_units->SetSelection( m_UnitDrillIsInch ? 1 : 0 );
m_zeros->SetSelection( m_ZerosFormat );
UpdatePrecisionOptions();
m_Check_Minimal->SetValue( m_MinimalHeader );
m_rbExcellon->SetValue( g_drillFileType == 0 );
m_rbGerberX2->SetValue( g_drillFileType == 1 );
m_units->SetSelection( g_unitDrillIsInch ? 1 : 0 );
m_zeros->SetSelection( g_zerosFormat );
updatePrecisionOptions();
m_Check_Minimal->SetValue( g_minimalHeader );
m_origin->SetSelection( m_drillOriginIsAuxAxis ? 1 : 0 );
m_Check_Mirror->SetValue( m_Mirror );
m_Check_Merge_PTH_NPTH->SetValue( m_Merge_PTH_NPTH );
m_choiceDrillMap->SetSelection( m_mapFileType );
m_altDrillMode->SetValue( !m_UseRouteModeForOvalHoles );
m_cbGenerateMap->SetValue( m_GenerateMap );
m_Check_Mirror->SetValue( g_mirror );
m_Check_Merge_PTH_NPTH->SetValue( g_merge_PTH_NPTH );
m_choiceDrillMap->SetSelection( g_mapFileType );
m_altDrillMode->SetValue( !g_useRouteModeForOvalHoles );
m_cbGenerateMap->SetValue( g_generateMap );
// Output directory
m_outputDirectoryName->SetValue( m_plotOpts.GetOutputDirectory() );
@ -226,7 +184,7 @@ void DIALOG_GENDRILL::InitDisplayParams()
m_rbGerberX2->SetValue( m_job->m_format == JOB_EXPORT_PCB_DRILL::DRILL_FORMAT::GERBER );
m_units->SetSelection( m_job->m_drillUnits == JOB_EXPORT_PCB_DRILL::DRILL_UNITS::INCHES );
m_zeros->SetSelection( static_cast<int>( m_job->m_zeroFormat ) );
UpdatePrecisionOptions();
updatePrecisionOptions();
m_Check_Minimal->SetValue( m_job->m_excellonMinimalHeader );
m_origin->SetSelection( m_job->m_drillOrigin == JOB_EXPORT_PCB_DRILL::DRILL_ORIGIN::PLOT );
@ -240,6 +198,40 @@ void DIALOG_GENDRILL::InitDisplayParams()
wxCommandEvent dummy;
onFileFormatSelection( dummy );
return true;
}
void DIALOG_GENDRILL::initDialog()
{
if( m_job )
{
SetTitle( m_job->GetSettingsDialogTitle() );
}
else
{
auto cfg = m_pcbEditFrame->GetPcbNewSettings();
g_merge_PTH_NPTH = cfg->m_GenDrill.merge_pth_npth;
g_minimalHeader = cfg->m_GenDrill.minimal_header;
g_mirror = cfg->m_GenDrill.mirror;
g_unitDrillIsInch = cfg->m_GenDrill.unit_drill_is_inch;
g_useRouteModeForOvalHoles = cfg->m_GenDrill.use_route_for_oval_holes;
g_drillFileType = cfg->m_GenDrill.drill_file_type;
g_mapFileType = cfg->m_GenDrill.map_file_type;
g_zerosFormat = cfg->m_GenDrill.zeros_format;
g_generateMap = cfg->m_GenDrill.generate_map;
// Ensure validity of g_mapFileType
if( g_mapFileType < 0 || g_mapFileType >= (int) m_choiceDrillMap->GetCount() )
g_mapFileType = m_choiceDrillMap->GetCount() - 1; // last item in list = default = PDF
}
// DIALOG_SHIM needs a unique hash_key because classname will be the same for both job and
// non-job versions (which have different sizes).
m_hash_key = TO_UTF8( GetTitle() );
m_drillOriginIsAuxAxis = m_plotOpts.GetUseAuxOrigin();
}
@ -247,7 +239,7 @@ void DIALOG_GENDRILL::onFileFormatSelection( wxCommandEvent& event )
{
bool enbl_Excellon = m_rbExcellon->GetValue();
m_drillFileType = enbl_Excellon ? 0 : 1;
g_drillFileType = enbl_Excellon ? 0 : 1;
m_unitsLabel->Enable( enbl_Excellon );
m_units->Enable( enbl_Excellon );
@ -260,7 +252,7 @@ void DIALOG_GENDRILL::onFileFormatSelection( wxCommandEvent& event )
if( enbl_Excellon )
{
UpdatePrecisionOptions();
updatePrecisionOptions();
}
else
{
@ -272,37 +264,37 @@ void DIALOG_GENDRILL::onFileFormatSelection( wxCommandEvent& event )
}
void DIALOG_GENDRILL::UpdateConfig()
void DIALOG_GENDRILL::updateConfig()
{
UpdateDrillParams();
auto cfg = m_pcbEditFrame->GetPcbNewSettings();
cfg->m_GenDrill.merge_pth_npth = m_Merge_PTH_NPTH;
cfg->m_GenDrill.minimal_header = m_MinimalHeader;
cfg->m_GenDrill.mirror = m_Mirror;
cfg->m_GenDrill.unit_drill_is_inch = m_UnitDrillIsInch;
cfg->m_GenDrill.use_route_for_oval_holes = m_UseRouteModeForOvalHoles;
cfg->m_GenDrill.drill_file_type = m_drillFileType;
cfg->m_GenDrill.map_file_type = m_mapFileType;
cfg->m_GenDrill.zeros_format = m_ZerosFormat;
cfg->m_GenDrill.generate_map = m_GenerateMap;
PCBNEW_SETTINGS* cfg = m_pcbEditFrame->GetPcbNewSettings();
cfg->m_GenDrill.merge_pth_npth = g_merge_PTH_NPTH;
cfg->m_GenDrill.minimal_header = g_minimalHeader;
cfg->m_GenDrill.mirror = g_mirror;
cfg->m_GenDrill.unit_drill_is_inch = g_unitDrillIsInch;
cfg->m_GenDrill.use_route_for_oval_holes = g_useRouteModeForOvalHoles;
cfg->m_GenDrill.drill_file_type = g_drillFileType;
cfg->m_GenDrill.map_file_type = g_mapFileType;
cfg->m_GenDrill.zeros_format = g_zerosFormat;
cfg->m_GenDrill.generate_map = g_generateMap;
}
void DIALOG_GENDRILL::OnSelDrillUnitsSelected( wxCommandEvent& event )
void DIALOG_GENDRILL::onSelDrillUnitsSelected( wxCommandEvent& event )
{
UpdatePrecisionOptions();
updatePrecisionOptions();
}
void DIALOG_GENDRILL::OnSelZerosFmtSelected( wxCommandEvent& event )
void DIALOG_GENDRILL::onSelZerosFmtSelected( wxCommandEvent& event )
{
UpdatePrecisionOptions();
updatePrecisionOptions();
}
void DIALOG_GENDRILL::UpdatePrecisionOptions()
void DIALOG_GENDRILL::updatePrecisionOptions()
{
if( m_units->GetSelection() == 1 )
{
@ -328,7 +320,7 @@ void DIALOG_GENDRILL::UpdatePrecisionOptions()
}
void DIALOG_GENDRILL::OnOutputDirectoryBrowseClicked( wxCommandEvent& event )
void DIALOG_GENDRILL::onOutputDirectoryBrowseClicked( wxCommandEvent& event )
{
// Build the absolute path of current output directory to preselect it in the file browser.
wxString path = ExpandEnvVarSubstitutions( m_outputDirectoryName->GetValue(), &Prj() );
@ -372,25 +364,25 @@ void DIALOG_GENDRILL::UpdateDrillParams()
m_drillOriginIsAuxAxis = m_origin->GetSelection() == 1;
m_plotOpts.SetUseAuxOrigin( m_drillOriginIsAuxAxis );
m_mapFileType = m_choiceDrillMap->GetSelection();
g_mapFileType = m_choiceDrillMap->GetSelection();
m_UnitDrillIsInch = ( m_units->GetSelection() == 0 ) ? false : true;
m_MinimalHeader = m_Check_Minimal->IsChecked();
m_Mirror = m_Check_Mirror->IsChecked();
m_Merge_PTH_NPTH = m_Check_Merge_PTH_NPTH->IsChecked();
m_ZerosFormat = m_zeros->GetSelection();
m_UseRouteModeForOvalHoles = !m_altDrillMode->GetValue();
m_GenerateMap = m_cbGenerateMap->IsChecked();
g_unitDrillIsInch = ( m_units->GetSelection() == 0 ) ? false : true;
g_minimalHeader = m_Check_Minimal->IsChecked();
g_mirror = m_Check_Mirror->IsChecked();
g_merge_PTH_NPTH = m_Check_Merge_PTH_NPTH->IsChecked();
g_zerosFormat = m_zeros->GetSelection();
g_useRouteModeForOvalHoles = !m_altDrillMode->GetValue();
g_generateMap = m_cbGenerateMap->IsChecked();
if( m_origin->GetSelection() == 0 )
m_DrillFileOffset = VECTOR2I( 0, 0 );
g_drillFileOffset = VECTOR2I( 0, 0 );
else
m_DrillFileOffset = m_board->GetDesignSettings().GetAuxOrigin();
g_drillFileOffset = m_board->GetDesignSettings().GetAuxOrigin();
if( m_UnitDrillIsInch )
m_Precision = precisionListForInches;
if( g_unitDrillIsInch )
g_precision = precisionListForInches;
else
m_Precision = precisionListForMetric;
g_precision = precisionListForMetric;
if( !m_plotOpts.IsSameAs( m_board->GetPlotOptions() ) )
{
@ -400,9 +392,9 @@ void DIALOG_GENDRILL::UpdateDrillParams()
}
void DIALOG_GENDRILL::GenDrillAndMapFiles( bool aGenDrill, bool aGenMap )
void DIALOG_GENDRILL::genDrillAndMapFiles( bool aGenDrill, bool aGenMap )
{
UpdateConfig(); // set params and Save drill options
updateConfig(); // set params and Save drill options
m_pcbEditFrame->ClearMsgPanel();
WX_TEXT_CTRL_REPORTER reporter( m_messagesBox );
@ -447,13 +439,13 @@ void DIALOG_GENDRILL::GenDrillAndMapFiles( bool aGenDrill, bool aGenMap )
return;
}
if( m_drillFileType == 0 )
if( g_drillFileType == 0 )
{
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_DrillFileOffset, m_Merge_PTH_NPTH );
excellonWriter.SetRouteModeForOvalHoles( m_UseRouteModeForOvalHoles );
excellonWriter.SetFormat( !g_unitDrillIsInch, (EXCELLON_WRITER::ZEROS_FMT) g_zerosFormat,
g_precision.m_Lhs, g_precision.m_Rhs );
excellonWriter.SetOptions( g_mirror, g_minimalHeader, g_drillFileOffset, g_merge_PTH_NPTH );
excellonWriter.SetRouteModeForOvalHoles( g_useRouteModeForOvalHoles );
excellonWriter.SetMapFileFormat( filefmt[choice] );
excellonWriter.CreateDrillandMapFilesSet( outputDir.GetFullPath(), aGenDrill, aGenMap,
@ -466,7 +458,7 @@ 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_DrillFileOffset );
gerberWriter.SetOptions( g_drillFileOffset );
gerberWriter.SetMapFileFormat( filefmt[choice] );
gerberWriter.CreateDrillandMapFilesSet( outputDir.GetFullPath(), aGenDrill, aGenMap,
@ -475,9 +467,9 @@ void DIALOG_GENDRILL::GenDrillAndMapFiles( bool aGenDrill, bool aGenMap )
}
void DIALOG_GENDRILL::OnGenReportFile( wxCommandEvent& event )
void DIALOG_GENDRILL::onGenReportFile( wxCommandEvent& event )
{
UpdateConfig(); // set params and Save drill options
updateConfig(); // set params and Save drill options
wxFileName fn = m_board->GetFileName();
@ -500,10 +492,10 @@ void DIALOG_GENDRILL::OnGenReportFile( wxCommandEvent& event )
// Info is slightly different between Excellon and Gerber
// (file ext, Merge PTH/NPTH option)
if( m_drillFileType == 0 )
if( g_drillFileType == 0 )
{
EXCELLON_WRITER excellonWriter( m_board );
excellonWriter.SetMergeOption( m_Merge_PTH_NPTH );
excellonWriter.SetMergeOption( g_merge_PTH_NPTH );
success = excellonWriter.GenDrillReportFile( dlg.GetPath() );
}
else

47
pcbnew/dialogs/dialog_gendrill.h

@ -51,11 +51,10 @@ public:
private:
void initDialog();
void InitDisplayParams();
// event functions
void OnSelDrillUnitsSelected( wxCommandEvent& event ) override;
void OnSelZerosFmtSelected( wxCommandEvent& event ) override;
void onSelDrillUnitsSelected( wxCommandEvent& event ) override;
void onSelZerosFmtSelected( wxCommandEvent& event ) override;
void onFileFormatSelection( wxCommandEvent& event ) override;
// Called when closing the dialog: Update config.
@ -63,7 +62,7 @@ private:
// could happen too late for the caller.
void onCloseDlg( wxCloseEvent& event ) override
{
UpdateConfig();
updateConfig();
event.Skip();
}
@ -72,9 +71,9 @@ private:
* for through holes, oblong holes, and for buried vias,
* drill values and drill count per layer pair
*/
void OnGenReportFile( wxCommandEvent& event ) override;
void onGenReportFile( wxCommandEvent& event ) override;
void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) override;
void onOutputDirectoryBrowseClicked( wxCommandEvent& event ) override;
// Specific functions:
/**
@ -85,23 +84,25 @@ private:
* plated through holes, and one file per layer pair, which have one or more holes, excluding
* through holes, already in the first file. One file for all Not Plated through holes.
*/
void GenDrillAndMapFiles( bool aGenDrill, bool aGenMap );
void genDrillAndMapFiles( bool aGenDrill, bool aGenMap );
void UpdatePrecisionOptions();
void UpdateConfig();
void updatePrecisionOptions();
void updateConfig();
public:
static int m_UnitDrillIsInch;
static int m_ZerosFormat;
static bool m_MinimalHeader;
static bool m_Mirror;
static bool m_Merge_PTH_NPTH;
static bool m_GenerateMap;
DRILL_PRECISION m_Precision; // Precision for drill files, in non decimal format
VECTOR2I 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
private:
static int g_unitDrillIsInch;
static int g_zerosFormat;
static bool g_minimalHeader;
static bool g_mirror;
static bool g_merge_PTH_NPTH;
static bool g_generateMap;
static DRILL_PRECISION g_precision; // Precision for drill files in non-decimal
// format
static VECTOR2I g_drillFileOffset; // Drill offset: 0,0 for absolute
// coordinates, or aux origin
static bool g_useRouteModeForOvalHoles; // True to use a G00 route command for
// oval holes; false to use a G85 canned
// mode for oval holes
private:
PCB_EDIT_FRAME* m_pcbEditFrame;
@ -111,8 +112,8 @@ private:
bool m_drillOriginIsAuxAxis; // Axis selection (main / auxiliary)
// for drill origin coordinates
static int m_mapFileType; // format of map file: HPGL, PS ...
static int m_drillFileType; // for Excellon, Gerber
static int g_mapFileType; // format of map file: HPGL, PS ...
static int g_drillFileType; // for Excellon, Gerber
};
#endif // DIALOG_GENDRILL_H_

20
pcbnew/dialogs/dialog_gendrill_base.cpp

@ -28,7 +28,7 @@ DIALOG_GENDRILL_BASE::DIALOG_GENDRILL_BASE( wxWindow* parent, wxWindowID id, con
bupperSizer->Add( m_outputDirectoryName, 1, wxALIGN_CENTER_VERTICAL|wxLEFT, 0 );
m_browseButton = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW|0 );
bupperSizer->Add( m_browseButton, 0, wxALIGN_CENTER_VERTICAL, 7 );
bupperSizer->Add( m_browseButton, 0, wxALIGN_CENTER_VERTICAL, 5 );
bMainSizer->Add( bupperSizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 10 );
@ -109,7 +109,7 @@ DIALOG_GENDRILL_BASE::DIALOG_GENDRILL_BASE( wxWindow* parent, wxWindowID id, con
bmiddlerSizer->Add( bLeftCol, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
bmiddlerSizer->Add( 10, 0, 0, 0, 5 );
bmiddlerSizer->Add( 15, 0, 0, 0, 5 );
wxBoxSizer* bRightCol;
bRightCol = new wxBoxSizer( wxVERTICAL );
@ -216,23 +216,23 @@ DIALOG_GENDRILL_BASE::DIALOG_GENDRILL_BASE( wxWindow* parent, wxWindowID id, con
// Connect Events
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_GENDRILL_BASE::onCloseDlg ) );
m_browseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnOutputDirectoryBrowseClicked ), NULL, this );
m_browseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::onOutputDirectoryBrowseClicked ), NULL, this );
m_rbExcellon->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::onFileFormatSelection ), NULL, this );
m_rbGerberX2->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::onFileFormatSelection ), NULL, this );
m_units->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnSelDrillUnitsSelected ), NULL, this );
m_zeros->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnSelZerosFmtSelected ), NULL, this );
m_buttonReport->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnGenReportFile ), NULL, this );
m_units->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::onSelDrillUnitsSelected ), NULL, this );
m_zeros->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::onSelZerosFmtSelected ), NULL, this );
m_buttonReport->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::onGenReportFile ), NULL, this );
}
DIALOG_GENDRILL_BASE::~DIALOG_GENDRILL_BASE()
{
// Disconnect Events
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_GENDRILL_BASE::onCloseDlg ) );
m_browseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnOutputDirectoryBrowseClicked ), NULL, this );
m_browseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::onOutputDirectoryBrowseClicked ), NULL, this );
m_rbExcellon->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::onFileFormatSelection ), NULL, this );
m_rbGerberX2->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::onFileFormatSelection ), NULL, this );
m_units->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnSelDrillUnitsSelected ), NULL, this );
m_zeros->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnSelZerosFmtSelected ), NULL, this );
m_buttonReport->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::OnGenReportFile ), NULL, this );
m_units->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::onSelDrillUnitsSelected ), NULL, this );
m_zeros->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::onSelZerosFmtSelected ), NULL, this );
m_buttonReport->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GENDRILL_BASE::onGenReportFile ), NULL, this );
}

12
pcbnew/dialogs/dialog_gendrill_base.fbp

@ -202,7 +202,7 @@
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">7</property>
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxBitmapButton" expanded="true">
@ -273,7 +273,7 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnOutputDirectoryBrowseClicked</event>
<event name="OnButtonClick">onOutputDirectoryBrowseClicked</event>
</object>
</object>
</object>
@ -1008,7 +1008,7 @@
<object class="spacer" expanded="true">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">10</property>
<property name="width">15</property>
</object>
</object>
<object class="sizeritem" expanded="true">
@ -1409,7 +1409,7 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChoice">OnSelDrillUnitsSelected</event>
<event name="OnChoice">onSelDrillUnitsSelected</event>
</object>
</object>
<object class="sizeritem" expanded="true">
@ -1537,7 +1537,7 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChoice">OnSelZerosFmtSelected</event>
<event name="OnChoice">onSelZerosFmtSelected</event>
</object>
</object>
<object class="sizeritem" expanded="true">
@ -1850,7 +1850,7 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnGenReportFile</event>
<event name="OnButtonClick">onGenReportFile</event>
</object>
</object>
<object class="sizeritem" expanded="true">

8
pcbnew/dialogs/dialog_gendrill_base.h

@ -77,11 +77,11 @@ class DIALOG_GENDRILL_BASE : public DIALOG_SHIM
// Virtual event handlers, override them in your derived class
virtual void onCloseDlg( wxCloseEvent& event ) { event.Skip(); }
virtual void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) { event.Skip(); }
virtual void onOutputDirectoryBrowseClicked( wxCommandEvent& event ) { event.Skip(); }
virtual void onFileFormatSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSelDrillUnitsSelected( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSelZerosFmtSelected( wxCommandEvent& event ) { event.Skip(); }
virtual void OnGenReportFile( wxCommandEvent& event ) { event.Skip(); }
virtual void onSelDrillUnitsSelected( wxCommandEvent& event ) { event.Skip(); }
virtual void onSelZerosFmtSelected( wxCommandEvent& event ) { event.Skip(); }
virtual void onGenReportFile( wxCommandEvent& event ) { event.Skip(); }
public:

2
pcbnew/dialogs/dialog_plot_base.fbp

@ -399,7 +399,7 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnOutputDirectoryBrowseClicked</event>
<event name="OnButtonClick">onOutputDirectoryBrowseClicked</event>
</object>
</object>
<object class="sizeritem" expanded="true">

Loading…
Cancel
Save