2008-03-04 04:22:27 +00:00
|
|
|
|
/***********************/
|
|
|
|
|
/* fichier pcbplot.cpp */
|
|
|
|
|
/***********************/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
|
|
#include "fctsys.h"
|
2009-02-04 15:25:03 +00:00
|
|
|
|
#include "appl_wxstruct.h"
|
2007-05-06 16:03:28 +00:00
|
|
|
|
#include "common.h"
|
|
|
|
|
#include "plot_common.h"
|
2009-02-04 15:25:03 +00:00
|
|
|
|
#include "confirm.h"
|
|
|
|
|
#include "gestfich.h"
|
2007-05-06 16:03:28 +00:00
|
|
|
|
#include "pcbnew.h"
|
|
|
|
|
#include "pcbplot.h"
|
|
|
|
|
#include "worksheet.h"
|
|
|
|
|
#include "id.h"
|
|
|
|
|
#include "protos.h"
|
|
|
|
|
|
2008-03-21 19:27:11 +00:00
|
|
|
|
#define PLOT_DEFAULT_MARGE 300 // mils
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
2008-01-23 08:01:38 +00:00
|
|
|
|
/* Keywords to r/w options in config */
|
2008-08-06 07:46:03 +00:00
|
|
|
|
#define OPTKEY_EDGELAYER_GERBER wxT( "EdgeLayerGerberOpt" )
|
|
|
|
|
#define OPTKEY_XFINESCALE_ADJ wxT( "PlotXFineScaleAdj" )
|
|
|
|
|
#define OPTKEY_YFINESCALE_ADJ wxT( "PlotYFineScaleAdj" )
|
|
|
|
|
#define OPTKEY_PADS_ON_SILKSCREEN wxT( "PlotPadsOnSilkscreen" )
|
|
|
|
|
#define OPTKEY_ALWAYS_PRINT_PADS wxT( "PlotAlwaysPads" )
|
|
|
|
|
#define OPTKEY_OUTPUT_FORMAT wxT( "PlotOutputFormat" )
|
2008-03-21 19:27:11 +00:00
|
|
|
|
|
2009-01-18 19:20:15 +00:00
|
|
|
|
// Define min et max reasonnable values for print scale
|
|
|
|
|
#define MIN_SCALE 0.01
|
|
|
|
|
#define MAX_SCALE 100.0
|
|
|
|
|
|
2008-01-23 08:01:38 +00:00
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
|
static long s_SelectedLayers = CUIVRE_LAYER | CMP_LAYER |
|
2008-03-04 04:22:27 +00:00
|
|
|
|
SILKSCREEN_LAYER_CMP | SILKSCREEN_LAYER_CU;
|
2008-03-21 19:27:11 +00:00
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
|
static bool s_PlotOriginIsAuxAxis = FALSE;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
|
|
|
2008-03-04 04:22:27 +00:00
|
|
|
|
enum id_plotps {
|
2008-03-21 19:27:11 +00:00
|
|
|
|
ID_DRILL_SHAPE_OPT = 8020,
|
2008-03-04 04:22:27 +00:00
|
|
|
|
ID_SCALE_OPT,
|
|
|
|
|
ID_ROTATE_OPT,
|
|
|
|
|
ID_MIROR_OPT,
|
|
|
|
|
ID_EXEC_PLOT,
|
|
|
|
|
ID_PLOT_MODE_OPT,
|
|
|
|
|
ID_MASKVIA_OPT,
|
|
|
|
|
ID_PLOT_CENTRE_OPT,
|
|
|
|
|
ID_SEL_PLOT_FORMAT,
|
|
|
|
|
ID_SEL_GERBER_FORMAT,
|
|
|
|
|
ID_SAVE_OPT_PLOT,
|
|
|
|
|
ID_EXCLUDE_EDGES_PCB,
|
|
|
|
|
ID_PRINT_REF,
|
|
|
|
|
ID_PRINT_VALUE,
|
|
|
|
|
ID_PRINT_MODULE_TEXTS,
|
|
|
|
|
ID_FORCE_PRINT_INVISIBLE_TEXT,
|
|
|
|
|
ID_PRINT_PAD_ON_SILKSCREEN,
|
|
|
|
|
ID_FORCE_PRINT_PAD,
|
|
|
|
|
ID_CREATE_DRILL_FILE,
|
|
|
|
|
ID_SEL_PLOT_OFFSET_OPTION
|
2007-05-06 16:03:28 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2008-03-04 04:22:27 +00:00
|
|
|
|
/*******************************/
|
|
|
|
|
/* Dialog box for plot control */
|
|
|
|
|
/*******************************/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
2008-03-04 04:22:27 +00:00
|
|
|
|
class WinEDA_PlotFrame : public wxDialog
|
2007-05-06 16:03:28 +00:00
|
|
|
|
{
|
|
|
|
|
public:
|
2008-03-04 04:22:27 +00:00
|
|
|
|
WinEDA_BasePcbFrame* m_Parent;
|
2008-03-21 19:27:11 +00:00
|
|
|
|
wxButton* m_PlotButton; // button with initial focus
|
|
|
|
|
wxCheckBox* m_BoxSelectLayer[32];
|
2008-03-04 04:22:27 +00:00
|
|
|
|
wxRadioBox* m_PlotFormatOpt;
|
|
|
|
|
wxRadioBox* m_Choice_Plot_Offset;
|
|
|
|
|
wxRadioBox* m_Drill_Shape_Opt;
|
|
|
|
|
wxRadioBox* m_Scale_Opt;
|
|
|
|
|
wxRadioBox* m_PlotModeOpt;
|
|
|
|
|
wxCheckBox* m_PlotMirorOpt;
|
|
|
|
|
wxCheckBox* m_PlotNoViaOnMaskOpt;
|
|
|
|
|
wxCheckBox* m_HPGL_PlotCenter_Opt;
|
|
|
|
|
wxCheckBox* m_Exclude_Edges_Pcb;
|
|
|
|
|
wxCheckBox* m_Plot_Sheet_Ref;
|
|
|
|
|
wxCheckBox* m_Plot_Invisible_Text;
|
|
|
|
|
wxCheckBox* m_Plot_Text_Value;
|
|
|
|
|
wxCheckBox* m_Plot_Text_Ref;
|
|
|
|
|
wxCheckBox* m_Plot_Text_Div;
|
|
|
|
|
wxCheckBox* m_Plot_Pads_on_Silkscreen;
|
|
|
|
|
wxCheckBox* m_Force_Plot_Pads;
|
|
|
|
|
wxCheckBox* m_Plot_PS_Negative;
|
|
|
|
|
WinEDA_ValueCtrl* m_LinesWidth;
|
|
|
|
|
WinEDA_ValueCtrl* m_HPGLPenSizeOpt;
|
|
|
|
|
WinEDA_ValueCtrl* m_HPGLPenSpeedOpt;
|
|
|
|
|
WinEDA_ValueCtrl* m_HPGLPenOverlayOpt;
|
2008-08-06 07:46:03 +00:00
|
|
|
|
wxStaticBox* m_HPGL_OptionsBox;
|
|
|
|
|
|
2008-03-04 04:22:27 +00:00
|
|
|
|
WinEDA_DFloatValueCtrl* m_FineAdjustXscaleOpt, * m_FineAdjustYscaleOpt;
|
|
|
|
|
double m_XScaleAdjust, m_YScaleAdjust;
|
2008-03-22 05:55:06 +00:00
|
|
|
|
|
|
|
|
|
bool useA4()
|
|
|
|
|
{
|
|
|
|
|
return m_PlotFormatOpt->GetSelection() == 3;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Function getFormat
|
|
|
|
|
* returns one of the values from the PlotFormat enum. If the 4th
|
|
|
|
|
* radio button is selected, map this back to postscript.
|
|
|
|
|
*/
|
|
|
|
|
PlotFormat getFormat()
|
|
|
|
|
{
|
|
|
|
|
int radioNdx = m_PlotFormatOpt->GetSelection();
|
|
|
|
|
|
|
|
|
|
// change the A4 to the simple postscript, according to the PlotFormat enum
|
|
|
|
|
if( radioNdx == 3 )
|
2008-08-06 07:46:03 +00:00
|
|
|
|
radioNdx = PLOT_FORMAT_POST;
|
2008-03-22 05:55:06 +00:00
|
|
|
|
|
|
|
|
|
return PlotFormat( radioNdx );
|
|
|
|
|
}
|
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
|
|
public:
|
2008-08-06 07:46:03 +00:00
|
|
|
|
WinEDA_PlotFrame( WinEDA_BasePcbFrame* parent );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
private:
|
2008-10-30 10:55:46 +00:00
|
|
|
|
void OnInitDialog( wxInitDialogEvent& event );
|
2008-08-06 07:46:03 +00:00
|
|
|
|
void Plot( wxCommandEvent& event );
|
|
|
|
|
void OnQuit( wxCommandEvent& event );
|
|
|
|
|
void OnClose( wxCloseEvent& event );
|
|
|
|
|
void SetCommands( wxCommandEvent& event );
|
|
|
|
|
void SaveOptPlot( wxCommandEvent& event );
|
|
|
|
|
void CreateDrillFile( wxCommandEvent& event );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
2007-05-06 16:03:28 +00:00
|
|
|
|
};
|
|
|
|
|
|
2008-03-04 04:22:27 +00:00
|
|
|
|
BEGIN_EVENT_TABLE( WinEDA_PlotFrame, wxDialog )
|
2008-10-30 10:55:46 +00:00
|
|
|
|
EVT_INIT_DIALOG( WinEDA_PlotFrame::OnInitDialog )
|
2008-08-06 07:46:03 +00:00
|
|
|
|
EVT_CLOSE( WinEDA_PlotFrame::OnClose )
|
|
|
|
|
EVT_BUTTON( wxID_CANCEL, WinEDA_PlotFrame::OnQuit )
|
|
|
|
|
EVT_BUTTON( ID_EXEC_PLOT, WinEDA_PlotFrame::Plot )
|
|
|
|
|
EVT_BUTTON( ID_SAVE_OPT_PLOT, WinEDA_PlotFrame::SaveOptPlot )
|
|
|
|
|
EVT_BUTTON( ID_CREATE_DRILL_FILE, WinEDA_PlotFrame::CreateDrillFile )
|
|
|
|
|
EVT_RADIOBOX( ID_SEL_PLOT_FORMAT, WinEDA_PlotFrame::SetCommands )
|
2007-05-06 16:03:28 +00:00
|
|
|
|
END_EVENT_TABLE()
|
|
|
|
|
|
|
|
|
|
|
2007-08-24 10:10:42 +00:00
|
|
|
|
const int UNITS_MILS = 1000;
|
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
|
|
/********************************************************************/
|
2008-03-04 04:22:27 +00:00
|
|
|
|
WinEDA_PlotFrame::WinEDA_PlotFrame( WinEDA_BasePcbFrame* parent ) :
|
|
|
|
|
wxDialog( parent, -1, _( "Plot" ),
|
|
|
|
|
wxPoint( -1, -1 ), wxDefaultSize,
|
|
|
|
|
wxDEFAULT_DIALOG_STYLE )
|
2007-05-06 16:03:28 +00:00
|
|
|
|
/********************************************************************/
|
|
|
|
|
{
|
2008-03-04 04:22:27 +00:00
|
|
|
|
m_Parent = parent;
|
2008-10-30 10:55:46 +00:00
|
|
|
|
Centre();
|
2008-03-04 04:22:27 +00:00
|
|
|
|
|
2008-10-30 10:55:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**************************************************************/
|
|
|
|
|
void WinEDA_PlotFrame::OnInitDialog( wxInitDialogEvent& event )
|
|
|
|
|
/**************************************************************/
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
wxButton* button;
|
|
|
|
|
|
2009-01-05 05:21:35 +00:00
|
|
|
|
BOARD* board = m_Parent->GetBoard();
|
2008-03-04 04:22:27 +00:00
|
|
|
|
|
2008-12-08 15:27:13 +00:00
|
|
|
|
wxConfig* config = wxGetApp().m_EDA_Config; // Current config used by application
|
2008-03-21 19:27:11 +00:00
|
|
|
|
|
|
|
|
|
|
2008-03-04 04:22:27 +00:00
|
|
|
|
SetFont( *g_DialogFont );
|
|
|
|
|
m_Plot_Sheet_Ref = NULL;
|
|
|
|
|
|
|
|
|
|
wxBoxSizer* MainBoxSizer = new wxBoxSizer( wxHORIZONTAL );
|
|
|
|
|
|
|
|
|
|
SetSizer( MainBoxSizer );
|
|
|
|
|
wxBoxSizer* RightBoxSizer = new wxBoxSizer( wxVERTICAL );
|
|
|
|
|
|
|
|
|
|
wxBoxSizer* MidRightBoxSizer = new wxBoxSizer( wxVERTICAL );
|
|
|
|
|
|
|
|
|
|
wxBoxSizer* MidLeftBoxSizer = new wxBoxSizer( wxVERTICAL );
|
|
|
|
|
|
|
|
|
|
wxBoxSizer* LeftBoxSizer = new wxBoxSizer( wxVERTICAL );
|
|
|
|
|
|
|
|
|
|
MainBoxSizer->Add( LeftBoxSizer, 0, wxGROW | wxALL, 5 );
|
|
|
|
|
MainBoxSizer->Add( MidLeftBoxSizer, 0, wxGROW | wxALL, 5 );
|
|
|
|
|
MainBoxSizer->Add( MidRightBoxSizer, 0, wxGROW | wxALL, 5 );
|
|
|
|
|
MainBoxSizer->Add( RightBoxSizer, 0, wxGROW | wxALL, 5 );
|
|
|
|
|
|
|
|
|
|
wxBoxSizer* LayersBoxSizer = new wxBoxSizer( wxHORIZONTAL );
|
|
|
|
|
|
|
|
|
|
LeftBoxSizer->Add( LayersBoxSizer, 0, wxGROW | wxALL, 5 );
|
|
|
|
|
|
|
|
|
|
static const wxString fmtmsg[4] = {
|
|
|
|
|
wxT( "HPGL" ), wxT( "Gerber" ), wxT( "Postscript" ), wxT( "Postscript A4" )
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
m_PlotFormatOpt = new wxRadioBox( this, ID_SEL_PLOT_FORMAT,
|
2008-08-06 07:46:03 +00:00
|
|
|
|
_( "Plot Format" ), wxDefaultPosition, wxSize( -1, -1 ),
|
|
|
|
|
4, fmtmsg, 1, wxRA_SPECIFY_COLS );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
MidRightBoxSizer->Add( m_PlotFormatOpt, 0, wxGROW | wxALL, 5 );
|
|
|
|
|
|
2008-03-22 05:55:06 +00:00
|
|
|
|
if( config )
|
2008-03-04 04:22:27 +00:00
|
|
|
|
{
|
2008-08-06 07:46:03 +00:00
|
|
|
|
config->Read( OPTKEY_OUTPUT_FORMAT, &g_PlotFormat );
|
2009-01-13 19:18:54 +00:00
|
|
|
|
config->Read( OPTKEY_PLOT_LINEWIDTH_VALUE, &g_PlotLine_Width);
|
2008-03-04 04:22:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-08-06 07:46:03 +00:00
|
|
|
|
m_PlotFormatOpt->SetSelection( g_PlotFormat );
|
2008-03-22 05:55:06 +00:00
|
|
|
|
|
|
|
|
|
|
2008-03-04 04:22:27 +00:00
|
|
|
|
// Creation des menus d'option du format HPGL
|
2008-08-06 07:46:03 +00:00
|
|
|
|
m_HPGL_OptionsBox = new wxStaticBox( this, wxID_ANY, _( "HPGL Options:" ) );
|
|
|
|
|
wxStaticBoxSizer* HPGL_OptionsBoxSizer = new wxStaticBoxSizer( m_HPGL_OptionsBox, wxVERTICAL );
|
|
|
|
|
MidRightBoxSizer->Add( HPGL_OptionsBoxSizer, 0, wxGROW | wxALL, 5 );
|
|
|
|
|
|
|
|
|
|
m_HPGLPenSizeOpt = new WinEDA_ValueCtrl( this, _( "Pen Size" ),
|
|
|
|
|
g_HPGL_Pen_Diam, g_UnitMetric, HPGL_OptionsBoxSizer,
|
|
|
|
|
UNITS_MILS );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
|
|
|
|
|
// unites standards = cm pour vitesse plume en HPGL
|
2008-08-06 07:46:03 +00:00
|
|
|
|
m_HPGLPenSpeedOpt = new WinEDA_ValueCtrl( this, _( "Pen Speed (cm/s)" ),
|
|
|
|
|
g_HPGL_Pen_Speed, CENTIMETRE, HPGL_OptionsBoxSizer,
|
|
|
|
|
1 );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
|
|
|
|
|
m_HPGLPenSpeedOpt->SetToolTip( _( "Set pen speed in cm/s" ) );
|
|
|
|
|
|
2008-03-21 19:27:11 +00:00
|
|
|
|
m_HPGLPenOverlayOpt = new WinEDA_ValueCtrl( this, _( "Pen ovr" ),
|
2008-08-06 07:46:03 +00:00
|
|
|
|
g_HPGL_Pen_Recouvrement, g_UnitMetric,
|
|
|
|
|
HPGL_OptionsBoxSizer, UNITS_MILS );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
|
|
|
|
|
m_HPGLPenOverlayOpt->SetToolTip( _( "Set plot overlay for filling" ) );
|
|
|
|
|
|
2008-08-06 07:46:03 +00:00
|
|
|
|
m_LinesWidth = new WinEDA_ValueCtrl( this, _( "Lines Width" ),
|
|
|
|
|
g_PlotLine_Width, g_UnitMetric, MidRightBoxSizer,
|
|
|
|
|
PCB_INTERNAL_UNIT );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
|
2008-08-06 07:46:03 +00:00
|
|
|
|
m_LinesWidth->SetToolTip( _( "Set lines width used to plot in sketch mode and plot pads outlines on silk screen layers" ) );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
|
|
|
|
|
// Create the right column commands
|
|
|
|
|
static const wxString choice_plot_offset_msg[] =
|
|
|
|
|
{ _( "Absolute" ), _( "Auxiliary axis" ) };
|
|
|
|
|
|
|
|
|
|
m_Choice_Plot_Offset = new wxRadioBox( this, ID_SEL_PLOT_OFFSET_OPTION,
|
2008-08-06 07:46:03 +00:00
|
|
|
|
_( "Plot Origin" ),
|
|
|
|
|
wxDefaultPosition, wxSize( -1, -1 ),
|
|
|
|
|
2, choice_plot_offset_msg, 1, wxRA_SPECIFY_COLS );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
|
|
|
|
|
if( s_PlotOriginIsAuxAxis )
|
|
|
|
|
m_Choice_Plot_Offset->SetSelection( 1 );
|
|
|
|
|
RightBoxSizer->Add( m_Choice_Plot_Offset, 0, wxGROW | wxALL, 5 );
|
|
|
|
|
/* Add a spacer for a better look */
|
|
|
|
|
RightBoxSizer->Add( 5, 5, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20 );
|
|
|
|
|
|
|
|
|
|
// Create scale adjust option
|
|
|
|
|
m_XScaleAdjust = m_YScaleAdjust = 1.0;
|
2008-03-21 19:27:11 +00:00
|
|
|
|
if( config )
|
2008-03-04 04:22:27 +00:00
|
|
|
|
{
|
2008-08-06 07:46:03 +00:00
|
|
|
|
config->Read( OPTKEY_EDGELAYER_GERBER, &g_Exclude_Edges_Pcb );
|
|
|
|
|
config->Read( OPTKEY_XFINESCALE_ADJ, &m_XScaleAdjust );
|
2009-01-07 07:58:45 +00:00
|
|
|
|
config->Read( OPTKEY_YFINESCALE_ADJ, &m_YScaleAdjust );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
2009-01-18 19:20:15 +00:00
|
|
|
|
// Test for a reasonnable scale value. Set to 1 if problem
|
|
|
|
|
if ( m_XScaleAdjust < MIN_SCALE || m_YScaleAdjust < MIN_SCALE || m_XScaleAdjust > MAX_SCALE || m_YScaleAdjust > MAX_SCALE )
|
|
|
|
|
m_XScaleAdjust = m_YScaleAdjust = 1.0;
|
|
|
|
|
|
2008-03-21 19:27:11 +00:00
|
|
|
|
m_FineAdjustXscaleOpt = new WinEDA_DFloatValueCtrl( this,
|
2008-08-06 07:46:03 +00:00
|
|
|
|
_( "X scale adjust" ), m_XScaleAdjust,
|
|
|
|
|
RightBoxSizer );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
m_FineAdjustXscaleOpt->SetToolTip( _( "Set X scale adjust for exact scale plotting" ) );
|
|
|
|
|
|
2008-03-21 19:27:11 +00:00
|
|
|
|
m_FineAdjustYscaleOpt = new WinEDA_DFloatValueCtrl( this,
|
2008-08-06 07:46:03 +00:00
|
|
|
|
_( "Y scale adjust" ), m_YScaleAdjust,
|
|
|
|
|
RightBoxSizer );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
m_FineAdjustYscaleOpt->SetToolTip( _( "Set Y scale adjust for exact scale plotting" ) );
|
|
|
|
|
|
2008-03-21 19:27:11 +00:00
|
|
|
|
m_Plot_PS_Negative = new wxCheckBox( this, -1, _( "Plot negative" ) );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
m_Plot_PS_Negative->SetValue( g_Plot_PS_Negative );
|
|
|
|
|
RightBoxSizer->Add( m_Plot_PS_Negative, 0, wxGROW | wxALL, 5 );
|
|
|
|
|
|
|
|
|
|
|
2008-03-21 19:27:11 +00:00
|
|
|
|
/* Create the command buttons */
|
|
|
|
|
m_PlotButton = new wxButton( this, ID_EXEC_PLOT, _( "Plot" ) );
|
|
|
|
|
m_PlotButton->SetForegroundColour( *wxRED );
|
|
|
|
|
RightBoxSizer->Add( m_PlotButton, 0, wxGROW | wxALL, 5 );
|
|
|
|
|
|
|
|
|
|
button = new wxButton( this, ID_SAVE_OPT_PLOT, _( "Save Options" ) );
|
|
|
|
|
button->SetForegroundColour( wxColour( 0, 80, 0 ) );
|
|
|
|
|
RightBoxSizer->Add( button, 0, wxGROW | wxALL, 5 );
|
|
|
|
|
|
2008-10-02 19:33:44 +00:00
|
|
|
|
button = new wxButton( this, ID_CREATE_DRILL_FILE, _( "Generate drill file" ) );
|
2008-03-21 19:27:11 +00:00
|
|
|
|
button->SetForegroundColour( wxColour( 0, 80, 80 ) );
|
|
|
|
|
RightBoxSizer->Add( button, 0, wxGROW | wxALL, 5 );
|
|
|
|
|
|
|
|
|
|
button = new wxButton( this, wxID_CANCEL, _( "Close" ) );
|
|
|
|
|
button->SetForegroundColour( *wxBLUE );
|
|
|
|
|
RightBoxSizer->Add( button, 0, wxGROW | wxALL, 5 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Creation de la liste des layers
|
|
|
|
|
wxBoxSizer* OneColumnLayerBoxSizer = new wxBoxSizer( wxVERTICAL );
|
|
|
|
|
LayersBoxSizer->Add( OneColumnLayerBoxSizer, 0, wxGROW | wxALL, 5 );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
|
2008-03-21 19:27:11 +00:00
|
|
|
|
int mask = 1;
|
2008-08-06 07:46:03 +00:00
|
|
|
|
for( int layer = 0; layer<NB_LAYERS; layer++, mask <<= 1 )
|
2008-03-04 04:22:27 +00:00
|
|
|
|
{
|
2008-03-21 19:27:11 +00:00
|
|
|
|
if( layer == 16 )
|
2008-03-04 04:22:27 +00:00
|
|
|
|
{
|
2008-03-21 19:27:11 +00:00
|
|
|
|
OneColumnLayerBoxSizer = new wxBoxSizer( wxVERTICAL );
|
|
|
|
|
LayersBoxSizer->Add( OneColumnLayerBoxSizer, 0, wxGROW | wxALL, 5 );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-08-06 07:46:03 +00:00
|
|
|
|
m_BoxSelectLayer[layer] = new wxCheckBox( this, -1, board->GetLayerName( layer ) );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
|
|
|
|
|
if( mask & s_SelectedLayers )
|
2008-03-21 19:27:11 +00:00
|
|
|
|
m_BoxSelectLayer[layer]->SetValue( true );
|
|
|
|
|
|
|
|
|
|
OneColumnLayerBoxSizer->Add( m_BoxSelectLayer[layer], 0, wxGROW | wxALL, 1 );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( config )
|
|
|
|
|
{
|
2008-08-06 07:46:03 +00:00
|
|
|
|
wxString layerKey;
|
2008-03-21 19:27:11 +00:00
|
|
|
|
|
2008-08-06 07:46:03 +00:00
|
|
|
|
for( int layer = 0; layer<NB_LAYERS; ++layer )
|
2008-03-21 19:27:11 +00:00
|
|
|
|
{
|
|
|
|
|
bool option;
|
|
|
|
|
|
|
|
|
|
layerKey.Printf( OPTKEY_LAYERBASE, layer );
|
|
|
|
|
|
|
|
|
|
if( config->Read( layerKey, &option ) )
|
|
|
|
|
m_BoxSelectLayer[layer]->SetValue( option );
|
|
|
|
|
}
|
2008-03-04 04:22:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Option for excluding contents of "Edges Pcb" layer
|
|
|
|
|
|
|
|
|
|
m_Exclude_Edges_Pcb = new wxCheckBox( this,
|
2008-08-06 07:46:03 +00:00
|
|
|
|
ID_EXCLUDE_EDGES_PCB, _( "Exclude Edges_Pcb layer" ) );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
|
|
|
|
|
m_Exclude_Edges_Pcb->SetValue( g_Exclude_Edges_Pcb );
|
|
|
|
|
m_Exclude_Edges_Pcb->SetToolTip(
|
2008-03-21 19:27:11 +00:00
|
|
|
|
_( "Exclude contents of Edges_Pcb layer from all other layers" ) );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
LeftBoxSizer->Add( m_Exclude_Edges_Pcb, 0, wxGROW | wxALL, 1 );
|
|
|
|
|
|
2008-04-18 13:28:56 +00:00
|
|
|
|
// Option to plot page references:
|
2008-03-04 04:22:27 +00:00
|
|
|
|
if( m_Parent->m_Print_Sheet_Ref )
|
|
|
|
|
{
|
2008-03-21 19:27:11 +00:00
|
|
|
|
m_Plot_Sheet_Ref = new wxCheckBox( this, ID_PRINT_REF, _( "Print sheet ref" ) );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
|
2009-01-13 19:18:54 +00:00
|
|
|
|
m_Plot_Sheet_Ref->SetValue( g_Plot_Frame_Ref );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
LeftBoxSizer->Add( m_Plot_Sheet_Ref, 0, wxGROW | wxALL, 1 );
|
|
|
|
|
}
|
|
|
|
|
else
|
2009-01-13 19:18:54 +00:00
|
|
|
|
g_Plot_Frame_Ref = false;
|
2008-03-04 04:22:27 +00:00
|
|
|
|
|
2009-01-07 07:58:45 +00:00
|
|
|
|
// Option to plot pads on silkscreen layers or all layers
|
2008-03-21 19:27:11 +00:00
|
|
|
|
m_Plot_Pads_on_Silkscreen = new wxCheckBox( this, ID_PRINT_PAD_ON_SILKSCREEN,
|
2008-08-06 07:46:03 +00:00
|
|
|
|
_( "Print pads on silkscreen" ) );
|
2008-03-21 19:27:11 +00:00
|
|
|
|
if( config )
|
|
|
|
|
config->Read( OPTKEY_PADS_ON_SILKSCREEN, &PlotPadsOnSilkLayer );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
m_Plot_Pads_on_Silkscreen->SetValue( PlotPadsOnSilkLayer );
|
|
|
|
|
m_Plot_Pads_on_Silkscreen->SetToolTip(
|
2008-03-21 19:27:11 +00:00
|
|
|
|
_( "Enable/disable print/plot pads on silkscreen layers" ) );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
LeftBoxSizer->Add( m_Plot_Pads_on_Silkscreen, 0, wxGROW | wxALL, 1 );
|
|
|
|
|
|
|
|
|
|
m_Force_Plot_Pads = new wxCheckBox( this, ID_FORCE_PRINT_PAD,
|
2008-08-06 07:46:03 +00:00
|
|
|
|
_( "Always print pads" ) );
|
2008-03-21 19:27:11 +00:00
|
|
|
|
if( config )
|
|
|
|
|
config->Read( OPTKEY_ALWAYS_PRINT_PADS, &Plot_Pads_All_Layers );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
m_Force_Plot_Pads->SetValue( Plot_Pads_All_Layers );
|
|
|
|
|
m_Force_Plot_Pads->SetToolTip( _( "Force print/plot pads on ALL layers" ) );
|
|
|
|
|
LeftBoxSizer->Add( m_Force_Plot_Pads, 0, wxGROW | wxALL, 1 );
|
|
|
|
|
|
2009-01-07 07:58:45 +00:00
|
|
|
|
// Options to plot texts on footprints
|
2008-03-21 19:27:11 +00:00
|
|
|
|
m_Plot_Text_Value = new wxCheckBox( this, ID_PRINT_VALUE, _( "Print module value" ) );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
|
|
|
|
|
m_Plot_Text_Value->SetValue( Sel_Texte_Valeur );
|
|
|
|
|
m_Plot_Text_Value->SetToolTip(
|
2008-03-21 19:27:11 +00:00
|
|
|
|
_( "Enable/disable print/plot module value on silkscreen layers" ) );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
LeftBoxSizer->Add( m_Plot_Text_Value, 0, wxGROW | wxALL, 1 );
|
|
|
|
|
|
2008-03-21 19:27:11 +00:00
|
|
|
|
m_Plot_Text_Ref = new wxCheckBox( this, ID_PRINT_REF, _( "Print module reference" ) );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
|
|
|
|
|
m_Plot_Text_Ref->SetValue( Sel_Texte_Reference );
|
|
|
|
|
m_Plot_Text_Ref->SetToolTip(
|
2008-03-21 19:27:11 +00:00
|
|
|
|
_( "Enable/disable print/plot module reference on silkscreen layers" ) );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
LeftBoxSizer->Add( m_Plot_Text_Ref, 0, wxGROW | wxALL, 1 );
|
|
|
|
|
|
|
|
|
|
m_Plot_Text_Div = new wxCheckBox( this, ID_PRINT_MODULE_TEXTS,
|
2008-08-06 07:46:03 +00:00
|
|
|
|
_( "Print other module texts" ) );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
|
|
|
|
|
m_Plot_Text_Div->SetValue( Sel_Texte_Divers );
|
|
|
|
|
m_Plot_Text_Div->SetToolTip(
|
2008-03-21 19:27:11 +00:00
|
|
|
|
_( "Enable/disable print/plot module field texts on silkscreen layers" ) );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
LeftBoxSizer->Add( m_Plot_Text_Div, 0, wxGROW | wxALL, 1 );
|
|
|
|
|
|
|
|
|
|
m_Plot_Invisible_Text = new wxCheckBox( this,
|
2008-08-06 07:46:03 +00:00
|
|
|
|
ID_FORCE_PRINT_INVISIBLE_TEXT, _(
|
|
|
|
|
"Force print invisible texts" ) );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
|
|
|
|
|
m_Plot_Invisible_Text->SetValue( Sel_Texte_Invisible );
|
|
|
|
|
m_Plot_Invisible_Text->SetToolTip(
|
2008-03-21 19:27:11 +00:00
|
|
|
|
_( "Force print/plot module invisible texts on silkscreen layers" ) );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
LeftBoxSizer->Add( m_Plot_Invisible_Text, 0, wxGROW | wxALL, 1 );
|
|
|
|
|
|
|
|
|
|
|
2008-03-21 19:27:11 +00:00
|
|
|
|
static const wxString drillmsg[3] = { _( "No drill mark" ), _( "Small mark" ), _( "Real drill" ) };
|
2008-03-04 04:22:27 +00:00
|
|
|
|
m_Drill_Shape_Opt = new wxRadioBox( this, ID_DRILL_SHAPE_OPT,
|
2008-08-06 07:46:03 +00:00
|
|
|
|
_( "Pads Drill Opt" ), wxDefaultPosition, wxSize( -1, -1 ),
|
|
|
|
|
3, drillmsg, 1, wxRA_SPECIFY_COLS );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
|
|
|
|
|
m_Drill_Shape_Opt->SetSelection( g_DrillShapeOpt );
|
|
|
|
|
MidLeftBoxSizer->Add( m_Drill_Shape_Opt, 0, wxGROW | wxALL, 5 );
|
|
|
|
|
|
|
|
|
|
static const wxString scalemsg[5] =
|
|
|
|
|
{ _( "Auto scale" ), _( "Scale 1" ), _( "Scale 1.5" ), _( "Scale 2" ), _( "Scale 3" ) };
|
|
|
|
|
|
|
|
|
|
m_Scale_Opt = new wxRadioBox( this, ID_SCALE_OPT,
|
2008-08-06 07:46:03 +00:00
|
|
|
|
_( "Scale Opt" ), wxDefaultPosition, wxSize( -1, -1 ),
|
|
|
|
|
5, scalemsg, 1, wxRA_SPECIFY_COLS );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
|
|
|
|
|
m_Scale_Opt->SetSelection( g_PlotScaleOpt );
|
|
|
|
|
MidLeftBoxSizer->Add( m_Scale_Opt, 0, wxGROW | wxALL, 5 );
|
|
|
|
|
|
|
|
|
|
static const wxString list_opt3[3] = { _( "Line" ), _( "Filled" ), _( "Sketch" ) };
|
2008-03-21 19:27:11 +00:00
|
|
|
|
|
2008-03-04 04:22:27 +00:00
|
|
|
|
m_PlotModeOpt = new wxRadioBox( this, ID_PLOT_MODE_OPT, _( "Plot Mode" ),
|
2008-08-06 07:46:03 +00:00
|
|
|
|
wxDefaultPosition, wxDefaultSize,
|
|
|
|
|
3, list_opt3, 1 );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
|
2009-01-13 19:18:54 +00:00
|
|
|
|
m_PlotModeOpt->SetSelection( g_Plot_Mode );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
MidLeftBoxSizer->Add( m_PlotModeOpt, 0, wxGROW | wxALL, 5 );
|
|
|
|
|
|
|
|
|
|
m_PlotMirorOpt = new wxCheckBox( this, ID_MIROR_OPT,
|
2008-08-06 07:46:03 +00:00
|
|
|
|
_( "Plot mirror" ) );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
|
|
|
|
|
m_PlotMirorOpt->SetValue( Plot_Set_MIROIR );
|
|
|
|
|
MidLeftBoxSizer->Add( m_PlotMirorOpt, 0, wxGROW | wxALL, 5 );
|
|
|
|
|
|
|
|
|
|
m_PlotNoViaOnMaskOpt = new wxCheckBox( this, ID_MASKVIA_OPT,
|
2008-08-06 07:46:03 +00:00
|
|
|
|
_( "Vias on mask" ) );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
|
|
|
|
|
m_PlotNoViaOnMaskOpt->SetValue( g_DrawViaOnMaskLayer );
|
|
|
|
|
m_PlotNoViaOnMaskOpt->SetToolTip(
|
|
|
|
|
_( "Print/plot vias on mask layers. They are in this case not protected" ) );
|
|
|
|
|
MidLeftBoxSizer->Add( m_PlotNoViaOnMaskOpt, 0, wxGROW | wxALL, 5 );
|
|
|
|
|
|
|
|
|
|
m_HPGL_PlotCenter_Opt = new wxCheckBox( this, ID_PLOT_CENTRE_OPT,
|
2008-08-06 07:46:03 +00:00
|
|
|
|
_( "Org = Centre" ) );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
|
|
|
|
|
m_HPGL_PlotCenter_Opt->SetValue( HPGL_Org_Centre );
|
|
|
|
|
m_HPGL_PlotCenter_Opt->SetToolTip( _( "Draw origin ( 0,0 ) in sheet center" ) );
|
|
|
|
|
MidLeftBoxSizer->Add( m_HPGL_PlotCenter_Opt, 0, wxGROW | wxALL, 5 );
|
|
|
|
|
|
2009-01-07 07:58:45 +00:00
|
|
|
|
// Update options values:
|
2008-10-30 10:55:46 +00:00
|
|
|
|
wxCommandEvent cmd_event;
|
|
|
|
|
SetCommands( cmd_event );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
|
|
|
|
|
GetSizer()->Fit( this );
|
|
|
|
|
GetSizer()->SetSizeHints( this );
|
2008-03-21 19:27:11 +00:00
|
|
|
|
|
|
|
|
|
// without this line, the ESC key does not work
|
2008-10-30 10:55:46 +00:00
|
|
|
|
SetFocus();
|
2007-05-06 16:03:28 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/***************************************************************/
|
2008-03-04 04:22:27 +00:00
|
|
|
|
void WinEDA_PlotFrame::OnQuit( wxCommandEvent& WXUNUSED (event) )
|
2007-05-06 16:03:28 +00:00
|
|
|
|
/***************************************************************/
|
2007-08-24 10:10:42 +00:00
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
|
/* Called by the close button
|
2007-08-24 10:10:42 +00:00
|
|
|
|
*/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
{
|
2008-03-04 04:22:27 +00:00
|
|
|
|
Close( true ); // true is to force the frame to close
|
2007-05-06 16:03:28 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-08-24 10:10:42 +00:00
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
|
/****************************************************/
|
2008-03-04 04:22:27 +00:00
|
|
|
|
void WinEDA_PlotFrame::OnClose( wxCloseEvent& event )
|
2007-05-06 16:03:28 +00:00
|
|
|
|
/****************************************************/
|
2007-08-24 10:10:42 +00:00
|
|
|
|
|
|
|
|
|
/* Called when WinEDA_PlotFrame is closed
|
|
|
|
|
*/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
{
|
2008-03-04 04:22:27 +00:00
|
|
|
|
EndModal( 0 );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*********************************************************/
|
2008-03-04 04:22:27 +00:00
|
|
|
|
void WinEDA_PlotFrame::CreateDrillFile( wxCommandEvent& event )
|
2007-05-06 16:03:28 +00:00
|
|
|
|
/*********************************************************/
|
2007-08-24 10:10:42 +00:00
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
|
/* Create the board drill file used with gerber documents
|
2007-08-24 10:10:42 +00:00
|
|
|
|
*/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
{
|
2008-03-04 04:22:27 +00:00
|
|
|
|
( (WinEDA_PcbFrame*) m_Parent )->InstallDrillFrame( event );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-08-24 10:10:42 +00:00
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
|
/*********************************************************/
|
2008-03-04 04:22:27 +00:00
|
|
|
|
void WinEDA_PlotFrame::SetCommands( wxCommandEvent& event )
|
2007-05-06 16:03:28 +00:00
|
|
|
|
/*********************************************************/
|
2007-08-24 10:10:42 +00:00
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
|
/* active ou d<>sactive les diff<66>rents menus d'option selon le standard choisi
|
2007-08-24 10:10:42 +00:00
|
|
|
|
*/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
{
|
2008-03-22 05:55:06 +00:00
|
|
|
|
int format = getFormat();
|
2008-03-04 04:22:27 +00:00
|
|
|
|
|
|
|
|
|
switch( format )
|
|
|
|
|
{
|
|
|
|
|
case PLOT_FORMAT_POST:
|
|
|
|
|
default:
|
|
|
|
|
m_Drill_Shape_Opt->Enable( true );
|
|
|
|
|
m_PlotModeOpt->Enable( true );
|
|
|
|
|
m_PlotMirorOpt->Enable( true );
|
|
|
|
|
m_Choice_Plot_Offset->Enable( false );
|
|
|
|
|
m_LinesWidth->Enable( true );
|
2008-08-06 07:46:03 +00:00
|
|
|
|
m_HPGL_OptionsBox->Enable( false );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
m_HPGLPenSizeOpt->Enable( false );
|
|
|
|
|
m_HPGLPenSpeedOpt->Enable( false );
|
|
|
|
|
m_HPGLPenOverlayOpt->Enable( false );
|
|
|
|
|
m_HPGL_PlotCenter_Opt->Enable( false );
|
|
|
|
|
m_Exclude_Edges_Pcb->Enable( false );
|
|
|
|
|
m_Plot_Sheet_Ref->Enable( true );
|
|
|
|
|
m_Scale_Opt->Enable( true );
|
|
|
|
|
m_FineAdjustXscaleOpt->Enable( true );
|
|
|
|
|
m_FineAdjustYscaleOpt->Enable( true );
|
|
|
|
|
m_Plot_PS_Negative->Enable( true );
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case PLOT_FORMAT_GERBER:
|
|
|
|
|
m_Drill_Shape_Opt->Enable( false );
|
|
|
|
|
m_PlotModeOpt->Enable( false );
|
|
|
|
|
m_PlotMirorOpt->Enable( false );
|
|
|
|
|
m_Choice_Plot_Offset->Enable( true );
|
|
|
|
|
m_LinesWidth->Enable( true );
|
2008-08-06 07:46:03 +00:00
|
|
|
|
m_HPGL_OptionsBox->Enable( false );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
m_HPGLPenSizeOpt->Enable( false );
|
|
|
|
|
m_HPGLPenSpeedOpt->Enable( false );
|
|
|
|
|
m_HPGLPenOverlayOpt->Enable( false );
|
|
|
|
|
m_HPGL_PlotCenter_Opt->Enable( false );
|
|
|
|
|
m_Exclude_Edges_Pcb->Enable( true );
|
|
|
|
|
m_Plot_Sheet_Ref->Enable( false );
|
|
|
|
|
m_Scale_Opt->Enable( false );
|
|
|
|
|
m_FineAdjustXscaleOpt->Enable( false );
|
|
|
|
|
m_FineAdjustYscaleOpt->Enable( false );
|
|
|
|
|
m_Plot_PS_Negative->Enable( false );
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case PLOT_FORMAT_HPGL:
|
|
|
|
|
m_PlotMirorOpt->Enable( true );
|
|
|
|
|
m_Drill_Shape_Opt->Enable( false );
|
|
|
|
|
m_PlotModeOpt->Enable( true );
|
|
|
|
|
m_Choice_Plot_Offset->Enable( false );
|
|
|
|
|
m_LinesWidth->Enable( false );
|
2008-08-06 07:46:03 +00:00
|
|
|
|
m_HPGL_OptionsBox->Enable( true );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
m_HPGLPenSizeOpt->Enable( true );
|
|
|
|
|
m_HPGLPenSpeedOpt->Enable( true );
|
|
|
|
|
m_HPGLPenOverlayOpt->Enable( true );
|
|
|
|
|
m_HPGL_PlotCenter_Opt->Enable( true );
|
|
|
|
|
m_Exclude_Edges_Pcb->Enable( false );
|
|
|
|
|
m_Plot_Sheet_Ref->Enable( true );
|
|
|
|
|
m_Scale_Opt->Enable( true );
|
|
|
|
|
m_FineAdjustXscaleOpt->Enable( false );
|
|
|
|
|
m_FineAdjustYscaleOpt->Enable( false );
|
|
|
|
|
m_Plot_PS_Negative->Enable( false );
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2008-08-06 07:46:03 +00:00
|
|
|
|
g_PlotFormat = format;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-08-24 10:10:42 +00:00
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
|
/*********************************************************/
|
2008-03-04 04:22:27 +00:00
|
|
|
|
void WinEDA_PlotFrame::SaveOptPlot( wxCommandEvent& event )
|
2007-05-06 16:03:28 +00:00
|
|
|
|
/*********************************************************/
|
|
|
|
|
{
|
2008-03-04 04:22:27 +00:00
|
|
|
|
g_Exclude_Edges_Pcb = m_Exclude_Edges_Pcb->GetValue();
|
|
|
|
|
|
|
|
|
|
if( m_Plot_Sheet_Ref )
|
2009-01-13 19:18:54 +00:00
|
|
|
|
g_Plot_Frame_Ref = m_Plot_Sheet_Ref->GetValue();
|
2008-03-04 04:22:27 +00:00
|
|
|
|
|
|
|
|
|
PlotPadsOnSilkLayer = m_Plot_Pads_on_Silkscreen->GetValue();
|
|
|
|
|
Plot_Pads_All_Layers = m_Force_Plot_Pads->GetValue();
|
|
|
|
|
|
|
|
|
|
s_PlotOriginIsAuxAxis = (m_Choice_Plot_Offset->GetSelection() == 0) ? FALSE : TRUE;
|
|
|
|
|
|
|
|
|
|
Sel_Texte_Valeur = m_Plot_Text_Value->GetValue();
|
|
|
|
|
Sel_Texte_Reference = m_Plot_Text_Ref->GetValue();
|
|
|
|
|
Sel_Texte_Divers = m_Plot_Text_Div->GetValue();
|
|
|
|
|
Sel_Texte_Invisible = m_Plot_Invisible_Text->GetValue();
|
|
|
|
|
|
|
|
|
|
g_PlotScaleOpt = m_Scale_Opt->GetSelection();
|
|
|
|
|
g_DrillShapeOpt = m_Drill_Shape_Opt->GetSelection();
|
|
|
|
|
Plot_Set_MIROIR = m_PlotMirorOpt->GetValue();
|
|
|
|
|
if( Plot_Set_MIROIR )
|
|
|
|
|
g_PlotOrient = PLOT_MIROIR;
|
|
|
|
|
else
|
|
|
|
|
g_PlotOrient = 0;
|
2009-01-13 19:18:54 +00:00
|
|
|
|
g_Plot_Mode = m_PlotModeOpt->GetSelection();
|
2008-03-04 04:22:27 +00:00
|
|
|
|
g_DrawViaOnMaskLayer = m_PlotNoViaOnMaskOpt->GetValue();
|
2008-08-06 07:46:03 +00:00
|
|
|
|
|
2008-03-04 04:22:27 +00:00
|
|
|
|
g_HPGL_Pen_Diam = m_HPGLPenSizeOpt->GetValue();
|
|
|
|
|
g_HPGL_Pen_Speed = m_HPGLPenSpeedOpt->GetValue();
|
|
|
|
|
g_HPGL_Pen_Recouvrement = m_HPGLPenOverlayOpt->GetValue();
|
|
|
|
|
HPGL_Org_Centre = m_HPGL_PlotCenter_Opt->GetValue();
|
|
|
|
|
g_PlotLine_Width = m_LinesWidth->GetValue();
|
|
|
|
|
|
|
|
|
|
m_XScaleAdjust = m_FineAdjustXscaleOpt->GetValue();
|
|
|
|
|
m_YScaleAdjust = m_FineAdjustYscaleOpt->GetValue();
|
|
|
|
|
|
2008-12-08 15:27:13 +00:00
|
|
|
|
wxConfig* config = wxGetApp().m_EDA_Config;
|
|
|
|
|
|
2008-08-06 07:46:03 +00:00
|
|
|
|
if( config )
|
2008-03-04 04:22:27 +00:00
|
|
|
|
{
|
2008-03-21 19:27:11 +00:00
|
|
|
|
config->Write( OPTKEY_EDGELAYER_GERBER, g_Exclude_Edges_Pcb );
|
|
|
|
|
config->Write( OPTKEY_XFINESCALE_ADJ, m_XScaleAdjust );
|
|
|
|
|
config->Write( OPTKEY_YFINESCALE_ADJ, m_YScaleAdjust );
|
|
|
|
|
config->Write( OPTKEY_PADS_ON_SILKSCREEN, PlotPadsOnSilkLayer );
|
|
|
|
|
config->Write( OPTKEY_ALWAYS_PRINT_PADS, Plot_Pads_All_Layers );
|
|
|
|
|
|
2008-08-06 07:46:03 +00:00
|
|
|
|
int formatNdx = m_PlotFormatOpt->GetSelection();
|
2008-03-22 05:55:06 +00:00
|
|
|
|
config->Write( OPTKEY_OUTPUT_FORMAT, formatNdx );
|
2008-03-21 19:27:11 +00:00
|
|
|
|
|
2009-01-13 19:18:54 +00:00
|
|
|
|
config->Write( OPTKEY_PLOT_LINEWIDTH_VALUE, g_PlotLine_Width );
|
2008-08-06 07:46:03 +00:00
|
|
|
|
|
2008-03-21 19:27:11 +00:00
|
|
|
|
wxString layerKey;
|
2008-08-06 07:46:03 +00:00
|
|
|
|
for( int layer = 0; layer<NB_LAYERS; ++layer )
|
2008-03-21 19:27:11 +00:00
|
|
|
|
{
|
|
|
|
|
layerKey.Printf( OPTKEY_LAYERBASE, layer );
|
|
|
|
|
config->Write( layerKey, m_BoxSelectLayer[layer]->IsChecked() );
|
|
|
|
|
}
|
2008-03-04 04:22:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
g_Plot_PS_Negative = m_Plot_PS_Negative->GetValue();
|
2007-05-06 16:03:28 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-08-24 10:10:42 +00:00
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
|
/***************************************************/
|
2008-03-04 04:22:27 +00:00
|
|
|
|
void WinEDA_PlotFrame::Plot( wxCommandEvent& event )
|
2007-05-06 16:03:28 +00:00
|
|
|
|
/***************************************************/
|
|
|
|
|
{
|
2009-04-05 20:49:15 +00:00
|
|
|
|
int layer_to_plot;
|
|
|
|
|
wxFileName fn;
|
|
|
|
|
wxString ext;
|
|
|
|
|
wxString wildcard;
|
2008-03-04 04:22:27 +00:00
|
|
|
|
|
2009-04-05 20:49:15 +00:00
|
|
|
|
BOARD* board = m_Parent->GetBoard();
|
2008-03-04 04:22:27 +00:00
|
|
|
|
|
|
|
|
|
SaveOptPlot( event );
|
|
|
|
|
|
|
|
|
|
switch( g_PlotScaleOpt )
|
|
|
|
|
{
|
|
|
|
|
default:
|
|
|
|
|
Scale_X = Scale_Y = 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
|
Scale_X = Scale_Y = 1.5;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 3:
|
|
|
|
|
Scale_X = Scale_Y = 2;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 4:
|
|
|
|
|
Scale_X = Scale_Y = 3;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Scale_X *= m_XScaleAdjust;
|
|
|
|
|
Scale_Y *= m_YScaleAdjust;
|
|
|
|
|
|
2009-01-07 07:58:45 +00:00
|
|
|
|
int format = getFormat();
|
|
|
|
|
|
2008-03-22 05:55:06 +00:00
|
|
|
|
switch( format )
|
2008-03-04 04:22:27 +00:00
|
|
|
|
{
|
|
|
|
|
case PLOT_FORMAT_POST:
|
2009-04-05 20:49:15 +00:00
|
|
|
|
ext = wxT( "ps" );
|
|
|
|
|
wildcard = _( "Adobe post script files (.ps)|*.ps" );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
break;
|
|
|
|
|
|
2008-03-22 05:55:06 +00:00
|
|
|
|
default:
|
2008-03-04 04:22:27 +00:00
|
|
|
|
case PLOT_FORMAT_GERBER:
|
2009-01-07 07:58:45 +00:00
|
|
|
|
Scale_X = Scale_Y = 1.0; // No scale option allowed in gerber format
|
2009-04-05 20:49:15 +00:00
|
|
|
|
ext = wxT( "pho" );
|
|
|
|
|
wildcard = _( "GERBER photo plot files (.pho)|*.pho" );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case PLOT_FORMAT_HPGL:
|
2009-04-05 20:49:15 +00:00
|
|
|
|
ext = wxT( "plt" );
|
|
|
|
|
wildcard = _( "HPGL plat files (.plt)|*.plt" );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2009-01-07 07:58:45 +00:00
|
|
|
|
// Test for a reasonnable scale value
|
2009-01-18 19:20:15 +00:00
|
|
|
|
if ( Scale_X < MIN_SCALE || Scale_Y < MIN_SCALE )
|
2009-01-07 07:58:45 +00:00
|
|
|
|
DisplayInfo(this, _("Warning: Scale option set to a very small value") );
|
2009-01-18 19:20:15 +00:00
|
|
|
|
if ( Scale_X > MAX_SCALE || Scale_Y > MAX_SCALE )
|
|
|
|
|
DisplayInfo(this, _("Warning: Scale option set to a very large value") );
|
2009-01-07 07:58:45 +00:00
|
|
|
|
|
2008-03-04 04:22:27 +00:00
|
|
|
|
int mask = 1;
|
|
|
|
|
s_SelectedLayers = 0;
|
|
|
|
|
|
|
|
|
|
for( layer_to_plot = 0; layer_to_plot < NB_LAYERS; layer_to_plot++, mask <<= 1 )
|
|
|
|
|
{
|
2008-03-21 19:27:11 +00:00
|
|
|
|
if( m_BoxSelectLayer[layer_to_plot]->GetValue() )
|
2008-03-04 04:22:27 +00:00
|
|
|
|
{
|
|
|
|
|
s_SelectedLayers |= mask;
|
|
|
|
|
|
2009-04-05 20:49:15 +00:00
|
|
|
|
fn = m_Parent->GetScreen()->m_FileName;
|
|
|
|
|
|
2008-03-04 04:22:27 +00:00
|
|
|
|
// Calcul du nom du fichier
|
2009-04-05 20:49:15 +00:00
|
|
|
|
fn.SetName( fn.GetName() + wxT( "-" ) +
|
|
|
|
|
board->GetLayerName( layer_to_plot ) );
|
|
|
|
|
fn.SetExt( ext );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
|
2008-03-22 05:55:06 +00:00
|
|
|
|
switch( format )
|
2008-03-04 04:22:27 +00:00
|
|
|
|
{
|
|
|
|
|
case PLOT_FORMAT_POST:
|
2009-04-05 20:49:15 +00:00
|
|
|
|
m_Parent->Genere_PS( fn.GetFullPath(), layer_to_plot, useA4() );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
break;
|
|
|
|
|
|
2008-03-22 05:55:06 +00:00
|
|
|
|
default:
|
2008-03-04 04:22:27 +00:00
|
|
|
|
case PLOT_FORMAT_GERBER:
|
2009-04-05 20:49:15 +00:00
|
|
|
|
m_Parent->Genere_GERBER( fn.GetFullPath(), layer_to_plot,
|
|
|
|
|
s_PlotOriginIsAuxAxis );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case PLOT_FORMAT_HPGL:
|
2009-04-05 20:49:15 +00:00
|
|
|
|
m_Parent->Genere_HPGL( fn.GetFullPath(), layer_to_plot );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2009-03-10 08:26:52 +00:00
|
|
|
|
// If no layer selected, we have no plot. prompt user if it happens
|
|
|
|
|
// because he could think there is a bug in pcbnew:
|
|
|
|
|
if ( s_SelectedLayers == 0 )
|
|
|
|
|
DisplayError( this, _("No layer selected") );
|
|
|
|
|
|
2008-03-21 19:27:11 +00:00
|
|
|
|
// Close(true);
|
2007-05-06 16:03:28 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**************************************************************/
|
2008-03-04 04:22:27 +00:00
|
|
|
|
void WinEDA_BasePcbFrame::ToPlotter( wxCommandEvent& event )
|
2007-05-06 16:03:28 +00:00
|
|
|
|
/***************************************************************/
|
|
|
|
|
{
|
2008-03-04 04:22:27 +00:00
|
|
|
|
WinEDA_PlotFrame* frame = new WinEDA_PlotFrame( this );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
2008-03-21 19:27:11 +00:00
|
|
|
|
frame->ShowModal();
|
|
|
|
|
frame->Destroy();
|
2008-03-04 04:22:27 +00:00
|
|
|
|
}
|