trim tab works except for graph

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@51 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
l_maliakal_d
2012-09-07 08:17:16 +00:00
parent b67f3a83d8
commit a4a0237711
20 changed files with 776 additions and 303 deletions

View File

@ -10,8 +10,8 @@
/** Qt Project Class Headers */
class SlsQtH1D;
class SlsQt1DPlot;
class SlsQt2DPlotLayout;
#include "SlsQt1DPlot.h"
#include "SlsQt2DPlotLayout.h"
/** Qt Include Headers */
#include <QMainWindow>
#include <QMenu>
@ -29,6 +29,7 @@ class SlsQt2DPlotLayout;
#include <QCheckBox>
/** C++ Include Headers */
#include <string>
#include <iostream>
using namespace std;
/**
@ -78,6 +79,16 @@ public:
* */
void SetCloneHists(int nHists,int histNBins,double* histXAxis,double* histYAxis,string histTitle[],bool lines,bool markers);
/**Set the range of the 1d plot
* @param IsXYRange array of x,y,min,max if these values are set
* @param XYRangeValues array of set values of x,y, min, max
*/
void SetRange(bool IsXYRange[], double XYRangeValues[]);
/** Returns the 1d plot
*/
SlsQt1DPlot* Get1dPlot(){return cloneplot1D;};
public slots:
/** Save Plots automatically by save all clones
* returns -1 if fail*/

View File

@ -26,6 +26,16 @@ public:
OK,
FAIL
};
//-------------------------------------------------------------------------------------------------------------------------------------------------
enum MessageIndex{
WARNING,
CRITICAL,
INFORMATION,
QUESTION
};
//-------------------------------------------------------------------------------------------------------------------------------------------------
/** unit of time
*/
@ -112,46 +122,35 @@ public:
//-------------------------------------------------------------------------------------------------------------------------------------------------
/**displays an warning message
* @param warningMessage the message to be displayed
* @param source is the tab or the source of the warning
/**displays an warning,error,info message
* @param message the message to be displayed
* @param source is the tab or the source of the message
* */
static void WarningMessage(string warningMessage,string source)
{
static QMessageBox* warningBox;
source.append(": WARNING");
warningBox= new QMessageBox(QMessageBox::Warning,source.c_str(),tr(warningMessage.c_str()),QMessageBox::Ok, warningBox);
warningBox->exec();
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
/**displays an error message
* @param errorMessage the message to be displayed
* @param source is the tab or the source of the error
* */
static void ErrorMessage(string errorMessage,string source)
{
static QMessageBox* errorBox;
source.append(": ERROR");
errorBox= new QMessageBox(QMessageBox::Critical,source.c_str(),tr(errorMessage.c_str()),QMessageBox::Ok, errorBox);
errorBox->exec();
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
/**displays an information message
* @param infoMessage the message to be displayed
* @param source is the tab or the source of the information
* */
static void InfoMessage(string infoMessage,string source)
static int Message(MessageIndex index, string message,string source)
{
static QMessageBox* msgBox;
source.append(": INFORMATION");
msgBox= new QMessageBox(QMessageBox::Information,source.c_str(),tr(infoMessage.c_str()),QMessageBox::Ok, msgBox);
msgBox->exec();
switch(index){
case WARNING:
source.append(": WARNING");
msgBox= new QMessageBox(QMessageBox::Warning,source.c_str(),tr(message.c_str()),QMessageBox::Ok, msgBox);
break;
case CRITICAL:
source.append(": CRITICAL");
msgBox= new QMessageBox(QMessageBox::Critical,source.c_str(),tr(message.c_str()),QMessageBox::Ok, msgBox);
break;
case INFORMATION:
source.append(": INFORMATION");
msgBox= new QMessageBox(QMessageBox::Information,source.c_str(),tr(message.c_str()),QMessageBox::Ok, msgBox);
break;
default:
source.append(": QUESTION");
msgBox= new QMessageBox(QMessageBox::Question,source.c_str(),tr(message.c_str()),QMessageBox::Ok| QMessageBox::Cancel, msgBox);
break;
}
if(msgBox->exec()==QMessageBox::Ok) return OK; else return FAIL;
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
/** range of x and y axes

View File

@ -15,8 +15,6 @@ class multiSlsDetector;
#include "SlsQt1DPlot.h"
#include "SlsQt2DPlotLayout.h"
#include "qDefs.h"
class SlsQt1DPlot;
class SlsQt2DPlotLayout;
class qCloneWidget;
/** Qt Include Headers */
#include <QWidget>
@ -218,8 +216,8 @@ void UpdatePause(){data_pause_over=true;};
/** Shows the first save error message while automatic saving
* @param fileName file name of the first file that it tried to save.*/
void ShowSaveErrorMessage(QString fileName);
/**Shows an error message when acquisition stopped unexpectedly*/
void ShowAcquisitionErrorMessage();
private:
@ -405,6 +403,7 @@ void SetZRangeSignal(double,double);
void EnableZRangeSignal(bool);
void SetCurrentMeasurementSignal(int);
void saveErrorSignal(QString);
void AcquisitionErrorSignal();
};

View File

@ -12,6 +12,7 @@
#include "ui_form_tab_advanced.h"
/** Project Class Headers */
class multiSlsDetector;
#include "sls_detector_defs.h"
/** Qt Include Header */
#include <QStackedLayout>
@ -37,6 +38,7 @@ public:
void Refresh();
private:
/** Sets up the widget
*/
@ -47,14 +49,59 @@ private:
void Initialization();
private slots:
/** Enable/Disable Energy and Calibration Logs
*/
void SetLogs();
/** Set acquisition time
*/
void SetExposureTime();
/** Set the Threshold dac value
*/
void SetThreshold();
/** Set output directory for trimming
*/
void SetOutputFile();
/** Browse output directory for trimming
*/
void BrowseOutputFile();
/** Enables trimming method and calls SetTrimmingMethod if enabled
* @param enable to enable trimming
*/
void EnableTrimming(bool enable);
/** Enabling resolution and Counts if this is enabled
* @param enable to enable
*/
void SetOptimize(bool enable);
/** Sets the trimming method
* @param mode trimming method
*/
void SetTrimmingMethod(int mode);
/** Ensures the right trimming mode and Executes Trimming
*/
void StartTrimming();
private:
/** The sls detector object */
multiSlsDetector *myDet;
/** Tool Tip for the output dir */
QString outputDirTip;
QString errOutputTip;
QPalette red;
/** Trimming mode */
slsDetectorDefs::trimMode trimmingMode;
private slots:
/** Enable/Disable Energy and Calibration Logs
*/
void SetLogs();
};