Bug fixes in Length Tuning UI.

1) hide the status popup when the dialog is brought up
2) forward events from the popup to the canvas so hotkeys work
3) make sure diff pair radius is always 100%
4) fix greyed-out Miter style label
5) make L a hotkey so it works before you start dragging

Fixes: lp:1545856
* https://bugs.launchpad.net/kicad/+bug/1545856
This commit is contained in:
Jeff Young 2018-05-20 14:08:06 +01:00
parent 8f6ae70400
commit 63c9e11aae
12 changed files with 314 additions and 256 deletions

View File

@ -96,7 +96,7 @@ EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWin
for( wxEventType eventType : events )
{
Connect( eventType, wxEventHandler( EDA_DRAW_PANEL_GAL::onEvent ),
Connect( eventType, wxEventHandler( EDA_DRAW_PANEL_GAL::OnEvent ),
NULL, m_eventDispatcher );
}
@ -401,7 +401,7 @@ bool EDA_DRAW_PANEL_GAL::SwitchBackend( GAL_TYPE aGalType )
}
void EDA_DRAW_PANEL_GAL::onEvent( wxEvent& aEvent )
void EDA_DRAW_PANEL_GAL::OnEvent( wxEvent& aEvent )
{
if( m_lostFocus && m_stealsFocus )
SetFocus();

View File

@ -30,7 +30,9 @@
#include <draw_frame.h>
STATUS_POPUP::STATUS_POPUP( EDA_DRAW_FRAME* aParent ) :
wxPopupWindow( aParent ), m_expireTimer( this )
wxPopupWindow( aParent ),
m_frame( aParent ),
m_expireTimer( this )
{
m_panel = new wxPanel( this, wxID_ANY );
m_panel->SetBackgroundColour( *wxLIGHT_GREY );
@ -40,6 +42,27 @@ STATUS_POPUP::STATUS_POPUP( EDA_DRAW_FRAME* aParent ) :
m_panel->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
Connect( wxEVT_TIMER, wxTimerEventHandler( STATUS_POPUP::onExpire ), NULL, this );
#ifdef __WXOSX_MAC__
// Key events from popups don't get put through the wxWidgets event system on OSX,
// so we have to fall back to the CHAR_HOOK to forwared hotkeys from the popup to
// the canvas / frame.
Connect( wxEVT_CHAR_HOOK, wxKeyEventHandler( STATUS_POPUP::onCharHook ), nullptr, this );
#endif
}
void STATUS_POPUP::onCharHook( wxKeyEvent& aEvent )
{
// Key events from popups don't get put through the wxWidgets event system on OSX,
// so we have to fall back to the CHAR_HOOK to forward hotkeys from the popup to
// the canvas / frame.
aEvent.SetEventType( wxEVT_CHAR );
if( m_frame->IsGalCanvasActive() )
m_frame->GetGalCanvas()->OnEvent( aEvent );
else
m_frame->ProcessEvent( aEvent );
}

View File

@ -236,11 +236,14 @@ public:
return BOX2I();
}
/**
* Used to forward events to the canvas from popups, etc.
*/
void OnEvent( wxEvent& aEvent );
protected:
void onPaint( wxPaintEvent& WXUNUSED( aEvent ) );
void onSize( wxSizeEvent& aEvent );
void onEvent( wxEvent& aEvent );
void onEnter( wxEvent& aEvent );
void onLostFocus( wxFocusEvent& aEvent );
void onRefreshTimer( wxTimerEvent& aEvent );

View File

@ -57,9 +57,12 @@ public:
protected:
void updateSize();
void onCharHook( wxKeyEvent& aEvent );
///> Expire timer even handler
void onExpire( wxTimerEvent& aEvent );
EDA_DRAW_FRAME* m_frame;
wxPanel* m_panel;
wxBoxSizer* m_topSizer;
wxTimer m_expireTimer;

View File

@ -39,15 +39,21 @@ DIALOG_PNS_LENGTH_TUNING_SETTINGS::DIALOG_PNS_LENGTH_TUNING_SETTINGS( wxWindow*
m_settings( aSettings ),
m_mode( aMode )
{
m_miterStyle->Enable( true );
m_radiusText->Enable( aMode != PNS::PNS_MODE_TUNE_DIFF_PAIR );
//m_minAmpl.Enable ( aMode != PNS_MODE_TUNE_DIFF_PAIR_SKEW );
if( aMode == PNS::PNS_MODE_TUNE_DIFF_PAIR )
{
// TODO: fix diff-pair meandering so we can use non-100% radii
m_radiusText->SetValue( wxT( "100" ) );
m_radiusText->Enable( false );
}
else
{
m_radiusText->SetValue( wxString::Format( wxT( "%i" ), m_settings.m_cornerRadiusPercentage ) );
}
m_minAmpl.SetValue( m_settings.m_minAmplitude );
m_maxAmpl.SetValue( m_settings.m_maxAmplitude );
m_spacing.SetValue( m_settings.m_spacing );
m_radiusText->SetValue( wxString::Format( wxT( "%i" ), m_settings.m_cornerRadiusPercentage ) );
m_miterStyle->SetSelection( m_settings.m_cornerStyle == PNS::MEANDER_STYLE_ROUND ? 1 : 0 );

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 19 2018)
// C++ code generated with wxFormBuilder (version Dec 30 2017)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -19,7 +19,7 @@ DIALOG_PNS_LENGTH_TUNING_SETTINGS_BASE::DIALOG_PNS_LENGTH_TUNING_SETTINGS_BASE(
bMainSizer = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* sbSizer1;
sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Length/skew:") ), wxVERTICAL );
sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Length / Skew") ), wxVERTICAL );
wxFlexGridSizer* fgSizerLenSkew;
fgSizerLenSkew = new wxFlexGridSizer( 0, 3, 0, 0 );
@ -29,31 +29,31 @@ DIALOG_PNS_LENGTH_TUNING_SETTINGS_BASE::DIALOG_PNS_LENGTH_TUNING_SETTINGS_BASE(
m_staticText4 = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("Tune from:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText4->Wrap( -1 );
fgSizerLenSkew->Add( m_staticText4, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
fgSizerLenSkew->Add( m_staticText4, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 );
wxArrayString m_choicePathFromChoices;
m_choicePathFrom = new wxChoice( sbSizer1->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choicePathFromChoices, 0 );
m_choicePathFrom->SetSelection( 0 );
fgSizerLenSkew->Add( m_choicePathFrom, 0, wxALL|wxEXPAND, 5 );
fgSizerLenSkew->Add( m_choicePathFrom, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
fgSizerLenSkew->Add( 0, 0, 0, 0, 5 );
m_staticText15 = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("Tune to:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText15->Wrap( -1 );
fgSizerLenSkew->Add( m_staticText15, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
fgSizerLenSkew->Add( m_staticText15, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 );
wxArrayString m_choice4Choices;
m_choice4 = new wxChoice( sbSizer1->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choice4Choices, 0 );
m_choice4->SetSelection( 0 );
fgSizerLenSkew->Add( m_choice4, 0, wxALL|wxEXPAND, 5 );
fgSizerLenSkew->Add( m_choice4, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
fgSizerLenSkew->Add( 0, 0, 0, 0, 5 );
m_staticText3 = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("Constraint:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText3->Wrap( -1 );
fgSizerLenSkew->Add( m_staticText3, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
fgSizerLenSkew->Add( m_staticText3, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 );
wxString m_constraintSourceChoices[] = { _("From Design Rules"), _("Manual") };
int m_constraintSourceNChoices = sizeof( m_constraintSourceChoices ) / sizeof( wxString );
@ -61,30 +61,30 @@ DIALOG_PNS_LENGTH_TUNING_SETTINGS_BASE::DIALOG_PNS_LENGTH_TUNING_SETTINGS_BASE(
m_constraintSource->SetSelection( 1 );
m_constraintSource->Enable( false );
fgSizerLenSkew->Add( m_constraintSource, 1, wxALL|wxEXPAND, 5 );
fgSizerLenSkew->Add( m_constraintSource, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
fgSizerLenSkew->Add( 0, 0, 0, 0, 5 );
m_targetLengthLabel = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("Target length:"), wxDefaultPosition, wxDefaultSize, 0 );
m_targetLengthLabel->Wrap( -1 );
fgSizerLenSkew->Add( m_targetLengthLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
fgSizerLenSkew->Add( m_targetLengthLabel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_targetLengthText = new TEXT_CTRL_EVAL( sbSizer1->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerLenSkew->Add( m_targetLengthText, 0, wxALL|wxEXPAND, 5 );
m_targetLengthUnit = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_targetLengthUnit->Wrap( -1 );
fgSizerLenSkew->Add( m_targetLengthUnit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
fgSizerLenSkew->Add( m_targetLengthUnit, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
sbSizer1->Add( fgSizerLenSkew, 1, wxEXPAND, 5 );
bMainSizer->Add( sbSizer1, 0, wxEXPAND|wxALL, 5 );
bMainSizer->Add( sbSizer1, 0, wxEXPAND|wxALL, 10 );
wxStaticBoxSizer* sbSizer2;
sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Meandering:") ), wxVERTICAL );
sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Meandering") ), wxVERTICAL );
m_legend = new wxStaticBitmap( sbSizer2->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
sbSizer2->Add( m_legend, 0, wxALL|wxEXPAND, 5 );
@ -97,67 +97,66 @@ DIALOG_PNS_LENGTH_TUNING_SETTINGS_BASE::DIALOG_PNS_LENGTH_TUNING_SETTINGS_BASE(
m_staticText9 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Min amplitude (Amin):"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText9->Wrap( -1 );
fgSizer3->Add( m_staticText9, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
fgSizer3->Add( m_staticText9, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 );
m_minAmplText = new TEXT_CTRL_EVAL( sbSizer2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3->Add( m_minAmplText, 0, wxALL|wxEXPAND, 5 );
fgSizer3->Add( m_minAmplText, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 );
m_minAmplUnit = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_minAmplUnit->Wrap( -1 );
fgSizer3->Add( m_minAmplUnit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
fgSizer3->Add( m_minAmplUnit, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 5 );
m_staticText91 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Max amplitude (Amax):"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText91->Wrap( -1 );
fgSizer3->Add( m_staticText91, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
fgSizer3->Add( m_staticText91, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 );
m_maxAmplText = new TEXT_CTRL_EVAL( sbSizer2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3->Add( m_maxAmplText, 0, wxALL|wxEXPAND, 5 );
fgSizer3->Add( m_maxAmplText, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
m_maxAmplUnit = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_maxAmplUnit->Wrap( -1 );
fgSizer3->Add( m_maxAmplUnit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
fgSizer3->Add( m_maxAmplUnit, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 5 );
m_staticText11 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Spacing (s):"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText11->Wrap( -1 );
fgSizer3->Add( m_staticText11, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
fgSizer3->Add( m_staticText11, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 );
m_spacingText = new TEXT_CTRL_EVAL( sbSizer2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3->Add( m_spacingText, 0, wxALL|wxEXPAND, 5 );
fgSizer3->Add( m_spacingText, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
m_spacingUnit = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_spacingUnit->Wrap( -1 );
fgSizer3->Add( m_spacingUnit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
fgSizer3->Add( m_spacingUnit, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 5 );
m_staticText14 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Miter style:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText14->Wrap( -1 );
fgSizer3->Add( m_staticText14, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 );
wxString m_miterStyleChoices[] = { _("45 degree"), _("arc") };
int m_miterStyleNChoices = sizeof( m_miterStyleChoices ) / sizeof( wxString );
m_miterStyle = new wxChoice( sbSizer2->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_miterStyleNChoices, m_miterStyleChoices, 0 );
m_miterStyle->SetSelection( 0 );
fgSizer3->Add( m_miterStyle, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
fgSizer3->Add( 0, 0, 1, wxEXPAND, 5 );
m_staticText13 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Miter radius (r):"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText13->Wrap( -1 );
fgSizer3->Add( m_staticText13, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
fgSizer3->Add( m_staticText13, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_radiusText = new TEXT_CTRL_EVAL( sbSizer2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3->Add( m_radiusText, 0, wxALL|wxEXPAND, 5 );
m_radiusUnit = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 );
m_radiusUnit->Wrap( -1 );
fgSizer3->Add( m_radiusUnit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_staticText14 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Miter style:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText14->Wrap( -1 );
m_staticText14->Enable( false );
fgSizer3->Add( m_staticText14, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
wxString m_miterStyleChoices[] = { _("45 degree"), _("arc") };
int m_miterStyleNChoices = sizeof( m_miterStyleChoices ) / sizeof( wxString );
m_miterStyle = new wxChoice( sbSizer2->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_miterStyleNChoices, m_miterStyleChoices, 0 );
m_miterStyle->SetSelection( 0 );
m_miterStyle->Enable( false );
fgSizer3->Add( m_miterStyle, 0, wxALL|wxEXPAND, 5 );
fgSizer3->Add( m_radiusUnit, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
sbSizer2->Add( fgSizer3, 1, wxEXPAND, 5 );
bMainSizer->Add( sbSizer2, 0, wxALL|wxEXPAND, 5 );
bMainSizer->Add( sbSizer2, 0, wxEXPAND|wxRIGHT|wxLEFT, 10 );
m_stdButtons = new wxStdDialogButtonSizer();
m_stdButtonsOK = new wxButton( this, wxID_OK );

View File

@ -14,7 +14,6 @@
<property name="file">dialog_pns_length_tuning_settings_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="name">DIALOG_PNS_LENGTH_TUNING_SETTINGS_BASE</property>
<property name="namespace"></property>
@ -95,12 +94,12 @@
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="border">10</property>
<property name="flag">wxEXPAND|wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Length/skew:</property>
<property name="label">Length / Skew</property>
<property name="minimum_size"></property>
<property name="name">sbSizer1</property>
<property name="orient">wxVERTICAL</property>
@ -125,7 +124,7 @@
<property name="vgap">0</property>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
@ -208,7 +207,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxChoice" expanded="1">
<property name="BottomDockable">1</property>
@ -306,7 +305,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
@ -389,7 +388,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxChoice" expanded="1">
<property name="BottomDockable">1</property>
@ -487,7 +486,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
@ -570,7 +569,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxChoice" expanded="0">
<property name="BottomDockable">1</property>
@ -668,7 +667,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
@ -842,7 +841,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
@ -928,12 +927,12 @@
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="border">10</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Meandering:</property>
<property name="label">Meandering</property>
<property name="minimum_size"></property>
<property name="name">sbSizer2</property>
<property name="orient">wxVERTICAL</property>
@ -1039,7 +1038,7 @@
<property name="vgap">0</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
@ -1122,7 +1121,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="flag">wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1">
<property name="BottomDockable">1</property>
@ -1213,7 +1212,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
@ -1296,7 +1295,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
@ -1379,7 +1378,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1">
<property name="BottomDockable">1</property>
@ -1470,7 +1469,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
@ -1553,7 +1552,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
@ -1636,7 +1635,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1">
<property name="BottomDockable">1</property>
@ -1727,7 +1726,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
@ -1810,7 +1809,188 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Miter style:</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticText14</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxChoice" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="choices">&quot;45 degree&quot; &quot;arc&quot;</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_miterStyle</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="selection">0</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnChoice"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
@ -1984,7 +2164,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
@ -2065,177 +2245,6 @@
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">1</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">0</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Miter style:</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticText14</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxChoice" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="choices">&quot;45 degree&quot; &quot;arc&quot;</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">0</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_miterStyle</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="selection">0</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnChoice"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
</object>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 19 2018)
// C++ code generated with wxFormBuilder (version Dec 30 2017)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -61,11 +61,11 @@ class DIALOG_PNS_LENGTH_TUNING_SETTINGS_BASE : public DIALOG_SHIM
wxStaticText* m_staticText11;
TEXT_CTRL_EVAL* m_spacingText;
wxStaticText* m_spacingUnit;
wxStaticText* m_staticText14;
wxChoice* m_miterStyle;
wxStaticText* m_staticText13;
TEXT_CTRL_EVAL* m_radiusText;
wxStaticText* m_radiusUnit;
wxStaticText* m_staticText14;
wxChoice* m_miterStyle;
wxStdDialogButtonSizer* m_stdButtons;
wxButton* m_stdButtonsOK;
wxButton* m_stdButtonsCancel;

View File

@ -105,6 +105,8 @@ static EDA_HOTKEY HkRouteTuneDiffPair( _HKI( "Tune Differential Pair Length (Mod
HK_ROUTE_TUNE_DIFF_PAIR, '8' );
static EDA_HOTKEY HkRouteTuneSkew( _HKI( "Tune Differential Pair Skew (Modern Toolset only)" ),
HK_ROUTE_TUNE_SKEW, '9' );
static EDA_HOTKEY HkRouteTuneSettings( _HKI( "Length Tuning Settings (Modern Toolset only)" ),
HK_ROUTE_TUNE_SETTINGS, 'L' );
static EDA_HOTKEY HkAddThroughVia( _HKI( "Add Through Via" ), HK_ADD_THROUGH_VIA, 'V' );
static EDA_HOTKEY HkSelLayerAndAddThroughVia( _HKI( "Select Layer and Add Through Via" ),

View File

@ -52,6 +52,7 @@ enum hotkey_id_commnand {
HK_ROUTE_TUNE_SINGLE,
HK_ROUTE_TUNE_DIFF_PAIR,
HK_ROUTE_TUNE_SKEW,
HK_ROUTE_TUNE_SETTINGS,
HK_ADD_THROUGH_VIA,
HK_SEL_LAYER_AND_ADD_THROUGH_VIA,
HK_ADD_BLIND_BURIED_VIA,

View File

@ -151,8 +151,7 @@ void LENGTH_TUNER_TOOL::performTuning()
return;
}
PNS::MEANDER_PLACER_BASE* placer = static_cast<PNS::MEANDER_PLACER_BASE*>(
m_router->Placer() );
auto placer = static_cast<PNS::MEANDER_PLACER_BASE*>( m_router->Placer() );
placer->UpdateSettings( m_savedMeanderSettings );
@ -208,6 +207,13 @@ void LENGTH_TUNER_TOOL::performTuning()
m_router->Move( end, NULL );
updateStatusPopup( statusPopup );
}
else if( evt->IsAction( &ACT_Settings ) )
{
statusPopup.Hide();
TOOL_EVENT dummy;
meanderSettingsDialog( dummy );
statusPopup.Show();
}
}
m_router->StopRouting();
@ -241,8 +247,6 @@ void LENGTH_TUNER_TOOL::setTransitions()
Go( &LENGTH_TUNER_TOOL::TuneSingleTrace, PCB_ACTIONS::routerActivateTuneSingleTrace.MakeEvent() );
Go( &LENGTH_TUNER_TOOL::TuneDiffPair, PCB_ACTIONS::routerActivateTuneDiffPair.MakeEvent() );
Go( &LENGTH_TUNER_TOOL::TuneDiffPairSkew, PCB_ACTIONS::routerActivateTuneDiffPairSkew.MakeEvent() );
Go( &LENGTH_TUNER_TOOL::meanderSettingsDialog, ACT_Settings.MakeEvent() );
}
@ -278,6 +282,11 @@ int LENGTH_TUNER_TOOL::mainLoop( PNS::ROUTER_MODE aMode )
updateStartItem( *evt );
performTuning();
}
else if( evt->IsAction( &ACT_Settings ) )
{
TOOL_EVENT dummy;
meanderSettingsDialog( dummy );
}
}
frame()->SetNoToolSelected();
@ -294,16 +303,16 @@ int LENGTH_TUNER_TOOL::meanderSettingsDialog( const TOOL_EVENT& aEvent )
{
PNS::MEANDER_PLACER_BASE* placer = static_cast<PNS::MEANDER_PLACER_BASE*>( m_router->Placer() );
if( !placer )
return 0;
PNS::MEANDER_SETTINGS settings = placer->MeanderSettings();
PNS::MEANDER_SETTINGS settings = placer ? placer->MeanderSettings() : m_savedMeanderSettings;
DIALOG_PNS_LENGTH_TUNING_SETTINGS settingsDlg( frame(), settings, m_router->Mode() );
if( settingsDlg.ShowModal() )
placer->UpdateSettings( settings );
{
if( placer )
placer->UpdateSettings( settings );
m_savedMeanderSettings = placer->MeanderSettings();
m_savedMeanderSettings = settings;
}
return 0;
}

View File

@ -167,7 +167,10 @@ void MEANDERED_LINE::MeanderSegment( const SEG& aBase, int aBaseIndex )
int MEANDER_SHAPE::cornerRadius() const
{
return (int64_t) spacing() * Settings().m_cornerRadiusPercentage / 200;
// TODO: fix diff-pair meandering so we can use non-100% radii
int rPercent = m_type == PNS_MODE_TUNE_DIFF_PAIR ? 100 : Settings().m_cornerRadiusPercentage;
return (int64_t) spacing() * rPercent / 200;
}