Changeset 278 in ntrip


Ignore:
Timestamp:
Nov 8, 2006, 11:58:57 AM (17 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNC
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncgetthread.cpp

    r277 r278  
    3434// Constructor
    3535////////////////////////////////////////////////////////////////////////////
    36 bncGetThread::bncGetThread(const QUrl& mountPoint, const QByteArray& format) {
     36bncGetThread::bncGetThread(const QUrl& mountPoint,
     37                           const QByteArray& format, int iMount) {
    3738  _decoder    = 0;
    3839  _mountPoint = mountPoint;
     
    4344  _timeOut    = 20*1000;  // 20 seconds
    4445  _nextSleep  =  1;       //  1 second
     46  _iMount     = iMount;   // index in mountpoints array
    4547
    4648  // Check name conflict
     
    4951  QListIterator<QString> it(settings.value("mountPoints").toStringList());
    5052  int num = 0;
    51   int ind = 0;
     53  int ind = -1;
    5254  while (it.hasNext()) {
     55    ++ind;
    5356    QStringList hlp = it.next().split(" ");
    5457    if (hlp.size() <= 1) continue;
    5558    QUrl url(hlp[0]);
    5659    if (_mountPoint.path() == url.path()) {
    57       ++num;
    58       if (_mountPoint.host() == url.host()) {
    59         ind = num - 1;
    60       }
    61     }
    62   }
    63   if (num > 1) {
    64     _staID = _staID.left(_staID.length()-1) + QString("%1").arg(ind).toAscii();
     60      if (_iMount > ind) {
     61        ++num;
     62      }
     63    }
     64  }
     65
     66  if (num > 0) {
     67    _staID = _staID.left(_staID.length()-1) + QString("%1").arg(num).toAscii();
    6568  }   
    6669}
  • trunk/BNC/bncgetthread.h

    r255 r278  
    1313
    1414 public:
    15    bncGetThread(const QUrl& mountPoint, const QByteArray& format);
     15   bncGetThread(const QUrl& mountPoint,
     16                const QByteArray& format, int iMount);
    1617   ~bncGetThread();
    1718
     
    4243   int         _timeOut;
    4344   int         _nextSleep;
     45   int         _iMount;
    4446};
    4547
  • trunk/BNC/bncmain.cpp

    r274 r278  
    8585                &app, SLOT(slotMessage(const QByteArray&)));
    8686
     87    int iMount = -1;
    8788    QListIterator<QString> it(settings.value("mountPoints").toStringList());
    8889    while (it.hasNext()) {
     90      ++iMount;
    8991      QStringList hlp = it.next().split(" ");
    9092      if (hlp.size() <= 1) continue;
    9193      QUrl url(hlp[0]);
    9294      QByteArray format = hlp[1].toAscii();
    93       bncGetThread* getThread = new bncGetThread(url, format);
     95      bncGetThread* getThread = new bncGetThread(url, format, iMount);
    9496      app.connect(getThread, SIGNAL(newMessage(const QByteArray&)),
    9597                  &app, SLOT(slotMessage(const QByteArray&)));
  • trunk/BNC/bncwindow.cpp

    r276 r278  
    393393    QByteArray format = _mountPointsTable->item(iRow, 2)->text().toAscii();
    394394
    395     bncGetThread* getThread = new bncGetThread(url, format);
     395    bncGetThread* getThread = new bncGetThread(url, format, iRow);
    396396
    397397    connect(getThread, SIGNAL(newMessage(const QByteArray&)),
Note: See TracChangeset for help on using the changeset viewer.