Drill files generation: when using blind/buried vias, the files are now created for each via layer pair, each file groups vias having the same pair, and one for through holes.
Drill report: serious enhancements. Plot files names for copper layers: build from the user layer name, like in bzr 4022 stable version. no change for other layers.
This commit is contained in:
parent
289897e364
commit
a0f52db1c8
|
@ -390,7 +390,7 @@ void DIALOG_GENDRILL::OnGenReportFile( wxCommandEvent& event )
|
|||
fn.SetName( fn.GetName() + wxT( "-drl" ) );
|
||||
fn.SetExt( ReportFileExtension );
|
||||
|
||||
wxString defaultPath = m_plotOpts.GetOutputDirectory();
|
||||
wxString defaultPath = Prj().AbsolutePath( m_plotOpts.GetOutputDirectory() );
|
||||
|
||||
if( defaultPath.IsEmpty() )
|
||||
defaultPath = wxStandardPaths::Get().GetDocumentsDir();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Jun 6 2014)
|
||||
// C++ code generated with wxFormBuilder (version Jun 17 2015)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
|
@ -15,36 +15,33 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
|
|||
{
|
||||
this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize );
|
||||
|
||||
m_MainSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
m_MainSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
wxBoxSizer* bSizer12;
|
||||
bSizer12 = new wxBoxSizer( wxVERTICAL );
|
||||
wxBoxSizer* bupperSizer;
|
||||
bupperSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
wxBoxSizer* bSizer26;
|
||||
bSizer26 = new wxBoxSizer( wxHORIZONTAL );
|
||||
wxBoxSizer* bSizerPlotFmt;
|
||||
bSizerPlotFmt = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
wxBoxSizer* bSizer27;
|
||||
bSizer27 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_staticText121 = new wxStaticText( this, wxID_ANY, _("Plot format:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText121->Wrap( -1 );
|
||||
bSizer27->Add( m_staticText121, 0, wxTOP, 5 );
|
||||
m_staticTextPlotFmt = new wxStaticText( this, wxID_ANY, _("Plot format:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextPlotFmt->Wrap( -1 );
|
||||
bSizerPlotFmt->Add( m_staticTextPlotFmt, 0, wxTOP, 5 );
|
||||
|
||||
wxString m_plotFormatOptChoices[] = { _("Gerber"), _("Postscript"), _("SVG"), _("DXF"), _("HPGL"), _("PDF") };
|
||||
int m_plotFormatOptNChoices = sizeof( m_plotFormatOptChoices ) / sizeof( wxString );
|
||||
m_plotFormatOpt = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_plotFormatOptNChoices, m_plotFormatOptChoices, 0 );
|
||||
m_plotFormatOpt->SetSelection( 0 );
|
||||
bSizer27->Add( m_plotFormatOpt, 0, 0, 5 );
|
||||
bSizerPlotFmt->Add( m_plotFormatOpt, 0, 0, 5 );
|
||||
|
||||
|
||||
bSizer26->Add( bSizer27, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
|
||||
bupperSizer->Add( bSizerPlotFmt, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
wxBoxSizer* bSizer28;
|
||||
bSizer28 = new wxBoxSizer( wxVERTICAL );
|
||||
wxBoxSizer* bSizerOutDir;
|
||||
bSizerOutDir = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_staticTextDir = new wxStaticText( this, wxID_ANY, _("Output directory:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextDir->Wrap( -1 );
|
||||
bSizer28->Add( m_staticTextDir, 0, wxEXPAND|wxTOP|wxLEFT, 5 );
|
||||
bSizerOutDir->Add( m_staticTextDir, 0, wxEXPAND|wxTOP|wxLEFT, 5 );
|
||||
|
||||
wxBoxSizer* bSizer29;
|
||||
bSizer29 = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
@ -59,25 +56,25 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
|
|||
bSizer29->Add( m_browseButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
|
||||
bSizer28->Add( bSizer29, 1, wxEXPAND, 5 );
|
||||
bSizerOutDir->Add( bSizer29, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
bSizer26->Add( bSizer28, 1, 0, 5 );
|
||||
bupperSizer->Add( bSizerOutDir, 1, 0, 5 );
|
||||
|
||||
|
||||
bSizer12->Add( bSizer26, 0, wxEXPAND, 5 );
|
||||
m_MainSizer->Add( bupperSizer, 0, wxEXPAND, 5 );
|
||||
|
||||
wxBoxSizer* bUpperSizer;
|
||||
bUpperSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
wxBoxSizer* bmiddleSizer;
|
||||
bmiddleSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_LayersSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Layers") ), wxHORIZONTAL );
|
||||
|
||||
wxArrayString m_layerCheckListBoxChoices;
|
||||
m_layerCheckListBox = new wxCheckListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_layerCheckListBoxChoices, 0 );
|
||||
m_layerCheckListBox = new wxCheckListBox( m_LayersSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_layerCheckListBoxChoices, 0 );
|
||||
m_LayersSizer->Add( m_layerCheckListBox, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
bUpperSizer->Add( m_LayersSizer, 1, wxALL|wxEXPAND, 3 );
|
||||
bmiddleSizer->Add( m_LayersSizer, 1, wxALL|wxEXPAND, 3 );
|
||||
|
||||
m_PlotOptionsSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
@ -90,46 +87,46 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
|
|||
wxBoxSizer* bSizerPlotItems;
|
||||
bSizerPlotItems = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_plotSheetRef = new wxCheckBox( this, wxID_ANY, _("Plot sheet reference on all layers"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_plotSheetRef = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Plot sheet reference on all layers"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerPlotItems->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( sbOptionsSizer->GetStaticBox(), ID_ALLOW_PRINT_PAD_ON_SILKSCREEN, _("Plot pads on silkscreen"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_plotPads_on_Silkscreen->SetToolTip( _("Enable plotting of pads on silkscreen layers\nWhen disabled, pads are never plotted on silkscreen layers\nWhen enabled, pads are plotted only if they appear on silkscreen layers") );
|
||||
|
||||
bSizerPlotItems->Add( m_plotPads_on_Silkscreen, 0, wxALL, 2 );
|
||||
|
||||
m_plotModuleValueOpt = new wxCheckBox( this, wxID_ANY, _("Plot footprint values"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_plotModuleValueOpt = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Plot footprint values"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_plotModuleValueOpt->SetValue(true);
|
||||
bSizerPlotItems->Add( m_plotModuleValueOpt, 0, wxTOP|wxRIGHT|wxLEFT, 2 );
|
||||
|
||||
m_plotModuleRefOpt = new wxCheckBox( this, ID_PRINT_REF, _("Plot footprint references"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_plotModuleRefOpt = new wxCheckBox( sbOptionsSizer->GetStaticBox(), ID_PRINT_REF, _("Plot footprint references"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerPlotItems->Add( m_plotModuleRefOpt, 0, wxTOP|wxRIGHT|wxLEFT, 2 );
|
||||
|
||||
m_plotInvisibleText = new wxCheckBox( this, wxID_ANY, _("Force plotting of invisible values/references"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_plotInvisibleText = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Force plotting of invisible values/references"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_plotInvisibleText->SetToolTip( _("Force plot invisible values and/or references") );
|
||||
|
||||
bSizerPlotItems->Add( m_plotInvisibleText, 0, wxALL, 2 );
|
||||
|
||||
m_plotNoViaOnMaskOpt = new wxCheckBox( this, wxID_ANY, _("Do not tent vias"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_plotNoViaOnMaskOpt = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Do not tent vias"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_plotNoViaOnMaskOpt->SetToolTip( _("Remove soldermask on vias") );
|
||||
|
||||
bSizerPlotItems->Add( m_plotNoViaOnMaskOpt, 0, wxTOP|wxRIGHT|wxLEFT, 2 );
|
||||
|
||||
m_excludeEdgeLayerOpt = new wxCheckBox( this, wxID_ANY, _("Exclude PCB edge layer from other layers"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_excludeEdgeLayerOpt = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Exclude PCB edge layer from other layers"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_excludeEdgeLayerOpt->SetToolTip( _("Exclude contents of the pcb edge layer from all other layers") );
|
||||
|
||||
bSizerPlotItems->Add( m_excludeEdgeLayerOpt, 0, wxALL, 2 );
|
||||
|
||||
m_plotMirrorOpt = new wxCheckBox( this, ID_MIROR_OPT, _("Mirrored plot"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerPlotItems->Add( m_plotMirrorOpt, 0, wxTOP|wxRIGHT|wxLEFT, 2 );
|
||||
m_plotMirrorOpt = new wxCheckBox( sbOptionsSizer->GetStaticBox(), ID_MIROR_OPT, _("Mirrored plot"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerPlotItems->Add( m_plotMirrorOpt, 0, wxALL, 2 );
|
||||
|
||||
m_plotPSNegativeOpt = new wxCheckBox( this, wxID_ANY, _("Negative plot"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_plotPSNegativeOpt = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Negative plot"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerPlotItems->Add( m_plotPSNegativeOpt, 0, wxALL, 2 );
|
||||
|
||||
m_useAuxOriginCheckBox = new wxCheckBox( this, wxID_ANY, _("Use auxiliary axis as origin"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_useAuxOriginCheckBox = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Use auxiliary axis as origin"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_useAuxOriginCheckBox->SetToolTip( _("Use auxiliary axis as coordinates origin in plot files") );
|
||||
|
||||
bSizerPlotItems->Add( m_useAuxOriginCheckBox, 0, wxTOP|wxRIGHT|wxLEFT, 2 );
|
||||
bSizerPlotItems->Add( m_useAuxOriginCheckBox, 0, wxALL, 2 );
|
||||
|
||||
|
||||
bSizer192->Add( bSizerPlotItems, 0, wxEXPAND, 5 );
|
||||
|
@ -137,43 +134,43 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
|
|||
wxBoxSizer* bSizer14;
|
||||
bSizer14 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_staticText11 = new wxStaticText( this, wxID_ANY, _("Drill marks:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText11 = new wxStaticText( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Drill marks:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText11->Wrap( -1 );
|
||||
bSizer14->Add( m_staticText11, 0, wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
wxString m_drillShapeOptChoices[] = { _("None"), _("Small"), _("Actual size") };
|
||||
int m_drillShapeOptNChoices = sizeof( m_drillShapeOptChoices ) / sizeof( wxString );
|
||||
m_drillShapeOpt = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_drillShapeOptNChoices, m_drillShapeOptChoices, 0 );
|
||||
m_drillShapeOpt = new wxChoice( sbOptionsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_drillShapeOptNChoices, m_drillShapeOptChoices, 0 );
|
||||
m_drillShapeOpt->SetSelection( 0 );
|
||||
bSizer14->Add( m_drillShapeOpt, 0, wxEXPAND|wxLEFT, 5 );
|
||||
|
||||
m_staticText12 = new wxStaticText( this, wxID_ANY, _("Scaling:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText12 = new wxStaticText( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Scaling:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText12->Wrap( -1 );
|
||||
bSizer14->Add( m_staticText12, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
wxString m_scaleOptChoices[] = { _("Auto"), _("1:1"), _("3:2"), _("2:1"), _("3:1") };
|
||||
int m_scaleOptNChoices = sizeof( m_scaleOptChoices ) / sizeof( wxString );
|
||||
m_scaleOpt = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_scaleOptNChoices, m_scaleOptChoices, 0 );
|
||||
m_scaleOpt = new wxChoice( sbOptionsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_scaleOptNChoices, m_scaleOptChoices, 0 );
|
||||
m_scaleOpt->SetSelection( 1 );
|
||||
bSizer14->Add( m_scaleOpt, 0, wxEXPAND|wxLEFT, 5 );
|
||||
|
||||
m_staticText13 = new wxStaticText( this, wxID_ANY, _("Plot mode:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText13 = new wxStaticText( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Plot mode:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText13->Wrap( -1 );
|
||||
bSizer14->Add( m_staticText13, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
wxString m_plotModeOptChoices[] = { _("Filled"), _("Sketch") };
|
||||
int m_plotModeOptNChoices = sizeof( m_plotModeOptChoices ) / sizeof( wxString );
|
||||
m_plotModeOpt = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_plotModeOptNChoices, m_plotModeOptChoices, 0 );
|
||||
m_plotModeOpt = new wxChoice( sbOptionsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_plotModeOptNChoices, m_plotModeOptChoices, 0 );
|
||||
m_plotModeOpt->SetSelection( 0 );
|
||||
bSizer14->Add( m_plotModeOpt, 0, wxEXPAND|wxLEFT, 5 );
|
||||
|
||||
m_textDefaultPenSize = new wxStaticText( this, wxID_ANY, _("Default line width"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_textDefaultPenSize = new wxStaticText( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Default line width"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_textDefaultPenSize->Wrap( -1 );
|
||||
m_textDefaultPenSize->SetToolTip( _("Pen size used to draw items that have no pen size specified.\nUsed mainly to draw items in sketch mode.") );
|
||||
|
||||
bSizer14->Add( m_textDefaultPenSize, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_linesWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_linesWidth = new wxTextCtrl( sbOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_linesWidth->SetMaxLength( 0 );
|
||||
m_linesWidth->SetToolTip( _("Line width for, e.g., sheet references.") );
|
||||
|
||||
|
@ -196,23 +193,23 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
|
|||
fgSizerSoldMaskOpts->SetFlexibleDirection( wxBOTH );
|
||||
fgSizerSoldMaskOpts->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
m_SolderMaskMarginLabel = new wxStaticText( this, wxID_ANY, _("Solder mask clearance:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_SolderMaskMarginLabel = new wxStaticText( sbSizerSoldMaskLayerOpt->GetStaticBox(), wxID_ANY, _("Solder mask clearance:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_SolderMaskMarginLabel->Wrap( -1 );
|
||||
m_SolderMaskMarginLabel->SetToolTip( _("Margin between pads and solder mask") );
|
||||
|
||||
fgSizerSoldMaskOpts->Add( m_SolderMaskMarginLabel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||
|
||||
m_SolderMaskMarginCurrValue = new wxStaticText( this, wxID_ANY, _("val"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_SolderMaskMarginCurrValue = new wxStaticText( sbSizerSoldMaskLayerOpt->GetStaticBox(), wxID_ANY, _("val"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_SolderMaskMarginCurrValue->Wrap( -1 );
|
||||
fgSizerSoldMaskOpts->Add( m_SolderMaskMarginCurrValue, 0, wxALL, 5 );
|
||||
|
||||
m_solderMaskMinWidthLabel = new wxStaticText( this, wxID_ANY, _("Solder mask min width:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_solderMaskMinWidthLabel = new wxStaticText( sbSizerSoldMaskLayerOpt->GetStaticBox(), wxID_ANY, _("Solder mask min width:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_solderMaskMinWidthLabel->Wrap( -1 );
|
||||
m_solderMaskMinWidthLabel->SetToolTip( _("Minimum distance between 2 pad areas.\nTwo pad areas nearer than this value will be merged during plotting") );
|
||||
|
||||
fgSizerSoldMaskOpts->Add( m_solderMaskMinWidthLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_SolderMaskMinWidthCurrValue = new wxStaticText( this, wxID_ANY, _("val"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_SolderMaskMinWidthCurrValue = new wxStaticText( sbSizerSoldMaskLayerOpt->GetStaticBox(), wxID_ANY, _("val"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_SolderMaskMinWidthCurrValue->Wrap( -1 );
|
||||
fgSizerSoldMaskOpts->Add( m_SolderMaskMinWidthCurrValue, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
@ -227,17 +224,17 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
|
|||
wxBoxSizer* bSizerGbrOpt;
|
||||
bSizerGbrOpt = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_useGerberExtensions = new wxCheckBox( this, wxID_ANY, _("Use Protel filename extensions"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_useGerberExtensions = new wxCheckBox( m_GerberOptionsSizer->GetStaticBox(), wxID_ANY, _("Use Protel filename extensions"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_useGerberExtensions->SetToolTip( _("Use conventional Protel Gerber extensions - .GBL, .GTL, etc...") );
|
||||
|
||||
bSizerGbrOpt->Add( m_useGerberExtensions, 0, wxALL, 2 );
|
||||
|
||||
m_useGerberAttributes = new wxCheckBox( this, wxID_ANY, _("Include extended attributes"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_useGerberAttributes = new wxCheckBox( m_GerberOptionsSizer->GetStaticBox(), wxID_ANY, _("Include extended attributes"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_useGerberAttributes->SetToolTip( _("Include extended attributes (X2 Gerber files format) in the Gerber file") );
|
||||
|
||||
bSizerGbrOpt->Add( m_useGerberAttributes, 0, wxALL, 2 );
|
||||
|
||||
m_subtractMaskFromSilk = new wxCheckBox( this, wxID_ANY, _("Subtract soldermask from silkscreen"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_subtractMaskFromSilk = new wxCheckBox( m_GerberOptionsSizer->GetStaticBox(), wxID_ANY, _("Subtract soldermask from silkscreen"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_subtractMaskFromSilk->SetToolTip( _("Remove silkscreen from areas without soldermask") );
|
||||
|
||||
bSizerGbrOpt->Add( m_subtractMaskFromSilk, 0, wxALL, 2 );
|
||||
|
@ -247,7 +244,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
|
|||
|
||||
wxString m_rbGerberFormatChoices[] = { _("4.5 (unit mm)"), _("4.6 (unit mm)") };
|
||||
int m_rbGerberFormatNChoices = sizeof( m_rbGerberFormatChoices ) / sizeof( wxString );
|
||||
m_rbGerberFormat = new wxRadioBox( this, wxID_ANY, _("Format"), wxDefaultPosition, wxDefaultSize, m_rbGerberFormatNChoices, m_rbGerberFormatChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_rbGerberFormat = new wxRadioBox( m_GerberOptionsSizer->GetStaticBox(), wxID_ANY, _("Format"), wxDefaultPosition, wxDefaultSize, m_rbGerberFormatNChoices, m_rbGerberFormatChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_rbGerberFormat->SetSelection( 0 );
|
||||
m_rbGerberFormat->SetToolTip( _("Resolution of coordinates in Gerber files.\nUse the higher value if possible.") );
|
||||
|
||||
|
@ -264,11 +261,11 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
|
|||
wxBoxSizer* bSizer20;
|
||||
bSizer20 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_textPenSize = new wxStaticText( this, wxID_ANY, _("Pen size"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_textPenSize = new wxStaticText( m_HPGLOptionsSizer->GetStaticBox(), wxID_ANY, _("Pen size"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_textPenSize->Wrap( -1 );
|
||||
bSizer20->Add( m_textPenSize, 0, wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_HPGLPenSizeOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_HPGLPenSizeOpt = new wxTextCtrl( m_HPGLOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_HPGLPenSizeOpt->SetMaxLength( 0 );
|
||||
bSizer20->Add( m_HPGLPenSizeOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
@ -278,11 +275,11 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
|
|||
wxBoxSizer* bSizer21;
|
||||
bSizer21 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_textPenOvr = new wxStaticText( this, wxID_ANY, _("Pen overlay"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_textPenOvr = new wxStaticText( m_HPGLOptionsSizer->GetStaticBox(), wxID_ANY, _("Pen overlay"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_textPenOvr->Wrap( -1 );
|
||||
bSizer21->Add( m_textPenOvr, 0, wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_HPGLPenOverlayOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_HPGLPenOverlayOpt = new wxTextCtrl( m_HPGLOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_HPGLPenOverlayOpt->SetMaxLength( 0 );
|
||||
m_HPGLPenOverlayOpt->SetToolTip( _("Set plot overlay for filling") );
|
||||
|
||||
|
@ -305,11 +302,11 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
|
|||
wxBoxSizer* bSizer18;
|
||||
bSizer18 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_staticText7 = new wxStaticText( this, wxID_ANY, _("X scale:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText7 = new wxStaticText( m_PSOptionsSizer->GetStaticBox(), wxID_ANY, _("X scale:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText7->Wrap( -1 );
|
||||
bSizer18->Add( m_staticText7, 0, wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_fineAdjustXscaleOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_fineAdjustXscaleOpt = new wxTextCtrl( m_PSOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_fineAdjustXscaleOpt->SetMaxLength( 0 );
|
||||
m_fineAdjustXscaleOpt->SetToolTip( _("Set global X scale adjust for exact scale postscript output.") );
|
||||
|
||||
|
@ -321,11 +318,11 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
|
|||
wxBoxSizer* bSizer19;
|
||||
bSizer19 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_staticText8 = new wxStaticText( this, wxID_ANY, _("Y scale:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText8 = new wxStaticText( m_PSOptionsSizer->GetStaticBox(), wxID_ANY, _("Y scale:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText8->Wrap( -1 );
|
||||
bSizer19->Add( m_staticText8, 0, wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_fineAdjustYscaleOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_fineAdjustYscaleOpt = new wxTextCtrl( m_PSOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_fineAdjustYscaleOpt->SetMaxLength( 0 );
|
||||
m_fineAdjustYscaleOpt->SetToolTip( _("Set global Y scale adjust for exact scale postscript output.") );
|
||||
|
||||
|
@ -337,11 +334,11 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
|
|||
wxBoxSizer* bSizer191;
|
||||
bSizer191 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_textPSFineAdjustWidth = new wxStaticText( this, wxID_ANY, _("Width correction"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_textPSFineAdjustWidth = new wxStaticText( m_PSOptionsSizer->GetStaticBox(), wxID_ANY, _("Width correction"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_textPSFineAdjustWidth->Wrap( -1 );
|
||||
bSizer191->Add( m_textPSFineAdjustWidth, 0, wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_PSFineAdjustWidthOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_PSFineAdjustWidthOpt = new wxTextCtrl( m_PSOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_PSFineAdjustWidthOpt->SetMaxLength( 0 );
|
||||
m_PSFineAdjustWidthOpt->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)] in decimils.") );
|
||||
|
||||
|
@ -353,17 +350,17 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
|
|||
|
||||
m_PSOptionsSizer->Add( bSizer17, 1, wxEXPAND, 5 );
|
||||
|
||||
m_forcePSA4OutputOpt = new wxCheckBox( this, wxID_ANY, _("Force A4 output"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_forcePSA4OutputOpt = new wxCheckBox( m_PSOptionsSizer->GetStaticBox(), wxID_ANY, _("Force A4 output"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_PSOptionsSizer->Add( m_forcePSA4OutputOpt, 0, wxALL, 2 );
|
||||
|
||||
|
||||
m_PlotOptionsSizer->Add( m_PSOptionsSizer, 0, wxALL|wxEXPAND, 3 );
|
||||
|
||||
|
||||
bUpperSizer->Add( m_PlotOptionsSizer, 0, 0, 5 );
|
||||
bmiddleSizer->Add( m_PlotOptionsSizer, 0, 0, 5 );
|
||||
|
||||
|
||||
bSizer12->Add( bUpperSizer, 0, wxEXPAND, 5 );
|
||||
m_MainSizer->Add( bmiddleSizer, 0, wxEXPAND, 5 );
|
||||
|
||||
wxBoxSizer* sbSizerMsg;
|
||||
sbSizerMsg = new wxBoxSizer( wxVERTICAL );
|
||||
|
@ -374,7 +371,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
|
|||
sbSizerMsg->Add( m_messagesPanel, 1, wxEXPAND | wxALL, 5 );
|
||||
|
||||
|
||||
bSizer12->Add( sbSizerMsg, 1, wxEXPAND, 5 );
|
||||
m_MainSizer->Add( sbSizerMsg, 1, wxEXPAND, 5 );
|
||||
|
||||
wxBoxSizer* bSizerButtons;
|
||||
bSizerButtons = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
@ -390,21 +387,11 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
|
|||
bSizerButtons->Add( m_buttonQuit, 0, wxALL, 5 );
|
||||
|
||||
|
||||
bSizer12->Add( bSizerButtons, 0, wxALIGN_RIGHT|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
wxBoxSizer* bSizer221;
|
||||
bSizer221 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
bSizer12->Add( bSizer221, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
m_MainSizer->Add( bSizer12, 1, wxALL|wxEXPAND, 5 );
|
||||
m_MainSizer->Add( bSizerButtons, 0, wxALIGN_RIGHT|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
this->SetSizer( m_MainSizer );
|
||||
this->Layout();
|
||||
m_MainSizer->Fit( this );
|
||||
m_popMenu = new wxMenu();
|
||||
wxMenuItem* m_menuItem1;
|
||||
m_menuItem1 = new wxMenuItem( m_popMenu, ID_LAYER_FAB, wxString( _("Select Fab Layers") ) , wxEmptyString, wxITEM_NORMAL );
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Jun 6 2014)
|
||||
// C++ code generated with wxFormBuilder (version Jun 17 2015)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
|
@ -60,7 +60,7 @@ class DIALOG_PLOT_BASE : public DIALOG_SHIM
|
|||
};
|
||||
|
||||
wxBoxSizer* m_MainSizer;
|
||||
wxStaticText* m_staticText121;
|
||||
wxStaticText* m_staticTextPlotFmt;
|
||||
wxChoice* m_plotFormatOpt;
|
||||
wxStaticText* m_staticTextDir;
|
||||
wxTextCtrl* m_outputDirectoryName;
|
||||
|
@ -129,7 +129,7 @@ class DIALOG_PLOT_BASE : public DIALOG_SHIM
|
|||
|
||||
public:
|
||||
|
||||
DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Plot"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), 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( 566,711 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
~DIALOG_PLOT_BASE();
|
||||
|
||||
void DIALOG_PLOT_BASEOnContextMenu( wxMouseEvent &event )
|
||||
|
|
|
@ -284,127 +284,93 @@ bool EXCELLON_WRITER::GenDrillMapFile( const wxString& aFullFileName,
|
|||
|
||||
bool EXCELLON_WRITER::GenDrillReportFile( const wxString& aFullFileName )
|
||||
{
|
||||
m_file = wxFopen( aFullFileName, wxT( "w" ) );
|
||||
FILE_OUTPUTFORMATTER out( aFullFileName );
|
||||
|
||||
if( m_file == NULL )
|
||||
return false;
|
||||
static const char separator[] =
|
||||
" =============================================================\n";
|
||||
|
||||
wxASSERT( m_pcb );
|
||||
|
||||
unsigned totalHoleCount;
|
||||
char line[1024];
|
||||
LAYER_NUM layer1 = F_Cu; // First layer of the layer stack
|
||||
LAYER_NUM layer2 = B_Cu; // Last layer of the layer stack
|
||||
bool gen_through_holes = true;
|
||||
bool gen_NPTH_holes = false;
|
||||
wxString brdFilename = m_pcb->GetFileName();
|
||||
|
||||
wxString brdFilename = m_pcb->GetFileName();
|
||||
fprintf( m_file, "Drill report for %s\n", TO_UTF8( brdFilename ) );
|
||||
fprintf( m_file, "Created on %s\n\n", TO_UTF8( DateAndTime() ) );
|
||||
std::vector<LAYER_PAIR> hole_sets = getUniqueLayerPairs();
|
||||
|
||||
/* build hole lists:
|
||||
* 1 - through holes
|
||||
* 2 - for partial holes only: by layer pair
|
||||
* 3 - Not Plated through holes
|
||||
*/
|
||||
out.Print( 0, "Drill report for %s\n", TO_UTF8( brdFilename ) );
|
||||
out.Print( 0, "Created on %s\n\n", TO_UTF8( DateAndTime() ) );
|
||||
|
||||
for( ; ; )
|
||||
// Output the cu layer stackup, so layer name references make sense.
|
||||
out.Print( 0, "Copper Layer Stackup:\n" );
|
||||
out.Print( 0, separator );
|
||||
|
||||
LSET cu = m_pcb->GetEnabledLayers() & LSET::AllCuMask();
|
||||
|
||||
int conventional_layer_num = 1;
|
||||
for( LSEQ seq = cu.Seq(); seq; ++seq, ++conventional_layer_num )
|
||||
{
|
||||
BuildHolesList( layer1, layer2,
|
||||
gen_through_holes ? false : true, gen_NPTH_holes, false);
|
||||
|
||||
totalHoleCount = 0;
|
||||
|
||||
if( gen_NPTH_holes )
|
||||
sprintf( line, "Drill report for unplated through holes :\n" );
|
||||
else if( gen_through_holes )
|
||||
sprintf( line, "Drill report for plated through holes :\n" );
|
||||
else
|
||||
{
|
||||
// If this is the first partial hole list: print a title
|
||||
if( layer1 == F_Cu )
|
||||
fputs( "Drill report for buried and blind vias :\n\n", m_file );
|
||||
|
||||
sprintf( line, "Holes from layer %s to layer %s :\n",
|
||||
TO_UTF8( m_pcb->GetLayerName( ToLAYER_ID( layer1 ) ) ),
|
||||
TO_UTF8( m_pcb->GetLayerName( ToLAYER_ID( layer2 ) ) ) );
|
||||
}
|
||||
|
||||
fputs( line, m_file );
|
||||
|
||||
for( unsigned ii = 0; ii < m_toolListBuffer.size(); ii++ )
|
||||
{
|
||||
// List the tool number assigned to each drill,
|
||||
// in mm then in inches.
|
||||
sprintf( line, " T%d %2.2fmm %2.3f\" ",
|
||||
ii + 1,
|
||||
diameter_in_mm( m_toolListBuffer[ii].m_Diameter ),
|
||||
diameter_in_inches( m_toolListBuffer[ii].m_Diameter ) );
|
||||
|
||||
fputs( line, m_file );
|
||||
|
||||
// Now list how many holes and ovals are associated with each drill.
|
||||
if( ( m_toolListBuffer[ii].m_TotalCount == 1 )
|
||||
&& ( m_toolListBuffer[ii].m_OvalCount == 0 ) )
|
||||
sprintf( line, "(1 hole)\n" );
|
||||
else if( m_toolListBuffer[ii].m_TotalCount == 1 )
|
||||
sprintf( line, "(1 hole) (with 1 slot)\n" );
|
||||
else if( m_toolListBuffer[ii].m_OvalCount == 0 )
|
||||
sprintf( line, "(%d holes)\n", m_toolListBuffer[ii].m_TotalCount );
|
||||
else if( m_toolListBuffer[ii].m_OvalCount == 1 )
|
||||
sprintf( line, "(%d holes) (with 1 slot)\n",
|
||||
m_toolListBuffer[ii].m_TotalCount );
|
||||
else // if ( buffer[ii]m_OvalCount > 1 )
|
||||
sprintf( line, "(%d holes) (with %d slots)\n",
|
||||
m_toolListBuffer[ii].m_TotalCount,
|
||||
m_toolListBuffer[ii].m_OvalCount );
|
||||
|
||||
fputs( line, m_file );
|
||||
|
||||
totalHoleCount += m_toolListBuffer[ii].m_TotalCount;
|
||||
}
|
||||
|
||||
if( gen_NPTH_holes )
|
||||
sprintf( line, "\nTotal unplated holes count %u\n\n\n", totalHoleCount );
|
||||
else
|
||||
sprintf( line, "\nTotal plated holes count %u\n\n\n", totalHoleCount );
|
||||
|
||||
fputs( line, m_file );
|
||||
|
||||
if( gen_NPTH_holes )
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( m_pcb->GetCopperLayerCount() <= 2 )
|
||||
{
|
||||
gen_NPTH_holes = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if( gen_through_holes )
|
||||
{ // Prepare the next iteration, which print the not through holes
|
||||
layer2 = layer1 + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( layer2 >= B_Cu ) // no more layer pair to consider
|
||||
{
|
||||
gen_NPTH_holes = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
++layer1;
|
||||
++layer2; // use next layer pair
|
||||
|
||||
if( layer2 == m_pcb->GetCopperLayerCount() - 1 )
|
||||
layer2 = B_Cu; // the last layer is always the bottom layer
|
||||
}
|
||||
|
||||
gen_through_holes = false;
|
||||
}
|
||||
out.Print( 0, " L%-2d: %-25s %s\n",
|
||||
conventional_layer_num,
|
||||
TO_UTF8( m_pcb->GetLayerName( *seq ) ),
|
||||
layerName( *seq ).c_str() // generic layer name
|
||||
);
|
||||
}
|
||||
|
||||
fclose( m_file );
|
||||
out.Print( 0, "\n\n" );
|
||||
|
||||
/* output hole lists:
|
||||
* 1 - through holes
|
||||
* 2 - for partial holes only: by layer starting and ending pair
|
||||
* 3 - Non Plated through holes
|
||||
*/
|
||||
|
||||
// in this loop are plated only:
|
||||
for( unsigned pair_ndx = 0; pair_ndx < hole_sets.size(); ++pair_ndx )
|
||||
{
|
||||
LAYER_PAIR pair = hole_sets[pair_ndx];
|
||||
|
||||
BuildHolesList( pair, false, false );
|
||||
|
||||
if( pair == LAYER_PAIR( F_Cu, B_Cu ) )
|
||||
{
|
||||
out.Print( 0, "Drill file '%s' contains\n",
|
||||
TO_UTF8( drillFileName( pair, false ) ) );
|
||||
|
||||
out.Print( 0, " plated through holes:\n" );
|
||||
out.Print( 0, separator );
|
||||
totalHoleCount = printToolSummary( out );
|
||||
out.Print( 0, " Total plated holes count %u\n", totalHoleCount );
|
||||
}
|
||||
else // blind/buried
|
||||
{
|
||||
out.Print( 0, "Drill file '%s' contains\n",
|
||||
TO_UTF8( drillFileName( pair, false ) ) );
|
||||
|
||||
out.Print( 0, " holes connecting layer pair: '%s and %s' (%s vias):\n",
|
||||
TO_UTF8( m_pcb->GetLayerName( ToLAYER_ID( pair.first ) ) ),
|
||||
TO_UTF8( m_pcb->GetLayerName( ToLAYER_ID( pair.second ) ) ),
|
||||
pair.first == F_Cu || pair.second == B_Cu ? "blind" : "buried"
|
||||
);
|
||||
|
||||
out.Print( 0, separator );
|
||||
totalHoleCount = printToolSummary( out );
|
||||
out.Print( 0, " Total plated holes count %u\n", totalHoleCount );
|
||||
}
|
||||
|
||||
out.Print( 0, "\n\n" );
|
||||
}
|
||||
|
||||
// NPTHoles:
|
||||
BuildHolesList( LAYER_PAIR( F_Cu, B_Cu ), true, false );
|
||||
|
||||
// if( m_toolListBuffer.size() ) nothing wrong with an empty NPTH file.
|
||||
{
|
||||
out.Print( 0, "Drill file '%s' contains\n",
|
||||
TO_UTF8( drillFileName( LAYER_PAIR( F_Cu, B_Cu ), true ) ) );
|
||||
out.Print( 0, " unplated through holes:\n" );
|
||||
out.Print( 0, separator );
|
||||
totalHoleCount = printToolSummary( out );
|
||||
out.Print( 0, " Total unplated holes count %u\n", totalHoleCount );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -434,3 +400,41 @@ bool EXCELLON_WRITER::PlotDrillMarks( PLOTTER* aPlotter )
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
unsigned EXCELLON_WRITER::printToolSummary( OUTPUTFORMATTER& out ) const
|
||||
{
|
||||
unsigned totalHoleCount = 0;
|
||||
|
||||
for( unsigned ii = 0; ii < m_toolListBuffer.size(); ii++ )
|
||||
{
|
||||
// List the tool number assigned to each drill,
|
||||
// in mm then in inches.
|
||||
out.Print( 0, " T%d %2.2fmm %2.3f\" ",
|
||||
ii + 1,
|
||||
diameter_in_mm( m_toolListBuffer[ii].m_Diameter ),
|
||||
diameter_in_inches( m_toolListBuffer[ii].m_Diameter ) );
|
||||
|
||||
// Now list how many holes and ovals are associated with each drill.
|
||||
if( ( m_toolListBuffer[ii].m_TotalCount == 1 )
|
||||
&& ( m_toolListBuffer[ii].m_OvalCount == 0 ) )
|
||||
out.Print( 0, "(1 hole)\n" );
|
||||
else if( m_toolListBuffer[ii].m_TotalCount == 1 )
|
||||
out.Print( 0, "(1 hole) (with 1 slot)\n" );
|
||||
else if( m_toolListBuffer[ii].m_OvalCount == 0 )
|
||||
out.Print( 0, "(%d holes)\n", m_toolListBuffer[ii].m_TotalCount );
|
||||
else if( m_toolListBuffer[ii].m_OvalCount == 1 )
|
||||
out.Print( 0, "(%d holes) (with 1 slot)\n",
|
||||
m_toolListBuffer[ii].m_TotalCount );
|
||||
else // if ( buffer[ii]m_OvalCount > 1 )
|
||||
out.Print( 0, "(%d holes) (with %d slots)\n",
|
||||
m_toolListBuffer[ii].m_TotalCount,
|
||||
m_toolListBuffer[ii].m_OvalCount );
|
||||
|
||||
totalHoleCount += m_toolListBuffer[ii].m_TotalCount;
|
||||
}
|
||||
|
||||
out.Print( 0, "\n" );
|
||||
|
||||
return totalHoleCount;
|
||||
}
|
||||
|
|
|
@ -54,6 +54,8 @@
|
|||
#include <gendrill_Excellon_writer.h>
|
||||
#include <wildcards_and_files_ext.h>
|
||||
#include <reporter.h>
|
||||
#include <collectors.h>
|
||||
|
||||
|
||||
//#include <dialog_gendrill.h> // Dialog box for drill file generation
|
||||
|
||||
|
@ -77,71 +79,29 @@ void EXCELLON_WRITER::CreateDrillandMapFilesSet( const wxString& aPlotDirectory
|
|||
bool aGenDrill, bool aGenMap,
|
||||
REPORTER * aReporter )
|
||||
{
|
||||
wxFileName fn;
|
||||
wxString msg;
|
||||
wxFileName fn;
|
||||
wxString msg;
|
||||
|
||||
wxString layername_extend; // added to the board filefame to create a full filename
|
||||
//(board fileName + layer pair names)
|
||||
std::vector<LAYER_PAIR> hole_sets = getUniqueLayerPairs();
|
||||
|
||||
// If some buried/blind vias are found, drill files are created
|
||||
// layer pair by layer pair for buried vias
|
||||
bool hasBuriedVias = false;
|
||||
// append a pair representing the NPTH set of holes.
|
||||
hole_sets.push_back( LAYER_PAIR( F_Cu, B_Cu ) );
|
||||
|
||||
for( TRACK* track = m_pcb->m_Track; track != NULL; track = track->Next() )
|
||||
for( std::vector<LAYER_PAIR>::const_iterator it = hole_sets.begin();
|
||||
it != hole_sets.end(); ++it )
|
||||
{
|
||||
if( track->Type() == PCB_VIA_T )
|
||||
{
|
||||
const VIA *via = static_cast<const VIA*>( track );
|
||||
LAYER_PAIR pair = *it;
|
||||
bool doing_npth = ( it == hole_sets.end() - 1 );
|
||||
|
||||
if( via->GetViaType() == VIA_MICROVIA ||
|
||||
via->GetViaType() == VIA_BLIND_BURIED )
|
||||
{
|
||||
hasBuriedVias = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int layer1 = F_Cu;
|
||||
int layer2 = B_Cu;
|
||||
bool gen_through_holes = true;
|
||||
bool gen_NPTH_holes = false;
|
||||
|
||||
for( ; ; )
|
||||
{
|
||||
BuildHolesList( layer1, layer2, gen_through_holes ? false : true,
|
||||
gen_NPTH_holes, m_merge_PTH_NPTH );
|
||||
BuildHolesList( pair, doing_npth, m_merge_PTH_NPTH );
|
||||
|
||||
if( GetHolesCount() > 0 ) // has holes?
|
||||
{
|
||||
fn = m_pcb->GetFileName();
|
||||
layername_extend.Empty();
|
||||
|
||||
if( gen_NPTH_holes )
|
||||
{
|
||||
layername_extend << wxT( "-NPTH" );
|
||||
}
|
||||
else if( !gen_through_holes )
|
||||
{
|
||||
if( layer1 == F_Cu )
|
||||
layername_extend << wxT( "-front" );
|
||||
else
|
||||
layername_extend << wxT( "-inner" ) << layer1;
|
||||
|
||||
if( layer2 == B_Cu )
|
||||
layername_extend << wxT( "-back" );
|
||||
else
|
||||
layername_extend << wxT( "-inner" ) << layer2;
|
||||
}
|
||||
|
||||
fn.SetName( fn.GetName() + layername_extend );
|
||||
|
||||
fn = drillFileName( pair, doing_npth );
|
||||
fn.SetPath( aPlotDirectory );
|
||||
|
||||
if( aGenDrill )
|
||||
{
|
||||
fn.SetExt( DrillFileExtension );
|
||||
wxString fullFilename = fn.GetFullPath();
|
||||
|
||||
FILE* file = wxFopen( fullFilename, wxT( "w" ) );
|
||||
|
@ -196,39 +156,11 @@ void EXCELLON_WRITER::CreateDrillandMapFilesSet( const wxString& aPlotDirectory
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( gen_NPTH_holes ) // The last drill file was created
|
||||
break;
|
||||
|
||||
if( !hasBuriedVias )
|
||||
gen_NPTH_holes = true;
|
||||
else
|
||||
{
|
||||
if( gen_through_holes )
|
||||
layer2 = layer1 + 1; // done with through-board holes, prepare generation of first layer pair
|
||||
else
|
||||
{
|
||||
if( layer2 >= B_Cu ) // no more layer pair to consider
|
||||
{
|
||||
layer1 = F_Cu;
|
||||
layer2 = B_Cu;
|
||||
gen_NPTH_holes = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
layer1++;
|
||||
layer2++; // use next layer pair
|
||||
|
||||
if( layer2 == m_pcb->GetCopperLayerCount() - 1 )
|
||||
layer2 = B_Cu; // the last layer is always the back layer
|
||||
}
|
||||
|
||||
gen_through_holes = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Creates the drill files in EXCELLON format
|
||||
* Number format:
|
||||
|
@ -604,25 +536,18 @@ static bool CmpHoleDiameterValue( const HOLE_INFO& a, const HOLE_INFO& b )
|
|||
}
|
||||
|
||||
|
||||
void EXCELLON_WRITER::BuildHolesList( int aFirstLayer,
|
||||
int aLastLayer,
|
||||
bool aExcludeThroughHoles,
|
||||
void EXCELLON_WRITER::BuildHolesList( LAYER_PAIR aLayerPair,
|
||||
bool aGenerateNPTH_list,
|
||||
bool aMerge_PTH_NPTH )
|
||||
{
|
||||
HOLE_INFO new_hole;
|
||||
int hole_value;
|
||||
|
||||
m_holeListBuffer.clear();
|
||||
m_toolListBuffer.clear();
|
||||
|
||||
if( (aFirstLayer >= 0) && (aLastLayer >= 0) )
|
||||
{
|
||||
if( aFirstLayer > aLastLayer )
|
||||
std::swap( aFirstLayer, aLastLayer );
|
||||
}
|
||||
wxASSERT( aLayerPair.first < aLayerPair.second ); // fix the caller
|
||||
|
||||
if ( aGenerateNPTH_list && aMerge_PTH_NPTH )
|
||||
if( aGenerateNPTH_list && aMerge_PTH_NPTH )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -632,14 +557,14 @@ void EXCELLON_WRITER::BuildHolesList( int aFirstLayer,
|
|||
{
|
||||
for( VIA* via = GetFirstVia( m_pcb->m_Track ); via; via = GetFirstVia( via->Next() ) )
|
||||
{
|
||||
hole_value = via->GetDrillValue();
|
||||
int hole_sz = via->GetDrillValue();
|
||||
|
||||
if( hole_value == 0 ) // Should not occur.
|
||||
if( hole_sz == 0 ) // Should not occur.
|
||||
continue;
|
||||
|
||||
new_hole.m_Tool_Reference = -1; // Flag value for Not initialized
|
||||
new_hole.m_Hole_Orient = 0;
|
||||
new_hole.m_Hole_Diameter = hole_value;
|
||||
new_hole.m_Hole_Diameter = hole_sz;
|
||||
new_hole.m_Hole_Size.x = new_hole.m_Hole_Size.y = new_hole.m_Hole_Diameter;
|
||||
|
||||
new_hole.m_Hole_Shape = 0; // hole shape: round
|
||||
|
@ -647,29 +572,22 @@ void EXCELLON_WRITER::BuildHolesList( int aFirstLayer,
|
|||
|
||||
via->LayerPair( &new_hole.m_Hole_Top_Layer, &new_hole.m_Hole_Bottom_Layer );
|
||||
|
||||
// LayerPair return params with m_Hole_Bottom_Layer > m_Hole_Top_Layer
|
||||
// LayerPair() returns params with m_Hole_Bottom_Layer > m_Hole_Top_Layer
|
||||
// Remember: top layer = 0 and bottom layer = 31 for through hole vias
|
||||
// the via should be at least from aFirstLayer to aLastLayer
|
||||
if( (new_hole.m_Hole_Top_Layer > aFirstLayer) && (aFirstLayer >= 0) )
|
||||
continue; // via above the first layer
|
||||
|
||||
if( (new_hole.m_Hole_Bottom_Layer < aLastLayer) && (aLastLayer >= 0) )
|
||||
continue; // via below the last layer
|
||||
|
||||
if( aExcludeThroughHoles && (new_hole.m_Hole_Bottom_Layer == B_Cu)
|
||||
&& (new_hole.m_Hole_Top_Layer == F_Cu) )
|
||||
// Any captured via should be from aLayerPair.first to aLayerPair.second exactly.
|
||||
if( new_hole.m_Hole_Top_Layer != aLayerPair.first ||
|
||||
new_hole.m_Hole_Bottom_Layer != aLayerPair.second )
|
||||
continue;
|
||||
|
||||
m_holeListBuffer.push_back( new_hole );
|
||||
}
|
||||
}
|
||||
|
||||
// build hole list for pads (assumed always through holes)
|
||||
if( !aExcludeThroughHoles || aGenerateNPTH_list )
|
||||
if( aLayerPair == LAYER_PAIR( F_Cu, B_Cu ) )
|
||||
{
|
||||
// add holes for thru hole pads
|
||||
for( MODULE* module = m_pcb->m_Modules; module; module = module->Next() )
|
||||
{
|
||||
// Read and analyse pads
|
||||
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
|
||||
{
|
||||
if( ! aGenerateNPTH_list &&
|
||||
|
@ -706,18 +624,18 @@ void EXCELLON_WRITER::BuildHolesList( int aFirstLayer,
|
|||
sort( m_holeListBuffer.begin(), m_holeListBuffer.end(), CmpHoleDiameterValue );
|
||||
|
||||
// build the tool list
|
||||
int LastHole = -1; /* Set to not initialized (this is a value not used
|
||||
* for m_holeListBuffer[ii].m_Hole_Diameter) */
|
||||
int last_hole = -1; /* Set to not initialized (this is a value not used
|
||||
* for m_holeListBuffer[ii].m_Hole_Diameter) */
|
||||
DRILL_TOOL new_tool( 0 );
|
||||
unsigned jj;
|
||||
|
||||
for( unsigned ii = 0; ii < m_holeListBuffer.size(); ii++ )
|
||||
{
|
||||
if( m_holeListBuffer[ii].m_Hole_Diameter != LastHole )
|
||||
if( m_holeListBuffer[ii].m_Hole_Diameter != last_hole )
|
||||
{
|
||||
new_tool.m_Diameter = ( m_holeListBuffer[ii].m_Hole_Diameter );
|
||||
m_toolListBuffer.push_back( new_tool );
|
||||
LastHole = new_tool.m_Diameter;
|
||||
last_hole = new_tool.m_Diameter;
|
||||
}
|
||||
|
||||
jj = m_toolListBuffer.size();
|
||||
|
@ -733,3 +651,100 @@ void EXCELLON_WRITER::BuildHolesList( int aFirstLayer,
|
|||
m_toolListBuffer.back().m_OvalCount++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
std::vector<LAYER_PAIR> EXCELLON_WRITER::getUniqueLayerPairs() const
|
||||
{
|
||||
wxASSERT( m_pcb );
|
||||
|
||||
static const KICAD_T interesting_stuff_to_collect[] = {
|
||||
PCB_VIA_T,
|
||||
EOT
|
||||
};
|
||||
|
||||
PCB_TYPE_COLLECTOR vias;
|
||||
|
||||
vias.Collect( m_pcb, interesting_stuff_to_collect );
|
||||
|
||||
std::set< LAYER_PAIR > unique;
|
||||
|
||||
LAYER_PAIR layer_pair;
|
||||
|
||||
for( int i = 0; i < vias.GetCount(); ++i )
|
||||
{
|
||||
VIA* v = (VIA*) vias[i];
|
||||
|
||||
v->LayerPair( &layer_pair.first, &layer_pair.second );
|
||||
|
||||
// only make note of blind buried.
|
||||
// thru hole is placed unconditionally as first in fetched list.
|
||||
if( layer_pair != LAYER_PAIR( F_Cu, B_Cu ) )
|
||||
{
|
||||
unique.insert( layer_pair );
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<LAYER_PAIR> ret;
|
||||
|
||||
ret.push_back( LAYER_PAIR( F_Cu, B_Cu ) ); // always first in returned list
|
||||
|
||||
for( std::set< LAYER_PAIR >::const_iterator it = unique.begin(); it != unique.end(); ++it )
|
||||
ret.push_back( *it );
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
const std::string EXCELLON_WRITER::layerName( LAYER_ID aLayer ) const
|
||||
{
|
||||
// Generic names here.
|
||||
switch( aLayer )
|
||||
{
|
||||
case F_Cu:
|
||||
return "front";
|
||||
case B_Cu:
|
||||
return "back";
|
||||
default:
|
||||
return StrPrintf( "inner%d", aLayer );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const std::string EXCELLON_WRITER::layerPairName( LAYER_PAIR aPair ) const
|
||||
{
|
||||
std::string ret = layerName( aPair.first );
|
||||
ret += '-';
|
||||
ret += layerName( aPair.second );
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
const wxString EXCELLON_WRITER::drillFileName( LAYER_PAIR aPair, bool aNPTH ) const
|
||||
{
|
||||
wxASSERT( m_pcb );
|
||||
|
||||
wxString extend;
|
||||
|
||||
if( aNPTH )
|
||||
extend = "-NPTH";
|
||||
else if( aPair == LAYER_PAIR( F_Cu, B_Cu ) )
|
||||
{
|
||||
// extend with nothing
|
||||
}
|
||||
else
|
||||
{
|
||||
extend += '-';
|
||||
extend += layerPairName( aPair );
|
||||
}
|
||||
|
||||
wxFileName fn = m_pcb->GetFileName();
|
||||
|
||||
fn.SetName( fn.GetName() + extend );
|
||||
fn.SetPath( "" );
|
||||
fn.SetExt( DrillFileExtension );
|
||||
|
||||
wxString ret = fn.GetFullPath(); // show me in debugger
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -113,6 +113,9 @@ public: DRILL_PRECISION( int l = 2, int r = 4 )
|
|||
};
|
||||
|
||||
|
||||
typedef std::pair<LAYER_ID, LAYER_ID> LAYER_PAIR;
|
||||
class OUTPUTFORMATTER;
|
||||
|
||||
/**
|
||||
* EXCELLON_WRITER is a class mainly used to create Excellon drill files
|
||||
* However, this class is also used to create drill maps and drill report
|
||||
|
@ -214,19 +217,18 @@ public:
|
|||
/**
|
||||
* Function BuildHolesList
|
||||
* Create the list of holes and tools for a given board
|
||||
* The list is sorted by increasing drill values
|
||||
* Only holes from aFirstLayer to aLastLayer copper layers are listed (for vias, because
|
||||
* pad holes are always through holes)
|
||||
* @param aFirstLayer = first layer to consider. if < 0 aFirstLayer is ignored
|
||||
* @param aLastLayer = last layer to consider. if < 0 aLastLayer is ignored
|
||||
* @param aExcludeThroughHoles Exclude through holes if true.
|
||||
* The list is sorted by increasing drill size.
|
||||
* Only holes included within aLayerPair are listed.
|
||||
* If aLayerPair identifies with [F_Cu, B_Cu], then
|
||||
* pad holes are always included also.
|
||||
*
|
||||
* @param aLayerPair is an inclusive range of layers.
|
||||
* @param aGenerateNPTH_list :
|
||||
* true to create NPTH only list (with no plated holes)
|
||||
* false to created plated holes list (with no NPTH )
|
||||
* @param aMerge_PTH_NPTH : true to create only one list which contains both PTH and NPTH
|
||||
*/
|
||||
void BuildHolesList( int aFirstLayer, int aLastLayer,
|
||||
bool aExcludeThroughHoles,
|
||||
void BuildHolesList( LAYER_PAIR aLayerPair,
|
||||
bool aGenerateNPTH_list,
|
||||
bool aMerge_PTH_NPTH );
|
||||
|
||||
|
@ -345,7 +347,21 @@ private:
|
|||
* @param aPlotter = a PLOTTER instance (HPGL, POSTSCRIPT ... plotter).
|
||||
*/
|
||||
bool PlotDrillMarks( PLOTTER* aPlotter );
|
||||
|
||||
/// Get unique layer pairs by examining the micro and blind_buried vias.
|
||||
std::vector<LAYER_PAIR> getUniqueLayerPairs() const;
|
||||
|
||||
/**
|
||||
* Function printToolSummary
|
||||
* prints m_toolListBuffer[] tools to aOut and returns total hole count.
|
||||
*/
|
||||
unsigned printToolSummary( OUTPUTFORMATTER& aOut ) const;
|
||||
|
||||
const std::string layerPairName( LAYER_PAIR aPair ) const;
|
||||
|
||||
const std::string layerName( LAYER_ID aLayer ) const;
|
||||
|
||||
const wxString drillFileName( LAYER_PAIR aPair, bool aNPTH ) const;
|
||||
};
|
||||
|
||||
|
||||
#endif // #ifndef _GENDRILL_EXCELLON_WRITER_
|
||||
|
|
Loading…
Reference in New Issue