Version 1 with the action tab working

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@6 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
l_maliakal_d
2012-06-06 15:23:55 +00:00
parent 20cc6d9a90
commit 7a218418d1
20 changed files with 1689 additions and 767 deletions

View File

@ -0,0 +1,264 @@
/*
* qTabActions.cpp
*
* Created on: May 10, 2012
* Author: l_maliakal_d
*/
/** Qt Project Class Headers */
#include "qActionsWidget.h"
/** Qt Include Headers */
#include <QGridLayout>
#include <QHBoxLayout>
#include <QComboBox>
#include <QLineEdit>
#include <QPushButton>
#include <QLabel>
#include <QLayout>
#include <QSpacerItem>
#include <QSpinBox>
#include <QGroupBox>
#include <QRadioButton>
/** C++ Include Headers */
#include<iostream>
using namespace std;
#define Detector_Index 0
ActionsWidget::ActionsWidget(QWidget *parent, int scanType): QFrame(parent){
SetupWidgetWindow(scanType);
Initialization();
}
ActionsWidget::~ActionsWidget(){
delete layout;
}
void ActionsWidget::SetupWidgetWindow(int scanType){
/** Widget Settings */
//setFrameStyle(QFrame::Box);
//setFrameShadow(QFrame::Raised);
setFixedHeight(25);
if(scanType) setFixedHeight(125);
/** Main Layout Settings */
layout = new QGridLayout(this);
setLayout(layout);
layout->setContentsMargins(0,0,0,0);
if(scanType) layout->setVerticalSpacing(5);
/** Main Widgets*/
comboScript = new QComboBox(this);
if(!scanType){
comboScript->addItem("None");
comboScript->addItem("Custom Script");
}else{
comboScript->addItem("None");
comboScript->addItem("Energy Scan");
comboScript->addItem("Threshold Scan");
comboScript->addItem("Trimbits Scan");
comboScript->addItem("Custom Script");
}
layout->addWidget(comboScript,0,0);
layout->addItem(new QSpacerItem(20,20,QSizePolicy::Fixed,QSizePolicy::Fixed),0,1);
dispScript = new QLineEdit("None");
dispScript->setEnabled(false);
layout->addWidget(dispScript,0,2);
btnBrowse = new QPushButton("Browse");
btnBrowse->setEnabled(false);
layout->addWidget(btnBrowse,0,3);
layout->addItem(new QSpacerItem(20,20,QSizePolicy::Fixed,QSizePolicy::Fixed),0,4);
lblParameter = new QLabel("Additional Parameter:");
lblParameter->setEnabled(false);
layout->addWidget(lblParameter,0,5);
dispParameter = new QLineEdit("None");
dispParameter->setEnabled(false);
dispParameter->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
layout->addWidget(dispParameter,0,6);
/** Scan Levels Widgets*/
if(scanType){
lblSteps = new QLabel("Number of Steps:");
lblSteps->setEnabled(false);
layout->addWidget(lblSteps,1,2);
spinSteps = new QSpinBox(this);
spinSteps->setEnabled(false);
layout->addWidget(spinSteps,1,3);
lblPrecision = new QLabel("Precision:");
lblPrecision->setEnabled(false);
layout->addWidget(lblPrecision,1,5);
spinPrecision = new QSpinBox(this);
spinPrecision->setEnabled(false);
layout->addWidget(spinPrecision,1,6);
group = new QGroupBox(this);
group->setEnabled(false);
/** Fix the size of the groupbox*/
group->setFixedSize(513,66);
layout->addWidget(group,2,2,1,5);
/** Group Box for step size */
/** Radio Buttons Layout */
QWidget *h1Widget = new QWidget(group);
h1Widget->setGeometry(QRect(10, 5, group->width()-20, 23));
QHBoxLayout *h1 = new QHBoxLayout(h1Widget);
h1->setContentsMargins(0, 0, 0, 0);
radioConstant = new QRadioButton("Constant Step Size",h1Widget);
radioConstant->setChecked(true);
h1->addWidget(radioConstant);
radioSpecific = new QRadioButton("Specific Values",h1Widget);
h1->addWidget(radioSpecific);
radioValue = new QRadioButton("Values from File",h1Widget);
radioValue->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
h1->addWidget(radioValue);
/** Constant Size Layout */
QWidget *h2ConstantWidget = new QWidget(group);
h2ConstantWidget->setGeometry(QRect(10, 30, group->width()-20, 31));
QHBoxLayout *h2Constant = new QHBoxLayout(h2ConstantWidget);
h2Constant->setContentsMargins(0, 0, 0, 0);
h2Constant->addItem(new QSpacerItem(50,20,QSizePolicy::Fixed,QSizePolicy::Fixed));
lblFrom = new QLabel("from",h2ConstantWidget);
lblFrom->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
h2Constant->addWidget(lblFrom);
spinFrom = new QSpinBox(h2ConstantWidget);
h2Constant->addWidget(spinFrom);
lblTo = new QLabel("to",h2ConstantWidget);
lblTo->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
h2Constant->addWidget(lblTo);
spinTo = new QSpinBox(h2ConstantWidget);
h2Constant->addWidget(spinTo);
h2Constant->addItem(new QSpacerItem(20,20,QSizePolicy::Fixed,QSizePolicy::Fixed));
lblSize = new QLabel("Size",h2ConstantWidget);
lblSize->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
h2Constant->addWidget(lblSize);
spinSize = new QSpinBox(h2ConstantWidget);
h2Constant->addWidget(spinSize);
h2Constant->addItem(new QSpacerItem(50,20,QSizePolicy::Fixed,QSizePolicy::Fixed));
/** Specific Values Layout */
QWidget *h2SpecificWidget = new QWidget(group);
h2SpecificWidget->setGeometry(QRect(10, 30, group->width()-20, 31));
QHBoxLayout *h2Specific = new QHBoxLayout(h2SpecificWidget);
h2Specific->setContentsMargins(0, 0, 0, 0);
h2Specific->addItem(new QSpacerItem(200,20,QSizePolicy::Fixed,QSizePolicy::Fixed));
comboSpecific = new QComboBox(h2SpecificWidget);
h2Specific->addWidget(comboSpecific);
comboSpecific->hide();
h2Specific->addItem(new QSpacerItem(200,20,QSizePolicy::Fixed,QSizePolicy::Fixed));
/** Values From a File Layout */
QWidget *h2ValuesWidget = new QWidget(group);
h2ValuesWidget->setGeometry(QRect(10, 30, group->width()-20, 31));
QHBoxLayout *h2Values = new QHBoxLayout(h2ValuesWidget);
h2Values->setContentsMargins(0, 0, 0, 0);
h2Values->addItem(new QSpacerItem(50,20,QSizePolicy::Fixed,QSizePolicy::Fixed));
dispValues = new QLineEdit("steps.txt",h2ValuesWidget);
dispValues->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed);
h2Values->addWidget(dispValues);
dispValues->hide();
btnValues = new QPushButton("Browse",h2ValuesWidget);
btnValues->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
h2Values->addWidget(btnValues);
btnValues->hide();
h2Values->addItem(new QSpacerItem(50,20,QSizePolicy::Fixed,QSizePolicy::Fixed));
}
}
void ActionsWidget::Initialization(){
connect(comboScript,SIGNAL(currentIndexChanged(int)),this,SLOT(SetScript(int)));
connect(radioConstant,SIGNAL(toggled(bool)),this,SLOT(EnableSizeWidgets()));
connect(radioSpecific,SIGNAL(toggled(bool)),this,SLOT(EnableSizeWidgets()));
connect(radioValue,SIGNAL(toggled(bool)),this,SLOT(EnableSizeWidgets()));
}
void ActionsWidget::SetScript(int index){
/** defaults */
dispScript->setEnabled(false);
btnBrowse->setEnabled(false);
lblParameter->setEnabled(false);
dispParameter->setEnabled(false);
if(comboScript->count()>2){
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(comboScript->count()>2){
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());
}
}
}
void ActionsWidget::EnableSizeWidgets(){
/** defaults */
lblFrom->hide();
spinFrom->hide();
lblTo->hide();
spinTo->hide();
lblSize->hide();
spinSize->hide();
comboSpecific->hide();
dispValues->hide();
btnValues->hide();
lblSteps->setEnabled(true);
spinSteps->setEnabled(true);
/** Constant Step Size */
if(radioConstant->isChecked()){
lblFrom->show();
spinFrom->show();
lblTo->show();
spinTo->show();
lblSize->show();
spinSize->show();
lblSteps->setEnabled(false);
spinSteps->setEnabled(false);
}/** Specific Values */
else if(radioSpecific->isChecked())
comboSpecific->show();
/** Values from a File */
else{
dispValues->show();
btnValues->show();
}
}

View File

@ -52,7 +52,6 @@ void qCloneWidget::SetupWidgetWindow(QString title,int numDim,SlsQt1DPlot*& plot
gridClone = new QGridLayout(cloneBox);
cloneBox->setLayout(gridClone);
cloneBox->setContentsMargins(0,0,0,0);
//cloneBox->resize(400,200);
cloneBox->setTitle(title);
cloneBox->setAlignment(Qt::AlignHCenter);
cloneBox->setFont(QFont("Sans Serif",11,QFont::Bold));
@ -86,6 +85,7 @@ void qCloneWidget::SetupWidgetWindow(QString title,int numDim,SlsQt1DPlot*& plot
hLayoutSave->setSpacing(0);
/** file name */
dispFName = new QLineEdit(this);
dispFName->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
hLayoutSave->addWidget(dispFName);
/** file format */
comboFormat = new QComboBox(this);
@ -118,6 +118,8 @@ void qCloneWidget::SetupWidgetWindow(QString title,int numDim,SlsQt1DPlot*& plot
/** Save */
connect(btnSave, SIGNAL(clicked()), this, SLOT(SavePlot()));
setMinimumHeight(300);
resize(500,350);
}

View File

@ -36,7 +36,7 @@ int main (int argc, char **argv) {
qDetectorMain::qDetectorMain(int argc, char **argv, QApplication *app, QWidget *parent) :
QMainWindow(parent), theApp(app),myPlot(NULL),tabs(NULL){
QMainWindow(parent), theApp(app),myPlot(NULL),tabs(NULL),isDeveloper(0){
myDet = 0;
setupUi(this);
SetUpWidgetWindow();
@ -44,7 +44,7 @@ qDetectorMain::qDetectorMain(int argc, char **argv, QApplication *app, QWidget *
/**need to use argc and argv to determine which slsdet or multidet to use.*/
for(int iarg=1; iarg<argc; iarg++){
if(!strcasecmp(argv[1],"-developer")) SetDeveloperMode(true);
if(!strcasecmp(argv[1],"-developer")) {isDeveloper=1;SetDeveloperMode(true);}
if(!strcasecmp(argv[1],"-help")){
cout<<"Possible Arguments are:"<<endl;
@ -56,8 +56,6 @@ qDetectorMain::qDetectorMain(int argc, char **argv, QApplication *app, QWidget *
}
}
//centralwidget->setFixedHeight(centralwidget->height());
}
@ -88,7 +86,7 @@ void qDetectorMain::SetUpWidgetWindow(){
dockWidgetPlot->setWidget(myPlot);
/**tabs setup*/
tabs = new QTabWidget(this);
tabs = new MyTabWidget(this);
layoutTabs->addWidget(tabs);
/** creating all the tab widgets */
tab_measurement = new qTabMeasurement (this, myDet,myPlot);
@ -114,6 +112,7 @@ void qDetectorMain::SetUpWidgetWindow(){
scroll[Debugging] ->setWidget(tab_debugging);
scroll[Developer] ->setWidget(tab_developer);
/** inserting all the tabs*/
tabs->insertTab(Measurement, scroll[Measurement], "Measurement");
tabs->insertTab(DataOutput, scroll[DataOutput], "Data Output");
@ -130,6 +129,9 @@ void qDetectorMain::SetUpWidgetWindow(){
SetExpertMode(false);
SetDeveloperMode(false);
tabs->tabBar()->setTabTextColor(0,QColor(0,0,200,255));
}
@ -172,6 +174,9 @@ void qDetectorMain::Initialization(){
/** Plotting */
/** When the acquisition is finished, must update the meas tab */
connect(tab_measurement, SIGNAL(StartSignal()), this,SLOT(EnableTabs()));
connect(tab_measurement, SIGNAL(StopSignal()), this,SLOT(EnableTabs()));
connect(myPlot, SIGNAL(UpdatingPlotFinished()), this,SLOT(EnableTabs()));
connect(myPlot, SIGNAL(UpdatingPlotFinished()), tab_measurement,SLOT(UpdateFinished()));
@ -195,7 +200,7 @@ void qDetectorMain::Initialization(){
connect(actionVersion,SIGNAL(triggered()),this,SLOT(Version()));
heightPlotWindow = dockWidgetPlot->size().height();
heightCentralWidget = centralwidget->size().height();
}
@ -224,9 +229,8 @@ void qDetectorMain::SetExpertMode(bool b){
#ifdef VERBOSE
cout<<"Setting Expert Mode to "<<b<<endl;
#endif
//threshold part in measu is enabled
tabs->setTabEnabled(Advanced,b);
tab_advanced->setEnabled(b);
}
@ -237,6 +241,13 @@ void qDetectorMain::refresh(int index){
else{
;
}
for(int i=0;i<NumberOfTabs;i++){
if(tabs->isTabEnabled(i))
tabs->tabBar()->setTabTextColor(i,Qt::black);
else
tabs->tabBar()->setTabTextColor(i,Qt::gray);
}
tabs->tabBar()->setTabTextColor(index,QColor(0,0,200,255));
}
@ -324,24 +335,45 @@ void qDetectorMain::ResizeMainWindow(bool b){
cout<<"Resizing Main Window: height:"<<height()<<endl;
#endif
/** undocked from the main window */
if(b){/** sets the main window height to a smaller maximum to get rid of space*/
if(b){
/** sets the main window height to a smaller maximum to get rid of space*/
setMaximumHeight(height()-heightPlotWindow-9);
dockWidgetPlot->setMinimumHeight(0);
cout<<"undocking it from main window"<<endl;
}
else{
setMaximumHeight(QWIDGETSIZE_MAX);
dockWidgetPlot->setMinimumHeight(heightPlotWindow);
/** the minimum for plot will be set when the widget gets resized automatically*/
}
}
void qDetectorMain::resizeEvent(QResizeEvent* event){
if(!dockWidgetPlot->isFloating()){
if(tabs->currentIndex()== Actions){
dockWidgetPlot->setMinimumHeight(heightPlotWindow-100);
centralwidget->setMaximumHeight(QWIDGETSIZE_MAX);
}
else{
dockWidgetPlot->setMinimumHeight(height()-centralwidget->height()-50);
centralwidget->setMaximumHeight(heightCentralWidget);
}
}
#ifdef VERBOSE
cout<<"height:"<<height()<<endl;
cout<<"dockWidgetPlot height:"<<dockWidgetPlot->height()<<endl;
#endif
}
//prolly not needed
void qDetectorMain::SetTerminalWindowSize(bool b){
#ifdef VERBOSE
cout<<"Resizing Terminal Window"<<endl;
#endif
//depends on gridlayout in qdrawterminal widget class
/*//depends on gridlayout in qdrawterminal widget class
if(b){
dockWidgetTerminal->setMinimumWidth(width()/2);
}
@ -350,5 +382,34 @@ void qDetectorMain::SetTerminalWindowSize(bool b){
dockWidgetTerminal->setMinimumWidth(38);
QSizePolicy sizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
dockWidgetTerminal->setSizePolicy(sizePolicy);
}*/
}
void qDetectorMain::EnableTabs(){
bool enable;
enable=(tabs->isTabEnabled(DataOutput)?false:true);
// or use the Enable/Disable button
/** normal tabs*/
tabs->setTabEnabled(DataOutput,enable);
tabs->setTabEnabled(Actions,enable);
tabs->setTabEnabled(Settings,enable);
/** special tabs */
if(enable==false){
tabs->setTabEnabled(Debugging,enable);
tabs->setTabEnabled(Advanced,enable);
tabs->setTabEnabled(Developer,enable);
}
else{
/** enable these tabs only if they were enabled earlier */
if(actionDebug->isChecked())
tabs->setTabEnabled(Debugging,enable);
if(actionExpert->isChecked())
tabs->setTabEnabled(Advanced,enable);
if(isDeveloper)
tabs->setTabEnabled(Developer,enable);
}
}

View File

@ -286,14 +286,14 @@ void* qDrawPlot::AcquireImages(){
/* if(framePeriod<acquisitionTime) usleep((int)acquisitionTime*1e6);
else usleep((int)framePeriod*1e6);*/
cout<<"Reading in image: "<<i<<endl;
//cout<<"Reading in image: "<<i<<endl;
//usleep(1000000);
if(stop_signal) break; //stop_signal should also go to readout function
if(!pthread_mutex_trylock(&last_image_complete_mutex)){
//plot_in_scope = 1;//i%2 + 1;
//plot_in_scope = 2;
cout<<"value:"<<image_data[6]<<endl;
//cout<<"value:"<<image_data[6]<<endl;
lastImageNumber = i+1;
char temp_title[2000];
@ -431,11 +431,14 @@ void qDrawPlot::ClonePlot(){
found=true;
break;
}
/** no space for more clone widget references*/
if(!found){
cout<<"Too many clones"<<endl;
exit(-1);
}
/** save height to keep maintain same height of plot */
int preheight = height();
/** create clone */
winClone[i] = new qCloneWidget(this,i,boxPlot->title(),(int)plot_in_scope,plot1D,plot2D,myDet->getFilePath());
if(plot_in_scope==1){
plot1D = new SlsQt1DPlot(boxPlot);
@ -454,11 +457,16 @@ void qDrawPlot::ClonePlot(){
plot2D->SetZTitle(imageZAxisTitle);
plotLayout->addWidget(plot2D,1,1,1,1);
}
setMinimumHeight(preheight);
resize(width(),preheight);
/** update the actual plot */
UpdatePlot();
connect(this, SIGNAL(InterpolateSignal(bool)), plot2D, SIGNAL(InterpolateSignal(bool)));
connect(this, SIGNAL(ContourSignal(bool)), plot2D, SIGNAL(ContourSignal(bool)));
connect(this, SIGNAL(LogzSignal(bool)), plot2D, SLOT(SetZScaleToLog(bool)));
winClone[i]->show();
/** to remember which all clone widgets were closed*/
connect(winClone[i], SIGNAL(CloneClosedSignal(int)),this, SLOT(CloneCloseEvent(int)));
}

View File

@ -7,9 +7,18 @@
/** Qt Project Class Headers */
#include "qTabActions.h"
#include "qDefs.h"
#include "qActionsWidget.h"
/** Project Class Headers */
#include "slsDetector.h"
#include "multiSlsDetector.h"
/** Qt Include Headers */
#include <QGridLayout>
#include <QPushButton>
#include <QLabel>
#include <QScrollArea>
#include <QLayoutItem>
#include <QPalette>
/** C++ Include Headers */
#include<iostream>
using namespace std;
@ -20,7 +29,7 @@ using namespace std;
qTabActions::qTabActions(QWidget *parent,slsDetectorUtils*& detector):QWidget(parent),myDet(detector){
setupUi(this);
//setupUi(this);
if(myDet)
{
SetupWidgetWindow();
@ -39,20 +48,209 @@ qTabActions::~qTabActions(){
void qTabActions::SetupWidgetWindow(){
setupUi(this);
/** Window Settings*/
setFixedSize(705,350);
setContentsMargins(0,0,0,0);
/** Scroll Area Settings*/
QScrollArea *scroll = new QScrollArea;
scroll->setWidget(this);
scroll->setWidgetResizable(true);
/** Layout Settings*/
gridLayout = new QGridLayout(scroll);
setLayout(gridLayout);
gridLayout->setContentsMargins(10,5,0,0);
gridLayout->setVerticalSpacing(2);
/** Buttongroup to know which +/- button was clicked*/
group = new QButtonGroup(this);
palette = new QPalette();
/** For each level of Actions */
for(int i=0;i<NUM_ACTION_WIDGETS;i++){
/** Add the extra widgets only for the 1st 2 levels*/
if((i==1)||(i==2))
actionWidget[i] = new ActionsWidget(this,1);
else
actionWidget[i] = new ActionsWidget(this,0);
btnExpand[i] = new QPushButton("+");
btnExpand[i]->setFixedSize(20,20);
lblName[i] = new QLabel("");
group->addButton(btnExpand[i],i);
gridLayout->addWidget(btnExpand[i],(i*2),0);
gridLayout->addWidget(lblName[i],(i*2),1);
gridLayout->addWidget(actionWidget[i],(i*2)+1,1,1,2);
}
/** Label Values */
lblName[0]->setText("Action at Start");
lblName[1]->setText("Scan Level 0");
lblName[2]->setText("Scan Level 1");
lblName[3]->setText("Action before each Frame");
lblName[4]->setText("Number of Positions");
lblName[5]->setText("Header before Frame");
lblName[6]->setText("Header after Frame");
lblName[7]->setText("Action after each Frame");
lblName[8]->setText("Action at Stop");
/** initially hide all the widgets*/
for(int i=0;i<NUM_ACTION_WIDGETS;i++) actionWidget[i]->hide();
}
void qTabActions::Initialization(){
connect(group,SIGNAL(buttonClicked(QAbstractButton*)),this,SLOT(Expand(QAbstractButton*)));
}
void qTabActions::Enable(bool enable){
}
void qTabActions::Expand(QAbstractButton *button ){
int index = group->id(button);
/** Collapse */
if(!QString::compare(button->text(), "-")){
palette->setColor(QPalette::WindowText,Qt::black);
lblName[index]->setPalette(*palette);
actionWidget[index]->hide();
button->setText("+");
if((index==1)||(index==2))
setFixedHeight(height()-130);
else
setFixedHeight(height()-30);
}else{
/** Expand */
palette->setColor(QPalette::WindowText,QColor(0,0,200,255));
lblName[index]->setPalette(*palette);
actionWidget[index]->show();
button->setText("-");
if((index==1)||(index==2))
setFixedHeight(height()+130);
else
setFixedHeight(height()+30);
}
}
/*
void qTabActions::Initialization(){
connect(radio0Constant, SIGNAL(toggled(bool)),this,SLOT(ChangeStepSize(bool)));
connect(radio0Specific, SIGNAL(toggled(bool)),this,SLOT(ChangeStepSize(bool)));
connect(radio0Value, SIGNAL(toggled(bool)),this,SLOT(ChangeStepSize(bool)));
connect(radio1Constant, SIGNAL(toggled(bool)),this,SLOT(ChangeStepSize(bool)));
connect(radio1Specific, SIGNAL(toggled(bool)),this,SLOT(ChangeStepSize(bool)));
connect(radio1Value, SIGNAL(toggled(bool)),this,SLOT(ChangeStepSize(bool)));
connect(btntry, SIGNAL(clicked()),this,SLOT(Trial()));
}
void qTabActions::Enable(bool enable){
//this->setEnabled(enable);
}
void qTabActions::ChangeStepSize(bool b){
* defaults
lbl0From->hide();
lbl0Size->hide();
lbl0To->hide();
spin0From->hide();
spin0Size->hide();
spin0To->hide();
combo0Specific->hide();
btn0Browse->hide();
disp0File->hide();
lbl1From->hide();
lbl1Size->hide();
lbl1To->hide();
spin1From->hide();
spin1Size->hide();
spin1To->hide();
combo1Specific->hide();
btn1Browse->hide();
disp1File->hide();
*Scan 0
* constant step size
if(radio0Constant->isChecked()){
lbl0From->show();
lbl0Size->show();
lbl0To->show();
spin0From->show();
spin0Size->show();
spin0To->show();
}
* specific values
else if(radio0Specific->isChecked())
combo0Specific->show();
* values from a file
else{
btn0Browse->show();
disp0File->show();
}
*Scan 1
* constant step size
if(radio1Constant->isChecked()){
lbl1From->show();
lbl1Size->show();
lbl1To->show();
spin1From->show();
spin1Size->show();
spin1To->show();
}
* specific values
else if(radio1Specific->isChecked())
combo1Specific->show();
* values from a file
else{
btn1Browse->show();
disp1File->show();
}
//groupBox->hide();
}
//if(!QString::compare(btntry->text(),"+")){
*/

View File

@ -9,8 +9,11 @@
/** Project Class Headers */
#include "slsDetector.h"
#include "multiSlsDetector.h"
/** Qt Include Headers */
#include <QFileDialog>
/** C++ Include Headers */
#include<iostream>
#include <iostream>
#include <string>
using namespace std;
@ -18,7 +21,8 @@ using namespace std;
qTabDataOutput::qTabDataOutput(QWidget *parent,slsDetectorUtils*& detector):QWidget(parent),myDet(detector){
qTabDataOutput::qTabDataOutput(QWidget *parent,slsDetectorUtils*& detector):
QWidget(parent),myDet(detector){
setupUi(this);
if(myDet)
{
@ -38,18 +42,39 @@ qTabDataOutput::~qTabDataOutput(){
void qTabDataOutput::SetupWidgetWindow(){
outputDir= QString(myDet->getFilePath().c_str());
dispOutputDir->setText(outputDir);
}
void qTabDataOutput::Initialization(){
connect(dispOutputDir, SIGNAL(textChanged(const QString&)), this, SLOT(setOutputDir(const QString&)));
connect(btnOutputBrowse, SIGNAL(clicked()), this, SLOT(browseOutputDir()));
}
void qTabDataOutput::Enable(bool enable){
//this->setEnabled(enable);
layoutOutput->setEnabled(enable);
boxCorrection->setEnabled(enable);
}
void qTabDataOutput::setOutputDir(const QString& path){
outputDir = path;
myDet->setFilePath(string(outputDir.toAscii().constData()));
#ifdef VERBOSE
cout<<"Output Directory changed to :"<<myDet->getFilePath()<<endl;
#endif
}
void qTabDataOutput::browseOutputDir()
{
QString directory = QFileDialog::getExistingDirectory(this,tr("Choose Output Directory "),dispOutputDir->text());
if (!directory.isEmpty())
dispOutputDir->setText(directory);
}

View File

@ -170,9 +170,8 @@ void qTabMeasurement::DeInitialization(){
void qTabMeasurement::Enable(bool enable){
gridTimeResolved->setEnabled(enable);
gridLayout->setEnabled(enable);
boxProgress->setEnabled(enable);
frameTimeResolved->setEnabled(enable);
frameNotTimeResolved->setEnabled(enable);
/** Enable this always **/
if(!enable) btnStartStop->setEnabled(true);
}
@ -217,12 +216,14 @@ void qTabMeasurement::startStopAcquisition(){
#endif
btnStartStop->setText("Stop");
Enable(0);
emit StartSignal();
}else{
#ifdef VERBOSE
cout<<"Stopping Acquisition"<<endl;
#endif
btnStartStop->setText("Start");
Enable(1);
emit StopSignal();
}
myPlot->StartStopDaqToggle();
}

View File

@ -36,7 +36,7 @@ qTabPlot::qTabPlot(QWidget *parent,slsDetectorUtils*& detector, qDrawPlot*& plot
//This also selects the text if unchecked
//includes setupwidgetwindow
//SelectPlot(1);
Select1DPlot(false);
Select1DPlot(true);
Initialization();
}
}
@ -115,10 +115,10 @@ void qTabPlot::Initialization(){
connect(chkXAxis, SIGNAL(toggled(bool)), this, SLOT(EnableTitles()));
connect(chkYAxis, SIGNAL(toggled(bool)), this, SLOT(EnableTitles()));
connect(chkZAxis, SIGNAL(toggled(bool)), this, SLOT(EnableTitles()));
connect(dispTitle, SIGNAL(returnPressed()), this, SLOT(SetTitles()));
connect(dispXAxis, SIGNAL(returnPressed()), this, SLOT(SetTitles()));
connect(dispYAxis, SIGNAL(returnPressed()), this, SLOT(SetTitles()));
connect(dispZAxis, SIGNAL(returnPressed()), this, SLOT(SetTitles()));
connect(dispTitle, SIGNAL(textChanged(const QString&)), this, SLOT(SetTitles()));
connect(dispXAxis, SIGNAL(textChanged(const QString&)), this, SLOT(SetTitles()));
connect(dispYAxis, SIGNAL(textChanged(const QString&)), this, SLOT(SetTitles()));
connect(dispZAxis, SIGNAL(textChanged(const QString&)), this, SLOT(SetTitles()));
/** Common Buttons*/
connect(btnClear, SIGNAL(clicked()), myPlot, SLOT(Clear1DPlot()));
/** Save */