diff --git a/eeschema/dialogs/dialog_plot_schematic.cpp b/eeschema/dialogs/dialog_plot_schematic.cpp index 66cb832070..add96ff631 100644 --- a/eeschema/dialogs/dialog_plot_schematic.cpp +++ b/eeschema/dialogs/dialog_plot_schematic.cpp @@ -47,6 +47,7 @@ // static members (static to remember last state): int DIALOG_PLOT_SCHEMATIC::m_pageSizeSelect = PAGE_SIZE_AUTO; +int DIALOG_PLOT_SCHEMATIC::m_HPGLPaperSizeSelect = PAGE_SIZE_AUTO; void SCH_EDIT_FRAME::PlotSchematic( wxCommandEvent& event ) @@ -63,12 +64,13 @@ void SCH_EDIT_FRAME::PlotSchematic( wxCommandEvent& event ) DIALOG_PLOT_SCHEMATIC::DIALOG_PLOT_SCHEMATIC( SCH_EDIT_FRAME* parent ) : DIALOG_PLOT_SCHEMATIC_BASE( parent ), + m_parent( parent ), + m_plotFormat( PLOT_FORMAT_UNDEFINED ), m_defaultLineWidth( parent, m_lineWidthLabel, m_lineWidthCtrl, m_lineWidthUnits, true ), m_penWidth( parent, m_penWidthLabel, m_penWidthCtrl, m_penWidthUnits, true ) { - m_parent = parent; - m_configChanged = false; m_config = Kiface().KifaceSettings(); + m_configChanged = false; m_browseButton->SetBitmap( KiBitmap( folder_xpm ) ); @@ -204,43 +206,48 @@ void DIALOG_PLOT_SCHEMATIC::OnUpdateUI( wxUpdateUIEvent& event ) { PlotFormat fmt = GetPlotFileFormat(); - wxArrayString paperSizes; - paperSizes.push_back( _( "Schematic size" ) ); - - int selection; - - if( fmt == PLOT_FORMAT_HPGL ) + if( fmt != m_plotFormat ) { - paperSizes.push_back( _( "A4" ) ); - paperSizes.push_back( _( "A3" ) ); - paperSizes.push_back( _( "A2" ) ); - paperSizes.push_back( _( "A1" ) ); - paperSizes.push_back( _( "A0" ) ); - paperSizes.push_back( _( "A" ) ); - paperSizes.push_back( _( "B" ) ); - paperSizes.push_back( _( "C" ) ); - paperSizes.push_back( _( "D" ) ); - paperSizes.push_back( _( "E" ) ); + m_plotFormat = fmt; - selection = m_HPGLPaperSizeSelect; + wxArrayString paperSizes; + paperSizes.push_back( _( "Schematic size" ) ); + + int selection; + + if( fmt == PLOT_FORMAT_HPGL ) + { + paperSizes.push_back( _( "A4" ) ); + paperSizes.push_back( _( "A3" ) ); + paperSizes.push_back( _( "A2" ) ); + paperSizes.push_back( _( "A1" ) ); + paperSizes.push_back( _( "A0" ) ); + paperSizes.push_back( _( "A" ) ); + paperSizes.push_back( _( "B" ) ); + paperSizes.push_back( _( "C" ) ); + paperSizes.push_back( _( "D" ) ); + paperSizes.push_back( _( "E" ) ); + + selection = m_HPGLPaperSizeSelect; + } + else + { + paperSizes.push_back( _( "A4" ) ); + paperSizes.push_back( _( "A" ) ); + + selection = m_pageSizeSelect; + } + + m_paperSizeOption->Set( paperSizes ); + m_paperSizeOption->SetSelection( selection ); + + m_defaultLineWidth.Enable( fmt == PLOT_FORMAT_POST || fmt == PLOT_FORMAT_PDF + || fmt == PLOT_FORMAT_SVG ); + + m_plotOriginTitle->Enable( fmt == PLOT_FORMAT_HPGL ); + m_plotOriginOpt->Enable( fmt == PLOT_FORMAT_HPGL ); + m_penWidth.Enable( fmt == PLOT_FORMAT_HPGL ); } - else - { - paperSizes.push_back( _( "A4" ) ); - paperSizes.push_back( _( "A" ) ); - - selection = m_pageSizeSelect; - } - - m_paperSizeOption->Set( paperSizes ); - m_paperSizeOption->SetSelection( selection ); - - m_defaultLineWidth.Enable( fmt == PLOT_FORMAT_POST || fmt == PLOT_FORMAT_PDF - || fmt == PLOT_FORMAT_SVG ); - - m_plotOriginTitle->Enable( fmt == PLOT_FORMAT_HPGL ); - m_plotOriginOpt->Enable( fmt == PLOT_FORMAT_HPGL ); - m_penWidth.Enable( fmt == PLOT_FORMAT_HPGL ); } diff --git a/eeschema/dialogs/dialog_plot_schematic.h b/eeschema/dialogs/dialog_plot_schematic.h index f53d840a0f..57bc470893 100644 --- a/eeschema/dialogs/dialog_plot_schematic.h +++ b/eeschema/dialogs/dialog_plot_schematic.h @@ -49,10 +49,9 @@ private: SCH_EDIT_FRAME* m_parent; wxConfigBase* m_config; bool m_configChanged; // true if a project config param has changed - static int m_pageSizeSelect; // Static to keep last option for some format: - // Static to keep last option: - // use default size or force A or A4 size - int m_HPGLPaperSizeSelect; // for HPGL format only: last selected paper size + PlotFormat m_plotFormat; + static int m_pageSizeSelect; // Static to keep last option for some format + static int m_HPGLPaperSizeSelect; // for HPGL format only: last selected paper size double m_HPGLPenSize; // for HPGL format only: pen size UNIT_BINDER m_defaultLineWidth; diff --git a/include/plotter.h b/include/plotter.h index 7021a04f07..4791ed0770 100644 --- a/include/plotter.h +++ b/include/plotter.h @@ -48,6 +48,7 @@ class GBR_NETLIST_METADATA; * of the radio buttons in the plot panel/windows. */ enum PlotFormat { + PLOT_FORMAT_UNDEFINED = -1, PLOT_FIRST_FORMAT = 0, PLOT_FORMAT_HPGL = PLOT_FIRST_FORMAT, PLOT_FORMAT_GERBER, diff --git a/pcbnew/dialogs/dialog_copper_zones.cpp b/pcbnew/dialogs/dialog_copper_zones.cpp index 43888f3730..042e28e2ae 100644 --- a/pcbnew/dialogs/dialog_copper_zones.cpp +++ b/pcbnew/dialogs/dialog_copper_zones.cpp @@ -54,6 +54,8 @@ private: long m_NetFiltering; static wxString m_netNameShowFilter; // the filter to show nets (default * "*"). // static to keep this pattern for an entire Pcbnew session + int m_cornerSmoothingType; + UNIT_BINDER m_cornerRadius; UNIT_BINDER m_clearance; UNIT_BINDER m_minWidth; @@ -96,6 +98,7 @@ int InvokeCopperZonesEditor( PCB_BASE_FRAME* aCaller, ZONE_SETTINGS* aSettings ) DIALOG_COPPER_ZONE::DIALOG_COPPER_ZONE( PCB_BASE_FRAME* aParent, ZONE_SETTINGS* aSettings ) : DIALOG_COPPER_ZONE_BASE( aParent ), + m_cornerSmoothingType( ZONE_SETTINGS::SMOOTHING_UNDEFINED ), m_cornerRadius( aParent, m_cornerRadiusLabel, m_cornerRadiusCtrl, m_cornerRadiusUnits, true, 0 ), m_clearance( aParent, m_clearanceLabel, m_clearanceCtrl, m_clearanceUnits, true, 0, ZONE_CLEARANCE_MAX_VALUE_MIL*IU_PER_MILS ), m_minWidth( aParent, m_minWidthLabel, m_minWidthCtrl, m_minWidthUnits, true, ZONE_THICKNESS_MIN_VALUE_MIL*IU_PER_MILS ), @@ -183,10 +186,15 @@ void DIALOG_COPPER_ZONE::OnUpdateUI( wxUpdateUIEvent& ) m_bNoNetWarning->Show( m_ListNetNameSelection->GetSelection() == 0 ); - if( m_cornerSmoothingChoice->GetSelection() == ZONE_SETTINGS::SMOOTHING_CHAMFER ) - m_cornerRadiusLabel->SetLabel( _( "Chamfer distance:" ) ); - else - m_cornerRadiusLabel->SetLabel( _( "Fillet radius:" ) ); + if( m_cornerSmoothingType != m_cornerSmoothingChoice->GetSelection() ) + { + m_cornerSmoothingType = m_cornerSmoothingChoice->GetSelection(); + + if( m_cornerSmoothingChoice->GetSelection() == ZONE_SETTINGS::SMOOTHING_CHAMFER ) + m_cornerRadiusLabel->SetLabel( _( "Chamfer distance:" ) ); + else + m_cornerRadiusLabel->SetLabel( _( "Fillet radius:" ) ); + } } diff --git a/pcbnew/zone_settings.h b/pcbnew/zone_settings.h index ea4ddf6ccb..a4939021dc 100644 --- a/pcbnew/zone_settings.h +++ b/pcbnew/zone_settings.h @@ -51,7 +51,8 @@ class ZONE_SETTINGS { public: enum { - SMOOTHING_NONE, + SMOOTHING_UNDEFINED = -1, + SMOOTHING_NONE = 0, SMOOTHING_CHAMFER, SMOOTHING_FILLET, SMOOTHING_LAST