Changeset 1925 in ntrip


Ignore:
Timestamp:
Nov 11, 2009, 5:33:46 PM (14 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncwindow.cpp

    r1916 r1925  
    5656using namespace std;
    5757
    58 // Begin new Perlt
    59 FWidget::FWidget(QWidget *parent)
    60     : QWidget(parent)
    61 {
     58// Constructor
     59////////////////////////////////////////////////////////////////////////////
     60FWidget::FWidget(QWidget *parent) : QWidget(parent) {
    6261  bncSettings settings;
    6362  QListIterator<QString> it(settings.value("mountPoints").toStringList());
     
    6564    QStringList hlp = it.next().split(" ");
    6665    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////////////////////////////////////////////////////////////////////////////
     72FWidget::~FWidget() {
     73}
     74
     75//
     76////////////////////////////////////////////////////////////////////////////
     77void FWidget::nextAnimationFrame() {
     78  update();
     79}
     80
     81//
     82////////////////////////////////////////////////////////////////////////////
     83void 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()) {
    101105    QByteArray hlp=it.next();
    102     double bytesnew=bytesMP[MPName.lastIndexOf(hlp)];
     106    double bytesnew=_bytesMP[_MPName.lastIndexOf(hlp)];
    103107    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}
    114117
    115118// Constructor
     
    119122  _caster = 0;
    120123
    121 // Begin new Perlt
    122   // Figure
    123124  _Figure1 = new FWidget(this);
    124 // End new Perlt
    125125
    126126  int ww = QFontMetrics(this->font()).width('w');
     
    432432  setCentralWidget(_canvas);
    433433
    434   aogroup = new QTabWidget();
     434  _aogroup = new QTabWidget();
    435435  QWidget* pgroup = new QWidget();
    436436  QWidget* ggroup = new QWidget();
     
    442442  QWidget* rgroup = new QWidget();
    443443  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();
    457455  QWidget* log1group = new QWidget();
    458456  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"));
    461459
    462460  // log Tab
     
    471469  log2Layout->addWidget(_Figure1,            0,0);
    472470  log2group->setLayout(log2Layout);
    473 
    474 // End new Perlt
    475471
    476472  // Proxy Tab
     
    789785
    790786  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);
    793789  mLayout->addWidget(_mountPointsTable,   1,0);
    794790
    795 // Begin new Perlt
    796 //  mLayout->addWidget(new QLabel(" Logs:"),2,0);
    797 //  mLayout->addWidget(_log,                3,0);
    798791  QTimer *timer = new QTimer(this);
    799792  connect(timer, SIGNAL(timeout()), _Figure1, SLOT(nextAnimationFrame()));
    800   mLayout->addWidget(loggroup,            2,0);
     793  mLayout->addWidget(_loggroup,            2,0);
    801794  timer->start(100);
    802 
    803 // End new Perlt
    804795
    805796  _canvas->setLayout(mLayout);
     
    11241115  settings.setValue("serialStopBits",  _serialStopBitsComboBox->currentText());
    11251116  settings.setValue("serialFlowControl",_serialFlowControlComboBox->currentText());
    1126   settings.setValue("startTab",    aogroup->currentIndex());
     1117  settings.setValue("startTab",    _aogroup->currentIndex());
    11271118  settings.setValue("waitTime",    _waitTimeSpinBox->value());
    11281119
     
    14241415  // Proxy
    14251416  //------
    1426   if (aogroup->currentIndex() == 0) {
     1417  if (_aogroup->currentIndex() == 0) {
    14271418    if (!isEmpty) {
    14281419      _proxyPortLineEdit->setStyleSheet("background-color: white");
     
    14361427  // RINEX Observations
    14371428  // ------------------
    1438   if (aogroup->currentIndex() == 2) {
     1429  if (_aogroup->currentIndex() == 2) {
    14391430    if (!isEmpty) {
    14401431      _rnxSamplSpinBox->setStyleSheet("background-color: white");
     
    14661457  // RINEX Ephemeris
    14671458  // ---------------
    1468   if (aogroup->currentIndex() == 3) {
     1459  if (_aogroup->currentIndex() == 3) {
    14691460    if (!_ephPathLineEdit->text().isEmpty() && !_outEphPortLineEdit->text().isEmpty()) {
    14701461      _ephIntrComboBox->setStyleSheet("background-color: white");
     
    14991490  // Broadcast Corrections
    15001491  // ---------------------
    1501   if (aogroup->currentIndex() == 4) {
     1492  if (_aogroup->currentIndex() == 4) {
    15021493    if (!isEmpty) {
    15031494      if (!_corrPathLineEdit->text().isEmpty()) {
     
    15251516  // Feed Engine
    15261517  // -----------
    1527   if (aogroup->currentIndex() == 5) {
     1518  if (_aogroup->currentIndex() == 5) {
    15281519    if ( !_outPortLineEdit->text().isEmpty() || !_outFileLineEdit->text().isEmpty()) {
    15291520      _waitTimeSpinBox->setStyleSheet("background-color: white");
     
    15411532  // Serial Output
    15421533  // -------------
    1543   if (aogroup->currentIndex() == 6) {
     1534  if (_aogroup->currentIndex() == 6) {
    15441535    if (!isEmpty) {
    15451536      _serialPortNameLineEdit->setStyleSheet("background-color: white");
     
    15921583  // Outages
    15931584  // -------
    1594   if (aogroup->currentIndex() == 7) {
     1585  if (_aogroup->currentIndex() == 7) {
    15951586    if (!isEmpty) {
    15961587      _adviseScriptLineEdit->setStyleSheet("background-color: white");
     
    16121603  // Miscellaneous
    16131604  // -------------
    1614   if (aogroup->currentIndex() == 8) {
     1605  if (_aogroup->currentIndex() == 8) {
    16151606    if (!isEmpty) {
    16161607      _perfIntrComboBox->setStyleSheet("background-color: white");
  • trunk/BNC/bncwindow.h

    r1912 r1925  
    3232#include "bnccaster.h"
    3333
    34 // Begin new Perlt
    35 class FWidget : public QWidget
    36 {
    37     Q_OBJECT
     34class 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};
    3847
    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 {
     48class bncAboutDlg : public QDialog {
    5649  Q_OBJECT
    57 
    5850  public:
    5951    bncAboutDlg(QWidget* parent);
     
    172164
    173165    QWidget*    _canvas;
    174     QTabWidget* aogroup;
     166    QTabWidget* _aogroup;
    175167
    176 // neu Perlt
    177     QTabWidget* loggroup;
     168    QTabWidget* _loggroup;
    178169    FWidget*    _Figure1;
    179 // Ende neu Perlt
    180170
    181171    bncCaster* _caster;
Note: See TracChangeset for help on using the changeset viewer.