Fix a few wording issues in dialogs (dialog plot and dialog move exact) for translators (more explicit words/sentences to remove ambiguities).
Pcbnew: Plot files: for copper layers, create suffix from user copper layer names instead of default copper layer names, like in last stable Kicad version (bzr 4022), to build the plot files filenames. Better test of illegal chars in plot filename, both in plot dialog and functions aclled by Python scripts. Fix a Plotcontroller issue to make SetUseGerberExtensions() work as expected from Python scripts ( from Henner Zeller'patch with a fix to be sure it works properly from a Python script) Note also using Protel Gerber Extensions is now a bad practice, because the official Gerber extension is .gbr since X2 Gerber version. But some users still use them)
This commit is contained in:
parent
9aba2f2683
commit
4dc2ece011
|
@ -110,7 +110,7 @@ DIALOG_ERC_BASE::DIALOG_ERC_BASE( wxWindow* parent, wxWindowID id, const wxStrin
|
|||
wxBoxSizer* m_panelMatrixSizer;
|
||||
m_panelMatrixSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_ResetOptButton = new wxButton( m_PanelERCOptions, ID_RESET_MATRIX, _("Reset"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_ResetOptButton = new wxButton( m_PanelERCOptions, ID_RESET_MATRIX, _("Initialize to Default"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_panelMatrixSizer->Add( m_ResetOptButton, 0, wxALIGN_RIGHT|wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_matrixPanel = new wxPanel( m_PanelERCOptions, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
|
|
|
@ -1653,7 +1653,7 @@
|
|||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">ID_RESET_MATRIX</property>
|
||||
<property name="label">Reset</property>
|
||||
<property name="label">Initialize to Default</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
// some define to choose how copper layers widgets are shown
|
||||
|
||||
// if defined, display only active copper layers
|
||||
// if not displays always 1=the full set (16 layers)
|
||||
// if not displays always 1=the full set (32 copper layers)
|
||||
#define HIDE_INACTIVE_LAYERS
|
||||
|
||||
// if defined, use the layer manager copper layers order (from FRONT to BACK)
|
||||
|
@ -405,7 +405,6 @@ void DIALOG_LAYERS_SETUP::showBoardLayerNames()
|
|||
if( ctl )
|
||||
{
|
||||
wxString lname = m_pcb->GetLayerName( layer );
|
||||
|
||||
//D(printf("layerName[%d]=%s\n", layer, TO_UTF8( lname ) );)
|
||||
|
||||
if( ctl->IsKindOf( CLASSINFO(wxTextCtrl) ) )
|
||||
|
@ -423,7 +422,6 @@ void DIALOG_LAYERS_SETUP::showSelectedLayerCheckBoxes( LSET enabledLayers )
|
|||
for( LSEQ seq = dlg_layers(); seq; ++seq )
|
||||
{
|
||||
LAYER_ID layer = *seq;
|
||||
|
||||
setLayerCheckBox( layer, enabledLayers[layer] );
|
||||
}
|
||||
}
|
||||
|
@ -614,11 +612,8 @@ void DIALOG_LAYERS_SETUP::OnOkButtonClick( wxCommandEvent& event )
|
|||
if( m_enabledLayers[layer] )
|
||||
{
|
||||
name = getLayerName( layer );
|
||||
|
||||
m_pcb->SetLayerName( layer, name );
|
||||
|
||||
LAYER_T t = (LAYER_T) getLayerTypeIndex( layer );
|
||||
|
||||
m_pcb->SetLayerType( layer, t );
|
||||
}
|
||||
}
|
||||
|
@ -695,7 +690,10 @@ bool DIALOG_LAYERS_SETUP::testLayerNames()
|
|||
// 4) cannot be 'signal'
|
||||
// 5) must be unique.
|
||||
// 6) cannot have illegal chars in filenames ( some filenames are built from layer names )
|
||||
static const wxString badchars( wxT("%$\" /\\") );
|
||||
// like : % $ \ " / :
|
||||
|
||||
wxString badchars = wxFileName::GetForbiddenChars(wxPATH_DOS);
|
||||
badchars.Append( '%' );
|
||||
|
||||
if( !name )
|
||||
{
|
||||
|
|
|
@ -170,12 +170,6 @@ void DIALOG_MOVE_EXACT::OnClear( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
|
||||
void DIALOG_MOVE_EXACT::OnCancelClick( wxCommandEvent& event )
|
||||
{
|
||||
EndModal( wxID_ABORT );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_MOVE_EXACT::OnOkClick( wxCommandEvent& event )
|
||||
{
|
||||
m_rotation = DoubleValueFromString( DEGREES, m_rotEntry->GetValue() );
|
||||
|
@ -191,7 +185,7 @@ void DIALOG_MOVE_EXACT::OnOkClick( wxCommandEvent& event )
|
|||
m_yEntry->GetValue().ToDouble( &m_options.entry2 );
|
||||
m_rotEntry->GetValue().ToDouble( &m_options.entryRotation );
|
||||
|
||||
EndModal( wxID_OK );
|
||||
event.Skip();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -183,7 +183,7 @@
|
|||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxFlexGridSizer" expanded="1">
|
||||
<property name="cols">4</property>
|
||||
|
@ -456,9 +456,9 @@
|
|||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" expanded="1">
|
||||
<object class="wxButton" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
|
@ -469,7 +469,6 @@
|
|||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap">Load From Art Provider; wxART_DELETE; wxART_BUTTON</property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
|
@ -478,20 +477,17 @@
|
|||
<property name="context_menu">1</property>
|
||||
<property name="default">0</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="disabled"></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="focus"></property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="hover"></property>
|
||||
<property name="id">wxID_CLEAR</property>
|
||||
<property name="label">Clear</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Reset</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
|
@ -507,10 +503,9 @@
|
|||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="selected"></property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxBU_AUTODRAW</property>
|
||||
<property name="style">wxBU_EXACTFIT</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
|
@ -806,9 +801,9 @@
|
|||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" expanded="1">
|
||||
<object class="wxButton" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
|
@ -819,7 +814,6 @@
|
|||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap">Load From Art Provider; wxART_DELETE; wxART_BUTTON</property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
|
@ -828,20 +822,17 @@
|
|||
<property name="context_menu">1</property>
|
||||
<property name="default">0</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="disabled"></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="focus"></property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="hover"></property>
|
||||
<property name="id">wxID_CLEAR</property>
|
||||
<property name="label">Clear</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Reset</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
|
@ -857,10 +848,9 @@
|
|||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="selected"></property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxBU_AUTODRAW</property>
|
||||
<property name="style">wxBU_EXACTFIT</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
|
@ -1156,9 +1146,9 @@
|
|||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" expanded="1">
|
||||
<object class="wxButton" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
|
@ -1169,7 +1159,6 @@
|
|||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap">Load From Art Provider; wxART_DELETE; wxART_BUTTON</property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
|
@ -1178,20 +1167,17 @@
|
|||
<property name="context_menu">1</property>
|
||||
<property name="default">0</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="disabled"></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="focus"></property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="hover"></property>
|
||||
<property name="id">wxID_CLEAR</property>
|
||||
<property name="label">Clear</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Reset</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
|
@ -1207,10 +1193,9 @@
|
|||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="selected"></property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxBU_AUTODRAW</property>
|
||||
<property name="style">wxBU_EXACTFIT</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
|
@ -1347,7 +1332,7 @@
|
|||
<property name="name">m_stdButtons</property>
|
||||
<property name="permission">protected</property>
|
||||
<event name="OnApplyButtonClick"></event>
|
||||
<event name="OnCancelButtonClick">OnCancelClick</event>
|
||||
<event name="OnCancelButtonClick"></event>
|
||||
<event name="OnContextHelpButtonClick"></event>
|
||||
<event name="OnHelpButtonClick"></event>
|
||||
<event name="OnNoButtonClick"></event>
|
||||
|
|
|
@ -52,7 +52,6 @@ private:
|
|||
void OnPolarChanged( wxCommandEvent& event );
|
||||
void OnClear( wxCommandEvent& event );
|
||||
|
||||
void OnCancelClick( wxCommandEvent& event );
|
||||
void OnOkClick( wxCommandEvent& event );
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Jun 5 2014)
|
||||
// C++ code generated with wxFormBuilder (version Jun 17 2015)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
|
@ -36,8 +36,8 @@ DIALOG_MOVE_EXACT_BASE::DIALOG_MOVE_EXACT_BASE( wxWindow* parent, wxWindowID id,
|
|||
m_xUnit->Wrap( -1 );
|
||||
fgSizer2->Add( m_xUnit, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxALL, 5 );
|
||||
|
||||
m_clearX = new wxBitmapButton( this, wxID_CLEAR, wxArtProvider::GetBitmap( wxART_DELETE, wxART_BUTTON ), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
|
||||
fgSizer2->Add( m_clearX, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
m_clearX = new wxButton( this, wxID_ANY, _("Reset"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
|
||||
fgSizer2->Add( m_clearX, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||
|
||||
m_yLabel = new wxStaticText( this, wxID_ANY, _("y:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_yLabel->Wrap( -1 );
|
||||
|
@ -50,8 +50,8 @@ DIALOG_MOVE_EXACT_BASE::DIALOG_MOVE_EXACT_BASE( wxWindow* parent, wxWindowID id,
|
|||
m_yUnit->Wrap( -1 );
|
||||
fgSizer2->Add( m_yUnit, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||
|
||||
m_clearY = new wxBitmapButton( this, wxID_CLEAR, wxArtProvider::GetBitmap( wxART_DELETE, wxART_BUTTON ), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
|
||||
fgSizer2->Add( m_clearY, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
m_clearY = new wxButton( this, wxID_ANY, _("Reset"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
|
||||
fgSizer2->Add( m_clearY, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||
|
||||
m_rotLabel = new wxStaticText( this, wxID_ANY, _("Item rotation:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_rotLabel->Wrap( -1 );
|
||||
|
@ -64,11 +64,11 @@ DIALOG_MOVE_EXACT_BASE::DIALOG_MOVE_EXACT_BASE( wxWindow* parent, wxWindowID id,
|
|||
m_rotUnit->Wrap( -1 );
|
||||
fgSizer2->Add( m_rotUnit, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||
|
||||
m_clearRot = new wxBitmapButton( this, wxID_CLEAR, wxArtProvider::GetBitmap( wxART_DELETE, wxART_BUTTON ), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
|
||||
fgSizer2->Add( m_clearRot, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
m_clearRot = new wxButton( this, wxID_ANY, _("Reset"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
|
||||
fgSizer2->Add( m_clearRot, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||
|
||||
|
||||
bMainSizer->Add( fgSizer2, 1, wxEXPAND, 5 );
|
||||
bMainSizer->Add( fgSizer2, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 );
|
||||
|
||||
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
bMainSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
|
||||
|
@ -96,7 +96,6 @@ DIALOG_MOVE_EXACT_BASE::DIALOG_MOVE_EXACT_BASE( wxWindow* parent, wxWindowID id,
|
|||
m_clearY->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnClear ), NULL, this );
|
||||
m_rotEntry->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_MOVE_EXACT_BASE::OnTextFocusLost ), NULL, this );
|
||||
m_clearRot->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnClear ), NULL, this );
|
||||
m_stdButtonsCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnCancelClick ), NULL, this );
|
||||
m_stdButtonsOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnOkClick ), NULL, this );
|
||||
}
|
||||
|
||||
|
@ -111,7 +110,6 @@ DIALOG_MOVE_EXACT_BASE::~DIALOG_MOVE_EXACT_BASE()
|
|||
m_clearY->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnClear ), NULL, this );
|
||||
m_rotEntry->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_MOVE_EXACT_BASE::OnTextFocusLost ), NULL, this );
|
||||
m_clearRot->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnClear ), NULL, this );
|
||||
m_stdButtonsCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnCancelClick ), NULL, this );
|
||||
m_stdButtonsOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnOkClick ), NULL, this );
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Jun 5 2014)
|
||||
// C++ code generated with wxFormBuilder (version Jun 17 2015)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
|
@ -22,10 +22,6 @@ class DIALOG_SHIM;
|
|||
#include <wx/settings.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/bitmap.h>
|
||||
#include <wx/image.h>
|
||||
#include <wx/icon.h>
|
||||
#include <wx/bmpbuttn.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/statline.h>
|
||||
|
@ -46,15 +42,15 @@ class DIALOG_MOVE_EXACT_BASE : public DIALOG_SHIM
|
|||
wxStaticText* m_xLabel;
|
||||
wxTextCtrl* m_xEntry;
|
||||
wxStaticText* m_xUnit;
|
||||
wxBitmapButton* m_clearX;
|
||||
wxButton* m_clearX;
|
||||
wxStaticText* m_yLabel;
|
||||
wxTextCtrl* m_yEntry;
|
||||
wxStaticText* m_yUnit;
|
||||
wxBitmapButton* m_clearY;
|
||||
wxButton* m_clearY;
|
||||
wxStaticText* m_rotLabel;
|
||||
wxTextCtrl* m_rotEntry;
|
||||
wxStaticText* m_rotUnit;
|
||||
wxBitmapButton* m_clearRot;
|
||||
wxButton* m_clearRot;
|
||||
wxStaticLine* m_staticline1;
|
||||
wxStdDialogButtonSizer* m_stdButtons;
|
||||
wxButton* m_stdButtonsOK;
|
||||
|
@ -65,7 +61,6 @@ class DIALOG_MOVE_EXACT_BASE : public DIALOG_SHIM
|
|||
virtual void OnPolarChanged( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnTextFocusLost( wxFocusEvent& event ) { event.Skip(); }
|
||||
virtual void OnClear( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
|
|
|
@ -790,11 +790,12 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event )
|
|||
// Use Gerber Extensions based on layer number
|
||||
// (See http://en.wikipedia.org/wiki/Gerber_File)
|
||||
if( m_plotOpts.GetFormat() == PLOT_FORMAT_GERBER && m_useGerberExtensions->GetValue() )
|
||||
file_ext = GetGerberExtension( layer );
|
||||
file_ext = GetGerberProtelExtension( layer );
|
||||
|
||||
// Create file name (from the English layer name for non copper layers).
|
||||
// Create file name (from the English default layer name for non copper layers).
|
||||
BuildPlotFileName( &fn, outputDir.GetPath(),
|
||||
m_board->GetStandardLayerName( layer ),
|
||||
// m_board->GetStandardLayerName( layer ),
|
||||
m_board->GetLayerName( layer ),
|
||||
file_ext );
|
||||
|
||||
LOCALE_IO toggle;
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
#include <build_version.h>
|
||||
|
||||
|
||||
const wxString GetGerberExtension( LAYER_NUM aLayer )
|
||||
const wxString GetGerberProtelExtension( LAYER_NUM aLayer )
|
||||
{
|
||||
if( IsCopperLayer( aLayer ) )
|
||||
{
|
||||
|
@ -286,28 +286,32 @@ void AddGerberX2Attribute( PLOTTER * aPlotter,
|
|||
}
|
||||
|
||||
|
||||
void BuildPlotFileName( wxFileName* aFilename,
|
||||
const wxString& aOutputDir,
|
||||
const wxString& aSuffix,
|
||||
const wxString& aExtension )
|
||||
void BuildPlotFileName( wxFileName* aFilename, const wxString& aOutputDir,
|
||||
const wxString& aSuffix, const wxString& aExtension )
|
||||
{
|
||||
// aFilename contains the base filename only (without path and extension)
|
||||
// when calling this function.
|
||||
// It is expected to be a valid filename (this is usually the board filename)
|
||||
aFilename->SetPath( aOutputDir );
|
||||
|
||||
// Set the file extension
|
||||
aFilename->SetExt( aExtension );
|
||||
|
||||
/* remove leading and trailing spaces if any from the suffix, if
|
||||
something survives add it to the name;
|
||||
also the suffix can contain some not allowed chars in filename (/ \ .),
|
||||
so change them to underscore
|
||||
*/
|
||||
// remove leading and trailing spaces if any from the suffix, if
|
||||
// something survives add it to the name;
|
||||
// also the suffix can contain some not allowed chars in filename (/ \ . :),
|
||||
// so change them to underscore
|
||||
// Remember it can be called from a python script, so the illegal chars
|
||||
// have to be filtered here.
|
||||
wxString suffix = aSuffix;
|
||||
suffix.Trim( true );
|
||||
suffix.Trim( false );
|
||||
|
||||
suffix.Replace( wxT("."), wxT("_") );
|
||||
suffix.Replace( wxT("/"), wxT("_") );
|
||||
suffix.Replace( wxT("\\"), wxT("_") );
|
||||
wxString badchars = wxFileName::GetForbiddenChars(wxPATH_DOS);
|
||||
badchars.Append( '%' );
|
||||
|
||||
for( unsigned ii = 0; ii < badchars.Len(); ii++ )
|
||||
suffix.Replace( badchars[ii], wxT("_") );
|
||||
|
||||
if( !suffix.IsEmpty() )
|
||||
aFilename->SetName( aFilename->GetName() + wxT( "-" ) + suffix );
|
||||
|
@ -368,9 +372,18 @@ bool PLOT_CONTROLLER::OpenPlotfile( const wxString &aSuffix,
|
|||
if( EnsureFileDirectoryExists( &outputDir, boardFilename ) )
|
||||
{
|
||||
wxFileName fn( boardFilename );
|
||||
BuildPlotFileName( &fn, outputDirName, aSuffix, GetDefaultPlotExtension( aFormat ) );
|
||||
wxString fileExt = GetDefaultPlotExtension( aFormat );
|
||||
|
||||
m_plotter = StartPlotBoard( m_board, &GetPlotOptions(), ToLAYER_ID( GetLayer() ), fn.GetFullPath(), aSheetDesc );
|
||||
// Gerber format can use specific file ext, depending on layers
|
||||
// (now not a good practice, because the official file ext is .gbr)
|
||||
if( GetPlotOptions().GetFormat() == PLOT_FORMAT_GERBER &&
|
||||
GetPlotOptions().GetUseGerberExtensions() )
|
||||
fileExt = GetGerberProtelExtension( GetLayer() );
|
||||
|
||||
BuildPlotFileName( &fn, outputDirName, aSuffix, fileExt );
|
||||
|
||||
m_plotter = StartPlotBoard( m_board, &GetPlotOptions(), ToLAYER_ID( GetLayer() ),
|
||||
fn.GetFullPath(), aSheetDesc );
|
||||
}
|
||||
|
||||
return( m_plotter != NULL );
|
||||
|
|
|
@ -246,10 +246,12 @@ void BuildPlotFileName( wxFileName* aFilename,
|
|||
|
||||
|
||||
/**
|
||||
* Function GetGerberExtension
|
||||
* Function GetGerberProtelExtension
|
||||
* @return the appropriate Gerber file extension for \a aLayer
|
||||
* used by Protel, and still sometimes in use (although the
|
||||
* official Gerber Ext is now .gbr)
|
||||
*/
|
||||
const wxString GetGerberExtension( LAYER_NUM aLayer );
|
||||
const wxString GetGerberProtelExtension( LAYER_NUM aLayer );
|
||||
|
||||
/**
|
||||
* Function GetGerberFileFunctionAttribute
|
||||
|
|
Loading…
Reference in New Issue