12 #ifndef CX_NETWORKHANDLER_H_
13 #define CX_NETWORKHANDLER_H_
15 #include "org_custusx_core_openigtlink3_Export.h"
16 #include "igtlioLogic.h"
17 #include "igtlioSession.h"
24 #include "ctkVTKObject.h"
40 igtlioSessionPointer requestConnectToServer(std::string serverHost,
int serverPort=-1, IGTLIO_SYNCHRONIZATION_TYPE sync=IGTLIO_BLOCKING,
double timeout_s=5);
41 void disconnectFromServer();
43 void clearTimestampSynchronization();
51 void commandRespons(QString devicename, QString xml);
52 void string_message(QString message);
58 void onConnectionEvent(vtkObject* caller,
void* connector,
unsigned long event,
void*);
59 void onDeviceAddedOrRemoved(vtkObject* caller,
void* connector,
unsigned long event,
void*callData);
60 void onDeviceReceived(vtkObject * caller_device,
void * unknown,
unsigned long event,
void *);
61 void periodicProcess();
64 void connectToConnectionEvents();
65 void connectToDeviceEvents();
66 void processImageAndEmitProbeDefinition(
ImagePtr cximage, QString deviceName);
67 bool emitProbeDefinitionIfChanged(QString deviceName);
68 bool convertZeroesInsideSectorToOnes(
ImagePtr cximage,
int threshold = 0,
int newValue = 1);
70 double synchronizedTimestamp(
double receivedTimestampSec);
71 bool verifyTimestamp(
double ×tampMS);