mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-09 03:20:42 +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)){
|
||||
/** value retains the old value */
|
||||
value = newVal;
|
||||
newVal = value/60;
|
||||
newVal = value/(double)60;
|
||||
intUnit--;
|
||||
}
|
||||
/** returning the previous value*/
|
||||
@ -128,7 +128,7 @@ static const int64_t GUI_VERSION=0x20121213;
|
||||
/** ms, us, ns */
|
||||
else{
|
||||
while((value<1)&&(intUnit<(int)NANOSECONDS)){
|
||||
value = value*1000;
|
||||
value = value*(double)1000;
|
||||
intUnit++;
|
||||
}
|
||||
unit = (timeUnit)(intUnit);
|
||||
|
@ -784,6 +784,13 @@ void qTabMeasurement::Refresh(){
|
||||
#ifdef VERBOSE
|
||||
cout << "Getting number of frames" << endl;
|
||||
#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
|
||||
qDefs::timeUnit unit;
|
||||
double time = qDefs::getCorrectTime(unit,((double)(myDet->setTimer(slsDetectorDefs::ACQUISITION_TIME,-1)*(1E-9))));
|
||||
@ -792,7 +799,6 @@ void qTabMeasurement::Refresh(){
|
||||
#ifdef VERBOSE
|
||||
cout << "Getting Exposure time" << endl;
|
||||
#endif
|
||||
|
||||
//period
|
||||
time = qDefs::getCorrectTime(unit,((double)(myDet->setTimer(slsDetectorDefs::FRAME_PERIOD,-1)*(1E-9))));
|
||||
spinPeriod->setValue(time);
|
||||
@ -800,13 +806,22 @@ void qTabMeasurement::Refresh(){
|
||||
#ifdef VERBOSE
|
||||
cout << "Getting Acquisition Period" << endl;
|
||||
#endif
|
||||
|
||||
//Number of Triggers
|
||||
spinNumTriggers->setValue((int)myDet->setTimer(slsDetectorDefs::CYCLES_NUMBER,-1));
|
||||
#ifdef VERBOSE
|
||||
cout << "Getting number of triggers" << endl;
|
||||
#endif
|
||||
|
||||
double acqtimeNS = qDefs::getNSTime((qDefs::timeUnit)comboPeriodUnit->currentIndex(),spinPeriod->value());
|
||||
double exptimeNS = qDefs::getNSTime((qDefs::timeUnit)comboExpUnit->currentIndex(),spinExpTime->value());
|
||||
if(exptimeNS>acqtimeNS){
|
||||
spinPeriod->setToolTip(errPeriodTip);
|
||||
lblPeriod->setToolTip(errPeriodTip);
|
||||
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
|
||||
time = qDefs::getCorrectTime(unit,((double)(myDet->setTimer(slsDetectorDefs::DELAY_AFTER_TRIGGER,-1)*(1E-9))));
|
||||
spinDelay->setValue(time);
|
||||
@ -814,6 +829,19 @@ void qTabMeasurement::Refresh(){
|
||||
#ifdef VERBOSE
|
||||
cout << "Getting delay after trigger" << endl;
|
||||
#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
|
||||
spinNumGates->setValue((int)myDet->setTimer(slsDetectorDefs::GATES_NUMBER,-1));
|
||||
|
Loading…
x
Reference in New Issue
Block a user