mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-09 11:30:43 +02:00
fixed problem of period beign recalculated for each refresh
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@244 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
parent
b9fcbf4697
commit
c32acebc35
@ -118,7 +118,7 @@ static const int64_t GUI_VERSION=0x20121213;
|
|||||||
while((newVal>=1)&&(intUnit>=(int)HOURS)){
|
while((newVal>=1)&&(intUnit>=(int)HOURS)){
|
||||||
/** value retains the old value */
|
/** value retains the old value */
|
||||||
value = newVal;
|
value = newVal;
|
||||||
newVal = value/60;
|
newVal = value/(double)60;
|
||||||
intUnit--;
|
intUnit--;
|
||||||
}
|
}
|
||||||
/** returning the previous value*/
|
/** returning the previous value*/
|
||||||
@ -128,7 +128,7 @@ static const int64_t GUI_VERSION=0x20121213;
|
|||||||
/** ms, us, ns */
|
/** ms, us, ns */
|
||||||
else{
|
else{
|
||||||
while((value<1)&&(intUnit<(int)NANOSECONDS)){
|
while((value<1)&&(intUnit<(int)NANOSECONDS)){
|
||||||
value = value*1000;
|
value = value*(double)1000;
|
||||||
intUnit++;
|
intUnit++;
|
||||||
}
|
}
|
||||||
unit = (timeUnit)(intUnit);
|
unit = (timeUnit)(intUnit);
|
||||||
|
@ -784,6 +784,13 @@ void qTabMeasurement::Refresh(){
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "Getting number of frames" << endl;
|
cout << "Getting number of frames" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
//to prevent it from recalculating forever
|
||||||
|
disconnect(spinExpTime,SIGNAL(valueChanged(double)), this, SLOT(setExposureTime()));
|
||||||
|
disconnect(comboExpUnit,SIGNAL(currentIndexChanged(int)), this, SLOT(setExposureTime()));
|
||||||
|
disconnect(spinPeriod,SIGNAL(valueChanged(double)), this, SLOT(setAcquisitionPeriod()));
|
||||||
|
disconnect(comboPeriodUnit,SIGNAL(currentIndexChanged(int)), this, SLOT(setAcquisitionPeriod()));
|
||||||
|
disconnect(spinDelay,SIGNAL(valueChanged(double)), this, SLOT(setDelay()));
|
||||||
|
disconnect(comboDelayUnit,SIGNAL(currentIndexChanged(int)), this, SLOT(setDelay()));
|
||||||
//Exp Time
|
//Exp Time
|
||||||
qDefs::timeUnit unit;
|
qDefs::timeUnit unit;
|
||||||
double time = qDefs::getCorrectTime(unit,((double)(myDet->setTimer(slsDetectorDefs::ACQUISITION_TIME,-1)*(1E-9))));
|
double time = qDefs::getCorrectTime(unit,((double)(myDet->setTimer(slsDetectorDefs::ACQUISITION_TIME,-1)*(1E-9))));
|
||||||
@ -792,7 +799,6 @@ void qTabMeasurement::Refresh(){
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "Getting Exposure time" << endl;
|
cout << "Getting Exposure time" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//period
|
//period
|
||||||
time = qDefs::getCorrectTime(unit,((double)(myDet->setTimer(slsDetectorDefs::FRAME_PERIOD,-1)*(1E-9))));
|
time = qDefs::getCorrectTime(unit,((double)(myDet->setTimer(slsDetectorDefs::FRAME_PERIOD,-1)*(1E-9))));
|
||||||
spinPeriod->setValue(time);
|
spinPeriod->setValue(time);
|
||||||
@ -800,13 +806,22 @@ void qTabMeasurement::Refresh(){
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "Getting Acquisition Period" << endl;
|
cout << "Getting Acquisition Period" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
double acqtimeNS = qDefs::getNSTime((qDefs::timeUnit)comboPeriodUnit->currentIndex(),spinPeriod->value());
|
||||||
//Number of Triggers
|
double exptimeNS = qDefs::getNSTime((qDefs::timeUnit)comboExpUnit->currentIndex(),spinExpTime->value());
|
||||||
spinNumTriggers->setValue((int)myDet->setTimer(slsDetectorDefs::CYCLES_NUMBER,-1));
|
if(exptimeNS>acqtimeNS){
|
||||||
#ifdef VERBOSE
|
spinPeriod->setToolTip(errPeriodTip);
|
||||||
cout << "Getting number of triggers" << endl;
|
lblPeriod->setToolTip(errPeriodTip);
|
||||||
#endif
|
lblPeriod->setPalette(red);
|
||||||
|
lblPeriod->setText("Acquisition Period:*");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
spinPeriod->setToolTip(acqPeriodTip);
|
||||||
|
lblPeriod->setToolTip(acqPeriodTip);
|
||||||
|
lblPeriod->setPalette(lblTimingMode->palette());
|
||||||
|
lblPeriod->setText("Acquisition Period:");
|
||||||
|
}
|
||||||
|
//Check if the interval between plots is ok
|
||||||
|
emit CheckPlotIntervalSignal();
|
||||||
//delay
|
//delay
|
||||||
time = qDefs::getCorrectTime(unit,((double)(myDet->setTimer(slsDetectorDefs::DELAY_AFTER_TRIGGER,-1)*(1E-9))));
|
time = qDefs::getCorrectTime(unit,((double)(myDet->setTimer(slsDetectorDefs::DELAY_AFTER_TRIGGER,-1)*(1E-9))));
|
||||||
spinDelay->setValue(time);
|
spinDelay->setValue(time);
|
||||||
@ -814,6 +829,19 @@ void qTabMeasurement::Refresh(){
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "Getting delay after trigger" << endl;
|
cout << "Getting delay after trigger" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
connect(spinExpTime,SIGNAL(valueChanged(double)), this, SLOT(setExposureTime()));
|
||||||
|
connect(comboExpUnit,SIGNAL(currentIndexChanged(int)), this, SLOT(setExposureTime()));
|
||||||
|
connect(spinPeriod,SIGNAL(valueChanged(double)), this, SLOT(setAcquisitionPeriod()));
|
||||||
|
connect(comboPeriodUnit,SIGNAL(currentIndexChanged(int)), this, SLOT(setAcquisitionPeriod()));
|
||||||
|
connect(spinDelay,SIGNAL(valueChanged(double)), this, SLOT(setDelay()));
|
||||||
|
connect(comboDelayUnit,SIGNAL(currentIndexChanged(int)), this, SLOT(setDelay()));
|
||||||
|
|
||||||
|
|
||||||
|
//Number of Triggers
|
||||||
|
spinNumTriggers->setValue((int)myDet->setTimer(slsDetectorDefs::CYCLES_NUMBER,-1));
|
||||||
|
#ifdef VERBOSE
|
||||||
|
cout << "Getting number of triggers" << endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
//gates
|
//gates
|
||||||
spinNumGates->setValue((int)myDet->setTimer(slsDetectorDefs::GATES_NUMBER,-1));
|
spinNumGates->setValue((int)myDet->setTimer(slsDetectorDefs::GATES_NUMBER,-1));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user