STEP/BREP export: expose Net Filter option in the UI.

This commit is contained in:
Alex Shvartzkop 2024-04-25 21:10:31 +03:00
parent ef62b01dd1
commit 22c4fa29f1
4 changed files with 149 additions and 2 deletions

View File

@ -123,6 +123,7 @@ private:
static bool m_exportZones; // remember last preference to export zones (stored only for the session)
static bool m_fuseShapes; // remember last preference to fuse shapes (stored only for the session)
static bool m_exportInnerCopper; // remember last preference to export inner layers (stored only for the session)
wxString m_netFilter; // filter copper nets
wxString m_boardPath; // path to the exported board file
static int m_toleranceLastChoice; // Store m_tolerance option during a session
};
@ -185,6 +186,7 @@ DIALOG_EXPORT_STEP::DIALOG_EXPORT_STEP( PCB_EDIT_FRAME* aParent, const wxString&
m_noUnspecified = cfg->m_ExportStep.no_unspecified;
m_noDNP = cfg->m_ExportStep.no_dnp;
m_txtNetFilter->SetValue( m_netFilter );
m_cbOptimizeStep->SetValue( m_optimizeStep );
m_cbExportBody->SetValue( m_exportBoardBody );
m_cbExportComponents->SetValue( m_exportComponents );
@ -283,6 +285,7 @@ DIALOG_EXPORT_STEP::~DIALOG_EXPORT_STEP()
cfg->m_ExportStep.no_dnp = m_cbRemoveDNP->GetValue();
}
m_netFilter = m_txtNetFilter->GetValue();
m_toleranceLastChoice = m_choiceTolerance->GetSelection();
m_optimizeStep = m_cbOptimizeStep->GetValue();
m_exportBoardBody = m_cbExportBody->GetValue();
@ -394,6 +397,8 @@ void DIALOG_EXPORT_STEP::onExportButton( wxCommandEvent& aEvent )
return;
}
m_netFilter = m_txtNetFilter->GetValue();
double tolerance; // default value in mm
m_toleranceLastChoice = m_choiceTolerance->GetSelection();
m_optimizeStep = m_cbOptimizeStep->GetValue();
@ -508,13 +513,17 @@ void DIALOG_EXPORT_STEP::onExportButton( wxCommandEvent& aEvent )
if( m_fuseShapes )
cmdK2S.Append( wxT( " --fuse-shapes" ) );
// TODO: --net-filter
// Note: for some reason, using \" to insert a quote in a format string, under MacOS
// wxString::Format does not work. So use a %c format in string
int quote = '\'';
int dblquote = '"';
if( !m_netFilter.empty() )
{
cmdK2S.Append( wxString::Format( wxT( " --net-filter %c%s%c" ), dblquote, m_netFilter,
dblquote ) );
}
switch( GetOriginOption() )
{
case STEP_ORIGIN_0:

View File

@ -193,6 +193,15 @@ DIALOG_EXPORT_STEP_BASE::DIALOG_EXPORT_STEP_BASE( wxWindow* parent, wxWindowID i
sbOtherOptions->Add( m_cbExportSolderpaste_hidden, 0, wxBOTTOM|wxRIGHT, 5 );
m_staticTextNetFilter = new wxStaticText( sbOtherOptions->GetStaticBox(), wxID_ANY, _("Net filter (supports wildcards):"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextNetFilter->Wrap( -1 );
sbOtherOptions->Add( m_staticTextNetFilter, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
m_txtNetFilter = new wxTextCtrl( sbOtherOptions->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_txtNetFilter->SetToolTip( _("Only copper items belonging to nets matching this filter will be exported.") );
sbOtherOptions->Add( m_txtNetFilter, 0, wxALL|wxEXPAND, 5 );
m_staticTextTolerance = new wxStaticText( sbOtherOptions->GetStaticBox(), wxID_ANY, _("Board outline chaining tolerance:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextTolerance->Wrap( -1 );
sbOtherOptions->Add( m_staticTextTolerance, 0, wxLEFT|wxRIGHT|wxTOP, 5 );

View File

@ -2079,6 +2079,133 @@
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxLEFT|wxRIGHT|wxTOP</property>
<property name="proportion">0</property>
<object class="wxStaticText" 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"></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="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">Net filter (supports wildcards):</property>
<property name="markup">0</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_staticTextNetFilter</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="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" 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"></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="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="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="maxlength"></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_txtNetFilter</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">Only copper items belonging to nets matching this filter will be exported.</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="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxLEFT|wxRIGHT|wxTOP</property>

View File

@ -77,6 +77,8 @@ class DIALOG_EXPORT_STEP_BASE : public DIALOG_SHIM
wxCheckBox* m_cbExportSilkscreen_hidden;
wxCheckBox* m_cbExportSoldermask_hidden;
wxCheckBox* m_cbExportSolderpaste_hidden;
wxStaticText* m_staticTextNetFilter;
wxTextCtrl* m_txtNetFilter;
wxStaticText* m_staticTextTolerance;
wxChoice* m_choiceTolerance;
wxStdDialogButtonSizer* m_sdbSizer;