included images

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@52 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
l_maliakal_d 2012-09-07 16:29:32 +00:00
parent a4a0237711
commit c9db2c4272
25 changed files with 331 additions and 147 deletions

View File

@ -109,6 +109,10 @@
<property name="text">
<string>Browse</string>
</property>
<property name="icon">
<iconset resource="../include/icons.qrc">
<normaloff>:/icons/images/browse.png</normaloff>:/icons/images/browse.png</iconset>
</property>
</widget>
</item>
<item row="0" column="3">
@ -158,6 +162,8 @@
</item>
</layout>
</widget>
<resources/>
<resources>
<include location="../include/icons.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -428,6 +428,10 @@ Defines scan range for a &lt;b&gt;Constant Step Size&lt;/b&gt; with the followin
<property name="text">
<string>Browse</string>
</property>
<property name="icon">
<iconset resource="../include/icons.qrc">
<normaloff>:/icons/images/browse.png</normaloff>:/icons/images/browse.png</iconset>
</property>
</widget>
</item>
</layout>
@ -466,6 +470,8 @@ Defines scan range for a &lt;b&gt;Constant Step Size&lt;/b&gt; with the followin
</item>
</layout>
</widget>
<resources/>
<resources>
<include location="../include/icons.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -31,6 +31,10 @@
<property name="windowTitle">
<string>Form</string>
</property>
<property name="windowIcon">
<iconset resource="../include/icons.qrc">
<normaloff>:/icons/images/refresh.png</normaloff>:/icons/images/refresh.png</iconset>
</property>
<widget class="QGroupBox" name="boxTrimming">
<property name="enabled">
<bool>true</bool>
@ -38,8 +42,8 @@
<property name="geometry">
<rect>
<x>25</x>
<y>90</y>
<width>721</width>
<y>100</y>
<width>726</width>
<height>226</height>
</rect>
</property>
@ -63,7 +67,7 @@
<rect>
<x>15</x>
<y>25</y>
<width>691</width>
<width>696</width>
<height>195</height>
</rect>
</property>
@ -302,6 +306,10 @@ An extension given by the modules serial number will be attached.
<property name="text">
<string>Browse</string>
</property>
<property name="icon">
<iconset resource="../include/icons.qrc">
<normaloff>:/icons/images/browse.png</normaloff>:/icons/images/browse.png</iconset>
</property>
</widget>
</item>
<item row="5" column="4">
@ -320,7 +328,11 @@ An extension given by the modules serial number will be attached.
</sizepolicy>
</property>
<property name="text">
<string>Start Trimming</string>
<string>Start Trimming </string>
</property>
<property name="icon">
<iconset resource="../include/icons.qrc">
<normaloff>:/icons/images/start.png</normaloff>:/icons/images/start.png</iconset>
</property>
</widget>
</item>
@ -540,70 +552,101 @@ An extension given by the modules serial number will be attached.
</layout>
</widget>
</widget>
<widget class="QGroupBox" name="groupBox">
<widget class="QGroupBox" name="boxPlot">
<property name="geometry">
<rect>
<x>25</x>
<y>10</y>
<width>341</width>
<height>61</height>
<height>76</height>
</rect>
</property>
<property name="title">
<string>Trimbits Plot Mode</string>
<string>Trimbits Plot</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<widget class="QWidget" name="horizontalLayoutWidget">
<property name="geometry">
<rect>
<x>15</x>
<y>20</y>
<width>311</width>
<height>31</height>
<x>120</x>
<y>22</y>
<width>211</width>
<height>44</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>34</number>
<number>17</number>
</property>
<item>
<widget class="QRadioButton" name="radioNoPlot">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<widget class="QPushButton" name="btnRefresh">
<property name="toolTip">
<string>&lt;nobr&gt;
Updates plot with Trimbits from Shared Memory, not from Detector.
&lt;/nobr&gt;</string>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="text">
<string>No Plot</string>
<string>Refresh </string>
</property>
<property name="checked">
<bool>true</bool>
<property name="icon">
<iconset resource="../include/icons.qrc">
<normaloff>:/icons/images/refresh.png</normaloff>:/icons/images/refresh.png</iconset>
</property>
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioDataGraph">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<widget class="QPushButton" name="btnGetTrimbits">
<property name="toolTip">
<string>&lt;nobr&gt;
Plots Trimbits from Detector. This will take time.
&lt;/nobr&gt;</string>
</property>
<property name="text">
<string>Get Trimbits </string>
</property>
<property name="icon">
<iconset resource="../include/icons.qrc">
<normaloff>:/icons/images/download.png</normaloff>:/icons/images/download.png</iconset>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="gridLayoutWidget">
<property name="geometry">
<rect>
<x>15</x>
<y>20</y>
<width>101</width>
<height>46</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0">
<widget class="QRadioButton" name="radioHistogram">
<property name="text">
<string>Histogram</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QRadioButton" name="radioDataGraph">
<property name="text">
<string>Data Graph</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioHistogram">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Histogram</string>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
@ -615,19 +658,20 @@ An extension given by the modules serial number will be attached.
<rect>
<x>405</x>
<y>10</y>
<width>341</width>
<height>61</height>
<width>346</width>
<height>76</height>
</rect>
</property>
<property name="title">
<string>Calibration Logs</string>
</property>
</widget>
<widget class="QWidget" name="horizontalLayoutWidget_2">
<property name="geometry">
<rect>
<x>15</x>
<y>20</y>
<width>311</width>
<x>420</x>
<y>37</y>
<width>313</width>
<height>31</height>
</rect>
</property>
@ -664,7 +708,8 @@ An extension given by the modules serial number will be attached.
</layout>
</widget>
</widget>
</widget>
<resources/>
<resources>
<include location="../include/icons.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -234,6 +234,10 @@
<property name="text">
<string>Browse</string>
</property>
<property name="icon">
<iconset resource="../include/icons.qrc">
<normaloff>:/icons/images/browse.png</normaloff>:/icons/images/browse.png</iconset>
</property>
</widget>
</item>
<item row="1" column="5">
@ -309,12 +313,18 @@
<property name="text">
<string>Browse</string>
</property>
<property name="icon">
<iconset resource="../include/icons.qrc">
<normaloff>:/icons/images/browse.png</normaloff>:/icons/images/browse.png</iconset>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</widget>
<resources/>
<resources>
<include location="../include/icons.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -87,6 +87,10 @@
<property name="text">
<string>Run</string>
</property>
<property name="icon">
<iconset resource="../include/icons.qrc">
<normaloff>:/icons/images/start.png</normaloff>:/icons/images/start.png</iconset>
</property>
</widget>
</widget>
<widget class="QGroupBox" name="groupBox_2">
@ -145,6 +149,10 @@
<property name="text">
<string>Run</string>
</property>
<property name="icon">
<iconset resource="../include/icons.qrc">
<normaloff>:/icons/images/start.png</normaloff>:/icons/images/start.png</iconset>
</property>
</widget>
</widget>
<widget class="QWidget" name="horizontalLayoutWidget_3">
@ -234,11 +242,17 @@
<property name="text">
<string>Get Information</string>
</property>
<property name="icon">
<iconset resource="../include/icons.qrc">
<normaloff>:/icons/images/download.png</normaloff>:/icons/images/download.png</iconset>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<resources/>
<resources>
<include location="../include/icons.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -157,6 +157,16 @@
<property name="text">
<string>Start</string>
</property>
<property name="icon">
<iconset resource="../include/icons.qrc">
<normaloff>:/icons/images/start.png</normaloff>:/icons/images/start.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
<widget class="QFrame" name="frameTimeResolved">
<property name="geometry">
@ -930,6 +940,8 @@ p, li { white-space: pre-wrap; }
</widget>
</widget>
</widget>
<resources/>
<resources>
<include location="../include/icons.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -377,7 +377,7 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>30</width>
<width>18</width>
<height>20</height>
</size>
</property>
@ -409,7 +409,7 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>18</width>
<width>15</width>
<height>20</height>
</size>
</property>
@ -495,7 +495,17 @@
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Save</string>
<string>Save </string>
</property>
<property name="icon">
<iconset resource="../include/icons.qrc">
<normaloff>:/icons/images/save.png</normaloff>:/icons/images/save.png</iconset>
</property>
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
</widget>
</widget>
@ -1315,7 +1325,7 @@
<rect>
<x>10</x>
<y>15</y>
<width>336</width>
<width>331</width>
<height>31</height>
</rect>
</property>
@ -1323,7 +1333,7 @@
<item row="0" column="0">
<widget class="QPushButton" name="btnClone">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -1369,7 +1379,11 @@
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Create</string>
<string>Create </string>
</property>
<property name="icon">
<iconset resource="../include/icons.qrc">
<normaloff>:/icons/images/new.png</normaloff>:/icons/images/new.png</iconset>
</property>
<property name="flat">
<bool>false</bool>
@ -1379,7 +1393,7 @@
<item row="0" column="2">
<widget class="QPushButton" name="btnCloseClones">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -1425,7 +1439,11 @@
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Close All</string>
<string>Close All </string>
</property>
<property name="icon">
<iconset resource="../include/icons.qrc">
<normaloff>:/icons/images/close.png</normaloff>:/icons/images/close.png</iconset>
</property>
<property name="flat">
<bool>false</bool>
@ -1442,7 +1460,7 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<width>20</width>
<height>20</height>
</size>
</property>
@ -1458,7 +1476,7 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<width>20</width>
<height>20</height>
</size>
</property>
@ -1470,7 +1488,7 @@
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -1516,7 +1534,11 @@
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Save All</string>
<string>Save All </string>
</property>
<property name="icon">
<iconset resource="../include/icons.qrc">
<normaloff>:/icons/images/saveAll.png</normaloff>:/icons/images/saveAll.png</iconset>
</property>
<property name="flat">
<bool>false</bool>
@ -1527,6 +1549,8 @@
</widget>
</widget>
</widget>
<resources/>
<resources>
<include location="../include/icons.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -200,6 +200,8 @@
</layout>
</widget>
</widget>
<resources/>
<resources>
<include location="../include/icons.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -1,5 +1,17 @@
<RCC version="1.0">
<qresource prefix="/icons">
<file>../images/mountain.png</file>
<file>../images/refresh.png</file>
<file>../images/save.png</file>
<file>../images/saveAll.png</file>
<file>../images/close.png</file>
<file>../images/add.png</file>
<file>../images/new.png</file>
<file>../images/download.png</file>
<file>../images/browse.png</file>
<file>../images/start.png</file>
<file>../images/erase.png</file>
<file>../images/remove.png</file>
<file>../images/stop.png</file>
</qresource>
</RCC>

View File

@ -35,6 +35,7 @@ public:
/**to update the widgets*/
void Refresh();
/**number of action widgets*/
static int NUM_ACTION_WIDGETS;
@ -46,7 +47,6 @@ private:
/**id of the action widget*/
int id;
/** Sets up the widget
*/
void SetupWidgetWindow();

View File

@ -35,6 +35,7 @@ public:
/**to update the widgets*/
void Refresh();
/**number of scan widgets*/
static int NUM_SCAN_WIDGETS;

View File

@ -48,6 +48,7 @@ public:
*/
void Refresh();
public slots:
/** Disable Positions
* @param enable true if to disable
@ -83,6 +84,7 @@ private:
slsDetectorDefs::detectorType detType;
enum actionIndex{Scan0=1, Scan1, NumPositions=4, NumTotalActions=9};
QGridLayout *gridLayout;
@ -109,6 +111,8 @@ private:
double *positions;
QPalette normal;
QIcon *iconPlus;
QIcon *iconMinus;
private slots:
/** To Expand the Action Widget

View File

@ -90,6 +90,10 @@ private slots:
*/
void StartTrimming();
/**Updates plot from shared memory
*/
void UpdatePlot();
private:
/** The sls detector object */
multiSlsDetector *myDet;

View File

@ -27,9 +27,8 @@ public:
/** \short The constructor
* @param parent is the parent tab widget
* @param detector is the detector returned from the detector tab
* @param detID is the id of the detector
*/
qTabDataOutput(QWidget *parent,multiSlsDetector*& detector,int detID);
qTabDataOutput(QWidget *parent,multiSlsDetector*& detector);
/** Destructor
*/
@ -45,9 +44,6 @@ private:
/** The sls detector object */
multiSlsDetector *myDet;
/**detector id */
int detID;
/** detector type */
slsDetectorDefs::detectorType detType;

View File

@ -173,7 +173,8 @@ private:
QPalette red;
/** expert mode */
bool expertMode;
QIcon *iconStart;
QIcon *iconStop;
signals:

View File

@ -26,9 +26,8 @@ public:
/** \short The constructor
* @param parent is the parent tab widget
* @param detector is the detector returned from the detector tab
* @param detID is the id of the detector
*/
qTabSettings(QWidget *parent,multiSlsDetector*& detector,int detID);
qTabSettings(QWidget *parent,multiSlsDetector*& detector);
/** Destructor
*/
@ -43,9 +42,6 @@ private:
/** The sls detector object */
multiSlsDetector *myDet;
/**detector id */
int detID;
/** detector type */
slsDetectorDefs::detectorType detType;

View File

@ -45,6 +45,7 @@ void qActionsWidget::SetupWidgetWindow(){
NUM_ACTION_WIDGETS++;
setFixedHeight(25);
}

View File

@ -99,10 +99,10 @@ void qDetectorMain::SetUpWidgetWindow(){
// creating all the tab widgets
tab_messages = new qTabMessages (this, myDet); cout<<"Messages ready"<<endl;
tab_measurement = new qTabMeasurement (this, myDet,myPlot); cout<<"Measurement ready"<<endl;
tab_dataoutput = new qTabDataOutput (this, myDet, detID); cout<<"DataOutput ready"<<endl;
tab_dataoutput = new qTabDataOutput (this, myDet); cout<<"DataOutput ready"<<endl;
tab_plot = new qTabPlot (this, myDet,myPlot); cout<<"Plot ready"<<endl;
tab_actions = new qTabActions (this, myDet); cout<<"Actions ready"<<endl;
tab_settings = new qTabSettings (this, myDet, detID); cout<<"Settings ready"<<endl;
tab_settings = new qTabSettings (this, myDet); cout<<"Settings ready"<<endl;
tab_advanced = new qTabAdvanced (this, myDet); cout<<"Advanced ready"<<endl;
tab_debugging = new qTabDebugging (this, myDet); cout<<"Debugging ready"<<endl;
tab_developer = new qTabDeveloper (this, myDet); cout<<"Developer ready"<<endl;

View File

@ -129,7 +129,8 @@ void qScanWidget::SetupWidgetWindow(){
QHBoxLayout *layoutCustom = new QHBoxLayout(widgetCustom);
layoutCustom->setContentsMargins(0, 0, 0, 0);
comboCustom = new QComboBox(widgetCustom);
btnCustom = new QPushButton("Delete",widgetCustom);
btnCustom = new QPushButton("Delete ",widgetCustom);
btnCustom->setIcon(QIcon( ":/icons/images/close.png" ));
comboCustom->setEditable(true);
comboCustom->setCompleter(false);
comboCustom->setValidator(new QDoubleValidator(comboCustom));

View File

@ -56,8 +56,13 @@ void qTabActions::SetupWidgetWindow(){
// Buttongroup to know which +/- button was clicked
group = new QButtonGroup(this);
group->setExclusive(false);
palette = new QPalette();
QPalette p;
p.setColor(QPalette::Shadow,QColor(0,0,0,0));
p.setColor(QPalette::Button,QColor(0,0,0,0));
char names[NumTotalActions][200] = {
"Action at Start",
"Scan Level 0",
@ -70,15 +75,30 @@ void qTabActions::SetupWidgetWindow(){
"Action at Stop"
};
//creating the icons for the buttons
iconPlus = new QIcon(":/icons/images/add.png");
iconMinus = new QIcon(":/icons/images/remove.png");
QString tip = "<nobr>Click on the \"+\" to Expand or \"-\" to Collapse.</nobr>";
// For each level of Actions
for(int i=0;i<NumTotalActions;i++){
//common widgets
lblName[i] = new QLabel(QString(names[i]));
btnExpand[i] = new QPushButton("+");
btnExpand[i]->setFixedSize(20,20);
QString tip = "<nobr>Click on the \"+\" to Expand or \"-\" to Collapse.</nobr>";
btnExpand[i] = new QPushButton();
lblName[i]->setToolTip(tip);
btnExpand[i]->setCheckable(true);
btnExpand[i]->setChecked(false);
btnExpand[i]->setFixedSize(16,16);
btnExpand[i]->setToolTip(tip);
btnExpand[i]->setIcon(*iconPlus);
btnExpand[i]->setFocusPolicy(Qt::NoFocus);
btnExpand[i]->setFlat(true);
btnExpand[i]->setIconSize(QSize(16,16));
btnExpand[i]->setPalette(p);
group->addButton(btnExpand[i],i);
//add the widgets to the layout , depending on the type create the widgets
@ -157,7 +177,9 @@ void qTabActions::CreatePositionsWidget(){
comboPos->setValidator(validate);
layout->addWidget(comboPos,0,5);
layout->addItem(new QSpacerItem(5,20,QSizePolicy::Fixed,QSizePolicy::Fixed),0,6);
btnDelete = new QPushButton("Delete");
btnDelete = new QPushButton("Delete ");
btnDelete->setEnabled(false);
btnDelete->setIcon(QIcon( ":/icons/images/close.png" ));
btnDelete->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
layout->addWidget(btnDelete,0,7);
@ -202,11 +224,12 @@ void qTabActions::Initialization(){
void qTabActions::Expand(QAbstractButton *button ){
int index = group->id(button);
// Collapse
if(!QString::compare(button->text(), "-")){
if(!button->isChecked()){
palette->setColor(QPalette::WindowText,Qt::black);
lblName[index]->setPalette(*palette);
button->setText("+");
button->setIcon(*iconPlus);
if(index==NumPositions) {
positionWidget->hide();
@ -234,9 +257,11 @@ void qTabActions::Expand(QAbstractButton *button ){
}
}else{
// Expand
//always set title color to blue for expan\d
palette->setColor(QPalette::WindowText,QColor(0,0,200,255));
lblName[index]->setPalette(*palette);
button->setText("-");
button->setIcon(*iconMinus);
if(index==NumPositions){
positionWidget->show();
setFixedHeight(height()+30);//+80 if the checkboxes are included
@ -265,6 +290,7 @@ void qTabActions::SetPosition(){
comboPos->setMaxCount(numPos);
comboPos->setEnabled(numPos);
lblPosList->setEnabled(numPos);
btnDelete->setEnabled(numPos);
//deleting too many or not entering enough
if(numPos>comboPos->count()){
@ -378,6 +404,7 @@ void qTabActions::Refresh(){
disconnect(comboPos,SIGNAL(currentIndexChanged(int)), this, SLOT(SetPosition()));
comboPos->setEnabled(numPos);
lblPosList->setEnabled(numPos);
btnDelete->setEnabled(numPos);
lblPosList->setText("List of Positions: ");
lblPosList->setPalette(normal);
for(int i=0;i<comboPos->count();i++)

View File

@ -87,6 +87,9 @@ void qTabAdvanced::Initialization(){
//start Trimming
connect(btnStart, SIGNAL(clicked()), this, SLOT(StartTrimming()));
//refresh
connect(btnRefresh, SIGNAL(clicked()), this, SLOT(UpdatePlot()));
}
@ -319,9 +322,6 @@ void qTabAdvanced::StartTrimming(){
break;
}
#ifdef VERBOSE
#endif
//execute
int ret = myDet->executeTrimming(trimmingMode,parameter1,parameter2,-1);
if((ret!=slsDetectorDefs::FAIL)&&(ret!=-1)){
@ -330,6 +330,8 @@ void qTabAdvanced::StartTrimming(){
if((ret!=slsDetectorDefs::FAIL)&&(ret!=-1))
qDefs::Message(qDefs::INFORMATION,"The Trimbits have been saved successfully.","Advanced");
else qDefs::Message(qDefs::WARNING,string("Could not Save the Trimbits to file:\n")+dispFile->text().toAscii().constData(),"Advanced");
//updates plots
UpdatePlot();
}
else
qDefs::Message(qDefs::WARNING,"Atleast 1 channel could not be trimmed.","Advanced");
@ -339,6 +341,16 @@ void qTabAdvanced::StartTrimming(){
//-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabAdvanced::UpdatePlot(){
#ifdef VERBOSE
cout << "Updating Plot" << endl;
#endif
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabAdvanced::Refresh(){
//disconnect
disconnect(chkEnergyLog, SIGNAL(toggled(bool)), this, SLOT(SetLogs()));

View File

@ -25,8 +25,9 @@ using namespace std;
//-------------------------------------------------------------------------------------------------------------------------------------------------
qTabDataOutput::qTabDataOutput(QWidget *parent,multiSlsDetector*& detector,int detID):
QWidget(parent),myDet(detector),detID(detID){
qTabDataOutput::qTabDataOutput(QWidget *parent,multiSlsDetector*& detector):
QWidget(parent),myDet(detector){
setupUi(this);
SetupWidgetWindow();
Initialization();
@ -241,7 +242,7 @@ void qTabDataOutput::SetRateCorrection(){
#ifdef VERBOSE
cout << "Entering Set Rate Correction function" << endl;
#endif
slsDetector *s = myDet->getSlsDetector(detID);
if(chkRate->isChecked()){
radioAuto->setEnabled(true);
radioDeadTime->setEnabled(true);
@ -251,14 +252,14 @@ void qTabDataOutput::SetRateCorrection(){
//auto
if(radioAuto->isChecked()){
spinDeadTime->setEnabled(false);
s->setRateCorrection(-1);
myDet->setRateCorrection(-1);
#ifdef VERBOSE
cout << "Setting rate corrections with default dead time" << endl;
#endif
}//custom dead time
else{
spinDeadTime->setEnabled(true);
s->setRateCorrection((double)spinDeadTime->value());
myDet->setRateCorrection((double)spinDeadTime->value());
#ifdef VERBOSE
cout << "Setting rate corrections with dead time "<< spinDeadTime->value() << endl;
#endif
@ -270,7 +271,7 @@ void qTabDataOutput::SetRateCorrection(){
spinDeadTime->setEnabled(false);
//Unsetting rate correction
s->setRateCorrection(0);
myDet->setRateCorrection(0);
#ifdef VERBOSE
cout << "Unsetting rate correction" << endl;
#endif
@ -291,8 +292,7 @@ void qTabDataOutput::UpdateRateCorrectionFromServer(){
disconnect(spinDeadTime, SIGNAL(valueChanged(double)), this, SLOT(SetRateCorrection()));
double rate;
slsDetector *s = myDet->getSlsDetector(detID);
rate = (double)s->getRateCorrectionTau();
rate = (double)myDet->getRateCorrectionTau();
#ifdef VERBOSE
cout << "Getting rate correction from server:" << rate << " : ";
#endif

View File

@ -81,6 +81,11 @@ void qTabMeasurement::SetupWidgetWindow(){
//file write enabled/disabled
chkFile->setChecked(myDet->enableWriteToFile());
//creating the icons for the buttons
iconStart = new QIcon(":/icons/images/start.png");
iconStop = new QIcon(":/icons/images/stop.png");
}
@ -278,12 +283,13 @@ void qTabMeasurement::setRunIndex(int index){
void qTabMeasurement::startStopAcquisition(){
if(!btnStartStop->text().compare("Start")){
if(btnStartStop->isChecked()){
#ifdef VERBOSE
cout << endl << endl << "Starting Acquisition" << endl;
#endif
//btnStartStop->setStyleSheet("color:red");
btnStartStop->setText("Stop");
btnStartStop->setIcon(*iconStop);
Enable(0);
progressBar->setValue(0);
//the progress which keeps adding up for all the measurements
@ -301,6 +307,8 @@ void qTabMeasurement::startStopAcquisition(){
//btnStartStop->setStyleSheet("background:rgb(239,239,239)");
progressTimer->stop();
btnStartStop->setText("Start");
btnStartStop->setIcon(*iconStart);
btnStartStop->setChecked(false);
Enable(1);
emit StopSignal();
}
@ -313,6 +321,8 @@ void qTabMeasurement::startStopAcquisition(){
void qTabMeasurement::UpdateFinished(){
disconnect(btnStartStop,SIGNAL(clicked()),this,SLOT(startStopAcquisition()));
btnStartStop->setText("Start");
btnStartStop->setIcon(*iconStart);
btnStartStop->setChecked(false);
//btnStartStop->setStyleSheet("color:green");
//btnStartStop->setStyleSheet("background:rgb(239,239,239)");
Enable(1);

View File

@ -16,7 +16,6 @@
#include <QFile>
#include <QTextStream>
#include <QFileDialog>
#include <QSizePolicy>
/** C++ Include Headers */
#include <iostream>
#include <string>
@ -47,15 +46,16 @@ void qTabMessages::SetupWidgetWindow(){
dispLog->setFocusPolicy(Qt::NoFocus);
dispLog->setTextColor(Qt::darkBlue);
QSizePolicy sizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
btnSave = new QPushButton("Save Log",this);
btnSave = new QPushButton("Save Log ",this);
btnSave->setFocusPolicy(Qt::NoFocus);
btnSave->setSizePolicy(sizePolicy);
btnSave->setFixedWidth(100);
btnSave->setIcon(QIcon( ":/icons/images/save.png" ));
btnClear = new QPushButton("Clear",this);
btnClear = new QPushButton("Clear ",this);
btnClear->setFocusPolicy(Qt::NoFocus);
btnClear->setSizePolicy(sizePolicy);
btnClear->setFixedWidth(100);
btnClear->setIcon(QIcon( ":/icons/images/erase.png" ));
gridLayout->addWidget(btnSave,0,0,1,1);
gridLayout->addWidget(btnClear,0,4,1,1);

View File

@ -17,8 +17,8 @@ using namespace std;
//-------------------------------------------------------------------------------------------------------------------------------------------------
qTabSettings::qTabSettings(QWidget *parent,multiSlsDetector*& detector,int detID):
QWidget(parent),myDet(detector),detID(detID){
qTabSettings::qTabSettings(QWidget *parent,multiSlsDetector*& detector):
QWidget(parent),myDet(detector){
setupUi(this);
SetupWidgetWindow();
@ -40,7 +40,7 @@ void qTabSettings::SetupWidgetWindow(){
// Settings
SetupDetectorSettings();
comboSettings->setCurrentIndex(myDet->getSettings(detID));
comboSettings->setCurrentIndex(myDet->getSettings());
//threshold
spinThreshold->setValue(myDet->getThresholdEnergy());
@ -68,7 +68,7 @@ void qTabSettings::SetupWidgetWindow(){
void qTabSettings::SetupDetectorSettings(){
// Get detector settings from detector
slsDetectorDefs::detectorSettings sett = myDet->getSettings(detID);
slsDetectorDefs::detectorSettings sett = myDet->getSettings();
// To be able to index items on a combo box
model = qobject_cast<QStandardItemModel*>(comboSettings->model());
@ -163,7 +163,7 @@ void qTabSettings::setSettings(int index){
if(index!=(int)Uninitialized)
item[(int)Uninitialized]->setEnabled(false);
}
slsDetectorDefs::detectorSettings sett = myDet->setSettings((slsDetectorDefs::detectorSettings)index,detID);
slsDetectorDefs::detectorSettings sett = myDet->setSettings((slsDetectorDefs::detectorSettings)index);
#ifdef VERBOSE
cout << "Settings have been set to " << myDet->slsDetectorBase::getDetectorSettings(sett) << endl;
#endif
@ -256,7 +256,7 @@ void qTabSettings::SetEnergy(){
void qTabSettings::Refresh(){
// Settings
SetupDetectorSettings();
comboSettings->setCurrentIndex(myDet->getSettings(detID));
comboSettings->setCurrentIndex(myDet->getSettings());
// Number of Modules
spinNumModules->setValue(myDet->setNumberOfModules());