34 #include <visp3/ustk_grabber/usNetworkGrabberPostScanBiPlan.h>
36 #if defined(USTK_HAVE_QT5) || defined(USTK_HAVE_VTK_QT)
38 #include <QtCore/QDataStream>
39 #include <QtCore/QEventLoop>
56 m_firstFrameAvailable =
false;
75 #if (defined(USTK_HAVE_QT5) || defined(USTK_HAVE_VTK_QT5))
76 in.setVersion(QDataStream::Qt_5_0);
77 #elif defined(USTK_HAVE_VTK_QT4)
78 in.setVersion(QDataStream::Qt_4_8);
80 throw(vpException(vpException::fatalError,
"your Qt version is not managed in ustk"));
86 std::vector<usFrameGrabbedInfo<usImagePostScan2D<unsigned char> > *> *refOnBufferToFill;
87 if (m_bufferToFill == 1) {
88 refOnBufferToFill = &m_outputBuffer1;
90 refOnBufferToFill = &m_outputBuffer2;
96 std::cout <<
"header received, type = " << headerType << std::endl;
108 throw(vpException(vpException::fatalError,
"porta initialisation error, closing connection."));
186 std::cout <<
"WARNING : new image received with an acquisition timestamp close to previous image" << std::endl;
222 m_bufferToFill = (m_bufferToFill == 1) ? 2 : 1;
223 if (m_bufferToFill == 1) {
224 m_firstFrameAvailable =
true;
229 std::cout <<
"Bytes left to read for whole frame = " <<
m_bytesLeftToRead << std::endl;
236 std::cout <<
"reading following part of the frame, left to read = " <<
m_bytesLeftToRead << std::endl;
253 m_bufferToFill = (m_bufferToFill == 1) ? 2 : 1;
254 if (m_bufferToFill == 1) {
255 m_firstFrameAvailable =
true;
271 if (!m_firstFrameAvailable ||
292 std::vector<usFrameGrabbedInfo<usImagePostScan2D<unsigned char> > *> ret;
Class to store additionnal informations arriving on the network with ultrasound images grabbed,...
std::vector< usFrameGrabbedInfo< usImagePostScan2D< unsigned char > > * > acquire()
usNetworkGrabberPostScanBiPlan(usNetworkGrabber *parent=0)
~usNetworkGrabberPostScanBiPlan()
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