diff --git a/common/plotters/DXF_plotter.cpp b/common/plotters/DXF_plotter.cpp index 222389a860..a1673190ad 100644 --- a/common/plotters/DXF_plotter.cpp +++ b/common/plotters/DXF_plotter.cpp @@ -122,18 +122,18 @@ static wxString getDXFColorName( COLOR4D aColor ) } -void DXF_PLOTTER::SetUnits( Units aUnit ) +void DXF_PLOTTER::SetUnits( DXF_UNITS aUnit ) { m_plotUnits = aUnit; switch( aUnit ) { - case MILIMETERS: + case DXF_UNIT_MILLIMETERS: m_unitScalingFactor = 0.00254; m_measurementDirective = 1; break; - case INCHES: + case DXF_UNIT_INCHES: default: m_unitScalingFactor = 0.0001; m_measurementDirective = 0; diff --git a/include/plotter.h b/include/plotter.h index ac06587861..aa57d64a26 100644 --- a/include/plotter.h +++ b/include/plotter.h @@ -1256,7 +1256,7 @@ public: textAsLines = true; m_currentColor = COLOR4D::BLACK; m_currentLineType = 0; - SetUnits( DXF_PLOTTER::INCHES ); + SetUnits( DXF_PLOTTER::DXF_UNIT_INCHES ); } virtual PlotFormat GetPlotterType() const override @@ -1340,11 +1340,11 @@ public: void* aData = NULL ) override; - // Should be the same order as in the PCB_PLOT_PARAMS class - enum Units + // Must be in the same order as the drop-down list in the plot dialog inside pcbnew + enum DXF_UNITS { - INCHES = 0, - MILIMETERS = 1 + DXF_UNIT_INCHES = 0, + DXF_UNIT_MILLIMETERS = 1 }; /** @@ -1352,14 +1352,14 @@ public: * * @param aUnit - The units to use */ - void SetUnits( Units aUnit ); + void SetUnits( DXF_UNITS aUnit ); /** * The units currently enabled for plotting * * @return The currently configured units */ - Units GetUnits() const + DXF_UNITS GetUnits() const { return m_plotUnits; } @@ -1390,7 +1390,7 @@ protected: COLOR4D m_currentColor; int m_currentLineType; - Units m_plotUnits; + DXF_UNITS m_plotUnits; double m_unitScalingFactor; unsigned int m_measurementDirective; }; diff --git a/pcbnew/dialogs/dialog_plot.cpp b/pcbnew/dialogs/dialog_plot.cpp index 036f61bf75..5808b3ccaa 100644 --- a/pcbnew/dialogs/dialog_plot.cpp +++ b/pcbnew/dialogs/dialog_plot.cpp @@ -573,7 +573,7 @@ void DIALOG_PLOT::applyPlotSettings() tempOptions.SetPlotMode( m_plotModeOpt->GetSelection() == 1 ? SKETCH : FILLED ); tempOptions.SetDXFPlotPolygonMode( m_DXF_plotModeOpt->GetValue() ); tempOptions.SetDXFPlotUnits( - static_cast( m_DXF_plotUnits->GetSelection() ) ); + static_cast( m_DXF_plotUnits->GetSelection() ) ); tempOptions.SetPlotViaOnMaskLayer( m_plotNoViaOnMaskOpt->GetValue() ); if( !m_DXF_plotTextStrokeFontOpt->IsEnabled() ) // Currently, only DXF supports this option diff --git a/pcbnew/pcb_plot_params.cpp b/pcbnew/pcb_plot_params.cpp index 0779352593..9e03c76bab 100644 --- a/pcbnew/pcb_plot_params.cpp +++ b/pcbnew/pcb_plot_params.cpp @@ -103,7 +103,7 @@ PCB_PLOT_PARAMS::PCB_PLOT_PARAMS() m_plotViaOnMaskLayer = false; m_plotMode = FILLED; m_DXFplotPolygonMode = true; - m_DXFplotUnits = INCHES; + m_DXFplotUnits = DXF_PLOTTER::DXF_UNIT_INCHES; m_useAuxOrigin = false; m_HPGLPenNum = 1; m_HPGLPenSpeed = 20; // this param is always in cm/s diff --git a/pcbnew/pcb_plot_params.h b/pcbnew/pcb_plot_params.h index cd92a80810..14d028761f 100644 --- a/pcbnew/pcb_plot_params.h +++ b/pcbnew/pcb_plot_params.h @@ -44,13 +44,6 @@ public: FULL_DRILL_SHAPE = 2 }; - // Must be in the same order as the drop-down list in the plot dialog - enum Units - { - INCHES = 0, - MILIMETERS = 1, - }; - private: // If true, do not plot NPTH pads // (mainly used to disable NPTH pads plotting on copper layers) @@ -70,7 +63,7 @@ private: /** * DXF format: Units to use when plotting the DXF */ - Units m_DXFplotUnits; + DXF_PLOTTER::DXF_UNITS m_DXFplotUnits; /// Plot format type (chooses the driver to be used) PlotFormat m_format; @@ -208,12 +201,12 @@ public: void SetDXFPlotPolygonMode( bool aFlag ) { m_DXFplotPolygonMode = aFlag; } bool GetDXFPlotPolygonMode() const { return m_DXFplotPolygonMode; } - void SetDXFPlotUnits( Units aUnit ) + void SetDXFPlotUnits( DXF_PLOTTER::DXF_UNITS aUnit ) { m_DXFplotUnits = aUnit; } - Units GetDXFPlotUnits() const + DXF_PLOTTER::DXF_UNITS GetDXFPlotUnits() const { return m_DXFplotUnits; } diff --git a/pcbnew/plot_board_layers.cpp b/pcbnew/plot_board_layers.cpp index 488fc7d126..98b1697d0a 100644 --- a/pcbnew/plot_board_layers.cpp +++ b/pcbnew/plot_board_layers.cpp @@ -1060,7 +1060,8 @@ PLOTTER* StartPlotBoard( BOARD *aBoard, PCB_PLOT_PARAMS *aPlotOpts, case PLOT_FORMAT_DXF: DXF_PLOTTER* DXF_plotter; DXF_plotter = new DXF_PLOTTER(); - DXF_plotter->SetUnits( static_cast( aPlotOpts->GetDXFPlotUnits() ) ); + DXF_plotter->SetUnits( + static_cast( aPlotOpts->GetDXFPlotUnits() ) ); plotter = DXF_plotter; break;