Eeschema: editors: show the pin position (when clicking on it) in message panel.

Pin properties dialog: show pin position ( and allow editon ).
This commit is contained in:
jean-pierre charras 2016-10-18 18:59:26 +02:00
parent c483574658
commit 1924478558
11 changed files with 709 additions and 46 deletions

View File

@ -53,7 +53,7 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateAndShowItem( const wxPoint& aPosition, const KIC
{
SCH_ITEM* item;
LIB_PIN* Pin = NULL;
SCH_COMPONENT* LibItem = NULL;
SCH_COMPONENT* component = NULL;
wxPoint gridPosition = GetNearestGridPosition( aPosition );
// Check the on grid position first. There is more likely to be multiple items on
@ -82,18 +82,18 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateAndShowItem( const wxPoint& aPosition, const KIC
{
case SCH_FIELD_T:
case LIB_FIELD_T:
LibItem = (SCH_COMPONENT*) item->GetParent();
SendMessageToPCBNEW( item, LibItem );
component = (SCH_COMPONENT*) item->GetParent();
SendMessageToPCBNEW( item, component );
break;
case SCH_COMPONENT_T:
LibItem = (SCH_COMPONENT*) item;
SendMessageToPCBNEW( item, LibItem );
component = (SCH_COMPONENT*) item;
SendMessageToPCBNEW( item, component );
break;
case LIB_PIN_T:
Pin = (LIB_PIN*) item;
LibItem = (SCH_COMPONENT*) LocateItem( aPosition, SCH_COLLECTOR::ComponentsOnly );
component = (SCH_COMPONENT*) LocateItem( aPosition, SCH_COLLECTOR::ComponentsOnly );
break;
default:
@ -105,16 +105,12 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateAndShowItem( const wxPoint& aPosition, const KIC
// Force display pin information (the previous display could be a component info)
MSG_PANEL_ITEMS items;
Pin->GetMsgPanelInfo( items );
if( LibItem )
items.push_back( MSG_PANEL_ITEM( LibItem->GetRef( m_CurrentSheet ),
LibItem->GetField( VALUE )->GetShownText(), DARKCYAN ) );
Pin->GetMsgPanelInfo( items, component );
SetMsgPanel( items );
// Cross probing:2 - pin found, and send a locate pin command to Pcbnew (highlight net)
SendMessageToPCBNEW( Pin, LibItem );
SendMessageToPCBNEW( Pin, component );
}
return item;

View File

@ -154,6 +154,14 @@ void DIALOG_LIB_EDIT_PIN::OnPropertiesChange( wxCommandEvent& event )
m_panelShowPin->Refresh();
}
void DIALOG_LIB_EDIT_PIN::SetDlgUnitsLabel( const wxString& units )
{
m_staticNameTextSizeUnits->SetLabel( units );
m_staticNumberTextSizeUnits->SetLabel( units );
m_staticLengthUnits->SetLabel( units );
m_staticPosXUnits->SetLabel( units );
m_staticPosYUnits->SetLabel( units );
}
void DIALOG_LIB_EDIT_PIN::SetOrientationList( const wxArrayString& list,
const BITMAP_DEF* aBitmaps )

View File

@ -86,9 +86,24 @@ public:
return m_textPinNameTextSize->GetValue();
}
void SetPinNameTextSizeUnits( const wxString& units )
void SetPinPositionX( const wxString& aSize )
{
m_staticNameTextSizeUnits->SetLabel( units );
m_textPinPosX->SetValue( aSize );
}
void SetPinPositionY( const wxString& aSize )
{
m_textPinPosY->SetValue( aSize );
}
wxString GetPinPositionX()
{
return m_textPinPosX->GetValue();
}
wxString GetPinPositionY()
{
return m_textPinPosY->GetValue();
}
void SetPadName( const wxString& number )
@ -106,22 +121,12 @@ public:
return m_textPadNameTextSize->GetValue();
}
void SetPadNameTextSizeUnits( const wxString& units )
{
m_staticNumberTextSizeUnits->SetLabel( units );
}
void SetLength( const wxString& length )
{
m_textLength->SetValue( length );
}
wxString GetLength( void ) { return m_textLength->GetValue(); }
void SetLengthUnits( const wxString& units )
{
m_staticLengthUnits->SetLabel( units );
}
void SetAddToAllParts( bool apply )
{
m_checkApplyToAllParts->SetValue( apply );
@ -140,6 +145,8 @@ public:
return m_checkApplyToAllConversions->GetValue();
}
void SetDlgUnitsLabel( const wxString& units );
void SetVisible( bool visible ) { m_checkShow->SetValue( visible ); }
bool GetVisible( void ) { return m_checkShow->GetValue(); }
};

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Mar 28 2015)
// C++ code generated with wxFormBuilder (version Sep 8 2016)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@ -37,7 +37,6 @@ DIALOG_LIB_EDIT_PIN_BASE::DIALOG_LIB_EDIT_PIN_BASE( wxWindow* parent, wxWindowID
fgSizerPins->Add( m_staticTextPinName, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
m_textPinName = new wxTextCtrl( this, ID_M_TEXTPINNAME, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_textPinName->SetMaxLength( 0 );
fgSizerPins->Add( m_textPinName, 0, wxEXPAND|wxTOP|wxBOTTOM, 3 );
m_staticTextPadName = new wxStaticText( this, ID_M_STATICTEXTPADNAME, _("Pin n&umber:"), wxDefaultPosition, wxDefaultSize, 0 );
@ -47,7 +46,6 @@ DIALOG_LIB_EDIT_PIN_BASE::DIALOG_LIB_EDIT_PIN_BASE( wxWindow* parent, wxWindowID
fgSizerPins->Add( m_staticTextPadName, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
m_textPadName = new wxTextCtrl( this, ID_M_TEXTPADNAME, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_textPadName->SetMaxLength( 0 );
fgSizerPins->Add( m_textPadName, 0, wxEXPAND|wxTOP|wxBOTTOM, 3 );
m_staticTextOrient = new wxStaticText( this, wxID_ANY, _("&Orientation:"), wxDefaultPosition, wxDefaultSize, 0 );
@ -111,7 +109,7 @@ DIALOG_LIB_EDIT_PIN_BASE::DIALOG_LIB_EDIT_PIN_BASE( wxWindow* parent, wxWindowID
bRightSizer = new wxBoxSizer( wxVERTICAL );
wxFlexGridSizer* fgSizerTextsSizes;
fgSizerTextsSizes = new wxFlexGridSizer( 3, 3, 0, 0 );
fgSizerTextsSizes = new wxFlexGridSizer( 0, 3, 0, 0 );
fgSizerTextsSizes->AddGrowableCol( 1 );
fgSizerTextsSizes->SetFlexibleDirection( wxBOTH );
fgSizerTextsSizes->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_ALL );
@ -121,7 +119,6 @@ DIALOG_LIB_EDIT_PIN_BASE::DIALOG_LIB_EDIT_PIN_BASE( wxWindow* parent, wxWindowID
fgSizerTextsSizes->Add( m_staticTextNameSize, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
m_textPinNameTextSize = new wxTextCtrl( this, ID_M_TEXTPINNAMETEXTSIZE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_textPinNameTextSize->SetMaxLength( 0 );
fgSizerTextsSizes->Add( m_textPinNameTextSize, 1, wxEXPAND|wxTOP|wxBOTTOM, 3 );
m_staticNameTextSizeUnits = new wxStaticText( this, ID_M_STATICNAMETEXTSIZEUNITS, _("units"), wxDefaultPosition, wxDefaultSize, 0 );
@ -133,8 +130,7 @@ DIALOG_LIB_EDIT_PIN_BASE::DIALOG_LIB_EDIT_PIN_BASE( wxWindow* parent, wxWindowID
fgSizerTextsSizes->Add( m_staticTextPadNameSize, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
m_textPadNameTextSize = new wxTextCtrl( this, ID_M_TEXTPADNAMETEXTSIZE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_textPadNameTextSize->SetMaxLength( 0 );
fgSizerTextsSizes->Add( m_textPadNameTextSize, 0, wxTOP|wxBOTTOM|wxEXPAND, 3 );
fgSizerTextsSizes->Add( m_textPadNameTextSize, 0, wxEXPAND|wxTOP, 3 );
m_staticNumberTextSizeUnits = new wxStaticText( this, ID_M_STATICNUMBERTEXTSIZEUNITS, _("units"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticNumberTextSizeUnits->Wrap( -1 );
@ -142,16 +138,37 @@ DIALOG_LIB_EDIT_PIN_BASE::DIALOG_LIB_EDIT_PIN_BASE( wxWindow* parent, wxWindowID
m_staticTextPinLen = new wxStaticText( this, ID_M_STATICTEXTPINLEN, _("&Length:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextPinLen->Wrap( -1 );
fgSizerTextsSizes->Add( m_staticTextPinLen, 0, wxALL, 5 );
fgSizerTextsSizes->Add( m_staticTextPinLen, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_textLength = new wxTextCtrl( this, ID_M_TEXTLENGTH, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_textLength->SetMaxLength( 0 );
fgSizerTextsSizes->Add( m_textLength, 0, wxTOP|wxBOTTOM|wxEXPAND, 5 );
fgSizerTextsSizes->Add( m_textLength, 0, wxEXPAND|wxTOP, 5 );
m_staticLengthUnits = new wxStaticText( this, ID_M_STATICLENGTHUNITS, _("units"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticLengthUnits->Wrap( -1 );
fgSizerTextsSizes->Add( m_staticLengthUnits, 0, wxALL, 5 );
m_staticTextPinPosX = new wxStaticText( this, wxID_ANY, _("Pin Pos X:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextPinPosX->Wrap( -1 );
fgSizerTextsSizes->Add( m_staticTextPinPosX, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_textPinPosX = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerTextsSizes->Add( m_textPinPosX, 0, wxEXPAND|wxTOP, 5 );
m_staticPosXUnits = new wxStaticText( this, wxID_ANY, _("units"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticPosXUnits->Wrap( -1 );
fgSizerTextsSizes->Add( m_staticPosXUnits, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_staticPinPosY = new wxStaticText( this, wxID_ANY, _("Pin Pos Y:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticPinPosY->Wrap( -1 );
fgSizerTextsSizes->Add( m_staticPinPosY, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_textPinPosY = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerTextsSizes->Add( m_textPinPosY, 0, wxEXPAND|wxTOP, 5 );
m_staticPosYUnits = new wxStaticText( this, wxID_ANY, _("units"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticPosYUnits->Wrap( -1 );
fgSizerTextsSizes->Add( m_staticPosYUnits, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
bRightSizer->Add( fgSizerTextsSizes, 0, wxALL|wxEXPAND, 5 );

View File

@ -44,7 +44,7 @@
<property name="minimum_size"></property>
<property name="name">DIALOG_LIB_EDIT_PIN_BASE</property>
<property name="pos"></property>
<property name="size">515,370</property>
<property name="size">625,428</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title">Pin Properties</property>
@ -1018,6 +1018,7 @@
<property name="minimum_size"></property>
<property name="name">sbSizerPinSharing</property>
<property name="orient">wxVERTICAL</property>
<property name="parent">1</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
@ -1208,6 +1209,7 @@
<property name="minimum_size"></property>
<property name="name">sbSizerSchematicProperties</property>
<property name="orient">wxVERTICAL</property>
<property name="parent">1</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
@ -1327,7 +1329,7 @@
<property name="name">fgSizerTextsSizes</property>
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_ALL</property>
<property name="permission">none</property>
<property name="rows">3</property>
<property name="rows">0</property>
<property name="vgap">0</property>
<object class="sizeritem" expanded="1">
<property name="border">3</property>
@ -1671,7 +1673,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">3</property>
<property name="flag">wxTOP|wxBOTTOM|wxEXPAND</property>
<property name="flag">wxEXPAND|wxTOP</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1">
<property name="BottomDockable">1</property>
@ -1845,7 +1847,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
@ -1928,7 +1930,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxTOP|wxBOTTOM|wxEXPAND</property>
<property name="flag">wxEXPAND|wxTOP</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1">
<property name="BottomDockable">1</property>
@ -2100,6 +2102,520 @@
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|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">Pin Pos X:</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_staticTextPinPosX</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">wxEXPAND|wxTOP</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" 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="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="maxlength">0</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_textPinPosX</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="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></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="OnText"></event>
<event name="OnTextEnter"></event>
<event name="OnTextMaxLen"></event>
<event name="OnTextURL"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|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">units</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_staticPosXUnits</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</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">Pin Pos Y:</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_staticPinPosY</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">wxEXPAND|wxTOP</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" 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="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="maxlength">0</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_textPinPosY</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="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></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="OnText"></event>
<event name="OnTextEnter"></event>
<event name="OnTextMaxLen"></event>
<event name="OnTextURL"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|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">units</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_staticPosYUnits</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>
</object>
<object class="sizeritem" expanded="1">

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Mar 28 2015)
// C++ code generated with wxFormBuilder (version Sep 8 2016)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@ -81,6 +81,12 @@ class DIALOG_LIB_EDIT_PIN_BASE : public DIALOG_SHIM
wxStaticText* m_staticTextPinLen;
wxTextCtrl* m_textLength;
wxStaticText* m_staticLengthUnits;
wxStaticText* m_staticTextPinPosX;
wxTextCtrl* m_textPinPosX;
wxStaticText* m_staticPosXUnits;
wxStaticText* m_staticPinPosY;
wxTextCtrl* m_textPinPosY;
wxStaticText* m_staticPosYUnits;
wxPanel* m_panelShowPin;
wxStaticLine* m_staticline1;
wxStdDialogButtonSizer* m_sdbSizerButtons;
@ -98,7 +104,7 @@ class DIALOG_LIB_EDIT_PIN_BASE : public DIALOG_SHIM
public:
DIALOG_LIB_EDIT_PIN_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Pin Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 515,370 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
DIALOG_LIB_EDIT_PIN_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Pin Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 625,428 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_LIB_EDIT_PIN_BASE();
};

View File

@ -80,7 +80,7 @@ void LIB_ITEM::GetMsgPanelInfo( MSG_PANEL_ITEMS& aList )
else
msg = wxT( "?" );
aList.push_back( MSG_PANEL_ITEM( _( "Convert" ), msg, BROWN ) );
aList.push_back( MSG_PANEL_ITEM( _( "Converted" ), msg, BROWN ) );
}

View File

@ -368,6 +368,33 @@ void LIB_PIN::SetLength( int length )
}
void LIB_PIN::SetPinPosition( wxPoint aPosition )
{
if( m_position != aPosition )
{
m_position = aPosition;
SetModified();
}
if( GetParent() == NULL )
return;
LIB_PINS pinList;
GetParent()->GetPins( pinList );
for( size_t i = 0; i < pinList.size(); i++ )
{
if( ( pinList[i]->m_Flags & IS_LINKED ) == 0
|| pinList[i]->m_Convert != m_Convert
|| pinList[i]->m_position == aPosition )
continue;
pinList[i]->m_position = aPosition;
SetModified();
}
}
void LIB_PIN::SetPartNumber( int part )
{
if( m_Unit == part )
@ -1981,7 +2008,7 @@ void LIB_PIN::SetWidth( int aWidth )
}
void LIB_PIN::GetMsgPanelInfo( MSG_PANEL_ITEMS& aList )
void LIB_PIN::getMsgPanelInfoBase( MSG_PANEL_ITEMS& aList )
{
wxString text;
@ -2019,6 +2046,44 @@ void LIB_PIN::GetMsgPanelInfo( MSG_PANEL_ITEMS& aList )
aList.push_back( MSG_PANEL_ITEM( _( "Orientation" ), text, DARKMAGENTA ) );
}
void LIB_PIN::GetMsgPanelInfo( MSG_PANEL_ITEMS& aList )
{
getMsgPanelInfoBase( aList );
wxString text;
wxPoint pinpos = GetPosition();
pinpos.y = -pinpos.y; // Display coord are top to bottom
// lib items coord are bottom to top
text = StringFromValue( g_UserUnit, pinpos.x, true );
aList.push_back( MSG_PANEL_ITEM( _( "Pos X" ), text, DARKMAGENTA ) );
text = StringFromValue( g_UserUnit, pinpos.y, true );
aList.push_back( MSG_PANEL_ITEM( _( "Pos Y" ), text, DARKMAGENTA ) );
}
void LIB_PIN::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList,
SCH_COMPONENT* aComponent )
{
getMsgPanelInfoBase( aList );
if( !aComponent )
return;
wxString text;
wxPoint pinpos = aComponent->GetTransform().TransformCoordinate( GetPosition() )
+ aComponent->GetPosition();
text = StringFromValue( g_UserUnit, pinpos.x, true );
aList.push_back( MSG_PANEL_ITEM( _( "Pos X" ), text, DARKMAGENTA ) );
text = StringFromValue( g_UserUnit, pinpos.y, true );
aList.push_back( MSG_PANEL_ITEM( _( "Pos Y" ), text, DARKMAGENTA ) );
aList.push_back( MSG_PANEL_ITEM( aComponent->GetField( REFERENCE )->GetShownText(),
aComponent->GetField( VALUE )->GetShownText(),
DARKCYAN ) );
}
const EDA_RECT LIB_PIN::GetBoundingBox( bool aIncludeInvisibles ) const
{

View File

@ -30,6 +30,8 @@
#ifndef CLASS_PIN_H
#define CLASS_PIN_H
class SCH_COMPONENT;
#include <lib_draw_item.h>
#include "pin_shape.h"
@ -118,6 +120,13 @@ public:
void GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList ) override;
/**
* Display pin info (given by GetMsgPanelInfo) and add some info related to aComponent
* (schematic pin position, and sheet path)
* @param aComponent is the component which "owns" the pin
*/
void GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList, SCH_COMPONENT* aComponent );
bool Matches( wxFindReplaceData& aSearchData, void* aAuxData, wxPoint* aFindLocation ) override;
/* Cannot use a default parameter here as it will not be compatible with the virtual. */
@ -448,6 +457,14 @@ public:
wxPoint GetPosition() const override { return m_position; }
/**
* move this and all linked pins to the new position
* used in pin edition.
* use SetPinPosition to set the position of this only
* @param aPosition is the new position of this and linked pins
*/
void SetPinPosition( wxPoint aPosition );
void MirrorHorizontal( const wxPoint& aCenter ) override;
void MirrorVertical( const wxPoint& aCenter ) override;
@ -468,6 +485,13 @@ public:
EDA_ITEM* Clone() const override;
private:
/**
* Build the pin basic info to display in message panel.
* they are pin info without the actual pin position, which
* is not known in schematic without knowing the parent component
*/
void getMsgPanelInfoBase( std::vector< MSG_PANEL_ITEM >& aList );
/**
* @copydoc LIB_ITEM::compare()

View File

@ -57,6 +57,7 @@ void LIB_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& aPosition )
{
MSG_PANEL_ITEMS items;
item->GetMsgPanelInfo( items );
SetMsgPanel( items );
}
else

View File

@ -41,6 +41,7 @@
#include <class_libentry.h>
#include <lib_pin.h>
#include <general.h>
#include <confirm.h>
#include <../common/dialogs/dialog_display_info_HTML_base.h>
#include <dialog_lib_edit_pin.h>
@ -102,19 +103,20 @@ void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event )
DIALOG_LIB_EDIT_PIN dlg( this, pin );
wxString units = GetUnitsLabel( g_UserUnit );
dlg.SetDlgUnitsLabel( units );
dlg.SetOrientationList( LIB_PIN::GetOrientationNames(), LIB_PIN::GetOrientationSymbols() );
dlg.SetOrientation( LIB_PIN::GetOrientationCodeIndex( pin->GetOrientation() ) );
dlg.SetStyle( pin->GetShape() );
dlg.SetElectricalType( pin->GetType() );
dlg.SetPinName( pin->GetName() );
dlg.SetPinNameTextSize( StringFromValue( g_UserUnit, pin->GetNameTextSize() ) );
dlg.SetPinNameTextSizeUnits( units );
dlg.SetPinPositionX( StringFromValue( g_UserUnit, pin->GetPosition().x ) );
dlg.SetPinPositionY( StringFromValue( g_UserUnit, -pin->GetPosition().y ) );
dlg.SetPadName( pin->GetNumberString() );
dlg.SetPadNameTextSize( StringFromValue( g_UserUnit, pin->GetNumberTextSize() ) );
dlg.SetPadNameTextSizeUnits( units );
dlg.SetLength( StringFromValue( g_UserUnit, pin->GetLength() ) );
dlg.SetLengthUnits( units );
dlg.SetAddToAllParts( pin->GetUnit() == 0 );
dlg.SetAddToAllBodyStyles( pin->GetConvert() == 0 );
dlg.SetVisible( pin->IsVisible() );
@ -139,6 +141,25 @@ void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event )
return;
}
// Test the pin position validity: to avoid issues in schematic,
// it must be on a 50 mils grid
wxPoint pinpos;
pinpos.x = ValueFromString( g_UserUnit, dlg.GetPinPositionX() );
pinpos.y = -ValueFromString( g_UserUnit, dlg.GetPinPositionY() );
const int acceptable_mingrid = 50;
if( (pinpos.x % acceptable_mingrid) || (pinpos.y % acceptable_mingrid) )
{
wxString msg;
msg.Printf( _( "This pin is not on a %d mils grid\n"
"It will be not easy to connect in schematic\n"
"Do you want to continue?"), acceptable_mingrid );
if( !IsOK( this, msg ) )
return;
}
// Save the pin properties to use for the next new pin.
LastPinNameSize = ValueFromString( g_UserUnit, dlg.GetPinNameTextSize() );
LastPinNumSize = ValueFromString( g_UserUnit, dlg.GetPadNameTextSize() );
@ -157,6 +178,8 @@ void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event )
pin->SetNumberTextSize( GetLastPinNumSize() );
pin->SetOrientation( LastPinOrient );
pin->SetLength( GetLastPinLength() );
pin->SetPinPosition( pinpos );
pin->SetType( LastPinType );
pin->SetShape( LastPinShape );
pin->SetConversion( ( LastPinCommonConvert ) ? 0 : m_convert );