created messages tab-not working completely yet

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@15 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
l_maliakal_d 2012-06-28 08:35:21 +00:00
parent 824da9d4c4
commit ec0878d008
12 changed files with 549 additions and 79 deletions

View File

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>TabMessagesObject</class>
<widget class="QWidget" name="TabMessagesObject">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>775</width>
<height>345</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="1" column="1" rowspan="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="2">
<widget class="QLineEdit" name="lineEdit"/>
</item>
<item row="2" column="0" rowspan="2">
<widget class="QLabel" name="label_2">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QLineEdit" name="lineEdit_2"/>
</item>
<item row="0" column="0" colspan="3">
<widget class="QTextEdit" name="textEdit"/>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -35,7 +35,7 @@
<property name="geometry">
<rect>
<x>10</x>
<y>135</y>
<y>200</y>
<width>751</width>
<height>141</height>
</rect>
@ -73,7 +73,26 @@
</widget>
</item>
<item row="0" column="1" colspan="7">
<widget class="QLineEdit" name="dispTitle"/>
<widget class="QLineEdit" name="dispTitle">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>250</width>
<height>0</height>
</size>
</property>
<property name="echoMode">
<enum>QLineEdit::Normal</enum>
</property>
<property name="readOnly">
<bool>false</bool>
</property>
</widget>
</item>
<item row="3" column="7">
<widget class="QLineEdit" name="dispZMax">
@ -392,10 +411,10 @@
</property>
<property name="geometry">
<rect>
<x>150</x>
<x>315</x>
<y>70</y>
<width>466</width>
<height>46</height>
<width>446</width>
<height>51</height>
</rect>
</property>
<property name="title">
@ -466,7 +485,7 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>210</width>
<width>180</width>
<height>20</height>
</size>
</property>
@ -478,10 +497,10 @@
<widget class="QGroupBox" name="box1D">
<property name="geometry">
<rect>
<x>150</x>
<x>315</x>
<y>10</y>
<width>466</width>
<height>46</height>
<width>446</width>
<height>51</height>
</rect>
</property>
<property name="title">
@ -499,7 +518,7 @@
<x>10</x>
<y>20</y>
<width>254</width>
<height>23</height>
<height>21</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_3">
@ -575,8 +594,8 @@
<widget class="QPushButton" name="btnClear">
<property name="geometry">
<rect>
<x>420</x>
<y>12</y>
<x>395</x>
<y>15</y>
<width>40</width>
<height>28</height>
</rect>
@ -608,7 +627,7 @@
<property name="geometry">
<rect>
<x>10</x>
<y>290</y>
<y>135</y>
<width>751</width>
<height>51</height>
</rect>
@ -634,6 +653,12 @@
<layout class="QHBoxLayout" name="layoutSave">
<item>
<widget class="QLabel" name="lblFName">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>File Name:</string>
</property>
@ -645,7 +670,20 @@
<number>0</number>
</property>
<item>
<widget class="QLineEdit" name="dispFName"/>
<widget class="QLineEdit" name="dispFName">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>250</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboFormat">
@ -687,6 +725,22 @@
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_10">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="chkAutoFName">
<property name="text">
@ -710,10 +764,10 @@
</property>
<property name="geometry">
<rect>
<x>655</x>
<y>10</y>
<width>106</width>
<height>106</height>
<x>10</x>
<y>70</y>
<width>261</width>
<height>51</height>
</rect>
</property>
<property name="title">
@ -725,28 +779,16 @@
<property name="flat">
<bool>false</bool>
</property>
<widget class="QWidget" name="gridLayoutWidget_2">
<widget class="QWidget" name="gridLayoutWidget_4">
<property name="geometry">
<rect>
<x>5</x>
<y>19</y>
<width>96</width>
<height>81</height>
<y>21</y>
<width>251</width>
<height>21</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="horizontalSpacing">
<number>28</number>
</property>
<property name="verticalSpacing">
<number>8</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<widget class="QPushButton" name="btnClone">
<property name="sizePolicy">
@ -762,11 +804,11 @@
<string>Create</string>
</property>
<property name="flat">
<bool>false</bool>
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<item row="0" column="1">
<widget class="QPushButton" name="btnCloseClones">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@ -780,6 +822,28 @@
<property name="text">
<string>Close All</string>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="btnSaveClones">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Save All</string>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
@ -793,8 +857,8 @@
<rect>
<x>10</x>
<y>10</y>
<width>106</width>
<height>106</height>
<width>261</width>
<height>51</height>
</rect>
</property>
<property name="title">
@ -806,16 +870,16 @@
<property name="flat">
<bool>false</bool>
</property>
<widget class="QWidget" name="gridLayoutWidget_4">
<widget class="QWidget" name="gridLayoutWidget_6">
<property name="geometry">
<rect>
<x>10</x>
<y>14</y>
<width>93</width>
<height>96</height>
<y>20</y>
<width>246</width>
<height>21</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="0">
<widget class="QCheckBox" name="chkNoPlot">
<property name="text">
@ -823,14 +887,14 @@
</property>
</widget>
</item>
<item row="1" column="0">
<item row="0" column="1">
<widget class="QCheckBox" name="chktest1D_3">
<property name="text">
<string>Data Graph</string>
</property>
</widget>
</item>
<item row="2" column="0">
<item row="0" column="2">
<widget class="QCheckBox" name="chktest1D_4">
<property name="text">
<string>Histogram</string>

View File

@ -115,7 +115,7 @@
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="spinBox">
<widget class="QSpinBox" name="spinThreshold">
<property name="minimum">
<number>-1</number>
</property>
@ -139,10 +139,10 @@
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="comboBox"/>
<widget class="QComboBox" name="comboDynamicRange"/>
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="spinBox_2"/>
<widget class="QSpinBox" name="spinNumModules"/>
</item>
</layout>
</widget>

View File

@ -19,6 +19,7 @@ class qTabAdvanced;
class qTabSettings;
class qTabDebugging;
class qTabDeveloper;
class qTabMessages;
/** Project Class Headers */
class slsDetectorUtils;
#include "sls_detector_defs.h"
@ -80,7 +81,7 @@ private:
/** The default tab heading color */
QColor defaultTabColor;
/** enumeration of the tabs */
enum {Measurement, Settings, DataOutput, Plot, Actions, Advanced, Debugging, Developer, NumberOfTabs };
enum {Measurement, Settings, DataOutput, Plot, Actions, Advanced, Debugging, Developer, Messages, NumberOfTabs };
/* Scroll Area for the tabs**/
QScrollArea *scroll[NumberOfTabs];
/**Measurement tab */
@ -99,6 +100,8 @@ private:
qTabDebugging *tab_debugging;
/**Developer tab */
qTabDeveloper *tab_developer;
/**Messages tab */
qTabMessages *tab_messages;
/**if the developer tab should be enabled,known from command line */
int isDeveloper;

View File

@ -53,6 +53,10 @@ private:
*/
void SetupWidgetWindow();
/** Sets up the timing mode
*/
void SetupTimingMode();
/** Sets up all the slots and signals
* @param timingChange only some of the signals are disconnected when timing mode is changed
* This method is to reconnect them again.

View File

@ -0,0 +1,68 @@
/*
* qTabMessages.h
*
* Created on: Jun 26, 2012
* Author: l_maliakal_d
*/
#ifndef QTABMESSAGES_H_
#define QTABMESSAGES_H_
/** Project Class Headers */
class slsDetectorUtils;
/** Qt Include Headers */
#include <QWidget>
#include <QTextEdit>
#include <QLineEdit>
/**
*@short sets up the Messages parameters
*/
class qTabMessages:public QWidget{
Q_OBJECT
public:
/** \short The constructor
* @param parent is the parent tab widget
* @param detector is the detector returned from the detector tab
*/
qTabMessages(QWidget *parent,slsDetectorUtils*& detector);
/** Destructor
*/
~qTabMessages();
private:
/** The sls detector object */
slsDetectorUtils *myDet;
/** Log of executed commands */
QTextEdit *dispLog;
/** Command display */
QLineEdit *dispCommand;
/** Path display */
QLineEdit *dispPath;
/** methods */
/** Sets up the widget */
void SetupWidgetWindow();
/** Sets up all the slots and signals */
void Initialization();
private slots:
void executeCommand();
};
#endif /* QTABMESSAGES_H_ */

View File

@ -12,6 +12,9 @@
#include "ui_form_tab_settings.h"
/** Project Class Headers */
class slsDetectorUtils;
#include "sls_detector_defs.h"
/** Qt Include Headers */
#include <QStandardItemModel>
/**
*@short sets up the Settings parameters
@ -35,15 +38,26 @@ public:
private:
/** The sls detector object */
slsDetectorUtils *myDet;
/** sls detector id */
/**etector id */
int detID;
/** detector type */
slsDetectorDefs::detectorType detType;
enum{Standard,Fast,HighGain,DynamicGain,LowGain,MediumGain,VeryHighGain,Undefined,Uninitialized,NumSettings};
/** To be able to index items on a combo box */
QStandardItemModel* model;
QModelIndex index[NumSettings];
QStandardItem* item[NumSettings];
/** Sets up the widget
*/
void SetupWidgetWindow();
/** Sets up the detector settings
*/
void SetupDetectorSettings();
/** Sets up all the slots and signals
*/
void Initialization();

View File

@ -58,7 +58,8 @@ SOURCES = \
src/qTabAdvanced.cpp\
src/qTabSettings.cpp\
src/qTabDebugging.cpp\
src/qTabDeveloper.cpp
src/qTabDeveloper.cpp\
src/qTabMessages.cpp
HEADERS = \
slsDetectorPlotting/include/SlsQt1DPlot.h\
@ -82,6 +83,7 @@ HEADERS = \
include/qTabSettings.h\
include/qTabDebugging.h\
include/qTabDeveloper.h\
include/qTabMessages.h\
../slsDetectorSoftware/commonFiles/sls_detector_defs.h
@ -95,3 +97,4 @@ FORMS = \
forms/form_tab_settings.ui\
forms/form_tab_debugging.ui\
forms/form_tab_developer.ui
# forms/form_tab_messages.ui

View File

@ -10,6 +10,7 @@
#include "qTabSettings.h"
#include "qTabDebugging.h"
#include "qTabDeveloper.h"
#include "qTabMessages.h"
/** Project Class Headers */
#include "slsDetector.h"
#include "multiSlsDetector.h"
@ -93,6 +94,7 @@ void qDetectorMain::SetUpWidgetWindow(){
tab_advanced = new qTabAdvanced (this, myDet);
tab_debugging = new qTabDebugging (this, myDet);
tab_developer = new qTabDeveloper (this, myDet);
tab_messages = new qTabMessages (this, myDet);
/** creating the scroll area widgets for the tabs */
for(int i=0;i<NumberOfTabs;i++){
scroll[i] = new QScrollArea;
@ -118,6 +120,8 @@ void qDetectorMain::SetUpWidgetWindow(){
tabs->insertTab(Advanced, scroll[Advanced], "Advanced");
tabs->insertTab(Debugging, scroll[Debugging], "Debugging");
tabs->insertTab(Developer, scroll[Developer], "Developer");
/** Prefer this to expand and not have scroll buttons*/
tabs->insertTab(Messages, tab_messages, "Messages");
/** mode setup - to set up the tabs initially as disabled, not in form so done here */
SetDebugMode(false);
@ -404,6 +408,7 @@ void qDetectorMain::EnableTabs(){
tabs->setTabEnabled(DataOutput,enable);
tabs->setTabEnabled(Actions,enable);
tabs->setTabEnabled(Settings,enable);
tabs->setTabEnabled(Messages,enable);
/** special tabs */
if(enable==false){

View File

@ -12,9 +12,8 @@
/** Project Class Headers */
#include "slsDetector.h"
#include "multiSlsDetector.h"
/** Qt Include Headers */
#include <QStandardItemModel>
/** C++ Include Headers */
#include<iostream>
using namespace std;
@ -63,8 +62,15 @@ void qTabMeasurement::SetupWidgetWindow(){
progressBar->setValue(0);
/** timing mode*/
SetupTimingMode();
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabMeasurement::SetupTimingMode(){
/** Get timing mode from detector*/
slsDetectorDefs::externalCommunicationMode mode = myDet->setExternalCommunicationMode();
/** To be able to index items on a combo box */
QStandardItemModel* model = qobject_cast<QStandardItemModel*>(comboTimingMode->model());
QModelIndex index[NumTimingModes];
@ -128,7 +134,7 @@ void qTabMeasurement::SetupWidgetWindow(){
}
}
/** Mode NOT ENABLED.
* This should not happen only if the server and gui has a mismatch
* This should not happen -only if the server and gui has a mismatch
* on which all modes are allowed in detectors */
else{
qDefs::ErrorMessage("ERROR: Unknown Timing Mode detected from detector."

View File

@ -0,0 +1,129 @@
/*
* qTabMessages.cpp
*
* Created on: Jun 26, 2012
* Author: l_maliakal_d
*/
#include "qTabMessages.h"
/** Project Class Headers */
#include "slsDetector.h"
#include "multiSlsDetector.h"
/** Qt Include Headers */
#include <QGridLayout>
#include <QLabel>
#include <QSpacerItem>
#include <QDir>
#include <QProcess>
#include <QStringList>
/** C++ Include Headers */
#include <iostream>
using namespace std;
//-------------------------------------------------------------------------------------------------------------------------------------------------
qTabMessages::qTabMessages(QWidget *parent,slsDetectorUtils*& detector):
QWidget(parent),myDet(detector){
SetupWidgetWindow();
Initialization();
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
qTabMessages::~qTabMessages(){
delete myDet;
delete dispLog;
delete dispCommand;
delete dispPath;
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabMessages::SetupWidgetWindow(){
/** Layout */
QGridLayout *gridLayout = new QGridLayout(this);
QLabel *lblCommand = new QLabel("System Command:",this);
QLabel *lblPath = new QLabel("Working Directory:",this);
QSpacerItem *hSpacer= new QSpacerItem(20, 20, QSizePolicy::Fixed, QSizePolicy::Minimum);
dispLog = new QTextEdit(this);
dispCommand = new QLineEdit(this);
dispPath = new QLineEdit(this);
dispLog->setReadOnly(true);
dispPath->setReadOnly(true);
dispLog->setFocusPolicy(Qt::NoFocus);
dispPath->setFocusPolicy(Qt::NoFocus);
gridLayout->addWidget(dispLog, 0, 0, 1, 3);
gridLayout->addWidget(lblCommand, 1, 0, 1, 1);
gridLayout->addItem(hSpacer, 1, 1, 1, 1);
gridLayout->addWidget(dispCommand, 1, 2, 1, 1);
gridLayout->addWidget(lblPath, 2, 0, 1, 1);
gridLayout->addWidget(dispPath, 2, 2, 1, 1);
/** Command & Path*/
dispCommand->setText("Insert your command here");
dispPath->setText(QDir("./").absolutePath());
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabMessages::Initialization(){
connect(dispCommand,SIGNAL(returnPressed()),this,SLOT(executeCommand()));
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabMessages::executeCommand(){
#ifdef VERBOSE
cout<<"Calling: "<< dispCommand->text().toAscii().constData()<<endl;
#endif
QProcess proc(this);
#ifdef VERBOSE
//std::cout <<"working directory would be " << proc.workingDirectory().absPath() << std::endl;
cout<<"Original Working Directory: "<< proc.workingDirectory().toAscii().constData()<<endl;
#endif
proc.setWorkingDirectory(QDir(dispPath->text()).absolutePath());
#ifdef VERBOSE
//std::cout <<"working directory is " << proc.workingDirectory().absPath() << std::endl;
cout<<"Current Working Directory: "<<proc.workingDirectory().toAscii().constData()<<endl;
#endif
proc.setArguments(QStringList::split(' ',dispCommand->text()));
#ifdef VERBOSE
/* QStringList list = proc.arguments();
QStringList::Iterator it = list.begin();
while( it != list.end() ) {
cout<<*it<<endl;
++it;
}*/
#endif
//if (!proc.start()) {
if(!(proc.state()==QProcess::Running)){
// error handling
cout<<"Could not launch process"<<endl;
} else {
//while(proc.isRunning()) {
while(proc.state()==QProcess::Running){
;
#ifdef VERBOSE
cout<<"Process running "<< proc.exitStatus()<< endl;
#endif
}
//if (proc.normalExit()) {
if(proc.exitStatus()==QProcess::NormalExit){
;
#ifdef VERBOSE
cout<<" process returned OK"<<endl;
#endif
} else
cout<<" process returned error"<<endl;
while (proc.canReadLineStdout()) {//readAllStandardOutput ()
cout<<proc.readLineStdout() <<endl;
}
while (proc.canReadLineStderr()) {
cout<<"Error: "<<proc.readLineStderr() <<endl;
}
}
}
//-------------------------------------------------------------------------------------------------------------------------------------------------

View File

@ -14,41 +14,132 @@
#include<iostream>
using namespace std;
//-------------------------------------------------------------------------------------------------------------------------------------------------
qTabSettings::qTabSettings(QWidget *parent,slsDetectorUtils*& detector,int detID):
QWidget(parent),myDet(detector),detID(detID){
setupUi(this);
SetupWidgetWindow();
Initialization();
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
qTabSettings::~qTabSettings(){
delete myDet;
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabSettings::SetupWidgetWindow(){
/** Detector Type*/
detType=myDet->getDetectorsType();
/** Settings */
SetupDetectorSettings();
comboSettings->setCurrentIndex(myDet->getSettings(detID));
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabSettings::SetupDetectorSettings(){
/** Get detector settings from detector*/
slsDetectorDefs::detectorSettings sett = myDet->getSettings(detID);
/** To be able to index items on a combo box */
model = qobject_cast<QStandardItemModel*>(comboSettings->model());
if (model) {
for(int i=0;i<NumSettings;i++){
index[i] = model->index(i, comboSettings->modelColumn(), comboSettings->rootModelIndex());
item[i] = model->itemFromIndex(index[i]);
}
/** Enabling/Disabling depending on the detector type
Undefined and uninitialized are enabled for all detectors*/
if(sett==slsDetectorDefs::UNDEFINED)
item[(int)Uninitialized]->setEnabled(false);
else if(sett==slsDetectorDefs::UNINITIALIZED)
item[(int)Undefined]->setEnabled(false);
else{
item[(int)Uninitialized]->setEnabled(false);
item[(int)Undefined]->setEnabled(false);
}
switch(detType){
case slsDetectorDefs::MYTHEN:
item[(int)Standard]->setEnabled(true);
item[(int)Fast]->setEnabled(true);
item[(int)HighGain]->setEnabled(true);
item[(int)DynamicGain]->setEnabled(false);
item[(int)LowGain]->setEnabled(false);
item[(int)MediumGain]->setEnabled(false);
item[(int)VeryHighGain]->setEnabled(false);
break;
case slsDetectorDefs::EIGER:
item[(int)Standard]->setEnabled(false);
item[(int)Fast]->setEnabled(false);
item[(int)HighGain]->setEnabled(false);
item[(int)DynamicGain]->setEnabled(false);
item[(int)LowGain]->setEnabled(false);
item[(int)MediumGain]->setEnabled(false);
item[(int)VeryHighGain]->setEnabled(false);
break;
case slsDetectorDefs::GOTTHARD:
item[(int)Standard]->setEnabled(false);
item[(int)Fast]->setEnabled(false);
item[(int)HighGain]->setEnabled(true);
item[(int)DynamicGain]->setEnabled(true);
item[(int)LowGain]->setEnabled(true);
item[(int)MediumGain]->setEnabled(true);
item[(int)VeryHighGain]->setEnabled(true);
break;
default:
qDefs::ErrorMessage("ERROR: Unknown detector type.","Settings: ERROR");
exit(-1);
break;
}
/** detector settings selected NOT ENABLED.
* This should not happen -only if the server and gui has a mismatch
* on which all modes are allowed in detectors */
if(!(item[(int)sett]->isEnabled())){
qDefs::ErrorMessage("ERROR: Unknown Detector Settings retrieved from detector. "
"Exiting GUI.","Settings: ERROR");
#ifdef VERBOSE
cout<<"ERROR: Unknown Detector Settings retrieved from detector."<<endl;
#endif
exit(-1);
}
/** Setting the detector settings */
else {
comboSettings->setCurrentIndex((int)sett);
}
}
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabSettings::Initialization(){
/** Settings */
connect(comboSettings,SIGNAL(currentIndexChanged(int)),this,SLOT(setSettings(int)));
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabSettings::setSettings(int index){
/** The first time settings is changed from undefined or uninitialized to a proper setting,
* then undefined/uninitialized should be disabled */
if(item[(int)Undefined]->isEnabled()){
/**Do not disable it if this wasnt selected again by mistake*/
if(index!=(int)Undefined)
item[(int)Undefined]->setEnabled(false);
}else if(item[(int)Uninitialized]->isEnabled()){
/**Do not disable it if this wasnt selected again by mistake*/
if(index!=(int)Uninitialized)
item[(int)Uninitialized]->setEnabled(false);
}
slsDetectorDefs::detectorSettings sett = myDet->setSettings((slsDetectorDefs::detectorSettings)index,detID);
#ifdef VERBOSE
cout<<"Settings have been set to "<<myDet->slsDetectorBase::getDetectorSettings(sett)<<endl;
@ -56,3 +147,4 @@ void qTabSettings::setSettings(int index){
}
//-------------------------------------------------------------------------------------------------------------------------------------------------