mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-23 23:10:02 +02:00
included number of triggers for number of measurements, script and parameters work for non scan types
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@20 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
parent
3b59d03526
commit
111608bdc8
@ -7,6 +7,11 @@
|
|||||||
|
|
||||||
#ifndef QACTIONSWIDGET_H_
|
#ifndef QACTIONSWIDGET_H_
|
||||||
#define QACTIONSWIDGET_H_
|
#define QACTIONSWIDGET_H_
|
||||||
|
|
||||||
|
|
||||||
|
/** Project Class Headers */
|
||||||
|
class multiSlsDetector;
|
||||||
|
/** Qt Include Headers */
|
||||||
#include <QFrame>
|
#include <QFrame>
|
||||||
class QGridLayout;
|
class QGridLayout;
|
||||||
class QComboBox;
|
class QComboBox;
|
||||||
@ -16,6 +21,11 @@ class QLabel;
|
|||||||
class QSpinBox;
|
class QSpinBox;
|
||||||
class QGroupBox;
|
class QGroupBox;
|
||||||
class QRadioButton;
|
class QRadioButton;
|
||||||
|
class QCheckBox;
|
||||||
|
/** C++ Include Headers */
|
||||||
|
#include <string>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ActionsWidget : public QFrame{
|
class ActionsWidget : public QFrame{
|
||||||
@ -24,18 +34,38 @@ class ActionsWidget : public QFrame{
|
|||||||
public:
|
public:
|
||||||
/** \short The constructor
|
/** \short The constructor
|
||||||
* @param parent is the parent tab widget
|
* @param parent is the parent tab widget
|
||||||
|
* @param detector is the detector returned from the detector tab
|
||||||
* @param scanType is if its an energy/threshold scan type
|
* @param scanType is if its an energy/threshold scan type
|
||||||
* @param id is the id of the widget. to know which one was emitting it
|
* @param id is the id of the widget. to know which one was emitting it
|
||||||
*/
|
*/
|
||||||
ActionsWidget(QWidget *parent, int scanType, int id);
|
ActionsWidget(QWidget *parent, multiSlsDetector*& detector, int scanType, int id);
|
||||||
|
|
||||||
~ActionsWidget();
|
~ActionsWidget();
|
||||||
|
|
||||||
|
/**set variable expand
|
||||||
|
*/
|
||||||
|
void SetExpand(bool expanded){expand = expanded;};
|
||||||
|
|
||||||
|
/**get variable expand
|
||||||
|
*/
|
||||||
|
bool isExpanded(){return expand;};
|
||||||
|
|
||||||
|
/**to update the widgets*/
|
||||||
|
void Refresh();
|
||||||
|
|
||||||
|
|
||||||
|
enum actions{Start,Scan0,Scan1,ActionBefore,NumPositions,
|
||||||
|
HeaderBefore,HeaderAfter,ActionAfter,Stop};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/** The sls detector object */
|
||||||
|
multiSlsDetector *myDet;
|
||||||
/**if its a scan type*/
|
/**if its a scan type*/
|
||||||
int scanType;
|
int scanType;
|
||||||
/**id of the action widget*/
|
/**id of the action widget*/
|
||||||
int id;
|
int id;
|
||||||
|
/**if this widget has been expanded*/
|
||||||
|
bool expand;
|
||||||
|
|
||||||
QGridLayout *layout;
|
QGridLayout *layout;
|
||||||
QComboBox *comboScript;
|
QComboBox *comboScript;
|
||||||
@ -60,6 +90,12 @@ private:
|
|||||||
QComboBox *comboSpecific;
|
QComboBox *comboSpecific;
|
||||||
QLineEdit *dispValues;
|
QLineEdit *dispValues;
|
||||||
QPushButton *btnValues;
|
QPushButton *btnValues;
|
||||||
|
QSpinBox *spinNumPos;
|
||||||
|
QComboBox *comboPos;
|
||||||
|
QPushButton *btnDelete;
|
||||||
|
QCheckBox *chkInvert;
|
||||||
|
QCheckBox *chkSeparate;
|
||||||
|
QCheckBox *chkReturn;
|
||||||
|
|
||||||
/** Sets up the widget
|
/** Sets up the widget
|
||||||
*/
|
*/
|
||||||
@ -68,6 +104,12 @@ private:
|
|||||||
/** Sets up all the slots and signals */
|
/** Sets up all the slots and signals */
|
||||||
void Initialization();
|
void Initialization();
|
||||||
|
|
||||||
|
/**Gets the sls class action index using the gui index
|
||||||
|
* @param index gui index
|
||||||
|
*/
|
||||||
|
int GetActionIndex(int gIndex);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
/** Sets the scan or script. Accordingly enables, disables other widgets
|
/** Sets the scan or script. Accordingly enables, disables other widgets
|
||||||
@ -82,10 +124,26 @@ void EnableSizeWidgets();
|
|||||||
* */
|
* */
|
||||||
void BrowsePath();
|
void BrowsePath();
|
||||||
|
|
||||||
|
/** Sets the script file
|
||||||
|
* */
|
||||||
|
void SetScriptFile();
|
||||||
|
|
||||||
|
/** Set Parameter
|
||||||
|
* @param parameter is the parameter to be set to
|
||||||
|
* */
|
||||||
|
void SetParameter(const QString& parameter);
|
||||||
|
|
||||||
|
/** Sets the number of positions
|
||||||
|
* */
|
||||||
|
void SetNumPositions(int index);
|
||||||
|
|
||||||
|
/** Deletes current position
|
||||||
|
* */
|
||||||
|
void DeletePosition();
|
||||||
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void EnableScanBox(bool,int);
|
void EnableScanBox(bool,int);
|
||||||
void SetScriptSignal(QString&,int);
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -91,7 +91,13 @@ public:
|
|||||||
void StartStopDaqToggle(bool stop_if_running=0);
|
void StartStopDaqToggle(bool stop_if_running=0);
|
||||||
/** Set number of measurements
|
/** Set number of measurements
|
||||||
* @param num number of measurements to be set */
|
* @param num number of measurements to be set */
|
||||||
void setNumMeasurements(int num);
|
void setNumMeasurements(int num){number_of_measurements = num;};
|
||||||
|
/** Set frame enabled
|
||||||
|
* @param enable enable*/
|
||||||
|
void setFrameEnabled(bool enable){isFrameEnabled = enable;};
|
||||||
|
/** Set trigger enabled
|
||||||
|
* @param enable enable */
|
||||||
|
void setTriggerEnabled(bool enable){isTriggerEnabled = enable;};
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -212,6 +218,10 @@ private:
|
|||||||
/** every nth frame when to plot */
|
/** every nth frame when to plot */
|
||||||
int frameFactor;
|
int frameFactor;
|
||||||
bool plotLock;
|
bool plotLock;
|
||||||
|
/**if frame is enabled in measurement tab */
|
||||||
|
bool isFrameEnabled;
|
||||||
|
/**if trigger is enabled in measurement tab */
|
||||||
|
bool isTriggerEnabled;
|
||||||
|
|
||||||
|
|
||||||
/** Initializes all its members and the thread */
|
/** Initializes all its members and the thread */
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
/** Project Class Headers */
|
/** Project Class Headers */
|
||||||
class multiSlsDetector;
|
class multiSlsDetector;
|
||||||
class ActionsWidget;
|
class ActionsWidget;
|
||||||
|
/** Qt Include Headers */
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
@ -57,9 +57,6 @@ private:
|
|||||||
QPushButton *btnExpand[NUM_ACTION_WIDGETS];
|
QPushButton *btnExpand[NUM_ACTION_WIDGETS];
|
||||||
QLabel *lblName[NUM_ACTION_WIDGETS];
|
QLabel *lblName[NUM_ACTION_WIDGETS];
|
||||||
|
|
||||||
enum{Start,Scan0,Scan1,ActionBefore,NumPositions,
|
|
||||||
HeaderBefore,HeaderAfter,ActionAfter,Stop};
|
|
||||||
|
|
||||||
/** Sets up the widget */
|
/** Sets up the widget */
|
||||||
void SetupWidgetWindow();
|
void SetupWidgetWindow();
|
||||||
|
|
||||||
@ -67,14 +64,11 @@ private:
|
|||||||
void Initialization();
|
void Initialization();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
/** To Expand the Action Widget */
|
/** To Expand the Action Widget */
|
||||||
void Expand(QAbstractButton *button);
|
void Expand(QAbstractButton *button);
|
||||||
|
|
||||||
/** To set the script of action widget
|
|
||||||
* @param fName name of script
|
|
||||||
* @param index id of action widget*/
|
|
||||||
void SetScript(const QString& fName,int index);
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void EnableScanBox(bool,int);
|
void EnableScanBox(bool,int);
|
||||||
|
@ -53,9 +53,6 @@ private:
|
|||||||
*/
|
*/
|
||||||
void Initialization();
|
void Initialization();
|
||||||
|
|
||||||
/** Enables/Disables all the widgets
|
|
||||||
*/
|
|
||||||
void Enable(bool enable);
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -4,9 +4,12 @@
|
|||||||
* Created on: May 10, 2012
|
* Created on: May 10, 2012
|
||||||
* Author: l_maliakal_d
|
* Author: l_maliakal_d
|
||||||
*/
|
*/
|
||||||
|
// Project Class Headers
|
||||||
|
#include "slsDetector.h"
|
||||||
|
#include "multiSlsDetector.h"
|
||||||
// Qt Project Class Headers
|
// Qt Project Class Headers
|
||||||
#include "qActionsWidget.h"
|
#include "qActionsWidget.h"
|
||||||
|
#include "qDefs.h"
|
||||||
// Qt Include Headers
|
// Qt Include Headers
|
||||||
#include <QGridLayout>
|
#include <QGridLayout>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
@ -20,6 +23,7 @@
|
|||||||
#include <QGroupBox>
|
#include <QGroupBox>
|
||||||
#include <QRadioButton>
|
#include <QRadioButton>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
#include <QCheckBox>
|
||||||
// C++ Include Headers
|
// C++ Include Headers
|
||||||
#include<iostream>
|
#include<iostream>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
@ -28,8 +32,8 @@ using namespace std;
|
|||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
ActionsWidget::ActionsWidget(QWidget *parent, int scanType, int id):
|
ActionsWidget::ActionsWidget(QWidget *parent,multiSlsDetector*& detector, int scanType, int id):
|
||||||
QFrame(parent),scanType(scanType),id(id){
|
QFrame(parent),myDet(detector),scanType(scanType),id(id),expand(false){
|
||||||
SetupWidgetWindow();
|
SetupWidgetWindow();
|
||||||
Initialization();
|
Initialization();
|
||||||
}
|
}
|
||||||
@ -39,6 +43,7 @@ ActionsWidget::ActionsWidget(QWidget *parent, int scanType, int id):
|
|||||||
|
|
||||||
|
|
||||||
ActionsWidget::~ActionsWidget(){
|
ActionsWidget::~ActionsWidget(){
|
||||||
|
delete myDet;
|
||||||
delete layout;
|
delete layout;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,17 +55,49 @@ void ActionsWidget::SetupWidgetWindow(){
|
|||||||
// Widget Settings
|
// Widget Settings
|
||||||
//setFrameStyle(QFrame::Box);
|
//setFrameStyle(QFrame::Box);
|
||||||
//setFrameShadow(QFrame::Raised);
|
//setFrameShadow(QFrame::Raised);
|
||||||
|
// Main Layout Settings
|
||||||
setFixedHeight(25);
|
setFixedHeight(25);
|
||||||
if(scanType) setFixedHeight(125);
|
if(scanType) setFixedHeight(125);
|
||||||
|
|
||||||
|
|
||||||
// Main Layout Settings
|
|
||||||
layout = new QGridLayout(this);
|
layout = new QGridLayout(this);
|
||||||
setLayout(layout);
|
setLayout(layout);
|
||||||
layout->setContentsMargins(0,0,0,0);
|
layout->setContentsMargins(0,0,0,0);
|
||||||
if(scanType) layout->setVerticalSpacing(5);
|
if(scanType) layout->setVerticalSpacing(5);
|
||||||
|
|
||||||
|
if(id==NumPositions){
|
||||||
|
setFixedHeight(75);
|
||||||
|
QLabel *lblNumPos = new QLabel("Number of Positions:");
|
||||||
|
lblNumPos->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
|
||||||
|
layout->addWidget(lblNumPos,0,0);
|
||||||
|
spinNumPos = new QSpinBox(this);
|
||||||
|
layout->addWidget(spinNumPos,0,1);
|
||||||
|
layout->addItem(new QSpacerItem(80,20,QSizePolicy::Fixed,QSizePolicy::Fixed),0,2);
|
||||||
|
QLabel *lblPosList = new QLabel("List of Positions:");
|
||||||
|
lblPosList->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
|
||||||
|
layout->addWidget(lblPosList,0,3);
|
||||||
|
comboPos = new QComboBox(this);
|
||||||
|
comboPos->setEditable(true);
|
||||||
|
comboPos->setCompleter(0);
|
||||||
|
layout->addWidget(comboPos,0,4);
|
||||||
|
btnDelete = new QPushButton("Delete");
|
||||||
|
btnDelete->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
|
||||||
|
layout->addWidget(btnDelete,0,5);
|
||||||
|
|
||||||
|
QGroupBox *w = new QGroupBox;
|
||||||
|
layout->addWidget(w,1,0,1,6);
|
||||||
|
QHBoxLayout *l1 = new QHBoxLayout(w);
|
||||||
|
l1->setContentsMargins(0,0,0,0);
|
||||||
|
l1->addItem(new QSpacerItem(20,20,QSizePolicy::Fixed,QSizePolicy::Fixed));
|
||||||
|
chkInvert = new QCheckBox("Invert Angles");
|
||||||
|
l1->addWidget(chkInvert);
|
||||||
|
chkSeparate = new QCheckBox("Separate Two Halves");
|
||||||
|
l1->addWidget(chkSeparate);
|
||||||
|
chkReturn = new QCheckBox("Return to Start Position");
|
||||||
|
chkReturn->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
|
||||||
|
l1->addWidget(chkReturn);
|
||||||
|
l1->addItem(new QSpacerItem(20,20,QSizePolicy::Fixed,QSizePolicy::Fixed));
|
||||||
|
|
||||||
|
|
||||||
|
}else{
|
||||||
// Main Widgets
|
// Main Widgets
|
||||||
comboScript = new QComboBox(this);
|
comboScript = new QComboBox(this);
|
||||||
if(!scanType){
|
if(!scanType){
|
||||||
@ -75,7 +112,7 @@ void ActionsWidget::SetupWidgetWindow(){
|
|||||||
}
|
}
|
||||||
layout->addWidget(comboScript,0,0);
|
layout->addWidget(comboScript,0,0);
|
||||||
layout->addItem(new QSpacerItem(20,20,QSizePolicy::Fixed,QSizePolicy::Fixed),0,1);
|
layout->addItem(new QSpacerItem(20,20,QSizePolicy::Fixed,QSizePolicy::Fixed),0,1);
|
||||||
dispScript = new QLineEdit("None");
|
dispScript = new QLineEdit("");
|
||||||
dispScript->setEnabled(false);
|
dispScript->setEnabled(false);
|
||||||
layout->addWidget(dispScript,0,2);
|
layout->addWidget(dispScript,0,2);
|
||||||
btnBrowse = new QPushButton("Browse");
|
btnBrowse = new QPushButton("Browse");
|
||||||
@ -85,7 +122,7 @@ void ActionsWidget::SetupWidgetWindow(){
|
|||||||
lblParameter = new QLabel("Additional Parameter:");
|
lblParameter = new QLabel("Additional Parameter:");
|
||||||
lblParameter->setEnabled(false);
|
lblParameter->setEnabled(false);
|
||||||
layout->addWidget(lblParameter,0,5);
|
layout->addWidget(lblParameter,0,5);
|
||||||
dispParameter = new QLineEdit("None");
|
dispParameter = new QLineEdit("");
|
||||||
dispParameter->setEnabled(false);
|
dispParameter->setEnabled(false);
|
||||||
dispParameter->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
|
dispParameter->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
|
||||||
layout->addWidget(dispParameter,0,6);
|
layout->addWidget(dispParameter,0,6);
|
||||||
@ -110,7 +147,7 @@ void ActionsWidget::SetupWidgetWindow(){
|
|||||||
group->setEnabled(false);
|
group->setEnabled(false);
|
||||||
// Fix the size of the groupbox
|
// Fix the size of the groupbox
|
||||||
group->setFixedSize(513,66);
|
group->setFixedSize(513,66);
|
||||||
layout->addWidget(group,2,2,1,5);
|
layout->addWidget(group,2,2,1,6);
|
||||||
|
|
||||||
|
|
||||||
// Group Box for step size
|
// Group Box for step size
|
||||||
@ -181,6 +218,7 @@ void ActionsWidget::SetupWidgetWindow(){
|
|||||||
h2Values->addItem(new QSpacerItem(50,20,QSizePolicy::Fixed,QSizePolicy::Fixed));
|
h2Values->addItem(new QSpacerItem(50,20,QSizePolicy::Fixed,QSizePolicy::Fixed));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -189,55 +227,20 @@ void ActionsWidget::SetupWidgetWindow(){
|
|||||||
|
|
||||||
|
|
||||||
void ActionsWidget::Initialization(){
|
void ActionsWidget::Initialization(){
|
||||||
connect(comboScript,SIGNAL(currentIndexChanged(int)),this,SLOT(SetScript(int)));
|
if(id==NumPositions){
|
||||||
if(scanType){
|
connect(spinNumPos, SIGNAL(valueChanged(int)), this, SLOT(SetNumPositions(int)));
|
||||||
connect(radioConstant,SIGNAL(toggled(bool)),this,SLOT(EnableSizeWidgets()));
|
connect(btnDelete, SIGNAL(clicked()), this, SLOT(DeletePosition()));
|
||||||
connect(radioSpecific,SIGNAL(toggled(bool)),this,SLOT(EnableSizeWidgets()));
|
}else{
|
||||||
connect(radioValue,SIGNAL(toggled(bool)),this,SLOT(EnableSizeWidgets()));
|
connect(comboScript, SIGNAL(currentIndexChanged(int)), this,SLOT(SetScript(int)));
|
||||||
}
|
connect(dispScript, SIGNAL(editingFinished()), this, SLOT(SetScriptFile()));
|
||||||
connect(btnBrowse, SIGNAL(clicked()), this, SLOT(BrowsePath()));
|
connect(btnBrowse, SIGNAL(clicked()), this, SLOT(BrowsePath()));
|
||||||
|
connect(dispParameter, SIGNAL(textChanged(const QString&)), this, SLOT(SetParameter(const QString&)));
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
void ActionsWidget::SetScript(int index){
|
|
||||||
// defaults
|
|
||||||
dispScript->setEnabled(false);
|
|
||||||
btnBrowse->setEnabled(false);
|
|
||||||
lblParameter->setEnabled(false);
|
|
||||||
dispParameter->setEnabled(false);
|
|
||||||
if(scanType){
|
if(scanType){
|
||||||
group->setEnabled(false);
|
connect(radioConstant, SIGNAL(toggled(bool)),this,SLOT(EnableSizeWidgets()));
|
||||||
lblSteps->setEnabled(false);
|
connect(radioSpecific, SIGNAL(toggled(bool)),this,SLOT(EnableSizeWidgets()));
|
||||||
spinSteps->setEnabled(false);
|
connect(radioValue, SIGNAL(toggled(bool)),this,SLOT(EnableSizeWidgets()));
|
||||||
lblPrecision->setEnabled(false);
|
|
||||||
spinPrecision->setEnabled(false);
|
|
||||||
}
|
|
||||||
// If anything other than None is selected
|
|
||||||
if(index){
|
|
||||||
// Custom Script only enables the first layout with addnl parameters etc
|
|
||||||
if(!comboScript->currentText().compare("Custom Script")){
|
|
||||||
dispScript->setEnabled(true);
|
|
||||||
btnBrowse->setEnabled(true);
|
|
||||||
lblParameter->setEnabled(true);
|
|
||||||
dispParameter->setEnabled(true);
|
|
||||||
}
|
|
||||||
// If this group includes Energy scan , threhold scan etc
|
|
||||||
if(scanType){
|
|
||||||
group->setEnabled(true);
|
|
||||||
lblPrecision->setEnabled(true);
|
|
||||||
spinPrecision->setEnabled(true);
|
|
||||||
// Steps are enabled only if constant step size is not checked
|
|
||||||
lblSteps->setEnabled(!radioConstant->isChecked());
|
|
||||||
spinSteps->setEnabled(!radioConstant->isChecked());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//emit signal to enable scanbox and the radiobuttons
|
|
||||||
if(scanType) emit EnableScanBox(index,((id==2)?1:0));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -278,17 +281,249 @@ void ActionsWidget::EnableSizeWidgets(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
void ActionsWidget::SetScript(int index){
|
||||||
|
// defaults
|
||||||
|
dispScript->setEnabled(false);
|
||||||
|
btnBrowse->setEnabled(false);
|
||||||
|
lblParameter->setEnabled(false);
|
||||||
|
dispParameter->setEnabled(false);
|
||||||
|
if(scanType){
|
||||||
|
group->setEnabled(false);
|
||||||
|
lblSteps->setEnabled(false);
|
||||||
|
spinSteps->setEnabled(false);
|
||||||
|
lblPrecision->setEnabled(false);
|
||||||
|
spinPrecision->setEnabled(false);
|
||||||
|
}
|
||||||
|
// If anything other than None is selected
|
||||||
|
if(index){
|
||||||
|
// Custom Script only enables the first layout with addnl parameters etc
|
||||||
|
if(!comboScript->currentText().compare("Custom Script")){
|
||||||
|
dispScript->setEnabled(true);
|
||||||
|
btnBrowse->setEnabled(true);
|
||||||
|
lblParameter->setEnabled(true);
|
||||||
|
dispParameter->setEnabled(true);
|
||||||
|
}
|
||||||
|
// If this group includes Energy scan , threhold scan etc
|
||||||
|
if(scanType){
|
||||||
|
group->setEnabled(true);
|
||||||
|
lblPrecision->setEnabled(true);
|
||||||
|
spinPrecision->setEnabled(true);
|
||||||
|
// Steps are enabled only if constant step size is not checked
|
||||||
|
lblSteps->setEnabled(!radioConstant->isChecked());
|
||||||
|
spinSteps->setEnabled(!radioConstant->isChecked());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//emit signal to enable scanbox and the radiobuttons
|
||||||
|
if(scanType) emit EnableScanBox(index,((id==2)?1:0));
|
||||||
|
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << "Setting mode of action widget:" << id << " to " << index << endl;
|
||||||
|
#endif
|
||||||
|
QString fName = dispScript->text();
|
||||||
|
//script
|
||||||
|
if((id!=Scan0)&&(id!=Scan1))
|
||||||
|
//scan and positions wouldnt get here
|
||||||
|
if(index) myDet->setActionScript(GetActionIndex(id),fName.toAscii().constData());
|
||||||
|
else myDet->setActionScript(GetActionIndex(id),"");
|
||||||
|
//scan
|
||||||
|
else{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
cout<<"mode:"<<myDet->getActionMode(GetActionIndex(id))<<" "
|
||||||
|
"script:"<<myDet->getActionScript(GetActionIndex(id))<<" "
|
||||||
|
"parameter:"<<myDet->getActionParameter(GetActionIndex(id))<<endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
void ActionsWidget::BrowsePath(){
|
void ActionsWidget::BrowsePath(){
|
||||||
QString fName = dispScript->text();
|
QString fName = dispScript->text();
|
||||||
QString dir = fName.section('/',0,-2,QString::SectionIncludeLeadingSep);
|
QString dir = fName.section('/',0,-2,QString::SectionIncludeLeadingSep);
|
||||||
if(dir.isEmpty()) dir = "/home";
|
if(dir.isEmpty()) dir = "/home";
|
||||||
|
//dialog
|
||||||
fName = QFileDialog::getOpenFileName(this,
|
fName = QFileDialog::getOpenFileName(this,
|
||||||
tr("Load Script File"),dir,
|
tr("Load Script File"),dir,
|
||||||
tr("Script Files(*.awk);;All Files(*)"));//,0,QFileDialog::ShowDirsOnly);
|
tr("Script Files(*.awk);;All Files(*)"));//,0,QFileDialog::ShowDirsOnly);
|
||||||
if (!fName.isEmpty()){
|
//if empty, set the file name and it calls setscriptfile, else ignore
|
||||||
|
if (!fName.isEmpty())
|
||||||
dispScript->setText(fName);
|
dispScript->setText(fName);
|
||||||
emit SetScriptSignal(fName,id);
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void ActionsWidget::SetScriptFile(){
|
||||||
|
QString fName = dispScript->text();bool set = false;
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << "Setting script file of action widget:" << id << " to " << fName.toAscii().constData() << endl;
|
||||||
|
#endif
|
||||||
|
disconnect(dispScript, SIGNAL(editingFinished()), this, SLOT(SetScriptFile()));
|
||||||
|
|
||||||
|
//blank
|
||||||
|
if(fName.isEmpty())
|
||||||
|
set = true;
|
||||||
|
//not blank
|
||||||
|
else{
|
||||||
|
QString file = dispScript->text().section('/',-1);
|
||||||
|
//is a file
|
||||||
|
if(file.contains('.')){
|
||||||
|
//check if it exists and set the script file
|
||||||
|
if(QFile::exists(fName))
|
||||||
|
set = true;
|
||||||
|
//if the file doesnt exist, set it to what it was before
|
||||||
|
else{
|
||||||
|
qDefs::WarningMessage("The script file entered does not exist","ActionsWidget");
|
||||||
|
dispScript->setText(QString(myDet->getActionScript(GetActionIndex(id)).c_str()));
|
||||||
|
}
|
||||||
|
}//not a file, set it to what it was before
|
||||||
|
else {
|
||||||
|
qDefs::WarningMessage("The script file path entered is not a file","ActionsWidget");
|
||||||
|
dispScript->setText(QString(myDet->getActionScript(GetActionIndex(id)).c_str()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//if blank or valid file
|
||||||
|
if(set){
|
||||||
|
//script
|
||||||
|
if((id!=Scan0)&&(id!=Scan1)){
|
||||||
|
//scan and positions wouldnt get here
|
||||||
|
if(!myDet->setActionScript(GetActionIndex(id),fName.toAscii().constData())){
|
||||||
|
//did not get set, write what is was before
|
||||||
|
if(!fName.isEmpty())
|
||||||
|
qDefs::WarningMessage("The script file could not be set. Reverting to previous file.","ActionsWidget");
|
||||||
|
dispScript->setText(QString(myDet->getActionScript(GetActionIndex(id)).c_str()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//scan
|
||||||
|
else{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//dont display if theres a none
|
||||||
|
if(!dispScript->text().compare("none")) dispScript->setText("");
|
||||||
|
|
||||||
|
connect(dispScript, SIGNAL(editingFinished()), this, SLOT(SetScriptFile()));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
void ActionsWidget::SetParameter(const QString& parameter){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << "Setting parameter of action widget:" << id << " to " << parameter.toAscii().constData() << endl;
|
||||||
|
#endif
|
||||||
|
//script
|
||||||
|
if((id!=ActionsWidget::Scan0)&&(id!=ActionsWidget::Scan1))
|
||||||
|
//scan and positions wouldnt get here
|
||||||
|
myDet->setActionParameter(GetActionIndex(id),parameter.toAscii().constData());
|
||||||
|
//scan
|
||||||
|
else{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void ActionsWidget::SetNumPositions(int index){
|
||||||
|
//comboPos->setEnabled(index);
|
||||||
|
//if there arent enough positions
|
||||||
|
if((index) && (comboPos->count()<index)){
|
||||||
|
qDefs::WarningMessage("Insufficient number of positions in the list. "
|
||||||
|
"\nAdd more positions to the list, then set Number of Positions.","ActionsWidget");
|
||||||
|
spinNumPos->setValue(comboPos->count());
|
||||||
|
}else{
|
||||||
|
//emit SetPositionsSignal();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
void ActionsWidget::DeletePosition(){
|
||||||
|
QString pos = comboPos->currentText();
|
||||||
|
bool found = false;
|
||||||
|
//loops through to find the index and to make sure its in the list
|
||||||
|
for(int i=0;i<comboPos->count();i++){
|
||||||
|
if(!comboPos->itemText(i).compare(pos)){
|
||||||
|
found = true;
|
||||||
|
comboPos->removeItem(i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//give the warning only when you try to delete stuff that arent there
|
||||||
|
if((!found)&&(comboPos->count())) qDefs::WarningMessage("This position cannot be deleted as it doesn't exist in the list anyway","ActionsWidget");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
void ActionsWidget::Refresh(){
|
||||||
|
//disabling signals and slots
|
||||||
|
if(id==NumPositions){
|
||||||
|
|
||||||
|
}else{
|
||||||
|
disconnect(dispScript, SIGNAL(editingFinished()), this, SLOT(SetScriptFile()));
|
||||||
|
disconnect(dispParameter, SIGNAL(textChanged(const QString&)),this, SLOT(SetParameter(const QString&)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int mode;string script,parameter;
|
||||||
|
if((id == Scan0)||(id == Scan1)){
|
||||||
|
|
||||||
|
}else if(id == NumPositions){
|
||||||
|
|
||||||
|
}else{
|
||||||
|
mode = (myDet->getActionMode(GetActionIndex(id))>0?1:0);
|
||||||
|
script = myDet->getActionScript(GetActionIndex(id));
|
||||||
|
parameter = myDet->getActionParameter(GetActionIndex(id));
|
||||||
|
//defaults
|
||||||
|
if(script == "none") script="";
|
||||||
|
if(parameter == "none") parameter="";
|
||||||
|
//settings values
|
||||||
|
dispScript->setText(QString(script.c_str()));
|
||||||
|
dispParameter->setText(QString(parameter.c_str()));
|
||||||
|
//set mode which also checks everything
|
||||||
|
comboScript->setCurrentIndex(mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//enabling signals and slots
|
||||||
|
if(id==NumPositions){
|
||||||
|
|
||||||
|
}else{
|
||||||
|
connect(dispScript, SIGNAL(editingFinished()), this, SLOT(SetScriptFile()));
|
||||||
|
connect(dispParameter, SIGNAL(textChanged(const QString&)),this, SLOT(SetParameter(const QString&)));
|
||||||
|
}
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << "Updated action widget " << id << "\tscript:" << script << "\tparameter:" << parameter << endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
int ActionsWidget::GetActionIndex(int gIndex){
|
||||||
|
switch(gIndex){
|
||||||
|
case Start: return slsDetectorDefs::startScript;
|
||||||
|
case ActionBefore: return slsDetectorDefs::scriptBefore;
|
||||||
|
case HeaderBefore: return slsDetectorDefs::headerBefore;
|
||||||
|
case HeaderAfter: return slsDetectorDefs::headerAfter;
|
||||||
|
case ActionAfter: return slsDetectorDefs::scriptAfter;
|
||||||
|
case Stop: return slsDetectorDefs::stopScript;
|
||||||
|
default: return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -27,7 +27,8 @@ using namespace std;
|
|||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
qDrawPlot::qDrawPlot(QWidget *parent,multiSlsDetector*& detector):QWidget(parent),myDet(detector){
|
qDrawPlot::qDrawPlot(QWidget *parent,multiSlsDetector*& detector):
|
||||||
|
QWidget(parent),myDet(detector){
|
||||||
SetupWidgetWindow();
|
SetupWidgetWindow();
|
||||||
Initialization();
|
Initialization();
|
||||||
StartStopDaqToggle(); //as default
|
StartStopDaqToggle(); //as default
|
||||||
@ -79,6 +80,8 @@ void qDrawPlot::SetupWidgetWindow(){
|
|||||||
timerValue = PLOT_TIMER_MS;
|
timerValue = PLOT_TIMER_MS;
|
||||||
frameFactor=0;
|
frameFactor=0;
|
||||||
plotLock = false;
|
plotLock = false;
|
||||||
|
isFrameEnabled = false;
|
||||||
|
isTriggerEnabled = false;
|
||||||
/** This is so that it initially stop and plots */
|
/** This is so that it initially stop and plots */
|
||||||
running = 1;
|
running = 1;
|
||||||
for(int i=0;i<MAX_1DPLOTS;i++) {histYAxis[i]=0;yvalues[i]=0; }
|
for(int i=0;i<MAX_1DPLOTS;i++) {histYAxis[i]=0;yvalues[i]=0; }
|
||||||
@ -165,7 +168,14 @@ void qDrawPlot::StartStopDaqToggle(bool stop_if_running){
|
|||||||
currentMeasurement = 0;
|
currentMeasurement = 0;
|
||||||
emit SetCurrentMeasurementSignal(currentMeasurement);
|
emit SetCurrentMeasurementSignal(currentMeasurement);
|
||||||
/** Number of Exposures */
|
/** Number of Exposures */
|
||||||
number_of_exposures= (int)myDet->setTimer(slsDetectorDefs::FRAME_NUMBER,-1);
|
int numFrames = (isFrameEnabled)*((int)myDet->setTimer(slsDetectorDefs::FRAME_NUMBER,-1));
|
||||||
|
int numTriggers = (isTriggerEnabled)*((int)myDet->setTimer(slsDetectorDefs::CYCLES_NUMBER,-1));
|
||||||
|
|
||||||
|
numFrames = ((numFrames==0)?1:numFrames);
|
||||||
|
numTriggers = ((numTriggers==0)?1:numTriggers);
|
||||||
|
|
||||||
|
|
||||||
|
number_of_exposures= numFrames * numTriggers;
|
||||||
cout<<"\tNumber of Exposures:"<<number_of_exposures<<endl;
|
cout<<"\tNumber of Exposures:"<<number_of_exposures<<endl;
|
||||||
/** ExposureTime */
|
/** ExposureTime */
|
||||||
exposureTime= ((double)(myDet->setTimer(slsDetectorDefs::ACQUISITION_TIME,-1))*1E-9);
|
exposureTime= ((double)(myDet->setTimer(slsDetectorDefs::ACQUISITION_TIME,-1))*1E-9);
|
||||||
@ -351,12 +361,6 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
void qDrawPlot::setNumMeasurements(int num){
|
|
||||||
number_of_measurements = num;
|
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
void qDrawPlot::SelectPlot(int i){ //1 for 1D otherwise 2D
|
void qDrawPlot::SelectPlot(int i){ //1 for 1D otherwise 2D
|
||||||
if(i==1){
|
if(i==1){
|
||||||
plot1D->SetXTitle(histXAxisTitle.toAscii().constData());
|
plot1D->SetXTitle(histXAxisTitle.toAscii().constData());
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
qTabActions::qTabActions(QWidget *parent,multiSlsDetector*& detector):
|
qTabActions::qTabActions(QWidget *parent,multiSlsDetector*& detector):
|
||||||
@ -27,6 +28,7 @@ qTabActions::qTabActions(QWidget *parent,multiSlsDetector*& detector):
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
qTabActions::~qTabActions(){
|
qTabActions::~qTabActions(){
|
||||||
@ -34,11 +36,12 @@ qTabActions::~qTabActions(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qTabActions::SetupWidgetWindow(){
|
void qTabActions::SetupWidgetWindow(){
|
||||||
// Window Settings
|
// Window Settings
|
||||||
setFixedSize(705,350);
|
setFixedSize(710,350);
|
||||||
setContentsMargins(0,0,0,0);
|
setContentsMargins(0,0,0,0);
|
||||||
|
|
||||||
// Scroll Area Settings
|
// Scroll Area Settings
|
||||||
@ -56,13 +59,14 @@ void qTabActions::SetupWidgetWindow(){
|
|||||||
group = new QButtonGroup(this);
|
group = new QButtonGroup(this);
|
||||||
palette = new QPalette();
|
palette = new QPalette();
|
||||||
|
|
||||||
|
|
||||||
// For each level of Actions
|
// For each level of Actions
|
||||||
for(int i=0;i<NUM_ACTION_WIDGETS;i++){
|
for(int i=0;i<NUM_ACTION_WIDGETS;i++){
|
||||||
// Add the extra widgets only for the 1st 2 levels
|
// Add the extra widgets only for the 1st 2 levels
|
||||||
if((i==Scan0)||(i==Scan1))
|
if((i==ActionsWidget::Scan0)||(i==ActionsWidget::Scan1))
|
||||||
actionWidget[i] = new ActionsWidget(this,1,i);
|
actionWidget[i] = new ActionsWidget(this,myDet,1,i);
|
||||||
else
|
else
|
||||||
actionWidget[i] = new ActionsWidget(this,0,i);
|
actionWidget[i] = new ActionsWidget(this,myDet,0,i);
|
||||||
|
|
||||||
btnExpand[i] = new QPushButton("+");
|
btnExpand[i] = new QPushButton("+");
|
||||||
btnExpand[i]->setFixedSize(20,20);
|
btnExpand[i]->setFixedSize(20,20);
|
||||||
@ -78,36 +82,43 @@ void qTabActions::SetupWidgetWindow(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Label Values
|
// Label Values
|
||||||
lblName[Start]->setText("Action at Start");
|
lblName[ActionsWidget::Start]->setText("Action at Start");
|
||||||
lblName[Scan0]->setText("Scan Level 0");
|
lblName[ActionsWidget::Scan0]->setText("Scan Level 0");
|
||||||
lblName[Scan1]->setText("Scan Level 1");
|
lblName[ActionsWidget::Scan1]->setText("Scan Level 1");
|
||||||
lblName[ActionBefore]->setText("Action before each Frame");
|
lblName[ActionsWidget::ActionBefore]->setText("Action before each Frame");
|
||||||
lblName[NumPositions]->setText("Number of Positions");
|
lblName[ActionsWidget::NumPositions]->setText("Positions");
|
||||||
lblName[HeaderBefore]->setText("Header before Frame");
|
lblName[ActionsWidget::HeaderBefore]->setText("Header before Frame");
|
||||||
lblName[HeaderAfter]->setText("Header after Frame");
|
lblName[ActionsWidget::HeaderAfter]->setText("Header after Frame");
|
||||||
lblName[ActionAfter]->setText("Action after each Frame");
|
lblName[ActionsWidget::ActionAfter]->setText("Action after each Frame");
|
||||||
lblName[Stop]->setText("Action at Stop");
|
lblName[ActionsWidget::Stop]->setText("Action at Stop");
|
||||||
|
|
||||||
// initially hide all the widgets
|
// initially hide all the widgets
|
||||||
for(int i=0;i<NUM_ACTION_WIDGETS;i++)
|
for(int i=0;i<NUM_ACTION_WIDGETS;i++)
|
||||||
actionWidget[i]->hide();
|
actionWidget[i]->hide();
|
||||||
|
|
||||||
|
//Number of positions is only for mythen or gotthard
|
||||||
|
slsDetectorDefs::detectorType detType = myDet->getDetectorsType();
|
||||||
|
if((detType == slsDetectorDefs::EIGER) || (detType == slsDetectorDefs::AGIPD)) {
|
||||||
|
lblName[ActionsWidget::NumPositions]->setEnabled(false);
|
||||||
|
btnExpand[ActionsWidget::NumPositions]->setEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qTabActions::Initialization(){
|
void qTabActions::Initialization(){
|
||||||
connect(group, SIGNAL(buttonClicked(QAbstractButton*)), this,SLOT(Expand(QAbstractButton*)));
|
connect(group, SIGNAL(buttonClicked(QAbstractButton*)), this,SLOT(Expand(QAbstractButton*)));
|
||||||
connect(actionWidget[Scan0],SIGNAL(EnableScanBox(bool,int)), this,SIGNAL(EnableScanBox(bool,int)));
|
connect(actionWidget[ActionsWidget::Scan0],SIGNAL(EnableScanBox(bool,int)), this,SIGNAL(EnableScanBox(bool,int)));
|
||||||
connect(actionWidget[Scan1],SIGNAL(EnableScanBox(bool,int)), this,SIGNAL(EnableScanBox(bool,int)));
|
connect(actionWidget[ActionsWidget::Scan1],SIGNAL(EnableScanBox(bool,int)), this,SIGNAL(EnableScanBox(bool,int)));
|
||||||
|
|
||||||
for(int i=0;i<NUM_ACTION_WIDGETS;i++){
|
|
||||||
connect(actionWidget[i],SIGNAL(SetScriptSignal(QString&,int)), this,SLOT(SetScript(QString&,int)));
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qTabActions::Expand(QAbstractButton *button ){
|
void qTabActions::Expand(QAbstractButton *button ){
|
||||||
int index = group->id(button);
|
int index = group->id(button);
|
||||||
@ -117,8 +128,11 @@ void qTabActions::Expand(QAbstractButton *button ){
|
|||||||
lblName[index]->setPalette(*palette);
|
lblName[index]->setPalette(*palette);
|
||||||
actionWidget[index]->hide();
|
actionWidget[index]->hide();
|
||||||
button->setText("+");
|
button->setText("+");
|
||||||
if((index==Scan0)||(index==Scan1))
|
if((index==ActionsWidget::Scan0)||(index==ActionsWidget::Scan1)){
|
||||||
setFixedHeight(height()-130);
|
setFixedHeight(height()-130);
|
||||||
|
}
|
||||||
|
else if(index==ActionsWidget::NumPositions)
|
||||||
|
setFixedHeight(height()-80);
|
||||||
else
|
else
|
||||||
setFixedHeight(height()-30);
|
setFixedHeight(height()-30);
|
||||||
}else{
|
}else{
|
||||||
@ -127,29 +141,28 @@ void qTabActions::Expand(QAbstractButton *button ){
|
|||||||
lblName[index]->setPalette(*palette);
|
lblName[index]->setPalette(*palette);
|
||||||
actionWidget[index]->show();
|
actionWidget[index]->show();
|
||||||
button->setText("-");
|
button->setText("-");
|
||||||
if((index==Scan0)||(index==Scan1))
|
if((index==ActionsWidget::Scan0)||(index==ActionsWidget::Scan1)){
|
||||||
setFixedHeight(height()+130);
|
setFixedHeight(height()+130);
|
||||||
|
}
|
||||||
|
else if(index==ActionsWidget::NumPositions)
|
||||||
|
setFixedHeight(height()+80);
|
||||||
else
|
else
|
||||||
setFixedHeight(height()+30);
|
setFixedHeight(height()+30);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
void qTabActions::SetScript(const QString& fName,int index){
|
|
||||||
#ifdef VERBOSE
|
|
||||||
cout << "Setting script file of action widget:" << index << " to " << fName.toAscii().constData() << endl;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qTabActions::Refresh(){
|
void qTabActions::Refresh(){
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << "Updating action widgets " << endl;
|
||||||
|
#endif
|
||||||
|
for(int i=0;i<NUM_ACTION_WIDGETS;i++)
|
||||||
|
actionWidget[i]->Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -15,6 +15,8 @@ using namespace std;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
qTabDebugging::qTabDebugging(QWidget *parent,multiSlsDetector*& detector):QWidget(parent),myDet(detector){
|
qTabDebugging::qTabDebugging(QWidget *parent,multiSlsDetector*& detector):QWidget(parent),myDet(detector){
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
@ -23,6 +25,7 @@ qTabDebugging::qTabDebugging(QWidget *parent,multiSlsDetector*& detector):QWidge
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
qTabDebugging::~qTabDebugging(){
|
qTabDebugging::~qTabDebugging(){
|
||||||
@ -30,6 +33,7 @@ qTabDebugging::~qTabDebugging(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qTabDebugging::SetupWidgetWindow(){
|
void qTabDebugging::SetupWidgetWindow(){
|
||||||
@ -49,6 +53,7 @@ void qTabDebugging::SetupWidgetWindow(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void qTabDebugging::Initialization(){
|
void qTabDebugging::Initialization(){
|
||||||
@ -56,12 +61,6 @@ void qTabDebugging::Initialization(){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void qTabDebugging::Enable(bool enable){
|
|
||||||
//this->setEnabled(enable);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
@ -634,10 +634,14 @@ void qTabMeasurement::setTimingMode(int mode){
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** To reconnect all the signals after changing their values*/
|
/** To reconnect all the signals after changing their values*/
|
||||||
Initialization(1);
|
Initialization(1);
|
||||||
|
|
||||||
|
|
||||||
|
// to let qdrawplot know that triggers or frames are used
|
||||||
|
myPlot->setFrameEnabled(lblNumTriggers->isEnabled());
|
||||||
|
myPlot->setTriggerEnabled(lblNumFrames->isEnabled());
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -654,6 +658,11 @@ void qTabMeasurement::Refresh(){
|
|||||||
lblProgressIndex->setText(QString::number(myDet->getFileIndex()));
|
lblProgressIndex->setText(QString::number(myDet->getFileIndex()));
|
||||||
/** Timing mode**/
|
/** Timing mode**/
|
||||||
SetupTimingMode();
|
SetupTimingMode();
|
||||||
|
|
||||||
|
// to let qdrawplot know that triggers or frames are used
|
||||||
|
myPlot->setFrameEnabled(lblNumTriggers->isEnabled());
|
||||||
|
myPlot->setTriggerEnabled(lblNumFrames->isEnabled());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -211,7 +211,7 @@ void qTabSettings::SetDynamicRange(int index){
|
|||||||
#endif
|
#endif
|
||||||
ret=myDet->setDynamicRange(dr);
|
ret=myDet->setDynamicRange(dr);
|
||||||
if(ret!=dr){
|
if(ret!=dr){
|
||||||
qDefs::WarningMessage("Dynamic Range cannot be set for this value.","Settings");
|
qDefs::WarningMessage("Dynamic Range cannot be set to this value.","Settings");
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "ERROR: Setting dynamic range to "<< ret << endl;
|
cout << "ERROR: Setting dynamic range to "<< ret << endl;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user