enhancement:nth frame changed to red, instead of error and changing it back

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@89 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
l_maliakal_d 2012-10-11 08:36:11 +00:00
parent ad171a3257
commit f4dc6aab22
3 changed files with 77 additions and 26 deletions

View File

@ -231,6 +231,9 @@
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="suffix">
<string/>
</property>
@ -277,6 +280,9 @@
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="decimals">
<number>9</number>
</property>
@ -385,6 +391,9 @@
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="suffix">
<string/>
</property>
@ -443,6 +452,9 @@
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="suffix">
<string/>
</property>
@ -545,6 +557,9 @@
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="suffix">
<string/>
</property>
@ -597,6 +612,9 @@ Exposure Time of a frame.
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="decimals">
<number>5</number>
</property>
@ -705,6 +723,9 @@ Frame period between exposures.
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="decimals">
<number>5</number>
</property>
@ -854,6 +875,9 @@ Frame period between exposures.
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="suffix">
<string/>
</property>
@ -913,6 +937,9 @@ Frame period between exposures.
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="suffix">
<string/>
</property>

View File

@ -755,8 +755,8 @@ int qDrawPlot::GetData(detectorData *data){
}
pthread_mutex_unlock(&(last_image_complete_mutex));
}
cout<<"currentframe:"<<currentFrame<<"\tcurrentfileIndex:"<<currentFileIndex<<endl;
currentFrame++;
}
#ifdef VERYVERBOSE
cout << "Exiting GetData function" << endl;

View File

@ -443,6 +443,34 @@ void qTabPlot::SetFrequency(){
char cMin[200];
sprintf(cMin,"%f ms",minPlotTimer);
acqPeriodMS = (myDet->setTimer(slsDetectorDefs::FRAME_PERIOD,-1)*(1E-6));
//if period is 0, check exptime, if that is also 0, give warning and set to min timer
if(acqPeriodMS==0){
acqPeriodMS = (myDet->setTimer(slsDetectorDefs::ACQUISITION_TIME,-1)*(1E-6));
if(acqPeriodMS==0){
qDefs::Message(qDefs::WARNING,"<nobr>Interval between Plots:</nobr><br><nobr>"
"<b>Every Nth Image</b>: Period betwen Frames and Exposure Time cannot both be 0 ms.</nobr><br><nobr>"
"Resetting to minimum plotting time interval","Plot");
comboFrequency->setCurrentIndex(0);
stackedLayout->setCurrentIndex(comboFrequency->currentIndex());
spinTimeGap->setValue(minPlotTimer);
comboTimeGapUnit->setCurrentIndex(qDefs::MILLISECONDS);
timeMS=minPlotTimer;
//This is done so that its known which one was selected
myPlot->SetFrameFactor(0);
// Setting the timer value(ms) between plots
myPlot->SetPlotTimer(timeMS);
connect(comboTimeGapUnit,SIGNAL(currentIndexChanged(int)), this, SLOT(SetFrequency()));
connect(spinTimeGap, SIGNAL(editingFinished()), this, SLOT(SetFrequency()));
connect(spinNthFrame, SIGNAL(editingFinished()), this, SLOT(SetFrequency()));
connect(comboFrequency, SIGNAL(currentIndexChanged(int)), this, SLOT(SetFrequency()));
return;
}
}
stackedLayout->setCurrentIndex(comboFrequency->currentIndex());
switch(comboFrequency->currentIndex()){
case 0:
@ -457,16 +485,29 @@ void qTabPlot::SetFrequency(){
timeMS=minPlotTimer;
}
//show red for warning
//show red if min interval<minplottimer
if(timeMS<minPlotTimer){
qDefs::Message(qDefs::WARNING,"<nobr>Interval between Plots: You might be losing Images!</nobr>","Plot");
//qDefs::Message(qDefs::WARNING,"<nobr>Interval between Plots: You might be losing Images!</nobr>","Plot");
boxFrequency->setPalette(*red);
boxFrequency->setTitle("Interval between Plots*");
QString errTip = intervalTip + QString("<br><br><font color=\"red\"><nobr>"
"<b>Time Interval</b> Condition: min of ")+QString("%1").arg(minPlotTimer)+
QString("ms.</nobr><br><nobr>You might be losing images!</nobr></font>");
boxFrequency->setToolTip(errTip);
}else{
}
//show red if acqPeriod<minInterval
else if(acqPeriodMS<timeMS){
//qDefs::Message(qDefs::WARNING,"<nobr>Interval between Plots: You might be losing Images!</nobr>","Plot");
boxFrequency->setPalette(*red);
boxFrequency->setTitle("Interval between Plots*");
QString errTip = intervalTip + QString("<br><br><font color=\"red\"><nobr>"
"<b>Time Interval</b> Acquisition Period should be >= Time Interval between plots.</nobr><br><nobr>"
"You might be losing images!</nobr></font>");
boxFrequency->setToolTip(errTip);
}
//correct
else{
boxFrequency->setPalette(boxSnapshot->palette());
boxFrequency->setTitle("Interval between Plots");
boxFrequency->setToolTip(intervalTip);
@ -480,28 +521,11 @@ void qTabPlot::SetFrequency(){
cout << "Plotting Frequency: Time Gap - " << spinTimeGap->value() << qDefs::getUnitString((qDefs::timeUnit)comboTimeGapUnit->currentIndex()) << endl;
#endif
break;
case 1:
acqPeriodMS = (myDet->setTimer(slsDetectorDefs::FRAME_PERIOD,-1)*(1E-6));
//if period is 0, check exptime, if that is also 0, give warning and set to min timer
if(acqPeriodMS==0){
acqPeriodMS = (myDet->setTimer(slsDetectorDefs::ACQUISITION_TIME,-1)*(1E-6));
if(acqPeriodMS==0){
qDefs::Message(qDefs::WARNING,"<nobr>Interval between Plots:</nobr><br><nobr>"
"<b>Every Nth Image</b>: Period betwen Frames and Exposure Time cannot both be 0 ms.</nobr><br><nobr>"
"Resetting to minimum plotting time interval","Plot");
comboFrequency->setCurrentIndex(0);
stackedLayout->setCurrentIndex(comboFrequency->currentIndex());
spinTimeGap->setValue(minPlotTimer);
comboTimeGapUnit->setCurrentIndex(qDefs::MILLISECONDS);
timeMS=minPlotTimer;
//This is done so that its known which one was selected
myPlot->SetFrameFactor(0);
// Setting the timer value(ms) between plots
myPlot->SetPlotTimer(timeMS);
break;
}
}
case 1:
// gets the acq period * number of nth frames
timeMS = (spinNthFrame->value())*acqPeriodMS;
@ -509,7 +533,7 @@ void qTabPlot::SetFrequency(){
//Show red to make sure the period between plotting is not less than minimum plot timer in ms
if(timeMS<minPlotTimer){
int minFrame = (int)(ceil)(minPlotTimer/acqPeriodMS);
qDefs::Message(qDefs::WARNING,"<nobr>Interval between Plots: You might be losing Images!</nobr>","Plot");
//qDefs::Message(qDefs::WARNING,"<nobr>Interval between Plots: You might be losing Images!</nobr>","Plot");
boxFrequency->setPalette(*red);
boxFrequency->setTitle("Interval between Plots*");
QString errTip = intervalTip + QString("<br><br><font color=\"red\"><nobr>"