KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_track_via_size.cpp
Go to the documentation of this file.
1/*
2 * KiRouter - a push-and-(sometimes-)shove PCB router
3 *
4 * Copyright (C) 2014 CERN
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 * Author: Maciej Suminski <[email protected]>
7 *
8 * This program is free software: you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation, either version 3 of the License, or (at your
11 * option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program. If not, see <http://www.gnu.or/licenses/>.
20 */
21
25
27#include <base_units.h>
28#include <confirm.h>
30#include <optional>
31#include <eda_draw_frame.h>
32
34
35const int minSize = (int) ( 0.01 * pcbIUScale.IU_PER_MM );
36
50
51
53{
54 if( !wxDialog::TransferDataFromWindow() )
55 return false;
56
57 if( m_viaDrill.GetValue() >= m_viaDiameter.GetValue() )
58 {
59 DisplayError( GetParent(), _( "Via hole size must be smaller than via diameter" ) );
60 m_viaDrillText->SetFocus();
61 return false;
62 }
63
64 // Store dialog values to the router settings
65 m_settings.SetCustomTrackWidth( m_trackWidth.GetIntValue() );
66 m_settings.SetCustomViaSize( m_viaDiameter.GetIntValue() );
67 m_settings.SetCustomViaDrill( m_viaDrill.GetIntValue() );
68
69 return true;
70}
71
72
74{
75 if( !wxDialog::TransferDataToWindow() )
76 return false;
77
78 // Load router settings to dialog fields
79 m_trackWidth.SetValue( m_settings.GetCustomTrackWidth() );
80 m_viaDiameter.SetValue( m_settings.GetCustomViaSize() );
81 m_viaDrill.SetValue( m_settings.GetCustomViaDrill() );
82
83 return true;
84}
85
constexpr EDA_IU_SCALE pcbIUScale
Definition base_units.h:112
Container for design settings for a BOARD object.
void SetupStandardButtons(std::map< int, wxString > aLabels={})
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
DIALOG_TRACK_VIA_SIZE_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Track and Via Dimensions"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
DIALOG_TRACK_VIA_SIZE(EDA_DRAW_FRAME *aParent, BOARD_DESIGN_SETTINGS &aSettings)
Constructor.
BOARD_DESIGN_SETTINGS & m_settings
bool TransferDataFromWindow() override
The base class for create windows for drawing purpose.
void DisplayError(wxWindow *aParent, const wxString &aText)
Display an error or warning message box with aMessage.
Definition confirm.cpp:169
This file is part of the common library.
const int minSize
Push and Shove router track width and via size dialog.
#define _(s)