34 #include <visp3/ustk_grabber/usNetworkGrabberPostScan2D.h>
36 #if defined(USTK_HAVE_QT5) || defined(USTK_HAVE_VTK_QT)
38 #include <QtCore/QDataStream>
39 #include <QtCore/QEventLoop>
51 m_firstFrameAvailable =
false;
53 m_recordingOn =
false;
54 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;
181 std::cout <<
"WARNING : new image received with an acquisition timestamp close to previous image" << std::endl;
218 m_firstImageTimestamp);
220 m_firstFrameAvailable =
true;
225 std::cout <<
"Bytes left to read for whole frame = " <<
m_bytesLeftToRead << std::endl;
232 std::cout <<
"reading following part of the frame, left to read = " <<
m_bytesLeftToRead << std::endl;
252 m_firstImageTimestamp);
254 m_firstFrameAvailable =
true;
270 if (!m_firstFrameAvailable ||
293 for (
unsigned int i = 0; i < m_outputBuffer.size(); i++)
294 m_outputBuffer.at(i)->display = display;
303 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)
usFrameGrabbedInfo< usImagePostScan2D< unsigned char > > * acquire()
void newFrame(usImagePostScan2D< unsigned char > image)
void activateRecording(std::string path)
~usNetworkGrabberPostScan2D()
void useVpDisplay(vpDisplay *display)
usNetworkGrabberPostScan2D(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