34 #include <visp3/ustk_grabber/usNetworkGrabberRF2D.h>
36 #if defined(USTK_HAVE_QT5) || defined(USTK_HAVE_VTK_QT)
38 #include <QtCore/QDataStream>
39 #include <QtCore/QEventLoop>
50 m_firstFrameAvailable =
false;
52 m_recordingOn =
false;
53 m_firstImageTimestamp = 0;
73 #if (defined(USTK_HAVE_QT5) || defined(USTK_HAVE_VTK_QT5))
74 in.setVersion(QDataStream::Qt_5_0);
75 #elif defined(USTK_HAVE_VTK_QT4)
76 in.setVersion(QDataStream::Qt_4_8);
78 throw(vpException(vpException::fatalError,
"your Qt version is not managed in ustk"));
85 std::cout <<
"header received, type = " << headerType << std::endl;
97 throw(vpException(vpException::fatalError,
"porta initialisation error, closing connection."));
117 m_firstImageTimestamp = timestamp;
186 std::cout <<
"WARNING : new image received with an acquisition timestamp close to previous image" << std::endl;
206 m_firstImageTimestamp);
208 m_firstFrameAvailable =
true;
213 std::cout <<
"Bytes left to read for whole frame = " <<
m_bytesLeftToRead << std::endl;
220 std::cout <<
"reading following part of the frame" << std::endl;
230 std::cout <<
"Bytes left to read for whole frame = " <<
m_bytesLeftToRead << std::endl;
241 m_firstImageTimestamp);
243 m_firstFrameAvailable =
true;
259 if (!m_firstFrameAvailable ||
282 m_recordingOn =
true;
Class to store additionnal informations arriving on the network with ultrasound images grabbed,...
void setSequenceDirectory(const std::string sequenceDirectory)
void write(const usImageRF2D< short int > &image, const uint64_t timestamp)
void activateRecording(std::string path)
void newFrame(usImageRF2D< short int > &)
usFrameGrabbedInfo< usImageRF2D< short int > > * acquire()
usNetworkGrabberRF2D(usNetworkGrabber *parent=0)
Generic abstract class to manage tcp connection to grab ultrasound frames (on port 8080).
usInitHeaderConfirmation m_confirmHeader
@ CURRENT_FILLED_FRAME_POSITION_IN_VEC
@ OUTPUT_FRAME_POSITION_IN_VEC
@ MOST_RECENT_FRAME_POSITION_IN_VEC
void readAcquisitionParameters(QDataStream &stream)
void serverUpdateEnded(bool success)
us::usImageHeader m_imageHeader