Changeset 1912 in ntrip
- Timestamp:
- Nov 6, 2009, 5:07:43 PM (15 years ago)
- Location:
- trunk/BNC
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncwindow.cpp
r1905 r1912 56 56 using namespace std; 57 57 58 // Begin new Perlt 59 FWidget::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 71 FWidget::~FWidget() { }; 72 73 void FWidget::nextAnimationFrame(){update();} 74 75 void 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 58 127 // Constructor 59 128 //////////////////////////////////////////////////////////////////////////// … … 61 130 62 131 _caster = 0; 132 133 // Begin new Perlt 134 // Figure 135 _Figure1 = new FWidget(this); 136 // End new Perlt 63 137 64 138 int ww = QFontMetrics(this->font()).width('w'); … … 390 464 aogroup->addTab(rgroup,tr("Miscellaneous")); 391 465 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 392 488 // Proxy Tab 393 489 // --------- … … 708 804 mLayout->addWidget(aogroup, 0,0); 709 805 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 712 816 713 817 _canvas->setLayout(mLayout); … … 1328 1432 QColor lightGray(230, 230, 230); 1329 1433 QColor white(255, 255, 255); 1434 1330 1435 1331 1436 // Proxy … … 1535 1640 } 1536 1641 } 1642 -
trunk/BNC/bncwindow.h
r1636 r1912 32 32 #include "bnccaster.h" 33 33 34 // Begin new Perlt 35 class FWidget : public QWidget 36 { 37 Q_OBJECT 38 39 public: 40 FWidget(QWidget *parent); 41 ~FWidget(); 42 43 public slots: 44 void nextAnimationFrame(); 45 46 protected: 47 void paintEvent(QPaintEvent *event); 48 49 private: 50 QList<QByteArray> MPName; 51 QList<double> bytesMP; 52 }; 53 // End new Perlt 54 34 55 class bncAboutDlg : public QDialog { 35 56 Q_OBJECT … … 56 77 void CreateMenu(); 57 78 void AddToolbar(); 58 79 59 80 public slots: 60 81 void slotMountPointsRead(QList<bncGetThread*>); … … 150 171 QTextEdit* _log; 151 172 152 QWidget* _canvas;173 QWidget* _canvas; 153 174 QTabWidget* aogroup; 175 176 // neu Perlt 177 QTabWidget* loggroup; 178 FWidget* _Figure1; 179 // Ende neu Perlt 154 180 155 181 bncCaster* _caster; -
trunk/BNC/todo.txt
r1911 r1912 13 13 We once saw a wrong date. 14 14 (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. 16 19 (5) GW: Keep an eye on www.igs-ip.net/PENC0. 17 20
Note:
See TracChangeset
for help on using the changeset viewer.