- Timestamp:
- Nov 22, 2008, 2:09:45 PM (16 years ago)
- Location:
- trunk/BNC
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/RTCM3/RTCM3coDecoder.cpp
r1218 r1222 109 109 // 110 110 //////////////////////////////////////////////////////////////////////////// 111 t_irc RTCM3coDecoder::Decode(char* buffer, int bufLen, vector<string>& errmsg) { 111 t_irc RTCM3coDecoder::Decode(char* buffer, int /* bufLen */, 112 vector<string>& errmsg) { 112 113 113 114 errmsg.clear(); 114 115 115 _buffer.append(buffer , bufLen);116 _buffer.append(buffer); 116 117 117 118 t_irc retCode = failure; … … 198 199 printLine(line, coTime); 199 200 } 200 _buffer = _buffer. substr(bytesused);201 _buffer = _buffer.mid(bytesused); 201 202 retCode = success; 202 203 } … … 205 206 // --------------- 206 207 else { 207 _buffer = _buffer. substr(1);208 _buffer = _buffer.mid(1); 208 209 } 209 210 } -
trunk/BNC/RTCM3/RTCM3coDecoder.h
r1218 r1222 56 56 QString _fileNameSkl; 57 57 QString _fileName; 58 std::string_buffer;58 QByteArray _buffer; 59 59 ClockOrbit _co; 60 60 Bias _bias; -
trunk/BNC/bnccaster.cpp
r1200 r1222 87 87 } 88 88 89 int uPort = settings.value("outUPort").toInt(); 90 if (uPort != 0) { 91 _uServer = new QTcpServer; 92 _uServer->listen(QHostAddress::Any, uPort); 93 connect(_uServer, SIGNAL(newConnection()), this, SLOT(slotNewUConnection())); 94 _uSockets = new QList<QTcpSocket*>; 95 } 96 else { 97 _uServer = 0; 98 _uSockets = 0; 99 } 100 89 101 _epochs = new QMultiMap<long, p_obs>; 90 102 … … 111 123 delete _server; 112 124 delete _sockets; 125 delete _uServer; 126 delete _uSockets; 113 127 if (_epochs) { 114 128 QListIterator<p_obs> it(_epochs->values()); … … 136 150 obs->_o.StatID[sizeof(obs->_o.StatID)-1] = '\0'; 137 151 152 const char begObs[] = "BEGOBS"; 153 const int begObsNBytes = sizeof(begObs) - 1; 154 155 // Output into the socket 156 // ---------------------- 157 if (_uSockets) { 158 QMutableListIterator<QTcpSocket*> is(*_uSockets); 159 while (is.hasNext()) { 160 QTcpSocket* sock = is.next(); 161 if (sock->state() == QAbstractSocket::ConnectedState) { 162 bool ok = true; 163 if (myWrite(sock, begObs, begObsNBytes) != begObsNBytes) { 164 ok = false; 165 } 166 int numBytes = sizeof(obs->_o); 167 if (myWrite(sock, (const char*)(&obs->_o), numBytes) != numBytes) { 168 ok = false; 169 } 170 if (!ok) { 171 delete sock; 172 is.remove(); 173 } 174 } 175 else if (sock->state() != QAbstractSocket::ConnectingState) { 176 delete sock; 177 is.remove(); 178 } 179 } 180 } 181 138 182 // First time, set the _lastDumpSec immediately 139 183 // -------------------------------------------- … … 175 219 emit( newMessage(QString("New Connection # %1") 176 220 .arg(_sockets->size()).toAscii()) ); 221 } 222 223 void bncCaster::slotNewUConnection() { 224 _uSockets->push_back( _uServer->nextPendingConnection() ); 225 emit( newMessage(QString("New Connection (usync) # %1") 226 .arg(_uSockets->size()).toAscii()) ); 177 227 } 178 228 … … 273 323 while (is.hasNext()) { 274 324 QTcpSocket* sock = is.next(); 275 int myFlag = 0;276 325 if (sock->state() == QAbstractSocket::ConnectedState) { 277 326 bool ok = true; 278 327 if (first) { 279 328 if (myWrite(sock, begEpoch, begEpochNBytes) != begEpochNBytes) { 280 myFlag = 1;281 329 ok = false; 282 330 } … … 284 332 int numBytes = sizeof(obs->_o); 285 333 if (myWrite(sock, (const char*)(&obs->_o), numBytes) != numBytes) { 286 myFlag = 2;287 334 ok = false; 288 335 } 289 336 if (!it.hasNext()) { 290 337 if (myWrite(sock, endEpoch, endEpochNBytes) != endEpochNBytes) { 291 myFlag = 3;292 338 ok = false; 293 339 } -
trunk/BNC/bnccaster.h
r1182 r1222 54 54 private slots: 55 55 void slotNewConnection(); 56 void slotNewUConnection(); 56 57 void slotGetThreadError(QByteArray staID); 57 58 … … 66 67 long _lastDumpSec; 67 68 QTcpServer* _server; 69 QTcpServer* _uServer; 68 70 QList<QTcpSocket*>* _sockets; 71 QList<QTcpSocket*>* _uSockets; 69 72 QList<QByteArray> _staIDs; 70 73 QList<bncGetThread*> _threads; -
trunk/BNC/bncwindow.cpp
r1218 r1222 125 125 _outPortLineEdit = new QLineEdit(settings.value("outPort").toString()); 126 126 _outPortLineEdit->setMaximumWidth(9*ww); 127 _outUPortLineEdit = new QLineEdit(settings.value("outUPort").toString()); 128 _outUPortLineEdit->setMaximumWidth(9*ww); 127 129 _outEphPortLineEdit = new QLineEdit(settings.value("outEphPort").toString()); 128 130 _outEphPortLineEdit->setMaximumWidth(9*ww); … … 264 266 _outFileLineEdit->setWhatsThis(tr("Specify the full path to a file where synchronized observations are saved in plain ASCII format. Beware that the size of this file can rapidly increase depending on the number of incoming streams.")); 265 267 _outPortLineEdit->setWhatsThis(tr("BNC can produce synchronized observations in binary format on your local host through an IP port. Specify a port number here to activate this function.")); 268 _outPortLineEdit->setWhatsThis(tr("Unsynchronized observations in binary format on your local host through an IP port. Specify a port number here to activate this function.")); 266 269 _outEphPortLineEdit->setWhatsThis(tr("BNC can produce ephemeris data in RINEX ASCII format on your local host through an IP port. Specify a port number here to activate this function.")); 267 270 _corrPortLineEdit->setWhatsThis(tr("BNC can produce Broadcast Ephemeris Corrections on your local host through an IP port. Specify a port number here to activate this function.")); … … 345 348 sLayout->addWidget(new QLabel("Port"), 0, 0); 346 349 sLayout->addWidget(_outPortLineEdit, 0, 1); 350 sLayout->addWidget(new QLabel("Port (Unsynchronized)"), 0, 2); 351 sLayout->addWidget(_outUPortLineEdit, 0, 3); 347 352 sLayout->addWidget(new QLabel("Wait for full epoch"), 1, 0); 348 353 sLayout->addWidget(_waitTimeSpinBox, 1, 1); 349 354 sLayout->addWidget(new QLabel("File (full path)"), 2, 0); 350 sLayout->addWidget(_outFileLineEdit, 2, 1 );355 sLayout->addWidget(_outFileLineEdit, 2, 1, 1, 3); 351 356 sLayout->addWidget(new QLabel("Sampling"), 3, 0, Qt::AlignLeft); 352 357 sLayout->addWidget(_binSamplSpinBox, 3, 1, Qt::AlignLeft); 353 sLayout->addWidget(new QLabel("Output synchronized observations epoch by epoch."),4,0,1, 2,Qt::AlignLeft);358 sLayout->addWidget(new QLabel("Output synchronized observations epoch by epoch."),4,0,1,4,Qt::AlignLeft); 354 359 sLayout->addWidget(new QLabel(" "),5,0); 355 360 sLayout->addWidget(new QLabel(" "),6,0); … … 634 639 settings.setValue("perfIntr", _perfIntrComboBox->currentText()); 635 640 settings.setValue("outPort", _outPortLineEdit->text()); 641 settings.setValue("outUPort", _outUPortLineEdit->text()); 636 642 settings.setValue("outEphPort", _outEphPortLineEdit->text()); 637 643 settings.setValue("corrPort", _corrPortLineEdit->text()); -
trunk/BNC/bncwindow.h
r1179 r1222 102 102 QLineEdit* _outFileLineEdit; 103 103 QLineEdit* _outPortLineEdit; 104 QLineEdit* _outUPortLineEdit; 104 105 QLineEdit* _outEphPortLineEdit; 105 106 QLineEdit* _corrPortLineEdit;
Note:
See TracChangeset
for help on using the changeset viewer.