16DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID
id,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
long style ) :
DIALOG_SHIM( parent, id, title, pos, size, style )
18 this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize );
22 wxBoxSizer* bupperSizer;
23 bupperSizer =
new wxBoxSizer( wxHORIZONTAL );
25 m_staticTextPlotFmt =
new wxStaticText(
this, wxID_ANY,
_(
"Plot format:"), wxDefaultPosition, wxDefaultSize, 0 );
29 wxString m_plotFormatOptChoices[] = {
_(
"Gerber"),
_(
"Postscript"),
_(
"SVG"),
_(
"DXF"),
_(
"PDF") };
30 int m_plotFormatOptNChoices =
sizeof( m_plotFormatOptChoices ) /
sizeof( wxString );
31 m_plotFormatOpt =
new wxChoice(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_plotFormatOptNChoices, m_plotFormatOptChoices, 0 );
33 bupperSizer->Add(
m_plotFormatOpt, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 28 );
35 m_staticTextDir =
new wxStaticText(
this, wxID_ANY,
_(
"Output directory:"), wxDefaultPosition, wxDefaultSize, 0 );
37 bupperSizer->Add(
m_staticTextDir, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
39 m_outputDirectoryName =
new wxTextCtrl(
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
40 m_outputDirectoryName->SetToolTip(
_(
"Target directory for plot files. Can be absolute or relative to the board file location.") );
50 bupperSizer->Add(
m_openDirButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
53 bupperSizer->Add( 0, 0, 0, wxEXPAND|wxRIGHT, 5 );
56 m_MainSizer->Add( bupperSizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
60 m_LayersSizer =
new wxStaticBoxSizer(
new wxStaticBox(
this, wxID_ANY,
_(
"Include Layers") ), wxHORIZONTAL );
62 wxArrayString m_layerCheckListBoxChoices;
73 wxStaticBoxSizer* sbOptionsSizer;
74 sbOptionsSizer =
new wxStaticBoxSizer(
new wxStaticBox(
this, wxID_ANY,
_(
"General Options") ), wxVERTICAL );
76 wxGridBagSizer* gbSizer1;
77 gbSizer1 =
new wxGridBagSizer( 3, 0 );
78 gbSizer1->SetFlexibleDirection( wxHORIZONTAL );
79 gbSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
81 m_plotSheetRef =
new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY,
_(
"Plot drawing sheet"), wxDefaultPosition, wxDefaultSize, 0 );
84 gbSizer1->Add(
m_plotSheetRef, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
86 m_subtractMaskFromSilk =
new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY,
_(
"Subtract soldermask from silkscreen"), wxDefaultPosition, wxDefaultSize, 0 );
89 gbSizer1->Add(
m_subtractMaskFromSilk, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
91 m_plotDNP =
new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY,
_(
"Indicate DNP on fabrication layers"), wxDefaultPosition, wxDefaultSize, 0 );
92 m_plotDNP->SetToolTip(
_(
"Hide or cross-out DNP footprints on fabrication layers") );
94 gbSizer1->Add(
m_plotDNP, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
96 m_hideDNP =
new wxRadioButton( sbOptionsSizer->GetStaticBox(), wxID_ANY,
_(
"Hide"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
97 m_hideDNP->SetToolTip(
_(
"Hide the footprint text and graphics") );
99 gbSizer1->Add(
m_hideDNP, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxLEFT, 25 );
101 m_crossoutDNP =
new wxRadioButton( sbOptionsSizer->GetStaticBox(), wxID_ANY,
_(
"Cross-out"), wxDefaultPosition, wxDefaultSize, 0 );
102 gbSizer1->Add(
m_crossoutDNP, wxGBPosition( 4, 0 ), wxGBSpan( 1, 1 ), wxLEFT, 25 );
109 m_plotPadNumbers =
new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY,
_(
"Include pad numbers"), wxDefaultPosition, wxDefaultSize, 0 );
110 gbSizer1->Add(
m_plotPadNumbers, wxGBPosition( 6, 0 ), wxGBSpan( 1, 1 ), wxLEFT, 25 );
112 m_zoneFillCheck =
new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY,
_(
"Check zone fills before plotting"), wxDefaultPosition, wxDefaultSize, 0 );
114 gbSizer1->Add(
m_zoneFillCheck, wxGBPosition( 6, 1 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 30 );
116 drillMarksLabel =
new wxStaticText( sbOptionsSizer->GetStaticBox(), wxID_ANY,
_(
"Drill marks:"), wxDefaultPosition, wxDefaultSize, 0 );
118 gbSizer1->Add(
drillMarksLabel, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 30 );
120 wxString m_drillShapeOptChoices[] = {
_(
"None"),
_(
"Small"),
_(
"Actual size") };
121 int m_drillShapeOptNChoices =
sizeof( m_drillShapeOptChoices ) /
sizeof( wxString );
122 m_drillShapeOpt =
new wxChoice( sbOptionsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_drillShapeOptNChoices, m_drillShapeOptChoices, 0 );
124 gbSizer1->Add(
m_drillShapeOpt, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxEXPAND|wxLEFT, 5 );
126 scalingLabel =
new wxStaticText( sbOptionsSizer->GetStaticBox(), wxID_ANY,
_(
"Scaling:"), wxDefaultPosition, wxDefaultSize, 0 );
128 gbSizer1->Add(
scalingLabel, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 30 );
130 wxString m_scaleOptChoices[] = {
_(
"Auto"),
_(
"1:1"),
_(
"3:2"),
_(
"2:1"),
_(
"3:1") };
131 int m_scaleOptNChoices =
sizeof( m_scaleOptChoices ) /
sizeof( wxString );
132 m_scaleOpt =
new wxChoice( sbOptionsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_scaleOptNChoices, m_scaleOptChoices, 0 );
134 gbSizer1->Add(
m_scaleOpt, wxGBPosition( 1, 2 ), wxGBSpan( 1, 1 ), wxEXPAND|wxLEFT, 5 );
136 m_useAuxOriginCheckBox =
new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY,
_(
"Use drill/place file origin"), wxDefaultPosition, wxDefaultSize, 0 );
137 m_useAuxOriginCheckBox->SetToolTip(
_(
"Use the drill/place file origin as the coordinate origin for plotted files") );
139 gbSizer1->Add(
m_useAuxOriginCheckBox, wxGBPosition( 2, 1 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 30 );
141 m_plotMirrorOpt =
new wxCheckBox( sbOptionsSizer->GetStaticBox(),
ID_MIROR_OPT,
_(
"Mirrored plot"), wxDefaultPosition, wxDefaultSize, 0 );
142 gbSizer1->Add(
m_plotMirrorOpt, wxGBPosition( 3, 1 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 30 );
144 m_plotPSNegativeOpt =
new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY,
_(
"Negative plot"), wxDefaultPosition, wxDefaultSize, 0 );
145 gbSizer1->Add(
m_plotPSNegativeOpt, wxGBPosition( 4, 1 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 30 );
148 sbOptionsSizer->Add( gbSizer1, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
155 m_bitmapAlert =
new wxStaticBitmap(
this, wxID_ANY, wxArtProvider::GetBitmap(
wxASCII_STR(wxART_WARNING),
wxASCII_STR(wxART_CMN_DIALOG) ), wxDefaultPosition, wxDefaultSize, 0 );
158 wxBoxSizer* bSizerWarningText;
159 bSizerWarningText =
new wxBoxSizer( wxVERTICAL );
161 m_staticTextAlert =
new wxStaticText(
this, wxID_ANY,
_(
"Global solder mask minimum width and/or margin are not set to 0. "), wxDefaultPosition, wxDefaultSize, 0 );
165 m_staticTextAlert1 =
new wxStaticText(
this, wxID_ANY,
_(
"Most board manufacturers expect 0 and use their own constraints for solder mask minimum width."), wxDefaultPosition, wxDefaultSize, 0 );
169 wxBoxSizer* bSizerSecondLine;
170 bSizerSecondLine =
new wxBoxSizer( wxHORIZONTAL );
173 bSizerSecondLine->Add( 0, 0, 1, wxEXPAND, 5 );
175 m_boardSetup =
new wxHyperlinkCtrl(
this, wxID_ANY,
_(
"Board setup"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
178 bSizerSecondLine->Add(
m_boardSetup, 0, wxLEFT|wxRIGHT|wxTOP, 2 );
181 bSizerWarningText->Add( bSizerSecondLine, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
189 m_GerberOptionsSizer =
new wxStaticBoxSizer(
new wxStaticBox(
this, wxID_ANY,
_(
"Gerber Options") ), wxHORIZONTAL );
191 wxGridBagSizer* gbSizer2;
192 gbSizer2 =
new wxGridBagSizer( 3, 0 );
193 gbSizer2->SetFlexibleDirection( wxHORIZONTAL );
194 gbSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
197 m_useGerberExtensions->SetToolTip(
_(
"Use Protel Gerber extensions (.GBL, .GTL, etc...)\nNo longer recommended. The official extension is .gbr") );
200 gbSizer2->Add(
m_useGerberExtensions, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
204 m_generateGerberJobFile->SetToolTip(
_(
"Generate a Gerber job file that contains info about the board,\nand the list of generated Gerber plot files") );
210 gbSizer2->Add(
coordFormatLabel, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 30 );
212 wxString m_coordFormatCtrlChoices[] = {
_(
"4.5, unit mm"),
_(
"4.6, unit mm") };
213 int m_coordFormatCtrlNChoices =
sizeof( m_coordFormatCtrlChoices ) /
sizeof( wxString );
216 gbSizer2->Add(
m_coordFormatCtrl, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxEXPAND|wxRIGHT|wxLEFT, 5 );
219 m_useGerberX2Format->SetToolTip(
_(
"Use X2 Gerber file format.\nInclude mainly X2 attributes in Gerber headers.\nIf not checked, use X1 format.\nIn X1 format, these attributes are included as comments in files.") );
221 gbSizer2->Add(
m_useGerberX2Format, wxGBPosition( 1, 1 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 30 );
224 m_useGerberNetAttributes->SetToolTip(
_(
"Include netlist metadata and aperture attributes in Gerber files.\nThey are comments in the X1 format.\nUsed to check connectivity in CAM tools and Gerber viewers.") );
226 gbSizer2->Add(
m_useGerberNetAttributes, wxGBPosition( 2, 1 ), wxGBSpan( 1, 2 ), wxLEFT|wxALIGN_CENTER_VERTICAL, 30 );
229 m_disableApertMacros->SetToolTip(
_(
"Disable aperture macros in Gerber files\nUse *only* for broken Gerber viewers.") );
231 gbSizer2->Add(
m_disableApertMacros, wxGBPosition( 3, 1 ), wxGBSpan( 1, 2 ), wxLEFT|wxALIGN_CENTER_VERTICAL, 30 );
234 gbSizer2->AddGrowableCol( 2 );
241 m_PSOptionsSizer =
new wxStaticBoxSizer(
new wxStaticBox(
this, wxID_ANY,
_(
"Postscript Options") ), wxVERTICAL );
243 wxFlexGridSizer* fgSizer2;
244 fgSizer2 =
new wxFlexGridSizer( 0, 6, 5, 0 );
245 fgSizer2->AddGrowableCol( 1 );
246 fgSizer2->AddGrowableCol( 4 );
247 fgSizer2->SetFlexibleDirection( wxBOTH );
248 fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
250 fgSizer2->SetMinSize( wxSize( 60,-1 ) );
256 m_fineAdjustXCtrl->SetToolTip(
_(
"Set global X scale adjust for exact scale PostScript output.") );
258 fgSizer2->Add(
m_fineAdjustXCtrl, 0, wxEXPAND|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 );
261 fgSizer2->Add( 0, 0, 1, wxEXPAND, 5 );
268 m_fineAdjustYCtrl->SetToolTip(
_(
"Set global Y scale adjust for exact scale PostScript output.") );
273 fgSizer2->Add( 0, 0, 1, wxEXPAND|wxRIGHT|wxLEFT, 10 );
280 m_widthAdjustCtrl->SetToolTip(
_(
"Set global width correction for exact width PostScript output.\nThese width correction is intended to compensate tracks width and also pads and vias size errors.\nThe reasonable width correction value must be in a range of [-(MinTrackWidth-1), +(MinClearanceValue-1)].") );
282 fgSizer2->Add(
m_widthAdjustCtrl, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
297 m_SizerDXF_options =
new wxStaticBoxSizer(
new wxStaticBox(
this, wxID_ANY,
_(
"DXF Options") ), wxHORIZONTAL );
299 wxGridBagSizer* gbSizer5;
300 gbSizer5 =
new wxGridBagSizer( 5, 5 );
301 gbSizer5->SetFlexibleDirection( wxBOTH );
302 gbSizer5->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
306 m_DXF_plotModeOpt->SetToolTip(
_(
"Uncheck to plot graphic items using their center lines") );
308 gbSizer5->Add(
m_DXF_plotModeOpt, wxGBPosition( 0, 0 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
312 gbSizer5->Add(
DXF_exportUnitsLabel, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 40 );
314 wxString m_DXF_plotUnitsChoices[] = {
_(
"Inches"),
_(
"Millimeters") };
315 int m_DXF_plotUnitsNChoices =
sizeof( m_DXF_plotUnitsChoices ) /
sizeof( wxString );
316 m_DXF_plotUnits =
new wxChoice(
m_SizerDXF_options->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_DXF_plotUnitsNChoices, m_DXF_plotUnitsChoices, 0 );
318 m_DXF_plotUnits->SetToolTip(
_(
"The units to use for the exported DXF file") );
320 gbSizer5->Add(
m_DXF_plotUnits, wxGBPosition( 0, 3 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
323 m_DXF_plotTextStrokeFontOpt->SetToolTip(
_(
"Check to use KiCad stroke font\nUncheck to plot single-line ASCII texts as editable text (using DXF font)") );
333 m_svgOptionsSizer =
new wxStaticBoxSizer(
new wxStaticBox(
this, wxID_ANY,
_(
"SVG Options") ), wxHORIZONTAL );
335 wxGridBagSizer* gbSizer3;
336 gbSizer3 =
new wxGridBagSizer( 5, 0 );
337 gbSizer3->SetFlexibleDirection( wxBOTH );
338 gbSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
342 gbSizer3->Add(
svgPrecisionLabel, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
345 m_svgPrecsision->SetToolTip(
_(
"This number defines how many digits are exported that are below 1 mm.\nUser unit is 10^-<N> mm\nChoose 4 if you are not sure.") );
347 gbSizer3->Add(
m_svgPrecsision, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
351 gbSizer3->Add(
m_staticText18, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
353 wxString m_SVGColorChoiceChoices[] = {
_(
"Color"),
_(
"Black and white") };
354 int m_SVGColorChoiceNChoices =
sizeof( m_SVGColorChoiceChoices ) /
sizeof( wxString );
355 m_SVGColorChoice =
new wxChoice(
m_svgOptionsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_SVGColorChoiceNChoices, m_SVGColorChoiceChoices, 0 );
357 gbSizer3->Add(
m_SVGColorChoice, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
368 m_PDFOptionsSizer =
new wxStaticBoxSizer(
new wxStaticBox(
this, wxID_ANY,
_(
"PDF Options") ), wxHORIZONTAL );
370 wxGridBagSizer* gbSizer4;
371 gbSizer4 =
new wxGridBagSizer( 5, 0 );
372 gbSizer4->SetFlexibleDirection( wxBOTH );
373 gbSizer4->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
377 gbSizer4->Add(
m_staticText19, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
379 wxString m_PDFColorChoiceChoices[] = {
_(
"Color"),
_(
"Black and white") };
380 int m_PDFColorChoiceNChoices =
sizeof( m_PDFColorChoiceChoices ) /
sizeof( wxString );
381 m_PDFColorChoice =
new wxChoice(
m_PDFOptionsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_PDFColorChoiceNChoices, m_PDFColorChoiceChoices, 0 );
383 gbSizer4->Add(
m_PDFColorChoice, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
391 m_pdfMetadata =
new wxCheckBox(
m_PDFOptionsSizer->GetStaticBox(), wxID_ANY,
_(
"Generate metadata from AUTHOR && SUBJECT variables"), wxDefaultPosition, wxDefaultSize, 0 );
392 m_pdfMetadata->SetToolTip(
_(
"Generate PDF document properties from AUTHOR and SUBJECT text variables") );
394 gbSizer4->Add(
m_pdfMetadata, wxGBPosition( 3, 0 ), wxGBSpan( 1, 2 ), wxLEFT|wxRIGHT, 5 );
397 gbSizer4->Add(
m_pdfSingle, wxGBPosition( 4, 0 ), wxGBSpan( 1, 2 ), wxLEFT|wxRIGHT, 5 );
418 wxBoxSizer* sbSizerMsg;
419 sbSizerMsg =
new wxBoxSizer( wxVERTICAL );
431 m_buttonDRC =
new wxButton(
this, wxID_ANY,
_(
"Run DRC..."), wxDefaultPosition, wxDefaultSize, 0 );
434 m_DRCExclusionsWarning =
new wxStaticText(
this, wxID_ANY,
_(
"(%d known DRC violations; %d exclusions)"), wxDefaultPosition, wxDefaultSize, 0 );
457 this->Centre( wxBOTH );