- Timestamp:
- Nov 11, 2009, 5:33:46 PM (15 years ago)
- Location:
- trunk/BNC
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/BNC/bncwindow.cpp ¶
r1916 r1925 56 56 using namespace std; 57 57 58 // Begin new Perlt 59 FWidget::FWidget(QWidget *parent) 60 : QWidget(parent) 61 { 58 // Constructor 59 //////////////////////////////////////////////////////////////////////////// 60 FWidget::FWidget(QWidget *parent) : QWidget(parent) { 62 61 bncSettings settings; 63 62 QListIterator<QString> it(settings.value("mountPoints").toStringList()); … … 65 64 QStringList hlp = it.next().split(" "); 66 65 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 line.setLine(50, 140, 50, 10); 85 painter.drawLine(line); 86 QPoint textP(40, 140); 87 painter.drawText(textP, tr("0")); 88 textP.setX(20); 89 textP.setY(25); 90 painter.drawText(textP, tr("3000")); 91 int anker=0; 92 textP.setY(160); 93 painter.drawText(textP, tr(QTime::currentTime().toString().toAscii())); 94 textP.setX(300); 95 96 // QString hlp = (QString("%1").arg(MPName.size())); 97 // if (MPName.isEmpty()) {painter.drawText(textP, tr("Empty"));} else {painter.drawText(textP, tr(hlp.toAscii()));} 98 99 QListIterator<QByteArray> it(MPName); 100 while (it.hasNext()) { 66 _MPName.append(url.path().toAscii()); _bytesMP.append(0); 67 } 68 } 69 70 // Destructor 71 //////////////////////////////////////////////////////////////////////////// 72 FWidget::~FWidget() { 73 } 74 75 // 76 //////////////////////////////////////////////////////////////////////////// 77 void FWidget::nextAnimationFrame() { 78 update(); 79 } 80 81 // 82 //////////////////////////////////////////////////////////////////////////// 83 void FWidget::paintEvent(QPaintEvent *) { 84 QRectF rectangle(0, 0, 640, 180); 85 QBrush rBrush(Qt::white,Qt::SolidPattern); 86 QPainter painter(this); 87 painter.fillRect(rectangle,rBrush); 88 painter.drawRect(rectangle); 89 QLine line(50, 140, 630, 140); 90 painter.drawLine(line); 91 line.setLine(50, 140, 50, 10); 92 painter.drawLine(line); 93 QPoint textP(40, 140); 94 painter.drawText(textP, tr("0")); 95 textP.setX(20); 96 textP.setY(25); 97 painter.drawText(textP, tr("3000")); 98 int anker=0; 99 textP.setY(160); 100 painter.drawText(textP, tr(QTime::currentTime().toString().toAscii())); 101 textP.setX(300); 102 103 QListIterator<QByteArray> it(_MPName); 104 while (it.hasNext()) { 101 105 QByteArray hlp=it.next(); 102 double bytesnew= bytesMP[MPName.lastIndexOf(hlp)];106 double bytesnew=_bytesMP[_MPName.lastIndexOf(hlp)]; 103 107 double vv = bytesnew/30; 104 QRectF vrect((100+anker*40), (140-vv), (30), (vv)); 105 QBrush xBrush(Qt::green,Qt::SolidPattern); 106 textP.setX(100+anker*40); 107 painter.fillRect(vrect,xBrush); 108 painter.drawRect(vrect); 109 painter.drawText(textP, hlp); 110 anker++; 111 } 112 } 113 // End new Perlt 108 QRectF vrect((100+anker*40), (140-vv), (30), (vv)); 109 QBrush xBrush(Qt::green,Qt::SolidPattern); 110 textP.setX(100+anker*40); 111 painter.fillRect(vrect,xBrush); 112 painter.drawRect(vrect); 113 painter.drawText(textP, hlp); 114 anker++; 115 } 116 } 114 117 115 118 // Constructor … … 119 122 _caster = 0; 120 123 121 // Begin new Perlt122 // Figure123 124 _Figure1 = new FWidget(this); 124 // End new Perlt125 125 126 126 int ww = QFontMetrics(this->font()).width('w'); … … 432 432 setCentralWidget(_canvas); 433 433 434 aogroup = new QTabWidget(); 434 _aogroup = new QTabWidget(); 435 435 QWidget* pgroup = new QWidget(); 436 436 QWidget* ggroup = new QWidget(); … … 442 442 QWidget* rgroup = new QWidget(); 443 443 QWidget* sergroup = new QWidget(); 444 aogroup->addTab(pgroup,tr("Proxy")); 445 aogroup->addTab(ggroup,tr("General")); 446 aogroup->addTab(ogroup,tr("RINEX Observations")); 447 aogroup->addTab(egroup,tr("RINEX Ephemeris")); 448 aogroup->addTab(cgroup,tr("Broadcast Corrections")); 449 aogroup->addTab(sgroup,tr("Feed Engine")); 450 aogroup->addTab(sergroup,tr("Serial Output")); 451 aogroup->addTab(agroup,tr("Outages")); 452 aogroup->addTab(rgroup,tr("Miscellaneous")); 453 454 // Begin new Perlt 455 456 loggroup = new QTabWidget(); 444 _aogroup->addTab(pgroup,tr("Proxy")); 445 _aogroup->addTab(ggroup,tr("General")); 446 _aogroup->addTab(ogroup,tr("RINEX Observations")); 447 _aogroup->addTab(egroup,tr("RINEX Ephemeris")); 448 _aogroup->addTab(cgroup,tr("Broadcast Corrections")); 449 _aogroup->addTab(sgroup,tr("Feed Engine")); 450 _aogroup->addTab(sergroup,tr("Serial Output")); 451 _aogroup->addTab(agroup,tr("Outages")); 452 _aogroup->addTab(rgroup,tr("Miscellaneous")); 453 454 _loggroup = new QTabWidget(); 457 455 QWidget* log1group = new QWidget(); 458 456 QWidget* log2group = new QWidget(); 459 loggroup->addTab(log1group,tr("Log")); 460 loggroup->addTab(log2group,tr("Status")); 457 _loggroup->addTab(log1group,tr("Log")); 458 _loggroup->addTab(log2group,tr("Status")); 461 459 462 460 // log Tab … … 471 469 log2Layout->addWidget(_Figure1, 0,0); 472 470 log2group->setLayout(log2Layout); 473 474 // End new Perlt475 471 476 472 // Proxy Tab … … 789 785 790 786 QGridLayout* mLayout = new QGridLayout; 791 aogroup->setCurrentIndex(settings.value("startTab").toInt()); 792 mLayout->addWidget(aogroup, 0,0); 787 _aogroup->setCurrentIndex(settings.value("startTab").toInt()); 788 mLayout->addWidget(_aogroup, 0,0); 793 789 mLayout->addWidget(_mountPointsTable, 1,0); 794 790 795 // Begin new Perlt796 // mLayout->addWidget(new QLabel(" Logs:"),2,0);797 // mLayout->addWidget(_log, 3,0);798 791 QTimer *timer = new QTimer(this); 799 792 connect(timer, SIGNAL(timeout()), _Figure1, SLOT(nextAnimationFrame())); 800 mLayout->addWidget(loggroup, 2,0); 793 mLayout->addWidget(_loggroup, 2,0); 801 794 timer->start(100); 802 803 // End new Perlt804 795 805 796 _canvas->setLayout(mLayout); … … 1124 1115 settings.setValue("serialStopBits", _serialStopBitsComboBox->currentText()); 1125 1116 settings.setValue("serialFlowControl",_serialFlowControlComboBox->currentText()); 1126 settings.setValue("startTab", aogroup->currentIndex()); 1117 settings.setValue("startTab", _aogroup->currentIndex()); 1127 1118 settings.setValue("waitTime", _waitTimeSpinBox->value()); 1128 1119 … … 1424 1415 // Proxy 1425 1416 //------ 1426 if (aogroup->currentIndex() == 0) { 1417 if (_aogroup->currentIndex() == 0) { 1427 1418 if (!isEmpty) { 1428 1419 _proxyPortLineEdit->setStyleSheet("background-color: white"); … … 1436 1427 // RINEX Observations 1437 1428 // ------------------ 1438 if (aogroup->currentIndex() == 2) { 1429 if (_aogroup->currentIndex() == 2) { 1439 1430 if (!isEmpty) { 1440 1431 _rnxSamplSpinBox->setStyleSheet("background-color: white"); … … 1466 1457 // RINEX Ephemeris 1467 1458 // --------------- 1468 if (aogroup->currentIndex() == 3) { 1459 if (_aogroup->currentIndex() == 3) { 1469 1460 if (!_ephPathLineEdit->text().isEmpty() && !_outEphPortLineEdit->text().isEmpty()) { 1470 1461 _ephIntrComboBox->setStyleSheet("background-color: white"); … … 1499 1490 // Broadcast Corrections 1500 1491 // --------------------- 1501 if (aogroup->currentIndex() == 4) { 1492 if (_aogroup->currentIndex() == 4) { 1502 1493 if (!isEmpty) { 1503 1494 if (!_corrPathLineEdit->text().isEmpty()) { … … 1525 1516 // Feed Engine 1526 1517 // ----------- 1527 if (aogroup->currentIndex() == 5) { 1518 if (_aogroup->currentIndex() == 5) { 1528 1519 if ( !_outPortLineEdit->text().isEmpty() || !_outFileLineEdit->text().isEmpty()) { 1529 1520 _waitTimeSpinBox->setStyleSheet("background-color: white"); … … 1541 1532 // Serial Output 1542 1533 // ------------- 1543 if (aogroup->currentIndex() == 6) { 1534 if (_aogroup->currentIndex() == 6) { 1544 1535 if (!isEmpty) { 1545 1536 _serialPortNameLineEdit->setStyleSheet("background-color: white"); … … 1592 1583 // Outages 1593 1584 // ------- 1594 if (aogroup->currentIndex() == 7) { 1585 if (_aogroup->currentIndex() == 7) { 1595 1586 if (!isEmpty) { 1596 1587 _adviseScriptLineEdit->setStyleSheet("background-color: white"); … … 1612 1603 // Miscellaneous 1613 1604 // ------------- 1614 if (aogroup->currentIndex() == 8) { 1605 if (_aogroup->currentIndex() == 8) { 1615 1606 if (!isEmpty) { 1616 1607 _perfIntrComboBox->setStyleSheet("background-color: white"); -
TabularUnified trunk/BNC/bncwindow.h ¶
r1912 r1925 32 32 #include "bnccaster.h" 33 33 34 // Begin new Perlt 35 class FWidget : public QWidget 36 { 37 Q_OBJECT 34 class FWidget : public QWidget { 35 Q_OBJECT 36 public: 37 FWidget(QWidget *parent); 38 ~FWidget(); 39 public slots: 40 void nextAnimationFrame(); 41 protected: 42 void paintEvent(QPaintEvent *event); 43 private: 44 QList<QByteArray> _MPName; 45 QList<double> _bytesMP; 46 }; 38 47 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 55 class bncAboutDlg : public QDialog { 48 class bncAboutDlg : public QDialog { 56 49 Q_OBJECT 57 58 50 public: 59 51 bncAboutDlg(QWidget* parent); … … 172 164 173 165 QWidget* _canvas; 174 QTabWidget* aogroup; 166 QTabWidget* _aogroup; 175 167 176 // neu Perlt 177 QTabWidget* loggroup; 168 QTabWidget* _loggroup; 178 169 FWidget* _Figure1; 179 // Ende neu Perlt180 170 181 171 bncCaster* _caster;
Note:
See TracChangeset
for help on using the changeset viewer.