Commit 73bdd76a authored by Marco Mattila's avatar Marco Mattila

Tune pcb plot dialog layout. Make output directory accept relative paths.

parent 50706777
...@@ -14,14 +14,20 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr ...@@ -14,14 +14,20 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
this->SetSizeHints( wxSize( -1,350 ), wxDefaultSize ); this->SetSizeHints( wxSize( -1,350 ), wxDefaultSize );
wxBoxSizer* bMainSizer; wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxVERTICAL ); bMainSizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bSizer12;
bSizer12 = new wxBoxSizer( wxVERTICAL );
wxString m_plotFormatOptChoices[] = { _("HPGL"), _("Gerber"), _("Postscript"), _("Postscript A4"), _("DXF") };
int m_plotFormatOptNChoices = sizeof( m_plotFormatOptChoices ) / sizeof( wxString );
m_plotFormatOpt = new wxRadioBox( this, wxID_ANY, _("Format"), wxDefaultPosition, wxDefaultSize, m_plotFormatOptNChoices, m_plotFormatOptChoices, 1, 0 );
m_plotFormatOpt->SetSelection( 0 );
bSizer12->Add( m_plotFormatOpt, 0, wxEXPAND, 5 );
wxBoxSizer* bUpperSizer; wxBoxSizer* bUpperSizer;
bUpperSizer = new wxBoxSizer( wxHORIZONTAL ); bUpperSizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bLeftSizer;
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 );
...@@ -33,190 +39,225 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr ...@@ -33,190 +39,225 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
sbLayersSizer->Add( m_TechnicalLayersBoxSizer, 1, wxALL, 5 ); sbLayersSizer->Add( m_TechnicalLayersBoxSizer, 1, wxALL, 5 );
bLeftSizer->Add( sbLayersSizer, 1, wxEXPAND, 5 ); bUpperSizer->Add( sbLayersSizer, 1, wxALL, 3 );
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 ); wxBoxSizer* bPlotOptionsSizer;
m_excludeEdgeLayerOpt->SetToolTip( _("Exclude contents of the pcb edge layer from all other layers") ); bPlotOptionsSizer = new wxBoxSizer( wxVERTICAL );
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 ); wxStaticBoxSizer* sbOptionsSizer;
sbOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options") ), wxVERTICAL );
m_plotSheetRef = new wxCheckBox( this, wxID_ANY, _("Plot sheet reference"), wxDefaultPosition, wxDefaultSize, 0 ); m_plotSheetRef = new wxCheckBox( this, wxID_ANY, _("Plot sheet reference on all layers"), wxDefaultPosition, wxDefaultSize, 0 );
bLeftSizer->Add( m_plotSheetRef, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); sbOptionsSizer->Add( m_plotSheetRef, 0, wxTOP|wxRIGHT|wxLEFT, 2 );
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 ); sbOptionsSizer->Add( m_plotPads_on_Silkscreen, 0, wxTOP|wxRIGHT|wxLEFT, 2 );
m_plotModuleValueOpt = new wxCheckBox( this, wxID_ANY, _("Plot module value"), wxDefaultPosition, wxDefaultSize, 0 ); m_plotModuleValueOpt = new wxCheckBox( this, wxID_ANY, _("Plot module value on silkscreen"), wxDefaultPosition, wxDefaultSize, 0 );
bLeftSizer->Add( m_plotModuleValueOpt, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); sbOptionsSizer->Add( m_plotModuleValueOpt, 0, wxTOP|wxRIGHT|wxLEFT, 2 );
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 on silkscreen"), wxDefaultPosition, wxDefaultSize, 0 );
bLeftSizer->Add( m_plotModuleRefOpt, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); sbOptionsSizer->Add( m_plotModuleRefOpt, 0, wxTOP|wxRIGHT|wxLEFT, 2 );
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 on silkscreen"), 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 ); sbOptionsSizer->Add( m_plotTextOther, 0, wxTOP|wxRIGHT|wxLEFT, 2 );
m_plotInvisibleText = new wxCheckBox( this, wxID_ANY, _("Force plot invisible texts"), wxDefaultPosition, wxDefaultSize, 0 ); m_plotInvisibleText = new wxCheckBox( this, wxID_ANY, _("Plot invisible texts on silkscreen"), 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 ); sbOptionsSizer->Add( m_plotInvisibleText, 0, wxALL, 2 );
bUpperSizer->Add( bLeftSizer, 2, wxEXPAND, 5 ); m_plotNoViaOnMaskOpt = new wxCheckBox( this, wxID_ANY, _("Do not tent vias"), wxDefaultPosition, wxDefaultSize, 0 );
m_plotNoViaOnMaskOpt->SetToolTip( _("Print/plot vias on mask layers. They are in this case not protected") );
wxBoxSizer* bPlotOptionsSizer; sbOptionsSizer->Add( m_plotNoViaOnMaskOpt, 0, wxALL, 2 );
bPlotOptionsSizer = new wxBoxSizer( wxVERTICAL );
m_plotMirrorOpt = new wxCheckBox( this, ID_MIROR_OPT, _("Mirrored plot"), wxDefaultPosition, wxDefaultSize, 0 );
sbOptionsSizer->Add( m_plotMirrorOpt, 0, wxALL, 2 );
wxBoxSizer* bSizer14;
bSizer14 = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bSizer15;
bSizer15 = new wxBoxSizer( wxVERTICAL );
wxString m_drillShapeOptChoices[] = { _("No drill mark"), _("Small mark"), _("Actual hole") }; m_staticText11 = new wxStaticText( this, wxID_ANY, _("Drill marks:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText11->Wrap( -1 );
bSizer15->Add( m_staticText11, 0, wxALL, 5 );
wxString m_drillShapeOptChoices[] = { _("None"), _("Small"), _("Actual size") };
int m_drillShapeOptNChoices = sizeof( m_drillShapeOptChoices ) / sizeof( wxString ); 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 = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_drillShapeOptNChoices, m_drillShapeOptChoices, 0 );
m_drillShapeOpt->SetSelection( 0 ); m_drillShapeOpt->SetSelection( 0 );
bPlotOptionsSizer->Add( m_drillShapeOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); bSizer15->Add( m_drillShapeOpt, 0, wxEXPAND, 5 );
m_staticText12 = new wxStaticText( this, wxID_ANY, _("Scaling:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText12->Wrap( -1 );
bSizer15->Add( m_staticText12, 0, wxALL, 5 );
wxString m_scaleOptChoices[] = { _("Auto scale"), _("Scale 1"), _("Scale 1.5"), _("Scale 2"), _("Scale 3") }; wxString m_scaleOptChoices[] = { _("Auto"), _("1:1"), _("3:2"), _("2:1"), _("3:1") };
int m_scaleOptNChoices = sizeof( m_scaleOptChoices ) / sizeof( wxString ); 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 = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_scaleOptNChoices, m_scaleOptChoices, 0 );
m_scaleOpt->SetSelection( 0 ); m_scaleOpt->SetSelection( 0 );
bPlotOptionsSizer->Add( m_scaleOpt, 0, wxEXPAND|wxALL, 5 ); bSizer15->Add( m_scaleOpt, 0, wxEXPAND, 5 );
bSizer14->Add( bSizer15, 1, wxALL|wxEXPAND, 3 );
wxBoxSizer* bSizer16;
bSizer16 = new wxBoxSizer( wxVERTICAL );
m_staticText13 = new wxStaticText( this, wxID_ANY, _("Plot mode:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText13->Wrap( -1 );
bSizer16->Add( m_staticText13, 0, 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 wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_plotModeOptNChoices, m_plotModeOptChoices, 0 );
m_plotModeOpt->SetSelection( 0 ); m_plotModeOpt->SetSelection( 0 );
bPlotOptionsSizer->Add( m_plotModeOpt, 0, wxALL|wxEXPAND, 5 ); bSizer16->Add( m_plotModeOpt, 0, wxEXPAND, 5 );
wxString m_choicePlotOffsetChoices[] = { _("Absolute"), _("Auxiliary axis") }; m_textDefaultPenSize = new wxStaticText( this, wxID_ANY, _("Default\nlinewidth"), wxDefaultPosition, wxDefaultSize, 0 );
int m_choicePlotOffsetNChoices = sizeof( m_choicePlotOffsetChoices ) / sizeof( wxString ); m_textDefaultPenSize->Wrap( -1 );
m_choicePlotOffset = new wxRadioBox( this, wxID_ANY, _("Plot Origin"), wxDefaultPosition, wxDefaultSize, m_choicePlotOffsetNChoices, m_choicePlotOffsetChoices, 1, wxRA_SPECIFY_COLS ); m_textDefaultPenSize->SetToolTip( _("Pen size used to draw items that have no pen size specified.\nUsed mainly to draw items in sketch mode.") );
m_choicePlotOffset->SetSelection( 1 );
bPlotOptionsSizer->Add( m_choicePlotOffset, 0, wxALL|wxEXPAND, 5 );
bUpperSizer->Add( bPlotOptionsSizer, 0, wxEXPAND, 5 ); bSizer16->Add( m_textDefaultPenSize, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* bSizerFmtPlot; m_linesWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bSizerFmtPlot = new wxBoxSizer( wxVERTICAL ); m_linesWidth->SetToolTip( _("Line width for, e.g., sheet references.") );
wxString m_plotFormatOptChoices[] = { _("HPGL"), _("Gerber"), _("Postscript"), _("Postscript A4"), _("DXF export") }; bSizer16->Add( m_linesWidth, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
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 ); bSizer14->Add( bSizer16, 1, wxALL|wxEXPAND, 3 );
m_plotFormatOpt->SetSelection( 1 );
bSizerFmtPlot->Add( m_plotFormatOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); sbOptionsSizer->Add( bSizer14, 1, wxALL|wxEXPAND, 3 );
bPlotOptionsSizer->Add( sbOptionsSizer, 0, wxALL|wxEXPAND, 3 );
bUpperSizer->Add( bPlotOptionsSizer, 1, 0, 5 );
wxBoxSizer* bPlotIndOptionsSizer;
bPlotIndOptionsSizer = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* m_Gerber_OptionsBox;
m_Gerber_OptionsBox = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Gerber Options") ), wxVERTICAL );
m_useGerberExtensions = new wxCheckBox( this, wxID_ANY, _("Use proper file extensions"), wxDefaultPosition, wxDefaultSize, 0 );
m_useGerberExtensions->SetToolTip( _("Use proper Gerber extensions - .GBL, .GTL, etc...") );
m_Gerber_OptionsBox->Add( m_useGerberExtensions, 0, wxLEFT|wxRIGHT|wxTOP, 2 );
m_excludeEdgeLayerOpt = new wxCheckBox( this, wxID_ANY, _("Exclude PCB edge layer\nfrom other layers"), wxDefaultPosition, wxDefaultSize, 0 );
m_excludeEdgeLayerOpt->SetToolTip( _("Exclude contents of the pcb edge layer from all other layers") );
m_Gerber_OptionsBox->Add( m_excludeEdgeLayerOpt, 0, wxTOP|wxRIGHT|wxLEFT, 2 );
m_subtractMaskFromSilk = new wxCheckBox( this, wxID_ANY, _("Subtract mask from\nsilkscren"), wxDefaultPosition, wxDefaultSize, 0 );
m_subtractMaskFromSilk->SetValue(true);
m_subtractMaskFromSilk->SetToolTip( _("Remove silkscreen from areas without soldermask") );
m_Gerber_OptionsBox->Add( m_subtractMaskFromSilk, 0, wxTOP|wxRIGHT|wxLEFT, 2 );
m_useAuxOriginCheckBox = new wxCheckBox( this, wxID_ANY, _("Use auxiliary origin"), wxDefaultPosition, wxDefaultSize, 0 );
m_Gerber_OptionsBox->Add( m_useAuxOriginCheckBox, 0, wxALL, 2 );
bPlotIndOptionsSizer->Add( m_Gerber_OptionsBox, 0, wxALL|wxEXPAND, 3 );
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 );
wxBoxSizer* bSizer22;
bSizer22 = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bSizer20;
bSizer20 = new wxBoxSizer( 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 ); bSizer20->Add( m_textPenSize, 0, wxLEFT|wxRIGHT|wxTOP, 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 ); bSizer20->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 = 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 ); bSizer20->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 ); bSizer20->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; bSizer22->Add( bSizer20, 1, wxEXPAND, 5 );
sbSizerPlotOpt = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Plot Options") ), wxVERTICAL );
m_plotPSNegativeOpt = new wxCheckBox( this, wxID_ANY, _("Plot negative"), wxDefaultPosition, wxDefaultSize, 0 ); wxBoxSizer* bSizer21;
sbSizerPlotOpt->Add( m_plotPSNegativeOpt, 0, wxALL, 5 ); bSizer21 = new wxBoxSizer( wxVERTICAL );
m_plotMirrorOpt = new wxCheckBox( this, ID_MIROR_OPT, _("Plot mirror"), wxDefaultPosition, wxDefaultSize, 0 ); m_textPenSpeed = new wxStaticText( this, wxID_ANY, _("Pen speed (cm/s):"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizerPlotOpt->Add( m_plotMirrorOpt, 0, wxALL, 5 ); m_textPenSpeed->Wrap( -1 );
bSizer21->Add( m_textPenSpeed, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_plotNoViaOnMaskOpt = new wxCheckBox( this, wxID_ANY, _("Vias on mask"), wxDefaultPosition, wxDefaultSize, 0 ); m_HPGLPenSpeedOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_plotNoViaOnMaskOpt->SetToolTip( _("Print/plot vias on mask layers. They are in this case not protected") ); m_HPGLPenSpeedOpt->SetToolTip( _("Set pen speed in cm/s") );
sbSizerPlotOpt->Add( m_plotNoViaOnMaskOpt, 0, wxALL, 5 ); bSizer21->Add( m_HPGLPenSpeedOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
bButtonsSizer->Add( sbSizerPlotOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); bSizer22->Add( bSizer21, 1, wxEXPAND, 5 );
m_staticText6 = new wxStaticText( this, wxID_ANY, _("Default Pen Size:"), wxDefaultPosition, wxDefaultSize, 0 ); m_HPGL_OptionsBox->Add( bSizer22, 1, wxEXPAND, 5 );
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 ); bPlotIndOptionsSizer->Add( m_HPGL_OptionsBox, 0, wxALL|wxEXPAND, 3 );
m_linesWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); wxStaticBoxSizer* m_PS_OptionsBox;
bButtonsSizer->Add( m_linesWidth, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_PS_OptionsBox = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Postscript Options") ), wxVERTICAL );
wxBoxSizer* bSizer17;
bSizer17 = new wxBoxSizer( wxHORIZONTAL );
bButtonsSizer->Add( 0, 20, 1, wxEXPAND, 5 ); wxBoxSizer* bSizer18;
bSizer18 = new wxBoxSizer( wxVERTICAL );
m_staticText7 = new wxStaticText( this, wxID_ANY, _("X Scale Adjust:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText7 = new wxStaticText( this, wxID_ANY, _("X scale:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText7->Wrap( -1 ); m_staticText7->Wrap( -1 );
bButtonsSizer->Add( m_staticText7, 0, wxRIGHT|wxLEFT, 5 ); bSizer18->Add( m_staticText7, 0, wxALL, 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 ); bSizer18->Add( m_fineAdjustXscaleOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_staticText8 = new wxStaticText( this, wxID_ANY, _("Y Scale Adjust:"), wxDefaultPosition, wxDefaultSize, 0 ); bSizer17->Add( bSizer18, 1, wxEXPAND, 5 );
m_staticText8->Wrap( -1 );
bButtonsSizer->Add( m_staticText8, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_fineAdjustYscaleOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); wxBoxSizer* bSizer19;
bButtonsSizer->Add( m_fineAdjustYscaleOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); bSizer19 = new wxBoxSizer( wxVERTICAL );
m_staticText8 = new wxStaticText( this, wxID_ANY, _("Y scale:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText8->Wrap( -1 );
bSizer19->Add( m_staticText8, 0, wxALL, 5 );
bButtonsSizer->Add( 0, 20, 1, wxEXPAND, 5 ); m_fineAdjustYscaleOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bSizer19->Add( m_fineAdjustYscaleOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_plotButton = new wxButton( this, wxID_ANY, _("Plot"), wxDefaultPosition, wxDefaultSize, 0 ); bSizer17->Add( bSizer19, 1, wxEXPAND, 5 );
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 ); m_PS_OptionsBox->Add( bSizer17, 1, 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_plotPSNegativeOpt = new wxCheckBox( this, wxID_ANY, _("Negative plot"), wxDefaultPosition, wxDefaultSize, 0 );
bButtonsSizer->Add( m_buttonDrill, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); m_PS_OptionsBox->Add( m_plotPSNegativeOpt, 0, wxALL, 2 );
m_buttonQuit = new wxButton( this, wxID_CANCEL, _("Quit"), wxDefaultPosition, wxDefaultSize, 0 ); bPlotIndOptionsSizer->Add( m_PS_OptionsBox, 1, wxALL|wxEXPAND, 3 );
bButtonsSizer->Add( m_buttonQuit, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
bUpperSizer->Add( bButtonsSizer, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); bUpperSizer->Add( bPlotIndOptionsSizer, 0, 0, 5 );
bMainSizer->Add( bUpperSizer, 0, wxEXPAND, 5 ); bSizer12->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 );
...@@ -224,6 +265,8 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr ...@@ -224,6 +265,8 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
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 );
m_outputDirectoryName->SetToolTip( _("Target directory for plot files. Can be relative or absolute.") );
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 );
...@@ -231,16 +274,36 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr ...@@ -231,16 +274,36 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
bSizerDirChoice->Add( bSizerDirNmae, 0, wxRIGHT|wxEXPAND, 5 ); bSizerDirChoice->Add( bSizerDirNmae, 0, wxRIGHT|wxEXPAND, 5 );
bMainSizer->Add( bSizerDirChoice, 0, wxEXPAND, 5 ); bSizer12->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 ); bSizer12->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,100 ) );
bSizer12->Add( m_messagesBox, 1, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
bMainSizer->Add( bSizer12, 1, wxALL|wxEXPAND, 5 );
wxBoxSizer* bButtonsSizer;
bButtonsSizer = new wxBoxSizer( wxVERTICAL );
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 );
bMainSizer->Add( m_messagesBox, 1, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); m_buttonQuit = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 );
bButtonsSizer->Add( m_buttonQuit, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
bMainSizer->Add( bButtonsSizer, 0, wxALIGN_BOTTOM|wxALL, 3 );
this->SetSizer( bMainSizer ); this->SetSizer( bMainSizer );
this->Layout(); this->Layout();
...@@ -249,11 +312,12 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr ...@@ -249,11 +312,12 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
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_scaleOpt->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnSetScaleOpt ), NULL, this );
m_browseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnOutputDirectoryBrowseClicked ), 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::applyPlotSettings ), 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 );
} }
DIALOG_PLOT_BASE::~DIALOG_PLOT_BASE() DIALOG_PLOT_BASE::~DIALOG_PLOT_BASE()
...@@ -262,10 +326,11 @@ DIALOG_PLOT_BASE::~DIALOG_PLOT_BASE() ...@@ -262,10 +326,11 @@ DIALOG_PLOT_BASE::~DIALOG_PLOT_BASE()
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_scaleOpt->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnSetScaleOpt ), NULL, this );
m_browseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnOutputDirectoryBrowseClicked ), 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::applyPlotSettings ), 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 );
} }
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -11,15 +11,16 @@ ...@@ -11,15 +11,16 @@
#include <wx/intl.h> #include <wx/intl.h>
#include <wx/string.h> #include <wx/string.h>
#include <wx/sizer.h> #include <wx/radiobox.h>
#include <wx/statbox.h>
#include <wx/gdicmn.h> #include <wx/gdicmn.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/sizer.h>
#include <wx/statbox.h>
#include <wx/checkbox.h>
#include <wx/stattext.h> #include <wx/stattext.h>
#include <wx/choice.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>
...@@ -43,63 +44,65 @@ class DIALOG_PLOT_BASE : public wxDialog ...@@ -43,63 +44,65 @@ class DIALOG_PLOT_BASE : public wxDialog
ID_CREATE_DRILL_FILE, ID_CREATE_DRILL_FILE,
}; };
wxRadioBox* m_plotFormatOpt;
wxStaticBoxSizer* m_CopperLayersBoxSizer; wxStaticBoxSizer* m_CopperLayersBoxSizer;
wxStaticBoxSizer* m_TechnicalLayersBoxSizer; wxStaticBoxSizer* m_TechnicalLayersBoxSizer;
wxCheckBox* m_useGerberExtensions;
wxCheckBox* m_excludeEdgeLayerOpt;
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; wxCheckBox* m_plotNoViaOnMaskOpt;
wxRadioBox* m_scaleOpt; wxCheckBox* m_plotMirrorOpt;
wxRadioBox* m_plotModeOpt; wxStaticText* m_staticText11;
wxRadioBox* m_choicePlotOffset; wxChoice* m_drillShapeOpt;
wxRadioBox* m_plotFormatOpt; wxStaticText* m_staticText12;
wxChoice* m_scaleOpt;
wxStaticText* m_staticText13;
wxChoice* m_plotModeOpt;
wxStaticText* m_textDefaultPenSize;
wxTextCtrl* m_linesWidth;
wxCheckBox* m_useGerberExtensions;
wxCheckBox* m_excludeEdgeLayerOpt;
wxCheckBox* m_subtractMaskFromSilk;
wxCheckBox* m_useAuxOriginCheckBox;
wxStaticText* m_textPenSize; wxStaticText* m_textPenSize;
wxTextCtrl* m_HPGLPenSizeOpt; wxTextCtrl* m_HPGLPenSizeOpt;
wxStaticText* m_staticText3;
wxTextCtrl* m_HPGLPenSpeedOpt;
wxStaticText* m_textPenOvr; wxStaticText* m_textPenOvr;
wxTextCtrl* m_HPGLPenOverlayOpt; wxTextCtrl* m_HPGLPenOverlayOpt;
wxCheckBox* m_plotPSNegativeOpt; wxStaticText* m_textPenSpeed;
wxCheckBox* m_plotMirrorOpt; wxTextCtrl* m_HPGLPenSpeedOpt;
wxCheckBox* m_plotNoViaOnMaskOpt;
wxStaticText* m_staticText6;
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;
wxCheckBox* m_plotPSNegativeOpt;
wxButton* m_plotButton;
wxButton* m_buttonSaveOpt;
wxButton* m_buttonDrill;
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;
wxButton* m_plotButton;
wxButton* m_buttonSaveOpt;
wxButton* m_buttonDrill;
wxButton* m_buttonQuit;
// 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 OnSetScaleOpt( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) { event.Skip(); }
virtual void Plot( wxCommandEvent& event ) { event.Skip(); } virtual void Plot( wxCommandEvent& event ) { event.Skip(); }
virtual void applyPlotSettings( 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(); }
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( 800,616 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_PLOT_BASE(); ~DIALOG_PLOT_BASE();
}; };
......
...@@ -145,37 +145,6 @@ void PCB_PLOT_PARAMS::Parse( PCB_PLOT_PARAMS_PARSER* aParser ) throw( IO_ERROR, ...@@ -145,37 +145,6 @@ void PCB_PLOT_PARAMS::Parse( PCB_PLOT_PARAMS_PARSER* aParser ) throw( IO_ERROR,
} }
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 bool PCB_PLOT_PARAMS::operator==( const PCB_PLOT_PARAMS &aPcbPlotParams ) const
{ {
if( layerSelection != aPcbPlotParams.layerSelection ) if( layerSelection != aPcbPlotParams.layerSelection )
...@@ -345,9 +314,6 @@ void PCB_PLOT_PARAMS_PARSER::Parse( PCB_PLOT_PARAMS* aPcbPlotParams ) throw( IO_ ...@@ -345,9 +314,6 @@ void PCB_PLOT_PARAMS_PARSER::Parse( PCB_PLOT_PARAMS* aPcbPlotParams ) throw( IO_
break; break;
case T_outputdirectory: case T_outputdirectory:
NeedSYMBOL(); NeedSYMBOL();
// token = NextTok();
// if( token != T_STRING )
// Expecting( T_STRING );
aPcbPlotParams->outputDirectory = CONV_FROM_UTF8( CurText() ); aPcbPlotParams->outputDirectory = CONV_FROM_UTF8( CurText() );
break; break;
default: default:
......
...@@ -99,7 +99,6 @@ public: ...@@ -99,7 +99,6 @@ public:
void Format( OUTPUTFORMATTER* aFormatter, int aNestLevel ) const throw( IO_ERROR ); void Format( OUTPUTFORMATTER* aFormatter, int aNestLevel ) const throw( IO_ERROR );
void Parse( PCB_PLOT_PARAMS_PARSER* aParser ) throw( IO_ERROR, PARSE_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;
bool operator!=( const PCB_PLOT_PARAMS &aPcbPlotParams ) const; bool operator!=( const PCB_PLOT_PARAMS &aPcbPlotParams ) const;
......
...@@ -118,14 +118,13 @@ void DIALOG_PLOT::Init_Dialog() ...@@ -118,14 +118,13 @@ void DIALOG_PLOT::Init_Dialog()
m_Config->Read( OPTKEY_YFINESCALE_ADJ, &m_YScaleAdjust ); m_Config->Read( OPTKEY_YFINESCALE_ADJ, &m_YScaleAdjust );
m_plotFormatOpt->SetSelection( g_PcbPlotOptions.m_PlotFormat ); m_plotFormatOpt->SetSelection( g_PcbPlotOptions.m_PlotFormat );
g_PcbPlotOptions.m_PlotLineWidth = g_DrawDefaultLineThickness;
// Set units and value for HPGL pen speed. // Set units and value for HPGL pen size.
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 );
m_HPGLPenSizeOpt->AppendText( msg ); m_HPGLPenSizeOpt->AppendText( msg );
// Set units to cm for standard HPGL pen speed. // Set units to cm/s for standard HPGL pen speed.
msg = ReturnStringFromValue( UNSCALED_UNITS, g_PcbPlotOptions.m_HPGLPenSpeed, 1 ); msg = ReturnStringFromValue( UNSCALED_UNITS, g_PcbPlotOptions.m_HPGLPenSpeed, 1 );
m_HPGLPenSpeedOpt->AppendText( msg ); m_HPGLPenSpeedOpt->AppendText( msg );
...@@ -136,15 +135,13 @@ void DIALOG_PLOT::Init_Dialog() ...@@ -136,15 +135,13 @@ void DIALOG_PLOT::Init_Dialog()
UNITS_MILS ); UNITS_MILS );
m_HPGLPenOverlayOpt->AppendText( msg ); m_HPGLPenOverlayOpt->AppendText( msg );
AddUnitSymbol( *m_textDefaultPenSize, g_UserUnit );
msg = ReturnStringFromValue( g_UserUnit, msg = ReturnStringFromValue( g_UserUnit,
g_PcbPlotOptions.m_PlotLineWidth, g_PcbPlotOptions.m_PlotLineWidth,
PCB_INTERNAL_UNIT ); PCB_INTERNAL_UNIT );
m_linesWidth->AppendText( msg ); m_linesWidth->AppendText( msg );
if( g_PcbPlotOptions.GetUseAuxOrigin() ) m_useAuxOriginCheckBox->SetValue( g_PcbPlotOptions.GetUseAuxOrigin() );
m_choicePlotOffset->SetSelection( 1 );
else
m_choicePlotOffset->SetSelection( 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
...@@ -159,7 +156,6 @@ void DIALOG_PLOT::Init_Dialog() ...@@ -159,7 +156,6 @@ void DIALOG_PLOT::Init_Dialog()
m_plotPSNegativeOpt->SetValue( g_PcbPlotOptions.m_PlotPSNegative ); m_plotPSNegativeOpt->SetValue( g_PcbPlotOptions.m_PlotPSNegative );
// Create layer list. // Create layer list.
int layer; int layer;
for( layer = 0; layer < NB_LAYERS; ++layer ) for( layer = 0; layer < NB_LAYERS; ++layer )
...@@ -175,7 +171,8 @@ void DIALOG_PLOT::Init_Dialog() ...@@ -175,7 +171,8 @@ void DIALOG_PLOT::Init_Dialog()
// List layers in same order than in setup layers dialog // List layers in same order than in setup layers dialog
// (Front or Top to Back or Bottom) // (Front or Top to Back or Bottom)
DECLARE_LAYERS_ORDER_LIST( layersOrder ); DECLARE_LAYERS_ORDER_LIST( layersOrder );
for( int layer_idx = 0; layer_idx < NB_LAYERS; ++layer_idx ) int layer_idx;
for( layer_idx = 0; layer_idx < NB_LAYERS; ++layer_idx )
{ {
layer = layersOrder[layer_idx]; layer = layersOrder[layer_idx];
...@@ -191,12 +188,10 @@ void DIALOG_PLOT::Init_Dialog() ...@@ -191,12 +188,10 @@ 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; if( g_PcbPlotOptions.GetLayerSelection() & ( 1 << layer ) )
if( g_PcbPlotOptions.GetLayerSelection() & mask )
m_BoxSelectLayer[layer]->SetValue( true ); m_BoxSelectLayer[layer]->SetValue( true );
} }
// Option for using proper Gerber extensions // Option for using proper Gerber extensions
m_useGerberExtensions->SetValue( g_PcbPlotOptions.GetUseGerberExtensions() ); m_useGerberExtensions->SetValue( g_PcbPlotOptions.GetUseGerberExtensions() );
...@@ -213,7 +208,7 @@ void DIALOG_PLOT::Init_Dialog() ...@@ -213,7 +208,7 @@ void DIALOG_PLOT::Init_Dialog()
else else
{ {
m_plotSheetRef->Enable( false ); m_plotSheetRef->Enable( false );
g_PcbPlotOptions.m_PlotFrameRef = false; m_plotSheetRef->SetValue( false );
} }
// Option to plot pads on silkscreen layers or all layers // Option to plot pads on silkscreen layers or all layers
...@@ -241,15 +236,7 @@ void DIALOG_PLOT::Init_Dialog() ...@@ -241,15 +236,7 @@ void DIALOG_PLOT::Init_Dialog()
m_plotNoViaOnMaskOpt->SetValue( g_PcbPlotOptions.m_PlotViaOnMaskLayer ); m_plotNoViaOnMaskOpt->SetValue( g_PcbPlotOptions.m_PlotViaOnMaskLayer );
// Output directory // Output directory
if( g_PcbPlotOptions.GetOutputDirectory().IsEmpty() )
{
fileName = m_Parent->GetScreen()->GetFileName();
m_outputDirectoryName->SetValue( fileName.GetPath() );
}
else
{
m_outputDirectoryName->SetValue( g_PcbPlotOptions.GetOutputDirectory() ); m_outputDirectoryName->SetValue( g_PcbPlotOptions.GetOutputDirectory() );
}
// Update options values: // Update options values:
wxCommandEvent cmd_event; wxCommandEvent cmd_event;
...@@ -293,13 +280,27 @@ void DIALOG_PLOT::OnSetScaleOpt( wxCommandEvent& event ) ...@@ -293,13 +280,27 @@ void DIALOG_PLOT::OnSetScaleOpt( wxCommandEvent& event )
void DIALOG_PLOT::OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) void DIALOG_PLOT::OnOutputDirectoryBrowseClicked( wxCommandEvent& event )
{ {
wxString currentDir; wxDirDialog dirDialog( this, _( "Select Output Directory" ),
m_outputDirectoryName->GetValue() );
currentDir = m_outputDirectoryName->GetValue();
wxDirDialog dirDialog( this, _( "Select Output Directory" ), currentDir );
if( dirDialog.ShowModal() == wxID_CANCEL ) if( dirDialog.ShowModal() == wxID_CANCEL )
return; return;
m_outputDirectoryName->SetValue( dirDialog.GetPath() );
wxFileName dirName = wxFileName::DirName( dirDialog.GetPath() );
wxMessageDialog dialog( this, wxT( "Use a relative path? "),
wxT( "Plot Output Directory" ),
wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT );
if( dialog.ShowModal() == wxID_YES ) {
wxString boardFilePath = ( (wxFileName) m_Parent->GetScreen()->GetFileName()).GetPath();
if( !dirName.MakeRelativeTo( boardFilePath ) )
wxMessageBox( wxT( "Cannot make path relative (target volume different from board file volume)!" ),
wxT( "Plot Output Directory" ), wxICON_ERROR );
}
m_outputDirectoryName->SetValue( dirName.GetFullPath() );
} }
...@@ -314,7 +315,7 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) ...@@ -314,7 +315,7 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
m_drillShapeOpt->Enable( true ); m_drillShapeOpt->Enable( true );
m_plotModeOpt->Enable( true ); m_plotModeOpt->Enable( true );
m_plotMirrorOpt->Enable( true ); m_plotMirrorOpt->Enable( true );
m_choicePlotOffset->Enable( false ); m_useAuxOriginCheckBox->Enable( false );
m_linesWidth->Enable( true ); m_linesWidth->Enable( true );
m_HPGLPenSizeOpt->Enable( false ); m_HPGLPenSizeOpt->Enable( false );
m_HPGLPenSpeedOpt->Enable( false ); m_HPGLPenSpeedOpt->Enable( false );
...@@ -335,7 +336,7 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) ...@@ -335,7 +336,7 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
m_plotModeOpt->Enable( false ); m_plotModeOpt->Enable( false );
m_plotMirrorOpt->SetValue( false ); m_plotMirrorOpt->SetValue( false );
m_plotMirrorOpt->Enable( false ); m_plotMirrorOpt->Enable( false );
m_choicePlotOffset->Enable( true ); m_useAuxOriginCheckBox->Enable( true );
m_linesWidth->Enable( true ); m_linesWidth->Enable( true );
m_HPGLPenSizeOpt->Enable( false ); m_HPGLPenSizeOpt->Enable( false );
m_HPGLPenSpeedOpt->Enable( false ); m_HPGLPenSpeedOpt->Enable( false );
...@@ -355,7 +356,7 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) ...@@ -355,7 +356,7 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
m_plotMirrorOpt->Enable( true ); m_plotMirrorOpt->Enable( true );
m_drillShapeOpt->Enable( false ); m_drillShapeOpt->Enable( false );
m_plotModeOpt->Enable( true ); m_plotModeOpt->Enable( true );
m_choicePlotOffset->Enable( false ); m_useAuxOriginCheckBox->Enable( false );
m_linesWidth->Enable( false ); m_linesWidth->Enable( false );
m_HPGLPenSizeOpt->Enable( true ); m_HPGLPenSizeOpt->Enable( true );
m_HPGLPenSpeedOpt->Enable( true ); m_HPGLPenSpeedOpt->Enable( true );
...@@ -376,7 +377,7 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) ...@@ -376,7 +377,7 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
m_plotMirrorOpt->SetValue( false ); m_plotMirrorOpt->SetValue( false );
m_drillShapeOpt->Enable( false ); m_drillShapeOpt->Enable( false );
m_plotModeOpt->Enable( true ); m_plotModeOpt->Enable( true );
m_choicePlotOffset->Enable( false ); m_useAuxOriginCheckBox->Enable( false );
m_linesWidth->Enable( false ); m_linesWidth->Enable( false );
m_HPGLPenSizeOpt->Enable( false ); m_HPGLPenSizeOpt->Enable( false );
m_HPGLPenSpeedOpt->Enable( false ); m_HPGLPenSpeedOpt->Enable( false );
...@@ -411,10 +412,7 @@ void DIALOG_PLOT::applyPlotSettings( wxCommandEvent& event ) ...@@ -411,10 +412,7 @@ void DIALOG_PLOT::applyPlotSettings( wxCommandEvent& event )
tempOptions.m_PlotPadsOnSilkLayer = m_plotPads_on_Silkscreen->GetValue(); tempOptions.m_PlotPadsOnSilkLayer = m_plotPads_on_Silkscreen->GetValue();
if( m_choicePlotOffset->GetSelection() == 0 ) tempOptions.SetUseAuxOrigin( m_useAuxOriginCheckBox->GetValue() );
tempOptions.SetUseAuxOrigin( false );
else
tempOptions.SetUseAuxOrigin( true );
tempOptions.m_PlotValue = m_plotModuleValueOpt->GetValue(); tempOptions.m_PlotValue = m_plotModuleValueOpt->GetValue();
tempOptions.m_PlotReference = m_plotModuleRefOpt->GetValue(); tempOptions.m_PlotReference = m_plotModuleRefOpt->GetValue();
...@@ -444,17 +442,16 @@ void DIALOG_PLOT::applyPlotSettings( wxCommandEvent& event ) ...@@ -444,17 +442,16 @@ void DIALOG_PLOT::applyPlotSettings( wxCommandEvent& event )
msg = m_linesWidth->GetValue(); msg = m_linesWidth->GetValue();
tmp = ReturnValueFromString( g_UserUnit, msg, PCB_INTERNAL_UNIT ); tmp = ReturnValueFromString( g_UserUnit, msg, PCB_INTERNAL_UNIT );
tempOptions.m_PlotLineWidth = tmp; tempOptions.m_PlotLineWidth = tmp;
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 );
tempOptions.SetUseGerberExtensions( 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 );
tempOptions.SetUseGerberExtensions( m_useGerberExtensions->GetValue() );
tempOptions.m_PlotFormat = m_plotFormatOpt->GetSelection(); tempOptions.m_PlotFormat = m_plotFormatOpt->GetSelection();
long selectedLayers = 0; long selectedLayers = 0;
...@@ -471,7 +468,11 @@ void DIALOG_PLOT::applyPlotSettings( wxCommandEvent& event ) ...@@ -471,7 +468,11 @@ void DIALOG_PLOT::applyPlotSettings( wxCommandEvent& event )
tempOptions.m_PlotPSNegative = m_plotPSNegativeOpt->GetValue(); tempOptions.m_PlotPSNegative = m_plotPSNegativeOpt->GetValue();
tempOptions.SetOutputDirectory( m_outputDirectoryName->GetValue() ); // Set output directory and replace backslashes with forward ones
wxString dirStr;
dirStr = m_outputDirectoryName->GetValue();
dirStr.Replace( wxT( "\\" ), wxT( "/" ) );
tempOptions.SetOutputDirectory( dirStr );
if( g_PcbPlotOptions != tempOptions ) if( g_PcbPlotOptions != tempOptions )
{ {
...@@ -492,17 +493,30 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event ) ...@@ -492,17 +493,30 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event )
applyPlotSettings( 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() ) ) wxFileName outputDir = wxFileName::DirName( m_outputDirectoryName->GetValue() );
wxString boardFilePath = ( (wxFileName) m_Parent->GetScreen()->GetFileName()).GetPath();
if( !outputDir.MakeAbsolute( boardFilePath ) )
{
wxString msg;
msg.Printf( wxT( " Cannot make %s absolute with respect to %s!" ),
GetChars( outputDir.GetPath() ),
GetChars( boardFilePath ) );
wxMessageBox( msg, wxT( "Plot" ), wxICON_ERROR );
return;
}
if( !wxFileName::DirExists( outputDir.GetPath() ) )
{ {
if( wxMkdir( m_outputDirectoryName->GetValue() ) ) if( wxMkdir( outputDir.GetPath() ) )
{ {
wxString msg; wxString msg;
msg.Printf( _( "Directory %s created.\n" ), GetChars( m_outputDirectoryName->GetValue() ) ); msg.Printf( wxT( "Directory %s created.\n" ), GetChars( outputDir.GetPath() ) );
m_messagesBox->AppendText( msg ); m_messagesBox->AppendText( msg );
} }
else else
{ {
wxMessageBox( _( "Cannot create output directory!" ), _( "Plot" ), wxICON_INFORMATION ); wxMessageBox( wxT( "Cannot create output directory!" ), wxT( "Plot" ), wxICON_ERROR );
return; return;
} }
} }
...@@ -581,7 +595,7 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event ) ...@@ -581,7 +595,7 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event )
if( m_BoxSelectLayer[layer]->GetValue() ) if( m_BoxSelectLayer[layer]->GetValue() )
{ {
fn = m_Parent->GetScreen()->GetFileName(); fn = m_Parent->GetScreen()->GetFileName();
fn.SetPath( m_outputDirectoryName->GetValue() ); fn.SetPath( outputDir.GetPath() );
// Create file name. // Create file name.
wxString layername = board->GetLayerName( layer ); wxString layername = board->GetLayerName( layer );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment