From eaa1e6d59464e8356d24afd1d29148335010f67a Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sun, 2 Mar 2025 11:34:30 +0100 Subject: [PATCH] Fix a collision with a Windows define and our use of the same var name. We use IN for INCH as units, but IN is defined in a Windows header --- 3d-viewer/dialogs/panel_preview_3d_model.cpp | 6 +++--- bitmap2component/bitmap2cmp_frame.cpp | 8 ++++---- bitmap2component/bitmap2cmp_panel.cpp | 4 ++-- common/eda_draw_frame.cpp | 6 +++--- common/eda_units.cpp | 18 +++++++++--------- common/jobs/job_export_pcb_3d.cpp | 2 +- common/jobs/job_export_pcb_3d.h | 2 +- common/jobs/job_export_pcb_drill.cpp | 4 ++-- common/jobs/job_export_pcb_drill.h | 2 +- common/jobs/job_export_pcb_dxf.cpp | 4 ++-- common/jobs/job_export_pcb_dxf.h | 2 +- common/jobs/job_export_pcb_odb.cpp | 2 +- common/jobs/job_export_pcb_odb.h | 2 +- common/jobs/job_export_pcb_pos.cpp | 2 +- common/jobs/job_export_pcb_pos.h | 2 +- common/jobs/job_rc.cpp | 2 +- common/jobs/job_rc.h | 2 +- common/libeval/numeric_evaluator.cpp | 2 +- common/plotters/DXF_plotter.cpp | 2 +- common/preview_items/preview_utils.cpp | 2 +- common/tool/actions.cpp | 2 +- common/tool/common_tools.cpp | 2 +- cvpcb/display_footprints_frame.cpp | 2 +- eeschema/eeschema_jobs_handler.cpp | 2 +- eeschema/sch_edit_frame.cpp | 2 +- eeschema/symbol_editor/symbol_edit_frame.cpp | 2 +- gerbview/gerbview_frame.cpp | 2 +- gerbview/toolbars_gerber.cpp | 2 +- gerbview/tools/gerbview_inspection_tool.cpp | 2 +- include/eda_units.h | 2 +- include/plotters/plotter.h | 2 +- include/plotters/plotter_dxf.h | 2 +- kicad/cli/command_pcb_drc.cpp | 2 +- kicad/cli/command_pcb_export_3d.cpp | 2 +- kicad/cli/command_pcb_export_drill.cpp | 2 +- kicad/cli/command_pcb_export_dxf.cpp | 2 +- kicad/cli/command_pcb_export_odb.cpp | 2 +- kicad/cli/command_pcb_export_pos.cpp | 2 +- kicad/cli/command_sch_erc.cpp | 2 +- pagelayout_editor/pl_editor_frame.cpp | 10 +++++----- pcbnew/api/api_pcb_enums.cpp | 4 ++-- pcbnew/board_design_settings.cpp | 2 +- pcbnew/dialogs/dialog_dimension_properties.cpp | 4 ++-- .../dialogs/dialog_gen_footprint_position.cpp | 10 +++++----- pcbnew/dialogs/dialog_gendrill.cpp | 4 ++-- pcbnew/dialogs/dialog_plot.cpp | 8 ++++---- pcbnew/dialogs/panel_setup_constraints.cpp | 18 +++++++++--------- pcbnew/exporters/gen_drill_report_files.cpp | 2 +- pcbnew/files.cpp | 2 +- pcbnew/footprint_chooser_frame.cpp | 2 +- pcbnew/footprint_edit_frame.cpp | 2 +- pcbnew/footprint_editor_settings.cpp | 4 ++-- pcbnew/footprint_viewer_frame.cpp | 2 +- pcbnew/pcb_dimension.cpp | 12 ++++++------ pcbnew/pcb_dimension.h | 2 +- pcbnew/pcb_edit_frame.cpp | 2 +- pcbnew/pcb_io/altium/altium_pcb.cpp | 4 ++-- .../cadstar/cadstar_pcb_archive_loader.cpp | 2 +- pcbnew/pcb_plot_params.cpp | 6 +++--- pcbnew/pcb_plotter.cpp | 4 ++-- pcbnew/pcbexpr_evaluator.cpp | 2 +- pcbnew/pcbnew_jobs_handler.cpp | 6 +++--- pcbnew/pcbnew_settings.cpp | 2 +- pcbnew/toolbars_pcb_editor.cpp | 2 +- pcbnew/tools/drawing_stackup_table_tool.cpp | 2 +- 65 files changed, 117 insertions(+), 117 deletions(-) diff --git a/3d-viewer/dialogs/panel_preview_3d_model.cpp b/3d-viewer/dialogs/panel_preview_3d_model.cpp index 4e2f826390..ceff53fcd6 100644 --- a/3d-viewer/dialogs/panel_preview_3d_model.cpp +++ b/3d-viewer/dialogs/panel_preview_3d_model.cpp @@ -286,7 +286,7 @@ wxString PANEL_PREVIEW_3D_MODEL::formatRotationValue( double aValue ) wxString PANEL_PREVIEW_3D_MODEL::formatOffsetValue( double aValue ) { // Convert from internal units (mm) to user units - if( m_userUnits == EDA_UNITS::IN ) + if( m_userUnits == EDA_UNITS::INCH ) aValue /= 25.4; else if( m_userUnits == EDA_UNITS::MILS ) aValue /= 25.4 / 1e3; @@ -511,7 +511,7 @@ void PANEL_PREVIEW_3D_MODEL::doIncrementOffset( wxSpinEvent& event, double aSign if( wxGetMouseState().ShiftDown( ) ) step_mm = OFFSET_INCREMENT_MM_FINE; - if( m_userUnits == EDA_UNITS::MILS || m_userUnits == EDA_UNITS::IN ) + if( m_userUnits == EDA_UNITS::MILS || m_userUnits == EDA_UNITS::INCH ) { step_mm = 25.4*OFFSET_INCREMENT_MIL/1000; @@ -586,7 +586,7 @@ void PANEL_PREVIEW_3D_MODEL::onMouseWheelOffset( wxMouseEvent& event ) if( event.ShiftDown( ) ) step_mm = OFFSET_INCREMENT_MM_FINE; - if( m_userUnits == EDA_UNITS::MILS || m_userUnits == EDA_UNITS::IN ) + if( m_userUnits == EDA_UNITS::MILS || m_userUnits == EDA_UNITS::INCH ) { step_mm = 25.4*OFFSET_INCREMENT_MIL/1000.0; diff --git a/bitmap2component/bitmap2cmp_frame.cpp b/bitmap2component/bitmap2cmp_frame.cpp index 90cd267fb2..9ca5b6279b 100644 --- a/bitmap2component/bitmap2cmp_frame.cpp +++ b/bitmap2component/bitmap2cmp_frame.cpp @@ -63,7 +63,7 @@ void IMAGE_SIZE::SetOutputSizeFromInitialImageSize() // Set the m_outputSize value from the m_originalSizePixels and the selected unit if( m_unit == EDA_UNITS::MM ) m_outputSize = (double)GetOriginalSizePixels() / m_originalDPI * 25.4; - else if( m_unit == EDA_UNITS::IN ) + else if( m_unit == EDA_UNITS::INCH ) m_outputSize = (double)GetOriginalSizePixels() / m_originalDPI; else m_outputSize = m_originalDPI; @@ -76,7 +76,7 @@ int IMAGE_SIZE::GetOutputDPI() if( m_unit == EDA_UNITS::MM ) outputDPI = GetOriginalSizePixels() / ( m_outputSize / 25.4 ); - else if( m_unit == EDA_UNITS::IN ) + else if( m_unit == EDA_UNITS::INCH ) outputDPI = GetOriginalSizePixels() / m_outputSize; else outputDPI = KiROUND( m_outputSize ); @@ -102,7 +102,7 @@ void IMAGE_SIZE::SetUnit( EDA_UNITS aUnit ) { size_mm = m_outputSize; } - else if( m_unit == EDA_UNITS::IN ) + else if( m_unit == EDA_UNITS::INCH ) { size_mm = m_outputSize * 25.4; } @@ -121,7 +121,7 @@ void IMAGE_SIZE::SetUnit( EDA_UNITS aUnit ) { m_outputSize = size_mm; } - else if( aUnit == EDA_UNITS::IN ) + else if( aUnit == EDA_UNITS::INCH ) { m_outputSize = size_mm / 25.4; } diff --git a/bitmap2component/bitmap2cmp_panel.cpp b/bitmap2component/bitmap2cmp_panel.cpp index d2da155228..ea88134a66 100644 --- a/bitmap2component/bitmap2cmp_panel.cpp +++ b/bitmap2component/bitmap2cmp_panel.cpp @@ -268,7 +268,7 @@ wxString BITMAP2CMP_PANEL::formatOutputSize( double aSize ) if( getUnitFromSelection() == EDA_UNITS::MM ) text.Printf( wxS( "%.1f" ), aSize ); - else if( getUnitFromSelection() == EDA_UNITS::IN ) + else if( getUnitFromSelection() == EDA_UNITS::INCH ) text.Printf( wxS( "%.2f" ), aSize ); else text.Printf( wxT( "%d" ), KiROUND( aSize ) ); @@ -295,7 +295,7 @@ EDA_UNITS BITMAP2CMP_PANEL::getUnitFromSelection() // return the EDA_UNITS from the m_PixelUnit choice switch( m_PixelUnit->GetSelection() ) { - case 1: return EDA_UNITS::IN; + case 1: return EDA_UNITS::INCH; case 2: return EDA_UNITS::UNSCALED; case 0: default: return EDA_UNITS::MM; diff --git a/common/eda_draw_frame.cpp b/common/eda_draw_frame.cpp index 830e6bc8f9..c332d8e107 100644 --- a/common/eda_draw_frame.cpp +++ b/common/eda_draw_frame.cpp @@ -320,7 +320,7 @@ void EDA_DRAW_FRAME::ToggleUserUnits() } else { - SetUserUnits( GetUserUnits() == EDA_UNITS::IN ? EDA_UNITS::MM : EDA_UNITS::IN ); + SetUserUnits( GetUserUnits() == EDA_UNITS::INCH ? EDA_UNITS::MM : EDA_UNITS::INCH ); unitsChangeRefresh(); wxCommandEvent e( EDA_EVT_UNITS_CHANGED ); @@ -678,7 +678,7 @@ void EDA_DRAW_FRAME::DisplayUnitsMsg() switch( GetUserUnits() ) { - case EDA_UNITS::IN: msg = _( "inches" ); break; + case EDA_UNITS::INCH: msg = _( "inches" ); break; case EDA_UNITS::MILS: msg = _( "mils" ); break; case EDA_UNITS::MM: msg = _( "mm" ); break; default: msg = _( "Units" ); break; @@ -1270,7 +1270,7 @@ void EDA_DRAW_FRAME::setupUnits( APP_SETTINGS_BASE* aCfg ) { default: case EDA_UNITS::MM: m_toolManager->RunAction( ACTIONS::millimetersUnits ); break; - case EDA_UNITS::IN: m_toolManager->RunAction( ACTIONS::inchesUnits ); break; + case EDA_UNITS::INCH: m_toolManager->RunAction( ACTIONS::inchesUnits ); break; case EDA_UNITS::MILS: m_toolManager->RunAction( ACTIONS::milsUnits ); break; } } diff --git a/common/eda_units.cpp b/common/eda_units.cpp index 2c15a196ab..309585f2bd 100644 --- a/common/eda_units.cpp +++ b/common/eda_units.cpp @@ -48,7 +48,7 @@ bool EDA_UNIT_UTILS::IsImperialUnit( EDA_UNITS aUnit ) { switch( aUnit ) { - case EDA_UNITS::IN: + case EDA_UNITS::INCH: case EDA_UNITS::MILS: return true; @@ -114,7 +114,7 @@ bool EDA_UNIT_UTILS::FetchUnitsFromString( const wxString& aTextValue, EDA_UNITS else if( unit == wxT( "mi" ) || unit == wxT( "th" ) ) // "mils" or "thou" aUnits = EDA_UNITS::MILS; else if( unit == wxT( "in" ) || unit == wxT( "\"" ) ) - aUnits = EDA_UNITS::IN; + aUnits = EDA_UNITS::INCH; else if( unit == wxT( "de" ) || unit == wxT( "ra" ) ) // "deg" or "rad" aUnits = EDA_UNITS::DEGREES; else @@ -135,7 +135,7 @@ wxString EDA_UNIT_UTILS::GetText( EDA_UNITS aUnits, EDA_DATA_TYPE aType ) case EDA_UNITS::CM: label = wxT( " cm" ); break; case EDA_UNITS::DEGREES: label = wxT( "°" ); break; case EDA_UNITS::MILS: label = wxT( " mils" ); break; - case EDA_UNITS::IN: label = wxT( " in" ); break; + case EDA_UNITS::INCH: label = wxT( " in" ); break; case EDA_UNITS::PERCENT: label = wxT( "%" ); break; case EDA_UNITS::UNSCALED: break; default: UNIMPLEMENTED_FOR( wxS( "Unknown units" ) ); break; @@ -267,7 +267,7 @@ double EDA_UNIT_UTILS::UI::ToUserUnit( const EDA_IU_SCALE& aIuScale, EDA_UNITS a case EDA_UNITS::MM: return IU_TO_MM( aValue, aIuScale ); case EDA_UNITS::CM: return IU_TO_MM( aValue, aIuScale ) / 10; case EDA_UNITS::MILS: return IU_TO_MILS( aValue, aIuScale ); - case EDA_UNITS::IN: return IU_TO_IN( aValue, aIuScale ); + case EDA_UNITS::INCH: return IU_TO_IN( aValue, aIuScale ); case EDA_UNITS::DEGREES: return aValue; default: return aValue; } @@ -305,7 +305,7 @@ wxString EDA_UNIT_UTILS::UI::StringFromValue( const EDA_IU_SCALE& aIuScale, EDA_ { case EDA_UNITS::MILS: format = is_eeschema ? wxT( "%.3f" ) : wxT( "%.5f" ); break; - case EDA_UNITS::IN: format = is_eeschema ? wxT( "%.6f" ) : wxT( "%.8f" ); break; + case EDA_UNITS::INCH: format = is_eeschema ? wxT( "%.6f" ) : wxT( "%.8f" ); break; case EDA_UNITS::DEGREES: format = wxT( "%.4f" ); break; default: format = wxT( "%.10f" ); break; } @@ -394,7 +394,7 @@ wxString EDA_UNIT_UTILS::UI::MessageTextFromValue( const EDA_IU_SCALE& aIuScale, case EDA_UNITS::MM: format = is_eeschema ? wxT( "%.2f" ) : wxT( "%.4f" ); break; case EDA_UNITS::CM: format = is_eeschema ? wxT( "%.3f" ) : wxT( "%.5f" ); break; case EDA_UNITS::MILS: format = is_eeschema ? wxT( "%.0f" ) : wxT( "%.2f" ); break; - case EDA_UNITS::IN: format = is_eeschema ? wxT( "%.3f" ) : wxT( "%.4f" ); break; + case EDA_UNITS::INCH: format = is_eeschema ? wxT( "%.3f" ) : wxT( "%.4f" ); break; case EDA_UNITS::DEGREES: format = wxT( "%.3f" ); break; case EDA_UNITS::UNSCALED: format = wxT( "%.0f" ); break; } @@ -448,7 +448,7 @@ double EDA_UNIT_UTILS::UI::FromUserUnit( const EDA_IU_SCALE& aIuScale, EDA_UNITS case EDA_UNITS::MM: return MM_TO_IU( aValue, aIuScale ); case EDA_UNITS::CM: return MM_TO_IU( aValue * 10, aIuScale ); case EDA_UNITS::MILS: return MILS_TO_IU( aValue, aIuScale ); - case EDA_UNITS::IN: return IN_TO_IU( aValue, aIuScale ); + case EDA_UNITS::INCH: return IN_TO_IU( aValue, aIuScale ); default: case EDA_UNITS::DEGREES: case EDA_UNITS::UNSCALED: @@ -532,7 +532,7 @@ double EDA_UNIT_UTILS::UI::DoubleValueFromString( const EDA_IU_SCALE& aIuScale, || aUnits == EDA_UNITS::MM || aUnits == EDA_UNITS::CM || aUnits == EDA_UNITS::MILS - || aUnits == EDA_UNITS::IN ) + || aUnits == EDA_UNITS::INCH ) { //check for um, μm (µ is MICRO SIGN) and µm (µ is GREEK SMALL LETTER MU) for micrometre if( unit == wxT( "um" ) || unit == wxT( "\u00B5m" ) || unit == wxT( "\u03BCm" ) ) @@ -553,7 +553,7 @@ double EDA_UNIT_UTILS::UI::DoubleValueFromString( const EDA_IU_SCALE& aIuScale, } else if( unit == wxT( "in" ) || unit == wxT( "\"" ) ) { - aUnits = EDA_UNITS::IN; + aUnits = EDA_UNITS::INCH; } else if( unit == wxT( "oz" ) ) // 1 oz = 1.37 mils { diff --git a/common/jobs/job_export_pcb_3d.cpp b/common/jobs/job_export_pcb_3d.cpp index cb6c69241d..792f5126fe 100644 --- a/common/jobs/job_export_pcb_3d.cpp +++ b/common/jobs/job_export_pcb_3d.cpp @@ -36,7 +36,7 @@ NLOHMANN_JSON_SERIALIZE_ENUM( JOB_EXPORT_PCB_3D::FORMAT, NLOHMANN_JSON_SERIALIZE_ENUM( JOB_EXPORT_PCB_3D::VRML_UNITS, { - { JOB_EXPORT_PCB_3D::VRML_UNITS::IN, "in" }, + { JOB_EXPORT_PCB_3D::VRML_UNITS::INCH, "in" }, { JOB_EXPORT_PCB_3D::VRML_UNITS::METERS, "m" }, { JOB_EXPORT_PCB_3D::VRML_UNITS::MM, "mm" }, { JOB_EXPORT_PCB_3D::VRML_UNITS::TENTHS, "tenths" }, diff --git a/common/jobs/job_export_pcb_3d.h b/common/jobs/job_export_pcb_3d.h index d6bcfd1e0f..8a714cfe64 100644 --- a/common/jobs/job_export_pcb_3d.h +++ b/common/jobs/job_export_pcb_3d.h @@ -125,7 +125,7 @@ public: enum class VRML_UNITS { - IN, + INCH, // Do not use IN: it conflicts with a Windows header MM, METERS, TENTHS // inches diff --git a/common/jobs/job_export_pcb_drill.cpp b/common/jobs/job_export_pcb_drill.cpp index 7e72f86448..7d4de1fc90 100644 --- a/common/jobs/job_export_pcb_drill.cpp +++ b/common/jobs/job_export_pcb_drill.cpp @@ -36,7 +36,7 @@ NLOHMANN_JSON_SERIALIZE_ENUM( JOB_EXPORT_PCB_DRILL::DRILL_ORIGIN, NLOHMANN_JSON_SERIALIZE_ENUM( JOB_EXPORT_PCB_DRILL::DRILL_UNITS, { - { JOB_EXPORT_PCB_DRILL::DRILL_UNITS::IN, "in" }, + { JOB_EXPORT_PCB_DRILL::DRILL_UNITS::INCH, "in" }, { JOB_EXPORT_PCB_DRILL::DRILL_UNITS::MM, "mm" }, } ) @@ -66,7 +66,7 @@ JOB_EXPORT_PCB_DRILL::JOB_EXPORT_PCB_DRILL() : m_excellonOvalDrillRoute( false ), m_format( DRILL_FORMAT::EXCELLON ), m_drillOrigin( DRILL_ORIGIN::ABS ), - m_drillUnits( DRILL_UNITS::IN ), + m_drillUnits( DRILL_UNITS::INCH ), m_zeroFormat( ZEROS_FORMAT::DECIMAL ), m_mapFormat( MAP_FORMAT::PDF ), m_gerberPrecision( 5 ), diff --git a/common/jobs/job_export_pcb_drill.h b/common/jobs/job_export_pcb_drill.h index c49cd47d60..3681c6b8c0 100644 --- a/common/jobs/job_export_pcb_drill.h +++ b/common/jobs/job_export_pcb_drill.h @@ -48,7 +48,7 @@ public: enum class DRILL_UNITS { - IN, + INCH, // Do not use IN: it conflicts with a Windows header MM }; diff --git a/common/jobs/job_export_pcb_dxf.cpp b/common/jobs/job_export_pcb_dxf.cpp index 6110407d60..31cab43b69 100644 --- a/common/jobs/job_export_pcb_dxf.cpp +++ b/common/jobs/job_export_pcb_dxf.cpp @@ -30,7 +30,7 @@ NLOHMANN_JSON_SERIALIZE_ENUM( JOB_EXPORT_PCB_DXF::GEN_MODE, NLOHMANN_JSON_SERIALIZE_ENUM( JOB_EXPORT_PCB_DXF::DXF_UNITS, { - { JOB_EXPORT_PCB_DXF::DXF_UNITS::IN, "in" }, + { JOB_EXPORT_PCB_DXF::DXF_UNITS::INCH, "in" }, { JOB_EXPORT_PCB_DXF::DXF_UNITS::MM, "mm" }, } ) @@ -38,7 +38,7 @@ JOB_EXPORT_PCB_DXF::JOB_EXPORT_PCB_DXF() : JOB_EXPORT_PCB_PLOT( JOB_EXPORT_PCB_PLOT::PLOT_FORMAT::DXF, "dxf", false ), m_plotGraphicItemsUsingContours( true ), m_polygonMode( true ), - m_dxfUnits( DXF_UNITS::IN ), + m_dxfUnits( DXF_UNITS::INCH ), m_genMode( GEN_MODE::MULTI ) { m_plotDrawingSheet = false; diff --git a/common/jobs/job_export_pcb_dxf.h b/common/jobs/job_export_pcb_dxf.h index f75521fc3a..f6a658fd5f 100644 --- a/common/jobs/job_export_pcb_dxf.h +++ b/common/jobs/job_export_pcb_dxf.h @@ -37,7 +37,7 @@ public: enum class DXF_UNITS { - IN, + INCH, // Do not use IN: it conflicts with a Windows header MM }; diff --git a/common/jobs/job_export_pcb_odb.cpp b/common/jobs/job_export_pcb_odb.cpp index 2b4fc0b832..5a243876db 100644 --- a/common/jobs/job_export_pcb_odb.cpp +++ b/common/jobs/job_export_pcb_odb.cpp @@ -24,7 +24,7 @@ NLOHMANN_JSON_SERIALIZE_ENUM( JOB_EXPORT_PCB_ODB::ODB_UNITS, { - { JOB_EXPORT_PCB_ODB::ODB_UNITS::IN, "in" }, + { JOB_EXPORT_PCB_ODB::ODB_UNITS::INCH, "in" }, { JOB_EXPORT_PCB_ODB::ODB_UNITS::MM, "mm" }, } ) diff --git a/common/jobs/job_export_pcb_odb.h b/common/jobs/job_export_pcb_odb.h index 4d2d46219c..9f599ddc0f 100644 --- a/common/jobs/job_export_pcb_odb.h +++ b/common/jobs/job_export_pcb_odb.h @@ -36,7 +36,7 @@ public: enum class ODB_UNITS { MM, - IN, + INCH, // Do not use IN: it conflicts with a Windows header }; enum class ODB_COMPRESSION diff --git a/common/jobs/job_export_pcb_pos.cpp b/common/jobs/job_export_pcb_pos.cpp index 3d0828423a..e264f56f39 100644 --- a/common/jobs/job_export_pcb_pos.cpp +++ b/common/jobs/job_export_pcb_pos.cpp @@ -39,7 +39,7 @@ NLOHMANN_JSON_SERIALIZE_ENUM( JOB_EXPORT_PCB_POS::SIDE, NLOHMANN_JSON_SERIALIZE_ENUM( JOB_EXPORT_PCB_POS::UNITS, { - { JOB_EXPORT_PCB_POS::UNITS::IN, "in" }, + { JOB_EXPORT_PCB_POS::UNITS::INCH, "in" }, { JOB_EXPORT_PCB_POS::UNITS::MM, "mm" }, } ) diff --git a/common/jobs/job_export_pcb_pos.h b/common/jobs/job_export_pcb_pos.h index 3ef35a66af..20f4f64475 100644 --- a/common/jobs/job_export_pcb_pos.h +++ b/common/jobs/job_export_pcb_pos.h @@ -44,7 +44,7 @@ public: enum class UNITS { - IN, + INCH, // Do not use IN: it conflicts with a Windows header MM }; diff --git a/common/jobs/job_rc.cpp b/common/jobs/job_rc.cpp index bdde645728..42c1c6eb1d 100644 --- a/common/jobs/job_rc.cpp +++ b/common/jobs/job_rc.cpp @@ -22,7 +22,7 @@ NLOHMANN_JSON_SERIALIZE_ENUM( JOB_RC::UNITS, { - { JOB_RC::UNITS::IN, "in" }, + { JOB_RC::UNITS::INCH, "in" }, { JOB_RC::UNITS::MM, "mm" }, { JOB_RC::UNITS::MILS, "mils" }, } ) diff --git a/common/jobs/job_rc.h b/common/jobs/job_rc.h index 9a565935f1..d5c0bfdc43 100644 --- a/common/jobs/job_rc.h +++ b/common/jobs/job_rc.h @@ -32,7 +32,7 @@ public: enum class UNITS { - IN, + INCH, // Do not use IN: it conflicts with a Windows header MM, MILS }; diff --git a/common/libeval/numeric_evaluator.cpp b/common/libeval/numeric_evaluator.cpp index ac55ea54e0..a780d91334 100644 --- a/common/libeval/numeric_evaluator.cpp +++ b/common/libeval/numeric_evaluator.cpp @@ -84,7 +84,7 @@ void NUMERIC_EVALUATOR::SetDefaultUnits( EDA_UNITS aUnits ) { case EDA_UNITS::MM: m_defaultUnits = Unit::MM; break; case EDA_UNITS::MILS: m_defaultUnits = Unit::Mil; break; - case EDA_UNITS::IN: m_defaultUnits = Unit::Inch; break; + case EDA_UNITS::INCH: m_defaultUnits = Unit::Inch; break; case EDA_UNITS::DEGREES: m_defaultUnits = Unit::Degrees; break; case EDA_UNITS::UNSCALED: m_defaultUnits = Unit::SI; break; default: m_defaultUnits = Unit::MM; break; diff --git a/common/plotters/DXF_plotter.cpp b/common/plotters/DXF_plotter.cpp index b748fb60ba..6b8e17793a 100644 --- a/common/plotters/DXF_plotter.cpp +++ b/common/plotters/DXF_plotter.cpp @@ -141,7 +141,7 @@ void DXF_PLOTTER::SetUnits( DXF_UNITS aUnit ) m_measurementDirective = 1; break; - case DXF_UNITS::IN: + case DXF_UNITS::INCH: default: m_unitScalingFactor = 0.0001; m_measurementDirective = 0; diff --git a/common/preview_items/preview_utils.cpp b/common/preview_items/preview_utils.cpp index d110df6c60..68d32e36b4 100644 --- a/common/preview_items/preview_utils.cpp +++ b/common/preview_items/preview_utils.cpp @@ -49,7 +49,7 @@ wxString KIGFX::PREVIEW::DimensionLabel( const wxString& prefix, double aVal, case EDA_UNITS::MM: fmtStr = wxT( "%.3f" ); break; // 1um case EDA_UNITS::CM: fmtStr = wxT( "%.4f" ); break; // 1um case EDA_UNITS::MILS: fmtStr = wxT( "%.1f" ); break; // 0.1mil - case EDA_UNITS::IN: fmtStr = wxT( "%.4f" ); break; // 0.1mil + case EDA_UNITS::INCH: fmtStr = wxT( "%.4f" ); break; // 0.1mil case EDA_UNITS::DEGREES: fmtStr = wxT( "%.1f" ); break; // 0.1deg case EDA_UNITS::PERCENT: fmtStr = wxT( "%.1f" ); break; // 0.1% case EDA_UNITS::UNSCALED: fmtStr = wxT( "%f" ); break; diff --git a/common/tool/actions.cpp b/common/tool/actions.cpp index 22932ea471..3e6374031a 100644 --- a/common/tool/actions.cpp +++ b/common/tool/actions.cpp @@ -973,7 +973,7 @@ TOOL_ACTION ACTIONS::inchesUnits( TOOL_ACTION_ARGS() .Icon( BITMAPS::unit_inch ) .ToolbarState( TOOLBAR_STATE::TOGGLE ) .Flags( AF_NONE ) - .Parameter( EDA_UNITS::IN ) ); + .Parameter( EDA_UNITS::INCH ) ); TOOL_ACTION ACTIONS::milsUnits( TOOL_ACTION_ARGS() .Name( "common.Control.mils" ) diff --git a/common/tool/common_tools.cpp b/common/tool/common_tools.cpp index ba4d94c953..65e5c944dc 100644 --- a/common/tool/common_tools.cpp +++ b/common/tool/common_tools.cpp @@ -50,7 +50,7 @@ COMMON_TOOLS::COMMON_TOOLS() : TOOL_INTERACTIVE( "common.Control" ), m_frame( nullptr ), - m_imperialUnit( EDA_UNITS::IN ), + m_imperialUnit( EDA_UNITS::INCH ), m_metricUnit( EDA_UNITS::MM ) { } diff --git a/cvpcb/display_footprints_frame.cpp b/cvpcb/display_footprints_frame.cpp index eeb65c4e30..ee090c83da 100644 --- a/cvpcb/display_footprints_frame.cpp +++ b/cvpcb/display_footprints_frame.cpp @@ -204,7 +204,7 @@ void DISPLAY_FOOTPRINTS_FRAME::setupUIConditions() mgr->SetConditions( ACTIONS::toggleCursorStyle, CHECK( cond.FullscreenCursor() ) ); mgr->SetConditions( ACTIONS::millimetersUnits, CHECK( cond.Units( EDA_UNITS::MM ) ) ); - mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::IN ) ) ); + mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::INCH ) ) ); mgr->SetConditions( ACTIONS::milsUnits, CHECK( cond.Units( EDA_UNITS::MILS ) ) ); mgr->SetConditions( PCB_ACTIONS::showPadNumbers, CHECK( cond.PadNumbersDisplay() ) ); diff --git a/eeschema/eeschema_jobs_handler.cpp b/eeschema/eeschema_jobs_handler.cpp index 1903c394ea..fc1680a628 100644 --- a/eeschema/eeschema_jobs_handler.cpp +++ b/eeschema/eeschema_jobs_handler.cpp @@ -1146,7 +1146,7 @@ int EESCHEMA_JOBS_HANDLER::JobSchErc( JOB* aJob ) switch( ercJob->m_units ) { - case JOB_SCH_ERC::UNITS::IN: units = EDA_UNITS::IN; break; + case JOB_SCH_ERC::UNITS::INCH: units = EDA_UNITS::INCH; break; case JOB_SCH_ERC::UNITS::MILS: units = EDA_UNITS::MILS; break; case JOB_SCH_ERC::UNITS::MM: units = EDA_UNITS::MM; break; default: units = EDA_UNITS::MM; break; diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index 546544337a..f1d98c7bcb 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -631,7 +631,7 @@ void SCH_EDIT_FRAME::setupUIConditions() mgr->SetConditions( ACTIONS::toggleGridOverrides, CHECK( cond.GridOverrides() ) ); mgr->SetConditions( ACTIONS::toggleCursorStyle, CHECK( cond.FullscreenCursor() ) ); mgr->SetConditions( ACTIONS::millimetersUnits, CHECK( cond.Units( EDA_UNITS::MM ) ) ); - mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::IN ) ) ); + mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::INCH ) ) ); mgr->SetConditions( ACTIONS::milsUnits, CHECK( cond.Units( EDA_UNITS::MILS ) ) ); mgr->SetConditions( EE_ACTIONS::lineModeFree, diff --git a/eeschema/symbol_editor/symbol_edit_frame.cpp b/eeschema/symbol_editor/symbol_edit_frame.cpp index 797451d2bf..2027d0a73b 100644 --- a/eeschema/symbol_editor/symbol_edit_frame.cpp +++ b/eeschema/symbol_editor/symbol_edit_frame.cpp @@ -488,7 +488,7 @@ void SYMBOL_EDIT_FRAME::setupUIConditions() mgr->SetConditions( ACTIONS::toggleGridOverrides, CHECK( cond.GridOverrides() ) ); mgr->SetConditions( ACTIONS::toggleCursorStyle, CHECK( cond.FullscreenCursor() ) ); mgr->SetConditions( ACTIONS::millimetersUnits, CHECK( cond.Units( EDA_UNITS::MM ) ) ); - mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::IN ) ) ); + mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::INCH ) ) ); mgr->SetConditions( ACTIONS::milsUnits, CHECK( cond.Units( EDA_UNITS::MILS ) ) ); mgr->SetConditions( ACTIONS::cut, ENABLE( isEditableCond ) ); diff --git a/gerbview/gerbview_frame.cpp b/gerbview/gerbview_frame.cpp index 97dd77f32c..6046bc8b8c 100644 --- a/gerbview/gerbview_frame.cpp +++ b/gerbview/gerbview_frame.cpp @@ -1136,7 +1136,7 @@ void GERBVIEW_FRAME::setupUIConditions() mgr->SetConditions( ACTIONS::toggleCursorStyle, CHECK( cond.FullscreenCursor() ) ); mgr->SetConditions( ACTIONS::millimetersUnits, CHECK( cond.Units( EDA_UNITS::MM ) ) ); - mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::IN ) ) ); + mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::INCH ) ) ); mgr->SetConditions( ACTIONS::milsUnits, CHECK( cond.Units( EDA_UNITS::MILS ) ) ); auto flashedDisplayOutlinesCond = diff --git a/gerbview/toolbars_gerber.cpp b/gerbview/toolbars_gerber.cpp index c90b3cb019..d5a12f248b 100644 --- a/gerbview/toolbars_gerber.cpp +++ b/gerbview/toolbars_gerber.cpp @@ -313,7 +313,7 @@ void GERBVIEW_FRAME::updateDCodeSelectBox() units = wxT( "mm" ); break; - case EDA_UNITS::IN: + case EDA_UNITS::INCH: scale = gerbIUScale.IU_PER_MILS * 1000; units = wxT( "in" ); break; diff --git a/gerbview/tools/gerbview_inspection_tool.cpp b/gerbview/tools/gerbview_inspection_tool.cpp index 773012c987..7f5d41a52b 100644 --- a/gerbview/tools/gerbview_inspection_tool.cpp +++ b/gerbview/tools/gerbview_inspection_tool.cpp @@ -83,7 +83,7 @@ int GERBVIEW_INSPECTION_TOOL::ShowDCodes( const TOOL_EVENT& aEvent ) units = wxT( "mm" ); break; - case EDA_UNITS::IN: + case EDA_UNITS::INCH: scale = gerbIUScale.IU_PER_MILS * 1000; units = wxT( "in" ); break; diff --git a/include/eda_units.h b/include/eda_units.h index 1548e668ef..6d8629f0fe 100644 --- a/include/eda_units.h +++ b/include/eda_units.h @@ -44,7 +44,7 @@ enum class EDA_DATA_TYPE enum class EDA_UNITS { - IN = 0, + INCH = 0, // Do not use IN: it conflicts with a Windows header MM = 1, UNSCALED = 2, DEGREES = 3, diff --git a/include/plotters/plotter.h b/include/plotters/plotter.h index edf95443e7..4e77e6402e 100644 --- a/include/plotters/plotter.h +++ b/include/plotters/plotter.h @@ -51,7 +51,7 @@ using KIGFX::RENDER_SETTINGS; // Units (inch/mm for DXF plotter enum class DXF_UNITS { - IN = 0, + INCH = 0, // Do not use MM: it conficts with a Windows header MM = 1 }; diff --git a/include/plotters/plotter_dxf.h b/include/plotters/plotter_dxf.h index bb6eae4d86..9ccbc13fb2 100644 --- a/include/plotters/plotter_dxf.h +++ b/include/plotters/plotter_dxf.h @@ -31,7 +31,7 @@ public: m_textAsLines = true; m_currentColor = COLOR4D::BLACK; m_currentLineType = LINE_STYLE::SOLID; - SetUnits( DXF_UNITS::IN ); + SetUnits( DXF_UNITS::INCH ); } virtual PLOT_FORMAT GetPlotterType() const override diff --git a/kicad/cli/command_pcb_drc.cpp b/kicad/cli/command_pcb_drc.cpp index 1e18e3d038..56e8470a52 100644 --- a/kicad/cli/command_pcb_drc.cpp +++ b/kicad/cli/command_pcb_drc.cpp @@ -135,7 +135,7 @@ int CLI::PCB_DRC_COMMAND::doPerform( KIWAY& aKiway ) } else if( units == wxS( "in" ) ) { - drcJob->m_units = JOB_PCB_DRC::UNITS::IN; + drcJob->m_units = JOB_PCB_DRC::UNITS::INCH; } else if( units == wxS( "mils" ) ) { diff --git a/kicad/cli/command_pcb_export_3d.cpp b/kicad/cli/command_pcb_export_3d.cpp index 4fb5ce8972..35244a9464 100644 --- a/kicad/cli/command_pcb_export_3d.cpp +++ b/kicad/cli/command_pcb_export_3d.cpp @@ -281,7 +281,7 @@ int CLI::PCB_EXPORT_3D_COMMAND::doPerform( KIWAY& aKiway ) wxString units = From_UTF8( m_argParser.get( ARG_VRML_UNITS ).c_str() ); if( units == wxS( "in" ) ) - step->m_vrmlUnits = JOB_EXPORT_PCB_3D::VRML_UNITS::IN; + step->m_vrmlUnits = JOB_EXPORT_PCB_3D::VRML_UNITS::INCH; else if( units == wxS( "mm" ) ) step->m_vrmlUnits = JOB_EXPORT_PCB_3D::VRML_UNITS::MM; else if( units == wxS( "m" ) ) diff --git a/kicad/cli/command_pcb_export_drill.cpp b/kicad/cli/command_pcb_export_drill.cpp index cc9003cd13..43b0c710c6 100644 --- a/kicad/cli/command_pcb_export_drill.cpp +++ b/kicad/cli/command_pcb_export_drill.cpp @@ -148,7 +148,7 @@ int CLI::PCB_EXPORT_DRILL_COMMAND::doPerform( KIWAY& aKiway ) } else if( units == wxS( "in" ) ) { - drillJob->m_drillUnits = JOB_EXPORT_PCB_DRILL::DRILL_UNITS::IN; + drillJob->m_drillUnits = JOB_EXPORT_PCB_DRILL::DRILL_UNITS::INCH; } else { diff --git a/kicad/cli/command_pcb_export_dxf.cpp b/kicad/cli/command_pcb_export_dxf.cpp index da5e006a69..ea30c4d94f 100644 --- a/kicad/cli/command_pcb_export_dxf.cpp +++ b/kicad/cli/command_pcb_export_dxf.cpp @@ -147,7 +147,7 @@ int CLI::PCB_EXPORT_DXF_COMMAND::doPerform( KIWAY& aKiway ) } else if( units == wxS( "in" ) ) { - dxfJob->m_dxfUnits = JOB_EXPORT_PCB_DXF::DXF_UNITS::IN; + dxfJob->m_dxfUnits = JOB_EXPORT_PCB_DXF::DXF_UNITS::INCH; } else { diff --git a/kicad/cli/command_pcb_export_odb.cpp b/kicad/cli/command_pcb_export_odb.cpp index 3f558c15dc..ae55f309e8 100644 --- a/kicad/cli/command_pcb_export_odb.cpp +++ b/kicad/cli/command_pcb_export_odb.cpp @@ -85,7 +85,7 @@ int CLI::PCB_EXPORT_ODB_COMMAND::doPerform( KIWAY& aKiway ) if( units == "mm" ) job->m_units = JOB_EXPORT_PCB_ODB::ODB_UNITS::MM; else if( units == "in" ) - job->m_units = JOB_EXPORT_PCB_ODB::ODB_UNITS::IN; + job->m_units = JOB_EXPORT_PCB_ODB::ODB_UNITS::INCH; wxString compression = From_UTF8( m_argParser.get( ARG_COMPRESS ).c_str() ).Lower(); diff --git a/kicad/cli/command_pcb_export_pos.cpp b/kicad/cli/command_pcb_export_pos.cpp index 82ffb4b5ac..ef8ebead95 100644 --- a/kicad/cli/command_pcb_export_pos.cpp +++ b/kicad/cli/command_pcb_export_pos.cpp @@ -144,7 +144,7 @@ int CLI::PCB_EXPORT_POS_COMMAND::doPerform( KIWAY& aKiway ) } else if( units == wxS( "in" ) ) { - aPosJob->m_units = JOB_EXPORT_PCB_POS::UNITS::IN; + aPosJob->m_units = JOB_EXPORT_PCB_POS::UNITS::INCH; } else { diff --git a/kicad/cli/command_sch_erc.cpp b/kicad/cli/command_sch_erc.cpp index 449b57f174..a2ebe8227e 100644 --- a/kicad/cli/command_sch_erc.cpp +++ b/kicad/cli/command_sch_erc.cpp @@ -122,7 +122,7 @@ int CLI::SCH_ERC_COMMAND::doPerform( KIWAY& aKiway ) } else if( units == wxS( "in" ) ) { - ercJob->m_units = JOB_SCH_ERC::UNITS::IN; + ercJob->m_units = JOB_SCH_ERC::UNITS::INCH; } else if( units == wxS( "mils" ) ) { diff --git a/pagelayout_editor/pl_editor_frame.cpp b/pagelayout_editor/pl_editor_frame.cpp index e4add66f4d..77806bf7ae 100644 --- a/pagelayout_editor/pl_editor_frame.cpp +++ b/pagelayout_editor/pl_editor_frame.cpp @@ -304,7 +304,7 @@ void PL_EDITOR_FRAME::setupUIConditions() mgr->SetConditions( ACTIONS::toggleGrid, CHECK( cond.GridVisible() ) ); mgr->SetConditions( ACTIONS::toggleCursorStyle, CHECK( cond.FullscreenCursor() ) ); mgr->SetConditions( ACTIONS::millimetersUnits, CHECK( cond.Units( EDA_UNITS::MM ) ) ); - mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::IN ) ) ); + mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::INCH ) ) ); mgr->SetConditions( ACTIONS::milsUnits, CHECK( cond.Units( EDA_UNITS::MILS ) ) ); mgr->SetConditions( ACTIONS::cut, ENABLE( SELECTION_CONDITIONS::NotEmpty ) ); @@ -705,9 +705,9 @@ void PL_EDITOR_FRAME::DisplayGridMsg() switch( GetUserUnits() ) { - case EDA_UNITS::IN: gridformatter = wxS( "grid %.3f" ); break; - case EDA_UNITS::MM: gridformatter = wxS( "grid %.4f" ); break; - default: gridformatter = wxS( "grid %f" ); break; + case EDA_UNITS::INCH: gridformatter = wxS( "grid %.3f" ); break; + case EDA_UNITS::MM: gridformatter = wxS( "grid %.4f" ); break; + default: gridformatter = wxS( "grid %f" ); break; } double grid = EDA_UNIT_UTILS::UI::ToUserUnit( drawSheetIUScale, GetUserUnits(), @@ -767,7 +767,7 @@ void PL_EDITOR_FRAME::UpdateStatusBar() switch( GetUserUnits() ) { - case EDA_UNITS::IN: SetStatusText( _( "inches" ), 6 ); break; + case EDA_UNITS::INCH: SetStatusText( _( "inches" ), 6 ); break; case EDA_UNITS::MILS: SetStatusText( _( "mils" ), 6 ); break; case EDA_UNITS::MM: SetStatusText( _( "mm" ), 6 ); break; case EDA_UNITS::UNSCALED: SetStatusText( wxEmptyString, 6 ); break; diff --git a/pcbnew/api/api_pcb_enums.cpp b/pcbnew/api/api_pcb_enums.cpp index 3b5939a89e..5418a955d7 100644 --- a/pcbnew/api/api_pcb_enums.cpp +++ b/pcbnew/api/api_pcb_enums.cpp @@ -641,7 +641,7 @@ types::DimensionUnit ToProtoEnum( DIM_UNITS_MODE aValue ) { switch( aValue ) { - case DIM_UNITS_MODE::IN: return types::DimensionUnit::DU_INCHES; + case DIM_UNITS_MODE::INCH: return types::DimensionUnit::DU_INCHES; case DIM_UNITS_MODE::MILS: return types::DimensionUnit::DU_MILS; case DIM_UNITS_MODE::MM: return types::DimensionUnit::DU_MILLIMETERS; case DIM_UNITS_MODE::AUTOMATIC: return types::DimensionUnit::DU_AUTOMATIC; @@ -658,7 +658,7 @@ DIM_UNITS_MODE FromProtoEnum( types::DimensionUnit aValue ) { switch( aValue ) { - case types::DimensionUnit::DU_INCHES: return DIM_UNITS_MODE::IN; + case types::DimensionUnit::DU_INCHES: return DIM_UNITS_MODE::INCH; case types::DimensionUnit::DU_MILS: return DIM_UNITS_MODE::MILS; case types::DimensionUnit::DU_MILLIMETERS: return DIM_UNITS_MODE::MM; case types::DimensionUnit::DU_UNKNOWN: diff --git a/pcbnew/board_design_settings.cpp b/pcbnew/board_design_settings.cpp index 01b0725951..be440e722a 100644 --- a/pcbnew/board_design_settings.cpp +++ b/pcbnew/board_design_settings.cpp @@ -813,7 +813,7 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS( JSON_SETTINGS* aParent, const std: &m_TextUpright[LAYER_CLASS_OTHERS], true ) ); m_params.emplace_back( new PARAM_ENUM( "defaults.dimension_units", - &m_DimensionUnitsMode, DIM_UNITS_MODE::AUTOMATIC, DIM_UNITS_MODE::IN, + &m_DimensionUnitsMode, DIM_UNITS_MODE::AUTOMATIC, DIM_UNITS_MODE::INCH, DIM_UNITS_MODE::AUTOMATIC ) ); m_params.emplace_back( new PARAM_ENUM( "defaults.dimension_precision", diff --git a/pcbnew/dialogs/dialog_dimension_properties.cpp b/pcbnew/dialogs/dialog_dimension_properties.cpp index 522615d587..914d41195f 100644 --- a/pcbnew/dialogs/dialog_dimension_properties.cpp +++ b/pcbnew/dialogs/dialog_dimension_properties.cpp @@ -205,7 +205,7 @@ bool DIALOG_DIMENSION_PROPERTIES::TransferDataToWindow() switch( m_dimension->GetUnitsMode() ) { - case DIM_UNITS_MODE::IN: m_cbUnits->SetSelection( 0 ); break; + case DIM_UNITS_MODE::INCH: m_cbUnits->SetSelection( 0 ); break; case DIM_UNITS_MODE::MILS: m_cbUnits->SetSelection( 1 ); break; case DIM_UNITS_MODE::MM: m_cbUnits->SetSelection( 2 ); break; case DIM_UNITS_MODE::AUTOMATIC: m_cbUnits->SetSelection( 3 ); break; @@ -396,7 +396,7 @@ void DIALOG_DIMENSION_PROPERTIES::updateDimensionFromDialog( PCB_DIMENSION_BASE* switch( m_cbUnits->GetSelection() ) { - case 0: aTarget->SetUnitsMode( DIM_UNITS_MODE::IN ); break; + case 0: aTarget->SetUnitsMode( DIM_UNITS_MODE::INCH ); break; case 1: aTarget->SetUnitsMode( DIM_UNITS_MODE::MILS ); break; case 2: aTarget->SetUnitsMode( DIM_UNITS_MODE::MM ); break; case 3: aTarget->SetUnitsMode( DIM_UNITS_MODE::AUTOMATIC ); break; diff --git a/pcbnew/dialogs/dialog_gen_footprint_position.cpp b/pcbnew/dialogs/dialog_gen_footprint_position.cpp index 0b3183a7e4..8e517af981 100644 --- a/pcbnew/dialogs/dialog_gen_footprint_position.cpp +++ b/pcbnew/dialogs/dialog_gen_footprint_position.cpp @@ -90,7 +90,7 @@ void DIALOG_GEN_FOOTPRINT_POSITION::initDialog() PROJECT_FILE& projectFile = m_editFrame->Prj().GetProjectFile(); PCBNEW_SETTINGS* cfg = m_editFrame->GetPcbNewSettings(); - m_units = cfg->m_PlaceFile.units == 0 ? EDA_UNITS::IN : EDA_UNITS::MM; + m_units = cfg->m_PlaceFile.units == 0 ? EDA_UNITS::INCH : EDA_UNITS::MM; // Output directory m_outputDirectoryName->SetValue( projectFile.m_PcbLastPath[LAST_PATH_POS_FILES] ); @@ -113,7 +113,7 @@ void DIALOG_GEN_FOOTPRINT_POSITION::initDialog() SetTitle( m_job->GetSettingsDialogTitle() ); m_browseButton->Hide(); - m_units = m_job->m_units == JOB_EXPORT_PCB_POS::UNITS::IN ? EDA_UNITS::IN : EDA_UNITS::MM; + m_units = m_job->m_units == JOB_EXPORT_PCB_POS::UNITS::INCH ? EDA_UNITS::INCH : EDA_UNITS::MM; m_staticTextDir->SetLabel( _( "Output file:" ) ); m_outputDirectoryName->SetValue( m_job->GetConfiguredOutputPath() ); @@ -264,7 +264,7 @@ void DIALOG_GEN_FOOTPRINT_POSITION::onGenerate( wxCommandEvent& event ) { if( !m_job ) { - m_units = m_unitsCtrl->GetSelection() == 0 ? EDA_UNITS::IN : EDA_UNITS::MM; + m_units = m_unitsCtrl->GetSelection() == 0 ? EDA_UNITS::INCH : EDA_UNITS::MM; PCBNEW_SETTINGS* cfg = m_editFrame->GetPcbNewSettings(); @@ -274,7 +274,7 @@ void DIALOG_GEN_FOOTPRINT_POSITION::onGenerate( wxCommandEvent& event ) m_editFrame->Prj().GetProjectFile().m_PcbLastPath[LAST_PATH_POS_FILES] = dirStr; cfg->m_PlaceFile.output_directory = dirStr; - cfg->m_PlaceFile.units = m_units == EDA_UNITS::IN ? 0 : 1; + cfg->m_PlaceFile.units = m_units == EDA_UNITS::INCH ? 0 : 1; cfg->m_PlaceFile.file_options = m_singleFile->GetValue() ? 1 : 0; cfg->m_PlaceFile.file_format = m_formatCtrl->GetSelection(); cfg->m_PlaceFile.include_board_edge = m_cbIncludeBoardEdge->GetValue(); @@ -291,7 +291,7 @@ void DIALOG_GEN_FOOTPRINT_POSITION::onGenerate( wxCommandEvent& event ) else { m_job->SetConfiguredOutputPath( m_outputDirectoryName->GetValue() ); - m_job->m_units = m_unitsCtrl->GetSelection() == 0 ? JOB_EXPORT_PCB_POS::UNITS::IN + m_job->m_units = m_unitsCtrl->GetSelection() == 0 ? JOB_EXPORT_PCB_POS::UNITS::INCH : JOB_EXPORT_PCB_POS::UNITS::MM; m_job->m_format = static_cast( m_formatCtrl->GetSelection() ); m_job->m_side = JOB_EXPORT_PCB_POS::SIDE::BOTH; diff --git a/pcbnew/dialogs/dialog_gendrill.cpp b/pcbnew/dialogs/dialog_gendrill.cpp index 04ee08d8bd..67c6d19567 100644 --- a/pcbnew/dialogs/dialog_gendrill.cpp +++ b/pcbnew/dialogs/dialog_gendrill.cpp @@ -139,7 +139,7 @@ bool DIALOG_GENDRILL::TransferDataFromWindow() m_job->m_format = m_rbExcellon->GetValue() ? JOB_EXPORT_PCB_DRILL::DRILL_FORMAT::EXCELLON : JOB_EXPORT_PCB_DRILL::DRILL_FORMAT::GERBER; m_job->m_drillUnits = m_units->GetSelection() == 0 ? JOB_EXPORT_PCB_DRILL::DRILL_UNITS::MM - : JOB_EXPORT_PCB_DRILL::DRILL_UNITS::IN; + : JOB_EXPORT_PCB_DRILL::DRILL_UNITS::INCH; m_job->m_drillOrigin = static_cast( m_origin->GetSelection() ); m_job->m_excellonCombinePTHNPTH = m_Check_Merge_PTH_NPTH->IsChecked(); m_job->m_excellonMinimalHeader = m_Check_Minimal->IsChecked(); @@ -185,7 +185,7 @@ bool DIALOG_GENDRILL::TransferDataToWindow() m_rbExcellon->SetValue( m_job->m_format == JOB_EXPORT_PCB_DRILL::DRILL_FORMAT::EXCELLON ); m_rbGerberX2->SetValue( m_job->m_format == JOB_EXPORT_PCB_DRILL::DRILL_FORMAT::GERBER ); - m_units->SetSelection( m_job->m_drillUnits == JOB_EXPORT_PCB_DRILL::DRILL_UNITS::IN ); + m_units->SetSelection( m_job->m_drillUnits == JOB_EXPORT_PCB_DRILL::DRILL_UNITS::INCH ); m_zeros->SetSelection( static_cast( m_job->m_zeroFormat ) ); updatePrecisionOptions(); m_Check_Minimal->SetValue( m_job->m_excellonMinimalHeader ); diff --git a/pcbnew/dialogs/dialog_plot.cpp b/pcbnew/dialogs/dialog_plot.cpp index 88541274ab..068c31e900 100644 --- a/pcbnew/dialogs/dialog_plot.cpp +++ b/pcbnew/dialogs/dialog_plot.cpp @@ -403,7 +403,7 @@ void DIALOG_PLOT::init_Dialog() == PLOT_TEXT_MODE::DEFAULT ); // DXF units selection - m_DXF_plotUnits->SetSelection( m_plotOpts.GetDXFPlotUnits() == DXF_UNITS::IN ? 0 : 1 ); + m_DXF_plotUnits->SetSelection( m_plotOpts.GetDXFPlotUnits() == DXF_UNITS::INCH ? 0 : 1 ); // Plot mirror option m_plotMirrorOpt->SetValue( m_plotOpts.GetMirror() ); @@ -451,8 +451,8 @@ void DIALOG_PLOT::transferPlotParamsToJob() if( m_job->m_plotFormat == JOB_EXPORT_PCB_PLOT::PLOT_FORMAT::DXF ) { JOB_EXPORT_PCB_DXF* dxfJob = static_cast( m_job ); - dxfJob->m_dxfUnits = m_plotOpts.GetDXFPlotUnits() == DXF_UNITS::IN - ? JOB_EXPORT_PCB_DXF::DXF_UNITS::IN + dxfJob->m_dxfUnits = m_plotOpts.GetDXFPlotUnits() == DXF_UNITS::INCH + ? JOB_EXPORT_PCB_DXF::DXF_UNITS::INCH : JOB_EXPORT_PCB_DXF::DXF_UNITS::MM; dxfJob->m_plotGraphicItemsUsingContours = m_plotOpts.GetPlotMode() == OUTLINE_MODE::SKETCH; dxfJob->m_polygonMode = m_plotOpts.GetDXFPlotPolygonMode(); @@ -1053,7 +1053,7 @@ void DIALOG_PLOT::applyPlotSettings() tempOptions.SetDXFPlotPolygonMode( m_DXF_plotModeOpt->GetValue() ); sel = m_DXF_plotUnits->GetSelection(); - tempOptions.SetDXFPlotUnits( sel == 0 ? DXF_UNITS::IN : DXF_UNITS::MM ); + tempOptions.SetDXFPlotUnits( sel == 0 ? DXF_UNITS::INCH : DXF_UNITS::MM ); if( !m_DXF_plotTextStrokeFontOpt->IsEnabled() ) // Currently, only DXF supports this option tempOptions.SetTextMode( PLOT_TEXT_MODE::DEFAULT ); diff --git a/pcbnew/dialogs/panel_setup_constraints.cpp b/pcbnew/dialogs/panel_setup_constraints.cpp index 2bff75b721..3e99d02a9f 100644 --- a/pcbnew/dialogs/panel_setup_constraints.cpp +++ b/pcbnew/dialogs/panel_setup_constraints.cpp @@ -124,34 +124,34 @@ bool PANEL_SETUP_CONSTRAINTS::TransferDataToWindow() bool PANEL_SETUP_CONSTRAINTS::TransferDataFromWindow() { - if( !m_minClearance.Validate( 0, 10, EDA_UNITS::IN ) ) + if( !m_minClearance.Validate( 0, 10, EDA_UNITS::INCH ) ) return false; - if( !m_minConn.Validate( 0, 10, EDA_UNITS::IN ) ) + if( !m_minConn.Validate( 0, 10, EDA_UNITS::INCH ) ) return false; - if( !m_trackMinWidth.Validate( 0, 10, EDA_UNITS::IN ) ) + if( !m_trackMinWidth.Validate( 0, 10, EDA_UNITS::INCH ) ) return false; - if( !m_viaMinAnnulus.Validate( 0, 10, EDA_UNITS::IN ) ) + if( !m_viaMinAnnulus.Validate( 0, 10, EDA_UNITS::INCH ) ) return false; - if( !m_viaMinSize.Validate( 0, 10, EDA_UNITS::IN ) ) + if( !m_viaMinSize.Validate( 0, 10, EDA_UNITS::INCH ) ) return false; - if( !m_holeClearance.Validate( 0, 10, EDA_UNITS::IN ) ) + if( !m_holeClearance.Validate( 0, 10, EDA_UNITS::INCH ) ) return false; - if( !m_edgeClearance.Validate( 0, 10, EDA_UNITS::IN ) ) + if( !m_edgeClearance.Validate( 0, 10, EDA_UNITS::INCH ) ) return false; - if( !m_minGrooveWidth.Validate( 0, 10, EDA_UNITS::IN ) ) + if( !m_minGrooveWidth.Validate( 0, 10, EDA_UNITS::INCH ) ) return false; if( !m_throughHoleMin.Validate( 2, 1000, EDA_UNITS::MILS ) ) // #107 to 1 inch return false; - if( !m_holeToHoleMin.Validate( 0, 10, EDA_UNITS::IN ) ) + if( !m_holeToHoleMin.Validate( 0, 10, EDA_UNITS::INCH ) ) return false; // These are all stored in project file, not board, so no need for OnModify() diff --git a/pcbnew/exporters/gen_drill_report_files.cpp b/pcbnew/exporters/gen_drill_report_files.cpp index 6ac4b2a4d5..13e35731b4 100644 --- a/pcbnew/exporters/gen_drill_report_files.cpp +++ b/pcbnew/exporters/gen_drill_report_files.cpp @@ -179,7 +179,7 @@ bool GENDRILL_WRITER_BASE::genDrillMapFile( const wxString& aFullFileName, PLOT_ { DXF_PLOTTER* dxf_plotter = new DXF_PLOTTER; - dxf_plotter->SetUnits( m_unitsMetric ? DXF_UNITS::MM : DXF_UNITS::IN ); + dxf_plotter->SetUnits( m_unitsMetric ? DXF_UNITS::MM : DXF_UNITS::INCH ); plotter = dxf_plotter; plotter->SetPageSettings( page_info ); diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp index edf4e59593..13cbcf16bf 100644 --- a/pcbnew/files.cpp +++ b/pcbnew/files.cpp @@ -1443,7 +1443,7 @@ void PCB_EDIT_FRAME::GenODBPPFiles( wxCommandEvent& event ) job.m_precision = dlg.GetPrecision(); job.m_units = dlg.GetUnitsString() == "mm" ? JOB_EXPORT_PCB_ODB::ODB_UNITS::MM - : JOB_EXPORT_PCB_ODB::ODB_UNITS::IN; + : JOB_EXPORT_PCB_ODB::ODB_UNITS::INCH; WX_PROGRESS_REPORTER progressReporter( this, _( "Generating ODB++ output files" ), 3, false ); WX_STRING_REPORTER reporter; diff --git a/pcbnew/footprint_chooser_frame.cpp b/pcbnew/footprint_chooser_frame.cpp index 59c296e945..506903cc9c 100644 --- a/pcbnew/footprint_chooser_frame.cpp +++ b/pcbnew/footprint_chooser_frame.cpp @@ -772,7 +772,7 @@ void FOOTPRINT_CHOOSER_FRAME::setupUIConditions() mgr->SetConditions( ACTIONS::toggleCursorStyle, CHECK( cond.FullscreenCursor() ) ); mgr->SetConditions( ACTIONS::millimetersUnits, CHECK( cond.Units( EDA_UNITS::MM ) ) ); - mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::IN ) ) ); + mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::INCH ) ) ); mgr->SetConditions( ACTIONS::milsUnits, CHECK( cond.Units( EDA_UNITS::MILS ) ) ); mgr->SetConditions( PCB_ACTIONS::showPadNumbers, CHECK( cond.PadNumbersDisplay() ) ); diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index 81f547c12b..7f516d5167 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -1255,7 +1255,7 @@ void FOOTPRINT_EDIT_FRAME::setupUIConditions() mgr->SetConditions( ACTIONS::toggleGridOverrides, CHECK( cond.GridOverrides() ) ); mgr->SetConditions( ACTIONS::toggleCursorStyle, CHECK( cond.FullscreenCursor() ) ); mgr->SetConditions( ACTIONS::millimetersUnits, CHECK( cond.Units( EDA_UNITS::MM ) ) ); - mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::IN ) ) ); + mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::INCH ) ) ); mgr->SetConditions( ACTIONS::milsUnits, CHECK( cond.Units( EDA_UNITS::MILS ) ) ); mgr->SetConditions( ACTIONS::cut, ENABLE( cond.HasItems() ) ); diff --git a/pcbnew/footprint_editor_settings.cpp b/pcbnew/footprint_editor_settings.cpp index 1342e3c219..e8482d6b84 100644 --- a/pcbnew/footprint_editor_settings.cpp +++ b/pcbnew/footprint_editor_settings.cpp @@ -289,7 +289,7 @@ FOOTPRINT_EDITOR_SETTINGS::FOOTPRINT_EDITOR_SETTINGS() : // Dimension settings m_params.emplace_back( new PARAM_ENUM( "design_settings.dimensions.units", - &m_DesignSettings.m_DimensionUnitsMode, DIM_UNITS_MODE::AUTOMATIC, DIM_UNITS_MODE::IN, + &m_DesignSettings.m_DimensionUnitsMode, DIM_UNITS_MODE::AUTOMATIC, DIM_UNITS_MODE::INCH, DIM_UNITS_MODE::AUTOMATIC ) ); m_params.emplace_back( new PARAM_ENUM( "design_settings.dimensions.precision", @@ -484,7 +484,7 @@ bool FOOTPRINT_EDITOR_SETTINGS::MigrateFromLegacy( wxConfigBase* aCfg ) if( aCfg->Read( f + "PcbUserGrid_X", &x ) && aCfg->Read( f + "PcbUserGrid_Y", &y ) ) { EDA_UNITS u = static_cast( aCfg->ReadLong( f + "PcbUserGrid_Unit", - static_cast( EDA_UNITS::IN ) ) ); + static_cast( EDA_UNITS::INCH ) ) ); // Convert to internal units x = EDA_UNIT_UTILS::UI::FromUserUnit( pcbIUScale, u, x ); diff --git a/pcbnew/footprint_viewer_frame.cpp b/pcbnew/footprint_viewer_frame.cpp index c9211aff7d..b687bf0807 100644 --- a/pcbnew/footprint_viewer_frame.cpp +++ b/pcbnew/footprint_viewer_frame.cpp @@ -350,7 +350,7 @@ void FOOTPRINT_VIEWER_FRAME::setupUIConditions() mgr->SetConditions( ACTIONS::toggleGrid, CHECK( cond.GridVisible() ) ); mgr->SetConditions( ACTIONS::toggleCursorStyle, CHECK( cond.FullscreenCursor() ) ); mgr->SetConditions( ACTIONS::millimetersUnits, CHECK( cond.Units( EDA_UNITS::MM ) ) ); - mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::IN ) ) ); + mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::INCH ) ) ); mgr->SetConditions( ACTIONS::milsUnits, CHECK( cond.Units( EDA_UNITS::MILS ) ) ); mgr->SetConditions( PCB_ACTIONS::saveFpToBoard, ENABLE( addToBoardCond ) ); diff --git a/pcbnew/pcb_dimension.cpp b/pcbnew/pcb_dimension.cpp index 8575d48470..fef48cfafd 100644 --- a/pcbnew/pcb_dimension.cpp +++ b/pcbnew/pcb_dimension.cpp @@ -147,7 +147,7 @@ static void CollectKnockedOutSegments( const SHAPE_POLY_SET& aPoly, const SEG& a PCB_DIMENSION_BASE::PCB_DIMENSION_BASE( BOARD_ITEM* aParent, KICAD_T aType ) : PCB_TEXT( aParent, aType ), m_overrideTextEnabled( false ), - m_units( EDA_UNITS::IN ), + m_units( EDA_UNITS::INCH ), m_autoUnits( false ), m_unitsFormat( DIM_UNITS_FORMAT::BARE_SUFFIX ), m_arrowDirection( DIM_ARROW_DIRECTION::OUTWARD ), @@ -429,7 +429,7 @@ wxString PCB_DIMENSION_BASE::GetValueText() const { switch( m_units ) { - case EDA_UNITS::IN: precision = precision - 4; break; + case EDA_UNITS::INCH: precision = precision - 4; break; case EDA_UNITS::MILS: precision = std::max( 0, precision - 7 ); break; case EDA_UNITS::MM: precision = precision - 5; break; default: precision = precision - 4; break; @@ -487,7 +487,7 @@ DIM_UNITS_MODE PCB_DIMENSION_BASE::GetUnitsMode() const switch( m_units ) { default: - case EDA_UNITS::IN: return DIM_UNITS_MODE::IN; + case EDA_UNITS::INCH: return DIM_UNITS_MODE::INCH; case EDA_UNITS::MM: return DIM_UNITS_MODE::MM; case EDA_UNITS::MILS: return DIM_UNITS_MODE::MILS; } @@ -499,9 +499,9 @@ void PCB_DIMENSION_BASE::SetUnitsMode( DIM_UNITS_MODE aMode ) { switch( aMode ) { - case DIM_UNITS_MODE::IN: + case DIM_UNITS_MODE::INCH: m_autoUnits = false; - m_units = EDA_UNITS::IN; + m_units = EDA_UNITS::INCH; break; case DIM_UNITS_MODE::MILS: @@ -1783,7 +1783,7 @@ static struct DIMENSION_DESC .Map( DIM_UNITS_FORMAT::PAREN_SUFFIX, _HKI( "1234.0 (mm)" ) ); ENUM_MAP::Instance() - .Map( DIM_UNITS_MODE::IN, _HKI( "Inches" ) ) + .Map( DIM_UNITS_MODE::INCH, _HKI( "Inches" ) ) .Map( DIM_UNITS_MODE::MILS, _HKI( "Mils" ) ) .Map( DIM_UNITS_MODE::MM, _HKI( "Millimeters" ) ) .Map( DIM_UNITS_MODE::AUTOMATIC, _HKI( "Automatic" ) ); diff --git a/pcbnew/pcb_dimension.h b/pcbnew/pcb_dimension.h index dc00bf5ddf..df38d8a6a2 100644 --- a/pcbnew/pcb_dimension.h +++ b/pcbnew/pcb_dimension.h @@ -70,7 +70,7 @@ enum class DIM_TEXT_POSITION */ enum class DIM_UNITS_MODE { - IN, + INCH, // Do not use IN: it conflicts with a Windows header MILS, MM, AUTOMATIC diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index 1535f6757c..7fee5054c3 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -805,7 +805,7 @@ void PCB_EDIT_FRAME::setupUIConditions() mgr->SetConditions( ACTIONS::toggleCursorStyle, CHECK( cond.FullscreenCursor() ) ); mgr->SetConditions( ACTIONS::togglePolarCoords, CHECK( cond.PolarCoordinates() ) ); mgr->SetConditions( ACTIONS::millimetersUnits, CHECK( cond.Units( EDA_UNITS::MM ) ) ); - mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::IN ) ) ); + mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::INCH ) ) ); mgr->SetConditions( ACTIONS::milsUnits, CHECK( cond.Units( EDA_UNITS::MILS ) ) ); mgr->SetConditions( ACTIONS::cut, ENABLE( cond.HasItems() ) ); diff --git a/pcbnew/pcb_io/altium/altium_pcb.cpp b/pcbnew/pcb_io/altium/altium_pcb.cpp index 5ca42c25c3..c90a9f0c9a 100644 --- a/pcbnew/pcb_io/altium/altium_pcb.cpp +++ b/pcbnew/pcb_io/altium/altium_pcb.cpp @@ -1646,7 +1646,7 @@ void ALTIUM_PCB::HelperParseDimensions6Linear( const ADIMENSION6& aElem ) switch( aElem.textunit ) { - case ALTIUM_UNIT::IN: dimension->SetUnits( EDA_UNITS::IN ); break; + case ALTIUM_UNIT::IN: dimension->SetUnits( EDA_UNITS::INCH ); break; case ALTIUM_UNIT::MILS: dimension->SetUnits( EDA_UNITS::MILS ); break; case ALTIUM_UNIT::MM: dimension->SetUnits( EDA_UNITS::MM ); break; case ALTIUM_UNIT::CM: dimension->SetUnits( EDA_UNITS::MM ); break; @@ -1697,7 +1697,7 @@ void ALTIUM_PCB::HelperParseDimensions6Radial(const ADIMENSION6 &aElem) switch( aElem.textunit ) { - case ALTIUM_UNIT::IN: dimension->SetUnits( EDA_UNITS::IN ); break; + case ALTIUM_UNIT::IN: dimension->SetUnits( EDA_UNITS::INCH ); break; case ALTIUM_UNIT::MILS: dimension->SetUnits( EDA_UNITS::MILS ); break; case ALTIUM_UNIT::MM: dimension->SetUnits( EDA_UNITS::MM ); break; case ALTIUM_UNIT::CM: dimension->SetUnits( EDA_UNITS::MM ); break; diff --git a/pcbnew/pcb_io/cadstar/cadstar_pcb_archive_loader.cpp b/pcbnew/pcb_io/cadstar/cadstar_pcb_archive_loader.cpp index d83da4dcdd..05dbb22c60 100644 --- a/pcbnew/pcb_io/cadstar/cadstar_pcb_archive_loader.cpp +++ b/pcbnew/pcb_io/cadstar/cadstar_pcb_archive_loader.cpp @@ -3725,7 +3725,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::applyDimensionSettings( const DIMENSION& aCads break; case UNITS::INCH: - aKiCadDim->SetUnitsMode( DIM_UNITS_MODE::IN ); + aKiCadDim->SetUnitsMode( DIM_UNITS_MODE::INCH ); break; case UNITS::THOU: diff --git a/pcbnew/pcb_plot_params.cpp b/pcbnew/pcb_plot_params.cpp index 702b17327d..a7a3d1a401 100644 --- a/pcbnew/pcb_plot_params.cpp +++ b/pcbnew/pcb_plot_params.cpp @@ -105,7 +105,7 @@ PCB_PLOT_PARAMS::PCB_PLOT_PARAMS() m_plotDrawingSheet = false; m_plotMode = FILLED; m_DXFPolygonMode = true; - m_DXFUnits = DXF_UNITS::IN; + m_DXFUnits = DXF_UNITS::INCH; m_useAuxOrigin = false; m_HPGLPenNum = 1; m_HPGLPenSpeed = 20; // this param is always in cm/s @@ -219,7 +219,7 @@ void PCB_PLOT_PARAMS::Format( OUTPUTFORMATTER* aFormatter ) const // DXF options KICAD_FORMAT::FormatBool( aFormatter, getTokenName( T_dxfpolygonmode ), m_DXFPolygonMode ); KICAD_FORMAT::FormatBool( aFormatter, getTokenName( T_dxfimperialunits ), - m_DXFUnits == DXF_UNITS::IN ); + m_DXFUnits == DXF_UNITS::INCH ); KICAD_FORMAT::FormatBool( aFormatter, getTokenName( T_dxfusepcbnewfont ), m_textMode != PLOT_TEXT_MODE::NATIVE ); @@ -776,7 +776,7 @@ void PCB_PLOT_PARAMS_PARSER::Parse( PCB_PLOT_PARAMS* aPcbPlotParams ) break; case T_dxfimperialunits: - aPcbPlotParams->m_DXFUnits = parseBool() ? DXF_UNITS::IN : DXF_UNITS::MM; + aPcbPlotParams->m_DXFUnits = parseBool() ? DXF_UNITS::INCH : DXF_UNITS::MM; break; case T_dxfusepcbnewfont: diff --git a/pcbnew/pcb_plotter.cpp b/pcbnew/pcb_plotter.cpp index 26463d8814..ee96edb63f 100644 --- a/pcbnew/pcb_plotter.cpp +++ b/pcbnew/pcb_plotter.cpp @@ -348,8 +348,8 @@ void PCB_PLOTTER::PlotJobToPlotOpts( PCB_PLOT_PARAMS& aOpts, JOB_EXPORT_PCB_PLOT if( aJob->m_plotFormat == JOB_EXPORT_PCB_PLOT::PLOT_FORMAT::DXF ) { JOB_EXPORT_PCB_DXF* dxfJob = static_cast( aJob ); - aOpts.SetDXFPlotUnits( dxfJob->m_dxfUnits == JOB_EXPORT_PCB_DXF::DXF_UNITS::IN - ? DXF_UNITS::IN + aOpts.SetDXFPlotUnits( dxfJob->m_dxfUnits == JOB_EXPORT_PCB_DXF::DXF_UNITS::INCH + ? DXF_UNITS::INCH : DXF_UNITS::MM ); aOpts.SetPlotMode( dxfJob->m_plotGraphicItemsUsingContours ? OUTLINE_MODE::SKETCH diff --git a/pcbnew/pcbexpr_evaluator.cpp b/pcbnew/pcbexpr_evaluator.cpp index bcf15d5d97..76e305d701 100644 --- a/pcbnew/pcbexpr_evaluator.cpp +++ b/pcbnew/pcbexpr_evaluator.cpp @@ -571,7 +571,7 @@ double PCBEXPR_UNIT_RESOLVER::Convert( const wxString& aString, int unitId ) con { case 0: return EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, EDA_UNITS::MILS, aString ); case 1: return EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, EDA_UNITS::MM, aString ); - case 2: return EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, EDA_UNITS::IN, aString ); + case 2: return EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, EDA_UNITS::INCH, aString ); default: return v; } }; diff --git a/pcbnew/pcbnew_jobs_handler.cpp b/pcbnew/pcbnew_jobs_handler.cpp index 09610477a8..9b20af9161 100644 --- a/pcbnew/pcbnew_jobs_handler.cpp +++ b/pcbnew/pcbnew_jobs_handler.cpp @@ -393,7 +393,7 @@ int PCBNEW_JOBS_HANDLER::JobExportStep( JOB* aJob ) case JOB_EXPORT_PCB_3D::VRML_UNITS::MM: scale = 1.0; break; case JOB_EXPORT_PCB_3D::VRML_UNITS::METERS: scale = 0.001; break; case JOB_EXPORT_PCB_3D::VRML_UNITS::TENTHS: scale = 10.0 / 25.4; break; - case JOB_EXPORT_PCB_3D::VRML_UNITS::IN: scale = 1.0 / 25.4; break; + case JOB_EXPORT_PCB_3D::VRML_UNITS::INCH: scale = 1.0 / 25.4; break; } EXPORTER_VRML vrmlExporter( brd ); @@ -1324,7 +1324,7 @@ int PCBNEW_JOBS_HANDLER::JobExportDrill( JOB* aJob ) DRILL_PRECISION precision; - if( aDrillJob->m_drillUnits == JOB_EXPORT_PCB_DRILL::DRILL_UNITS::IN ) + if( aDrillJob->m_drillUnits == JOB_EXPORT_PCB_DRILL::DRILL_UNITS::INCH ) precision = precisionListForInches; else precision = precisionListForMetric; @@ -1813,7 +1813,7 @@ int PCBNEW_JOBS_HANDLER::JobExportDrc( JOB* aJob ) switch( drcJob->m_units ) { - case JOB_PCB_DRC::UNITS::IN: units = EDA_UNITS::IN; break; + case JOB_PCB_DRC::UNITS::INCH: units = EDA_UNITS::INCH; break; case JOB_PCB_DRC::UNITS::MILS: units = EDA_UNITS::MILS; break; case JOB_PCB_DRC::UNITS::MM: units = EDA_UNITS::MM; break; default: units = EDA_UNITS::MM; break; diff --git a/pcbnew/pcbnew_settings.cpp b/pcbnew/pcbnew_settings.cpp index c0c1f9eb26..e9b3e8cb7c 100644 --- a/pcbnew/pcbnew_settings.cpp +++ b/pcbnew/pcbnew_settings.cpp @@ -991,7 +991,7 @@ bool PCBNEW_SETTINGS::MigrateFromLegacy( wxConfigBase* aCfg ) if( aCfg->Read( f + "PcbUserGrid_X", &x ) && aCfg->Read( f + "PcbUserGrid_Y", &y ) ) { EDA_UNITS u = static_cast( aCfg->ReadLong( f + "PcbUserGrid_Unit", - static_cast( EDA_UNITS::IN ) ) ); + static_cast( EDA_UNITS::INCH ) ) ); // Convert to internal units x = EDA_UNIT_UTILS::UI::FromUserUnit( pcbIUScale, u, x ); diff --git a/pcbnew/toolbars_pcb_editor.cpp b/pcbnew/toolbars_pcb_editor.cpp index 0b29312846..6e716bb330 100644 --- a/pcbnew/toolbars_pcb_editor.cpp +++ b/pcbnew/toolbars_pcb_editor.cpp @@ -448,7 +448,7 @@ static wxString ComboBoxUnits( EDA_UNITS aUnits, double aValue, bool aIncludeLab case EDA_UNITS::UNSCALED: format = wxT( "%.0f" ); break; case EDA_UNITS::MM: format = wxT( "%.3f" ); break; case EDA_UNITS::MILS: format = wxT( "%.2f" ); break; - case EDA_UNITS::IN: format = wxT( "%.5f" ); break; + case EDA_UNITS::INCH: format = wxT( "%.5f" ); break; } text.Printf( format, EDA_UNIT_UTILS::UI::ToUserUnit( pcbIUScale, aUnits, aValue ) ); diff --git a/pcbnew/tools/drawing_stackup_table_tool.cpp b/pcbnew/tools/drawing_stackup_table_tool.cpp index e0e9204592..ead6120bd1 100644 --- a/pcbnew/tools/drawing_stackup_table_tool.cpp +++ b/pcbnew/tools/drawing_stackup_table_tool.cpp @@ -260,7 +260,7 @@ std::vector DRAWING_TOOL::DrawSpecificationStackup( const VECTOR2I& switch( m_frame->GetUserUnits() ) { case EDA_UNITS::MM: t->SetText( _( "Thickness (mm)" ) ); break; - case EDA_UNITS::IN: t->SetText( _( "Thickness (inches)" ) ); break; + case EDA_UNITS::INCH: t->SetText( _( "Thickness (inches)" ) ); break; case EDA_UNITS::MILS: t->SetText( _( "Thickness (mils)" ) ); break; default: wxFAIL_MSG( wxT( "Unhandled unit type" ) ); }