Changeset 734 in ntrip for trunk/BNC/test_bnc_qt.cpp
- Timestamp:
- Mar 18, 2008, 4:56:54 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/test_bnc_qt.cpp
r733 r734 57 57 58 58 QTcpSocket socketObs; 59 //// QTcpSocket socketEph;60 59 61 60 QFile obsFile("obs.txt"); 62 //// QFile ephFile("eph.txt");63 61 64 62 socketObs.connectToHost("127.0.0.1", 1968); … … 68 66 } 69 67 70 //// socketEph.connectToHost("127.0.0.1", 1969);71 //// if (!socketEph.waitForConnected(10000)) {72 //// cout << "socketEph: not connected" << endl;73 //// exit(1);74 //// }75 76 68 obsFile.open(QIODevice::WriteOnly | QIODevice::Unbuffered); 77 //// ephFile.open(QIODevice::WriteOnly | QIODevice::Unbuffered);78 69 79 70 QTextStream outObs(&obsFile); 80 71 outObs.setRealNumberNotation(QTextStream::FixedNotation); 81 82 //// QTextStream outEph(&ephFile);83 //// outEph.setRealNumberNotation(QTextStream::FixedNotation);84 72 85 73 // Receive Data … … 94 82 exit(0); 95 83 } 96 //// if (socketEph.state() != QAbstractSocket::ConnectedState) {97 //// cout << "socketEph: disconnected" << endl;98 //// exit(0);99 //// }100 84 101 if ( socketObs.bytesAvailable() ) {102 int bytesRecv =socketObs.read(&flag, 1);85 if ( socketObs.bytesAvailable() > sizeof(obs) ) { 86 socketObs.read(&flag, 1); 103 87 if (flag == begObs) { 104 if ( socketObs.bytesAvailable() >= sizeof(obs) ) { 105 bytesRecv = socketObs.read((char*) &obs, sizeof(obs)); 106 outObs << obs.StatID << " " 107 << obs.satSys << obs.satNum << " " 108 << obs.GPSWeek << " " 109 << qSetRealNumberPrecision(2) << obs.GPSWeeks << " " 110 << qSetRealNumberPrecision(4) << obs.C1 << " " 111 << qSetRealNumberPrecision(4) << obs.C2 << " " 112 << qSetRealNumberPrecision(4) << obs.P1 << " " 113 << qSetRealNumberPrecision(4) << obs.P2 << " " 114 << qSetRealNumberPrecision(4) << obs.L1 << " " 115 << qSetRealNumberPrecision(4) << obs.L2 << " " 116 << qSetRealNumberPrecision(4) << obs.S1 << " " 117 << qSetRealNumberPrecision(4) << obs.S2 << " " 118 << obs.SNR1 << " " 119 << obs.SNR2 << endl; 120 } 88 socketObs.read((char*) &obs, sizeof(obs)); 89 outObs << obs.StatID << " " 90 << obs.satSys << obs.satNum << " " 91 << obs.GPSWeek << " " 92 << qSetRealNumberPrecision(2) << obs.GPSWeeks << " " 93 << qSetRealNumberPrecision(4) << obs.C1 << " " 94 << qSetRealNumberPrecision(4) << obs.C2 << " " 95 << qSetRealNumberPrecision(4) << obs.P1 << " " 96 << qSetRealNumberPrecision(4) << obs.P2 << " " 97 << qSetRealNumberPrecision(4) << obs.L1 << " " 98 << qSetRealNumberPrecision(4) << obs.L2 << " " 99 << qSetRealNumberPrecision(4) << obs.S1 << " " 100 << qSetRealNumberPrecision(4) << obs.S2 << " " 101 << obs.SNR1 << " " 102 << obs.SNR2 << endl; 121 103 } 122 104 } … … 124 106 socketObs.waitForReadyRead(1); 125 107 } 126 127 //// if ( socketEph.bytesAvailable() ) {128 //// QByteArray eph = socketEph.readAll();129 //// outEph << eph.data() << endl;130 //// }131 //// else {132 //// socketEph.waitForReadyRead(1);133 //// }134 108 } 135 109
Note:
See TracChangeset
for help on using the changeset viewer.