mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-21 17:18:00 +02:00
set current measurement dont work
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@17 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
@ -206,29 +206,26 @@ void qDetectorMain::SetUpDetector(){
|
||||
|
||||
void qDetectorMain::Initialization(){
|
||||
/** Dockable Plot*/
|
||||
connect(dockWidgetPlot,SIGNAL(topLevelChanged(bool)),this,SLOT(ResizeMainWindow(bool)));
|
||||
|
||||
connect(dockWidgetPlot, SIGNAL(topLevelChanged(bool)), this,SLOT(ResizeMainWindow(bool)));
|
||||
/** tabs */
|
||||
connect(tabs,SIGNAL(currentChanged(int)),this, SLOT(Refresh(int)));//( QWidget*)));
|
||||
connect(tabs, SIGNAL(currentChanged(int)), this, SLOT(Refresh(int)));//( QWidget*)));
|
||||
/** Measurement tab*/
|
||||
connect(tab_measurement, SIGNAL(StartSignal()), this,SLOT(EnableTabs()));
|
||||
connect(tab_measurement, SIGNAL(StopSignal()), this,SLOT(EnableTabs()));
|
||||
/** Plot tab */
|
||||
connect(tab_plot,SIGNAL(DisableZoomSignal(bool)),this, SLOT(SetZoomToolTip(bool)));
|
||||
|
||||
connect(tab_plot, SIGNAL(DisableZoomSignal(bool)), this,SLOT(SetZoomToolTip(bool)));
|
||||
/** 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()));
|
||||
|
||||
|
||||
/** When the acquisition is finished, must update the meas tab */
|
||||
connect(myPlot, SIGNAL(UpdatingPlotFinished()), this, SLOT(EnableTabs()));
|
||||
connect(myPlot, SIGNAL(UpdatingPlotFinished()), tab_measurement, SLOT(UpdateFinished()));
|
||||
connect(myPlot, SIGNAL(SetCurrentMeasurementSignal(int)), tab_measurement, SLOT(SetCurrentMeasurement(int)));
|
||||
/** menubar */
|
||||
/** Modes Menu */
|
||||
connect(menuModes,SIGNAL(triggered(QAction*)),SLOT(EnableModes(QAction*)));
|
||||
/** Utilities Menu */
|
||||
connect(menuUtilities,SIGNAL(triggered(QAction*)),SLOT(ExecuteUtilities(QAction*)));
|
||||
/** Help Menu */
|
||||
connect(menuHelp,SIGNAL(triggered(QAction*)),SLOT(ExecuteHelp(QAction*)));
|
||||
/** Modes Menu */
|
||||
connect(menuModes, SIGNAL(triggered(QAction*)), this,SLOT(EnableModes(QAction*)));
|
||||
/** Utilities Menu */
|
||||
connect(menuUtilities, SIGNAL(triggered(QAction*)), this,SLOT(ExecuteUtilities(QAction*)));
|
||||
/** Help Menu */
|
||||
connect(menuHelp, SIGNAL(triggered(QAction*)), this,SLOT(ExecuteHelp(QAction*)));
|
||||
}
|
||||
|
||||
|
||||
|
@ -158,6 +158,7 @@ void qDrawPlot::StartStopDaqToggle(bool stop_if_running){
|
||||
/**Do the following only once before each n measurements */
|
||||
/** Reset Current Measurement */
|
||||
currentMeasurement = 0;
|
||||
emit SetCurrentMeasurementSignal(currentMeasurement);
|
||||
/** Number of Exposures */
|
||||
number_of_exposures= (int)myDet->setTimer(slsDetectorDefs::FRAME_NUMBER,-1);
|
||||
cout<<"\tNumber of Exposures:"<<number_of_exposures<<endl;
|
||||
@ -432,8 +433,8 @@ void qDrawPlot::UpdatePlot(){
|
||||
}
|
||||
/** if a measurement is over */
|
||||
else{
|
||||
emit SetCurrentMeasurementSignal(currentMeasurement);
|
||||
currentMeasurement++;
|
||||
cout<<"currentMeausremet:"<<currentMeasurement<<endl;
|
||||
/** if all the measurements are over */
|
||||
if(currentMeasurement==number_of_measurements){
|
||||
StartStopDaqToggle(true);
|
||||
|
@ -24,6 +24,7 @@ using namespace std;
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
qTabMeasurement::qTabMeasurement(QWidget *parent,slsDetectorUtils*& detector, qDrawPlot*& plot):
|
||||
QWidget(parent),myDet(detector),myPlot(plot){
|
||||
setupUi(this);
|
||||
@ -32,15 +33,19 @@ qTabMeasurement::qTabMeasurement(QWidget *parent,slsDetectorUtils*& detector, qD
|
||||
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
qTabMeasurement::~qTabMeasurement(){
|
||||
delete myDet;
|
||||
delete myPlot;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::SetupWidgetWindow(){
|
||||
/** Timer to update the progress bar **/
|
||||
progressTimer = new QTimer(this);
|
||||
@ -65,8 +70,10 @@ void qTabMeasurement::SetupWidgetWindow(){
|
||||
SetupTimingMode();
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::SetupTimingMode(){
|
||||
/** Get timing mode from detector*/
|
||||
slsDetectorDefs::externalCommunicationMode mode = myDet->setExternalCommunicationMode();
|
||||
@ -148,8 +155,10 @@ void qTabMeasurement::SetupTimingMode(){
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::Initialization(int timingChange){
|
||||
/** These signals are connected only at start up. The others are reinitialized when changing timing mode*/
|
||||
if(!timingChange){
|
||||
@ -183,11 +192,12 @@ void qTabMeasurement::Initialization(int timingChange){
|
||||
connect(spinNumGates,SIGNAL(valueChanged(int)), this, SLOT(setNumGates(int)));//
|
||||
/** Number of Probes**/
|
||||
connect(spinNumProbes,SIGNAL(valueChanged(int)), this, SLOT(setNumProbes(int)));//
|
||||
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::DeInitialization(){
|
||||
/** Number of Frames**/
|
||||
disconnect(spinNumFrames,SIGNAL(valueChanged(int)), this, SLOT(setNumFrames(int)));
|
||||
@ -208,8 +218,10 @@ void qTabMeasurement::DeInitialization(){
|
||||
disconnect(spinNumProbes,SIGNAL(valueChanged(int)), this, SLOT(setNumProbes(int)));
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::Enable(bool enable){
|
||||
frameTimeResolved->setEnabled(enable);
|
||||
frameNotTimeResolved->setEnabled(enable);
|
||||
@ -217,8 +229,10 @@ void qTabMeasurement::Enable(bool enable){
|
||||
if(!enable) btnStartStop->setEnabled(true);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::setFileName(const QString& fName){
|
||||
myDet->setFileName(fName.toAscii().data());
|
||||
#ifdef VERBOSE
|
||||
@ -226,6 +240,7 @@ void qTabMeasurement::setFileName(const QString& fName){
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabMeasurement::setRunIndex(int index){
|
||||
@ -238,6 +253,7 @@ void qTabMeasurement::setRunIndex(int index){
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::startStopAcquisition(){
|
||||
if(!btnStartStop->text().compare("Start")){
|
||||
#ifdef VERBOSE
|
||||
@ -265,8 +281,10 @@ void qTabMeasurement::startStopAcquisition(){
|
||||
myPlot->StartStopDaqToggle();
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::UpdateFinished(){
|
||||
disconnect(btnStartStop,SIGNAL(clicked()),this,SLOT(startStopAcquisition()));
|
||||
btnStartStop->setText("Start");
|
||||
@ -278,15 +296,28 @@ void qTabMeasurement::UpdateFinished(){
|
||||
progressTimer->stop();
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void SetCurrentMeasurement(int val){
|
||||
lblCurrentMeasurement->setText("0u");//lblCurrentMeasurement->setText(QString::number(val));
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::UpdateProgress(){
|
||||
|
||||
progressBar->setValue(myPlot->GetProgress());
|
||||
lblProgressIndex->setText(QString::number(myDet->getFileIndex()));
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::setNumFrames(int val){
|
||||
myDet->setTimer(slsDetectorDefs::FRAME_NUMBER,val);
|
||||
#ifdef VERBOSE
|
||||
@ -295,8 +326,10 @@ void qTabMeasurement::setNumFrames(int val){
|
||||
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::setExposureTime(){
|
||||
int64_t exptimeNS;
|
||||
/** Get the value of timer in ns **/
|
||||
@ -322,8 +355,10 @@ void qTabMeasurement::setExposureTime(){
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::setAcquisitionPeriod(){
|
||||
int64_t acqtimeNS;
|
||||
/** Get the value of timer in ns **/
|
||||
@ -347,8 +382,10 @@ void qTabMeasurement::setAcquisitionPeriod(){
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::setNumTriggers(int val){
|
||||
myDet->setTimer(slsDetectorDefs::CYCLES_NUMBER,val);
|
||||
#ifdef VERBOSE
|
||||
@ -356,8 +393,10 @@ void qTabMeasurement::setNumTriggers(int val){
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::setDelay(){
|
||||
int64_t exptimeNS;
|
||||
/** Get the value of timer in ns **/
|
||||
@ -368,8 +407,10 @@ void qTabMeasurement::setDelay(){
|
||||
myDet->setTimer(slsDetectorDefs::DELAY_AFTER_TRIGGER,exptimeNS);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::setNumGates(int val){
|
||||
myDet->setTimer(slsDetectorDefs::GATES_NUMBER,val);
|
||||
#ifdef VERBOSE
|
||||
@ -377,8 +418,10 @@ void qTabMeasurement::setNumGates(int val){
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::setNumProbes(int val){
|
||||
myDet->setTimer(slsDetectorDefs::PROBES_NUMBER,val);
|
||||
#ifdef VERBOSE
|
||||
@ -386,8 +429,10 @@ void qTabMeasurement::setNumProbes(int val){
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::setTimingMode(int mode){
|
||||
#ifdef VERBOSE
|
||||
cout<<"Setting Timing mode to " << comboTimingMode->currentText().toAscii().data()<<endl;
|
||||
@ -570,8 +615,6 @@ void qTabMeasurement::setTimingMode(int mode){
|
||||
|
||||
/** To reconnect all the signals after changing their values*/
|
||||
Initialization(1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -586,7 +629,7 @@ void qTabMeasurement::Refresh(){
|
||||
/** progress label index **/
|
||||
lblProgressIndex->setText(QString::number(myDet->getFileIndex()));
|
||||
/** Progress bar **/
|
||||
progressBar->setValue(myDet->getCurrentProgress());
|
||||
progressBar->setValue((int)myDet->getCurrentProgress());
|
||||
/** Timing mode**/
|
||||
SetupTimingMode();//comboTimingMode->setCurrentIndex((int)myDet->setExternalCommunicationMode());
|
||||
}
|
||||
|
@ -332,8 +332,8 @@ void qTabPlot::SetPlot(){
|
||||
}else if(radioHistogram->isChecked()){
|
||||
myPlot->EnablePlot(true);
|
||||
/**if enable is true, disable everything */
|
||||
box1D->setEnabled(true);
|
||||
box2D->setEnabled(true);
|
||||
box1D->setEnabled(isOneD);
|
||||
box2D->setEnabled(!isOneD);
|
||||
boxSnapshot->setEnabled(true);
|
||||
boxSave->setEnabled(true);
|
||||
boxPlotAxis->setEnabled(true);
|
||||
@ -341,8 +341,8 @@ void qTabPlot::SetPlot(){
|
||||
}else{
|
||||
myPlot->EnablePlot(true);
|
||||
/**if enable is true, disable everything */
|
||||
box1D->setEnabled(true);
|
||||
box2D->setEnabled(true);
|
||||
box1D->setEnabled(isOneD);
|
||||
box2D->setEnabled(!isOneD);
|
||||
boxSnapshot->setEnabled(true);
|
||||
boxSave->setEnabled(true);
|
||||
boxPlotAxis->setEnabled(true);
|
||||
|
Reference in New Issue
Block a user