diff --git a/bitmaps_png/CMakeLists.txt b/bitmaps_png/CMakeLists.txt index 5152ddd619..342b58aef1 100644 --- a/bitmaps_png/CMakeLists.txt +++ b/bitmaps_png/CMakeLists.txt @@ -603,6 +603,7 @@ set( BMAPS_OTHER stripline stroke_dash stroke_dashdot + stroke_dashdotdot stroke_dot stroke_solid tune_diff_pair_length_legend diff --git a/bitmaps_png/png/stroke_dashdot.png b/bitmaps_png/png/stroke_dashdot.png index e7507c2f17..23551ff41f 100644 Binary files a/bitmaps_png/png/stroke_dashdot.png and b/bitmaps_png/png/stroke_dashdot.png differ diff --git a/bitmaps_png/png/stroke_dashdot_dark.png b/bitmaps_png/png/stroke_dashdot_dark.png index 5af0749d78..27869e1202 100644 Binary files a/bitmaps_png/png/stroke_dashdot_dark.png and b/bitmaps_png/png/stroke_dashdot_dark.png differ diff --git a/bitmaps_png/png/stroke_dashdotdot.png b/bitmaps_png/png/stroke_dashdotdot.png new file mode 100644 index 0000000000..96c883858e Binary files /dev/null and b/bitmaps_png/png/stroke_dashdotdot.png differ diff --git a/bitmaps_png/png/stroke_dashdotdot_dark.png b/bitmaps_png/png/stroke_dashdotdot_dark.png new file mode 100644 index 0000000000..108b23cd42 Binary files /dev/null and b/bitmaps_png/png/stroke_dashdotdot_dark.png differ diff --git a/bitmaps_png/png/stroke_dot.png b/bitmaps_png/png/stroke_dot.png index 9e9fa6dcbd..439721644c 100644 Binary files a/bitmaps_png/png/stroke_dot.png and b/bitmaps_png/png/stroke_dot.png differ diff --git a/bitmaps_png/png/stroke_dot_dark.png b/bitmaps_png/png/stroke_dot_dark.png index 47ba8d9a27..9f78b46cb7 100644 Binary files a/bitmaps_png/png/stroke_dot_dark.png and b/bitmaps_png/png/stroke_dot_dark.png differ diff --git a/bitmaps_png/sources/dark/stroke_dashdot.svg b/bitmaps_png/sources/dark/stroke_dashdot.svg index 6f14cc61e5..5bbe884f01 100644 --- a/bitmaps_png/sources/dark/stroke_dashdot.svg +++ b/bitmaps_png/sources/dark/stroke_dashdot.svg @@ -15,7 +15,10 @@ style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;" id="svg840" sodipodi:docname="stroke_dashdot.svg" - inkscape:version="1.0.1 (c497b03c, 2020-09-10)"> + inkscape:current-layer="svg840" + inkscape:document-rotation="0" /> @@ -44,7 +48,7 @@ image/svg+xml - + @@ -59,15 +63,18 @@ rdf:resource="http://creativecommons.org/ns#ShareAlike" /> + d="m 35.735,8 c 0,-1.656 -1.344,-3 -3,-3 h -1 c -1.656,0 -3,1.344 -3,3 0,1.656 1.344,3 3,3 h 1 c 1.656,0 3,-1.344 3,-3 z" + style="fill:#ded3dd;fill-opacity:1;stroke:#000000;stroke-width:0.09px" + id="path834" + sodipodi:nodetypes="sssssss" /> + d="m 19.5,8 c 0,-1.656 -1.344,-3 -3,-3 H 4 C 2.344,5 1,6.344 1,8 c 0,1.656 1.344,3 3,3 h 12.5 c 1.656,0 3,-1.344 3,-3 z" + style="fill:#ded3dd;fill-opacity:1;stroke:#000000;stroke-width:0.09px" + id="path836" + sodipodi:nodetypes="sssssss" /> + d="M 63,8 C 63,6.344 61.656,5 60,5 H 47.5 c -1.656,0 -3,1.344 -3,3 0,1.656 1.344,3 3,3 H 60 c 1.656,0 3,-1.344 3,-3 z" + style="fill:#ded3dd;fill-opacity:1;stroke:#000000;stroke-width:0.09px" + id="path838" + sodipodi:nodetypes="sssssss" /> diff --git a/bitmaps_png/sources/dark/stroke_dashdotdot.svg b/bitmaps_png/sources/dark/stroke_dashdotdot.svg new file mode 100644 index 0000000000..336d8c26f5 --- /dev/null +++ b/bitmaps_png/sources/dark/stroke_dashdotdot.svg @@ -0,0 +1,84 @@ + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/bitmaps_png/sources/dark/stroke_dot.svg b/bitmaps_png/sources/dark/stroke_dot.svg index 7aa447e5e1..d3eb7da6bc 100644 --- a/bitmaps_png/sources/dark/stroke_dot.svg +++ b/bitmaps_png/sources/dark/stroke_dot.svg @@ -15,7 +15,10 @@ style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;" id="svg844" sodipodi:docname="stroke_dot.svg" - inkscape:version="1.0.1 (c497b03c, 2020-09-10)"> + inkscape:current-layer="svg844" + inkscape:document-rotation="0" /> @@ -44,7 +48,7 @@ image/svg+xml - + @@ -59,23 +63,28 @@ rdf:resource="http://creativecommons.org/ns#ShareAlike" /> + d="m 35.1,8 c 0,-1.656 -1.344,-3 -3,-3 h -1 c -1.656,0 -3,1.344 -3,3 0,1.656 1.344,3 3,3 h 1 c 1.656,0 3,-1.344 3,-3 z" + style="fill:#ded3dd;fill-opacity:1;stroke:#000000;stroke-width:0.09px" + id="path834" + sodipodi:nodetypes="sssssss" /> + d="M 8,8 C 8,6.344 6.656,5 5,5 H 4 C 2.344,5 1,6.344 1,8 1,9.656 2.344,11 4,11 H 5 C 6.656,11 8,9.656 8,8 Z" + style="fill:#ded3dd;fill-opacity:1;stroke:#000000;stroke-width:0.09px" + id="path836" + sodipodi:nodetypes="sssssss" /> + d="m 48.9,8 c 0,-1.656 -1.344,-3 -3,-3 h -1 c -1.656,0 -3,1.344 -3,3 0,1.656 1.344,3 3,3 h 1 c 1.656,0 3,-1.344 3,-3 z" + style="fill:#ded3dd;fill-opacity:1;stroke:#000000;stroke-width:0.09px" + id="path838" + sodipodi:nodetypes="sssssss" /> + d="m 21.3,8 c 0,-1.656 -1.344,-3 -3,-3 h -1 c -1.656,0 -3,1.344 -3,3 0,1.656 1.344,3 3,3 h 1 c 1.656,0 3,-1.344 3,-3 z" + style="fill:#ded3dd;fill-opacity:1;stroke:#000000;stroke-width:0.09px" + id="path840" + sodipodi:nodetypes="sssssss" /> + d="M 63,8 C 63,6.344 61.656,5 60,5 h -1 c -1.656,0 -3,1.344 -3,3 0,1.656 1.344,3 3,3 h 1 c 1.656,0 3,-1.344 3,-3 z" + style="fill:#ded3dd;fill-opacity:1;stroke:#000000;stroke-width:0.09px" + id="path842" + sodipodi:nodetypes="sssssss" /> diff --git a/bitmaps_png/sources/light/stroke_dashdot.svg b/bitmaps_png/sources/light/stroke_dashdot.svg index 7676143c2c..bf4b3ab769 100644 --- a/bitmaps_png/sources/light/stroke_dashdot.svg +++ b/bitmaps_png/sources/light/stroke_dashdot.svg @@ -15,7 +15,10 @@ style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;" id="svg840" sodipodi:docname="stroke_dashdot.svg" - inkscape:version="1.0.1 (c497b03c, 2020-09-10)"> + inkscape:current-layer="svg840" + inkscape:document-rotation="0" /> @@ -44,7 +48,7 @@ image/svg+xml - + @@ -59,15 +63,18 @@ rdf:resource="http://creativecommons.org/ns#ShareAlike" /> + d="m 35.735,8 c 0,-1.656 -1.344,-3 -3,-3 h -1 c -1.656,0 -3,1.344 -3,3 0,1.656 1.344,3 3,3 h 1 c 1.656,0 3,-1.344 3,-3 z" + style="fill:#545454;fill-opacity:1;stroke:#000000;stroke-width:0.09px" + id="path834" + sodipodi:nodetypes="sssssss" /> + d="m 19.5,8 c 0,-1.656 -1.344,-3 -3,-3 H 4 C 2.344,5 1,6.344 1,8 c 0,1.656 1.344,3 3,3 h 12.5 c 1.656,0 3,-1.344 3,-3 z" + style="fill:#545454;fill-opacity:1;stroke:#000000;stroke-width:0.09px" + id="path836" + sodipodi:nodetypes="sssssss" /> + d="M 63,8 C 63,6.344 61.656,5 60,5 H 47.5 c -1.656,0 -3,1.344 -3,3 0,1.656 1.344,3 3,3 H 60 c 1.656,0 3,-1.344 3,-3 z" + style="fill:#545454;fill-opacity:1;stroke:#000000;stroke-width:0.09px" + id="path838" + sodipodi:nodetypes="sssssss" /> diff --git a/bitmaps_png/sources/light/stroke_dashdotdot.svg b/bitmaps_png/sources/light/stroke_dashdotdot.svg new file mode 100644 index 0000000000..3b0b305e84 --- /dev/null +++ b/bitmaps_png/sources/light/stroke_dashdotdot.svg @@ -0,0 +1,84 @@ + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/bitmaps_png/sources/light/stroke_dot.svg b/bitmaps_png/sources/light/stroke_dot.svg index 57a10b52c3..669ef45766 100644 --- a/bitmaps_png/sources/light/stroke_dot.svg +++ b/bitmaps_png/sources/light/stroke_dot.svg @@ -15,7 +15,10 @@ style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;" id="svg844" sodipodi:docname="stroke_dot.svg" - inkscape:version="1.0.1 (c497b03c, 2020-09-10)"> + inkscape:current-layer="svg844" + inkscape:document-rotation="0" /> @@ -44,7 +48,7 @@ image/svg+xml - + @@ -59,23 +63,28 @@ rdf:resource="http://creativecommons.org/ns#ShareAlike" /> + d="m 35.1,8 c 0,-1.656 -1.344,-3 -3,-3 h -1 c -1.656,0 -3,1.344 -3,3 0,1.656 1.344,3 3,3 h 1 c 1.656,0 3,-1.344 3,-3 z" + style="fill:#545454;fill-opacity:1;stroke:#000000;stroke-width:0.09px" + id="path834" + sodipodi:nodetypes="sssssss" /> + d="M 8,8 C 8,6.344 6.656,5 5,5 H 4 C 2.344,5 1,6.344 1,8 1,9.656 2.344,11 4,11 H 5 C 6.656,11 8,9.656 8,8 Z" + style="fill:#545454;fill-opacity:1;stroke:#000000;stroke-width:0.09px" + id="path836" + sodipodi:nodetypes="sssssss" /> + d="m 48.9,8 c 0,-1.656 -1.344,-3 -3,-3 h -1 c -1.656,0 -3,1.344 -3,3 0,1.656 1.344,3 3,3 h 1 c 1.656,0 3,-1.344 3,-3 z" + style="fill:#545454;fill-opacity:1;stroke:#000000;stroke-width:0.09px" + id="path838" + sodipodi:nodetypes="sssssss" /> + d="m 21.3,8 c 0,-1.656 -1.344,-3 -3,-3 h -1 c -1.656,0 -3,1.344 -3,3 0,1.656 1.344,3 3,3 h 1 c 1.656,0 3,-1.344 3,-3 z" + style="fill:#545454;fill-opacity:1;stroke:#000000;stroke-width:0.09px" + id="path840" + sodipodi:nodetypes="sssssss" /> + d="M 63,8 C 63,6.344 61.656,5 60,5 h -1 c -1.656,0 -3,1.344 -3,3 0,1.656 1.344,3 3,3 h 1 c 1.656,0 3,-1.344 3,-3 z" + style="fill:#545454;fill-opacity:1;stroke:#000000;stroke-width:0.09px" + id="path842" + sodipodi:nodetypes="sssssss" /> diff --git a/common/dialogs/panel_setup_netclasses.cpp b/common/dialogs/panel_setup_netclasses.cpp index def7f5b1a1..ccb690df26 100644 --- a/common/dialogs/panel_setup_netclasses.cpp +++ b/common/dialogs/panel_setup_netclasses.cpp @@ -93,6 +93,8 @@ PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES( PAGED_DIALOG* aParent, EDA_DRAW_ g_lineStyleNames.push_back( _( "Dotted" ) ); g_lineStyleIcons.push_back( BITMAPS::stroke_dashdot ); g_lineStyleNames.push_back( _( "Dash-Dot" ) ); + g_lineStyleIcons.push_back( BITMAPS::stroke_dashdotdot ); + g_lineStyleNames.push_back( _( "Dash-Dot-Dot" ) ); m_netclassesDirty = true; diff --git a/common/plotters/PDF_plotter.cpp b/common/plotters/PDF_plotter.cpp index 7d88ff0957..f5e467e2a5 100644 --- a/common/plotters/PDF_plotter.cpp +++ b/common/plotters/PDF_plotter.cpp @@ -184,6 +184,12 @@ void PDF_PLOTTER::SetDash( PLOT_DASH_TYPE dashed ) (int) GetDashMarkLenIU(), (int) GetDashGapLenIU(), (int) GetDotMarkLenIU(), (int) GetDashGapLenIU() ); break; + case PLOT_DASH_TYPE::DASHDOTDOT: + fprintf( workFile, "[%d %d %d %d %d %d] 0 d\n", + (int) GetDashMarkLenIU(), (int) GetDashGapLenIU(), + (int) GetDotMarkLenIU(), (int) GetDashGapLenIU(), + (int) GetDotMarkLenIU(), (int) GetDashGapLenIU() ); + break; default: fputs( "[] 0 d\n", workFile ); } diff --git a/common/plotters/PS_plotter.cpp b/common/plotters/PS_plotter.cpp index b99e7dc0a2..b3e4ae3c09 100644 --- a/common/plotters/PS_plotter.cpp +++ b/common/plotters/PS_plotter.cpp @@ -571,6 +571,12 @@ void PS_PLOTTER::SetDash( PLOT_DASH_TYPE dashed ) (int) GetDashMarkLenIU(), (int) GetDashGapLenIU(), (int) GetDotMarkLenIU(), (int) GetDashGapLenIU() ); break; + case PLOT_DASH_TYPE::DASHDOTDOT: + fprintf( m_outputFile, "[%d %d %d %d %d %d] 0 setdash\n", + (int) GetDashMarkLenIU(), (int) GetDashGapLenIU(), + (int) GetDotMarkLenIU(), (int) GetDashGapLenIU(), + (int) GetDotMarkLenIU(), (int) GetDashGapLenIU() ); + break; default: fputs( "solidline\n", m_outputFile ); } diff --git a/common/plotters/SVG_plotter.cpp b/common/plotters/SVG_plotter.cpp index cdbc23d44a..ae0da370ee 100644 --- a/common/plotters/SVG_plotter.cpp +++ b/common/plotters/SVG_plotter.cpp @@ -257,16 +257,24 @@ void SVG_PLOTTER::setSVGPlotStyle( bool aIsGroup, const std::string& aExtraStyle switch( m_dashed ) { case PLOT_DASH_TYPE::DASH: - fprintf( m_outputFile, "stroke-dasharray:%f,%f;", GetDashMarkLenIU(), GetDashGapLenIU() ); + fprintf( m_outputFile, "stroke-dasharray:%f,%f;", + GetDashMarkLenIU(), GetDashGapLenIU() ); break; case PLOT_DASH_TYPE::DOT: - fprintf( m_outputFile, "stroke-dasharray:%f,%f;", GetDotMarkLenIU(), GetDashGapLenIU() ); + fprintf( m_outputFile, "stroke-dasharray:%f,%f;", + GetDotMarkLenIU(), GetDashGapLenIU() ); break; case PLOT_DASH_TYPE::DASHDOT: fprintf( m_outputFile, "stroke-dasharray:%f,%f,%f,%f;", GetDashMarkLenIU(), GetDashGapLenIU(), GetDotMarkLenIU(), GetDashGapLenIU() ); break; + case PLOT_DASH_TYPE::DASHDOTDOT: + fprintf( m_outputFile, "stroke-dasharray:%f,%f,%f,%f,%f,%f;", + GetDashMarkLenIU(), GetDashGapLenIU(), + GetDotMarkLenIU(), GetDashGapLenIU(), + GetDotMarkLenIU(), GetDashGapLenIU() ); + break; case PLOT_DASH_TYPE::DEFAULT: case PLOT_DASH_TYPE::SOLID: default: diff --git a/common/stroke_params.cpp b/common/stroke_params.cpp index c9c82c8c78..1a785fec99 100644 --- a/common/stroke_params.cpp +++ b/common/stroke_params.cpp @@ -58,6 +58,15 @@ void STROKE_PARAMS::Stroke( const SHAPE* aShape, PLOT_DASH_TYPE aLineStyle, int strokes[3] = aRenderSettings->GetGapLength( aWidth ); wrapAround = 4; break; + case PLOT_DASH_TYPE::DASHDOTDOT: + strokes[0] = aRenderSettings->GetDashLength( aWidth ); + strokes[1] = aRenderSettings->GetGapLength( aWidth ); + strokes[2] = aRenderSettings->GetDotLength( aWidth ); + strokes[3] = aRenderSettings->GetGapLength( aWidth ); + strokes[4] = aRenderSettings->GetDotLength( aWidth ); + strokes[5] = aRenderSettings->GetGapLength( aWidth ); + wrapAround = 6; + break; default: UNIMPLEMENTED_FOR( lineTypeNames.at( aLineStyle ).name ); } @@ -171,11 +180,12 @@ static wxString getLineStyleToken( PLOT_DASH_TYPE aStyle ) switch( aStyle ) { - case PLOT_DASH_TYPE::DASH: token = "dash"; break; - case PLOT_DASH_TYPE::DOT: token = "dot"; break; - case PLOT_DASH_TYPE::DASHDOT: token = "dash_dot"; break; - case PLOT_DASH_TYPE::SOLID: token = "solid"; break; - case PLOT_DASH_TYPE::DEFAULT: token = "default"; break; + case PLOT_DASH_TYPE::DASH: token = "dash"; break; + case PLOT_DASH_TYPE::DOT: token = "dot"; break; + case PLOT_DASH_TYPE::DASHDOT: token = "dash_dot"; break; + case PLOT_DASH_TYPE::DASHDOTDOT: token = "dash_dot_dot"; break; + case PLOT_DASH_TYPE::SOLID: token = "solid"; break; + case PLOT_DASH_TYPE::DEFAULT: token = "default"; break; } return token; @@ -186,13 +196,22 @@ void STROKE_PARAMS::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel ) const { wxASSERT( aFormatter != nullptr ); - aFormatter->Print( aNestLevel, "(stroke (width %s) (type %s) (color %d %d %d %s))", - FormatInternalUnits(GetWidth() ).c_str(), - TO_UTF8( getLineStyleToken( GetPlotStyle() ) ), - KiROUND( GetColor().r * 255.0 ), - KiROUND( GetColor().g * 255.0 ), - KiROUND( GetColor().b * 255.0 ), - Double2Str( GetColor().a ).c_str() ); + if( GetColor() == KIGFX::COLOR4D::UNSPECIFIED ) + { + aFormatter->Print( aNestLevel, "(stroke (width %s) (type %s))", + FormatInternalUnits(GetWidth() ).c_str(), + TO_UTF8( getLineStyleToken( GetPlotStyle() ) ) ); + } + else + { + aFormatter->Print( aNestLevel, "(stroke (width %s) (type %s) (color %d %d %d %s))", + FormatInternalUnits(GetWidth() ).c_str(), + TO_UTF8( getLineStyleToken( GetPlotStyle() ) ), + KiROUND( GetColor().r * 255.0 ), + KiROUND( GetColor().g * 255.0 ), + KiROUND( GetColor().b * 255.0 ), + Double2Str( GetColor().a ).c_str() ); + } } @@ -218,13 +237,14 @@ void STROKE_PARAMS_PARSER::ParseStroke( STROKE_PARAMS& aStroke ) switch( token ) { - case T_dash: aStroke.SetPlotStyle( PLOT_DASH_TYPE::DASH ); break; - case T_dot: aStroke.SetPlotStyle( PLOT_DASH_TYPE::DOT ); break; - case T_dash_dot: aStroke.SetPlotStyle( PLOT_DASH_TYPE::DASHDOT ); break; - case T_solid: aStroke.SetPlotStyle( PLOT_DASH_TYPE::SOLID ); break; - case T_default: aStroke.SetPlotStyle( PLOT_DASH_TYPE::DEFAULT ); break; + case T_dash: aStroke.SetPlotStyle( PLOT_DASH_TYPE::DASH ); break; + case T_dot: aStroke.SetPlotStyle( PLOT_DASH_TYPE::DOT ); break; + case T_dash_dot: aStroke.SetPlotStyle( PLOT_DASH_TYPE::DASHDOT ); break; + case T_dash_dot_dot: aStroke.SetPlotStyle( PLOT_DASH_TYPE::DASHDOTDOT ); break; + case T_solid: aStroke.SetPlotStyle( PLOT_DASH_TYPE::SOLID ); break; + case T_default: aStroke.SetPlotStyle( PLOT_DASH_TYPE::DEFAULT ); break; default: - Expecting( "solid, dash, dash_dot, dot or default" ); + Expecting( "solid, dash, dash_dot, dash_dot_dot, dot or default" ); } NeedRIGHT(); diff --git a/eeschema/dialogs/panel_setup_formatting.cpp b/eeschema/dialogs/panel_setup_formatting.cpp index 08d81b1677..4c28099b17 100644 --- a/eeschema/dialogs/panel_setup_formatting.cpp +++ b/eeschema/dialogs/panel_setup_formatting.cpp @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2020-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 @@ -41,10 +41,13 @@ PANEL_SETUP_FORMATTING::PANEL_SETUP_FORMATTING( wxWindow* aWindow, SCH_EDIT_FRAM { } + void PANEL_SETUP_FORMATTING::onCheckBoxIref( wxCommandEvent& event ) { bool enabled = m_showIntersheetsReferences->GetValue(); + m_dashedLineHelp->SetFont( KIUI::GetInfoFont( this ) ); + m_radioFormatStandard->Enable( enabled ); m_radioFormatAbbreviated->Enable( enabled ); m_prefixCtrl->Enable( enabled ); @@ -94,11 +97,17 @@ bool PANEL_SETUP_FORMATTING::TransferDataToWindow() m_suffixCtrl->ChangeValue( settings.m_IntersheetRefsSuffix ); m_listOwnPage->SetValue( settings.m_IntersheetRefsListOwnPage ); - wxString offsetRatio = wxString::Format( "%f", settings.m_TextOffsetRatio * 100.0 ); - m_textOffsetRatioCtrl->SetValue( offsetRatio ); + m_textOffsetRatioCtrl->SetValue( StringFromValue( EDA_UNITS::PERCENT, + settings.m_TextOffsetRatio * 100.0 ) ); - wxString labelSizeRatio = wxString::Format( "%f", settings.m_LabelSizeRatio * 100.0 ); - m_labelSizeRatioCtrl->SetValue( labelSizeRatio ); + m_dashLengthCtrl->SetValue( StringFromValue( EDA_UNITS::UNSCALED, + settings.m_DashedLineDashRatio ) ); + + m_gapLengthCtrl->SetValue( StringFromValue( EDA_UNITS::UNSCALED, + settings.m_DashedLineGapRatio ) ); + + m_labelSizeRatioCtrl->SetValue( StringFromValue( EDA_UNITS::PERCENT, + settings.m_LabelSizeRatio * 100.0 ) ); return true; } @@ -142,13 +151,17 @@ bool PANEL_SETUP_FORMATTING::TransferDataFromWindow() settings.m_IntersheetRefsSuffix = m_suffixCtrl->GetValue(); settings.m_IntersheetRefsListOwnPage = m_listOwnPage->GetValue(); - double dtmp = DEFAULT_TEXT_OFFSET_RATIO; - m_textOffsetRatioCtrl->GetValue().ToDouble( &dtmp ); - settings.m_TextOffsetRatio = dtmp / 100.0; + settings.m_TextOffsetRatio = DoubleValueFromString( EDA_UNITS::PERCENT, + m_textOffsetRatioCtrl->GetValue() ) / 100.0; - dtmp = DEFAULT_LABEL_SIZE_RATIO; - m_labelSizeRatioCtrl->GetValue().ToDouble( &dtmp ); - settings.m_LabelSizeRatio = dtmp / 100.0; + settings.m_DashedLineDashRatio = DoubleValueFromString( EDA_UNITS::UNSCALED, + m_dashLengthCtrl->GetValue() ); + + settings.m_DashedLineGapRatio = DoubleValueFromString( EDA_UNITS::UNSCALED, + m_gapLengthCtrl->GetValue() ); + + settings.m_LabelSizeRatio = DoubleValueFromString( EDA_UNITS::PERCENT, + m_labelSizeRatioCtrl->GetValue() ) / 100.0; return true; } diff --git a/eeschema/dialogs/panel_setup_formatting_base.cpp b/eeschema/dialogs/panel_setup_formatting_base.cpp index eff80a42f3..c35863d289 100644 --- a/eeschema/dialogs/panel_setup_formatting_base.cpp +++ b/eeschema/dialogs/panel_setup_formatting_base.cpp @@ -93,7 +93,7 @@ PANEL_SETUP_FORMATTING_BASE::PANEL_SETUP_FORMATTING_BASE( wxWindow* parent, wxWi sbSizer4->Add( fgSizer2, 1, wxALL|wxEXPAND, 5 ); - bLeftColumn->Add( sbSizer4, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); + bLeftColumn->Add( sbSizer4, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); wxStaticBoxSizer* sbSizer41; sbSizer41 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Symbols") ), wxVERTICAL ); @@ -149,13 +149,13 @@ PANEL_SETUP_FORMATTING_BASE::PANEL_SETUP_FORMATTING_BASE( wxWindow* parent, wxWi bSizer61->Add( m_choiceJunctionDotSize, 1, wxEXPAND|wxRIGHT, 5 ); - sbSizer2->Add( bSizer61, 1, wxBOTTOM|wxEXPAND, 5 ); + sbSizer2->Add( bSizer61, 0, wxBOTTOM|wxEXPAND, 5 ); - bLeftColumn->Add( sbSizer2, 0, wxEXPAND|wxALL, 5 ); + bLeftColumn->Add( sbSizer2, 1, wxEXPAND|wxALL, 5 ); - bPanelSizer->Add( bLeftColumn, 1, 0, 10 ); + bPanelSizer->Add( bLeftColumn, 1, wxEXPAND, 10 ); wxBoxSizer* bRightColumn; bRightColumn = new wxBoxSizer( wxVERTICAL ); @@ -209,11 +209,40 @@ PANEL_SETUP_FORMATTING_BASE::PANEL_SETUP_FORMATTING_BASE( wxWindow* parent, wxWi bRightColumn->Add( sbSizerIREf, 0, wxALL|wxEXPAND, 5 ); + wxStaticBoxSizer* sbSizer6; + sbSizer6 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Dashed Lines") ), wxVERTICAL ); - bRightColumn->Add( 0, 0, 0, wxEXPAND, 5 ); + wxFlexGridSizer* fgSizer41; + fgSizer41 = new wxFlexGridSizer( 0, 2, 5, 0 ); + fgSizer41->SetFlexibleDirection( wxBOTH ); + fgSizer41->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + dashLengthLabel = new wxStaticText( sbSizer6->GetStaticBox(), wxID_ANY, _("Dash length:"), wxDefaultPosition, wxDefaultSize, 0 ); + dashLengthLabel->Wrap( -1 ); + fgSizer41->Add( dashLengthLabel, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); + + m_dashLengthCtrl = new wxTextCtrl( sbSizer6->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer41->Add( m_dashLengthCtrl, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + gapLengthLabel = new wxStaticText( sbSizer6->GetStaticBox(), wxID_ANY, _("Gap length:"), wxDefaultPosition, wxDefaultSize, 0 ); + gapLengthLabel->Wrap( -1 ); + fgSizer41->Add( gapLengthLabel, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); + + m_gapLengthCtrl = new wxTextCtrl( sbSizer6->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer41->Add( m_gapLengthCtrl, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bPanelSizer->Add( bRightColumn, 1, wxRIGHT|wxLEFT, 10 ); + sbSizer6->Add( fgSizer41, 0, wxEXPAND|wxBOTTOM, 5 ); + + m_dashedLineHelp = new wxStaticText( sbSizer6->GetStaticBox(), wxID_ANY, _("Dash and dot lengths are ratios of the line width."), wxDefaultPosition, wxDefaultSize, 0 ); + m_dashedLineHelp->Wrap( -1 ); + sbSizer6->Add( m_dashedLineHelp, 0, wxALL, 5 ); + + + bRightColumn->Add( sbSizer6, 1, wxEXPAND|wxBOTTOM, 5 ); + + + bPanelSizer->Add( bRightColumn, 1, wxRIGHT|wxLEFT|wxEXPAND, 10 ); this->SetSizer( bPanelSizer ); diff --git a/eeschema/dialogs/panel_setup_formatting_base.fbp b/eeschema/dialogs/panel_setup_formatting_base.fbp index 526e68d086..5301e24437 100644 --- a/eeschema/dialogs/panel_setup_formatting_base.fbp +++ b/eeschema/dialogs/panel_setup_formatting_base.fbp @@ -56,7 +56,7 @@ none 10 - + wxEXPAND 1 @@ -216,7 +216,7 @@ 5 wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT - 1 + 0 wxID_ANY Text @@ -1210,7 +1210,7 @@ 5 wxEXPAND|wxALL - 0 + 1 wxID_ANY Connections @@ -1222,7 +1222,7 @@ 5 wxBOTTOM|wxEXPAND - 1 + 0 bSizer61 @@ -1361,7 +1361,7 @@ 10 - wxRIGHT|wxLEFT + wxRIGHT|wxLEFT|wxEXPAND 1 @@ -1920,12 +1920,345 @@ 5 - wxEXPAND - 0 - - 0 - protected - 0 + wxEXPAND|wxBOTTOM + 1 + + wxID_ANY + Dashed Lines + + sbSizer6 + wxVERTICAL + 1 + none + + 5 + wxEXPAND|wxBOTTOM + 0 + + 2 + wxBOTH + + + 0 + + fgSizer41 + wxFLEX_GROWMODE_SPECIFIED + none + 0 + 5 + + 5 + wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Dash length: + 0 + + 0 + + + 0 + + 1 + dashLengthLabel + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_dashLengthCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + 5 + wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Gap length: + 0 + + 0 + + + 0 + + 1 + gapLengthLabel + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_gapLengthCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Dash and dot lengths are ratios of the line width. + 0 + + 0 + + + 0 + + 1 + m_dashedLineHelp + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + diff --git a/eeschema/dialogs/panel_setup_formatting_base.h b/eeschema/dialogs/panel_setup_formatting_base.h index c6c8f3d235..2f212b7bb4 100644 --- a/eeschema/dialogs/panel_setup_formatting_base.h +++ b/eeschema/dialogs/panel_setup_formatting_base.h @@ -66,6 +66,11 @@ class PANEL_SETUP_FORMATTING_BASE : public wxPanel wxTextCtrl* m_prefixCtrl; wxStaticText* m_suffixLabel; wxTextCtrl* m_suffixCtrl; + wxStaticText* dashLengthLabel; + wxTextCtrl* m_dashLengthCtrl; + wxStaticText* gapLengthLabel; + wxTextCtrl* m_gapLengthCtrl; + wxStaticText* m_dashedLineHelp; // Virtual event handlers, overide them in your derived class virtual void onCheckBoxIref( wxCommandEvent& event ) { event.Skip(); } diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp index f789dcb818..28f933e554 100644 --- a/eeschema/eeschema_config.cpp +++ b/eeschema/eeschema_config.cpp @@ -86,6 +86,9 @@ bool SCH_EDIT_FRAME::LoadProjectSettings() GetRenderSettings()->m_PinSymbolSize = settings.m_PinSymbolSize; GetRenderSettings()->m_JunctionSize = settings.m_JunctionSize; + GetRenderSettings()->SetDashLengthRatio( settings.m_DashedLineDashRatio ); + GetRenderSettings()->SetGapLengthRatio( settings.m_DashedLineGapRatio ); + // Verify some values, because the config file can be edited by hand, and have bad values: LIB_SYMBOL::SetSubpartIdNotation( LIB_SYMBOL::GetSubpartIdSeparator(), LIB_SYMBOL::GetSubpartFirstId() ); @@ -123,6 +126,9 @@ void SCH_EDIT_FRAME::ShowSchematicSetupDialog( const wxString& aInitialPage ) GetRenderSettings()->m_PinSymbolSize = Schematic().Settings().m_PinSymbolSize; GetRenderSettings()->m_JunctionSize = Schematic().Settings().m_JunctionSize; + GetRenderSettings()->SetDashLengthRatio( Schematic().Settings().m_DashedLineDashRatio ); + GetRenderSettings()->SetGapLengthRatio( Schematic().Settings().m_DashedLineGapRatio ); + GetCanvas()->GetView()->MarkDirty(); GetCanvas()->GetView()->UpdateAllItems( KIGFX::REPAINT ); GetCanvas()->Refresh(); diff --git a/eeschema/sch_file_versions.h b/eeschema/sch_file_versions.h index b6c3ca0049..7ed2abf6d5 100644 --- a/eeschema/sch_file_versions.h +++ b/eeschema/sch_file_versions.h @@ -67,4 +67,5 @@ //#define SEXPR_SCHEMATIC_FILE_VERSION 20210615 // Update overbar syntax in net names. //#define SEXPR_SCHEMATIC_FILE_VERSION 20210621 // Update overbar syntax in bus aliases. //#define SEXPR_SCHEMATIC_FILE_VERSION 20211123 // R/W uuids for junctions. -#define SEXPR_SCHEMATIC_FILE_VERSION 20220101 // Circles, arcs, rects, polys & beziers +//#define SEXPR_SCHEMATIC_FILE_VERSION 20220101 // Circles, arcs, rects, polys & beziers +#define SEXPR_SCHEMATIC_FILE_VERSION 20220102 // Dash-dot-dot diff --git a/eeschema/schematic_settings.cpp b/eeschema/schematic_settings.cpp index 08bd205647..841a59a1aa 100644 --- a/eeschema/schematic_settings.cpp +++ b/eeschema/schematic_settings.cpp @@ -50,6 +50,8 @@ SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS( JSON_SETTINGS* aParent, const std::strin m_IntersheetRefsFormatShort( false ), m_IntersheetRefsPrefix( DEFAULT_IREF_PREFIX ), m_IntersheetRefsSuffix( DEFAULT_IREF_SUFFIX ), + m_DashedLineDashRatio( 5 ), + m_DashedLineGapRatio( 3 ), m_SpiceAdjustPassiveValues( false ), m_NgspiceSimulatorSettings( nullptr ) { @@ -89,6 +91,12 @@ SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS( JSON_SETTINGS* aParent, const std::strin m_params.emplace_back( new PARAM( "drawing.intersheets_ref_suffix", &m_IntersheetRefsSuffix, defaultIntersheetsRefSuffix ) ); + m_params.emplace_back( new PARAM( "drawing.dashed_lines_dash_length_ratio", + &m_DashedLineDashRatio, 5 ) ); + + m_params.emplace_back( new PARAM( "drawing.dashed_lines_gap_length_ratio", + &m_DashedLineGapRatio, 3 ) ); + m_params.emplace_back( new PARAM_SCALED( "drawing.default_line_thickness", &m_DefaultLineWidth, Mils2iu( defaultLineThickness ), Mils2iu( 5 ), Mils2iu( 1000 ), 1 / IU_PER_MILS ) ); diff --git a/eeschema/schematic_settings.h b/eeschema/schematic_settings.h index 4db45e1df6..b8b280ada8 100644 --- a/eeschema/schematic_settings.h +++ b/eeschema/schematic_settings.h @@ -61,6 +61,9 @@ public: wxString m_IntersheetRefsPrefix; wxString m_IntersheetRefsSuffix; + double m_DashedLineDashRatio; // Dash length as ratio of the lineWidth + double m_DashedLineGapRatio; // Gap length as ratio of the lineWidth + wxString m_PlotDirectoryName; wxString m_NetFormatName; diff --git a/include/bitmaps/bitmap_info.h b/include/bitmaps/bitmap_info.h index 8fdf15dcfb..f816fef450 100644 --- a/include/bitmaps/bitmap_info.h +++ b/include/bitmaps/bitmap_info.h @@ -1021,6 +1021,7 @@ const std::vector g_BitmapInfo = { { BITMAPS::stripline, wxT( "stripline.png" ), -1, wxT( "light" ) }, { BITMAPS::stroke_dash, wxT( "stroke_dash.png" ), -1, wxT( "light" ) }, { BITMAPS::stroke_dashdot, wxT( "stroke_dashdot.png" ), -1, wxT( "light" ) }, + { BITMAPS::stroke_dashdotdot, wxT( "stroke_dashdotdot.png" ), -1, wxT( "light" ) }, { BITMAPS::stroke_dot, wxT( "stroke_dot.png" ), -1, wxT( "light" ) }, { BITMAPS::stroke_solid, wxT( "stroke_solid.png" ), -1, wxT( "light" ) }, { BITMAPS::tune_diff_pair_length_legend, wxT( "tune_diff_pair_length_legend.png" ), -1, wxT( "light" ) }, @@ -1055,6 +1056,7 @@ const std::vector g_BitmapInfo = { { BITMAPS::stripline, wxT( "stripline_dark.png" ), -1, wxT( "dark" ) }, { BITMAPS::stroke_dash, wxT( "stroke_dash_dark.png" ), -1, wxT( "dark" ) }, { BITMAPS::stroke_dashdot, wxT( "stroke_dashdot_dark.png" ), -1, wxT( "dark" ) }, + { BITMAPS::stroke_dashdotdot, wxT( "stroke_dashdotdot_dark.png" ), -1, wxT( "dark" ) }, { BITMAPS::stroke_dot, wxT( "stroke_dot_dark.png" ), -1, wxT( "dark" ) }, { BITMAPS::stroke_solid, wxT( "stroke_solid_dark.png" ), -1, wxT( "dark" ) }, { BITMAPS::tune_diff_pair_length_legend, wxT( "tune_diff_pair_length_legend_dark.png" ), -1, wxT( "dark" ) }, diff --git a/include/bitmaps/bitmaps_list.h b/include/bitmaps/bitmaps_list.h index 4c893dbfb4..8074b76d15 100644 --- a/include/bitmaps/bitmaps_list.h +++ b/include/bitmaps/bitmaps_list.h @@ -519,6 +519,7 @@ enum class BITMAPS : unsigned int stripline, stroke_dash, stroke_dashdot, + stroke_dashdotdot, stroke_dot, stroke_solid, swap_layer, diff --git a/include/stroke_params.h b/include/stroke_params.h index a7b4770d44..af097933db 100644 --- a/include/stroke_params.h +++ b/include/stroke_params.h @@ -50,7 +50,8 @@ enum class PLOT_DASH_TYPE DASH, DOT, DASHDOT, - LAST_TYPE = DASHDOT + DASHDOTDOT, + LAST_TYPE = DASHDOTDOT }; @@ -69,7 +70,8 @@ const std::map lineTypeNames = { PLOT_DASH_TYPE::SOLID, { _( "Solid" ), BITMAPS::stroke_solid } }, { PLOT_DASH_TYPE::DASH, { _( "Dashed" ), BITMAPS::stroke_dash } }, { PLOT_DASH_TYPE::DOT, { _( "Dotted" ), BITMAPS::stroke_dot } }, - { PLOT_DASH_TYPE::DASHDOT, { _( "Dash-Dot" ), BITMAPS::stroke_dashdot } } + { PLOT_DASH_TYPE::DASHDOT, { _( "Dash-Dot" ), BITMAPS::stroke_dashdot } }, + { PLOT_DASH_TYPE::DASHDOTDOT, { _( "Dash-Dot-Dot" ), BITMAPS::stroke_dashdotdot } } };