Add saving of pcb plot settings in board files.
This commit is contained in:
parent
e0f4963b6a
commit
7ccdb5589d
|
@ -154,6 +154,8 @@ set(PCBNEW_SRCS
|
||||||
netlist.cpp
|
netlist.cpp
|
||||||
onleftclick.cpp
|
onleftclick.cpp
|
||||||
onrightclick.cpp
|
onrightclick.cpp
|
||||||
|
pcb_plot_params.cpp
|
||||||
|
pcb_plot_params_keywords.cpp
|
||||||
pcbnew.cpp
|
pcbnew.cpp
|
||||||
pcbnew_config.cpp
|
pcbnew_config.cpp
|
||||||
pcbplot.cpp
|
pcbplot.cpp
|
||||||
|
@ -256,6 +258,15 @@ make_lexer(
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# auto-generate pcb_plot_params_lexer.h and pcb_plot_params_keywords.cpp
|
||||||
|
make_lexer(
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/pcb_plot_params.keywords
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/pcb_plot_params_lexer.h
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/pcb_plot_params_keywords.cpp
|
||||||
|
PCBPLOTPARAMS_T
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
###
|
###
|
||||||
# Create the pcbnew executable
|
# Create the pcbnew executable
|
||||||
###
|
###
|
||||||
|
|
|
@ -1,271 +1,271 @@
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// C++ code generated with wxFormBuilder (version Sep 8 2010)
|
// C++ code generated with wxFormBuilder (version Nov 18 2010)
|
||||||
// http://www.wxformbuilder.org/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "dialog_plot_base.h"
|
#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 )
|
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 );
|
this->SetSizeHints( wxSize( -1,350 ), wxDefaultSize );
|
||||||
|
|
||||||
wxBoxSizer* bMainSizer;
|
wxBoxSizer* bMainSizer;
|
||||||
bMainSizer = new wxBoxSizer( wxVERTICAL );
|
bMainSizer = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
wxBoxSizer* bUpperSizer;
|
wxBoxSizer* bUpperSizer;
|
||||||
bUpperSizer = new wxBoxSizer( wxHORIZONTAL );
|
bUpperSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||||
|
|
||||||
wxBoxSizer* bLeftSizer;
|
wxBoxSizer* bLeftSizer;
|
||||||
bLeftSizer = new wxBoxSizer( wxVERTICAL );
|
bLeftSizer = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
wxStaticBoxSizer* sbLayersSizer;
|
wxStaticBoxSizer* sbLayersSizer;
|
||||||
sbLayersSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Layers:") ), wxHORIZONTAL );
|
sbLayersSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Layers") ), wxHORIZONTAL );
|
||||||
|
|
||||||
m_CopperLayersBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Copper Layers:") ), wxVERTICAL );
|
m_CopperLayersBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Copper Layers") ), wxVERTICAL );
|
||||||
|
|
||||||
sbLayersSizer->Add( m_CopperLayersBoxSizer, 1, wxALL, 5 );
|
sbLayersSizer->Add( m_CopperLayersBoxSizer, 1, wxALL, 5 );
|
||||||
|
|
||||||
m_TechnicalLayersBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Technical Layers:") ), wxVERTICAL );
|
m_TechnicalLayersBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Technical Layers") ), wxVERTICAL );
|
||||||
|
|
||||||
sbLayersSizer->Add( m_TechnicalLayersBoxSizer, 1, wxALL, 5 );
|
sbLayersSizer->Add( m_TechnicalLayersBoxSizer, 1, wxALL, 5 );
|
||||||
|
|
||||||
bLeftSizer->Add( sbLayersSizer, 1, wxEXPAND, 5 );
|
bLeftSizer->Add( sbLayersSizer, 1, wxEXPAND, 5 );
|
||||||
|
|
||||||
m_useGerberExtensions = new wxCheckBox( this, wxID_ANY, _("Use proper Gerber extensions"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_useGerberExtensions = new wxCheckBox( this, wxID_ANY, _("Use proper Gerber extensions"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_useGerberExtensions->SetToolTip( _("Use Proper Gerber Extensions - .GBL, .GTL, etc...") );
|
m_useGerberExtensions->SetToolTip( _("Use Proper Gerber Extensions - .GBL, .GTL, etc...") );
|
||||||
|
|
||||||
bLeftSizer->Add( m_useGerberExtensions, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
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 = 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") );
|
m_excludeEdgeLayerOpt->SetToolTip( _("Exclude contents of the pcb edge layer from all other layers") );
|
||||||
|
|
||||||
bLeftSizer->Add( m_excludeEdgeLayerOpt, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
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 = new wxCheckBox( this, wxID_ANY, _("Subtract mask from silk"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_subtractMaskFromSilk->SetToolTip( _("Remove silkscreen from areas without soldermask") );
|
m_subtractMaskFromSilk->SetToolTip( _("Remove silkscreen from areas without soldermask") );
|
||||||
|
|
||||||
bLeftSizer->Add( m_subtractMaskFromSilk, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
bLeftSizer->Add( m_subtractMaskFromSilk, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
m_plotSheetRef = new wxCheckBox( this, wxID_ANY, _("Plot sheet reference"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_plotSheetRef = new wxCheckBox( this, wxID_ANY, _("Plot sheet reference"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
bLeftSizer->Add( m_plotSheetRef, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
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 = 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") );
|
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 );
|
bLeftSizer->Add( m_plotPads_on_Silkscreen, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
m_plotModuleValueOpt = new wxCheckBox( this, wxID_ANY, _("Plot module value"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_plotModuleValueOpt = new wxCheckBox( this, wxID_ANY, _("Plot module value"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
bLeftSizer->Add( m_plotModuleValueOpt, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
bLeftSizer->Add( m_plotModuleValueOpt, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
m_plotModuleRefOpt = new wxCheckBox( this, ID_PRINT_REF, _("Plot module reference"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_plotModuleRefOpt = new wxCheckBox( this, ID_PRINT_REF, _("Plot module reference"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
bLeftSizer->Add( m_plotModuleRefOpt, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
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 = 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") );
|
m_plotTextOther->SetToolTip( _("Enable/disable print/plot module field texts on silkscreen layers") );
|
||||||
|
|
||||||
bLeftSizer->Add( m_plotTextOther, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
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 = new wxCheckBox( this, wxID_ANY, _("Force plot invisible texts"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_plotInvisibleText->SetToolTip( _("Force print/plot module invisible texts on silkscreen layers") );
|
m_plotInvisibleText->SetToolTip( _("Force print/plot module invisible texts on silkscreen layers") );
|
||||||
|
|
||||||
bLeftSizer->Add( m_plotInvisibleText, 0, wxALL, 5 );
|
bLeftSizer->Add( m_plotInvisibleText, 0, wxALL, 5 );
|
||||||
|
|
||||||
bUpperSizer->Add( bLeftSizer, 2, wxEXPAND, 5 );
|
bUpperSizer->Add( bLeftSizer, 2, wxEXPAND, 5 );
|
||||||
|
|
||||||
wxBoxSizer* bPlotOptionsSizer;
|
wxBoxSizer* bPlotOptionsSizer;
|
||||||
bPlotOptionsSizer = new wxBoxSizer( wxVERTICAL );
|
bPlotOptionsSizer = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
wxString m_drillShapeOptChoices[] = { _("No drill mark"), _("Small mark"), _("Actual hole") };
|
wxString m_drillShapeOptChoices[] = { _("No drill mark"), _("Small mark"), _("Actual hole") };
|
||||||
int m_drillShapeOptNChoices = sizeof( m_drillShapeOptChoices ) / sizeof( wxString );
|
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 = new wxRadioBox( this, wxID_ANY, _("Hole Options"), wxDefaultPosition, wxDefaultSize, m_drillShapeOptNChoices, m_drillShapeOptChoices, 1, wxRA_SPECIFY_COLS );
|
||||||
m_drillShapeOpt->SetSelection( 2 );
|
m_drillShapeOpt->SetSelection( 0 );
|
||||||
bPlotOptionsSizer->Add( m_drillShapeOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
bPlotOptionsSizer->Add( m_drillShapeOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
wxString m_scaleOptChoices[] = { _("Auto scale"), _("Scale 1"), _("Scale 1.5"), _("Scale 2"), _("Scale 3") };
|
wxString m_scaleOptChoices[] = { _("Auto scale"), _("Scale 1"), _("Scale 1.5"), _("Scale 2"), _("Scale 3") };
|
||||||
int m_scaleOptNChoices = sizeof( m_scaleOptChoices ) / sizeof( wxString );
|
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 = new wxRadioBox( this, wxID_ANY, _("Scale"), wxDefaultPosition, wxDefaultSize, m_scaleOptNChoices, m_scaleOptChoices, 1, wxRA_SPECIFY_COLS );
|
||||||
m_scaleOpt->SetSelection( 0 );
|
m_scaleOpt->SetSelection( 0 );
|
||||||
bPlotOptionsSizer->Add( m_scaleOpt, 0, wxEXPAND|wxALL, 5 );
|
bPlotOptionsSizer->Add( m_scaleOpt, 0, wxEXPAND|wxALL, 5 );
|
||||||
|
|
||||||
wxString m_plotModeOptChoices[] = { _("Line"), _("Filled"), _("Sketch") };
|
wxString m_plotModeOptChoices[] = { _("Line"), _("Filled"), _("Sketch") };
|
||||||
int m_plotModeOptNChoices = sizeof( m_plotModeOptChoices ) / sizeof( wxString );
|
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 = new wxRadioBox( this, wxID_ANY, _("Plot Mode"), wxDefaultPosition, wxDefaultSize, m_plotModeOptNChoices, m_plotModeOptChoices, 1, wxRA_SPECIFY_COLS );
|
||||||
m_plotModeOpt->SetSelection( 0 );
|
m_plotModeOpt->SetSelection( 0 );
|
||||||
bPlotOptionsSizer->Add( m_plotModeOpt, 0, wxALL|wxEXPAND, 5 );
|
bPlotOptionsSizer->Add( m_plotModeOpt, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
wxString m_choicePlotOffsetChoices[] = { _("Absolute"), _("Auxiliary axis") };
|
wxString m_choicePlotOffsetChoices[] = { _("Absolute"), _("Auxiliary axis") };
|
||||||
int m_choicePlotOffsetNChoices = sizeof( m_choicePlotOffsetChoices ) / sizeof( wxString );
|
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 = new wxRadioBox( this, wxID_ANY, _("Plot Origin"), wxDefaultPosition, wxDefaultSize, m_choicePlotOffsetNChoices, m_choicePlotOffsetChoices, 1, wxRA_SPECIFY_COLS );
|
||||||
m_choicePlotOffset->SetSelection( 0 );
|
m_choicePlotOffset->SetSelection( 1 );
|
||||||
bPlotOptionsSizer->Add( m_choicePlotOffset, 0, wxALL|wxEXPAND, 5 );
|
bPlotOptionsSizer->Add( m_choicePlotOffset, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
bUpperSizer->Add( bPlotOptionsSizer, 0, wxEXPAND, 5 );
|
bUpperSizer->Add( bPlotOptionsSizer, 0, wxEXPAND, 5 );
|
||||||
|
|
||||||
wxBoxSizer* bSizerFmtPlot;
|
wxBoxSizer* bSizerFmtPlot;
|
||||||
bSizerFmtPlot = new wxBoxSizer( wxVERTICAL );
|
bSizerFmtPlot = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
wxString m_plotFormatOptChoices[] = { _("HPGL"), _("Gerber"), _("Postscript"), _("Postscript A4"), _("DXF export") };
|
wxString m_plotFormatOptChoices[] = { _("HPGL"), _("Gerber"), _("Postscript"), _("Postscript A4"), _("DXF export") };
|
||||||
int m_plotFormatOptNChoices = sizeof( m_plotFormatOptChoices ) / sizeof( wxString );
|
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 = new wxRadioBox( this, wxID_ANY, _("Plot Format"), wxDefaultPosition, wxDefaultSize, m_plotFormatOptNChoices, m_plotFormatOptChoices, 1, wxRA_SPECIFY_COLS );
|
||||||
m_plotFormatOpt->SetSelection( 4 );
|
m_plotFormatOpt->SetSelection( 1 );
|
||||||
bSizerFmtPlot->Add( m_plotFormatOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
bSizerFmtPlot->Add( m_plotFormatOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
wxStaticBoxSizer* m_HPGL_OptionsBox;
|
wxStaticBoxSizer* m_HPGL_OptionsBox;
|
||||||
m_HPGL_OptionsBox = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("HPGL Options:") ), wxVERTICAL );
|
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 = new wxStaticText( this, wxID_ANY, _("Pen size"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_textPenSize->Wrap( -1 );
|
m_textPenSize->Wrap( -1 );
|
||||||
m_HPGL_OptionsBox->Add( m_textPenSize, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
m_HPGL_OptionsBox->Add( m_textPenSize, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
m_HPGLPenSizeOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
m_HPGLPenSizeOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_HPGL_OptionsBox->Add( m_HPGLPenSizeOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
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 = new wxStaticText( this, wxID_ANY, _("Pen speed (cm/s)"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_staticText3->Wrap( -1 );
|
m_staticText3->Wrap( -1 );
|
||||||
m_HPGL_OptionsBox->Add( m_staticText3, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
m_HPGL_OptionsBox->Add( m_staticText3, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
m_HPGLPenSpeedOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
m_HPGLPenSpeedOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_HPGLPenSpeedOpt->SetToolTip( _("Set pen speed in cm/s") );
|
m_HPGLPenSpeedOpt->SetToolTip( _("Set pen speed in cm/s") );
|
||||||
|
|
||||||
m_HPGL_OptionsBox->Add( m_HPGLPenSpeedOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
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 = new wxStaticText( this, wxID_ANY, _("Pen overlay"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_textPenOvr->Wrap( -1 );
|
m_textPenOvr->Wrap( -1 );
|
||||||
m_HPGL_OptionsBox->Add( m_textPenOvr, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
m_HPGL_OptionsBox->Add( m_textPenOvr, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
m_HPGLPenOverlayOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
m_HPGLPenOverlayOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_HPGLPenOverlayOpt->SetToolTip( _("Set plot overlay for filling") );
|
m_HPGLPenOverlayOpt->SetToolTip( _("Set plot overlay for filling") );
|
||||||
|
|
||||||
m_HPGL_OptionsBox->Add( m_HPGLPenOverlayOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
m_HPGL_OptionsBox->Add( m_HPGLPenOverlayOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
||||||
|
|
||||||
bSizerFmtPlot->Add( m_HPGL_OptionsBox, 0, wxEXPAND, 5 );
|
bSizerFmtPlot->Add( m_HPGL_OptionsBox, 0, wxEXPAND, 5 );
|
||||||
|
|
||||||
bUpperSizer->Add( bSizerFmtPlot, 0, wxEXPAND, 5 );
|
bUpperSizer->Add( bSizerFmtPlot, 0, wxEXPAND, 5 );
|
||||||
|
|
||||||
wxBoxSizer* bButtonsSizer;
|
wxBoxSizer* bButtonsSizer;
|
||||||
bButtonsSizer = new wxBoxSizer( wxVERTICAL );
|
bButtonsSizer = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
wxStaticBoxSizer* sbSizerPlotOpt;
|
wxStaticBoxSizer* sbSizerPlotOpt;
|
||||||
sbSizerPlotOpt = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Plot Options:") ), wxVERTICAL );
|
sbSizerPlotOpt = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Plot Options") ), wxVERTICAL );
|
||||||
|
|
||||||
m_plotPSNegativeOpt = new wxCheckBox( this, wxID_ANY, _("Plot negative"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_plotPSNegativeOpt = new wxCheckBox( this, wxID_ANY, _("Plot negative"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
sbSizerPlotOpt->Add( m_plotPSNegativeOpt, 0, wxALL, 5 );
|
sbSizerPlotOpt->Add( m_plotPSNegativeOpt, 0, wxALL, 5 );
|
||||||
|
|
||||||
m_plotMirrorOpt = new wxCheckBox( this, ID_MIROR_OPT, _("Plot mirror"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_plotMirrorOpt = new wxCheckBox( this, ID_MIROR_OPT, _("Plot mirror"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
sbSizerPlotOpt->Add( m_plotMirrorOpt, 0, wxALL, 5 );
|
sbSizerPlotOpt->Add( m_plotMirrorOpt, 0, wxALL, 5 );
|
||||||
|
|
||||||
m_plotNoViaOnMaskOpt = new wxCheckBox( this, wxID_ANY, _("Vias on mask"), wxDefaultPosition, wxDefaultSize, 0 );
|
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") );
|
m_plotNoViaOnMaskOpt->SetToolTip( _("Print/plot vias on mask layers. They are in this case not protected") );
|
||||||
|
|
||||||
sbSizerPlotOpt->Add( m_plotNoViaOnMaskOpt, 0, wxALL, 5 );
|
sbSizerPlotOpt->Add( m_plotNoViaOnMaskOpt, 0, wxALL, 5 );
|
||||||
|
|
||||||
bButtonsSizer->Add( sbSizerPlotOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 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 = new wxStaticText( this, wxID_ANY, _("Default Pen Size:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_staticText6->Wrap( -1 );
|
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.") );
|
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 );
|
bButtonsSizer->Add( m_staticText6, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
m_linesWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
m_linesWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
bButtonsSizer->Add( m_linesWidth, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
bButtonsSizer->Add( m_linesWidth, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
|
|
||||||
bButtonsSizer->Add( 0, 20, 1, wxEXPAND, 5 );
|
bButtonsSizer->Add( 0, 20, 1, wxEXPAND, 5 );
|
||||||
|
|
||||||
m_staticText7 = new wxStaticText( this, wxID_ANY, _("X scale adjust"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_staticText7 = new wxStaticText( this, wxID_ANY, _("X Scale Adjust:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_staticText7->Wrap( -1 );
|
m_staticText7->Wrap( -1 );
|
||||||
bButtonsSizer->Add( m_staticText7, 0, wxRIGHT|wxLEFT, 5 );
|
bButtonsSizer->Add( m_staticText7, 0, wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
m_fineAdjustXscaleOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
m_fineAdjustXscaleOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_fineAdjustXscaleOpt->SetToolTip( _("Set X scale adjust for exact scale plotting") );
|
m_fineAdjustXscaleOpt->SetToolTip( _("Set X scale adjust for exact scale plotting") );
|
||||||
|
|
||||||
bButtonsSizer->Add( m_fineAdjustXscaleOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
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 = new wxStaticText( this, wxID_ANY, _("Y Scale Adjust:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_staticText8->Wrap( -1 );
|
m_staticText8->Wrap( -1 );
|
||||||
bButtonsSizer->Add( m_staticText8, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
bButtonsSizer->Add( m_staticText8, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
m_fineAdjustYscaleOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
m_fineAdjustYscaleOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
bButtonsSizer->Add( m_fineAdjustYscaleOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
bButtonsSizer->Add( m_fineAdjustYscaleOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
|
|
||||||
bButtonsSizer->Add( 0, 20, 1, wxEXPAND, 5 );
|
bButtonsSizer->Add( 0, 20, 1, wxEXPAND, 5 );
|
||||||
|
|
||||||
m_plotButton = new wxButton( this, wxID_ANY, _("Plot"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_plotButton = new wxButton( this, wxID_ANY, _("Plot"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_plotButton->SetDefault();
|
m_plotButton->SetDefault();
|
||||||
bButtonsSizer->Add( m_plotButton, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
|
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 );
|
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 );
|
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 );
|
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 );
|
bButtonsSizer->Add( m_buttonDrill, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
|
||||||
|
|
||||||
m_buttonQuit = new wxButton( this, wxID_CANCEL, _("Quit"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_buttonQuit = new wxButton( this, wxID_CANCEL, _("Quit"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
bButtonsSizer->Add( m_buttonQuit, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
|
bButtonsSizer->Add( m_buttonQuit, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
|
||||||
|
|
||||||
bUpperSizer->Add( bButtonsSizer, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
bUpperSizer->Add( bButtonsSizer, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||||
|
|
||||||
bMainSizer->Add( bUpperSizer, 0, wxEXPAND, 5 );
|
bMainSizer->Add( bUpperSizer, 0, wxEXPAND, 5 );
|
||||||
|
|
||||||
wxBoxSizer* bSizerDirChoice;
|
wxBoxSizer* bSizerDirChoice;
|
||||||
bSizerDirChoice = new wxBoxSizer( wxVERTICAL );
|
bSizerDirChoice = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
m_staticTextDir = new wxStaticText( this, wxID_ANY, _("Output Directory:"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_staticTextDir = new wxStaticText( this, wxID_ANY, _("Output Directory:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_staticTextDir->Wrap( -1 );
|
m_staticTextDir->Wrap( -1 );
|
||||||
bSizerDirChoice->Add( m_staticTextDir, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
bSizerDirChoice->Add( m_staticTextDir, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
wxBoxSizer* bSizerDirNmae;
|
wxBoxSizer* bSizerDirNmae;
|
||||||
bSizerDirNmae = new wxBoxSizer( wxHORIZONTAL );
|
bSizerDirNmae = new wxBoxSizer( wxHORIZONTAL );
|
||||||
|
|
||||||
m_outputDirectoryName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
m_outputDirectoryName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
bSizerDirNmae->Add( m_outputDirectoryName, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
|
bSizerDirNmae->Add( m_outputDirectoryName, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
m_browseButton = new wxButton( this, wxID_ANY, _("Browse..."), wxDefaultPosition, wxDefaultSize, 0 );
|
m_browseButton = new wxButton( this, wxID_ANY, _("Browse..."), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
bSizerDirNmae->Add( m_browseButton, 0, wxRIGHT|wxLEFT, 5 );
|
bSizerDirNmae->Add( m_browseButton, 0, wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
bSizerDirChoice->Add( bSizerDirNmae, 0, wxRIGHT|wxEXPAND, 5 );
|
bSizerDirChoice->Add( bSizerDirNmae, 0, wxRIGHT|wxEXPAND, 5 );
|
||||||
|
|
||||||
bMainSizer->Add( bSizerDirChoice, 0, wxEXPAND, 5 );
|
bMainSizer->Add( bSizerDirChoice, 0, wxEXPAND, 5 );
|
||||||
|
|
||||||
m_staticText2 = new wxStaticText( this, wxID_ANY, _("Messages:"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_staticText2 = new wxStaticText( this, wxID_ANY, _("Messages:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_staticText2->Wrap( -1 );
|
m_staticText2->Wrap( -1 );
|
||||||
bMainSizer->Add( m_staticText2, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
bMainSizer->Add( m_staticText2, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||||
|
|
||||||
m_messagesBox = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
|
m_messagesBox = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
|
||||||
m_messagesBox->SetMinSize( wxSize( -1,120 ) );
|
m_messagesBox->SetMinSize( wxSize( -1,120 ) );
|
||||||
|
|
||||||
bMainSizer->Add( m_messagesBox, 1, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
bMainSizer->Add( m_messagesBox, 1, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
||||||
|
|
||||||
this->SetSizer( bMainSizer );
|
this->SetSizer( bMainSizer );
|
||||||
this->Layout();
|
this->Layout();
|
||||||
|
|
||||||
// Connect Events
|
// Connect Events
|
||||||
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PLOT_BASE::OnCloseWindow ) );
|
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PLOT_BASE::OnCloseWindow ) );
|
||||||
this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_PLOT_BASE::OnInitDialog ) );
|
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_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_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_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_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_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 );
|
m_browseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnOutputDirectoryBrowseClicked ), NULL, this );
|
||||||
}
|
}
|
||||||
|
|
||||||
DIALOG_PLOT_BASE::~DIALOG_PLOT_BASE()
|
DIALOG_PLOT_BASE::~DIALOG_PLOT_BASE()
|
||||||
{
|
{
|
||||||
// Disconnect Events
|
// Disconnect Events
|
||||||
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PLOT_BASE::OnCloseWindow ) );
|
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PLOT_BASE::OnCloseWindow ) );
|
||||||
this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_PLOT_BASE::OnInitDialog ) );
|
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_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_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_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_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_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 );
|
m_browseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnOutputDirectoryBrowseClicked ), NULL, this );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,107 +1,107 @@
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// C++ code generated with wxFormBuilder (version Sep 8 2010)
|
// C++ code generated with wxFormBuilder (version Nov 18 2010)
|
||||||
// http://www.wxformbuilder.org/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef __dialog_plot_base__
|
#ifndef __dialog_plot_base__
|
||||||
#define __dialog_plot_base__
|
#define __dialog_plot_base__
|
||||||
|
|
||||||
#include <wx/intl.h>
|
#include <wx/intl.h>
|
||||||
|
|
||||||
#include <wx/string.h>
|
#include <wx/string.h>
|
||||||
#include <wx/sizer.h>
|
#include <wx/sizer.h>
|
||||||
#include <wx/statbox.h>
|
#include <wx/statbox.h>
|
||||||
#include <wx/gdicmn.h>
|
#include <wx/gdicmn.h>
|
||||||
#include <wx/checkbox.h>
|
#include <wx/checkbox.h>
|
||||||
#include <wx/font.h>
|
#include <wx/font.h>
|
||||||
#include <wx/colour.h>
|
#include <wx/colour.h>
|
||||||
#include <wx/settings.h>
|
#include <wx/settings.h>
|
||||||
#include <wx/radiobox.h>
|
#include <wx/radiobox.h>
|
||||||
#include <wx/stattext.h>
|
#include <wx/stattext.h>
|
||||||
#include <wx/textctrl.h>
|
#include <wx/textctrl.h>
|
||||||
#include <wx/button.h>
|
#include <wx/button.h>
|
||||||
#include <wx/dialog.h>
|
#include <wx/dialog.h>
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
/// Class DIALOG_PLOT_BASE
|
/// Class DIALOG_PLOT_BASE
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
class DIALOG_PLOT_BASE : public wxDialog
|
class DIALOG_PLOT_BASE : public wxDialog
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
ID_ALLOW_PRINT_PAD_ON_SILKSCREEN = 1000,
|
ID_ALLOW_PRINT_PAD_ON_SILKSCREEN = 1000,
|
||||||
ID_PRINT_REF,
|
ID_PRINT_REF,
|
||||||
ID_MIROR_OPT,
|
ID_MIROR_OPT,
|
||||||
ID_SAVE_OPT_PLOT,
|
ID_SAVE_OPT_PLOT,
|
||||||
ID_CREATE_DRILL_FILE,
|
ID_CREATE_DRILL_FILE,
|
||||||
};
|
};
|
||||||
|
|
||||||
wxStaticBoxSizer* m_CopperLayersBoxSizer;
|
wxStaticBoxSizer* m_CopperLayersBoxSizer;
|
||||||
wxStaticBoxSizer* m_TechnicalLayersBoxSizer;
|
wxStaticBoxSizer* m_TechnicalLayersBoxSizer;
|
||||||
wxCheckBox* m_useGerberExtensions;
|
wxCheckBox* m_useGerberExtensions;
|
||||||
wxCheckBox* m_excludeEdgeLayerOpt;
|
wxCheckBox* m_excludeEdgeLayerOpt;
|
||||||
wxCheckBox* m_subtractMaskFromSilk;
|
wxCheckBox* m_subtractMaskFromSilk;
|
||||||
wxCheckBox* m_plotSheetRef;
|
wxCheckBox* m_plotSheetRef;
|
||||||
wxCheckBox* m_plotPads_on_Silkscreen;
|
wxCheckBox* m_plotPads_on_Silkscreen;
|
||||||
wxCheckBox* m_plotModuleValueOpt;
|
wxCheckBox* m_plotModuleValueOpt;
|
||||||
wxCheckBox* m_plotModuleRefOpt;
|
wxCheckBox* m_plotModuleRefOpt;
|
||||||
wxCheckBox* m_plotTextOther;
|
wxCheckBox* m_plotTextOther;
|
||||||
wxCheckBox* m_plotInvisibleText;
|
wxCheckBox* m_plotInvisibleText;
|
||||||
wxRadioBox* m_drillShapeOpt;
|
wxRadioBox* m_drillShapeOpt;
|
||||||
wxRadioBox* m_scaleOpt;
|
wxRadioBox* m_scaleOpt;
|
||||||
wxRadioBox* m_plotModeOpt;
|
wxRadioBox* m_plotModeOpt;
|
||||||
wxRadioBox* m_choicePlotOffset;
|
wxRadioBox* m_choicePlotOffset;
|
||||||
wxRadioBox* m_plotFormatOpt;
|
wxRadioBox* m_plotFormatOpt;
|
||||||
wxStaticText* m_textPenSize;
|
wxStaticText* m_textPenSize;
|
||||||
wxTextCtrl* m_HPGLPenSizeOpt;
|
wxTextCtrl* m_HPGLPenSizeOpt;
|
||||||
wxStaticText* m_staticText3;
|
wxStaticText* m_staticText3;
|
||||||
wxTextCtrl* m_HPGLPenSpeedOpt;
|
wxTextCtrl* m_HPGLPenSpeedOpt;
|
||||||
wxStaticText* m_textPenOvr;
|
wxStaticText* m_textPenOvr;
|
||||||
wxTextCtrl* m_HPGLPenOverlayOpt;
|
wxTextCtrl* m_HPGLPenOverlayOpt;
|
||||||
wxCheckBox* m_plotPSNegativeOpt;
|
wxCheckBox* m_plotPSNegativeOpt;
|
||||||
wxCheckBox* m_plotMirrorOpt;
|
wxCheckBox* m_plotMirrorOpt;
|
||||||
wxCheckBox* m_plotNoViaOnMaskOpt;
|
wxCheckBox* m_plotNoViaOnMaskOpt;
|
||||||
wxStaticText* m_staticText6;
|
wxStaticText* m_staticText6;
|
||||||
wxTextCtrl* m_linesWidth;
|
wxTextCtrl* m_linesWidth;
|
||||||
|
|
||||||
wxStaticText* m_staticText7;
|
wxStaticText* m_staticText7;
|
||||||
wxTextCtrl* m_fineAdjustXscaleOpt;
|
wxTextCtrl* m_fineAdjustXscaleOpt;
|
||||||
wxStaticText* m_staticText8;
|
wxStaticText* m_staticText8;
|
||||||
wxTextCtrl* m_fineAdjustYscaleOpt;
|
wxTextCtrl* m_fineAdjustYscaleOpt;
|
||||||
|
|
||||||
wxButton* m_plotButton;
|
wxButton* m_plotButton;
|
||||||
wxButton* m_buttonSaveOpt;
|
wxButton* m_buttonSaveOpt;
|
||||||
wxButton* m_buttonDrill;
|
wxButton* m_buttonDrill;
|
||||||
wxButton* m_buttonQuit;
|
wxButton* m_buttonQuit;
|
||||||
wxStaticText* m_staticTextDir;
|
wxStaticText* m_staticTextDir;
|
||||||
wxTextCtrl* m_outputDirectoryName;
|
wxTextCtrl* m_outputDirectoryName;
|
||||||
wxButton* m_browseButton;
|
wxButton* m_browseButton;
|
||||||
wxStaticText* m_staticText2;
|
wxStaticText* m_staticText2;
|
||||||
wxTextCtrl* m_messagesBox;
|
wxTextCtrl* m_messagesBox;
|
||||||
|
|
||||||
// Virtual event handlers, overide them in your derived class
|
// Virtual event handlers, overide them in your derived class
|
||||||
virtual void OnCloseWindow( wxCloseEvent& event ) { event.Skip(); }
|
virtual void OnCloseWindow( wxCloseEvent& event ) { event.Skip(); }
|
||||||
virtual void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); }
|
virtual void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); }
|
||||||
virtual void SetPlotFormat( wxCommandEvent& event ) { event.Skip(); }
|
virtual void SetPlotFormat( wxCommandEvent& event ) { event.Skip(); }
|
||||||
virtual void Plot( wxCommandEvent& event ) { event.Skip(); }
|
virtual void Plot( wxCommandEvent& event ) { event.Skip(); }
|
||||||
virtual void savePlotOptions( wxCommandEvent& event ) { event.Skip(); }
|
virtual void applyPlotSettings( wxCommandEvent& event ) { event.Skip(); }
|
||||||
virtual void CreateDrillFile( wxCommandEvent& event ) { event.Skip(); }
|
virtual void CreateDrillFile( wxCommandEvent& event ) { event.Skip(); }
|
||||||
virtual void OnQuit( wxCommandEvent& event ) { event.Skip(); }
|
virtual void OnQuit( wxCommandEvent& event ) { event.Skip(); }
|
||||||
virtual void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) { event.Skip(); }
|
virtual void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) { event.Skip(); }
|
||||||
|
|
||||||
|
|
||||||
public:
|
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( 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();
|
~DIALOG_PLOT_BASE();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //__dialog_plot_base__
|
#endif //__dialog_plot_base__
|
||||||
|
|
|
@ -25,6 +25,8 @@
|
||||||
#include "pcbnew_id.h"
|
#include "pcbnew_id.h"
|
||||||
#include "richio.h"
|
#include "richio.h"
|
||||||
|
|
||||||
|
#include "pcb_plot_params.h"
|
||||||
|
|
||||||
/* ASCII format of structures:
|
/* ASCII format of structures:
|
||||||
*
|
*
|
||||||
* Structure PAD:
|
* Structure PAD:
|
||||||
|
@ -314,6 +316,27 @@ int WinEDA_BasePcbFrame::ReadSetup( LINE_READER* aReader )
|
||||||
while( aReader->ReadLine() )
|
while( aReader->ReadLine() )
|
||||||
{
|
{
|
||||||
Line = aReader->Line();
|
Line = aReader->Line();
|
||||||
|
|
||||||
|
if( strnicmp( Line, "PcbPlotParams", 13 ) == 0 )
|
||||||
|
{
|
||||||
|
PCB_PLOT_PARAMS_PARSER parser( &Line[13], aReader->GetSource() );
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
g_PcbPlotOptions.Parse( &parser );
|
||||||
|
}
|
||||||
|
catch( IO_ERROR& e )
|
||||||
|
{
|
||||||
|
wxString msg;
|
||||||
|
msg.Printf( wxT( "Error reading PcbPlotParams from %s:\n%s" ),
|
||||||
|
aReader->GetSource().GetData(),
|
||||||
|
e.errorText.GetData() );
|
||||||
|
wxMessageBox( msg, wxT( "Open Board File" ), wxICON_ERROR );
|
||||||
|
}
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
strtok( Line, " =\n\r" );
|
strtok( Line, " =\n\r" );
|
||||||
data = strtok( NULL, " =\n\r" );
|
data = strtok( NULL, " =\n\r" );
|
||||||
|
|
||||||
|
@ -576,7 +599,6 @@ int WinEDA_BasePcbFrame::ReadSetup( LINE_READER* aReader )
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -728,6 +750,15 @@ static int WriteSetup( FILE* aFile, WinEDA_BasePcbFrame* aFrame, BOARD* aBoard )
|
||||||
aFrame->m_Auxiliary_Axis_Position.x,
|
aFrame->m_Auxiliary_Axis_Position.x,
|
||||||
aFrame->m_Auxiliary_Axis_Position.y );
|
aFrame->m_Auxiliary_Axis_Position.y );
|
||||||
|
|
||||||
|
STRING_FORMATTER sf;
|
||||||
|
|
||||||
|
g_PcbPlotOptions.Format( &sf, 0 );
|
||||||
|
|
||||||
|
wxString record = CONV_FROM_UTF8( sf.GetString().c_str() );
|
||||||
|
record.Replace( wxT("\n"), wxT(""), true );
|
||||||
|
record.Replace( wxT(" "), wxT(" "), true);
|
||||||
|
fprintf( aFile, "PcbPlotParams %s\n", CONV_TO_UTF8( record ) );
|
||||||
|
|
||||||
fprintf( aFile, "$EndSETUP\n\n" );
|
fprintf( aFile, "$EndSETUP\n\n" );
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
|
@ -398,34 +398,5 @@ PARAM_CFG_ARRAY& WinEDA_PcbFrame::GetConfigurationSettings()
|
||||||
&g_Show_Module_Ratsnest, TRUE ) );
|
&g_Show_Module_Ratsnest, TRUE ) );
|
||||||
m_configSettings.push_back( new PARAM_CFG_BOOL( true, wxT( "TwoSegT" ),
|
m_configSettings.push_back( new PARAM_CFG_BOOL( true, wxT( "TwoSegT" ),
|
||||||
&g_TwoSegmentTrackBuild, TRUE ) );
|
&g_TwoSegmentTrackBuild, TRUE ) );
|
||||||
// Plot options:
|
|
||||||
m_configSettings.push_back( new PARAM_CFG_INT( true, wxT( "HPGLnum" ),
|
|
||||||
&g_PcbPlotOptions.m_HPGLPenNum,
|
|
||||||
1, 1, 16 ) );
|
|
||||||
m_configSettings.push_back( new PARAM_CFG_INT( true, wxT( "HPGdiam" ),
|
|
||||||
&g_PcbPlotOptions.m_HPGLPenDiam,
|
|
||||||
15, 0, 100 ) );
|
|
||||||
m_configSettings.push_back( new PARAM_CFG_INT( true, wxT( "HPGLSpd" ),
|
|
||||||
&g_PcbPlotOptions.m_HPGLPenSpeed,
|
|
||||||
20, 0, 1000 ) );
|
|
||||||
m_configSettings.push_back( new PARAM_CFG_INT( true, wxT( "HPGLrec" ),
|
|
||||||
&g_PcbPlotOptions.m_HPGLPenOvr,
|
|
||||||
2, 0, 0x100 ) );
|
|
||||||
m_configSettings.push_back( new PARAM_CFG_INT( true, wxT( "PlotOutputFormat" ),
|
|
||||||
&g_PcbPlotOptions.m_PlotFormat, PLOT_FORMAT_GERBER ) );
|
|
||||||
m_configSettings.push_back( new PARAM_CFG_BOOL( true, wxT( "EdgeLayerGerberOpt" ),
|
|
||||||
&g_PcbPlotOptions.m_ExcludeEdgeLayer, true ) );
|
|
||||||
m_configSettings.push_back( new PARAM_CFG_BOOL( true, wxT( "SubstractMasktoSilk" ),
|
|
||||||
&g_PcbPlotOptions.m_SubtractMaskFromSilk, false ) );
|
|
||||||
m_configSettings.push_back( new PARAM_CFG_BOOL( true, wxT( "PlotPadsOnSilkscreen" ),
|
|
||||||
&g_PcbPlotOptions.m_PlotPadsOnSilkLayer, false ) );
|
|
||||||
m_configSettings.push_back( new PARAM_CFG_BOOL( true, wxT( "PlotFrameRef" ),
|
|
||||||
&g_PcbPlotOptions.m_PlotFrameRef, false ) );
|
|
||||||
m_configSettings.push_back( new PARAM_CFG_BOOL( true, wxT( "PlotViasOnMask" ),
|
|
||||||
&g_PcbPlotOptions.m_PlotViaOnMaskLayer, false ) );
|
|
||||||
m_configSettings.push_back( new PARAM_CFG_INT( true, wxT( "PlotHolesOpt" ),
|
|
||||||
(int*)&g_PcbPlotOptions.m_DrillShapeOpt,
|
|
||||||
PCB_PLOT_PARAMS::SMALL_DRILL_SHAPE ) );
|
|
||||||
|
|
||||||
return m_configSettings;
|
return m_configSettings;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,11 +17,11 @@
|
||||||
#include "pcbstruct.h"
|
#include "pcbstruct.h"
|
||||||
#include "class_board_design_settings.h"
|
#include "class_board_design_settings.h"
|
||||||
#include "dialog_plot_base.h"
|
#include "dialog_plot_base.h"
|
||||||
|
#include "pcb_plot_params.h"
|
||||||
|
|
||||||
#define PLOT_DEFAULT_MARGE 300 // mils
|
#define PLOT_DEFAULT_MARGE 300 // mils
|
||||||
|
|
||||||
/* Keywords to r/w options in m_Config */
|
/* Keywords to r/w options in m_Config */
|
||||||
#define OPTKEY_GERBER_EXTENSIONS wxT( "GerberOptUseLayersExt" )
|
|
||||||
#define OPTKEY_XFINESCALE_ADJ wxT( "PlotXFineScaleAdj" )
|
#define OPTKEY_XFINESCALE_ADJ wxT( "PlotXFineScaleAdj" )
|
||||||
#define OPTKEY_YFINESCALE_ADJ wxT( "PlotYFineScaleAdj" )
|
#define OPTKEY_YFINESCALE_ADJ wxT( "PlotYFineScaleAdj" )
|
||||||
|
|
||||||
|
@ -29,32 +29,7 @@
|
||||||
#define MIN_SCALE 0.01
|
#define MIN_SCALE 0.01
|
||||||
#define MAX_SCALE 100.0
|
#define MAX_SCALE 100.0
|
||||||
|
|
||||||
// PCB_PLOT_PARAMS constructor: set the default values for plot options:
|
extern int g_DrawDefaultLineThickness;
|
||||||
PCB_PLOT_PARAMS::PCB_PLOT_PARAMS()
|
|
||||||
{
|
|
||||||
m_SubtractMaskFromSilk = false;
|
|
||||||
m_PlotReference = true;
|
|
||||||
m_PlotValue = true;
|
|
||||||
m_PlotTextOther = true;
|
|
||||||
m_DrillShapeOpt = PCB_PLOT_PARAMS::SMALL_DRILL_SHAPE;
|
|
||||||
m_PlotMode = FILLED;
|
|
||||||
m_PlotScale = 1.0;
|
|
||||||
m_AutoScale = false;
|
|
||||||
m_FineScaleAdjustX = 1.0;
|
|
||||||
m_FineScaleAdjustY = 1.0;
|
|
||||||
outputDirectory = wxT( "" );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static long s_SelectedLayers = LAYER_BACK | LAYER_FRONT |
|
|
||||||
SILKSCREEN_LAYER_FRONT | SILKSCREEN_LAYER_BACK;
|
|
||||||
|
|
||||||
static bool s_PlotOriginIsAuxAxis = FALSE;
|
|
||||||
|
|
||||||
|
|
||||||
/* The group of plot options - sadly global XXX */
|
|
||||||
PCB_PLOT_PARAMS g_PcbPlotOptions;
|
|
||||||
extern int g_DrawDefaultLineThickness;
|
|
||||||
|
|
||||||
|
|
||||||
/*******************************/
|
/*******************************/
|
||||||
|
@ -69,8 +44,6 @@ public:
|
||||||
wxCheckBox* m_BoxSelectLayer[LAYER_COUNT]; // wxCheckBox list to select/deselec layers to plot
|
wxCheckBox* m_BoxSelectLayer[LAYER_COUNT]; // wxCheckBox list to select/deselec layers to plot
|
||||||
double m_XScaleAdjust;
|
double m_XScaleAdjust;
|
||||||
double m_YScaleAdjust;
|
double m_YScaleAdjust;
|
||||||
static int m_dlgPlotScaleOpt; // Static to remember last selection
|
|
||||||
|
|
||||||
|
|
||||||
bool useA4()
|
bool useA4()
|
||||||
{
|
{
|
||||||
|
@ -113,12 +86,10 @@ private:
|
||||||
void OnOutputDirectoryBrowseClicked( wxCommandEvent& event );
|
void OnOutputDirectoryBrowseClicked( wxCommandEvent& event );
|
||||||
void SetPlotFormat( wxCommandEvent& event );
|
void SetPlotFormat( wxCommandEvent& event );
|
||||||
void OnSetScaleOpt( wxCommandEvent& event );
|
void OnSetScaleOpt( wxCommandEvent& event );
|
||||||
void savePlotOptions( wxCommandEvent& event );
|
void applyPlotSettings( wxCommandEvent& event );
|
||||||
void CreateDrillFile( wxCommandEvent& event );
|
void CreateDrillFile( wxCommandEvent& event );
|
||||||
};
|
};
|
||||||
|
|
||||||
int DIALOG_PLOT::m_dlgPlotScaleOpt = 1;
|
|
||||||
|
|
||||||
const int UNITS_MILS = 1000;
|
const int UNITS_MILS = 1000;
|
||||||
|
|
||||||
|
|
||||||
|
@ -149,7 +120,6 @@ void DIALOG_PLOT::Init_Dialog()
|
||||||
m_plotFormatOpt->SetSelection( g_PcbPlotOptions.m_PlotFormat );
|
m_plotFormatOpt->SetSelection( g_PcbPlotOptions.m_PlotFormat );
|
||||||
g_PcbPlotOptions.m_PlotLineWidth = g_DrawDefaultLineThickness;
|
g_PcbPlotOptions.m_PlotLineWidth = g_DrawDefaultLineThickness;
|
||||||
|
|
||||||
|
|
||||||
// Set units and value for HPGL pen speed.
|
// Set units and value for HPGL pen speed.
|
||||||
AddUnitSymbol( *m_textPenSize, g_UserUnit );
|
AddUnitSymbol( *m_textPenSize, g_UserUnit );
|
||||||
msg = ReturnStringFromValue( g_UserUnit, g_PcbPlotOptions.m_HPGLPenDiam, UNITS_MILS );
|
msg = ReturnStringFromValue( g_UserUnit, g_PcbPlotOptions.m_HPGLPenDiam, UNITS_MILS );
|
||||||
|
@ -171,11 +141,10 @@ void DIALOG_PLOT::Init_Dialog()
|
||||||
PCB_INTERNAL_UNIT );
|
PCB_INTERNAL_UNIT );
|
||||||
m_linesWidth->AppendText( msg );
|
m_linesWidth->AppendText( msg );
|
||||||
|
|
||||||
if( s_PlotOriginIsAuxAxis )
|
if( g_PcbPlotOptions.GetUseAuxOrigin() )
|
||||||
m_choicePlotOffset->SetSelection( 1 );
|
m_choicePlotOffset->SetSelection( 1 );
|
||||||
|
else
|
||||||
// Create scale adjust option
|
m_choicePlotOffset->SetSelection( 0 );
|
||||||
m_XScaleAdjust = m_YScaleAdjust = 1.0;
|
|
||||||
|
|
||||||
// Test for a reasonable scale value. Set to 1 if problem
|
// Test for a reasonable scale value. Set to 1 if problem
|
||||||
if( m_XScaleAdjust < MIN_SCALE || m_YScaleAdjust < MIN_SCALE
|
if( m_XScaleAdjust < MIN_SCALE || m_YScaleAdjust < MIN_SCALE
|
||||||
|
@ -193,7 +162,6 @@ void DIALOG_PLOT::Init_Dialog()
|
||||||
|
|
||||||
// Create layer list.
|
// Create layer list.
|
||||||
int layer;
|
int layer;
|
||||||
wxString layerKey;
|
|
||||||
for( layer = 0; layer < NB_LAYERS; ++layer )
|
for( layer = 0; layer < NB_LAYERS; ++layer )
|
||||||
{
|
{
|
||||||
if( !board->IsLayerEnabled( layer ) )
|
if( !board->IsLayerEnabled( layer ) )
|
||||||
|
@ -223,24 +191,14 @@ void DIALOG_PLOT::Init_Dialog()
|
||||||
m_TechnicalLayersBoxSizer->Add( m_BoxSelectLayer[layer],
|
m_TechnicalLayersBoxSizer->Add( m_BoxSelectLayer[layer],
|
||||||
0, wxGROW | wxALL, 1 );
|
0, wxGROW | wxALL, 1 );
|
||||||
|
|
||||||
|
long mask = 1 << layer;
|
||||||
layerKey.Printf( OPTKEY_LAYERBASE, layer );
|
if( g_PcbPlotOptions.GetLayerSelection() & mask )
|
||||||
bool option;
|
m_BoxSelectLayer[layer]->SetValue( true );
|
||||||
if( m_Config->Read( layerKey, &option ) )
|
|
||||||
m_BoxSelectLayer[layer]->SetValue( option );
|
|
||||||
else
|
|
||||||
{
|
|
||||||
long mask = 1 << layer;
|
|
||||||
if( mask & s_SelectedLayers )
|
|
||||||
m_BoxSelectLayer[layer]->SetValue( true );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Option for using proper Gerber extensions
|
// Option for using proper Gerber extensions
|
||||||
long ltmp;
|
m_useGerberExtensions->SetValue( g_PcbPlotOptions.GetUseGerberExtensions() );
|
||||||
m_Config->Read( OPTKEY_GERBER_EXTENSIONS, <mp );
|
|
||||||
m_useGerberExtensions->SetValue( ltmp );
|
|
||||||
|
|
||||||
// Option for excluding contents of "Edges Pcb" layer
|
// Option for excluding contents of "Edges Pcb" layer
|
||||||
m_excludeEdgeLayerOpt->SetValue( g_PcbPlotOptions.m_ExcludeEdgeLayer );
|
m_excludeEdgeLayerOpt->SetValue( g_PcbPlotOptions.m_ExcludeEdgeLayer );
|
||||||
|
@ -271,7 +229,7 @@ void DIALOG_PLOT::Init_Dialog()
|
||||||
m_drillShapeOpt->SetSelection( g_PcbPlotOptions.m_DrillShapeOpt );
|
m_drillShapeOpt->SetSelection( g_PcbPlotOptions.m_DrillShapeOpt );
|
||||||
|
|
||||||
// Scale option
|
// Scale option
|
||||||
m_scaleOpt->SetSelection( m_dlgPlotScaleOpt );
|
m_scaleOpt->SetSelection( g_PcbPlotOptions.GetScaleSelection() );
|
||||||
|
|
||||||
// Plot mode
|
// Plot mode
|
||||||
m_plotModeOpt->SetSelection( g_PcbPlotOptions.m_PlotMode );
|
m_plotModeOpt->SetSelection( g_PcbPlotOptions.m_PlotMode );
|
||||||
|
@ -440,73 +398,86 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DIALOG_PLOT::savePlotOptions( wxCommandEvent& event )
|
void DIALOG_PLOT::applyPlotSettings( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
g_PcbPlotOptions.m_ExcludeEdgeLayer = m_excludeEdgeLayerOpt->GetValue();
|
PCB_PLOT_PARAMS tempOptions;
|
||||||
|
|
||||||
g_PcbPlotOptions.SetSubtractMaskFromSilk( m_subtractMaskFromSilk->GetValue() );
|
tempOptions.m_ExcludeEdgeLayer = m_excludeEdgeLayerOpt->GetValue();
|
||||||
|
|
||||||
|
tempOptions.SetSubtractMaskFromSilk( m_subtractMaskFromSilk->GetValue() );
|
||||||
|
|
||||||
if( m_plotSheetRef )
|
if( m_plotSheetRef )
|
||||||
g_PcbPlotOptions.m_PlotFrameRef = m_plotSheetRef->GetValue();
|
tempOptions.m_PlotFrameRef = m_plotSheetRef->GetValue();
|
||||||
|
|
||||||
g_PcbPlotOptions.m_PlotPadsOnSilkLayer = m_plotPads_on_Silkscreen->GetValue();
|
tempOptions.m_PlotPadsOnSilkLayer = m_plotPads_on_Silkscreen->GetValue();
|
||||||
|
|
||||||
s_PlotOriginIsAuxAxis =
|
if( m_choicePlotOffset->GetSelection() == 0 )
|
||||||
(m_choicePlotOffset->GetSelection() == 0) ? FALSE : TRUE;
|
tempOptions.SetUseAuxOrigin( false );
|
||||||
|
else
|
||||||
|
tempOptions.SetUseAuxOrigin( true );
|
||||||
|
|
||||||
g_PcbPlotOptions.m_PlotValue = m_plotModuleValueOpt->GetValue();
|
tempOptions.m_PlotValue = m_plotModuleValueOpt->GetValue();
|
||||||
g_PcbPlotOptions.m_PlotReference = m_plotModuleRefOpt->GetValue();
|
tempOptions.m_PlotReference = m_plotModuleRefOpt->GetValue();
|
||||||
g_PcbPlotOptions.m_PlotTextOther = m_plotTextOther->GetValue();
|
tempOptions.m_PlotTextOther = m_plotTextOther->GetValue();
|
||||||
g_PcbPlotOptions.m_PlotInvisibleTexts = m_plotInvisibleText->GetValue();
|
tempOptions.m_PlotInvisibleTexts = m_plotInvisibleText->GetValue();
|
||||||
|
|
||||||
m_dlgPlotScaleOpt = m_scaleOpt->GetSelection();
|
tempOptions.SetScaleSelection( m_scaleOpt->GetSelection() );
|
||||||
g_PcbPlotOptions.m_DrillShapeOpt =
|
|
||||||
|
tempOptions.m_DrillShapeOpt =
|
||||||
(PCB_PLOT_PARAMS::DrillShapeOptT) m_drillShapeOpt->GetSelection();
|
(PCB_PLOT_PARAMS::DrillShapeOptT) m_drillShapeOpt->GetSelection();
|
||||||
g_PcbPlotOptions.m_PlotMirror = m_plotMirrorOpt->GetValue();
|
tempOptions.m_PlotMirror = m_plotMirrorOpt->GetValue();
|
||||||
g_PcbPlotOptions.m_PlotMode = (GRTraceMode) m_plotModeOpt->GetSelection();
|
tempOptions.m_PlotMode = (GRTraceMode) m_plotModeOpt->GetSelection();
|
||||||
g_PcbPlotOptions.m_PlotViaOnMaskLayer = m_plotNoViaOnMaskOpt->GetValue();
|
tempOptions.m_PlotViaOnMaskLayer = m_plotNoViaOnMaskOpt->GetValue();
|
||||||
|
|
||||||
wxString msg = m_HPGLPenSizeOpt->GetValue();
|
wxString msg = m_HPGLPenSizeOpt->GetValue();
|
||||||
int tmp = ReturnValueFromString( g_UserUnit, msg, UNITS_MILS );
|
int tmp = ReturnValueFromString( g_UserUnit, msg, UNITS_MILS );
|
||||||
g_PcbPlotOptions.m_HPGLPenDiam = tmp;
|
tempOptions.m_HPGLPenDiam = tmp;
|
||||||
|
|
||||||
msg = m_HPGLPenSpeedOpt->GetValue();
|
msg = m_HPGLPenSpeedOpt->GetValue();
|
||||||
tmp = ReturnValueFromString( MILLIMETRES, msg, 1 );
|
tmp = ReturnValueFromString( UNSCALED_UNITS, msg, 1 );
|
||||||
g_PcbPlotOptions.m_HPGLPenSpeed = tmp;
|
tempOptions.m_HPGLPenSpeed = tmp;
|
||||||
|
|
||||||
msg = m_HPGLPenOverlayOpt->GetValue();
|
msg = m_HPGLPenOverlayOpt->GetValue();
|
||||||
tmp = ReturnValueFromString( g_UserUnit, msg, UNITS_MILS );
|
tmp = ReturnValueFromString( g_UserUnit, msg, UNITS_MILS );
|
||||||
g_PcbPlotOptions.m_HPGLPenOvr = tmp;
|
tempOptions.m_HPGLPenOvr = tmp;
|
||||||
|
|
||||||
msg = m_linesWidth->GetValue();
|
msg = m_linesWidth->GetValue();
|
||||||
tmp = ReturnValueFromString( g_UserUnit, msg, PCB_INTERNAL_UNIT );
|
tmp = ReturnValueFromString( g_UserUnit, msg, PCB_INTERNAL_UNIT );
|
||||||
g_PcbPlotOptions.m_PlotLineWidth = tmp;
|
tempOptions.m_PlotLineWidth = tmp;
|
||||||
g_DrawDefaultLineThickness = g_PcbPlotOptions.m_PlotLineWidth;
|
g_DrawDefaultLineThickness = tempOptions.m_PlotLineWidth;
|
||||||
|
|
||||||
msg = m_fineAdjustXscaleOpt->GetValue();
|
msg = m_fineAdjustXscaleOpt->GetValue();
|
||||||
msg.ToDouble( &m_XScaleAdjust );
|
msg.ToDouble( &m_XScaleAdjust );
|
||||||
msg = m_fineAdjustYscaleOpt->GetValue();
|
msg = m_fineAdjustYscaleOpt->GetValue();
|
||||||
msg.ToDouble( &m_YScaleAdjust );
|
msg.ToDouble( &m_YScaleAdjust );
|
||||||
|
|
||||||
m_Config->Write( OPTKEY_GERBER_EXTENSIONS,
|
tempOptions.SetUseGerberExtensions( m_useGerberExtensions->GetValue() );
|
||||||
m_useGerberExtensions->GetValue() );
|
|
||||||
m_Config->Write( OPTKEY_XFINESCALE_ADJ, m_XScaleAdjust );
|
m_Config->Write( OPTKEY_XFINESCALE_ADJ, m_XScaleAdjust );
|
||||||
m_Config->Write( OPTKEY_YFINESCALE_ADJ, m_YScaleAdjust );
|
m_Config->Write( OPTKEY_YFINESCALE_ADJ, m_YScaleAdjust );
|
||||||
|
|
||||||
g_PcbPlotOptions.m_PlotFormat = m_plotFormatOpt->GetSelection();
|
tempOptions.m_PlotFormat = m_plotFormatOpt->GetSelection();
|
||||||
|
|
||||||
wxString layerKey;
|
long selectedLayers = 0;
|
||||||
for( int layer = 0; layer<NB_LAYERS; ++layer )
|
long mask = 1;
|
||||||
|
int layer;
|
||||||
|
for( layer = 0; layer < NB_LAYERS; layer++, mask <<= 1 )
|
||||||
{
|
{
|
||||||
if( m_BoxSelectLayer[layer] == NULL )
|
if( m_BoxSelectLayer[layer] == NULL )
|
||||||
continue;
|
continue;
|
||||||
layerKey.Printf( OPTKEY_LAYERBASE, layer );
|
if( m_BoxSelectLayer[layer]->GetValue() )
|
||||||
m_Config->Write( layerKey, m_BoxSelectLayer[layer]->IsChecked() );
|
selectedLayers |= mask;
|
||||||
}
|
}
|
||||||
|
tempOptions.SetLayerSelection( selectedLayers );
|
||||||
|
|
||||||
g_PcbPlotOptions.m_PlotPSNegative = m_plotPSNegativeOpt->GetValue();
|
tempOptions.m_PlotPSNegative = m_plotPSNegativeOpt->GetValue();
|
||||||
|
|
||||||
g_PcbPlotOptions.SetOutputDirectory( m_outputDirectoryName->GetValue() );
|
tempOptions.SetOutputDirectory( m_outputDirectoryName->GetValue() );
|
||||||
|
|
||||||
|
if( g_PcbPlotOptions != tempOptions )
|
||||||
|
{
|
||||||
|
g_PcbPlotOptions = tempOptions;
|
||||||
|
m_Parent->OnModify();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -518,7 +489,7 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event )
|
||||||
|
|
||||||
BOARD* board = m_Parent->GetBoard();
|
BOARD* board = m_Parent->GetBoard();
|
||||||
|
|
||||||
savePlotOptions( event );
|
applyPlotSettings( event );
|
||||||
|
|
||||||
// Create output directory if it does not exist
|
// Create output directory if it does not exist
|
||||||
if( !wxFileName::DirExists( m_outputDirectoryName->GetValue() ) )
|
if( !wxFileName::DirExists( m_outputDirectoryName->GetValue() ) )
|
||||||
|
@ -538,7 +509,7 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event )
|
||||||
|
|
||||||
g_PcbPlotOptions.m_AutoScale = false;
|
g_PcbPlotOptions.m_AutoScale = false;
|
||||||
g_PcbPlotOptions.m_PlotScale = 1;
|
g_PcbPlotOptions.m_PlotScale = 1;
|
||||||
switch( m_dlgPlotScaleOpt )
|
switch( g_PcbPlotOptions.GetScaleSelection() )
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -601,8 +572,7 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event )
|
||||||
DisplayInfoMessage( this,
|
DisplayInfoMessage( this,
|
||||||
_( "Warning: Scale option set to a very large value" ) );
|
_( "Warning: Scale option set to a very large value" ) );
|
||||||
|
|
||||||
int mask = 1;
|
long mask = 1;
|
||||||
s_SelectedLayers = 0;
|
|
||||||
for( layer = 0; layer < NB_LAYERS; layer++, mask <<= 1 )
|
for( layer = 0; layer < NB_LAYERS; layer++, mask <<= 1 )
|
||||||
{
|
{
|
||||||
if( m_BoxSelectLayer[layer] == NULL )
|
if( m_BoxSelectLayer[layer] == NULL )
|
||||||
|
@ -610,8 +580,6 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event )
|
||||||
bool success = false;
|
bool success = false;
|
||||||
if( m_BoxSelectLayer[layer]->GetValue() )
|
if( m_BoxSelectLayer[layer]->GetValue() )
|
||||||
{
|
{
|
||||||
s_SelectedLayers |= mask;
|
|
||||||
|
|
||||||
fn = m_Parent->GetScreen()->GetFileName();
|
fn = m_Parent->GetScreen()->GetFileName();
|
||||||
fn.SetPath( m_outputDirectoryName->GetValue() );
|
fn.SetPath( m_outputDirectoryName->GetValue() );
|
||||||
|
|
||||||
|
@ -711,7 +679,7 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event )
|
||||||
|
|
||||||
case PLOT_FORMAT_GERBER:
|
case PLOT_FORMAT_GERBER:
|
||||||
success = m_Parent->Genere_GERBER( fn.GetFullPath(), layer,
|
success = m_Parent->Genere_GERBER( fn.GetFullPath(), layer,
|
||||||
s_PlotOriginIsAuxAxis,
|
g_PcbPlotOptions.GetUseAuxOrigin(),
|
||||||
g_PcbPlotOptions.m_PlotMode );
|
g_PcbPlotOptions.m_PlotMode );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -740,7 +708,7 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event )
|
||||||
// If no layer selected, we have nothing plotted.
|
// If no layer selected, we have nothing plotted.
|
||||||
// Prompt user if it happens
|
// Prompt user if it happens
|
||||||
// because he could think there is a bug in pcbnew:
|
// because he could think there is a bug in pcbnew:
|
||||||
if( s_SelectedLayers == 0 )
|
if( !g_PcbPlotOptions.GetLayerSelection() )
|
||||||
DisplayError( this, _( "No layer selected" ) );
|
DisplayError( this, _( "No layer selected" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#ifndef PCBPLOT_H
|
#ifndef PCBPLOT_H
|
||||||
#define PCBPLOT_H
|
#define PCBPLOT_H
|
||||||
|
|
||||||
|
#include "pcb_plot_params.h"
|
||||||
|
|
||||||
/* Shared Config keys for plot and print */
|
/* Shared Config keys for plot and print */
|
||||||
#define OPTKEY_LAYERBASE wxT( "PlotLayer_%d" )
|
#define OPTKEY_LAYERBASE wxT( "PlotLayer_%d" )
|
||||||
|
@ -25,67 +26,6 @@
|
||||||
// Small drill marks diameter value (in internal value = 1/10000 inch)
|
// Small drill marks diameter value (in internal value = 1/10000 inch)
|
||||||
#define SMALL_DRILL 150
|
#define SMALL_DRILL 150
|
||||||
|
|
||||||
/* a helper class to handle plot parameters and options when plotting/printing a board
|
|
||||||
*/
|
|
||||||
class PCB_PLOT_PARAMS
|
|
||||||
{
|
|
||||||
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
|
|
||||||
bool m_SubtractMaskFromSilk;
|
|
||||||
|
|
||||||
/// id for plot format (see enum PlotFormat in plot_common.h) */
|
|
||||||
int m_PlotFormat; // Gerber, HPGL ...
|
|
||||||
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:
|
|
||||||
wxString outputDirectory;
|
|
||||||
|
|
||||||
public:
|
|
||||||
PCB_PLOT_PARAMS();
|
|
||||||
void SetOutputDirectory( wxString aDir ) { outputDirectory = aDir; };
|
|
||||||
wxString GetOutputDirectory() { return outputDirectory; };
|
|
||||||
void SetSubtractMaskFromSilk( bool aSubtract ) { m_SubtractMaskFromSilk = aSubtract; };
|
|
||||||
bool GetSubtractMaskFromSilk() { return m_SubtractMaskFromSilk; };
|
|
||||||
};
|
|
||||||
|
|
||||||
extern PCB_PLOT_PARAMS g_PcbPlotOptions;
|
|
||||||
|
|
||||||
|
|
||||||
void PlotTextePcb( PLOTTER* plotter, TEXTE_PCB* pt_texte, int masque_layer,
|
void PlotTextePcb( PLOTTER* plotter, TEXTE_PCB* pt_texte, int masque_layer,
|
||||||
GRTraceMode trace_mode );
|
GRTraceMode trace_mode );
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
#include "confirm.h"
|
#include "confirm.h"
|
||||||
#include "pcbnew.h"
|
#include "pcbnew.h"
|
||||||
#include "protos.h"
|
#include "protos.h"
|
||||||
#include "pcbplot.h"
|
|
||||||
|
|
||||||
#include "printout_controler.h"
|
#include "printout_controler.h"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue