Changeset 858 in ntrip
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNS/bns.cpp
r857 r858 15 15 * -----------------------------------------------------------------------*/ 16 16 17 #include <math.h> 17 18 #include <iostream> 18 19 #include <newmatio.h> … … 54 55 // Socket and file for outputting the results 55 56 // ------------------------------------------- 56 _outSocket = 0; 57 _outSocket = 0; 58 _outSocketOpenTrial = 0; 57 59 58 60 QString outFileName = settings.value("outFile").toString(); … … 173 175 //////////////////////////////////////////////////////////////////////////// 174 176 void t_bns::openCaster() { 175 177 178 delete _outSocket; _outSocket = 0; 179 180 double minDt = exp2(_outSocketOpenTrial); 181 if (++_outSocketOpenTrial > 8) { 182 _outSocketOpenTrial = 8; 183 } 184 if (_outSocketOpenTime.isValid() && 185 _outSocketOpenTime.secsTo(QDateTime::currentDateTime()) < minDt) { 186 return; 187 } 188 else { 189 _outSocketOpenTime = QDateTime::currentDateTime(); 190 } 191 176 192 QSettings settings; 177 178 delete _outSocket;179 193 _outSocket = new QTcpSocket(); 180 194 _outSocket->connectToHost(settings.value("outHost").toString(), … … 209 223 else { 210 224 slotMessage("bns::openCaster socket OK"); 225 _outSocketOpenTrial = 0; 211 226 } 212 227 } -
trunk/BNS/bns.h
r848 r858 57 57 QTcpSocket* _clkSocket; 58 58 QTcpSocket* _outSocket; 59 int _outSocketOpenTrial; 60 QDateTime _outSocketOpenTime; 59 61 QFile* _outFile; 60 62 QFile* _logFile; -
trunk/BNS/bnsrinex.cpp
r857 r858 35 35 } 36 36 37 // Write Header38 ////////////////////////////////////////////////////////////////////////////39 void bnsRinex::writeHeader(const QDateTime& datTim) {40 _out << "THIS IS A DUMMY CLOCK RINEX HEADER" << endl;41 }42 43 37 // Write One Epoch 44 38 //////////////////////////////////////////////////////////////////////////// … … 63 57 } 64 58 } 59 60 // Write Header 61 //////////////////////////////////////////////////////////////////////////// 62 void bnsRinex::writeHeader(const QDateTime& datTim) { 63 64 _out << " 3.00 C " 65 << "RINEX VERSION / TYPE" << endl; 66 67 _out << "BNS " 68 << datTim.toString("yyyyMMdd hhmmss").leftJustified(20, ' ', true).toAscii().data() 69 << "PGM / RUN BY / DATE" << endl; 70 71 _out << " 1 AS " 72 << "# / TYPES OF DATA" << endl; 73 74 _out << " " 75 << "END OF HEADER" << endl; 76 } 77
Note:
See TracChangeset
for help on using the changeset viewer.