KiCad PCB EDA Suite
dialog_pns_diff_pair_dimensions.cpp
Go to the documentation of this file.
1 /*
2  * KiRouter - a push-and-(sometimes-)shove PCB router
3  *
4  * Copyright (C) 2014-2015 CERN
5  * Copyright (C) 2016 KiCad Developers, see AUTHORS.txt for contributors.
6  * Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
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.org/licenses/>.
20  */
21 
28 
31  m_traceWidth( this, m_traceWidthText, m_traceWidthUnit ),
32  m_traceGap( this, m_traceGapText, m_traceGapUnit ),
33  m_viaGap( this, m_viaGapText, m_viaGapUnit ),
34  m_sizes( aSizes )
35 {
37  m_traceGap.SetValue( aSizes.DiffPairGap() );
38  m_viaGap.SetValue( aSizes.DiffPairViaGap() );
40 
42 
43  GetSizer()->SetSizeHints(this);
44  Centre();
45 }
46 
47 
49 {
50  if( m_viaTraceGapEqual->GetValue() )
51  {
53  m_viaGapText->Disable();
54  m_viaGapLabel->Disable();
55  m_viaGapUnit->Disable();
56  }
57  else
58  {
60  m_viaGapText->Enable();
61  m_viaGapLabel->Enable();
62  m_viaGapUnit->Enable();
63  }
64 }
65 
66 
67 void DIALOG_PNS_DIFF_PAIR_DIMENSIONS::OnOkClick( wxCommandEvent& aEvent )
68 {
69  // Save widgets' values to settings
73 
74  // todo: verify against design rules
75  EndModal( wxID_OK );
76 }
77 
78 
80 {
81  event.Skip();
83 }
84 
void SetDiffPairViaGapSameAsTraceGap(bool aEnable)
DIALOG_PNS_DIFF_PAIR_DIMENSIONS(wxWindow *aParent, PNS::SIZES_SETTINGS &aSizes)
Push and Shove diff pair dimensions (gap) settings dialog.
void SetDiffPairViaGap(int aGap)
virtual void SetValue(int aValue)
Function SetValue Sets new value (in Internal Units) for the text field, taking care of units convers...
int DiffPairViaGap() const
virtual void OnViaTraceGapEqualCheck(wxCommandEvent &event) override
virtual int GetValue() const
Function GetValue Returns the current value in Internal Units.
Class DIALOG_PNS_DIFF_PAIR_DIMENSIONS_BASE.
virtual void OnOkClick(wxCommandEvent &aEvent) override
bool DiffPairViaGapSameAsTraceGap() const
void SetDiffPairGap(int aGap)
int DiffPairWidth() const
void SetDiffPairWidth(int aWidth)