diff --git a/eeschema/default_values.h b/eeschema/default_values.h index 7a5b4c905c..f6a0d598d3 100644 --- a/eeschema/default_values.h +++ b/eeschema/default_values.h @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2020 Jean-Pierre Charras, jp.charras at wanadoo.fr - * Copyright (C) 2016-2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -42,13 +42,13 @@ #define DEFAULTSELECTIONTHICKNESS 3 ///< The default line width in mils. (can be changed in preference menu) -#define DEFAULT_LINE_THICKNESS 6 +#define DEFAULT_LINE_WIDTH_MILS 6 ///< The default wire width in mils. (can be changed in preference menu) -#define DEFAULT_WIRE_THICKNESS 6 +#define DEFAULT_WIRE_WIDTH_MILS 6 ///< The default bus width in mils. (can be changed in preference menu) -#define DEFAULT_BUS_THICKNESS 12 +#define DEFAULT_BUS_WIDTH_MILS 12 ///< The default noconnect size in mils. #define DEFAULT_NOCONNECT_SIZE 48 diff --git a/eeschema/eeschema_settings.cpp b/eeschema/eeschema_settings.cpp index aa739c3734..81a0ecdc82 100644 --- a/eeschema/eeschema_settings.cpp +++ b/eeschema/eeschema_settings.cpp @@ -120,7 +120,7 @@ EESCHEMA_SETTINGS::EESCHEMA_SETTINGS() : &m_AutoplaceFields.align_to_grid, true ) ); m_params.emplace_back( new PARAM( "drawing.default_bus_thickness", - &m_Drawing.default_bus_thickness, DEFAULT_BUS_THICKNESS ) ); + &m_Drawing.default_bus_thickness, DEFAULT_BUS_WIDTH_MILS ) ); m_params.emplace_back( new PARAM( "drawing.default_junction_size", &m_Drawing.default_junction_size, DEFAULT_JUNCTION_DIAM ) ); @@ -128,11 +128,11 @@ EESCHEMA_SETTINGS::EESCHEMA_SETTINGS() : m_params.emplace_back( new PARAM( "drawing.pin_symbol_size", &m_Drawing.pin_symbol_size, DEFAULT_TEXT_SIZE / 2 ) ); - m_params.emplace_back( - new PARAM( "drawing.text_offset_ratio", &m_Drawing.text_offset_ratio, 0.08 ) ); + m_params.emplace_back( new PARAM( "drawing.text_offset_ratio", + &m_Drawing.text_offset_ratio, 0.08 ) ); m_params.emplace_back( new PARAM( "drawing.default_line_thickness", - &m_Drawing.default_line_thickness, DEFAULT_LINE_THICKNESS ) ); + &m_Drawing.default_line_thickness, DEFAULT_LINE_WIDTH_MILS ) ); m_params.emplace_back( new PARAM( "drawing.default_repeat_offset_x", &m_Drawing.default_repeat_offset_x, 0 ) ); @@ -141,10 +141,10 @@ EESCHEMA_SETTINGS::EESCHEMA_SETTINGS() : &m_Drawing.default_repeat_offset_y, 100 ) ); m_params.emplace_back( new PARAM( "drawing.default_wire_thickness", - &m_Drawing.default_wire_thickness, DEFAULT_WIRE_THICKNESS ) ); + &m_Drawing.default_wire_thickness, DEFAULT_WIRE_WIDTH_MILS ) ); - m_params.emplace_back( new PARAM( - "drawing.default_text_size", &m_Drawing.default_text_size, DEFAULT_TEXT_SIZE ) ); + m_params.emplace_back( new PARAM( "drawing.default_text_size", + &m_Drawing.default_text_size, DEFAULT_TEXT_SIZE ) ); m_params.emplace_back( new PARAM( "drawing.field_names", &m_Drawing.field_names, "" ) ); diff --git a/eeschema/sch_bus_entry.cpp b/eeschema/sch_bus_entry.cpp index 49e2111b62..f587758503 100644 --- a/eeschema/sch_bus_entry.cpp +++ b/eeschema/sch_bus_entry.cpp @@ -182,7 +182,7 @@ int SCH_BUS_WIRE_ENTRY::GetPenWidth() const if( Schematic() ) return std::max( Schematic()->Settings().m_DefaultWireThickness, 1 ); - return DEFAULT_WIRE_THICKNESS; + return Mils2iu( DEFAULT_WIRE_WIDTH_MILS ); } @@ -199,7 +199,7 @@ int SCH_BUS_BUS_ENTRY::GetPenWidth() const if( Schematic() ) return std::max( Schematic()->Settings().m_DefaultBusThickness, 1 ); - return DEFAULT_BUS_THICKNESS; + return Mils2iu( DEFAULT_BUS_WIDTH_MILS ); } diff --git a/eeschema/sch_item.h b/eeschema/sch_item.h index a1cf249d1a..858f87dfba 100644 --- a/eeschema/sch_item.h +++ b/eeschema/sch_item.h @@ -151,7 +151,7 @@ typedef std::unordered_set SCH_ITEM_SET; class STROKE_PARAMS { public: - STROKE_PARAMS( int aWidth = Mils2iu( DEFAULT_LINE_THICKNESS ), + STROKE_PARAMS( int aWidth = Mils2iu( DEFAULT_LINE_WIDTH_MILS ), PLOT_DASH_TYPE aPlotStyle = PLOT_DASH_TYPE::DEFAULT, const COLOR4D& aColor = COLOR4D::UNSPECIFIED ) : m_width( aWidth ), diff --git a/eeschema/sch_line.cpp b/eeschema/sch_line.cpp index 1d083e0d2b..336b67f116 100644 --- a/eeschema/sch_line.cpp +++ b/eeschema/sch_line.cpp @@ -47,9 +47,9 @@ SCH_LINE::SCH_LINE( const wxPoint& pos, int layer ) : switch( layer ) { - default: m_layer = LAYER_NOTES; break; + default: m_layer = LAYER_NOTES; break; case LAYER_WIRE: m_layer = LAYER_WIRE; break; - case LAYER_BUS: m_layer = LAYER_BUS; break; + case LAYER_BUS: m_layer = LAYER_BUS; break; } } @@ -287,7 +287,7 @@ int SCH_LINE::GetPenWidth() const if( Schematic() ) return Schematic()->Settings().m_DefaultLineWidth; - return DEFAULT_LINE_THICKNESS; + return Mils2iu( DEFAULT_LINE_WIDTH_MILS ); case LAYER_WIRE: if( m_stroke.GetWidth() > 0 ) @@ -299,7 +299,7 @@ int SCH_LINE::GetPenWidth() const if( Schematic() ) return Schematic()->Settings().m_DefaultWireThickness; - return DEFAULT_WIRE_THICKNESS; + return Mils2iu( DEFAULT_WIRE_WIDTH_MILS ); case LAYER_BUS: if( m_stroke.GetWidth() > 0 ) @@ -311,7 +311,7 @@ int SCH_LINE::GetPenWidth() const if( Schematic() ) return Schematic()->Settings().m_DefaultBusThickness; - return DEFAULT_BUS_THICKNESS; + return Mils2iu( DEFAULT_BUS_WIDTH_MILS ); } } diff --git a/eeschema/sch_painter.cpp b/eeschema/sch_painter.cpp index 679dd446ff..3cd26a80c0 100644 --- a/eeschema/sch_painter.cpp +++ b/eeschema/sch_painter.cpp @@ -81,12 +81,12 @@ SCH_RENDER_SETTINGS::SCH_RENDER_SETTINGS() : m_OverrideItemColors( false ), m_LabelSizeRatio( DEFAULT_LABEL_SIZE_RATIO ), m_TextOffsetRatio( DEFAULT_TEXT_OFFSET_RATIO ), - m_DefaultWireThickness( DEFAULT_WIRE_THICKNESS * IU_PER_MILS ), - m_DefaultBusThickness( DEFAULT_BUS_THICKNESS * IU_PER_MILS ), + m_DefaultWireThickness( DEFAULT_WIRE_WIDTH_MILS * IU_PER_MILS ), + m_DefaultBusThickness( DEFAULT_BUS_WIDTH_MILS * IU_PER_MILS ), m_PinSymbolSize( DEFAULT_TEXT_SIZE * IU_PER_MILS / 2 ), m_JunctionSize( DEFAULT_JUNCTION_DIAM * IU_PER_MILS ) { - SetDefaultPenWidth( DEFAULT_LINE_THICKNESS * IU_PER_MILS ); + SetDefaultPenWidth( DEFAULT_LINE_WIDTH_MILS * IU_PER_MILS ); m_minPenWidth = ADVANCED_CFG::GetCfg().m_MinPlotPenWidth * IU_PER_MM; } diff --git a/eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp b/eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp index 4dd6f7a68c..1f99fbe890 100644 --- a/eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp +++ b/eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp @@ -477,7 +477,7 @@ void SCH_SEXPR_PARSER::parseStroke( STROKE_PARAMS& aStroke ) wxCHECK_RET( CurTok() == T_stroke, wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a stroke." ) ); - aStroke.SetWidth( Mils2iu( DEFAULT_LINE_THICKNESS ) ); + aStroke.SetWidth( Mils2iu( DEFAULT_LINE_WIDTH_MILS ) ); aStroke.SetPlotStyle( PLOT_DASH_TYPE::DEFAULT ); aStroke.SetColor( COLOR4D::UNSPECIFIED ); diff --git a/eeschema/sch_sheet.cpp b/eeschema/sch_sheet.cpp index fc8c58d13c..3654e187ca 100644 --- a/eeschema/sch_sheet.cpp +++ b/eeschema/sch_sheet.cpp @@ -514,7 +514,7 @@ int SCH_SHEET::GetPenWidth() const if( Schematic() ) return Schematic()->Settings().m_DefaultLineWidth; - return DEFAULT_LINE_THICKNESS; + return Mils2iu( DEFAULT_LINE_WIDTH_MILS ); } diff --git a/eeschema/sch_sheet_pin.cpp b/eeschema/sch_sheet_pin.cpp index 0ca26dd575..06519555f7 100644 --- a/eeschema/sch_sheet_pin.cpp +++ b/eeschema/sch_sheet_pin.cpp @@ -100,7 +100,7 @@ int SCH_SHEET_PIN::GetPenWidth() const if( Schematic() ) return Schematic()->Settings().m_DefaultLineWidth; - return DEFAULT_LINE_THICKNESS; + return Mils2iu( DEFAULT_LINE_WIDTH_MILS ); } diff --git a/eeschema/schematic_settings.cpp b/eeschema/schematic_settings.cpp index 0dc87840cb..28913f0542 100644 --- a/eeschema/schematic_settings.cpp +++ b/eeschema/schematic_settings.cpp @@ -38,9 +38,9 @@ const int schSettingsSchemaVersion = 1; SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS( JSON_SETTINGS* aParent, const std::string& aPath ) : NESTED_SETTINGS( "schematic", schSettingsSchemaVersion, aParent, aPath ), - m_DefaultLineWidth( DEFAULT_LINE_THICKNESS * IU_PER_MILS ), - m_DefaultWireThickness( DEFAULT_WIRE_THICKNESS * IU_PER_MILS ), - m_DefaultBusThickness( DEFAULT_BUS_THICKNESS * IU_PER_MILS ), + m_DefaultLineWidth( DEFAULT_LINE_WIDTH_MILS * IU_PER_MILS ), + m_DefaultWireThickness( DEFAULT_WIRE_WIDTH_MILS * IU_PER_MILS ), + m_DefaultBusThickness( DEFAULT_BUS_WIDTH_MILS * IU_PER_MILS ), m_DefaultTextSize( DEFAULT_TEXT_SIZE * IU_PER_MILS ), m_LabelSizeRatio( DEFAULT_LABEL_SIZE_RATIO ), m_TextOffsetRatio( DEFAULT_TEXT_OFFSET_RATIO ), @@ -59,11 +59,11 @@ SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS( JSON_SETTINGS* aParent, const std::strin EESCHEMA_SETTINGS* appSettings = dynamic_cast( Kiface().KifaceSettings() ); int defaultLineThickness = - appSettings ? appSettings->m_Drawing.default_line_thickness : DEFAULT_LINE_THICKNESS; + appSettings ? appSettings->m_Drawing.default_line_thickness : DEFAULT_LINE_WIDTH_MILS; int defaultWireThickness = - appSettings ? appSettings->m_Drawing.default_wire_thickness : DEFAULT_WIRE_THICKNESS; + appSettings ? appSettings->m_Drawing.default_wire_thickness : DEFAULT_WIRE_WIDTH_MILS; int defaultBusThickness = - appSettings ? appSettings->m_Drawing.default_bus_thickness : DEFAULT_BUS_THICKNESS; + appSettings ? appSettings->m_Drawing.default_bus_thickness : DEFAULT_BUS_WIDTH_MILS; int defaultTextSize = appSettings ? appSettings->m_Drawing.default_text_size : DEFAULT_TEXT_SIZE; int defaultPinSymbolSize = diff --git a/eeschema/symbol_editor/symbol_editor_settings.cpp b/eeschema/symbol_editor/symbol_editor_settings.cpp index 1019b0112b..2482295a25 100644 --- a/eeschema/symbol_editor/symbol_editor_settings.cpp +++ b/eeschema/symbol_editor/symbol_editor_settings.cpp @@ -47,7 +47,7 @@ SYMBOL_EDITOR_SETTINGS::SYMBOL_EDITOR_SETTINGS() : SetLegacyFilename( "eeschema" ); m_params.emplace_back( new PARAM( "defaults.line_width", - &m_Defaults.line_width, DEFAULT_LINE_THICKNESS ) ); + &m_Defaults.line_width, DEFAULT_LINE_WIDTH_MILS ) ); m_params.emplace_back( new PARAM( "defaults.text_size", &m_Defaults.text_size, DEFAULT_TEXT_SIZE ) ); diff --git a/eeschema/symbol_viewer_frame.cpp b/eeschema/symbol_viewer_frame.cpp index 4d7cf89d64..ecfd5bcc4e 100644 --- a/eeschema/symbol_viewer_frame.cpp +++ b/eeschema/symbol_viewer_frame.cpp @@ -143,7 +143,7 @@ SYMBOL_VIEWER_FRAME::SYMBOL_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAM GetRenderSettings()->m_ShowHiddenText = true; GetRenderSettings()->m_ShowHiddenPins = true; - GetRenderSettings()->SetDefaultPenWidth( DEFAULT_LINE_THICKNESS * IU_PER_MILS ); + GetRenderSettings()->SetDefaultPenWidth( DEFAULT_LINE_WIDTH_MILS * IU_PER_MILS ); setupTools(); setupUIConditions();