mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-21 11:20:04 +02:00
check if outdir exists,indent Actions,degreeC,cascode,thresholdscan(ev),not saving data secondary title,got rid of 2d sampledata
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@86 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
parent
b703e52563
commit
87410f09de
@ -367,7 +367,7 @@ Defines scan range for a <b>Constant Step Size</b> with the followin
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Energy Scan</string>
|
<string>Energy Scan (eV)</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
@ -299,23 +299,48 @@
|
|||||||
<number>-1</number>
|
<number>-1</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="lblOutputDir">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><nobr>
|
||||||
|
Directory where one saves the data.
|
||||||
|
</nobr><br>
|
||||||
|
#outdir#
|
||||||
|
<br>
|
||||||
|
</string>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Output Directory :</string>
|
<string>Output Directory :</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="dispOutputDir"/>
|
<widget class="QLineEdit" name="dispOutputDir">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><nobr>
|
||||||
|
Directory where one saves the data.
|
||||||
|
</nobr><br>
|
||||||
|
#outdir#
|
||||||
|
<br>
|
||||||
|
</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="btnOutputBrowse">
|
<widget class="QPushButton" name="btnOutputBrowse">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><nobr>
|
||||||
|
Directory where one saves the data.
|
||||||
|
</nobr><br>
|
||||||
|
#outdir#
|
||||||
|
<br>
|
||||||
|
</string>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Browse</string>
|
<string>Browse</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -638,7 +638,7 @@
|
|||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QCheckBox" name="chkTitle">
|
<widget class="QCheckBox" name="chkTitle">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Title:</string>
|
<string>Title Prefix:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -21,7 +21,7 @@ public:
|
|||||||
qDefs(){};
|
qDefs(){};
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
#define GUI_VERSION 0.12
|
#define GUI_VERSION 0.13
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -52,6 +52,9 @@ public:
|
|||||||
int GetProgress(){return progress;};
|
int GetProgress(){return progress;};
|
||||||
/** gets the file index to the measurement tab*/
|
/** gets the file index to the measurement tab*/
|
||||||
int GetFileIndex(){return currentFileIndex;};
|
int GetFileIndex(){return currentFileIndex;};
|
||||||
|
/** sets file write enable , if not enabled,
|
||||||
|
* file index wont increase and so you need secondary titles to differentitate between plots*/
|
||||||
|
void SetEnableFileWrite(bool enable){fileSaveEnable = enable;};
|
||||||
|
|
||||||
/** sets plot Title prefix*/
|
/** sets plot Title prefix*/
|
||||||
void SetPlotTitlePrefix(QString title) {plotTitle_prefix = title;}
|
void SetPlotTitlePrefix(QString title) {plotTitle_prefix = title;}
|
||||||
@ -448,7 +451,8 @@ static const int TRIM_HISTOGRAM_XMAX = 63;
|
|||||||
/**if the values increment backwards*/
|
/**if the values increment backwards*/
|
||||||
bool backwardScanPlot;
|
bool backwardScanPlot;
|
||||||
|
|
||||||
|
/**if files will be saved and index increased*/
|
||||||
|
bool fileSaveEnable;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void UpdatingPlotFinished();
|
void UpdatingPlotFinished();
|
||||||
|
@ -85,7 +85,17 @@ private:
|
|||||||
slsDetectorDefs::detectorType detType;
|
slsDetectorDefs::detectorType detType;
|
||||||
|
|
||||||
|
|
||||||
enum actionIndex{Scan0=1, Scan1, NumPositions=4, NumTotalActions=9};
|
enum actionIndex{
|
||||||
|
ActionStart,
|
||||||
|
Scan0,
|
||||||
|
Scan1,
|
||||||
|
ActionBefore,
|
||||||
|
NumPositions,
|
||||||
|
HeaderBefore,
|
||||||
|
HeaderAfter,
|
||||||
|
ActionAfter,
|
||||||
|
ActionStop,
|
||||||
|
NumTotalActions};
|
||||||
|
|
||||||
QGridLayout *gridLayout;
|
QGridLayout *gridLayout;
|
||||||
QButtonGroup *group;
|
QButtonGroup *group;
|
||||||
|
@ -49,6 +49,7 @@ private:
|
|||||||
|
|
||||||
QString flatFieldTip;
|
QString flatFieldTip;
|
||||||
QString errFlatFieldTip;
|
QString errFlatFieldTip;
|
||||||
|
QString outDirTip;
|
||||||
QPalette red;
|
QPalette red;
|
||||||
|
|
||||||
/** methods */
|
/** methods */
|
||||||
|
@ -66,15 +66,17 @@ void qDrawPlot::SetupWidgetWindow(){
|
|||||||
//gui_acquisition_thread_running = 0;
|
//gui_acquisition_thread_running = 0;
|
||||||
// Default Plotting
|
// Default Plotting
|
||||||
plot_in_scope = 0;
|
plot_in_scope = 0;
|
||||||
//2d
|
|
||||||
lastImageNumber = 0;
|
lastImageNumber = 0;
|
||||||
last_plot_number = 0;
|
last_plot_number = 0;
|
||||||
|
|
||||||
nPixelsX = myDet->getTotalNumberOfChannels();
|
nPixelsX = myDet->getTotalNumberOfChannels();
|
||||||
nPixelsY = 100;
|
nPixelsY = 100;
|
||||||
nAnglePixelsX = 1;
|
nAnglePixelsX = 1;
|
||||||
|
|
||||||
minPixelsY = 0;
|
minPixelsY = 0;
|
||||||
|
maxPixelsY = 0;
|
||||||
|
startPixel=-0.5;
|
||||||
|
endPixel=nPixelsY-0.5;
|
||||||
|
|
||||||
//2d
|
//2d
|
||||||
lastImageArray = 0;
|
lastImageArray = 0;
|
||||||
//1d
|
//1d
|
||||||
@ -156,6 +158,7 @@ void qDrawPlot::SetupWidgetWindow(){
|
|||||||
|
|
||||||
plot2D = new SlsQt2DPlotLayout(boxPlot);
|
plot2D = new SlsQt2DPlotLayout(boxPlot);
|
||||||
plot2D->setFont(QFont("Sans Serif",9,QFont::Normal));
|
plot2D->setFont(QFont("Sans Serif",9,QFont::Normal));
|
||||||
|
plot2D->GetPlot()->SetData(nPixelsX,-0.5,nPixelsX-0.5,nPixelsY,startPixel,endPixel,lastImageArray);
|
||||||
plot2D->setTitle(GetImageTitle());
|
plot2D->setTitle(GetImageTitle());
|
||||||
plot2D->SetXTitle(imageXAxisTitle);
|
plot2D->SetXTitle(imageXAxisTitle);
|
||||||
plot2D->SetYTitle(imageYAxisTitle);
|
plot2D->SetYTitle(imageYAxisTitle);
|
||||||
@ -182,6 +185,8 @@ void qDrawPlot::SetupWidgetWindow(){
|
|||||||
fileName = QString(myDet->getFileName().c_str());
|
fileName = QString(myDet->getFileName().c_str());
|
||||||
|
|
||||||
|
|
||||||
|
fileSaveEnable= myDet->enableWriteToFile();
|
||||||
|
|
||||||
|
|
||||||
// Setting the callback function to get data from detector class
|
// Setting the callback function to get data from detector class
|
||||||
myDet->registerDataCallback(&(GetDataCallBack),this);
|
myDet->registerDataCallback(&(GetDataCallBack),this);
|
||||||
@ -540,7 +545,10 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
//Plot Disabled
|
//Plot Disabled
|
||||||
if(!plotEnable) return 0;
|
if(!plotEnable) return 0;
|
||||||
|
|
||||||
|
// secondary title necessary to differentiate between frames when not saving data
|
||||||
|
char temp_title[2000];
|
||||||
|
if(fileSaveEnable) strcpy(temp_title,"");
|
||||||
|
else sprintf(temp_title,"#%d",currentFrame);
|
||||||
|
|
||||||
|
|
||||||
//angle plotting
|
//angle plotting
|
||||||
@ -549,8 +557,9 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
||||||
//set title
|
//set title
|
||||||
plotTitle=QString(plotTitle_prefix)+QString(data->fileName).section('/',-1);
|
plotTitle=QString(plotTitle_prefix)+QString(data->fileName).section('/',-1);
|
||||||
|
// Title
|
||||||
|
histTitle[0] = temp_title;
|
||||||
|
|
||||||
cout<<endl<<"angle plot"<<endl<<endl;
|
|
||||||
if(data->angles==NULL){
|
if(data->angles==NULL){
|
||||||
cout<<"\n\nWARNING:RETURNED NULL instead of angles."<<endl;
|
cout<<"\n\nWARNING:RETURNED NULL instead of angles."<<endl;
|
||||||
lastImageNumber= currentFrame+1;
|
lastImageNumber= currentFrame+1;
|
||||||
@ -623,8 +632,6 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
//variables
|
//variables
|
||||||
lastImageNumber= currentFrame+1;
|
lastImageNumber= currentFrame+1;
|
||||||
//title
|
//title
|
||||||
char temp_title[2000];
|
|
||||||
sprintf(temp_title,"Image Index %d",currentFileIndex);
|
|
||||||
imageTitle = temp_title;
|
imageTitle = temp_title;
|
||||||
//copy data
|
//copy data
|
||||||
memcpy(lastImageArray+(currentScanDivLevel*nPixelsX),data->values,nPixelsX*sizeof(double));
|
memcpy(lastImageArray+(currentScanDivLevel*nPixelsX),data->values,nPixelsX*sizeof(double));
|
||||||
@ -646,8 +653,6 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
if(currentFileIndex == minPixelsY) currentScanDivLevel = 0;
|
if(currentFileIndex == minPixelsY) currentScanDivLevel = 0;
|
||||||
lastImageNumber= currentFrame+1;
|
lastImageNumber= currentFrame+1;
|
||||||
//title
|
//title
|
||||||
char temp_title[2000];
|
|
||||||
sprintf(temp_title,"Image Index %d",currentFileIndex);
|
|
||||||
imageTitle = temp_title;
|
imageTitle = temp_title;
|
||||||
//copy data
|
//copy data
|
||||||
for(unsigned int px=0;px<nPixelsX;px++) lastImageArray[currentScanDivLevel*nPixelsX+px] += data->values[px];
|
for(unsigned int px=0;px<nPixelsX;px++) lastImageArray[currentScanDivLevel*nPixelsX+px] += data->values[px];
|
||||||
@ -678,8 +683,6 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
currentScanValue = cs0;
|
currentScanValue = cs0;
|
||||||
lastImageNumber= currentFrame+1;
|
lastImageNumber= currentFrame+1;
|
||||||
//title
|
//title
|
||||||
char temp_title[2000];
|
|
||||||
sprintf(temp_title,"Image Index %d",currentFileIndex);
|
|
||||||
imageTitle = temp_title;
|
imageTitle = temp_title;
|
||||||
//copy data
|
//copy data
|
||||||
for(unsigned int px=0;px<nPixelsX;px++) lastImageArray[currentScanDivLevel*nPixelsX+px] += data->values[px];
|
for(unsigned int px=0;px<nPixelsX;px++) lastImageArray[currentScanDivLevel*nPixelsX+px] += data->values[px];
|
||||||
@ -706,8 +709,6 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
currentScanValue = cs1;
|
currentScanValue = cs1;
|
||||||
lastImageNumber= currentFrame+1;
|
lastImageNumber= currentFrame+1;
|
||||||
//title
|
//title
|
||||||
char temp_title[2000];
|
|
||||||
sprintf(temp_title,"Image Index %d",currentFileIndex);
|
|
||||||
imageTitle = temp_title;
|
imageTitle = temp_title;
|
||||||
//copy data
|
//copy data
|
||||||
for(unsigned int px=0;px<nPixelsX;px++) lastImageArray[currentScanDivLevel*nPixelsX+px] += data->values[px];
|
for(unsigned int px=0;px<nPixelsX;px++) lastImageArray[currentScanDivLevel*nPixelsX+px] += data->values[px];
|
||||||
@ -724,13 +725,13 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
||||||
//set title
|
//set title
|
||||||
plotTitle=QString(plotTitle_prefix)+QString(data->fileName).section('/',-1);
|
plotTitle=QString(plotTitle_prefix)+QString(data->fileName).section('/',-1);
|
||||||
char temp_title[2000];
|
|
||||||
// only if you got the lock, do u need to remember lastimagenumber to plot
|
// only if you got the lock, do u need to remember lastimagenumber to plot
|
||||||
lastImageNumber= currentFrame+1;
|
lastImageNumber= currentFrame+1;
|
||||||
|
|
||||||
//1d
|
//1d
|
||||||
if(plot_in_scope==1){
|
if(plot_in_scope==1){
|
||||||
// Titles changed to "" inside startstopthread
|
// Titles
|
||||||
|
histTitle[0] = temp_title;
|
||||||
// Persistency
|
// Persistency
|
||||||
if(currentPersistency < persistency)currentPersistency++;
|
if(currentPersistency < persistency)currentPersistency++;
|
||||||
else currentPersistency=persistency;
|
else currentPersistency=persistency;
|
||||||
@ -742,9 +743,8 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
memcpy(histYAxis[0],data->values,nPixelsX*sizeof(double));
|
memcpy(histYAxis[0],data->values,nPixelsX*sizeof(double));
|
||||||
}
|
}
|
||||||
//2d
|
//2d
|
||||||
else{
|
else{cout<<endl<<"****************************IN HERE-2D*******************************************"<<endl<<endl;
|
||||||
// Titles
|
// Titles
|
||||||
sprintf(temp_title,"Image Index %d",currentFileIndex);
|
|
||||||
imageTitle = temp_title;
|
imageTitle = temp_title;
|
||||||
// manufacture data for now
|
// manufacture data for now
|
||||||
for(unsigned int px=0;px<nPixelsX;px++)
|
for(unsigned int px=0;px<nPixelsX;px++)
|
||||||
@ -1058,6 +1058,7 @@ void qDrawPlot::ClonePlot(){
|
|||||||
else{
|
else{
|
||||||
|
|
||||||
plot2D = new SlsQt2DPlotLayout(boxPlot);
|
plot2D = new SlsQt2DPlotLayout(boxPlot);
|
||||||
|
plot2D->GetPlot()->SetData(nPixelsX,-0.5,nPixelsX-0.5,nPixelsY,startPixel,endPixel,lastImageArray);
|
||||||
plot2D->setFont(QFont("Sans Serif",9,QFont::Normal));
|
plot2D->setFont(QFont("Sans Serif",9,QFont::Normal));
|
||||||
plot2D->setTitle(GetImageTitle());
|
plot2D->setTitle(GetImageTitle());
|
||||||
plot2D->SetXTitle(imageXAxisTitle);
|
plot2D->SetXTitle(imageXAxisTitle);
|
||||||
|
@ -92,7 +92,7 @@ void qScanWidget::SetupWidgetWindow(){
|
|||||||
spinFrom->setMinimum(-1000000);
|
spinFrom->setMinimum(-1000000);
|
||||||
spinFrom->setKeyboardTracking(false);
|
spinFrom->setKeyboardTracking(false);
|
||||||
spinFrom->setFixedWidth(80);
|
spinFrom->setFixedWidth(80);
|
||||||
spinFrom->setDecimals(4);
|
spinFrom->setDecimals(2);
|
||||||
lblTo->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
|
lblTo->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
|
||||||
lblTo->setToolTip(rangeTip);
|
lblTo->setToolTip(rangeTip);
|
||||||
lblTo->setFixedWidth(18);
|
lblTo->setFixedWidth(18);
|
||||||
@ -102,7 +102,7 @@ void qScanWidget::SetupWidgetWindow(){
|
|||||||
spinTo->setMinimum(-1000000);
|
spinTo->setMinimum(-1000000);
|
||||||
spinTo->setKeyboardTracking(false);
|
spinTo->setKeyboardTracking(false);
|
||||||
spinTo->setFixedWidth(80);
|
spinTo->setFixedWidth(80);
|
||||||
spinTo->setDecimals(4);
|
spinTo->setDecimals(2);
|
||||||
lblSize->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
|
lblSize->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
|
||||||
lblSize->setToolTip(rangeTip);
|
lblSize->setToolTip(rangeTip);
|
||||||
lblSize->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
|
lblSize->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
|
||||||
@ -113,7 +113,7 @@ void qScanWidget::SetupWidgetWindow(){
|
|||||||
spinSize->setSingleStep(0.1);
|
spinSize->setSingleStep(0.1);
|
||||||
spinSize->setToolTip(rangeTip);
|
spinSize->setToolTip(rangeTip);
|
||||||
spinSize->setKeyboardTracking(false);
|
spinSize->setKeyboardTracking(false);
|
||||||
spinSize->setDecimals(4);
|
spinSize->setDecimals(2);
|
||||||
|
|
||||||
//spinSize->setMinimum(0.0001);
|
//spinSize->setMinimum(0.0001);
|
||||||
layoutRange->addItem(new QSpacerItem(40,20,QSizePolicy::Fixed,QSizePolicy::Fixed));
|
layoutRange->addItem(new QSpacerItem(40,20,QSizePolicy::Fixed,QSizePolicy::Fixed));
|
||||||
|
@ -40,7 +40,8 @@ qTabActions::~qTabActions(){
|
|||||||
|
|
||||||
void qTabActions::SetupWidgetWindow(){
|
void qTabActions::SetupWidgetWindow(){
|
||||||
// Window Settings
|
// Window Settings
|
||||||
setFixedSize(710,350);
|
setFixedHeight(350);
|
||||||
|
//setFixedSize(710,350);
|
||||||
setContentsMargins(0,0,0,0);
|
setContentsMargins(0,0,0,0);
|
||||||
|
|
||||||
// Scroll Area Settings
|
// Scroll Area Settings
|
||||||
@ -62,7 +63,7 @@ void qTabActions::SetupWidgetWindow(){
|
|||||||
QPalette p;
|
QPalette p;
|
||||||
p.setColor(QPalette::Shadow,QColor(0,0,0,0));
|
p.setColor(QPalette::Shadow,QColor(0,0,0,0));
|
||||||
p.setColor(QPalette::Button,QColor(0,0,0,0));
|
p.setColor(QPalette::Button,QColor(0,0,0,0));
|
||||||
|
/*get rid of this vector*/
|
||||||
char names[NumTotalActions][200] = {
|
char names[NumTotalActions][200] = {
|
||||||
"Action at Start",
|
"Action at Start",
|
||||||
"Scan Level 0",
|
"Scan Level 0",
|
||||||
@ -81,6 +82,10 @@ void qTabActions::SetupWidgetWindow(){
|
|||||||
|
|
||||||
QString tip = "<nobr>Click on the \"+\" to Expand or \"-\" to Collapse.</nobr>";
|
QString tip = "<nobr>Click on the \"+\" to Expand or \"-\" to Collapse.</nobr>";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int hIndent=0, vIndent=0, colspan=6;
|
||||||
|
QLabel *lblReal;
|
||||||
// For each level of Actions
|
// For each level of Actions
|
||||||
for(int i=0;i<NumTotalActions;i++){
|
for(int i=0;i<NumTotalActions;i++){
|
||||||
//common widgets
|
//common widgets
|
||||||
@ -88,7 +93,6 @@ void qTabActions::SetupWidgetWindow(){
|
|||||||
btnExpand[i] = new QPushButton();
|
btnExpand[i] = new QPushButton();
|
||||||
|
|
||||||
lblName[i]->setToolTip(tip);
|
lblName[i]->setToolTip(tip);
|
||||||
|
|
||||||
btnExpand[i]->setCheckable(true);
|
btnExpand[i]->setCheckable(true);
|
||||||
btnExpand[i]->setChecked(false);
|
btnExpand[i]->setChecked(false);
|
||||||
btnExpand[i]->setFixedSize(16,16);
|
btnExpand[i]->setFixedSize(16,16);
|
||||||
@ -98,32 +102,62 @@ void qTabActions::SetupWidgetWindow(){
|
|||||||
btnExpand[i]->setFlat(true);
|
btnExpand[i]->setFlat(true);
|
||||||
btnExpand[i]->setIconSize(QSize(16,16));
|
btnExpand[i]->setIconSize(QSize(16,16));
|
||||||
btnExpand[i]->setPalette(p);
|
btnExpand[i]->setPalette(p);
|
||||||
|
|
||||||
group->addButton(btnExpand[i],i);
|
group->addButton(btnExpand[i],i);
|
||||||
|
|
||||||
//add the widgets to the layout , depending on the type create the widgets
|
|
||||||
gridLayout->addWidget(btnExpand[i],(i*2),0);
|
|
||||||
gridLayout->addWidget(lblName[i],(i*2),1);
|
|
||||||
|
|
||||||
if(i==NumPositions){
|
//add label and button to expand or collapse
|
||||||
|
gridLayout->addWidget(btnExpand[i],vIndent,hIndent,1,1);
|
||||||
|
gridLayout->addWidget(lblName[i],vIndent,hIndent+1,1,colspan);
|
||||||
|
|
||||||
|
//creating the action/scan/position widgets and adding them
|
||||||
|
switch(i){
|
||||||
|
case NumPositions:
|
||||||
CreatePositionsWidget();
|
CreatePositionsWidget();
|
||||||
gridLayout->addWidget(positionWidget,(i*2)+1,1,1,2);
|
gridLayout->addWidget(positionWidget,vIndent+1,hIndent+1,1,colspan);
|
||||||
positionWidget->hide();
|
positionWidget->hide();
|
||||||
}else if((i==Scan0)||(i==Scan1)){
|
break;
|
||||||
|
case Scan0:
|
||||||
|
case Scan1:
|
||||||
scanWidget[qScanWidget::NUM_SCAN_WIDGETS] = new qScanWidget(this,myDet);
|
scanWidget[qScanWidget::NUM_SCAN_WIDGETS] = new qScanWidget(this,myDet);
|
||||||
gridLayout->addWidget(scanWidget[qScanWidget::NUM_SCAN_WIDGETS-1],(i*2)+1,1,1,2);
|
gridLayout->addWidget(scanWidget[qScanWidget::NUM_SCAN_WIDGETS-1],vIndent+1,hIndent+1,1,colspan);
|
||||||
scanWidget[qScanWidget::NUM_SCAN_WIDGETS-1]->hide();
|
scanWidget[qScanWidget::NUM_SCAN_WIDGETS-1]->hide();
|
||||||
}else{
|
break;
|
||||||
|
default:
|
||||||
actionWidget[qActionsWidget::NUM_ACTION_WIDGETS] = new qActionsWidget(this,myDet);
|
actionWidget[qActionsWidget::NUM_ACTION_WIDGETS] = new qActionsWidget(this,myDet);
|
||||||
gridLayout->addWidget(actionWidget[qActionsWidget::NUM_ACTION_WIDGETS-1],(i*2)+1,1,1,2);
|
gridLayout->addWidget(actionWidget[qActionsWidget::NUM_ACTION_WIDGETS-1],vIndent+1,hIndent+1,1,colspan);
|
||||||
actionWidget[qActionsWidget::NUM_ACTION_WIDGETS-1]->hide();
|
actionWidget[qActionsWidget::NUM_ACTION_WIDGETS-1]->hide();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//incrementing the vertical and horizontal indent
|
||||||
|
vIndent+=2;
|
||||||
|
switch(i){
|
||||||
|
case HeaderBefore:
|
||||||
|
//real time acquisition
|
||||||
|
palette->setColor(QPalette::Active,QPalette::WindowText,QColor(0,0,200,255));
|
||||||
|
lblReal = new QLabel(" <b>Real Time Acquisition</b>");
|
||||||
|
lblReal->setFixedHeight(25);
|
||||||
|
//lblReal->setPalette(*palette);
|
||||||
|
gridLayout->addWidget(lblReal,vIndent,hIndent+1,1,colspan);
|
||||||
|
vIndent++;
|
||||||
|
break;
|
||||||
|
case HeaderAfter:
|
||||||
|
hIndent-=2;
|
||||||
|
colspan+=2;
|
||||||
|
break;
|
||||||
|
case ActionAfter:
|
||||||
|
hIndent=0;
|
||||||
|
colspan=6;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
hIndent++;
|
||||||
|
colspan--;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
//gridLayout->addWidget(btnExpand[i],(i*2),i);
|
|
||||||
//gridLayout->addWidget(lblName[i],(i*2),i+1);
|
|
||||||
//gridLayout->addWidget(actionWidget[i],(i*2)+1,i+1,1,2);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Number of positions is only for mythen or gotthard
|
//Number of positions is only for mythen or gotthard
|
||||||
detType = myDet->getDetectorsType();
|
detType = myDet->getDetectorsType();
|
||||||
if((detType == slsDetectorDefs::EIGER) || (detType == slsDetectorDefs::AGIPD)) {
|
if((detType == slsDetectorDefs::EIGER) || (detType == slsDetectorDefs::AGIPD)) {
|
||||||
@ -174,6 +208,7 @@ void qTabActions::SetupWidgetWindow(){
|
|||||||
void qTabActions::CreatePositionsWidget(){
|
void qTabActions::CreatePositionsWidget(){
|
||||||
positionWidget = new QWidget;
|
positionWidget = new QWidget;
|
||||||
positionWidget->setFixedHeight(25);
|
positionWidget->setFixedHeight(25);
|
||||||
|
positionWidget->setFixedWidth(680);
|
||||||
|
|
||||||
QGridLayout *layout = new QGridLayout(positionWidget);
|
QGridLayout *layout = new QGridLayout(positionWidget);
|
||||||
layout->setContentsMargins(0,0,0,0);
|
layout->setContentsMargins(0,0,0,0);
|
||||||
|
@ -64,6 +64,7 @@ void qTabDataOutput::SetupWidgetWindow(){
|
|||||||
QString("<nobr><font color=\"red\">"
|
QString("<nobr><font color=\"red\">"
|
||||||
"Enter a valid file to enable Flat Field.</font></nobr>");
|
"Enter a valid file to enable Flat Field.</font></nobr>");
|
||||||
|
|
||||||
|
outDirTip = dispOutputDir->toolTip();
|
||||||
|
|
||||||
Initialization();
|
Initialization();
|
||||||
|
|
||||||
@ -146,13 +147,29 @@ void qTabDataOutput::setOutputDir(){
|
|||||||
while(path.endsWith('/')) path.chop(1);
|
while(path.endsWith('/')) path.chop(1);
|
||||||
dispOutputDir->setText(path);
|
dispOutputDir->setText(path);
|
||||||
|
|
||||||
//if(QFile::exists(path))
|
if(QFile::exists(path)){
|
||||||
|
lblOutputDir->setText("Output Directory: ");
|
||||||
|
lblOutputDir->setPalette(chkRate->palette());
|
||||||
|
lblOutputDir->setToolTip(outDirTip);
|
||||||
|
dispOutputDir->setToolTip(outDirTip);
|
||||||
|
btnOutputBrowse->setToolTip(outDirTip);
|
||||||
|
|
||||||
|
myDet->setFilePath(string(path.toAscii().constData()));
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << "Output Directory changed to :"<<myDet->getFilePath() << endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
lblOutputDir->setText("Output Directory:*");
|
||||||
|
lblOutputDir->setPalette(red);
|
||||||
|
QString errTip = outDirTip +
|
||||||
|
QString("<nobr><font color=\"red\">"
|
||||||
|
"Enter a valid path to change <b>Output Directory</b>.</font></nobr>");
|
||||||
|
lblOutputDir->setToolTip(errTip);
|
||||||
|
dispOutputDir->setToolTip(errTip);
|
||||||
|
btnOutputBrowse->setToolTip(errTip);
|
||||||
|
}
|
||||||
|
|
||||||
myDet->setFilePath(string(path.toAscii().constData()));
|
|
||||||
#ifdef VERBOSE
|
|
||||||
cout << "Output Directory changed to :"<<myDet->getFilePath() << endl;
|
|
||||||
#endif
|
|
||||||
connect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(setOutputDir()));
|
connect(dispOutputDir, SIGNAL(editingFinished()), this, SLOT(setOutputDir()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -454,7 +471,11 @@ void qTabDataOutput::Refresh(){
|
|||||||
cout << "Getting output directory" << endl;
|
cout << "Getting output directory" << endl;
|
||||||
#endif
|
#endif
|
||||||
dispOutputDir->setText(QString(myDet->getFilePath().c_str()));
|
dispOutputDir->setText(QString(myDet->getFilePath().c_str()));
|
||||||
|
lblOutputDir->setText("Output Directory: ");
|
||||||
|
lblOutputDir->setPalette(chkRate->palette());
|
||||||
|
lblOutputDir->setToolTip(outDirTip);
|
||||||
|
dispOutputDir->setToolTip(outDirTip);
|
||||||
|
btnOutputBrowse->setToolTip(outDirTip);
|
||||||
|
|
||||||
//flat field correction from server
|
//flat field correction from server
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
|
@ -71,14 +71,14 @@ void qTabDeveloper::SetupWidgetWindow(){
|
|||||||
case slsDetectorDefs::GOTTHARD:
|
case slsDetectorDefs::GOTTHARD:
|
||||||
NUM_DAC_WIDGETS = 8;
|
NUM_DAC_WIDGETS = 8;
|
||||||
NUM_ADC_WIDGETS = 2;
|
NUM_ADC_WIDGETS = 2;
|
||||||
dacNames.push_back("Reference Voltage:");
|
dacNames.push_back("v Reference:");
|
||||||
dacNames.push_back("Cascade n Voltage:");
|
dacNames.push_back("v Cascode n:");
|
||||||
dacNames.push_back("Cascade p Voltage:");
|
dacNames.push_back("v Cascode p:");
|
||||||
dacNames.push_back("Comp. Output Voltage:");
|
dacNames.push_back("v Comp. Output:");
|
||||||
dacNames.push_back("Cascade out Voltage:");
|
dacNames.push_back("v Cascode out");
|
||||||
dacNames.push_back("Comp. Input Voltage:");
|
dacNames.push_back("v Comp. Input:");
|
||||||
dacNames.push_back("Comp. Ref Voltage:");
|
dacNames.push_back("v Comp. Ref:");
|
||||||
dacNames.push_back("Base Test Current:");
|
dacNames.push_back("i Base Test:");
|
||||||
|
|
||||||
adcNames.push_back("Temperature ADC:");
|
adcNames.push_back("Temperature ADC:");
|
||||||
adcNames.push_back("Temperature FPGA:");
|
adcNames.push_back("Temperature FPGA:");
|
||||||
@ -194,6 +194,7 @@ void qTabDeveloper::CreateADCWidgets(){
|
|||||||
lblAdcs[i] = new QLabel(QString(adcNames[i].c_str()),boxAdcs);
|
lblAdcs[i] = new QLabel(QString(adcNames[i].c_str()),boxAdcs);
|
||||||
spinAdcs[i] = new QDoubleSpinBox(boxAdcs);
|
spinAdcs[i] = new QDoubleSpinBox(boxAdcs);
|
||||||
spinAdcs[i]->setMaximum(10000);
|
spinAdcs[i]->setMaximum(10000);
|
||||||
|
if(detType==slsDetectorDefs::GOTTHARD) spinAdcs[i]->setSuffix(0x00b0+QString("C"));
|
||||||
|
|
||||||
adcLayout->addWidget(lblAdcs[i],(int)(i/2),((i%2)==0)?1:4);
|
adcLayout->addWidget(lblAdcs[i],(int)(i/2),((i%2)==0)?1:4);
|
||||||
adcLayout->addWidget(spinAdcs[i],(int)(i/2),((i%2)==0)?2:5);
|
adcLayout->addWidget(spinAdcs[i],(int)(i/2),((i%2)==0)?2:5);
|
||||||
|
@ -364,7 +364,7 @@ void qTabMeasurement::SetCurrentMeasurement(int val){
|
|||||||
|
|
||||||
void qTabMeasurement::UpdateProgress(){
|
void qTabMeasurement::UpdateProgress(){
|
||||||
progressBar->setValue((int)myPlot->GetProgress());
|
progressBar->setValue((int)myPlot->GetProgress());
|
||||||
lblProgressIndex->setText(QString::number(myPlot->GetFileIndex()+1));
|
lblProgressIndex->setText(QString::number(myPlot->GetFileIndex()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -728,6 +728,7 @@ void qTabMeasurement::EnableFileWrite(bool enable){
|
|||||||
myDet->enableWriteToFile(enable);
|
myDet->enableWriteToFile(enable);
|
||||||
dispFileName->setEnabled(enable);
|
dispFileName->setEnabled(enable);
|
||||||
if(enable) setFileName(dispFileName->text());
|
if(enable) setFileName(dispFileName->text());
|
||||||
|
myPlot->SetEnableFileWrite(enable);
|
||||||
};
|
};
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user