Changeset 1912 in ntrip


Ignore:
Timestamp:
Nov 6, 2009, 5:07:43 PM (15 years ago)
Author:
weber
Message:

* empty log message *

Location:
trunk/BNC
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncwindow.cpp

    r1905 r1912  
    5656using namespace std;
    5757
     58// Begin new Perlt
     59FWidget::FWidget(QWidget *parent)
     60    : QWidget(parent)
     61{
     62  bncSettings settings;
     63  QListIterator<QString> it(settings.value("mountPoints").toStringList());
     64  while (it.hasNext()) {
     65    QStringList hlp = it.next().split(" ");
     66    QUrl    url(hlp[0]);
     67    MPName.append(url.path().toAscii()); bytesMP.append(0);
     68    }
     69}
     70
     71FWidget::~FWidget() { };
     72
     73void FWidget::nextAnimationFrame(){update();}
     74
     75void FWidget::paintEvent(QPaintEvent *)
     76{
     77    QRectF rectangle(0, 0, 640, 180);
     78    QBrush rBrush(Qt::white,Qt::SolidPattern);
     79    QPainter painter(this);
     80    painter.fillRect(rectangle,rBrush);
     81    painter.drawRect(rectangle);
     82    QLine line(50, 140, 630, 140);
     83    painter.drawLine(line);
     84
     85    line.setLine(50, 105, 50, 10);
     86    painter.drawLine(line);
     87    line.setLine(50, 105, 400, 105);
     88    painter.drawLine(line);
     89
     90    QPoint textP(40, 140);
     91    painter.drawText(textP, tr("0"));
     92    textP.setX(20);
     93    textP.setY(25);
     94    painter.drawText(textP, tr("3000"));
     95    textP.setX(20);
     96    textP.setY(40);
     97    painter.drawText(textP, tr("bps"));
     98
     99    textP.setX(410);
     100    textP.setY(105);
     101    painter.drawText(textP, tr("Mountpoints"));
     102
     103    int anker=0;
     104    textP.setY(160);
     105    painter.drawText(textP, tr(QTime::currentTime().toString().toAscii()));
     106    textP.setX(300);
     107
     108//  QString hlp = (QString("%1").arg(MPName.size()));
     109//  if (MPName.isEmpty()) {painter.drawText(textP, tr("Empty"));} else {painter.drawText(textP, tr(hlp.toAscii()));}
     110
     111    QListIterator<QByteArray> it(MPName);
     112    while (it.hasNext()) {
     113    QByteArray hlp=it.next();
     114    double bytesnew=bytesMP[MPName.lastIndexOf(hlp)];
     115    double vv = bytesnew/30;
     116      QRectF vrect((100+anker*40), (140-vv), (30), (vv));
     117      QBrush xBrush(Qt::green,Qt::SolidPattern);
     118      textP.setX(100+anker*40);
     119      painter.fillRect(vrect,xBrush);
     120      painter.drawRect(vrect);
     121      painter.drawText(textP, hlp);
     122      anker++;
     123    }
     124}
     125// End new Perlt
     126
    58127// Constructor
    59128////////////////////////////////////////////////////////////////////////////
     
    61130
    62131  _caster = 0;
     132
     133// Begin new Perlt
     134  // Figure
     135  _Figure1 = new FWidget(this);
     136// End new Perlt
    63137
    64138  int ww = QFontMetrics(this->font()).width('w');
     
    390464  aogroup->addTab(rgroup,tr("Miscellaneous"));
    391465
     466// Begin new Perlt
     467
     468  loggroup = new QTabWidget();
     469  QWidget* log1group = new QWidget();
     470  QWidget* log2group = new QWidget();
     471  loggroup->addTab(log1group,tr("Log"));
     472  loggroup->addTab(log2group,tr("Status"));
     473
     474  // log Tab
     475  // -------
     476  QGridLayout* log1Layout = new QGridLayout;
     477  log1Layout->addWidget(_log,                0,0);
     478  log1group->setLayout(log1Layout);
     479
     480  // Status Tab
     481  // ----------
     482  QGridLayout* log2Layout = new QGridLayout;
     483  log2Layout->addWidget(_Figure1,            0,0);
     484  log2group->setLayout(log2Layout);
     485
     486// End new Perlt
     487
    392488  // Proxy Tab
    393489  // ---------
     
    708804  mLayout->addWidget(aogroup,             0,0);
    709805  mLayout->addWidget(_mountPointsTable,   1,0);
    710   mLayout->addWidget(new QLabel(" Logs:"),2,0);
    711   mLayout->addWidget(_log,                3,0);
     806
     807// Begin new Perlt
     808//  mLayout->addWidget(new QLabel(" Logs:"),2,0);
     809//  mLayout->addWidget(_log,                3,0);
     810  QTimer *timer = new QTimer(this);
     811  connect(timer, SIGNAL(timeout()), _Figure1, SLOT(nextAnimationFrame()));
     812  mLayout->addWidget(loggroup,            2,0);
     813  timer->start(100);
     814
     815// End new Perlt
    712816
    713817  _canvas->setLayout(mLayout);
     
    13281432  QColor lightGray(230, 230, 230);
    13291433  QColor white(255, 255, 255);
     1434
    13301435
    13311436  // Proxy
     
    15351640  }
    15361641}
     1642
  • trunk/BNC/bncwindow.h

    r1636 r1912  
    3232#include "bnccaster.h"
    3333
     34// Begin new Perlt
     35class FWidget : public QWidget
     36{
     37    Q_OBJECT
     38
     39public:
     40    FWidget(QWidget *parent);
     41    ~FWidget();
     42
     43public slots:
     44    void nextAnimationFrame();
     45
     46protected:
     47    void paintEvent(QPaintEvent *event);
     48
     49private:
     50    QList<QByteArray> MPName;
     51    QList<double> bytesMP;
     52};
     53// End new Perlt
     54
    3455  class bncAboutDlg : public QDialog {
    3556  Q_OBJECT
     
    5677    void CreateMenu();
    5778    void AddToolbar();
    58  
     79
    5980  public slots: 
    6081    void slotMountPointsRead(QList<bncGetThread*>);
     
    150171    QTextEdit*  _log;
    151172
    152     QWidget*   _canvas;
     173    QWidget*    _canvas;
    153174    QTabWidget* aogroup;
     175
     176// neu Perlt
     177    QTabWidget* loggroup;
     178    FWidget*    _Figure1;
     179// Ende neu Perlt
    154180
    155181    bncCaster* _caster;
  • trunk/BNC/todo.txt

    r1911 r1912  
    1313    We once saw a wrong date.
    1414(4) LM&JP: Bandwidth graphics: one column per stream showing the current bandwidth needed.
    15     Please consider this as "nice to have". It's of course not a must.
     15    Please consider this as "nice to have" - it's not a must.
     16    What we have is marked with "Begin new Perlt" and "End new Perlt" in bncwindow.cpp
     17    and bncwindow.h. If you don't like it or if its to difficult to implement
     18    it then: please delete it form the source code.
    1619(5) GW: Keep an eye on www.igs-ip.net/PENC0.
    1720
Note: See TracChangeset for help on using the changeset viewer.