Changeset 1927 in ntrip


Ignore:
Timestamp:
Nov 11, 2009, 7:57:09 PM (14 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncwindow.cpp

    r1926 r1927  
    6262  QListIterator<QString> it(settings.value("mountPoints").toStringList());
    6363  while (it.hasNext()) {
    64     QStringList hlp = it.next().split(" ");
    65     QUrl    url(hlp[0]);
    66     _MPName.append(url.path().toAscii()); _bytesMP.append(0);
    67   }
    68   connect(&_timer, SIGNAL(timeout()), this, SLOT(update()));
    69   _timer.start(1000);
     64    QStringList hlp   = it.next().split(" ");
     65    QUrl        url(hlp[0]);
     66    QByteArray  staID = url.path().mid(1).toAscii();
     67    _bytes[staID] = 0.0;
     68  }
     69  slotNextAnimationFrame();
    7070}
    7171
     
    7373////////////////////////////////////////////////////////////////////////////
    7474FWidget::~FWidget() {
    75   _timer.stop();
    7675}
    7776
    7877//
    7978////////////////////////////////////////////////////////////////////////////
    80 void FWidget::slotNextAnimationFrame(const QByteArray staID, double nbyte) {
    81   _timer.stop();
     79void FWidget::slotNewData(const QByteArray staID, double nbyte) {
    8280  cout << staID.data() << " " << nbyte << endl;
     81}
     82
     83//
     84////////////////////////////////////////////////////////////////////////////
     85void FWidget::slotNextAnimationFrame() {
    8386  update();
    84   _timer.start(1000);
     87  QTimer::singleShot(1000, this, SLOT(slotNextAnimationFrame()));
    8588}
    8689
     
    107110  textP.setX(300);
    108111
    109   QListIterator<QByteArray> it(_MPName);
     112  QMapIterator<QByteArray, double> it(_bytes);
    110113  while (it.hasNext()) {
    111     QByteArray hlp=it.next();
    112     double bytesnew=_bytesMP[_MPName.lastIndexOf(hlp)];
    113     double vv = bytesnew/30;
     114    it.next();
     115    QByteArray staID    = it.key();
     116    double     bytesnew = it.value();
     117    double     vv       = bytesnew/30;
    114118    QRectF vrect((100+anker*40), (140-vv), (30), (vv));
    115119    QBrush xBrush(Qt::green,Qt::SolidPattern);
     
    117121    painter.fillRect(vrect,xBrush);
    118122    painter.drawRect(vrect);
    119     painter.drawText(textP, hlp);
     123    painter.drawText(textP, staID);
    120124    anker++;
    121125  }
     
    13051309        ((bncTableItem*) _mountPointsTable->item(iRow, 7))->setGetThread(thread);
    13061310        connect(thread, SIGNAL(newBytes(QByteArray, double)),
    1307                 _Figure1, SLOT(slotNextAnimationFrame(QByteArray, double)));
     1311                _Figure1, SLOT(slotNewData(QByteArray, double)));
    13081312
    13091313        break;
  • trunk/BNC/bncwindow.h

    r1926 r1927  
    3838  ~FWidget();
    3939 public slots:
    40   void slotNextAnimationFrame(const QByteArray staID, double nbyte);
     40  void slotNewData(const QByteArray staID, double nbyte);
    4141 protected:
    4242  void paintEvent(QPaintEvent *event);
     43 private slots:
     44  void slotNextAnimationFrame();
    4345 private:
    44   QList<QByteArray> _MPName;
    45   QList<double>     _bytesMP;
    46   QTimer            _timer;
     46  QMap<QByteArray, double> _bytes;
    4747};
    4848
Note: See TracChangeset for help on using the changeset viewer.