kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #11367
Joint diameter option in Eeschema
Hi,
for me the diameter of the joints in Eeschema is too big.
So I made a patch which adds a joint diameter setting to the option
dialog. I hope you find it useful.
André
=== modified file 'eeschema/dialogs/dialog_eeschema_options.h'
--- eeschema/dialogs/dialog_eeschema_options.h 2013-07-19 18:27:22 +0000
+++ eeschema/dialogs/dialog_eeschema_options.h 2013-10-02 00:08:18 +0000
@@ -58,6 +58,9 @@
void SetLineWidth( int aWidth ) { m_spinLineWidth->SetValue( aWidth ); }
int GetLineWidth( void ) { return m_spinLineWidth->GetValue(); }
+ void SetJointDiameter( int aDiameter ) { m_spinJointDiameter->SetValue( aDiameter ); }
+ int GetJointDiameter( void ) { return m_spinJointDiameter->GetValue(); }
+
void SetTextSize( int text_size ) { m_spinTextSize->SetValue( text_size ); }
int GetTextSize( void ) { return m_spinTextSize->GetValue(); }
=== modified file 'eeschema/dialogs/dialog_eeschema_options_base.cpp'
--- eeschema/dialogs/dialog_eeschema_options_base.cpp 2013-07-22 16:45:22 +0000
+++ eeschema/dialogs/dialog_eeschema_options_base.cpp 2013-10-02 00:07:22 +0000
@@ -89,6 +89,17 @@
m_staticLineWidthUnits->Wrap( -1 );
fgSizer1->Add( m_staticLineWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
+ m_staticText52 = new wxStaticText( m_panel1, wxID_ANY, _("&Joint diameter:"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticText52->Wrap( -1 );
+ fgSizer1->Add( m_staticText52, 1, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_spinJointDiameter = new wxSpinCtrl( m_panel1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, 1, 100, 1 );
+ fgSizer1->Add( m_spinJointDiameter, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
+
+ m_staticJointDiameterUnits = new wxStaticText( m_panel1, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticJointDiameterUnits->Wrap( -1 );
+ fgSizer1->Add( m_staticJointDiameterUnits, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
+
m_staticText7 = new wxStaticText( m_panel1, wxID_ANY, _("Default text &size:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText7->Wrap( -1 );
fgSizer1->Add( m_staticText7, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
=== modified file 'eeschema/dialogs/dialog_eeschema_options_base.fbp'
--- eeschema/dialogs/dialog_eeschema_options_base.fbp 2013-07-22 16:45:22 +0000
+++ eeschema/dialogs/dialog_eeschema_options_base.fbp 2013-10-01 23:58:11 +0000
@@ -1231,6 +1231,259 @@
<event name="OnUpdateUI"></event>
</object>
</object>
+ <object class="sizeritem" expanded="1">
+ <property name="border">5</property>
+ <property name="flag">wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL</property>
+ <property name="proportion">1</property>
+ <object class="wxStaticText" expanded="1">
+ <property name="BottomDockable">1</property>
+ <property name="LeftDockable">1</property>
+ <property name="RightDockable">1</property>
+ <property name="TopDockable">1</property>
+ <property name="aui_layer"></property>
+ <property name="aui_name"></property>
+ <property name="aui_position"></property>
+ <property name="aui_row"></property>
+ <property name="best_size"></property>
+ <property name="bg"></property>
+ <property name="caption"></property>
+ <property name="caption_visible">1</property>
+ <property name="center_pane">0</property>
+ <property name="close_button">1</property>
+ <property name="context_help"></property>
+ <property name="context_menu">1</property>
+ <property name="default_pane">0</property>
+ <property name="dock">Dock</property>
+ <property name="dock_fixed">0</property>
+ <property name="docking">Left</property>
+ <property name="enabled">1</property>
+ <property name="fg"></property>
+ <property name="floatable">1</property>
+ <property name="font"></property>
+ <property name="gripper">0</property>
+ <property name="hidden">0</property>
+ <property name="id">wxID_ANY</property>
+ <property name="label">&Joint diameter:</property>
+ <property name="max_size"></property>
+ <property name="maximize_button">0</property>
+ <property name="maximum_size"></property>
+ <property name="min_size"></property>
+ <property name="minimize_button">0</property>
+ <property name="minimum_size"></property>
+ <property name="moveable">1</property>
+ <property name="name">m_staticText52</property>
+ <property name="pane_border">1</property>
+ <property name="pane_position"></property>
+ <property name="pane_size"></property>
+ <property name="permission">protected</property>
+ <property name="pin_button">1</property>
+ <property name="pos"></property>
+ <property name="resize">Resizable</property>
+ <property name="show">1</property>
+ <property name="size"></property>
+ <property name="style"></property>
+ <property name="subclass"></property>
+ <property name="toolbar_pane">0</property>
+ <property name="tooltip"></property>
+ <property name="window_extra_style"></property>
+ <property name="window_name"></property>
+ <property name="window_style"></property>
+ <property name="wrap">-1</property>
+ <event name="OnChar"></event>
+ <event name="OnEnterWindow"></event>
+ <event name="OnEraseBackground"></event>
+ <event name="OnKeyDown"></event>
+ <event name="OnKeyUp"></event>
+ <event name="OnKillFocus"></event>
+ <event name="OnLeaveWindow"></event>
+ <event name="OnLeftDClick"></event>
+ <event name="OnLeftDown"></event>
+ <event name="OnLeftUp"></event>
+ <event name="OnMiddleDClick"></event>
+ <event name="OnMiddleDown"></event>
+ <event name="OnMiddleUp"></event>
+ <event name="OnMotion"></event>
+ <event name="OnMouseEvents"></event>
+ <event name="OnMouseWheel"></event>
+ <event name="OnPaint"></event>
+ <event name="OnRightDClick"></event>
+ <event name="OnRightDown"></event>
+ <event name="OnRightUp"></event>
+ <event name="OnSetFocus"></event>
+ <event name="OnSize"></event>
+ <event name="OnUpdateUI"></event>
+ </object>
+ </object>
+ <object class="sizeritem" expanded="1">
+ <property name="border">5</property>
+ <property name="flag">wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND</property>
+ <property name="proportion">0</property>
+ <object class="wxSpinCtrl" expanded="1">
+ <property name="BottomDockable">1</property>
+ <property name="LeftDockable">1</property>
+ <property name="RightDockable">1</property>
+ <property name="TopDockable">1</property>
+ <property name="aui_layer"></property>
+ <property name="aui_name"></property>
+ <property name="aui_position"></property>
+ <property name="aui_row"></property>
+ <property name="best_size"></property>
+ <property name="bg"></property>
+ <property name="caption"></property>
+ <property name="caption_visible">1</property>
+ <property name="center_pane">0</property>
+ <property name="close_button">1</property>
+ <property name="context_help"></property>
+ <property name="context_menu">1</property>
+ <property name="default_pane">0</property>
+ <property name="dock">Dock</property>
+ <property name="dock_fixed">0</property>
+ <property name="docking">Left</property>
+ <property name="enabled">1</property>
+ <property name="fg"></property>
+ <property name="floatable">1</property>
+ <property name="font"></property>
+ <property name="gripper">0</property>
+ <property name="hidden">0</property>
+ <property name="id">wxID_ANY</property>
+ <property name="initial">1</property>
+ <property name="max">100</property>
+ <property name="max_size"></property>
+ <property name="maximize_button">0</property>
+ <property name="maximum_size"></property>
+ <property name="min">1</property>
+ <property name="min_size"></property>
+ <property name="minimize_button">0</property>
+ <property name="minimum_size"></property>
+ <property name="moveable">1</property>
+ <property name="name">m_spinJointDiameter</property>
+ <property name="pane_border">1</property>
+ <property name="pane_position"></property>
+ <property name="pane_size"></property>
+ <property name="permission">protected</property>
+ <property name="pin_button">1</property>
+ <property name="pos"></property>
+ <property name="resize">Resizable</property>
+ <property name="show">1</property>
+ <property name="size"></property>
+ <property name="style">wxSP_ARROW_KEYS|wxSP_WRAP</property>
+ <property name="subclass"></property>
+ <property name="toolbar_pane">0</property>
+ <property name="tooltip"></property>
+ <property name="value"></property>
+ <property name="window_extra_style"></property>
+ <property name="window_name"></property>
+ <property name="window_style"></property>
+ <event name="OnChar"></event>
+ <event name="OnEnterWindow"></event>
+ <event name="OnEraseBackground"></event>
+ <event name="OnKeyDown"></event>
+ <event name="OnKeyUp"></event>
+ <event name="OnKillFocus"></event>
+ <event name="OnLeaveWindow"></event>
+ <event name="OnLeftDClick"></event>
+ <event name="OnLeftDown"></event>
+ <event name="OnLeftUp"></event>
+ <event name="OnMiddleDClick"></event>
+ <event name="OnMiddleDown"></event>
+ <event name="OnMiddleUp"></event>
+ <event name="OnMotion"></event>
+ <event name="OnMouseEvents"></event>
+ <event name="OnMouseWheel"></event>
+ <event name="OnPaint"></event>
+ <event name="OnRightDClick"></event>
+ <event name="OnRightDown"></event>
+ <event name="OnRightUp"></event>
+ <event name="OnSetFocus"></event>
+ <event name="OnSize"></event>
+ <event name="OnSpinCtrl"></event>
+ <event name="OnSpinCtrlText"></event>
+ <event name="OnUpdateUI"></event>
+ </object>
+ </object>
+ <object class="sizeritem" expanded="1">
+ <property name="border">5</property>
+ <property name="flag">wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL</property>
+ <property name="proportion">0</property>
+ <object class="wxStaticText" expanded="1">
+ <property name="BottomDockable">1</property>
+ <property name="LeftDockable">1</property>
+ <property name="RightDockable">1</property>
+ <property name="TopDockable">1</property>
+ <property name="aui_layer"></property>
+ <property name="aui_name"></property>
+ <property name="aui_position"></property>
+ <property name="aui_row"></property>
+ <property name="best_size"></property>
+ <property name="bg"></property>
+ <property name="caption"></property>
+ <property name="caption_visible">1</property>
+ <property name="center_pane">0</property>
+ <property name="close_button">1</property>
+ <property name="context_help"></property>
+ <property name="context_menu">1</property>
+ <property name="default_pane">0</property>
+ <property name="dock">Dock</property>
+ <property name="dock_fixed">0</property>
+ <property name="docking">Left</property>
+ <property name="enabled">1</property>
+ <property name="fg"></property>
+ <property name="floatable">1</property>
+ <property name="font"></property>
+ <property name="gripper">0</property>
+ <property name="hidden">0</property>
+ <property name="id">wxID_ANY</property>
+ <property name="label">mils</property>
+ <property name="max_size"></property>
+ <property name="maximize_button">0</property>
+ <property name="maximum_size"></property>
+ <property name="min_size"></property>
+ <property name="minimize_button">0</property>
+ <property name="minimum_size"></property>
+ <property name="moveable">1</property>
+ <property name="name">m_staticJointDiameterUnits</property>
+ <property name="pane_border">1</property>
+ <property name="pane_position"></property>
+ <property name="pane_size"></property>
+ <property name="permission">protected</property>
+ <property name="pin_button">1</property>
+ <property name="pos"></property>
+ <property name="resize">Resizable</property>
+ <property name="show">1</property>
+ <property name="size"></property>
+ <property name="style"></property>
+ <property name="subclass"></property>
+ <property name="toolbar_pane">0</property>
+ <property name="tooltip"></property>
+ <property name="window_extra_style"></property>
+ <property name="window_name"></property>
+ <property name="window_style"></property>
+ <property name="wrap">-1</property>
+ <event name="OnChar"></event>
+ <event name="OnEnterWindow"></event>
+ <event name="OnEraseBackground"></event>
+ <event name="OnKeyDown"></event>
+ <event name="OnKeyUp"></event>
+ <event name="OnKillFocus"></event>
+ <event name="OnLeaveWindow"></event>
+ <event name="OnLeftDClick"></event>
+ <event name="OnLeftDown"></event>
+ <event name="OnLeftUp"></event>
+ <event name="OnMiddleDClick"></event>
+ <event name="OnMiddleDown"></event>
+ <event name="OnMiddleUp"></event>
+ <event name="OnMotion"></event>
+ <event name="OnMouseEvents"></event>
+ <event name="OnMouseWheel"></event>
+ <event name="OnPaint"></event>
+ <event name="OnRightDClick"></event>
+ <event name="OnRightDown"></event>
+ <event name="OnRightUp"></event>
+ <event name="OnSetFocus"></event>
+ <event name="OnSize"></event>
+ <event name="OnUpdateUI"></event>
+ </object>
+ </object>
<object class="sizeritem" expanded="0">
<property name="border">3</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT</property>
=== modified file 'eeschema/dialogs/dialog_eeschema_options_base.h'
--- eeschema/dialogs/dialog_eeschema_options_base.h 2013-07-19 18:27:22 +0000
+++ eeschema/dialogs/dialog_eeschema_options_base.h 2013-10-02 00:07:22 +0000
@@ -69,6 +69,9 @@
wxStaticText* m_staticText5;
wxSpinCtrl* m_spinLineWidth;
wxStaticText* m_staticLineWidthUnits;
+ wxStaticText* m_staticText52;
+ wxSpinCtrl* m_spinJointDiameter;
+ wxStaticText* m_staticJointDiameterUnits;
wxStaticText* m_staticText7;
wxSpinCtrl* m_spinTextSize;
wxStaticText* m_staticTextSizeUnits;
=== modified file 'eeschema/eeschema_config.cpp'
--- eeschema/eeschema_config.cpp 2013-07-19 18:27:22 +0000
+++ eeschema/eeschema_config.cpp 2013-10-02 00:14:32 +0000
@@ -91,6 +91,24 @@
s_drawDefaultLineThickness = 1;
}
+/*
+ * Default joint (in Eeschema units) diameter used to draw/plot joints.
+ */
+static int s_drawJointDiameter;
+
+int GetJointDiameter()
+{
+ return s_drawJointDiameter;
+}
+
+void SetJointDiameter( int aDiameter)
+{
+ if( aDiameter >=1 )
+ s_drawJointDiameter = aDiameter;
+ else
+ s_drawJointDiameter = 1;
+}
+
EDA_COLOR_T GetLayerColor( LayerNumber aLayer )
{
return s_layerColor[aLayer];
@@ -268,6 +286,7 @@
dlg.SetGridSizes( grid_list, GetScreen()->GetGridId() );
dlg.SetBusWidth( GetDefaultBusThickness() );
dlg.SetLineWidth( GetDefaultLineThickness() );
+ dlg.SetJointDiameter( GetJointDiameter() );
dlg.SetTextSize( GetDefaultLabelSize() );
dlg.SetRepeatHorizontal( g_RepeatStep.x );
dlg.SetRepeatVertical( g_RepeatStep.y );
@@ -315,6 +334,7 @@
SetDefaultBusThickness( dlg.GetBusWidth() );
SetDefaultLineThickness( dlg.GetLineWidth() );
+ SetJointDiameter( dlg.GetJointDiameter() );
SetDefaultLabelSize( dlg.GetTextSize() );
g_RepeatStep.x = dlg.GetRepeatHorizontal();
g_RepeatStep.y = dlg.GetRepeatVertical();
@@ -479,6 +499,7 @@
static const wxString DefaultBusWidthEntry( wxT( "DefaultBusWidth" ) );
static const wxString DefaultDrawLineWidthEntry( wxT( "DefaultDrawLineWidth" ) );
+static const wxString DrawJointDiameterEntry( wxT( "DrawJointDiameter" ) );
static const wxString ShowHiddenPinsEntry( wxT( "ShowHiddenPins" ) );
static const wxString HorzVertLinesOnlyEntry( wxT( "HorizVertLinesOnly" ) );
static const wxString PreviewFramePositionXEntry( wxT( "PreviewFramePositionX" ) );
@@ -608,6 +629,7 @@
SetDefaultBusThickness( cfg->Read( DefaultBusWidthEntry, 12l ) );
SetDefaultLineThickness( cfg->Read( DefaultDrawLineWidthEntry, 6l ) );
+ SetJointDiameter( cfg->Read( DrawJointDiameterEntry, 40l ) );
cfg->Read( ShowHiddenPinsEntry, &m_showAllPins, false );
cfg->Read( HorzVertLinesOnlyEntry, &m_forceHVLines, true );
@@ -699,6 +721,7 @@
cfg->Write( DefaultBusWidthEntry, (long) GetDefaultBusThickness() );
cfg->Write( DefaultDrawLineWidthEntry, (long) GetDefaultLineThickness() );
+ cfg->Write( DrawJointDiameterEntry, (long) GetJointDiameter() );
cfg->Write( ShowHiddenPinsEntry, m_showAllPins );
cfg->Write( HorzVertLinesOnlyEntry, GetForceHVLines() );
=== modified file 'eeschema/general.h'
--- eeschema/general.h 2013-09-25 19:09:57 +0000
+++ eeschema/general.h 2013-10-02 00:10:18 +0000
@@ -77,6 +77,12 @@
void SetDefaultLineThickness( int aThickness);
/**
+ * Joint diameter used to draw/plot joints.
+ */
+int GetJointDiameter();
+void SetJointDiameter( int aDiameter);
+
+/**
* Default line thickness used to draw/plot busses.
*/
int GetDefaultBusThickness();
=== modified file 'eeschema/sch_junction.cpp'
--- eeschema/sch_junction.cpp 2013-09-29 18:24:38 +0000
+++ eeschema/sch_junction.cpp 2013-10-02 00:29:00 +0000
@@ -34,13 +34,12 @@
#include <common.h>
#include <richio.h>
#include <plot_common.h>
+#include <general.h>
#include <sch_junction.h>
#include <class_netlist_object.h>
-int SCH_JUNCTION::m_symbolSize = 40; // Default diameter of the junction symbol
-
SCH_JUNCTION::SCH_JUNCTION( const wxPoint& pos ) :
SCH_ITEM( NULL, SCH_JUNCTION_T )
{
@@ -108,6 +107,16 @@
return rect;
}
+int SCH_JUNCTION::GetSymbolSize()
+{
+ return GetJointDiameter();
+}
+
+void SCH_JUNCTION::SetSymbolSize( int aSize )
+{
+ SetJointDiameter(aSize);
+}
+
void SCH_JUNCTION::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
GR_DRAWMODE aDrawMode, EDA_COLOR_T aColor )
=== modified file 'eeschema/sch_junction.h'
--- eeschema/sch_junction.h 2013-09-25 19:09:57 +0000
+++ eeschema/sch_junction.h 2013-10-01 23:45:46 +0000
@@ -36,7 +36,6 @@
class SCH_JUNCTION : public SCH_ITEM
{
wxPoint m_pos; // Position of the junction.
- static int m_symbolSize; // diameter of the junction graphic symbol
public:
SCH_JUNCTION( const wxPoint& pos = wxPoint( 0, 0 ) );
@@ -50,8 +49,8 @@
return wxT( "SCH_JUNCTION" );
}
- static int GetSymbolSize() { return m_symbolSize; }
- static void SetSymbolSize( int aSize ) { m_symbolSize = aSize; }
+ static int GetSymbolSize();
+ static void SetSymbolSize( int aSize );
void SwapData( SCH_ITEM* aItem );