mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
multi-channel tool: more fine grained control over in/exclusion
The locking option from the repeat layout dialog was renamed and is now called 'include locked items', like in the code. If an item is locked in the source rule area it is not replicated, if an item is locked in the target area it will not be deleted upon running the repeat layout tool. Added an option to ignore tracks that do not share a net with a pad inside the source rule area. This gives unrelated track segments lying inside the rule areas a chance of peaceful coexistance.
This commit is contained in:
parent
6e06125719
commit
159f2c9482
@ -103,6 +103,7 @@ DIALOG_MULTICHANNEL_REPEAT_LAYOUT::DIALOG_MULTICHANNEL_REPEAT_LAYOUT (
|
||||
|
||||
m_cbCopyPlacement->SetValue( data->m_options.m_copyPlacement );
|
||||
m_cbCopyRouting->SetValue( data->m_options.m_copyRouting );
|
||||
m_cbCopyOnlyConnectedRouting->SetValue( data->m_options.m_connectedRoutingOnly );
|
||||
m_cbGroupItems->SetValue( data->m_options.m_groupItems );
|
||||
m_cbCopyOtherItems->SetValue( data->m_options.m_copyOtherItems );
|
||||
m_cbIncludeLockedComponents->SetValue( data->m_options.m_includeLockedItems );
|
||||
@ -132,6 +133,7 @@ bool DIALOG_MULTICHANNEL_REPEAT_LAYOUT::TransferDataFromWindow()
|
||||
|
||||
data->m_options.m_copyPlacement = m_cbCopyPlacement->GetValue();
|
||||
data->m_options.m_copyRouting = m_cbCopyRouting->GetValue();
|
||||
data->m_options.m_connectedRoutingOnly = m_cbCopyOnlyConnectedRouting->GetValue();
|
||||
data->m_options.m_copyOtherItems = m_cbCopyOtherItems->GetValue();
|
||||
data->m_options.m_groupItems = m_cbGroupItems->GetValue();
|
||||
data->m_options.m_includeLockedItems = m_cbIncludeLockedComponents->GetValue();
|
||||
|
@ -266,7 +266,7 @@
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Reference Rule Area:</property>
|
||||
<property name="label">Reference rule area:</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
@ -571,69 +571,145 @@
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="false">
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="false">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</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="drag_accept_files">0</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">Copy routing</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="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxBoxSizer" expanded="true">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_cbCopyRouting</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">; ; forward_declare</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>
|
||||
<property name="name">bSizer5</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="false">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="false">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</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="drag_accept_files">0</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">Copy routing</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_cbCopyRouting</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">; ; forward_declare</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>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</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">1</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="drag_accept_files">0</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">Restrict to routing connected within the area</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_cbCopyOnlyConnectedRouting</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">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip">Can be useful if unrelated tracks pass through the area</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>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="false">
|
||||
@ -865,7 +941,7 @@
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Remove locked items from target rule areas</property>
|
||||
<property name="label">Include locked items</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
@ -886,7 +962,7 @@
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="tooltip">Copy from reference area + delete / update in target area if included</property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
|
@ -56,7 +56,7 @@ DIALOG_MULTICHANNEL_REPEAT_LAYOUT_BASE::DIALOG_MULTICHANNEL_REPEAT_LAYOUT_BASE(
|
||||
wxBoxSizer* bSizer4;
|
||||
bSizer4 = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_staticText1 = new wxStaticText( this, wxID_ANY, _("Reference Rule Area:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText1 = new wxStaticText( this, wxID_ANY, _("Reference rule area:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText1->Wrap( -1 );
|
||||
bSizer4->Add( m_staticText1, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
@ -93,8 +93,20 @@ DIALOG_MULTICHANNEL_REPEAT_LAYOUT_BASE::DIALOG_MULTICHANNEL_REPEAT_LAYOUT_BASE(
|
||||
m_cbCopyPlacement = new wxCheckBox( this, wxID_ANY, _("Copy footprint placement"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer13->Add( m_cbCopyPlacement, 0, wxALL, 5 );
|
||||
|
||||
wxBoxSizer* bSizer5;
|
||||
bSizer5 = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_cbCopyRouting = new wxCheckBox( this, wxID_ANY, _("Copy routing"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer13->Add( m_cbCopyRouting, 0, wxALL, 5 );
|
||||
bSizer5->Add( m_cbCopyRouting, 0, wxALL, 5 );
|
||||
|
||||
m_cbCopyOnlyConnectedRouting = new wxCheckBox( this, wxID_ANY, _("Restrict to routing connected within the area"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_cbCopyOnlyConnectedRouting->SetValue(true);
|
||||
m_cbCopyOnlyConnectedRouting->SetToolTip( _("Can be useful if unrelated tracks pass through the area") );
|
||||
|
||||
bSizer5->Add( m_cbCopyOnlyConnectedRouting, 0, wxALL, 5 );
|
||||
|
||||
|
||||
bSizer13->Add( bSizer5, 1, wxEXPAND, 5 );
|
||||
|
||||
m_cbCopyOtherItems = new wxCheckBox( this, wxID_ANY, _("Copy other items"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_cbCopyOtherItems->SetToolTip( _("Copy text, shapes, zones, and other items inside the source rule area") );
|
||||
@ -109,7 +121,9 @@ DIALOG_MULTICHANNEL_REPEAT_LAYOUT_BASE::DIALOG_MULTICHANNEL_REPEAT_LAYOUT_BASE(
|
||||
m_cbGroupItems = new wxCheckBox( this, wxID_ANY, _("Group items with their target rule areas"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer13->Add( m_cbGroupItems, 0, wxALL, 5 );
|
||||
|
||||
m_cbIncludeLockedComponents = new wxCheckBox( this, wxID_ANY, _("Remove locked items from target rule areas"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_cbIncludeLockedComponents = new wxCheckBox( this, wxID_ANY, _("Include locked items"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_cbIncludeLockedComponents->SetToolTip( _("Copy from reference area + delete / update in target area if included") );
|
||||
|
||||
bSizer13->Add( m_cbIncludeLockedComponents, 0, wxALL, 5 );
|
||||
|
||||
|
||||
|
@ -42,6 +42,7 @@ class DIALOG_MULTICHANNEL_REPEAT_LAYOUT_BASE : public DIALOG_SHIM
|
||||
wxChoice* m_refAnchorFp;
|
||||
wxCheckBox* m_cbCopyPlacement;
|
||||
wxCheckBox* m_cbCopyRouting;
|
||||
wxCheckBox* m_cbCopyOnlyConnectedRouting;
|
||||
wxCheckBox* m_cbCopyOtherItems;
|
||||
wxCheckBox* m_cbIncludeOffRAComponents;
|
||||
wxCheckBox* m_cbGroupItems;
|
||||
|
@ -737,6 +737,18 @@ bool MULTICHANNEL_TOOL::copyRuleAreaContents( TMATCH::COMPONENT_MATCHES& aMatche
|
||||
|
||||
wxLogTrace( traceMultichannelTool, wxT("copying routing: %d fps\n"), (int) aMatches.size() );
|
||||
|
||||
std::set<int> refc;
|
||||
std::set<int> targc;
|
||||
|
||||
for( auto& fpPair : aMatches )
|
||||
{
|
||||
for( PAD* pad : fpPair.first->Pads() )
|
||||
refc.insert( pad->GetNetCode() );
|
||||
|
||||
for( PAD* pad : fpPair.second->Pads() )
|
||||
targc.insert( pad->GetNetCode() );
|
||||
}
|
||||
|
||||
findRouting( targetRouting, connectivity, targetPoly, aTargetArea, aOpts );
|
||||
findRouting( refRouting, connectivity, refPoly, aRefArea, aOpts );
|
||||
|
||||
@ -744,6 +756,8 @@ bool MULTICHANNEL_TOOL::copyRuleAreaContents( TMATCH::COMPONENT_MATCHES& aMatche
|
||||
{
|
||||
if( item->IsLocked() && !aOpts.m_includeLockedItems )
|
||||
continue;
|
||||
if (aOpts.m_connectedRoutingOnly && !targc.contains(static_cast<BOARD_CONNECTED_ITEM*>( item )->GetNetCode()))
|
||||
continue;
|
||||
// item already removed
|
||||
if( aCommit->GetStatus( item ) != 0 )
|
||||
continue;
|
||||
@ -757,6 +771,10 @@ bool MULTICHANNEL_TOOL::copyRuleAreaContents( TMATCH::COMPONENT_MATCHES& aMatche
|
||||
|
||||
for( BOARD_ITEM* item : refRouting )
|
||||
{
|
||||
if( item->IsLocked() && !aOpts.m_includeLockedItems )
|
||||
continue;
|
||||
if (aOpts.m_connectedRoutingOnly && !refc.contains(static_cast<BOARD_CONNECTED_ITEM*>( item )->GetNetCode()))
|
||||
continue;
|
||||
if( !aRefArea->m_area->GetLayerSet().Contains( item->GetLayer() ) )
|
||||
continue;
|
||||
|
||||
@ -836,6 +854,9 @@ bool MULTICHANNEL_TOOL::copyRuleAreaContents( TMATCH::COMPONENT_MATCHES& aMatche
|
||||
&& item->GetParent()->Type() == PCB_FOOTPRINT_T )
|
||||
continue;
|
||||
|
||||
if( item->IsLocked() && !aOpts.m_includeLockedItems )
|
||||
continue;
|
||||
|
||||
BOARD_ITEM* copied = nullptr;
|
||||
|
||||
if( item->Type() != PCB_ZONE_T )
|
||||
|
@ -48,6 +48,7 @@ enum class REPEAT_LAYOUT_EDGE_MODE
|
||||
struct REPEAT_LAYOUT_OPTIONS
|
||||
{
|
||||
bool m_copyRouting = true;
|
||||
bool m_connectedRoutingOnly = false;
|
||||
bool m_copyPlacement = true;
|
||||
bool m_copyOtherItems = true;
|
||||
bool m_groupItems = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user