P&S: support for trace & via locking
This commit is contained in:
parent
7e0caf7abe
commit
2b32b6f72e
|
@ -47,6 +47,10 @@ DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES( PCB_BASE_FRAME* aParen
|
|||
boost::optional<LAYER_ID> trackLayer;
|
||||
boost::optional<int> viaX, viaY, viaDiameter, viaDrill;
|
||||
|
||||
bool hasLocked = false;
|
||||
bool hasUnlocked = false;
|
||||
|
||||
|
||||
// Look for values that are common for every item that is selected
|
||||
for( int i = 0; i < m_items.Size(); ++i )
|
||||
{
|
||||
|
@ -88,6 +92,12 @@ DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES( PCB_BASE_FRAME* aParen
|
|||
if( trackLayer && *trackLayer != t->GetLayer() )
|
||||
trackLayer = boost::none;
|
||||
}
|
||||
|
||||
if ( t->IsLocked() )
|
||||
hasLocked = true;
|
||||
else
|
||||
hasUnlocked = true;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -117,6 +127,12 @@ DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES( PCB_BASE_FRAME* aParen
|
|||
if( viaDrill && *viaDrill != v->GetDrillValue() )
|
||||
viaDrill = boost::none;
|
||||
}
|
||||
|
||||
if ( v->IsLocked() )
|
||||
hasLocked = true;
|
||||
else
|
||||
hasUnlocked = true;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -164,6 +180,19 @@ DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES( PCB_BASE_FRAME* aParen
|
|||
m_MainSizer->Hide( m_sbTrackSizer, true );
|
||||
}
|
||||
|
||||
if ( hasLocked && hasUnlocked )
|
||||
{
|
||||
m_lockedCbox->Set3StateValue( wxCHK_UNDETERMINED );
|
||||
}
|
||||
else if ( hasLocked )
|
||||
{
|
||||
m_lockedCbox->Set3StateValue( wxCHK_CHECKED );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_lockedCbox->Set3StateValue( wxCHK_UNCHECKED );
|
||||
}
|
||||
|
||||
m_StdButtonsOK->SetDefault();
|
||||
|
||||
FixOSXCancelButtonIssue();
|
||||
|
@ -178,6 +207,10 @@ bool DIALOG_TRACK_VIA_PROPERTIES::Apply()
|
|||
if( !check() )
|
||||
return false;
|
||||
|
||||
bool changeLock = m_lockedCbox->Get3StateValue() != wxCHK_UNDETERMINED;
|
||||
bool setLock = m_lockedCbox->Get3StateValue() == wxCHK_CHECKED;
|
||||
|
||||
|
||||
for( int i = 0; i < m_items.Size(); ++i )
|
||||
{
|
||||
BOARD_ITEM* item = m_items.Item<BOARD_ITEM>( i );
|
||||
|
@ -229,6 +262,9 @@ bool DIALOG_TRACK_VIA_PROPERTIES::Apply()
|
|||
if( layer != UNDEFINED_LAYER )
|
||||
t->SetLayer( (LAYER_ID) layer );
|
||||
|
||||
if( changeLock )
|
||||
t->SetLocked( setLock );
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -265,6 +301,9 @@ bool DIALOG_TRACK_VIA_PROPERTIES::Apply()
|
|||
v->SetDrill( m_viaDrill.GetValue() );
|
||||
}
|
||||
|
||||
if( changeLock )
|
||||
v->SetLocked( setLock );
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version May 6 2016)
|
||||
// C++ code generated with wxFormBuilder (version Jun 17 2015)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
|
@ -17,6 +17,14 @@ DIALOG_TRACK_VIA_PROPERTIES_BASE::DIALOG_TRACK_VIA_PROPERTIES_BASE( wxWindow* pa
|
|||
|
||||
m_MainSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_sbCommonSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Common") ), wxHORIZONTAL );
|
||||
|
||||
m_lockedCbox = new wxCheckBox( m_sbCommonSizer->GetStaticBox(), wxID_ANY, _("Locked"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE );
|
||||
m_sbCommonSizer->Add( m_lockedCbox, 0, wxALL, 5 );
|
||||
|
||||
|
||||
m_MainSizer->Add( m_sbCommonSizer, 1, wxEXPAND|wxALL, 5 );
|
||||
|
||||
m_sbTrackSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Tracks") ), wxHORIZONTAL );
|
||||
|
||||
wxFlexGridSizer* fgTrackLeftGridSizer;
|
||||
|
@ -29,6 +37,7 @@ DIALOG_TRACK_VIA_PROPERTIES_BASE::DIALOG_TRACK_VIA_PROPERTIES_BASE( wxWindow* pa
|
|||
fgTrackLeftGridSizer->Add( m_TrackStartXLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
|
||||
|
||||
m_TrackStartXCtrl = new wxTextCtrl( m_sbTrackSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_TrackStartXCtrl->SetMaxLength( 0 );
|
||||
fgTrackLeftGridSizer->Add( m_TrackStartXCtrl, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
|
||||
|
||||
m_TrackStartXUnit = new wxStaticText( m_sbTrackSizer->GetStaticBox(), wxID_ANY, _("Unit"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
@ -40,6 +49,7 @@ DIALOG_TRACK_VIA_PROPERTIES_BASE::DIALOG_TRACK_VIA_PROPERTIES_BASE( wxWindow* pa
|
|||
fgTrackLeftGridSizer->Add( m_TrackStartYLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
|
||||
|
||||
m_TrackStartYCtrl = new wxTextCtrl( m_sbTrackSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_TrackStartYCtrl->SetMaxLength( 0 );
|
||||
fgTrackLeftGridSizer->Add( m_TrackStartYCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
|
||||
m_TrackStartYUnit = new wxStaticText( m_sbTrackSizer->GetStaticBox(), wxID_ANY, _("Unit"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
@ -51,6 +61,7 @@ DIALOG_TRACK_VIA_PROPERTIES_BASE::DIALOG_TRACK_VIA_PROPERTIES_BASE( wxWindow* pa
|
|||
fgTrackLeftGridSizer->Add( m_TrackEndXLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
|
||||
|
||||
m_TrackEndXCtrl = new wxTextCtrl( m_sbTrackSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_TrackEndXCtrl->SetMaxLength( 0 );
|
||||
fgTrackLeftGridSizer->Add( m_TrackEndXCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
|
||||
m_TrackEndXUnit = new wxStaticText( m_sbTrackSizer->GetStaticBox(), wxID_ANY, _("Unit"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
@ -62,6 +73,7 @@ DIALOG_TRACK_VIA_PROPERTIES_BASE::DIALOG_TRACK_VIA_PROPERTIES_BASE( wxWindow* pa
|
|||
fgTrackLeftGridSizer->Add( m_TrackEndYLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
|
||||
|
||||
m_TrackEndYCtrl = new wxTextCtrl( m_sbTrackSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_TrackEndYCtrl->SetMaxLength( 0 );
|
||||
fgTrackLeftGridSizer->Add( m_TrackEndYCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
|
||||
m_TrackEndYUnit = new wxStaticText( m_sbTrackSizer->GetStaticBox(), wxID_ANY, _("Unit"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
@ -84,6 +96,7 @@ DIALOG_TRACK_VIA_PROPERTIES_BASE::DIALOG_TRACK_VIA_PROPERTIES_BASE( wxWindow* pa
|
|||
fgTrackRightSizer->Add( m_TrackWidthLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT, 5 );
|
||||
|
||||
m_TrackWidthCtrl = new wxTextCtrl( m_sbTrackSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_TrackWidthCtrl->SetMaxLength( 0 );
|
||||
fgTrackRightSizer->Add( m_TrackWidthCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
|
||||
m_TrackWidthUnit = new wxStaticText( m_sbTrackSizer->GetStaticBox(), wxID_ANY, _("Unit"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
@ -127,6 +140,7 @@ DIALOG_TRACK_VIA_PROPERTIES_BASE::DIALOG_TRACK_VIA_PROPERTIES_BASE( wxWindow* pa
|
|||
fgViaLeftSizer->Add( m_ViaXLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
|
||||
|
||||
m_ViaXCtrl = new wxTextCtrl( m_sbViaSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_ViaXCtrl->SetMaxLength( 0 );
|
||||
fgViaLeftSizer->Add( m_ViaXCtrl, 0, wxEXPAND, 5 );
|
||||
|
||||
m_ViaXUnit = new wxStaticText( m_sbViaSizer->GetStaticBox(), wxID_ANY, _("Unit"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
@ -138,6 +152,7 @@ DIALOG_TRACK_VIA_PROPERTIES_BASE::DIALOG_TRACK_VIA_PROPERTIES_BASE( wxWindow* pa
|
|||
fgViaLeftSizer->Add( m_ViaYLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
|
||||
|
||||
m_ViaYCtrl = new wxTextCtrl( m_sbViaSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_ViaYCtrl->SetMaxLength( 0 );
|
||||
fgViaLeftSizer->Add( m_ViaYCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
|
||||
m_ViaYUnit = new wxStaticText( m_sbViaSizer->GetStaticBox(), wxID_ANY, _("Unit"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
@ -145,7 +160,7 @@ DIALOG_TRACK_VIA_PROPERTIES_BASE::DIALOG_TRACK_VIA_PROPERTIES_BASE( wxWindow* pa
|
|||
fgViaLeftSizer->Add( m_ViaYUnit, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
|
||||
m_sbViaSizer->Add( fgViaLeftSizer, 1, wxEXPAND, 5 );
|
||||
m_sbViaSizer->Add( fgViaLeftSizer, 1, wxEXPAND|wxALL, 5 );
|
||||
|
||||
m_viaStaticLine = new wxStaticLine( m_sbViaSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
|
||||
m_sbViaSizer->Add( m_viaStaticLine, 0, wxEXPAND | wxALL, 5 );
|
||||
|
@ -160,6 +175,7 @@ DIALOG_TRACK_VIA_PROPERTIES_BASE::DIALOG_TRACK_VIA_PROPERTIES_BASE( wxWindow* pa
|
|||
fgViaRightSizer->Add( m_ViaDiameterLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
|
||||
|
||||
m_ViaDiameterCtrl = new wxTextCtrl( m_sbViaSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_ViaDiameterCtrl->SetMaxLength( 0 );
|
||||
fgViaRightSizer->Add( m_ViaDiameterCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
|
||||
m_ViaDiameterUnit = new wxStaticText( m_sbViaSizer->GetStaticBox(), wxID_ANY, _("Unit"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
@ -171,6 +187,7 @@ DIALOG_TRACK_VIA_PROPERTIES_BASE::DIALOG_TRACK_VIA_PROPERTIES_BASE( wxWindow* pa
|
|||
fgViaRightSizer->Add( m_ViaDrillLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
|
||||
|
||||
m_ViaDrillCtrl = new wxTextCtrl( m_sbViaSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_ViaDrillCtrl->SetMaxLength( 0 );
|
||||
fgViaRightSizer->Add( m_ViaDrillCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
|
||||
m_ViaDrillUnit = new wxStaticText( m_sbViaSizer->GetStaticBox(), wxID_ANY, _("Unit"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
@ -187,7 +204,7 @@ DIALOG_TRACK_VIA_PROPERTIES_BASE::DIALOG_TRACK_VIA_PROPERTIES_BASE( wxWindow* pa
|
|||
fgViaRightSizer->Add( 0, 0, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
m_sbViaSizer->Add( fgViaRightSizer, 1, wxEXPAND, 5 );
|
||||
m_sbViaSizer->Add( fgViaRightSizer, 1, wxEXPAND|wxALL, 5 );
|
||||
|
||||
|
||||
m_MainSizer->Add( m_sbViaSizer, 0, wxALL|wxEXPAND, 5 );
|
||||
|
@ -207,7 +224,6 @@ DIALOG_TRACK_VIA_PROPERTIES_BASE::DIALOG_TRACK_VIA_PROPERTIES_BASE( wxWindow* pa
|
|||
|
||||
this->SetSizer( m_MainSizer );
|
||||
this->Layout();
|
||||
m_MainSizer->Fit( this );
|
||||
|
||||
this->Centre( wxBOTH );
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
<property name="minimum_size">-1,-1</property>
|
||||
<property name="name">DIALOG_TRACK_VIA_PROPERTIES_BASE</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size">-1,-1</property>
|
||||
<property name="size">573,437</property>
|
||||
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSYSTEM_MENU</property>
|
||||
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
|
||||
<property name="title">Track & Via Properties</property>
|
||||
|
@ -93,6 +93,108 @@
|
|||
<property name="name">m_MainSizer</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">protected</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxALL</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxStaticBoxSizer" expanded="1">
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Common</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_sbCommonSizer</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="permission">protected</property>
|
||||
<event name="OnUpdateUI"></event>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" 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="checked">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">Locked</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_lockedCbox</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">wxCHK_3STATE</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="OnCheckBox"></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 class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
|
@ -1817,7 +1919,7 @@
|
|||
<event name="OnUpdateUI"></event>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="flag">wxEXPAND|wxALL</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxFlexGridSizer" expanded="1">
|
||||
<property name="cols">3</property>
|
||||
|
@ -2430,7 +2532,7 @@
|
|||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="flag">wxEXPAND|wxALL</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxFlexGridSizer" expanded="1">
|
||||
<property name="cols">3</property>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version May 6 2016)
|
||||
// C++ code generated with wxFormBuilder (version Jun 17 2015)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
|
@ -16,17 +16,17 @@ class PCB_LAYER_BOX_SELECTOR;
|
|||
|
||||
#include "dialog_shim.h"
|
||||
#include <wx/string.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/font.h>
|
||||
#include <wx/colour.h>
|
||||
#include <wx/settings.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/statline.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/bmpcbox.h>
|
||||
#include <wx/statbox.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/statline.h>
|
||||
#include <wx/bmpcbox.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/dialog.h>
|
||||
|
||||
|
@ -42,6 +42,8 @@ class DIALOG_TRACK_VIA_PROPERTIES_BASE : public DIALOG_SHIM
|
|||
|
||||
protected:
|
||||
wxBoxSizer* m_MainSizer;
|
||||
wxStaticBoxSizer* m_sbCommonSizer;
|
||||
wxCheckBox* m_lockedCbox;
|
||||
wxStaticBoxSizer* m_sbTrackSizer;
|
||||
wxStaticText* m_TrackStartXLabel;
|
||||
wxTextCtrl* m_TrackStartXCtrl;
|
||||
|
@ -92,7 +94,7 @@ class DIALOG_TRACK_VIA_PROPERTIES_BASE : public DIALOG_SHIM
|
|||
|
||||
public:
|
||||
|
||||
DIALOG_TRACK_VIA_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Track & Via Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSYSTEM_MENU );
|
||||
DIALOG_TRACK_VIA_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Track & Via Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 573,437 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSYSTEM_MENU );
|
||||
~DIALOG_TRACK_VIA_PROPERTIES_BASE();
|
||||
|
||||
};
|
||||
|
|
|
@ -886,3 +886,13 @@ OPT_BOX2I PNS_LINE::ChangedArea( const PNS_LINE* aOther ) const
|
|||
|
||||
return OPT_BOX2I();
|
||||
}
|
||||
|
||||
bool PNS_LINE::HasLockedSegments() const
|
||||
{
|
||||
for ( const PNS_SEGMENT *seg : *m_segmentRefs )
|
||||
{
|
||||
if ( seg->Marker() & MK_LOCKED )
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -266,6 +266,7 @@ public:
|
|||
int Rank() const;
|
||||
|
||||
bool HasLoops() const;
|
||||
bool HasLockedSegments() const;
|
||||
|
||||
OPT_BOX2I ChangedArea( const PNS_LINE* aOther ) const;
|
||||
|
||||
|
|
|
@ -308,6 +308,9 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::onCollidingSegment( PNS_LINE& aCurrent, PNS_S
|
|||
PNS_LINE shovedLine( obstacleLine );
|
||||
PNS_SEGMENT tmp( *aObstacleSeg );
|
||||
|
||||
if( obstacleLine.HasLockedSegments() )
|
||||
return SH_TRY_WALK;
|
||||
|
||||
SHOVE_STATUS rv = ProcessSingleLine( aCurrent, obstacleLine, shovedLine );
|
||||
|
||||
const double extensionWalkThreshold = 1.0;
|
||||
|
@ -441,11 +444,13 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::onCollidingSolid( PNS_LINE& aCurrent, PNS_ITE
|
|||
int currentRank = aCurrent.Rank();
|
||||
int nextRank;
|
||||
|
||||
bool success = false;
|
||||
|
||||
for( int attempt = 0; attempt < 2; attempt++ )
|
||||
{
|
||||
|
||||
if( attempt == 1 || Settings().JumpOverObstacles() )
|
||||
{
|
||||
|
||||
nextRank = currentRank - 1;
|
||||
walkaround.SetSingleDirection( true );
|
||||
}
|
||||
|
@ -456,22 +461,24 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::onCollidingSolid( PNS_LINE& aCurrent, PNS_ITE
|
|||
}
|
||||
|
||||
|
||||
if( walkaround.Route( aCurrent, walkaroundLine, false ) != PNS_WALKAROUND::DONE )
|
||||
return SH_INCOMPLETE;
|
||||
PNS_WALKAROUND::WALKAROUND_STATUS status = walkaround.Route( aCurrent, walkaroundLine, false );
|
||||
|
||||
if ( status != PNS_WALKAROUND::DONE )
|
||||
continue;
|
||||
|
||||
walkaroundLine.ClearSegmentLinks();
|
||||
walkaroundLine.Unmark();
|
||||
walkaroundLine.Line().Simplify();
|
||||
|
||||
if( walkaroundLine.HasLoops() )
|
||||
return SH_INCOMPLETE;
|
||||
continue;
|
||||
|
||||
if( aCurrent.Marker() & MK_HEAD )
|
||||
{
|
||||
walkaroundLine.Mark( MK_HEAD );
|
||||
|
||||
if( m_multiLineMode )
|
||||
return SH_INCOMPLETE;
|
||||
continue;
|
||||
|
||||
m_newHead = walkaroundLine;
|
||||
}
|
||||
|
@ -487,12 +494,20 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::onCollidingSolid( PNS_LINE& aCurrent, PNS_ITE
|
|||
PNS_LINE dummy ( lastLine );
|
||||
|
||||
if( ProcessSingleLine( walkaroundLine, lastLine, dummy ) == SH_OK )
|
||||
{
|
||||
success = true;
|
||||
break;
|
||||
} else
|
||||
}
|
||||
} else {
|
||||
success = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!success)
|
||||
return SH_INCOMPLETE;
|
||||
|
||||
replaceItems( &aCurrent, &walkaroundLine );
|
||||
walkaroundLine.SetRank( nextRank );
|
||||
|
||||
|
@ -608,6 +623,9 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::pushVia( PNS_VIA* aVia, const VECTOR2I& aForc
|
|||
|
||||
lp.first = assembleLine( seg, &segIndex );
|
||||
|
||||
if( lp.first.HasLockedSegments() )
|
||||
return SH_TRY_WALK;
|
||||
|
||||
assert( segIndex == 0 || ( segIndex == ( lp.first.SegmentCount() - 1 ) ) );
|
||||
|
||||
if( segIndex == 0 )
|
||||
|
@ -966,17 +984,23 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::shoveIteration( int aIter )
|
|||
{
|
||||
case PNS_ITEM::SEGMENT:
|
||||
TRACE( 2, "iter %d: collide-segment ", aIter );
|
||||
|
||||
st = onCollidingSegment( currentLine, (PNS_SEGMENT*) ni );
|
||||
|
||||
if( st == SH_TRY_WALK )
|
||||
{
|
||||
st = onCollidingSolid( currentLine, (PNS_SOLID*) ni );
|
||||
st = onCollidingSolid( currentLine, ni );
|
||||
}
|
||||
break;
|
||||
|
||||
case PNS_ITEM::VIA:
|
||||
TRACE( 2, "iter %d: shove-via ", aIter );
|
||||
st = onCollidingVia( ¤tLine, (PNS_VIA*) ni );
|
||||
|
||||
if( st == SH_TRY_WALK )
|
||||
{
|
||||
st = onCollidingSolid( currentLine, ni );
|
||||
}
|
||||
break;
|
||||
|
||||
case PNS_ITEM::SOLID:
|
||||
|
@ -1132,6 +1156,9 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::ShoveLines( const PNS_LINE& aCurrentHead )
|
|||
m_newHead = OPT_LINE();
|
||||
}
|
||||
|
||||
if(m_newHead)
|
||||
m_newHead->Unmark();
|
||||
|
||||
if( m_newHead && head.EndsWithVia() )
|
||||
{
|
||||
PNS_VIA v = head.Via();
|
||||
|
|
|
@ -370,7 +370,7 @@ const std::set<PNS_ITEM*> PNS_TOPOLOGY::AssembleCluster( PNS_ITEM* aStart, int a
|
|||
|
||||
visited.insert( top );
|
||||
|
||||
m_world->QueryColliding( top, obstacles, PNS_ITEM::ANY, -1, false, 0 );
|
||||
m_world->QueryColliding( top, obstacles, PNS_ITEM::ANY, -1, false );
|
||||
|
||||
for( PNS_OBSTACLE& obs : obstacles )
|
||||
{
|
||||
|
|
|
@ -118,9 +118,6 @@ void ROUTER_PREVIEW_ITEM::Update( const PNS_ITEM* aItem )
|
|||
if( aItem->Marker() & MK_VIOLATION )
|
||||
m_color = COLOR4D( 0, 1, 0, 1 );
|
||||
|
||||
if( aItem->Marker() & MK_HEAD )
|
||||
m_color.Brighten( 0.7 );
|
||||
|
||||
ViewSetVisible( true );
|
||||
ViewUpdate( GEOMETRY | APPEARANCE );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue