Ignore:
Timestamp:
06/21/11 12:52:38 (13 years ago)
Author:
ogrimm
Message:
Updates to Edd. History server now periodically saves histories to disk.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fact/tools/Edd/Edd.cc

    r10984 r11088  
    901901  // Menu bar
    902902  QMenu* Menu = menuBar()->addMenu("&Menu");
    903   Menu->addAction("New history plot", this, SLOT(MenuNewHistory()));
     903  Menu->addAction("Open history plot", this, SLOT(MenuNewHistory()));
     904  Menu->addAction("Send command", this, SLOT(MenuCommand()));
    904905  Menu->addAction("Raw data browser", this, SLOT(MenuRawDataBrowser()));
    905906  Menu->addSeparator();
     
    939940}
    940941
    941 // Open request for new history plot
     942// Open new history plot
    942943void GUI::MenuNewHistory() {
    943944
     
    956957  // Open dialog and open history window
    957958  QString Result = QInputDialog::getItem(this, "Edd Request",
    958     "Enter DIM service name", List, 0, true, &OK);
     959    "Enter or choose DIM service name (add index separated by colon)", List, 0, true, &OK);
     960
     961  // Check if cancelled or empty data
     962  List = Result.trimmed().split(":", QString::SkipEmptyParts);
     963  if (!OK || List.isEmpty()) return;
     964
     965  if (List.size() == 1) OpenHistory(List[0].toAscii().data(), 0);
     966  else OpenHistory(List[0].toAscii().data(), atoi(List[1].toAscii().data()));
     967}
     968
     969// Send command selected from list
     970void GUI::MenuCommand() {
     971
     972  QStringList List;
     973  char *Name, *Format;
     974  int Type;
     975  bool OK;
     976
     977  // Find all DIM commands and sort
     978  getServices("*");
     979  while ((Type = getNextService(Name, Format)) != 0) {
     980    if (Type==DimCOMMAND) List.append(Name);
     981  }
     982  List.sort();
     983
     984  // Open dialog and open window for entering command
     985  QString Result = QInputDialog::getItem(this, "Edd Request",
     986    "Enter or choose DIM command name", List, 0, true, &OK);
    959987  if (OK && !Result.isEmpty()) {
    960988    Result = Result.trimmed();
    961     QWidget *Hist = OpenHistory(Result.toAscii().data(), 0);
    962     if (Hist != NULL) Hist->show();
     989       
     990        QMainWindow *M = new QMainWindow;
     991        M->setCentralWidget(new QWidget(M));
     992        M->setStatusBar(new QStatusBar(M));
     993        M->setAttribute(Qt::WA_DeleteOnClose);
     994        QWidget *W = new EddCommand(Result.toAscii().data());
     995        QFormLayout *FormLayout = new QFormLayout(M->centralWidget());
     996        FormLayout->setRowWrapPolicy(QFormLayout::WrapAllRows);
     997        FormLayout->addRow("Enter argument for " + Result, W);
     998        M->show();
    963999  }
    9641000}
Note: See TracChangeset for help on using the changeset viewer.