- Timestamp:
- Sep 8, 2006, 10:45:48 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bnccaster.cpp
r139 r140 98 98 } 99 99 100 // Check the sampling rate101 // -----------------------102 if (_samplingRate != 0) {103 if ( newTime % _samplingRate ) {104 delete obs;105 return;106 }107 }108 109 100 // Rename the station and save the observation 110 101 // ------------------------------------------- … … 157 148 158 149 for (long sec = minTime; sec <= maxTime; sec++) { 159 150 160 151 bool first = true; 161 152 QList<Observation*> allObs = _epochs->values(sec); … … 164 155 Observation* obs = it.next(); 165 156 166 // Output into the file 167 // -------------------- 168 if (_out) { 169 if (first) { 170 *_out << begEpoch << endl;; 171 } 172 *_out << obs->StatID << " " 173 << (int) obs->SVPRN << " " 174 << (int) obs->GPSWeek << " " 175 << obs->GPSWeeks << " " 176 << obs->sec << " " 177 << obs->pCodeIndicator << " " 178 << obs->cumuLossOfCont << " " 179 << obs->C1 << " " 180 << obs->P2 << " " 181 << obs->L1 << " " 182 << obs->L2 << endl; 183 if (!it.hasNext()) { 184 *_out << endEpoch << endl; 185 } 186 } 187 188 // Output into the socket 189 // ---------------------- 190 if (_sockets) { 191 int numBytes = sizeof(*obs); 192 QListIterator<QTcpSocket*> is(*_sockets); 193 while (is.hasNext()) { 194 QTcpSocket* sock = is.next(); 157 if (_samplingRate == 0 || sec % _samplingRate == 0) { 158 159 // Output into the file 160 // -------------------- 161 if (_out) { 195 162 if (first) { 196 sock->write(&begEpoch, 1);163 *_out << begEpoch << endl;; 197 164 } 198 sock->write(&begObs, 1); 199 sock->write((char*) obs, numBytes); 165 *_out << obs->StatID << " " 166 << (int) obs->SVPRN << " " 167 << (int) obs->GPSWeek << " " 168 << obs->GPSWeeks << " " 169 << obs->sec << " " 170 << obs->pCodeIndicator << " " 171 << obs->cumuLossOfCont << " " 172 << obs->C1 << " " 173 << obs->P2 << " " 174 << obs->L1 << " " 175 << obs->L2 << endl; 200 176 if (!it.hasNext()) { 201 sock->write(&endEpoch, 1);177 *_out << endEpoch << endl; 202 178 } 203 179 } 204 } 205 206 // Prepare RINEX Output 207 // -------------------- 208 if (1) { 180 181 // Output into the socket 182 // ---------------------- 183 if (_sockets) { 184 int numBytes = sizeof(*obs); 185 QListIterator<QTcpSocket*> is(*_sockets); 186 while (is.hasNext()) { 187 QTcpSocket* sock = is.next(); 188 if (first) { 189 sock->write(&begEpoch, 1); 190 } 191 sock->write(&begObs, 1); 192 sock->write((char*) obs, numBytes); 193 if (!it.hasNext()) { 194 sock->write(&endEpoch, 1); 195 } 196 } 197 } 198 199 // Prepare RINEX Output 200 // -------------------- 209 201 if (_rinexWriters.find(obs->StatID) == _rinexWriters.end()) { 210 202 _rinexWriters.insert(obs->StatID, new bncRinex(obs->StatID));
Note:
See TracChangeset
for help on using the changeset viewer.