KiCad PCB EDA Suite
panel_gerbview_excellon_settings.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2021 Jean-Pierre Charras jp.charras at wanadoo.fr
5 * Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#include <pgm_base.h>
23#include <gerbview_settings.h>
24
26
27
29 PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE( aParent, wxID_ANY )
30{
31}
32
33
35{
36 GERBVIEW_SETTINGS* config = Pgm().GetSettingsManager().GetAppSettings<GERBVIEW_SETTINGS>();
37 EXCELLON_DEFAULTS curr_settings;
38 config->GetExcellonDefaults( curr_settings );
39
40 applySettingsToPanel( curr_settings );
41
42 return true;
43}
44
45
47{
48 GERBVIEW_SETTINGS* config = Pgm().GetSettingsManager().GetAppSettings<GERBVIEW_SETTINGS>();
49
50 config->m_ExcellonDefaults.m_UnitsMM = m_rbUnits->GetSelection() != 0;
51 config->m_ExcellonDefaults.m_LeadingZero = m_rbZeroFormat->GetSelection();
52 // The first value of these param is 2, not 0
53 #define FIRST_VALUE 2
54 config->m_ExcellonDefaults.m_MmIntegerLen = m_choiceIntegerMM->GetSelection()+FIRST_VALUE;
55 config->m_ExcellonDefaults.m_MmMantissaLen = m_choiceMantissaMM->GetSelection()+FIRST_VALUE;
56 config->m_ExcellonDefaults.m_InchIntegerLen = m_choiceIntegerInch->GetSelection()+FIRST_VALUE;
57 config->m_ExcellonDefaults.m_InchMantissaLen = m_choiceMantissaInch->GetSelection()+FIRST_VALUE;
58
59 return true;
60}
61
62
64{
65 EXCELLON_DEFAULTS defaults;
66 applySettingsToPanel( defaults );
67}
68
69
71{
72 m_rbUnits->SetSelection( aSettings.m_UnitsMM ? 1 : 0 );
73 m_rbZeroFormat->SetSelection( aSettings.m_LeadingZero );
74
75 // The first value of these param is 2, not 0
76 #define FIRST_VALUE 2
77 m_choiceIntegerMM->SetSelection( aSettings.m_MmIntegerLen-FIRST_VALUE );
78 m_choiceMantissaMM->SetSelection( aSettings.m_MmMantissaLen-FIRST_VALUE );
79 m_choiceIntegerInch->SetSelection( aSettings.m_InchIntegerLen-FIRST_VALUE );
80 m_choiceMantissaInch->SetSelection( aSettings.m_InchMantissaLen-FIRST_VALUE );
81}
82
Class PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE.
void ResetPanel() override
Reset the contents of this panel.
void applySettingsToPanel(const EXCELLON_DEFAULTS &aSettings)
#define FIRST_VALUE
see class PGM_BASE
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:111
management of default values used to read a Excellon (.nc) drill file Some important parameters are n...