12 changed files with 4583 additions and 3011 deletions
-
11pcbnew/CMakeLists.txt
-
542pcbnew/dialogs/dialog_plot_base.cpp
-
5991pcbnew/dialogs/dialog_plot_base.fbp
-
214pcbnew/dialogs/dialog_plot_base.h
-
33pcbnew/ioascii.cpp
-
387pcbnew/pcb_plot_params.cpp
-
144pcbnew/pcb_plot_params.h
-
28pcbnew/pcb_plot_params.keywords
-
29pcbnew/pcbnew_config.cpp
-
152pcbnew/pcbplot.cpp
-
62pcbnew/pcbplot.h
-
1pcbnew/printout_controler.cpp
@ -1,271 +1,271 @@ |
|||
///////////////////////////////////////////////////////////////////////////
|
|||
// C++ code generated with wxFormBuilder (version Sep 8 2010)
|
|||
// http://www.wxformbuilder.org/
|
|||
//
|
|||
// PLEASE DO "NOT" EDIT THIS FILE!
|
|||
///////////////////////////////////////////////////////////////////////////
|
|||
|
|||
#include "dialog_plot_base.h"
|
|||
|
|||
///////////////////////////////////////////////////////////////////////////
|
|||
|
|||
DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) |
|||
{ |
|||
this->SetSizeHints( wxSize( -1,350 ), wxDefaultSize ); |
|||
|
|||
wxBoxSizer* bMainSizer; |
|||
bMainSizer = new wxBoxSizer( wxVERTICAL ); |
|||
|
|||
wxBoxSizer* bUpperSizer; |
|||
bUpperSizer = new wxBoxSizer( wxHORIZONTAL ); |
|||
|
|||
wxBoxSizer* bLeftSizer; |
|||
bLeftSizer = new wxBoxSizer( wxVERTICAL ); |
|||
|
|||
wxStaticBoxSizer* sbLayersSizer; |
|||
sbLayersSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Layers:") ), wxHORIZONTAL ); |
|||
|
|||
m_CopperLayersBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Copper Layers:") ), wxVERTICAL ); |
|||
|
|||
sbLayersSizer->Add( m_CopperLayersBoxSizer, 1, wxALL, 5 ); |
|||
|
|||
m_TechnicalLayersBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Technical Layers:") ), wxVERTICAL ); |
|||
|
|||
sbLayersSizer->Add( m_TechnicalLayersBoxSizer, 1, wxALL, 5 ); |
|||
|
|||
bLeftSizer->Add( sbLayersSizer, 1, wxEXPAND, 5 ); |
|||
|
|||
m_useGerberExtensions = new wxCheckBox( this, wxID_ANY, _("Use proper Gerber extensions"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_useGerberExtensions->SetToolTip( _("Use Proper Gerber Extensions - .GBL, .GTL, etc...") ); |
|||
|
|||
bLeftSizer->Add( m_useGerberExtensions, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_excludeEdgeLayerOpt = new wxCheckBox( this, wxID_ANY, _("Exclude pcb edge layer"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_excludeEdgeLayerOpt->SetToolTip( _("Exclude contents of the pcb edge layer from all other layers") ); |
|||
|
|||
bLeftSizer->Add( m_excludeEdgeLayerOpt, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_subtractMaskFromSilk = new wxCheckBox( this, wxID_ANY, _("Subtract mask from silk"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_subtractMaskFromSilk->SetToolTip( _("Remove silkscreen from areas without soldermask") ); |
|||
|
|||
bLeftSizer->Add( m_subtractMaskFromSilk, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_plotSheetRef = new wxCheckBox( this, wxID_ANY, _("Plot sheet reference"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
bLeftSizer->Add( m_plotSheetRef, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_plotPads_on_Silkscreen = new wxCheckBox( this, ID_ALLOW_PRINT_PAD_ON_SILKSCREEN, _("Plot pads on silkscreen"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_plotPads_on_Silkscreen->SetToolTip( _("Enable/disable print/plot pads on silkscreen layers\nWhen disable, pads are never potted on silkscreen layers\nWhen enable, pads are potted only if they appear on silkscreen layers") ); |
|||
|
|||
bLeftSizer->Add( m_plotPads_on_Silkscreen, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_plotModuleValueOpt = new wxCheckBox( this, wxID_ANY, _("Plot module value"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
bLeftSizer->Add( m_plotModuleValueOpt, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_plotModuleRefOpt = new wxCheckBox( this, ID_PRINT_REF, _("Plot module reference"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
bLeftSizer->Add( m_plotModuleRefOpt, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_plotTextOther = new wxCheckBox( this, wxID_ANY, _("Plot other module texts"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_plotTextOther->SetToolTip( _("Enable/disable print/plot module field texts on silkscreen layers") ); |
|||
|
|||
bLeftSizer->Add( m_plotTextOther, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_plotInvisibleText = new wxCheckBox( this, wxID_ANY, _("Force plot invisible texts"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_plotInvisibleText->SetToolTip( _("Force print/plot module invisible texts on silkscreen layers") ); |
|||
|
|||
bLeftSizer->Add( m_plotInvisibleText, 0, wxALL, 5 ); |
|||
|
|||
bUpperSizer->Add( bLeftSizer, 2, wxEXPAND, 5 ); |
|||
|
|||
wxBoxSizer* bPlotOptionsSizer; |
|||
bPlotOptionsSizer = new wxBoxSizer( wxVERTICAL ); |
|||
|
|||
wxString m_drillShapeOptChoices[] = { _("No drill mark"), _("Small mark"), _("Actual hole") }; |
|||
int m_drillShapeOptNChoices = sizeof( m_drillShapeOptChoices ) / sizeof( wxString ); |
|||
m_drillShapeOpt = new wxRadioBox( this, wxID_ANY, _("Holes Options"), wxDefaultPosition, wxDefaultSize, m_drillShapeOptNChoices, m_drillShapeOptChoices, 1, wxRA_SPECIFY_COLS ); |
|||
m_drillShapeOpt->SetSelection( 2 ); |
|||
bPlotOptionsSizer->Add( m_drillShapeOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
wxString m_scaleOptChoices[] = { _("Auto scale"), _("Scale 1"), _("Scale 1.5"), _("Scale 2"), _("Scale 3") }; |
|||
int m_scaleOptNChoices = sizeof( m_scaleOptChoices ) / sizeof( wxString ); |
|||
m_scaleOpt = new wxRadioBox( this, wxID_ANY, _("Scale Opt"), wxDefaultPosition, wxDefaultSize, m_scaleOptNChoices, m_scaleOptChoices, 1, wxRA_SPECIFY_COLS ); |
|||
m_scaleOpt->SetSelection( 0 ); |
|||
bPlotOptionsSizer->Add( m_scaleOpt, 0, wxEXPAND|wxALL, 5 ); |
|||
|
|||
wxString m_plotModeOptChoices[] = { _("Line"), _("Filled"), _("Sketch") }; |
|||
int m_plotModeOptNChoices = sizeof( m_plotModeOptChoices ) / sizeof( wxString ); |
|||
m_plotModeOpt = new wxRadioBox( this, wxID_ANY, _("Plot Mode"), wxDefaultPosition, wxDefaultSize, m_plotModeOptNChoices, m_plotModeOptChoices, 1, wxRA_SPECIFY_COLS ); |
|||
m_plotModeOpt->SetSelection( 0 ); |
|||
bPlotOptionsSizer->Add( m_plotModeOpt, 0, wxALL|wxEXPAND, 5 ); |
|||
|
|||
wxString m_choicePlotOffsetChoices[] = { _("Absolute"), _("Auxiliary axis") }; |
|||
int m_choicePlotOffsetNChoices = sizeof( m_choicePlotOffsetChoices ) / sizeof( wxString ); |
|||
m_choicePlotOffset = new wxRadioBox( this, wxID_ANY, _("Plot Origin"), wxDefaultPosition, wxDefaultSize, m_choicePlotOffsetNChoices, m_choicePlotOffsetChoices, 1, wxRA_SPECIFY_COLS ); |
|||
m_choicePlotOffset->SetSelection( 0 ); |
|||
bPlotOptionsSizer->Add( m_choicePlotOffset, 0, wxALL|wxEXPAND, 5 ); |
|||
|
|||
bUpperSizer->Add( bPlotOptionsSizer, 0, wxEXPAND, 5 ); |
|||
|
|||
wxBoxSizer* bSizerFmtPlot; |
|||
bSizerFmtPlot = new wxBoxSizer( wxVERTICAL ); |
|||
|
|||
wxString m_plotFormatOptChoices[] = { _("HPGL"), _("Gerber"), _("Postscript"), _("Postscript A4"), _("DXF export") }; |
|||
int m_plotFormatOptNChoices = sizeof( m_plotFormatOptChoices ) / sizeof( wxString ); |
|||
m_plotFormatOpt = new wxRadioBox( this, wxID_ANY, _("Plot Format"), wxDefaultPosition, wxDefaultSize, m_plotFormatOptNChoices, m_plotFormatOptChoices, 1, wxRA_SPECIFY_COLS ); |
|||
m_plotFormatOpt->SetSelection( 4 ); |
|||
bSizerFmtPlot->Add( m_plotFormatOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
wxStaticBoxSizer* m_HPGL_OptionsBox; |
|||
m_HPGL_OptionsBox = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("HPGL Options:") ), wxVERTICAL ); |
|||
|
|||
m_textPenSize = new wxStaticText( this, wxID_ANY, _("Pen size"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_textPenSize->Wrap( -1 ); |
|||
m_HPGL_OptionsBox->Add( m_textPenSize, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_HPGLPenSizeOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_HPGL_OptionsBox->Add( m_HPGLPenSizeOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_staticText3 = new wxStaticText( this, wxID_ANY, _("Pen Speed (cm/s)"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText3->Wrap( -1 ); |
|||
m_HPGL_OptionsBox->Add( m_staticText3, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_HPGLPenSpeedOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_HPGLPenSpeedOpt->SetToolTip( _("Set pen speed in cm/s") ); |
|||
|
|||
m_HPGL_OptionsBox->Add( m_HPGLPenSpeedOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); |
|||
|
|||
m_textPenOvr = new wxStaticText( this, wxID_ANY, _("Pen ovr"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_textPenOvr->Wrap( -1 ); |
|||
m_HPGL_OptionsBox->Add( m_textPenOvr, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_HPGLPenOverlayOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_HPGLPenOverlayOpt->SetToolTip( _("Set plot overlay for filling") ); |
|||
|
|||
m_HPGL_OptionsBox->Add( m_HPGLPenOverlayOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); |
|||
|
|||
bSizerFmtPlot->Add( m_HPGL_OptionsBox, 0, wxEXPAND, 5 ); |
|||
|
|||
bUpperSizer->Add( bSizerFmtPlot, 0, wxEXPAND, 5 ); |
|||
|
|||
wxBoxSizer* bButtonsSizer; |
|||
bButtonsSizer = new wxBoxSizer( wxVERTICAL ); |
|||
|
|||
wxStaticBoxSizer* sbSizerPlotOpt; |
|||
sbSizerPlotOpt = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Plot Options:") ), wxVERTICAL ); |
|||
|
|||
m_plotPSNegativeOpt = new wxCheckBox( this, wxID_ANY, _("Plot negative"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
sbSizerPlotOpt->Add( m_plotPSNegativeOpt, 0, wxALL, 5 ); |
|||
|
|||
m_plotMirrorOpt = new wxCheckBox( this, ID_MIROR_OPT, _("Plot mirror"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
sbSizerPlotOpt->Add( m_plotMirrorOpt, 0, wxALL, 5 ); |
|||
|
|||
m_plotNoViaOnMaskOpt = new wxCheckBox( this, wxID_ANY, _("Vias on mask"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_plotNoViaOnMaskOpt->SetToolTip( _("Print/plot vias on mask layers. They are in this case not protected") ); |
|||
|
|||
sbSizerPlotOpt->Add( m_plotNoViaOnMaskOpt, 0, wxALL, 5 ); |
|||
|
|||
bButtonsSizer->Add( sbSizerPlotOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_staticText6 = new wxStaticText( this, wxID_ANY, _("Default pen size"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText6->Wrap( -1 ); |
|||
m_staticText6->SetToolTip( _("Pen size used to draw items that have no pen size specified.\nUsed mainly to draw items in sketch mode.") ); |
|||
|
|||
bButtonsSizer->Add( m_staticText6, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_linesWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
bButtonsSizer->Add( m_linesWidth, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
|
|||
bButtonsSizer->Add( 0, 20, 1, wxEXPAND, 5 ); |
|||
|
|||
m_staticText7 = new wxStaticText( this, wxID_ANY, _("X scale adjust"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText7->Wrap( -1 ); |
|||
bButtonsSizer->Add( m_staticText7, 0, wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_fineAdjustXscaleOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_fineAdjustXscaleOpt->SetToolTip( _("Set X scale adjust for exact scale plotting") ); |
|||
|
|||
bButtonsSizer->Add( m_fineAdjustXscaleOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_staticText8 = new wxStaticText( this, wxID_ANY, _("Y scale adjust"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText8->Wrap( -1 ); |
|||
bButtonsSizer->Add( m_staticText8, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_fineAdjustYscaleOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
bButtonsSizer->Add( m_fineAdjustYscaleOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
|
|||
bButtonsSizer->Add( 0, 20, 1, wxEXPAND, 5 ); |
|||
|
|||
m_plotButton = new wxButton( this, wxID_ANY, _("Plot"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_plotButton->SetDefault(); |
|||
bButtonsSizer->Add( m_plotButton, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); |
|||
|
|||
m_buttonSaveOpt = new wxButton( this, ID_SAVE_OPT_PLOT, _("Save Options"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
bButtonsSizer->Add( m_buttonSaveOpt, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); |
|||
|
|||
m_buttonDrill = new wxButton( this, ID_CREATE_DRILL_FILE, _("Generate drill file"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
bButtonsSizer->Add( m_buttonDrill, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); |
|||
|
|||
m_buttonQuit = new wxButton( this, wxID_CANCEL, _("Quit"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
bButtonsSizer->Add( m_buttonQuit, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); |
|||
|
|||
bUpperSizer->Add( bButtonsSizer, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); |
|||
|
|||
bMainSizer->Add( bUpperSizer, 0, wxEXPAND, 5 ); |
|||
|
|||
wxBoxSizer* bSizerDirChoice; |
|||
bSizerDirChoice = new wxBoxSizer( wxVERTICAL ); |
|||
|
|||
m_staticTextDir = new wxStaticText( this, wxID_ANY, _("Output Directory:"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticTextDir->Wrap( -1 ); |
|||
bSizerDirChoice->Add( m_staticTextDir, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
wxBoxSizer* bSizerDirNmae; |
|||
bSizerDirNmae = new wxBoxSizer( wxHORIZONTAL ); |
|||
|
|||
m_outputDirectoryName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
bSizerDirNmae->Add( m_outputDirectoryName, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_browseButton = new wxButton( this, wxID_ANY, _("Browse..."), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
bSizerDirNmae->Add( m_browseButton, 0, wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
bSizerDirChoice->Add( bSizerDirNmae, 0, wxRIGHT|wxEXPAND, 5 ); |
|||
|
|||
bMainSizer->Add( bSizerDirChoice, 0, wxEXPAND, 5 ); |
|||
|
|||
m_staticText2 = new wxStaticText( this, wxID_ANY, _("Messages:"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText2->Wrap( -1 ); |
|||
bMainSizer->Add( m_staticText2, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_messagesBox = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE ); |
|||
m_messagesBox->SetMinSize( wxSize( -1,120 ) ); |
|||
|
|||
bMainSizer->Add( m_messagesBox, 1, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); |
|||
|
|||
this->SetSizer( bMainSizer ); |
|||
this->Layout(); |
|||
|
|||
// Connect Events
|
|||
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PLOT_BASE::OnCloseWindow ) ); |
|||
this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_PLOT_BASE::OnInitDialog ) ); |
|||
m_plotFormatOpt->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::SetPlotFormat ), NULL, this ); |
|||
m_plotButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::Plot ), NULL, this ); |
|||
m_buttonSaveOpt->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::savePlotOptions ), NULL, this ); |
|||
m_buttonDrill->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::CreateDrillFile ), NULL, this ); |
|||
m_buttonQuit->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnQuit ), NULL, this ); |
|||
m_browseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnOutputDirectoryBrowseClicked ), NULL, this ); |
|||
} |
|||
|
|||
DIALOG_PLOT_BASE::~DIALOG_PLOT_BASE() |
|||
{ |
|||
// Disconnect Events
|
|||
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PLOT_BASE::OnCloseWindow ) ); |
|||
this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_PLOT_BASE::OnInitDialog ) ); |
|||
m_plotFormatOpt->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::SetPlotFormat ), NULL, this ); |
|||
m_plotButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::Plot ), NULL, this ); |
|||
m_buttonSaveOpt->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::savePlotOptions ), NULL, this ); |
|||
m_buttonDrill->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::CreateDrillFile ), NULL, this ); |
|||
m_buttonQuit->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnQuit ), NULL, this ); |
|||
m_browseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnOutputDirectoryBrowseClicked ), NULL, this ); |
|||
|
|||
} |
|||
///////////////////////////////////////////////////////////////////////////
|
|||
// C++ code generated with wxFormBuilder (version Nov 18 2010)
|
|||
// http://www.wxformbuilder.org/
|
|||
//
|
|||
// PLEASE DO "NOT" EDIT THIS FILE!
|
|||
///////////////////////////////////////////////////////////////////////////
|
|||
|
|||
#include "dialog_plot_base.h"
|
|||
|
|||
///////////////////////////////////////////////////////////////////////////
|
|||
|
|||
DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) |
|||
{ |
|||
this->SetSizeHints( wxSize( -1,350 ), wxDefaultSize ); |
|||
|
|||
wxBoxSizer* bMainSizer; |
|||
bMainSizer = new wxBoxSizer( wxVERTICAL ); |
|||
|
|||
wxBoxSizer* bUpperSizer; |
|||
bUpperSizer = new wxBoxSizer( wxHORIZONTAL ); |
|||
|
|||
wxBoxSizer* bLeftSizer; |
|||
bLeftSizer = new wxBoxSizer( wxVERTICAL ); |
|||
|
|||
wxStaticBoxSizer* sbLayersSizer; |
|||
sbLayersSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Layers") ), wxHORIZONTAL ); |
|||
|
|||
m_CopperLayersBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Copper Layers") ), wxVERTICAL ); |
|||
|
|||
sbLayersSizer->Add( m_CopperLayersBoxSizer, 1, wxALL, 5 ); |
|||
|
|||
m_TechnicalLayersBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Technical Layers") ), wxVERTICAL ); |
|||
|
|||
sbLayersSizer->Add( m_TechnicalLayersBoxSizer, 1, wxALL, 5 ); |
|||
|
|||
bLeftSizer->Add( sbLayersSizer, 1, wxEXPAND, 5 ); |
|||
|
|||
m_useGerberExtensions = new wxCheckBox( this, wxID_ANY, _("Use proper Gerber extensions"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_useGerberExtensions->SetToolTip( _("Use Proper Gerber Extensions - .GBL, .GTL, etc...") ); |
|||
|
|||
bLeftSizer->Add( m_useGerberExtensions, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_excludeEdgeLayerOpt = new wxCheckBox( this, wxID_ANY, _("Exclude pcb edge layer"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_excludeEdgeLayerOpt->SetToolTip( _("Exclude contents of the pcb edge layer from all other layers") ); |
|||
|
|||
bLeftSizer->Add( m_excludeEdgeLayerOpt, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_subtractMaskFromSilk = new wxCheckBox( this, wxID_ANY, _("Subtract mask from silk"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_subtractMaskFromSilk->SetToolTip( _("Remove silkscreen from areas without soldermask") ); |
|||
|
|||
bLeftSizer->Add( m_subtractMaskFromSilk, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_plotSheetRef = new wxCheckBox( this, wxID_ANY, _("Plot sheet reference"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
bLeftSizer->Add( m_plotSheetRef, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_plotPads_on_Silkscreen = new wxCheckBox( this, ID_ALLOW_PRINT_PAD_ON_SILKSCREEN, _("Plot pads on silkscreen"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_plotPads_on_Silkscreen->SetToolTip( _("Enable/disable print/plot pads on silkscreen layers\nWhen disable, pads are never potted on silkscreen layers\nWhen enable, pads are potted only if they appear on silkscreen layers") ); |
|||
|
|||
bLeftSizer->Add( m_plotPads_on_Silkscreen, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_plotModuleValueOpt = new wxCheckBox( this, wxID_ANY, _("Plot module value"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
bLeftSizer->Add( m_plotModuleValueOpt, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_plotModuleRefOpt = new wxCheckBox( this, ID_PRINT_REF, _("Plot module reference"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
bLeftSizer->Add( m_plotModuleRefOpt, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_plotTextOther = new wxCheckBox( this, wxID_ANY, _("Plot other module texts"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_plotTextOther->SetToolTip( _("Enable/disable print/plot module field texts on silkscreen layers") ); |
|||
|
|||
bLeftSizer->Add( m_plotTextOther, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_plotInvisibleText = new wxCheckBox( this, wxID_ANY, _("Force plot invisible texts"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_plotInvisibleText->SetToolTip( _("Force print/plot module invisible texts on silkscreen layers") ); |
|||
|
|||
bLeftSizer->Add( m_plotInvisibleText, 0, wxALL, 5 ); |
|||
|
|||
bUpperSizer->Add( bLeftSizer, 2, wxEXPAND, 5 ); |
|||
|
|||
wxBoxSizer* bPlotOptionsSizer; |
|||
bPlotOptionsSizer = new wxBoxSizer( wxVERTICAL ); |
|||
|
|||
wxString m_drillShapeOptChoices[] = { _("No drill mark"), _("Small mark"), _("Actual hole") }; |
|||
int m_drillShapeOptNChoices = sizeof( m_drillShapeOptChoices ) / sizeof( wxString ); |
|||
m_drillShapeOpt = new wxRadioBox( this, wxID_ANY, _("Hole Options"), wxDefaultPosition, wxDefaultSize, m_drillShapeOptNChoices, m_drillShapeOptChoices, 1, wxRA_SPECIFY_COLS ); |
|||
m_drillShapeOpt->SetSelection( 0 ); |
|||
bPlotOptionsSizer->Add( m_drillShapeOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
wxString m_scaleOptChoices[] = { _("Auto scale"), _("Scale 1"), _("Scale 1.5"), _("Scale 2"), _("Scale 3") }; |
|||
int m_scaleOptNChoices = sizeof( m_scaleOptChoices ) / sizeof( wxString ); |
|||
m_scaleOpt = new wxRadioBox( this, wxID_ANY, _("Scale"), wxDefaultPosition, wxDefaultSize, m_scaleOptNChoices, m_scaleOptChoices, 1, wxRA_SPECIFY_COLS ); |
|||
m_scaleOpt->SetSelection( 0 ); |
|||
bPlotOptionsSizer->Add( m_scaleOpt, 0, wxEXPAND|wxALL, 5 ); |
|||
|
|||
wxString m_plotModeOptChoices[] = { _("Line"), _("Filled"), _("Sketch") }; |
|||
int m_plotModeOptNChoices = sizeof( m_plotModeOptChoices ) / sizeof( wxString ); |
|||
m_plotModeOpt = new wxRadioBox( this, wxID_ANY, _("Plot Mode"), wxDefaultPosition, wxDefaultSize, m_plotModeOptNChoices, m_plotModeOptChoices, 1, wxRA_SPECIFY_COLS ); |
|||
m_plotModeOpt->SetSelection( 0 ); |
|||
bPlotOptionsSizer->Add( m_plotModeOpt, 0, wxALL|wxEXPAND, 5 ); |
|||
|
|||
wxString m_choicePlotOffsetChoices[] = { _("Absolute"), _("Auxiliary axis") }; |
|||
int m_choicePlotOffsetNChoices = sizeof( m_choicePlotOffsetChoices ) / sizeof( wxString ); |
|||
m_choicePlotOffset = new wxRadioBox( this, wxID_ANY, _("Plot Origin"), wxDefaultPosition, wxDefaultSize, m_choicePlotOffsetNChoices, m_choicePlotOffsetChoices, 1, wxRA_SPECIFY_COLS ); |
|||
m_choicePlotOffset->SetSelection( 1 ); |
|||
bPlotOptionsSizer->Add( m_choicePlotOffset, 0, wxALL|wxEXPAND, 5 ); |
|||
|
|||
bUpperSizer->Add( bPlotOptionsSizer, 0, wxEXPAND, 5 ); |
|||
|
|||
wxBoxSizer* bSizerFmtPlot; |
|||
bSizerFmtPlot = new wxBoxSizer( wxVERTICAL ); |
|||
|
|||
wxString m_plotFormatOptChoices[] = { _("HPGL"), _("Gerber"), _("Postscript"), _("Postscript A4"), _("DXF export") }; |
|||
int m_plotFormatOptNChoices = sizeof( m_plotFormatOptChoices ) / sizeof( wxString ); |
|||
m_plotFormatOpt = new wxRadioBox( this, wxID_ANY, _("Plot Format"), wxDefaultPosition, wxDefaultSize, m_plotFormatOptNChoices, m_plotFormatOptChoices, 1, wxRA_SPECIFY_COLS ); |
|||
m_plotFormatOpt->SetSelection( 1 ); |
|||
bSizerFmtPlot->Add( m_plotFormatOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
wxStaticBoxSizer* m_HPGL_OptionsBox; |
|||
m_HPGL_OptionsBox = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("HPGL Options") ), wxVERTICAL ); |
|||
|
|||
m_textPenSize = new wxStaticText( this, wxID_ANY, _("Pen size"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_textPenSize->Wrap( -1 ); |
|||
m_HPGL_OptionsBox->Add( m_textPenSize, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_HPGLPenSizeOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_HPGL_OptionsBox->Add( m_HPGLPenSizeOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_staticText3 = new wxStaticText( this, wxID_ANY, _("Pen speed (cm/s)"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText3->Wrap( -1 ); |
|||
m_HPGL_OptionsBox->Add( m_staticText3, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_HPGLPenSpeedOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_HPGLPenSpeedOpt->SetToolTip( _("Set pen speed in cm/s") ); |
|||
|
|||
m_HPGL_OptionsBox->Add( m_HPGLPenSpeedOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); |
|||
|
|||
m_textPenOvr = new wxStaticText( this, wxID_ANY, _("Pen overlay"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_textPenOvr->Wrap( -1 ); |
|||
m_HPGL_OptionsBox->Add( m_textPenOvr, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_HPGLPenOverlayOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_HPGLPenOverlayOpt->SetToolTip( _("Set plot overlay for filling") ); |
|||
|
|||
m_HPGL_OptionsBox->Add( m_HPGLPenOverlayOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); |
|||
|
|||
bSizerFmtPlot->Add( m_HPGL_OptionsBox, 0, wxEXPAND, 5 ); |
|||
|
|||
bUpperSizer->Add( bSizerFmtPlot, 0, wxEXPAND, 5 ); |
|||
|
|||
wxBoxSizer* bButtonsSizer; |
|||
bButtonsSizer = new wxBoxSizer( wxVERTICAL ); |
|||
|
|||
wxStaticBoxSizer* sbSizerPlotOpt; |
|||
sbSizerPlotOpt = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Plot Options") ), wxVERTICAL ); |
|||
|
|||
m_plotPSNegativeOpt = new wxCheckBox( this, wxID_ANY, _("Plot negative"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
sbSizerPlotOpt->Add( m_plotPSNegativeOpt, 0, wxALL, 5 ); |
|||
|
|||
m_plotMirrorOpt = new wxCheckBox( this, ID_MIROR_OPT, _("Plot mirror"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
sbSizerPlotOpt->Add( m_plotMirrorOpt, 0, wxALL, 5 ); |
|||
|
|||
m_plotNoViaOnMaskOpt = new wxCheckBox( this, wxID_ANY, _("Vias on mask"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_plotNoViaOnMaskOpt->SetToolTip( _("Print/plot vias on mask layers. They are in this case not protected") ); |
|||
|
|||
sbSizerPlotOpt->Add( m_plotNoViaOnMaskOpt, 0, wxALL, 5 ); |
|||
|
|||
bButtonsSizer->Add( sbSizerPlotOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_staticText6 = new wxStaticText( this, wxID_ANY, _("Default Pen Size:"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText6->Wrap( -1 ); |
|||
m_staticText6->SetToolTip( _("Pen size used to draw items that have no pen size specified.\nUsed mainly to draw items in sketch mode.") ); |
|||
|
|||
bButtonsSizer->Add( m_staticText6, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_linesWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
bButtonsSizer->Add( m_linesWidth, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
|
|||
bButtonsSizer->Add( 0, 20, 1, wxEXPAND, 5 ); |
|||
|
|||
m_staticText7 = new wxStaticText( this, wxID_ANY, _("X Scale Adjust:"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText7->Wrap( -1 ); |
|||
bButtonsSizer->Add( m_staticText7, 0, wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_fineAdjustXscaleOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_fineAdjustXscaleOpt->SetToolTip( _("Set X scale adjust for exact scale plotting") ); |
|||
|
|||
bButtonsSizer->Add( m_fineAdjustXscaleOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_staticText8 = new wxStaticText( this, wxID_ANY, _("Y Scale Adjust:"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText8->Wrap( -1 ); |
|||
bButtonsSizer->Add( m_staticText8, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_fineAdjustYscaleOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
bButtonsSizer->Add( m_fineAdjustYscaleOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
|
|||
bButtonsSizer->Add( 0, 20, 1, wxEXPAND, 5 ); |
|||
|
|||
m_plotButton = new wxButton( this, wxID_ANY, _("Plot"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_plotButton->SetDefault(); |
|||
bButtonsSizer->Add( m_plotButton, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); |
|||
|
|||
m_buttonSaveOpt = new wxButton( this, ID_SAVE_OPT_PLOT, _("Apply Settings"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
bButtonsSizer->Add( m_buttonSaveOpt, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); |
|||
|
|||
m_buttonDrill = new wxButton( this, ID_CREATE_DRILL_FILE, _("Generate Drill File"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
bButtonsSizer->Add( m_buttonDrill, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); |
|||
|
|||
m_buttonQuit = new wxButton( this, wxID_CANCEL, _("Quit"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
bButtonsSizer->Add( m_buttonQuit, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); |
|||
|
|||
bUpperSizer->Add( bButtonsSizer, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); |
|||
|
|||
bMainSizer->Add( bUpperSizer, 0, wxEXPAND, 5 ); |
|||
|
|||
wxBoxSizer* bSizerDirChoice; |
|||
bSizerDirChoice = new wxBoxSizer( wxVERTICAL ); |
|||
|
|||
m_staticTextDir = new wxStaticText( this, wxID_ANY, _("Output Directory:"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticTextDir->Wrap( -1 ); |
|||
bSizerDirChoice->Add( m_staticTextDir, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
wxBoxSizer* bSizerDirNmae; |
|||
bSizerDirNmae = new wxBoxSizer( wxHORIZONTAL ); |
|||
|
|||
m_outputDirectoryName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
bSizerDirNmae->Add( m_outputDirectoryName, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_browseButton = new wxButton( this, wxID_ANY, _("Browse..."), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
bSizerDirNmae->Add( m_browseButton, 0, wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
bSizerDirChoice->Add( bSizerDirNmae, 0, wxRIGHT|wxEXPAND, 5 ); |
|||
|
|||
bMainSizer->Add( bSizerDirChoice, 0, wxEXPAND, 5 ); |
|||
|
|||
m_staticText2 = new wxStaticText( this, wxID_ANY, _("Messages:"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText2->Wrap( -1 ); |
|||
bMainSizer->Add( m_staticText2, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_messagesBox = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE ); |
|||
m_messagesBox->SetMinSize( wxSize( -1,120 ) ); |
|||
|
|||
bMainSizer->Add( m_messagesBox, 1, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); |
|||
|
|||
this->SetSizer( bMainSizer ); |
|||
this->Layout(); |
|||
|
|||
// Connect Events
|
|||
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PLOT_BASE::OnCloseWindow ) ); |
|||
this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_PLOT_BASE::OnInitDialog ) ); |
|||
m_plotFormatOpt->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::SetPlotFormat ), NULL, this ); |
|||
m_plotButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::Plot ), NULL, this ); |
|||
m_buttonSaveOpt->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::applyPlotSettings ), NULL, this ); |
|||
m_buttonDrill->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::CreateDrillFile ), NULL, this ); |
|||
m_buttonQuit->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnQuit ), NULL, this ); |
|||
m_browseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnOutputDirectoryBrowseClicked ), NULL, this ); |
|||
} |
|||
|
|||
DIALOG_PLOT_BASE::~DIALOG_PLOT_BASE() |
|||
{ |
|||
// Disconnect Events
|
|||
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PLOT_BASE::OnCloseWindow ) ); |
|||
this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_PLOT_BASE::OnInitDialog ) ); |
|||
m_plotFormatOpt->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::SetPlotFormat ), NULL, this ); |
|||
m_plotButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::Plot ), NULL, this ); |
|||
m_buttonSaveOpt->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::applyPlotSettings ), NULL, this ); |
|||
m_buttonDrill->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::CreateDrillFile ), NULL, this ); |
|||
m_buttonQuit->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnQuit ), NULL, this ); |
|||
m_browseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnOutputDirectoryBrowseClicked ), NULL, this ); |
|||
|
|||
} |
|||
5991
pcbnew/dialogs/dialog_plot_base.fbp
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,107 +1,107 @@ |
|||
/////////////////////////////////////////////////////////////////////////// |
|||
// C++ code generated with wxFormBuilder (version Sep 8 2010) |
|||
// http://www.wxformbuilder.org/ |
|||
// |
|||
// PLEASE DO "NOT" EDIT THIS FILE! |
|||
/////////////////////////////////////////////////////////////////////////// |
|||
|
|||
#ifndef __dialog_plot_base__ |
|||
#define __dialog_plot_base__ |
|||
|
|||
#include <wx/intl.h> |
|||
|
|||
#include <wx/string.h> |
|||
#include <wx/sizer.h> |
|||
#include <wx/statbox.h> |
|||
#include <wx/gdicmn.h> |
|||
#include <wx/checkbox.h> |
|||
#include <wx/font.h> |
|||
#include <wx/colour.h> |
|||
#include <wx/settings.h> |
|||
#include <wx/radiobox.h> |
|||
#include <wx/stattext.h> |
|||
#include <wx/textctrl.h> |
|||
#include <wx/button.h> |
|||
#include <wx/dialog.h> |
|||
|
|||
/////////////////////////////////////////////////////////////////////////// |
|||
|
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
/// Class DIALOG_PLOT_BASE |
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
class DIALOG_PLOT_BASE : public wxDialog |
|||
{ |
|||
private: |
|||
|
|||
protected: |
|||
enum |
|||
{ |
|||
ID_ALLOW_PRINT_PAD_ON_SILKSCREEN = 1000, |
|||
ID_PRINT_REF, |
|||
ID_MIROR_OPT, |
|||
ID_SAVE_OPT_PLOT, |
|||
ID_CREATE_DRILL_FILE, |
|||
}; |
|||
|
|||
wxStaticBoxSizer* m_CopperLayersBoxSizer; |
|||
wxStaticBoxSizer* m_TechnicalLayersBoxSizer; |
|||
wxCheckBox* m_useGerberExtensions; |
|||
wxCheckBox* m_excludeEdgeLayerOpt; |
|||
wxCheckBox* m_subtractMaskFromSilk; |
|||
wxCheckBox* m_plotSheetRef; |
|||
wxCheckBox* m_plotPads_on_Silkscreen; |
|||
wxCheckBox* m_plotModuleValueOpt; |
|||
wxCheckBox* m_plotModuleRefOpt; |
|||
wxCheckBox* m_plotTextOther; |
|||
wxCheckBox* m_plotInvisibleText; |
|||
wxRadioBox* m_drillShapeOpt; |
|||
wxRadioBox* m_scaleOpt; |
|||
wxRadioBox* m_plotModeOpt; |
|||
wxRadioBox* m_choicePlotOffset; |
|||
wxRadioBox* m_plotFormatOpt; |
|||
wxStaticText* m_textPenSize; |
|||
wxTextCtrl* m_HPGLPenSizeOpt; |
|||
wxStaticText* m_staticText3; |
|||
wxTextCtrl* m_HPGLPenSpeedOpt; |
|||
wxStaticText* m_textPenOvr; |
|||
wxTextCtrl* m_HPGLPenOverlayOpt; |
|||
wxCheckBox* m_plotPSNegativeOpt; |
|||
wxCheckBox* m_plotMirrorOpt; |
|||
wxCheckBox* m_plotNoViaOnMaskOpt; |
|||
wxStaticText* m_staticText6; |
|||
wxTextCtrl* m_linesWidth; |
|||
|
|||
wxStaticText* m_staticText7; |
|||
wxTextCtrl* m_fineAdjustXscaleOpt; |
|||
wxStaticText* m_staticText8; |
|||
wxTextCtrl* m_fineAdjustYscaleOpt; |
|||
|
|||
wxButton* m_plotButton; |
|||
wxButton* m_buttonSaveOpt; |
|||
wxButton* m_buttonDrill; |
|||
wxButton* m_buttonQuit; |
|||
wxStaticText* m_staticTextDir; |
|||
wxTextCtrl* m_outputDirectoryName; |
|||
wxButton* m_browseButton; |
|||
wxStaticText* m_staticText2; |
|||
wxTextCtrl* m_messagesBox; |
|||
|
|||
// Virtual event handlers, overide them in your derived class |
|||
virtual void OnCloseWindow( wxCloseEvent& event ) { event.Skip(); } |
|||
virtual void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); } |
|||
virtual void SetPlotFormat( wxCommandEvent& event ) { event.Skip(); } |
|||
virtual void Plot( wxCommandEvent& event ) { event.Skip(); } |
|||
virtual void savePlotOptions( wxCommandEvent& event ) { event.Skip(); } |
|||
virtual void CreateDrillFile( wxCommandEvent& event ) { event.Skip(); } |
|||
virtual void OnQuit( wxCommandEvent& event ) { event.Skip(); } |
|||
virtual void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) { event.Skip(); } |
|||
|
|||
|
|||
public: |
|||
|
|||
DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Plot"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 571,616 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); |
|||
~DIALOG_PLOT_BASE(); |
|||
|
|||
}; |
|||
|
|||
#endif //__dialog_plot_base__ |
|||
/////////////////////////////////////////////////////////////////////////// |
|||
// C++ code generated with wxFormBuilder (version Nov 18 2010) |
|||
// http://www.wxformbuilder.org/ |
|||
// |
|||
// PLEASE DO "NOT" EDIT THIS FILE! |
|||
/////////////////////////////////////////////////////////////////////////// |
|||
|
|||
#ifndef __dialog_plot_base__ |
|||
#define __dialog_plot_base__ |
|||
|
|||
#include <wx/intl.h> |
|||
|
|||
#include <wx/string.h> |
|||
#include <wx/sizer.h> |
|||
#include <wx/statbox.h> |
|||
#include <wx/gdicmn.h> |
|||
#include <wx/checkbox.h> |
|||
#include <wx/font.h> |
|||
#include <wx/colour.h> |
|||
#include <wx/settings.h> |
|||
#include <wx/radiobox.h> |
|||
#include <wx/stattext.h> |
|||
#include <wx/textctrl.h> |
|||
#include <wx/button.h> |
|||
#include <wx/dialog.h> |
|||
|
|||
/////////////////////////////////////////////////////////////////////////// |
|||
|
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
/// Class DIALOG_PLOT_BASE |
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
class DIALOG_PLOT_BASE : public wxDialog |
|||
{ |
|||
private: |
|||
|
|||
protected: |
|||
enum |
|||
{ |
|||
ID_ALLOW_PRINT_PAD_ON_SILKSCREEN = 1000, |
|||
ID_PRINT_REF, |
|||
ID_MIROR_OPT, |
|||
ID_SAVE_OPT_PLOT, |
|||
ID_CREATE_DRILL_FILE, |
|||
}; |
|||
|
|||
wxStaticBoxSizer* m_CopperLayersBoxSizer; |
|||
wxStaticBoxSizer* m_TechnicalLayersBoxSizer; |
|||
wxCheckBox* m_useGerberExtensions; |
|||
wxCheckBox* m_excludeEdgeLayerOpt; |
|||
wxCheckBox* m_subtractMaskFromSilk; |
|||
wxCheckBox* m_plotSheetRef; |
|||
wxCheckBox* m_plotPads_on_Silkscreen; |
|||
wxCheckBox* m_plotModuleValueOpt; |
|||
wxCheckBox* m_plotModuleRefOpt; |
|||
wxCheckBox* m_plotTextOther; |
|||
wxCheckBox* m_plotInvisibleText; |
|||
wxRadioBox* m_drillShapeOpt; |
|||
wxRadioBox* m_scaleOpt; |
|||
wxRadioBox* m_plotModeOpt; |
|||
wxRadioBox* m_choicePlotOffset; |
|||
wxRadioBox* m_plotFormatOpt; |
|||
wxStaticText* m_textPenSize; |
|||
wxTextCtrl* m_HPGLPenSizeOpt; |
|||
wxStaticText* m_staticText3; |
|||
wxTextCtrl* m_HPGLPenSpeedOpt; |
|||
wxStaticText* m_textPenOvr; |
|||
wxTextCtrl* m_HPGLPenOverlayOpt; |
|||
wxCheckBox* m_plotPSNegativeOpt; |
|||
wxCheckBox* m_plotMirrorOpt; |
|||
wxCheckBox* m_plotNoViaOnMaskOpt; |
|||
wxStaticText* m_staticText6; |
|||
wxTextCtrl* m_linesWidth; |
|||
|
|||
wxStaticText* m_staticText7; |
|||
wxTextCtrl* m_fineAdjustXscaleOpt; |
|||
wxStaticText* m_staticText8; |
|||
wxTextCtrl* m_fineAdjustYscaleOpt; |
|||
|
|||
wxButton* m_plotButton; |
|||
wxButton* m_buttonSaveOpt; |
|||
wxButton* m_buttonDrill; |
|||
wxButton* m_buttonQuit; |
|||
wxStaticText* m_staticTextDir; |
|||
wxTextCtrl* m_outputDirectoryName; |
|||
wxButton* m_browseButton; |
|||
wxStaticText* m_staticText2; |
|||
wxTextCtrl* m_messagesBox; |
|||
|
|||
// Virtual event handlers, overide them in your derived class |
|||
virtual void OnCloseWindow( wxCloseEvent& event ) { event.Skip(); } |
|||
virtual void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); } |
|||
virtual void SetPlotFormat( wxCommandEvent& event ) { event.Skip(); } |
|||
virtual void Plot( wxCommandEvent& event ) { event.Skip(); } |
|||
virtual void applyPlotSettings( wxCommandEvent& event ) { event.Skip(); } |
|||
virtual void CreateDrillFile( wxCommandEvent& event ) { event.Skip(); } |
|||
virtual void OnQuit( wxCommandEvent& event ) { event.Skip(); } |
|||
virtual void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) { event.Skip(); } |
|||
|
|||
|
|||
public: |
|||
|
|||
DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Plot"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 571,616 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); |
|||
~DIALOG_PLOT_BASE(); |
|||
|
|||
}; |
|||
|
|||
#endif //__dialog_plot_base__ |
|||
@ -0,0 +1,387 @@ |
|||
|
|||
/*
|
|||
* This program source code file is part of KICAD, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 1992-2011 Kicad Developers, see change_log.txt for contributors. |
|||
* |
|||
* This program is free software; you can redistribute it and/or |
|||
* modify it under the terms of the GNU General Public License |
|||
* as published by the Free Software Foundation; either version 2 |
|||
* of the License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program; if not, you may find one here: |
|||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|||
* or you may search the http://www.gnu.org website for the version 2 license,
|
|||
* or you may write to the Free Software Foundation, Inc., |
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|||
*/ |
|||
|
|||
#include <wx/wx.h>
|
|||
#include "pcb_plot_params.h"
|
|||
#include "pcb_plot_params_lexer.h"
|
|||
#include "layers_id_colors_and_visibility.h"
|
|||
#include "plot_common.h"
|
|||
#include "macros.h"
|
|||
|
|||
extern int g_DrawDefaultLineThickness; |
|||
|
|||
PCB_PLOT_PARAMS g_PcbPlotOptions; |
|||
|
|||
using namespace PCBPLOTPARAMS_T; |
|||
|
|||
static const char* GetTokenName( T aTok ) |
|||
{ |
|||
return PCB_PLOT_PARAMS_LEXER::TokenName( aTok ); |
|||
} |
|||
|
|||
|
|||
// PCB_PLOT_PARAMS
|
|||
|
|||
PCB_PLOT_PARAMS::PCB_PLOT_PARAMS() |
|||
{ |
|||
layerSelection = LAYER_BACK | LAYER_FRONT |
|||
| SILKSCREEN_LAYER_FRONT | SILKSCREEN_LAYER_BACK; |
|||
useGerberExtensions = true; |
|||
m_ExcludeEdgeLayer = true; |
|||
m_PlotLineWidth = g_DrawDefaultLineThickness; |
|||
m_PlotFrameRef = false; |
|||
m_PlotViaOnMaskLayer = false; |
|||
m_PlotMode = FILLED; |
|||
useAuxOrigin = false; |
|||
m_HPGLPenNum = 1; |
|||
m_HPGLPenSpeed = 20; |
|||
m_HPGLPenDiam = 15; |
|||
m_HPGLPenOvr = 2; |
|||
m_PlotPSColorOpt = true; |
|||
m_PlotPSNegative = false; |
|||
m_PlotReference = true; |
|||
m_PlotValue = true; |
|||
m_PlotTextOther = true; |
|||
m_PlotInvisibleTexts = false; |
|||
m_PlotPadsOnSilkLayer = false; |
|||
subtractMaskFromSilk = false; |
|||
m_PlotFormat = PLOT_FORMAT_GERBER; |
|||
m_PlotMirror = false; |
|||
m_DrillShapeOpt = SMALL_DRILL_SHAPE; |
|||
m_AutoScale = false; |
|||
m_PlotScale = 1.0; |
|||
scaleSelection = 1; |
|||
m_FineScaleAdjustX = 1.0; |
|||
m_FineScaleAdjustY = 1.0; |
|||
outputDirectory = wxT( "" ); |
|||
} |
|||
|
|||
|
|||
void PCB_PLOT_PARAMS::Format( OUTPUTFORMATTER* aFormatter, |
|||
int aNestLevel ) const throw( IO_ERROR ) |
|||
{ |
|||
const char* falseStr = GetTokenName( T_false ); |
|||
const char* trueStr = GetTokenName( T_true ); |
|||
|
|||
aFormatter->Print( aNestLevel, "(%s", GetTokenName( T_pcbplotparams ) ); |
|||
aFormatter->Print( aNestLevel+1, "(%s %ld)\n", GetTokenName( T_layerselection ), |
|||
layerSelection ); |
|||
aFormatter->Print( aNestLevel+1, "(%s %s)\n", GetTokenName( T_usegerberextensions ), |
|||
useGerberExtensions ? trueStr : falseStr ); |
|||
aFormatter->Print( aNestLevel+1, "(%s %s)\n", GetTokenName( T_excludeedgelayer ), |
|||
m_ExcludeEdgeLayer ? trueStr : falseStr ); |
|||
aFormatter->Print( aNestLevel+1, "(%s %d)\n", GetTokenName( T_linewidth ), |
|||
m_PlotLineWidth ); |
|||
aFormatter->Print( aNestLevel+1, "(%s %s)\n", GetTokenName( T_plotframeref ), |
|||
m_PlotFrameRef ? trueStr : falseStr ); |
|||
aFormatter->Print( aNestLevel+1, "(%s %s)\n", GetTokenName( T_viasonmask ), |
|||
m_PlotViaOnMaskLayer ? trueStr : falseStr ); |
|||
aFormatter->Print( aNestLevel+1, "(%s %d)\n", GetTokenName( T_mode ), |
|||
m_PlotMode ); |
|||
aFormatter->Print( aNestLevel+1, "(%s %s)\n", GetTokenName( T_useauxorigin ), |
|||
useAuxOrigin ? trueStr : falseStr ); |
|||
aFormatter->Print( aNestLevel+1, "(%s %d)\n", GetTokenName( T_hpglpennumber ), |
|||
m_HPGLPenNum ); |
|||
aFormatter->Print( aNestLevel+1, "(%s %d)\n", GetTokenName( T_hpglpenspeed ), |
|||
m_HPGLPenSpeed ); |
|||
aFormatter->Print( aNestLevel+1, "(%s %d)\n", GetTokenName( T_hpglpendiameter ), |
|||
m_HPGLPenDiam ); |
|||
aFormatter->Print( aNestLevel+1, "(%s %d)\n", GetTokenName( T_hpglpenoverlay ), |
|||
m_HPGLPenOvr ); |
|||
aFormatter->Print( aNestLevel+1, "(%s %s)\n", GetTokenName( T_pscolor ), |
|||
m_PlotPSColorOpt ? trueStr : falseStr ); |
|||
aFormatter->Print( aNestLevel+1, "(%s %s)\n", GetTokenName( T_psnegative ), |
|||
m_PlotPSNegative ? trueStr : falseStr ); |
|||
aFormatter->Print( aNestLevel+1, "(%s %s)\n", GetTokenName( T_plotreference ), |
|||
m_PlotReference ? trueStr : falseStr ); |
|||
aFormatter->Print( aNestLevel+1, "(%s %s)\n", GetTokenName( T_plotvalue ), |
|||
m_PlotValue ? trueStr : falseStr ); |
|||
aFormatter->Print( aNestLevel+1, "(%s %s)\n", GetTokenName( T_plotothertext ), |
|||
m_PlotTextOther ? trueStr : falseStr ); |
|||
aFormatter->Print( aNestLevel+1, "(%s %s)\n", GetTokenName( T_plotinvisibletext ), |
|||
m_PlotInvisibleTexts ? trueStr : falseStr ); |
|||
aFormatter->Print( aNestLevel+1, "(%s %s)\n", GetTokenName( T_padsonsilk ), |
|||
m_PlotPadsOnSilkLayer ? trueStr : falseStr ); |
|||
aFormatter->Print( aNestLevel+1, "(%s %s)\n", GetTokenName( T_subtractmaskfromsilk ), |
|||
subtractMaskFromSilk ? trueStr : falseStr ); |
|||
aFormatter->Print( aNestLevel+1, "(%s %d)\n", GetTokenName( T_outputformat ), |
|||
m_PlotFormat ); |
|||
aFormatter->Print( aNestLevel+1, "(%s %s)\n", GetTokenName( T_mirror ), |
|||
m_PlotMirror ? trueStr : falseStr ); |
|||
aFormatter->Print( aNestLevel+1, "(%s %d)\n", GetTokenName( T_drillshape ), |
|||
m_DrillShapeOpt ); |
|||
aFormatter->Print( aNestLevel+1, "(%s %d)\n", GetTokenName( T_scaleselection ), |
|||
scaleSelection ); |
|||
aFormatter->Print( aNestLevel+1, "(%s %s)\n", GetTokenName( T_outputdirectory ), |
|||
aFormatter->Quoted( CONV_TO_UTF8( outputDirectory ) ).c_str() ); |
|||
aFormatter->Print( 0, ")\n" ); |
|||
} |
|||
|
|||
|
|||
void PCB_PLOT_PARAMS::Parse( PCB_PLOT_PARAMS_PARSER* aParser ) throw( IO_ERROR, PARSE_ERROR ) |
|||
{ |
|||
aParser->Parse( this ); |
|||
} |
|||
|
|||
|
|||
PCB_PLOT_PARAMS& PCB_PLOT_PARAMS::operator=( const PCB_PLOT_PARAMS &aPcbPlotParams ) |
|||
{ |
|||
layerSelection = aPcbPlotParams.layerSelection; |
|||
useGerberExtensions = aPcbPlotParams.useGerberExtensions; |
|||
m_ExcludeEdgeLayer = aPcbPlotParams.m_ExcludeEdgeLayer; |
|||
m_PlotLineWidth = aPcbPlotParams.m_PlotLineWidth; |
|||
m_PlotFrameRef = aPcbPlotParams.m_PlotFrameRef; |
|||
m_PlotViaOnMaskLayer = aPcbPlotParams.m_PlotViaOnMaskLayer; |
|||
m_PlotMode = aPcbPlotParams.m_PlotMode; |
|||
useAuxOrigin = aPcbPlotParams.useAuxOrigin; |
|||
m_HPGLPenNum = aPcbPlotParams.m_HPGLPenNum; |
|||
m_HPGLPenSpeed = aPcbPlotParams.m_HPGLPenSpeed; |
|||
m_HPGLPenDiam = aPcbPlotParams.m_HPGLPenDiam; |
|||
m_HPGLPenOvr = aPcbPlotParams.m_HPGLPenOvr; |
|||
m_PlotPSColorOpt = aPcbPlotParams.m_PlotPSColorOpt; |
|||
m_PlotPSNegative = aPcbPlotParams.m_PlotPSNegative; |
|||
m_PlotReference = aPcbPlotParams.m_PlotReference; |
|||
m_PlotValue = aPcbPlotParams.m_PlotValue; |
|||
m_PlotTextOther = aPcbPlotParams.m_PlotTextOther; |
|||
m_PlotInvisibleTexts = aPcbPlotParams.m_PlotInvisibleTexts; |
|||
m_PlotPadsOnSilkLayer = aPcbPlotParams.m_PlotPadsOnSilkLayer; |
|||
subtractMaskFromSilk = aPcbPlotParams.subtractMaskFromSilk; |
|||
m_PlotFormat = aPcbPlotParams.m_PlotFormat; |
|||
m_PlotMirror = aPcbPlotParams.m_PlotMirror; |
|||
m_DrillShapeOpt = aPcbPlotParams.m_DrillShapeOpt; |
|||
scaleSelection = aPcbPlotParams.scaleSelection; |
|||
outputDirectory = aPcbPlotParams.outputDirectory; |
|||
return *this; |
|||
} |
|||
|
|||
|
|||
bool PCB_PLOT_PARAMS::operator==( const PCB_PLOT_PARAMS &aPcbPlotParams ) const |
|||
{ |
|||
if( layerSelection != aPcbPlotParams.layerSelection ) |
|||
return false; |
|||
if( useGerberExtensions != aPcbPlotParams.useGerberExtensions ) |
|||
return false; |
|||
if( m_ExcludeEdgeLayer != aPcbPlotParams.m_ExcludeEdgeLayer ) |
|||
return false; |
|||
if( m_PlotLineWidth != aPcbPlotParams.m_PlotLineWidth ) |
|||
return false; |
|||
if( m_PlotFrameRef != aPcbPlotParams.m_PlotFrameRef ) |
|||
return false; |
|||
if( m_PlotViaOnMaskLayer != aPcbPlotParams.m_PlotViaOnMaskLayer ) |
|||
return false; |
|||
if( m_PlotMode != aPcbPlotParams.m_PlotMode ) |
|||
return false; |
|||
if( useAuxOrigin != aPcbPlotParams.useAuxOrigin ) |
|||
return false; |
|||
if( m_HPGLPenNum != aPcbPlotParams.m_HPGLPenNum ) |
|||
return false; |
|||
if( m_HPGLPenSpeed != aPcbPlotParams.m_HPGLPenSpeed ) |
|||
return false; |
|||
if( m_HPGLPenDiam != aPcbPlotParams.m_HPGLPenDiam ) |
|||
return false; |
|||
if( m_HPGLPenOvr != aPcbPlotParams.m_HPGLPenOvr ) |
|||
return false; |
|||
if( m_PlotPSColorOpt != aPcbPlotParams.m_PlotPSColorOpt ) |
|||
return false; |
|||
if( m_PlotPSNegative != aPcbPlotParams.m_PlotPSNegative ) |
|||
return false; |
|||
if( m_PlotReference != aPcbPlotParams.m_PlotReference ) |
|||
return false; |
|||
if( m_PlotValue != aPcbPlotParams.m_PlotValue ) |
|||
return false; |
|||
if( m_PlotTextOther != aPcbPlotParams.m_PlotTextOther ) |
|||
return false; |
|||
if( m_PlotInvisibleTexts != aPcbPlotParams.m_PlotInvisibleTexts ) |
|||
return false; |
|||
if( m_PlotPadsOnSilkLayer != aPcbPlotParams.m_PlotPadsOnSilkLayer ) |
|||
return false; |
|||
if( subtractMaskFromSilk != aPcbPlotParams.subtractMaskFromSilk ) |
|||
return false; |
|||
if( m_PlotFormat != aPcbPlotParams.m_PlotFormat ) |
|||
return false; |
|||
if( m_PlotMirror != aPcbPlotParams.m_PlotMirror ) |
|||
return false; |
|||
if( m_DrillShapeOpt != aPcbPlotParams.m_DrillShapeOpt ) |
|||
return false; |
|||
if( scaleSelection != aPcbPlotParams.scaleSelection ) |
|||
return false; |
|||
if( !outputDirectory.IsSameAs( aPcbPlotParams.outputDirectory ) ) |
|||
return false; |
|||
return true; |
|||
} |
|||
|
|||
|
|||
bool PCB_PLOT_PARAMS::operator!=( const PCB_PLOT_PARAMS &aPcbPlotParams ) const |
|||
{ |
|||
return !( *this == aPcbPlotParams ); |
|||
} |
|||
|
|||
|
|||
// PCB_PLOT_PARAMS_PARSER
|
|||
|
|||
PCB_PLOT_PARAMS_PARSER::PCB_PLOT_PARAMS_PARSER( LINE_READER* aReader ) : |
|||
PCB_PLOT_PARAMS_LEXER( aReader ) |
|||
{ |
|||
} |
|||
|
|||
|
|||
PCB_PLOT_PARAMS_PARSER::PCB_PLOT_PARAMS_PARSER( char* aLine, wxString aSource ) : |
|||
PCB_PLOT_PARAMS_LEXER( aLine, aSource ) |
|||
{ |
|||
} |
|||
|
|||
|
|||
void PCB_PLOT_PARAMS_PARSER::Parse( PCB_PLOT_PARAMS* aPcbPlotParams ) throw( IO_ERROR, PARSE_ERROR ) |
|||
{ |
|||
T token; |
|||
while( ( token = NextTok() ) != T_RIGHT ) |
|||
{ |
|||
if( token == T_EOF) |
|||
Unexpected( T_EOF ); |
|||
|
|||
if( token == T_LEFT ) |
|||
token = NextTok(); |
|||
|
|||
if( token == T_pcbplotparams ) |
|||
continue; |
|||
|
|||
switch( token ) |
|||
{ |
|||
case T_layerselection: |
|||
token = NextTok(); |
|||
if( token != T_NUMBER ) |
|||
Expecting( T_NUMBER ); |
|||
aPcbPlotParams->layerSelection = atol( CurText() ); |
|||
break; |
|||
case T_usegerberextensions: |
|||
aPcbPlotParams->useGerberExtensions = ParseBool(); |
|||
break; |
|||
case T_excludeedgelayer: |
|||
aPcbPlotParams->m_ExcludeEdgeLayer = ParseBool(); |
|||
break; |
|||
case T_linewidth: |
|||
aPcbPlotParams->m_PlotLineWidth = ParseInt( 40, 200 ); |
|||
break; |
|||
case T_plotframeref: |
|||
aPcbPlotParams->m_PlotFrameRef = ParseBool(); |
|||
break; |
|||
case T_viasonmask: |
|||
aPcbPlotParams->m_PlotViaOnMaskLayer = ParseBool(); |
|||
break; |
|||
case T_mode: |
|||
aPcbPlotParams->m_PlotMode = (GRTraceMode)ParseInt( 0, 2 ); |
|||
break; |
|||
case T_useauxorigin: |
|||
aPcbPlotParams->useAuxOrigin = ParseBool(); |
|||
break; |
|||
case T_hpglpennumber: |
|||
aPcbPlotParams->m_HPGLPenNum = ParseInt( 1, 16 ); |
|||
break; |
|||
case T_hpglpenspeed: |
|||
aPcbPlotParams->m_HPGLPenSpeed = ParseInt( 0, 1000 ); |
|||
break; |
|||
case T_hpglpendiameter: |
|||
aPcbPlotParams->m_HPGLPenDiam = ParseInt( 0, 100 ); |
|||
break; |
|||
case T_hpglpenoverlay: |
|||
aPcbPlotParams->m_HPGLPenOvr = ParseInt( 0, 0x100 ); |
|||
break; |
|||
case T_pscolor: |
|||
aPcbPlotParams->m_PlotPSColorOpt = ParseBool(); |
|||
break; |
|||
case T_psnegative: |
|||
aPcbPlotParams->m_PlotPSNegative = ParseBool(); |
|||
break; |
|||
case T_plotreference: |
|||
aPcbPlotParams->m_PlotReference = ParseBool(); |
|||
break; |
|||
case T_plotvalue: |
|||
aPcbPlotParams->m_PlotValue = ParseBool(); |
|||
break; |
|||
case T_plotothertext: |
|||
aPcbPlotParams->m_PlotTextOther = ParseBool(); |
|||
break; |
|||
case T_plotinvisibletext: |
|||
aPcbPlotParams->m_PlotInvisibleTexts = ParseBool(); |
|||
break; |
|||
case T_padsonsilk: |
|||
aPcbPlotParams->m_PlotPadsOnSilkLayer= ParseBool(); |
|||
break; |
|||
case T_subtractmaskfromsilk: |
|||
aPcbPlotParams->subtractMaskFromSilk = ParseBool(); |
|||
break; |
|||
case T_outputformat: |
|||
aPcbPlotParams->m_PlotFormat = ParseInt( 0, 4 ); |
|||
break; |
|||
case T_mirror: |
|||
aPcbPlotParams->m_PlotMirror = ParseBool(); |
|||
break; |
|||
case T_drillshape: |
|||
aPcbPlotParams->m_DrillShapeOpt = (PCB_PLOT_PARAMS::DrillShapeOptT) ParseInt( 0, 2 ); |
|||
break; |
|||
case T_scaleselection: |
|||
aPcbPlotParams->scaleSelection = ParseInt( 0, 4 ); |
|||
break; |
|||
case T_outputdirectory: |
|||
NeedSYMBOL(); |
|||
// token = NextTok();
|
|||
// if( token != T_STRING )
|
|||
// Expecting( T_STRING );
|
|||
aPcbPlotParams->outputDirectory = CONV_FROM_UTF8( CurText() ); |
|||
break; |
|||
default: |
|||
Unexpected( CurText() ); |
|||
break; |
|||
} |
|||
NeedRIGHT(); |
|||
} |
|||
} |
|||
|
|||
|
|||
bool PCB_PLOT_PARAMS_PARSER::ParseBool() throw( IO_ERROR ) |
|||
{ |
|||
T token; |
|||
token = NeedSYMBOL(); |
|||
if( token != T_false && token != T_true ) |
|||
Expecting( "true|false" ); |
|||
return (token == T_true); |
|||
} |
|||
|
|||
|
|||
int PCB_PLOT_PARAMS_PARSER::ParseInt( int aMin, int aMax ) throw( IO_ERROR ) |
|||
{ |
|||
T token; |
|||
int i; |
|||
token = NextTok(); |
|||
if( token != T_NUMBER ) |
|||
Expecting( T_NUMBER ); |
|||
i = atoi( CurText() ); |
|||
|
|||
if( i < aMin ) |
|||
i = aMin; |
|||
else if( i > aMax ) |
|||
i = aMax; |
|||
|
|||
return i; |
|||
} |
|||
@ -0,0 +1,144 @@ |
|||
|
|||
/* |
|||
* This program source code file is part of KICAD, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 1992-2011 Kicad Developers, see change_log.txt for contributors. |
|||
* |
|||
* This program is free software; you can redistribute it and/or |
|||
* modify it under the terms of the GNU General Public License |
|||
* as published by the Free Software Foundation; either version 2 |
|||
* of the License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program; if not, you may find one here: |
|||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
|||
* or you may search the http://www.gnu.org website for the version 2 license, |
|||
* or you may write to the Free Software Foundation, Inc., |
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|||
*/ |
|||
|
|||
#ifndef PCB_PLOT_PARAMS_H_ |
|||
#define PCB_PLOT_PARAMS_H_ |
|||
|
|||
#include <wx/wx.h> |
|||
#include "base_struct.h" |
|||
#include "pcb_plot_params_lexer.h" |
|||
|
|||
class PCB_PLOT_PARAMS; |
|||
class PCB_PLOT_PARAMS_PARSER; |
|||
|
|||
extern PCB_PLOT_PARAMS g_PcbPlotOptions; |
|||
|
|||
|
|||
/** |
|||
* Class PCB_PLOT_PARAMS |
|||
* handles plot parameters and options when plotting/printing a board. |
|||
*/ |
|||
class PCB_PLOT_PARAMS |
|||
{ |
|||
friend class PCB_PLOT_PARAMS_PARSER; |
|||
public: |
|||
bool m_ExcludeEdgeLayer; // True: do not plot edge layer when plotting other layers |
|||
// False: Edge layer always plotted (merged) when plotting other layers |
|||
int m_PlotLineWidth; |
|||
bool m_PlotFrameRef; // True to plot/print frame references |
|||
bool m_PlotViaOnMaskLayer; // True if vias are drawn on Mask layer |
|||
// (ie protected by mask) |
|||
GRTraceMode m_PlotMode; // = FILAIRE, FILLED or SKETCH: select how to plot filled objects. |
|||
// depending on plot format or layers, all options are not always allowed |
|||
int m_HPGLPenNum; |
|||
int m_HPGLPenSpeed; |
|||
int m_HPGLPenDiam; |
|||
int m_HPGLPenOvr; |
|||
int m_PlotPSColorOpt; // True for color Postscript output |
|||
bool m_PlotPSNegative; // True to create a negative board ps plot |
|||
|
|||
// Flags to enable or disable ploting of various PCB elements. |
|||
bool m_PlotReference; |
|||
bool m_PlotValue; |
|||
bool m_PlotTextOther; |
|||
bool m_PlotInvisibleTexts; |
|||
bool m_PlotPadsOnSilkLayer; // allows pads outlines on silkscreen layer (when pads are also o, silk screen |
|||
|
|||
int m_PlotFormat; // id for plot format (see enum PlotFormat in plot_common.h) */ |
|||
bool m_PlotMirror; |
|||
|
|||
enum DrillShapeOptT { |
|||
NO_DRILL_SHAPE = 0, |
|||
SMALL_DRILL_SHAPE = 1, |
|||
FULL_DRILL_SHAPE = 2 |
|||
}; |
|||
DrillShapeOptT m_DrillShapeOpt; // For postscript output: holes can be not plotted, |
|||
// or have a small size or plotted with their actual size |
|||
bool m_AutoScale; // If true, use the better scale to fit in page |
|||
double m_PlotScale; // The global scale factor. a 1.0 scale factor plot a board |
|||
// with its actual size. |
|||
|
|||
// These next two scale factors are intended to compensable plotters (and mainly printers) X and Y scale error. |
|||
// Therefore they are expected very near 1.0 |
|||
// Only X and Y dimensions are adjusted: circles are plotted as circle, even if X and Y fine scale differ. |
|||
double m_FineScaleAdjustX; // fine scale adjust X axis |
|||
double m_FineScaleAdjustY; // dine scale adjust Y axis |
|||
|
|||
private: |
|||
long layerSelection; |
|||
bool useGerberExtensions; |
|||
bool useAuxOrigin; |
|||
bool subtractMaskFromSilk; |
|||
int scaleSelection; |
|||
wxString outputDirectory; |
|||
|
|||
public: |
|||
PCB_PLOT_PARAMS(); |
|||
|
|||
void Format( OUTPUTFORMATTER* aFormatter, int aNestLevel ) const throw( IO_ERROR ); |
|||
void Parse( PCB_PLOT_PARAMS_PARSER* aParser ) throw( IO_ERROR, PARSE_ERROR ); |
|||
|
|||
PCB_PLOT_PARAMS& operator=( const PCB_PLOT_PARAMS &aPcbPlotParams); |
|||
bool operator==( const PCB_PLOT_PARAMS &aPcbPlotParams ) const; |
|||
bool operator!=( const PCB_PLOT_PARAMS &aPcbPlotParams ) const; |
|||
|
|||
void SetOutputDirectory( wxString aDir ) { outputDirectory = aDir; }; |
|||
wxString GetOutputDirectory() const { return outputDirectory; }; |
|||
void SetUseGerberExtensions( bool aUse ) { useGerberExtensions = aUse; }; |
|||
bool GetUseGerberExtensions() const { return useGerberExtensions; }; |
|||
void SetSubtractMaskFromSilk( bool aSubtract ) { subtractMaskFromSilk = aSubtract; }; |
|||
bool GetSubtractMaskFromSilk() const { return subtractMaskFromSilk; }; |
|||
void SetLayerSelection( long aSelection ) { layerSelection = aSelection; }; |
|||
long GetLayerSelection() const { return layerSelection; }; |
|||
void SetUseAuxOrigin( bool aAux ) { useAuxOrigin = aAux; }; |
|||
bool GetUseAuxOrigin() const { return useAuxOrigin; }; |
|||
void SetScaleSelection( int aSelection ) { scaleSelection = aSelection; }; |
|||
int GetScaleSelection() const { return scaleSelection; }; |
|||
}; |
|||
|
|||
|
|||
/** |
|||
* Class PCB_PLOT_PARAMS_PARSER |
|||
* is the parser class for PCB_PLOT_PARAMS. |
|||
*/ |
|||
class PCB_PLOT_PARAMS_PARSER : public PCB_PLOT_PARAMS_LEXER |
|||
{ |
|||
public: |
|||
PCB_PLOT_PARAMS_PARSER( LINE_READER* aReader ); |
|||
PCB_PLOT_PARAMS_PARSER( char* aLine, wxString aSource ); |
|||
LINE_READER* GetReader() { return reader; }; |
|||
void Parse( PCB_PLOT_PARAMS* aPcbPlotParams ) throw( IO_ERROR, PARSE_ERROR ); |
|||
bool ParseBool() throw( IO_ERROR ); |
|||
|
|||
/** |
|||
* Function ParseInt |
|||
* parses an integer and constrains it between two values. |
|||
* @param aMin is the smallest return value. |
|||
* @param aMax is the largest return value. |
|||
* @return int - the parsed integer. |
|||
*/ |
|||
int ParseInt( int aMin, int aMax ) throw( IO_ERROR ); |
|||
}; |
|||
|
|||
#endif // PCB_PLOT_PARAMS_H_ |
|||
@ -0,0 +1,28 @@ |
|||
drillshape |
|||
excludeedgelayer |
|||
false |
|||
hpglpendiameter |
|||
hpglpennumber |
|||
hpglpenoverlay |
|||
hpglpenspeed |
|||
layerselection |
|||
linewidth |
|||
mirror |
|||
mode |
|||
outputdirectory |
|||
outputformat |
|||
padsonsilk |
|||
pcbplotparams |
|||
plotframeref |
|||
plotinvisibletext |
|||
plotothertext |
|||
plotreference |
|||
plotvalue |
|||
pscolor |
|||
psnegative |
|||
scaleselection |
|||
subtractmaskfromsilk |
|||
true |
|||
useauxorigin |
|||
usegerberextensions |
|||
viasonmask |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue