kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #23081
PATCH: length matching tolerance
Hi guys,
This patch adds a tolerance field to the length matching dialog and set the
pns settings accordingly.
Cheers,
Mikael
PS: promise my next contributions will be by submitting branches for review
and not patch files by email
=== modified file 'pcbnew/dialogs/dialog_pns_length_tuning_settings.cpp'
--- pcbnew/dialogs/dialog_pns_length_tuning_settings.cpp 2015-05-03 18:43:07 +0000
+++ pcbnew/dialogs/dialog_pns_length_tuning_settings.cpp 2016-02-13 02:05:15 +0000
@@ -31,6 +31,7 @@
m_maxAmpl( this, m_maxAmplText, m_maxAmplUnit ),
m_spacing( this, m_spacingText, m_spacingUnit ),
m_targetLength( this, m_targetLengthText, m_targetLengthUnit ),
+ m_toleranceLength( this, m_toleranceLengthText, m_toleranceLengthUnit ),
m_settings( aSettings ),
m_mode( aMode )
{
@@ -52,12 +53,14 @@
SetTitle( _( "Single Track Length Tuning" ) );
m_legend->SetBitmap( KiBitmap( tune_single_track_length_legend_xpm ) );
m_targetLength.SetValue( m_settings.m_targetLength );
+ m_toleranceLength.SetValue( m_settings.m_lengthTolerance );
break;
case PNS_MODE_TUNE_DIFF_PAIR:
SetTitle( _( "Differential Pair Length Tuning" ) );
m_legend->SetBitmap( KiBitmap( tune_diff_pair_length_legend_xpm ) );
m_targetLength.SetValue( m_settings.m_targetLength );
+ m_toleranceLength.SetValue( m_settings.m_lengthTolerance );
break;
case PNS_MODE_TUNE_DIFF_PAIR_SKEW:
@@ -65,6 +68,7 @@
m_legend->SetBitmap( KiBitmap( tune_diff_pair_skew_legend_xpm ) );
m_targetLengthLabel->SetLabel( _( "Target skew: " ) );
m_targetLength.SetValue ( m_settings.m_targetSkew );
+ m_toleranceLength.SetValue( m_settings.m_lengthTolerance );
break;
default:
@@ -72,6 +76,7 @@
}
m_stdButtonsOK->SetDefault();
+
m_targetLengthText->SetSelection( -1, -1 );
m_targetLengthText->SetFocus();
@@ -89,10 +94,14 @@
m_settings.m_cornerRadiusPercentage = wxAtoi( m_radiusText->GetValue() );
- if( m_mode == PNS_MODE_TUNE_DIFF_PAIR_SKEW )
+ if( m_mode == PNS_MODE_TUNE_DIFF_PAIR_SKEW ){
m_settings.m_targetSkew = m_targetLength.GetValue();
- else
+ m_settings.m_lengthTolerance = m_toleranceLength.GetValue();
+ }
+ else{
m_settings.m_targetLength = m_targetLength.GetValue();
+ m_settings.m_lengthTolerance = m_toleranceLength.GetValue();
+ }
if( m_settings.m_maxAmplitude < m_settings.m_minAmplitude )
m_settings.m_maxAmplitude = m_settings.m_minAmplitude;
=== modified file 'pcbnew/dialogs/dialog_pns_length_tuning_settings.h'
--- pcbnew/dialogs/dialog_pns_length_tuning_settings.h 2015-05-03 18:43:07 +0000
+++ pcbnew/dialogs/dialog_pns_length_tuning_settings.h 2016-02-13 02:04:21 +0000
@@ -45,6 +45,7 @@
WX_UNIT_BINDER m_maxAmpl;
WX_UNIT_BINDER m_spacing;
WX_UNIT_BINDER m_targetLength;
+ WX_UNIT_BINDER m_toleranceLength;
PNS_MEANDER_SETTINGS& m_settings;
PNS_ROUTER_MODE m_mode;
=== modified file 'pcbnew/dialogs/dialog_pns_length_tuning_settings_base.cpp'
--- pcbnew/dialogs/dialog_pns_length_tuning_settings_base.cpp 2015-06-15 13:54:58 +0000
+++ pcbnew/dialogs/dialog_pns_length_tuning_settings_base.cpp 2016-02-13 02:11:32 +0000
@@ -75,6 +75,17 @@
m_targetLengthUnit->Wrap( -1 );
fgSizerLenSkew->Add( m_targetLengthUnit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
+ m_toleranceLengthLabel = new wxStaticText( this, wxID_ANY, _("Length matching tolerance:"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_toleranceLengthLabel->Wrap( -1 );
+ fgSizerLenSkew->Add( m_toleranceLengthLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
+
+ m_toleranceLengthText = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
+ fgSizerLenSkew->Add( m_toleranceLengthText, 0, wxALL|wxEXPAND, 5 );
+
+ m_toleranceLengthUnit = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_toleranceLengthUnit->Wrap( -1 );
+ fgSizerLenSkew->Add( m_toleranceLengthUnit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
+
sbSizer1->Add( fgSizerLenSkew, 1, wxEXPAND, 5 );
@@ -103,7 +114,7 @@
m_minAmplUnit = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_minAmplUnit->Wrap( -1 );
fgSizer3->Add( m_minAmplUnit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
-
+
m_staticText91 = new wxStaticText( this, wxID_ANY, _("Max amplitude (Amax):"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText91->Wrap( -1 );
fgSizer3->Add( m_staticText91, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
=== modified file 'pcbnew/dialogs/dialog_pns_length_tuning_settings_base.h'
--- pcbnew/dialogs/dialog_pns_length_tuning_settings_base.h 2015-06-15 13:54:58 +0000
+++ pcbnew/dialogs/dialog_pns_length_tuning_settings_base.h 2016-02-13 02:04:19 +0000
@@ -51,6 +51,9 @@
wxStaticText* m_targetLengthLabel;
wxTextCtrl* m_targetLengthText;
wxStaticText* m_targetLengthUnit;
+ wxStaticText* m_toleranceLengthLabel;
+ wxTextCtrl* m_toleranceLengthText;
+ wxStaticText* m_toleranceLengthUnit;
wxStaticBitmap* m_legend;
wxStaticText* m_staticText9;
wxTextCtrl* m_minAmplText;
Follow ups