KiCad PCB EDA Suite
eda_dde.h File Reference

DDE server & client. More...

#include <string>
#include <wx/socket.h>

Go to the source code of this file.

Macros

#define KICAD_PCB_PORT_SERVICE_NUMBER   4242
 < Pcbnew listens on this port for commands from Eeschema More...
 
#define KICAD_SCH_PORT_SERVICE_NUMBER   4243
 Scripting window listens for commands for other apps. More...
 
#define KICAD_PY_PORT_SERVICE_NUMBER   4244
 
#define MSG_TO_PCB   KICAD_PCB_PORT_SERVICE_NUMBER
 
#define MSG_TO_SCH   KICAD_SCH_PORT_SERVICE_NUMBER
 

Functions

bool SendCommand (int aPort, const std::string &aMessage)
 Must be called to clean up the socket thread used by SendCommand. More...
 
void SocketCleanup ()
 

Detailed Description

DDE server & client.

Definition in file eda_dde.h.

Macro Definition Documentation

◆ KICAD_PCB_PORT_SERVICE_NUMBER

#define KICAD_PCB_PORT_SERVICE_NUMBER   4242

< Pcbnew listens on this port for commands from Eeschema

Eeschema listens on this port for commands from Pcbnew

Definition at line 40 of file eda_dde.h.

◆ KICAD_PY_PORT_SERVICE_NUMBER

#define KICAD_PY_PORT_SERVICE_NUMBER   4244

Definition at line 46 of file eda_dde.h.

◆ KICAD_SCH_PORT_SERVICE_NUMBER

#define KICAD_SCH_PORT_SERVICE_NUMBER   4243

Scripting window listens for commands for other apps.

Definition at line 43 of file eda_dde.h.

◆ MSG_TO_PCB

#define MSG_TO_PCB   KICAD_PCB_PORT_SERVICE_NUMBER

Definition at line 49 of file eda_dde.h.

◆ MSG_TO_SCH

#define MSG_TO_SCH   KICAD_SCH_PORT_SERVICE_NUMBER

Definition at line 50 of file eda_dde.h.

Function Documentation

◆ SendCommand()

bool SendCommand ( int  aService,
const std::string &  aMessage 
)

Must be called to clean up the socket thread used by SendCommand.

Must be called to clean up the socket thread used by SendCommand.

  • Open a Socket Client connection.
  • Send the buffer cmdline.
  • Close the socket connection.
Parameters
aServiceis the service number for the TC/IP connection.
aMessageis the message to send.

Definition at line 304 of file eda_dde.cpp.

305 {
306  if( !socketHolder )
307  socketHolder.reset( new ASYNC_SOCKET_HOLDER() );
308 
309  return socketHolder->Send( aService, aMessage );
310 }
Spin up a thread to send messages via a socket.
Definition: eda_dde.cpp:120
std::unique_ptr< ASYNC_SOCKET_HOLDER > socketHolder
Definition: eda_dde.cpp:292

References socketHolder.

Referenced by SCH_EDIT_FRAME::SendCrossProbeClearHighlight(), SCH_EDIT_FRAME::SendCrossProbeNetName(), PCB_EDIT_FRAME::SendCrossProbeNetName(), CVPCB_MAINFRAME::SendMessageToEESCHEMA(), PCB_EDIT_FRAME::SendMessageToEESCHEMA(), SCH_EDIT_FRAME::SendMessageToPCBNEW(), and SCH_EDIT_FRAME::SetCrossProbeConnection().

◆ SocketCleanup()

void SocketCleanup ( )

Definition at line 313 of file eda_dde.cpp.

314 {
315  if( socketHolder )
316  socketHolder.reset();
317 }
std::unique_ptr< ASYNC_SOCKET_HOLDER > socketHolder
Definition: eda_dde.cpp:292

References socketHolder.

Referenced by EDA_BASE_FRAME::~EDA_BASE_FRAME().