From d57f5b1a2cc3c0adf0f433e7dcdc7f9fbc09c958 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 5 Mar 2021 20:41:21 +0100 Subject: [PATCH] DIALOG_GENDRILL: fix incorrect initialization of drill coord origin option Fix also missing board change mark when drill plot settings are modified. --- pcbnew/dialogs/dialog_gendrill.cpp | 21 ++++++++++++--------- pcbnew/dialogs/dialog_gendrill_base.cpp | 4 ++-- pcbnew/dialogs/dialog_gendrill_base.fbp | 6 +----- pcbnew/dialogs/dialog_gendrill_base.h | 2 +- 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/pcbnew/dialogs/dialog_gendrill.cpp b/pcbnew/dialogs/dialog_gendrill.cpp index b158f62c19..ae85bc140f 100644 --- a/pcbnew/dialogs/dialog_gendrill.cpp +++ b/pcbnew/dialogs/dialog_gendrill.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 1992-2019 Jean_Pierre Charras - * Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -127,8 +127,7 @@ void DIALOG_GENDRILL::InitDisplayParams() UpdatePrecisionOptions(); m_Check_Minimal->SetValue( m_MinimalHeader ); - if( m_drillOriginIsAuxAxis ) - m_Choice_Drill_Offset->SetSelection( 1 ); + m_Choice_Drill_Offset->SetSelection( m_drillOriginIsAuxAxis ? 1 : 0 ); m_Check_Mirror->SetValue( m_Mirror ); m_Check_Merge_PTH_NPTH->SetValue( m_Merge_PTH_NPTH ); @@ -185,11 +184,11 @@ void DIALOG_GENDRILL::InitDisplayParams() } // Display hole counts: - m_PlatedPadsCountInfoMsg-> SetLabel( wxString() << m_platedPadsHoleCount ); + m_PlatedPadsCountInfoMsg->SetLabel( wxString() << m_platedPadsHoleCount ); m_NotPlatedPadsCountInfoMsg->SetLabel( wxString() << m_notplatedPadsHoleCount ); - m_ThroughViasInfoMsg-> SetLabel( wxString() << m_throughViasCount ); - m_MicroViasInfoMsg-> SetLabel( wxString() << m_microViasCount ); - m_BuriedViasInfoMsg-> SetLabel( wxString() << m_blindOrBuriedViasCount ); + m_ThroughViasInfoMsg->SetLabel( wxString() << m_throughViasCount ); + m_MicroViasInfoMsg->SetLabel( wxString() << m_microViasCount ); + m_BuriedViasInfoMsg->SetLabel( wxString() << m_blindOrBuriedViasCount ); // Output directory m_outputDirectoryName->SetValue( m_plotOpts.GetOutputDirectory() ); @@ -323,7 +322,7 @@ void DIALOG_GENDRILL::UpdateDrillParams() dirStr = m_outputDirectoryName->GetValue(); dirStr.Replace( wxT( "\\" ), wxT( "/" ) ); m_plotOpts.SetOutputDirectory( dirStr ); - m_drillOriginIsAuxAxis = m_Choice_Drill_Offset->GetSelection(); + m_drillOriginIsAuxAxis = m_Choice_Drill_Offset->GetSelection() == 1; m_plotOpts.SetUseAuxOrigin( m_drillOriginIsAuxAxis ); m_mapFileType = m_Choice_Drill_Map->GetSelection(); @@ -345,7 +344,11 @@ void DIALOG_GENDRILL::UpdateDrillParams() else m_Precision = precisionListForMetric; - m_board->SetPlotOptions( m_plotOpts ); + if( !m_plotOpts.IsSameAs( m_board->GetPlotOptions() ) ) + { + m_board->SetPlotOptions( m_plotOpts ); + m_pcbEditFrame->OnModify(); + } } diff --git a/pcbnew/dialogs/dialog_gendrill_base.cpp b/pcbnew/dialogs/dialog_gendrill_base.cpp index ef44fa31c5..0cbe5dacbf 100644 --- a/pcbnew/dialogs/dialog_gendrill_base.cpp +++ b/pcbnew/dialogs/dialog_gendrill_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.9.0 Nov 1 2020) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -96,7 +96,7 @@ DIALOG_GENDRILL_BASE::DIALOG_GENDRILL_BASE( wxWindow* parent, wxWindowID id, con wxString m_Choice_Drill_OffsetChoices[] = { _("Absolute"), _("Drill/place file origin") }; int m_Choice_Drill_OffsetNChoices = sizeof( m_Choice_Drill_OffsetChoices ) / sizeof( wxString ); m_Choice_Drill_Offset = new wxRadioBox( this, wxID_ANY, _("Drill Origin"), wxDefaultPosition, wxDefaultSize, m_Choice_Drill_OffsetNChoices, m_Choice_Drill_OffsetChoices, 1, wxRA_SPECIFY_COLS ); - m_Choice_Drill_Offset->SetSelection( 1 ); + m_Choice_Drill_Offset->SetSelection( 0 ); m_Choice_Drill_Offset->SetToolTip( _("Choose the coordinate origin: absolute or relative to the drill/place file origin") ); bLeftSizer->Add( m_Choice_Drill_Offset, 0, wxALL|wxEXPAND, 5 ); diff --git a/pcbnew/dialogs/dialog_gendrill_base.fbp b/pcbnew/dialogs/dialog_gendrill_base.fbp index 92722f7547..30c9c497a8 100644 --- a/pcbnew/dialogs/dialog_gendrill_base.fbp +++ b/pcbnew/dialogs/dialog_gendrill_base.fbp @@ -14,7 +14,6 @@ dialog_gendrill_base 1000 none - 1 dialog_gendrill_base @@ -26,7 +25,6 @@ 1 1 UI - 0 0 0 @@ -208,7 +206,6 @@ - 0 @@ -829,7 +826,7 @@ 1 Resizable - 1 + 0 1 wxRA_SPECIFY_COLS @@ -1876,7 +1873,6 @@ - 0 diff --git a/pcbnew/dialogs/dialog_gendrill_base.h b/pcbnew/dialogs/dialog_gendrill_base.h index cc7682ea55..7dc718f948 100644 --- a/pcbnew/dialogs/dialog_gendrill_base.h +++ b/pcbnew/dialogs/dialog_gendrill_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.9.0 Nov 1 2020) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE!