Browse Source

Python compatibility: move DXF_PLOTTER::DXF_UNITS to DXF_UNITS in pcb_plot_params.h

Fixes #6034
https://gitlab.com/kicad/code/kicad/issues/6034
6.0.7
jean-pierre charras 5 years ago
parent
commit
c87faad344
  1. 7
      common/plotters/plotter_dxf.h
  2. 10
      include/plotter.h
  3. 4
      pcbnew/dialogs/dialog_plot.cpp
  4. 4
      pcbnew/exporters/gen_drill_report_files.cpp
  5. 2
      pcbnew/pcb_plot_params.cpp
  6. 6
      pcbnew/pcb_plot_params.h
  7. 3
      pcbnew/plot_board_layers.cpp

7
common/plotters/plotter_dxf.h

@ -119,13 +119,6 @@ public:
void* aData = NULL ) override;
// Must be in the same order as the drop-down list in the plot dialog inside pcbnew
enum class DXF_UNITS
{
INCHES = 0,
MILLIMETERS = 1
};
/**
* Set the units to use for plotting the DXF file.
*

10
include/plotter.h

@ -48,6 +48,16 @@ class GBR_NETLIST_METADATA;
using KIGFX::RENDER_SETTINGS;
// Must be in the same order as the drop-down list in the plot dialog inside pcbnew
// Units (inch/mm for DXF plotter
enum class DXF_UNITS
{
INCHES = 0,
MILLIMETERS = 1
};
/**
* The set of supported output plot formats.
*

4
pcbnew/dialogs/dialog_plot.cpp

@ -196,7 +196,7 @@ void DIALOG_PLOT::init_Dialog()
m_DXF_plotTextStrokeFontOpt->SetValue( m_plotOpts.GetTextMode() == PLOT_TEXT_MODE::DEFAULT );
// DXF units selection
m_DXF_plotUnits->SetSelection( static_cast<int>( m_plotOpts.GetDXFPlotUnits() ) );
m_DXF_plotUnits->SetSelection( m_plotOpts.GetDXFPlotUnits() == DXF_UNITS::INCHES ? 0 : 1);
// Plot mirror option
m_plotMirrorOpt->SetValue( m_plotOpts.GetMirror() );
@ -641,7 +641,7 @@ void DIALOG_PLOT::applyPlotSettings()
tempOptions.SetDXFPlotPolygonMode( m_DXF_plotModeOpt->GetValue() );
sel = m_DXF_plotUnits->GetSelection();
tempOptions.SetDXFPlotUnits( static_cast<DXF_PLOTTER::DXF_UNITS>( sel ) );
tempOptions.SetDXFPlotUnits( sel == 0 ? DXF_UNITS::INCHES : DXF_UNITS::MILLIMETERS );
tempOptions.SetPlotViaOnMaskLayer( m_plotNoViaOnMaskOpt->GetValue() );

4
pcbnew/exporters/gen_drill_report_files.cpp

@ -160,9 +160,9 @@ bool GENDRILL_WRITER_BASE::genDrillMapFile( const wxString& aFullFileName, PLOT_
DXF_PLOTTER* dxf_plotter = new DXF_PLOTTER;
if( m_unitsMetric )
dxf_plotter->SetUnits( DXF_PLOTTER::DXF_UNITS::MILLIMETERS );
dxf_plotter->SetUnits( DXF_UNITS::MILLIMETERS );
else
dxf_plotter->SetUnits( DXF_PLOTTER::DXF_UNITS::INCHES );
dxf_plotter->SetUnits( DXF_UNITS::INCHES );
plotter = dxf_plotter;
plotter->SetPageSettings( page_info );

2
pcbnew/pcb_plot_params.cpp

@ -111,7 +111,7 @@ PCB_PLOT_PARAMS::PCB_PLOT_PARAMS()
m_plotViaOnMaskLayer = false;
m_plotMode = FILLED;
m_DXFplotPolygonMode = true;
m_DXFplotUnits = DXF_PLOTTER::DXF_UNITS::INCHES;
m_DXFplotUnits = DXF_UNITS::INCHES;
m_useAuxOrigin = false;
m_HPGLPenNum = 1;
m_HPGLPenSpeed = 20; // this param is always in cm/s

6
pcbnew/pcb_plot_params.h

@ -64,7 +64,7 @@ private:
/**
* DXF format: Units to use when plotting the DXF
*/
DXF_PLOTTER::DXF_UNITS m_DXFplotUnits;
DXF_UNITS m_DXFplotUnits;
/// Plot format type (chooses the driver to be used)
PLOT_FORMAT m_format;
@ -229,12 +229,12 @@ public:
void SetDXFPlotPolygonMode( bool aFlag ) { m_DXFplotPolygonMode = aFlag; }
bool GetDXFPlotPolygonMode() const { return m_DXFplotPolygonMode; }
void SetDXFPlotUnits( DXF_PLOTTER::DXF_UNITS aUnit )
void SetDXFPlotUnits( DXF_UNITS aUnit )
{
m_DXFplotUnits = aUnit;
}
DXF_PLOTTER::DXF_UNITS GetDXFPlotUnits() const
DXF_UNITS GetDXFPlotUnits() const
{
return m_DXFplotUnits;
}

3
pcbnew/plot_board_layers.cpp

@ -1029,8 +1029,7 @@ PLOTTER* StartPlotBoard( BOARD *aBoard, PCB_PLOT_PARAMS *aPlotOpts, int aLayer,
case PLOT_FORMAT::DXF:
DXF_PLOTTER* DXF_plotter;
DXF_plotter = new DXF_PLOTTER();
DXF_plotter->SetUnits(
static_cast<DXF_PLOTTER::DXF_UNITS>( aPlotOpts->GetDXFPlotUnits() ) );
DXF_plotter->SetUnits( aPlotOpts->GetDXFPlotUnits() );
plotter = DXF_plotter;
break;

Loading…
Cancel
Save