C++ (Qt)bool QIODevice::reset () [virtual]bool QIODevice::seek ( qint64 pos ) [virtual]
for( int i= 0; i < 483; ++i ){ QDataStream ds; ...}
QByteArray datagramIn;QList<Data> saveData;for( int i = 0; i < 483; ++i ){ QDataStream datagramInStream(&datagramIn, QIODevice::ReadOnly); udpSocket.readDatagram(datagramIn.data(),datagramIn.size()); // ... обработали данные data = ... // Сохранили saveData.append( data );}
QList<QByteArray*> frame;for( int line = 0; line < lineCount; ++line ){ QByteArray *dataIn = new QByteArray( pendingDatagramSize, 0 ); udpSocket.readDatagram( dataIn->data(), dataIn->size() ); frame.append( dataIn );}
C++ (Qt)FrameReceiveTime.start(); while(FrameReceiveTime.elapsed() <= 100){ if(udpSocket.hasPendingDatagrams()){ QDataStream datagramInStream3(&datagramIn, QIODevice::ReadOnly); datagramIn.resize(udpSocket.pendingDatagramSize()); udpSocket.readDatagram(datagramIn.data(),datagramIn.size()); datagramInStream3>>temp>>ReceivedFrameType>>RowNumber; if(ReceivedFrameType == 0x44415441){ for(quint32 i=RowNumber*(WindowWidth->value()/3 + (WindowWidth->value()%3 != 0)); i<(RowNumber+1)*(WindowWidth->value()/3 + (WindowWidth->value()%3 != 0));i++) datagramInStream3>>monitor->Data[i]; } } }