• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

gui/opticwidget.cpp (r4864/r3096)

Go to the documentation of this file.
00001 #include "opticwidget.h"
00002 
00003 #include <QFileDialog>
00004 #include <QTimer>
00005 #include <QApplication>
00006 
00007 OpticWidget::OpticWidget(QWidget* parent, roc::OpticBoard* brd) :
00008    SubWidget(parent),
00009    fBoard(brd)
00010 {
00011    setupUi(this);
00012 
00013    QObject::connect(StartDAQPushButton, SIGNAL(clicked()), this, SLOT(setStartDAQ()));
00014    QObject::connect(StopDAQPushButton, SIGNAL(clicked()), this, SLOT(setStopDAQ()));
00015    QObject::connect(DatagenPushButton, SIGNAL(clicked()), this, SLOT(setDataGen()));
00016    QObject::connect(DLMtoABBButton, SIGNAL(clicked()), this, SLOT(setSendDLM_R2A()));
00017    QObject::connect(DLMtoROCButton, SIGNAL(clicked()), this, SLOT(setSendDLM_A2R()));
00018    QObject::connect(DLMHistoryButton, SIGNAL(clicked()), this, SLOT(getDLMHistory()));
00019 
00020    getSubConfig();
00021 }
00022 
00023 
00024 bool OpticWidget::getSubConfig()
00025 {
00026    base::OperList lst;
00027 
00028    lst.addGet(ROC_OPTICS_HWV);
00029    lst.addGet(ROC_OPTICS_DLM_HISTORY);
00030    lst.addGet(ROC_OPTICS_RADTOL);
00031 
00032    fBoard->operGen(lst);
00033 
00034    VersionLbl->setText(QString("Optics version: %1").arg(roc::Board::versionToString(lst.oper(0).value), 0, 16));
00035 
00036         fRadTol = (lst.oper(2).value==1);
00037    if (fRadTol){
00038                 RadTolLbl->setText(QString("Radiation mitigated: Yes"));
00039                 DatagenPushButton->setEnabled(false);
00040         } else {
00041                 RadTolLbl->setText(QString("Radiation mitigated: No"));
00042         }
00043 
00044         DLMHistoryEdit->setText(QString("%1").arg(lst.oper(1).value, 0, 16));
00045 
00046    return true;
00047 
00048 }
00049 
00050 bool OpticWidget::setSubConfig()
00051 {
00052 //   base::OperList lst;
00053 //
00054 //   uint32_t value;
00055 //   bool ok(false);
00056 //
00057 //   value = ReceiveMaskEdit->text().toUInt(&ok, 16);
00058 //   if (!ok) return false;
00059 //   lst.addPut(ROC_FEET_RECEIVE_MASK, value);
00060 //
00061 //   fBoard->operGen(lst);
00062 //
00063    return true;
00064 }
00065 
00066 bool OpticWidget::fillCmdFile(FILE* f)
00067 {
00068    fprintf(f, "\n// OPTICS relevant settings\n");
00069 
00070    return true;
00071 }
00072 
00073 
00074 void OpticWidget::setStartDAQ()
00075 {
00076    fBoard->put(ROC_OPTICS_START_DAQ, 0);
00077 }
00078 
00079 void OpticWidget::setStopDAQ()
00080 {
00081    fBoard->put(ROC_OPTICS_STOP_DAQ, 0);
00082 }
00083 
00084 void OpticWidget::setDataGen()
00085 {
00086 
00087         if (DatagenPushButton->isChecked()) {
00088                 fBoard->put(ROC_OPTICS_DATAGEN, 1);
00089         } else {
00090                 fBoard->put(ROC_OPTICS_DATAGEN, 0);
00091         }
00092 }
00093 
00094 void OpticWidget::setSendDLM_R2A()
00095 {
00096    uint32_t value;
00097    //bool ok(false);
00098 
00099    //value = DLMtoABBEdit->text().toUInt(&ok, 10);
00100    value = DLMtoABBcomboBox->currentIndex();
00101         //if (!ok) return;
00102         fBoard->put(ROC_OPTICS_DLMGEN, value);
00103 }
00104 
00105 void OpticWidget::setSendDLM_A2R()
00106 {
00107    uint32_t value;
00108 
00109    value = DLMtoROCcomboBox->currentIndex();
00110         fBoard->invokeDLM(value);
00111 
00112 }
00113 
00114 void OpticWidget::getDLMHistory()
00115 {
00116    base::OperList lst;
00117 
00118    lst.addGet(ROC_OPTICS_DLM_HISTORY);
00119 
00120    fBoard->operGen(lst);
00121 
00122         DLMHistoryEdit->setText(QString("%1").arg(lst.oper(0).value, 0, 16));
00123 }
00124 
00125 

Generated on Tue Dec 10 2013 04:52:22 for ROCsoft by  doxygen 1.7.1