cvpcb: add send message to eeschema when selecting item in list components
This commit is contained in:
parent
d5cbd5d186
commit
31a4334a5a
|
@ -7,6 +7,7 @@
|
||||||
#include "macros.h"
|
#include "macros.h"
|
||||||
#include "confirm.h"
|
#include "confirm.h"
|
||||||
#include "eda_doc.h"
|
#include "eda_doc.h"
|
||||||
|
#include "eda_dde.h"
|
||||||
#include "gestfich.h"
|
#include "gestfich.h"
|
||||||
#include "param_config.h"
|
#include "param_config.h"
|
||||||
#include "bitmaps.h"
|
#include "bitmaps.h"
|
||||||
|
@ -316,6 +317,7 @@ void CVPCB_MAINFRAME::ToFirstNA( wxCommandEvent& event )
|
||||||
if( component.m_Module.IsEmpty() && ii > selection )
|
if( component.m_Module.IsEmpty() && ii > selection )
|
||||||
{
|
{
|
||||||
m_ListCmp->SetSelection( ii );
|
m_ListCmp->SetSelection( ii );
|
||||||
|
SendMessageToEESCHEMA();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -345,6 +347,7 @@ void CVPCB_MAINFRAME::ToPreviousNA( wxCommandEvent& event )
|
||||||
if( component.m_Module.IsEmpty() && ii < selection )
|
if( component.m_Module.IsEmpty() && ii < selection )
|
||||||
{
|
{
|
||||||
m_ListCmp->SetSelection( ii );
|
m_ListCmp->SetSelection( ii );
|
||||||
|
SendMessageToEESCHEMA();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -500,6 +503,7 @@ void CVPCB_MAINFRAME::OnSelectComponent( wxListEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
m_FootprintList->SetFootprintFilteredList( &m_components[ selection ], m_footprints );
|
m_FootprintList->SetFootprintFilteredList( &m_components[ selection ], m_footprints );
|
||||||
|
SendMessageToEESCHEMA();
|
||||||
DisplayStatus();
|
DisplayStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -617,3 +621,33 @@ void CVPCB_MAINFRAME::UpdateTitle()
|
||||||
|
|
||||||
SetTitle( title );
|
SetTitle( title );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send a remote command to Eeschema via a socket,
|
||||||
|
* Commands are
|
||||||
|
* $PART: "reference" put cursor on component anchor
|
||||||
|
*/
|
||||||
|
void CVPCB_MAINFRAME::SendMessageToEESCHEMA()
|
||||||
|
{
|
||||||
|
char cmd[1024];
|
||||||
|
int selection;
|
||||||
|
COMPONENT* Component;
|
||||||
|
|
||||||
|
if( m_components.empty() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
selection = m_ListCmp->GetSelection();
|
||||||
|
|
||||||
|
if ( selection < 0 )
|
||||||
|
selection = 0;
|
||||||
|
|
||||||
|
if( &m_components[ selection ] == NULL )
|
||||||
|
return;
|
||||||
|
|
||||||
|
Component = &m_components[ selection ];
|
||||||
|
|
||||||
|
sprintf( cmd, "$PART: \"%s\"", TO_UTF8( Component->m_Reference ) );
|
||||||
|
|
||||||
|
SendCommand( MSG_TO_SCH, cmd );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -233,6 +233,14 @@ public:
|
||||||
*/
|
*/
|
||||||
void UpdateTitle();
|
void UpdateTitle();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function SendMessageToEESCHEMA
|
||||||
|
* Send a remote command to Eeschema via a socket,
|
||||||
|
* Commands are
|
||||||
|
* $PART: "reference" put cursor on component anchor
|
||||||
|
*/
|
||||||
|
void SendMessageToEESCHEMA();
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue