Commit 8031e512 authored by jean-pierre charras's avatar jean-pierre charras

Dialog drill file: remove precision choice, because only one choice was acceptable

(the option with the smallest number of digits for coordinates created unacceptable truncation coordinates in Excellon drill files)
parent c41bb774
......@@ -51,18 +51,9 @@
// list of allowed precision for EXCELLON files, for integer format:
// Due to difference between inches and mm,
// there are 2 set of reasonnable precision values, one for inches and one for metric
static DRILL_PRECISION precisionListForInches[] =
{
DRILL_PRECISION( 2, 3 ), DRILL_PRECISION( 2, 4 )
};
static DRILL_PRECISION precisionListForMetric[] =
{
DRILL_PRECISION( 3, 2 ), DRILL_PRECISION( 3, 3 )
};
// there are 2 precision values, one for inches and one for metric
static DRILL_PRECISION precisionListForInches( 2, 4 );
static DRILL_PRECISION precisionListForMetric( 3, 3 );
/* This function displays the dialog frame for drill tools
......@@ -96,7 +87,6 @@ int DIALOG_GENDRILL::m_ZerosFormat = EXCELLON_WRITER::DECIMAL_FORMAT;
bool DIALOG_GENDRILL::m_MinimalHeader = false;
bool DIALOG_GENDRILL::m_Mirror = false;
bool DIALOG_GENDRILL::m_DrillOriginIsAuxAxis = false;
int DIALOG_GENDRILL::m_PrecisionFormat = 1;
int DIALOG_GENDRILL::m_mapFileType = 1;
......@@ -109,7 +99,6 @@ DIALOG_GENDRILL::~DIALOG_GENDRILL()
void DIALOG_GENDRILL::initDialog()
{
m_config->Read( ZerosFormatKey, &DIALOG_GENDRILL::m_ZerosFormat );
m_config->Read( PrecisionKey, &DIALOG_GENDRILL::m_PrecisionFormat );
m_config->Read( MirrorKey, &DIALOG_GENDRILL::m_Mirror );
m_config->Read( MinimalHeaderKey, &DIALOG_GENDRILL::m_MinimalHeader );
m_config->Read( UnitDrillInchKey, &DIALOG_GENDRILL::m_UnitDrillIsInch );
......@@ -124,12 +113,8 @@ void DIALOG_GENDRILL::InitDisplayParams()
wxString msg;
m_Choice_Unit->SetSelection( m_UnitDrillIsInch ? 1 : 0 );
m_Choice_Precision->SetSelection( m_PrecisionFormat );
m_Choice_Zeros_Format->SetSelection( m_ZerosFormat );
if( m_ZerosFormat == EXCELLON_WRITER::DECIMAL_FORMAT )
m_Choice_Precision->Enable( false );
UpdatePrecisionOptions();
m_Check_Minimal->SetValue( m_MinimalHeader );
......@@ -228,7 +213,6 @@ void DIALOG_GENDRILL::UpdateConfig()
SetParams();
m_config->Write( ZerosFormatKey, m_ZerosFormat );
m_config->Write( PrecisionKey, m_PrecisionFormat );
m_config->Write( MirrorKey, m_Mirror );
m_config->Write( MinimalHeaderKey, m_MinimalHeader );
m_config->Write( UnitDrillInchKey, m_UnitDrillIsInch );
......@@ -268,22 +252,17 @@ void DIALOG_GENDRILL::OnSelZerosFmtSelected( wxCommandEvent& event )
void DIALOG_GENDRILL::UpdatePrecisionOptions()
{
if( m_Choice_Unit->GetSelection()== 1 ) // Units = inches
{
// inch options
m_Choice_Precision->SetString( 0, precisionListForInches[0].GetPrecisionString() );
m_Choice_Precision->SetString( 1, precisionListForInches[1].GetPrecisionString() );
}
m_staticTextPrecision->SetLabel( precisionListForInches.GetPrecisionString() );
else
{
// metric options
m_Choice_Precision->SetString( 0, precisionListForMetric[0].GetPrecisionString() );
m_Choice_Precision->SetString( 1, precisionListForMetric[1].GetPrecisionString() );
m_staticTextPrecision->SetLabel( precisionListForMetric.GetPrecisionString() );
}
if( m_Choice_Zeros_Format->GetSelection() == EXCELLON_WRITER::DECIMAL_FORMAT )
m_Choice_Precision->Enable( false );
m_staticTextPrecision->Enable( false );
else
m_Choice_Precision->Enable( true );
m_staticTextPrecision->Enable( true );
}
void DIALOG_GENDRILL::OnOutputDirectoryBrowseClicked( wxCommandEvent& event )
......@@ -339,20 +318,16 @@ void DIALOG_GENDRILL::SetParams()
m_Mirror = m_Check_Mirror->IsChecked();
m_ZerosFormat = m_Choice_Zeros_Format->GetSelection();
m_DrillOriginIsAuxAxis = m_Choice_Drill_Offset->GetSelection();
m_PrecisionFormat = m_Choice_Precision->GetSelection();
if( m_Choice_Drill_Offset->GetSelection() == 0 )
m_FileDrillOffset = wxPoint( 0, 0 );
else
m_FileDrillOffset = m_parent->GetOriginAxisPosition();
// get precision
int idx = m_Choice_Precision->GetSelection();
if( m_UnitDrillIsInch )
m_Precision = precisionListForInches[idx];
m_Precision = precisionListForInches;
else
m_Precision = precisionListForMetric[idx];
m_Precision = precisionListForMetric;
m_board->SetPlotOptions( m_plotOpts );
}
......
......@@ -39,7 +39,6 @@ public:
static int m_UnitDrillIsInch;
static int m_ZerosFormat;
static int m_PrecisionFormat;
static bool m_MinimalHeader;
static bool m_Mirror;
static bool m_DrillOriginIsAuxAxis; /* Axis selection (main / auxiliary)
......
......@@ -54,13 +54,15 @@ DIALOG_GENDRILL_BASE::DIALOG_GENDRILL_BASE( wxWindow* parent, wxWindowID id, con
m_LeftBoxSizer->Add( m_Choice_Zeros_Format, 0, wxALL|wxEXPAND, 5 );
wxString m_Choice_PrecisionChoices[] = { _("2:3"), _("2:4") };
int m_Choice_PrecisionNChoices = sizeof( m_Choice_PrecisionChoices ) / sizeof( wxString );
m_Choice_Precision = new wxRadioBox( this, wxID_ANY, _("Precision"), wxDefaultPosition, wxDefaultSize, m_Choice_PrecisionNChoices, m_Choice_PrecisionChoices, 1, wxRA_SPECIFY_COLS );
m_Choice_Precision->SetSelection( 1 );
m_Choice_Precision->SetToolTip( _("Choose EXCELLON numbers precision") );
wxStaticBoxSizer* sbSizerPrecision;
sbSizerPrecision = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Precision") ), wxVERTICAL );
m_LeftBoxSizer->Add( m_Choice_Precision, 0, wxALL|wxEXPAND, 5 );
m_staticTextPrecision = new wxStaticText( this, wxID_ANY, _("Precision"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextPrecision->Wrap( -1 );
sbSizerPrecision->Add( m_staticTextPrecision, 0, wxALL, 5 );
m_LeftBoxSizer->Add( sbSizerPrecision, 0, wxEXPAND, 5 );
bmiddlerSizer->Add( m_LeftBoxSizer, 0, wxEXPAND, 5 );
......@@ -166,10 +168,10 @@ DIALOG_GENDRILL_BASE::DIALOG_GENDRILL_BASE( wxWindow* parent, wxWindowID id, con
bSizerButtons->Add( m_buttonDrill, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
m_buttonMap = new wxButton( this, wxID_ANY, _("Map File"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtons->Add( m_buttonMap, 0, wxALL, 5 );
bSizerButtons->Add( m_buttonMap, 0, wxALL|wxEXPAND, 5 );
m_buttonReport = new wxButton( this, wxID_ANY, _("Report File"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtons->Add( m_buttonReport, 0, wxALL, 5 );
bSizerButtons->Add( m_buttonReport, 0, wxALL|wxEXPAND, 5 );
m_CancelButton = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtons->Add( m_CancelButton, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
......
This diff is collapsed.
......@@ -22,8 +22,8 @@
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/radiobox.h>
#include <wx/checkbox.h>
#include <wx/stattext.h>
#include <wx/checkbox.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
......@@ -42,7 +42,7 @@ class DIALOG_GENDRILL_BASE : public DIALOG_SHIM
wxButton* m_buttonBrowse;
wxRadioBox* m_Choice_Unit;
wxRadioBox* m_Choice_Zeros_Format;
wxRadioBox* m_Choice_Precision;
wxStaticText* m_staticTextPrecision;
wxRadioBox* m_Choice_Drill_Map;
wxCheckBox* m_Check_Mirror;
wxCheckBox* m_Check_Minimal;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment