Changeset 222 in flair-src for trunk/tools/FlairGCS/src/DataRemote.cpp


Ignore:
Timestamp:
02/26/18 09:36:16 (4 years ago)
Author:
Sanahuja Guillaume
Message:

allows realloc in graphs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/FlairGCS/src/DataRemote.cpp

    r67 r222  
    2929  menu->addSeparator();
    3030
    31   b = menu->addAction("auto refresh");
    32   b->setCheckable(true);
    33   b->setChecked(auto_refresh);
     31  autoRefresh = menu->addAction("auto refresh");
     32  autoRefresh->setCheckable(true);
     33  autoRefresh->setChecked(auto_refresh);
    3434
    35   c = menu->addAction(QString("set refresh rate (%1ms)")
     35  setRefreshRate = menu->addAction(QString("set refresh rate (%1ms)")
    3636                          .arg((uint16_t)(qRound(refresh_rate * 1000))));
    37   c->setEnabled(auto_refresh);
    38   menu->addSeparator();
     37  setRefreshRate->setEnabled(auto_refresh);
     38/*  menu->addSeparator();
    3939
    40   d = menu->addAction("log");
    41   d->setCheckable(true);
    42   d->setChecked(is_logging);
     40  log = menu->addAction("log");
     41  log->setCheckable(true);
     42  log->setChecked(is_logging);
     43  */
    4344}
    4445
    4546QAction *DataRemote::execmenu(QWidget *parent, QMenu *menu, QPoint point) {
    46   QAction *z;
     47  QAction *action;
    4748
    48   z = menu->exec(point);
     49  action = menu->exec(point);
    4950
    5051  // auto_refresh=b->isChecked();
    5152
    52   if (z == b) {
    53     SendPeriod(RefreshRate_ms(), b->isChecked());
     53  if (action == autoRefresh) {
     54    SendPeriod(RefreshRate_ms(), autoRefresh->isChecked());
    5455  }
    5556
    56   if (z == c) {
     57  if (action == setRefreshRate) {
    5758    bool ok;
    5859    // uint16_t time = QInputDialog::getInt(this, QString("Set refresh rate
     
    6465    if (ok == true && time != qRound(refresh_rate * 1000)) {
    6566      // refresh_rate=time/1000.;
    66       SendPeriod(time, b->isChecked());
     67      SendPeriod(time, autoRefresh->isChecked());
    6768    }
    6869  }
    69 
    70   return z;
     70 
     71  return action;
    7172}
    7273
Note: See TracChangeset for help on using the changeset viewer.