diff --git a/slsDetectorGui/src/qDetectorMain.cpp b/slsDetectorGui/src/qDetectorMain.cpp index 38e65e03c..f470bdae1 100644 --- a/slsDetectorGui/src/qDetectorMain.cpp +++ b/slsDetectorGui/src/qDetectorMain.cpp @@ -30,10 +30,9 @@ using namespace std; //------------------------------------------------------------------------------------------------------------------------------------------------- - int main (int argc, char **argv) { - - QApplication *theApp = new QApplication(argc, argv); + MyApplication *theApp = new MyApplication(argc, argv); + // QApplication *theApp = new QApplication(argc, argv); theApp->setStyle(new QPlastiqueStyle);//not default when desktop is windows theApp->setWindowIcon(QIcon( ":/icons/images/mountain.png" )); qDetectorMain *det=new qDetectorMain(argc, argv, theApp,0); diff --git a/slsDetectorGui/src/qDrawPlot.cpp b/slsDetectorGui/src/qDrawPlot.cpp index 2621bf3b6..8d9d48f55 100644 --- a/slsDetectorGui/src/qDrawPlot.cpp +++ b/slsDetectorGui/src/qDrawPlot.cpp @@ -630,8 +630,9 @@ void qDrawPlot::SetupMeasurement(){ #ifdef VERBOSE cout << "SetupMeasurement function:" << running << endl; #endif - - LockLastImageArray(); + cout<<"begnPixelsX:"<angles << endl; //#endif if(!stop_signal){ - +cout<<"before progress"<progressIndex; currentFrameIndex = fileIOStatic::getIndicesFromFileName(string(data->fileName),currentFileIndex); @@ -769,10 +771,9 @@ int qDrawPlot::GetData(detectorData *data,int fIndex){ cout << "Received empty file name. Exiting function without updating data for plot." << endl; return -1; } -#ifdef VERYVERBOSE + //#ifdef VERYVERBOSE cout << "progress:" << progress << endl; -#endif - + //#endif // secondary title necessary to differentiate between frames when not saving data char temp_title[2000]; //findex is used because in the receiver, you cannot know the frame index as many frames are in 1 file. @@ -788,7 +789,7 @@ int qDrawPlot::GetData(detectorData *data,int fIndex){ //Plot Disabled if(!plotEnable) return 0; - + cout<<"before entering angleplot"<start((int)(PLOT_TIMER_MS/2)); - } + if (scanArgument == qDefs::None) { + //if the time is not over, RETURN + if(!data_pause_over){ + return 0; + } + data_pause_over=false; + data_pause_timer->start((int)(PLOT_TIMER_MS/2)); + } } -//if scan + //if scan //alframes if(scanArgument==qDefs::AllFrames){ LockLastImageArray(); @@ -964,10 +965,10 @@ int qDrawPlot::GetData(detectorData *data,int fIndex){ //normal measurement or 1d scans if(!pthread_mutex_trylock(&(last_image_complete_mutex))){ - //set title - plotTitle=QString(plotTitle_prefix)+QString(data->fileName).section('/',-1); - // only if you got the lock, do u need to remember lastimagenumber to plot - lastImageNumber= currentFrame+1; + //set title + plotTitle=QString(plotTitle_prefix)+QString(data->fileName).section('/',-1); + // only if you got the lock, do u need to remember lastimagenumber to plot + lastImageNumber= currentFrame+1; //1d if(plot_in_scope==1){ @@ -1051,7 +1052,7 @@ int qDrawPlot::GetData(detectorData *data,int fIndex){ histYAxis[0][px] = temp; } } - } + } } //2d else{ @@ -1135,9 +1136,9 @@ int qDrawPlot::AcquisitionFinished(double currentProgress, int detectorStatus){ #endif QString status = QString(slsDetectorBase::runStatusType(slsDetectorDefs::runStatus(detectorStatus)).c_str()); #ifdef VERBOSE - cout << status.toAscii().constData() << " and progress " << currentProgress << endl; + cout << status.toAscii().constData() << " and progress " << currentProgress << endl; #endif - //error or stopped + //error or stopped if((stop_signal)||(detectorStatus==slsDetectorDefs::ERROR)){ #ifdef VERBOSE cout << "Error in Acquisition" << endl << endl; @@ -1325,8 +1326,9 @@ void qDrawPlot::UpdatePlot(){ firstPlot = false; } } - } + + // update range if required if(XYRangeChanged){ if(!IsXYRange[qDefs::XMINIMUM]) XYRangeValues[qDefs::XMINIMUM]= plot1D->GetXMinimum(); @@ -1709,8 +1711,10 @@ int qDrawPlot::UpdateTrimbitPlot(bool fromDetector,bool Histogram){ //get trimbits actualPixelsX = myDet->getTotalNumberOfChannels(slsDetectorDefs::X); - if(histTrimbits) delete [] histTrimbits; histTrimbits = new double[actualPixelsX]; + if(histTrimbits) delete [] histTrimbits; + histTrimbits = new double[actualPixelsX]; ret = myDet->getChanRegs(histTrimbits,fromDetector); + // cout << "got it!" << endl; if(!ret){ qDefs::Message(qDefs::WARNING,"No Trimbit data found in shared memory.","qDrawPlot::UpdateTrimbitPlot"); UnlockLastImageArray(); diff --git a/slsDetectorGui/src/qTabAdvanced.cpp b/slsDetectorGui/src/qTabAdvanced.cpp index 08be2056b..a5b7565e9 100644 --- a/slsDetectorGui/src/qTabAdvanced.cpp +++ b/slsDetectorGui/src/qTabAdvanced.cpp @@ -584,14 +584,15 @@ void qTabAdvanced::StartTrimming(){ break; default: cout << "Should never come here. Start Trimming will have only 2 methods. Trimming Method:" << trimmingMode << endl; - break; + return; } //execute int ret = myDet->executeTrimming(trimmingMode,parameter1,parameter2,-1); + if((ret!=slsDetectorDefs::FAIL)&&(ret!=-1)); else - qDefs::Message(qDefs::WARNING,"Atleast 1 channel could not be trimmed.","qTabAdvanced::StartTrimming"); + qDefs::Message(qDefs::WARNING,"Atleast 1 channel could not be trimmed.","qTabAdvanced::StartTrimming"); //save trim file ret = myDet->saveSettingsFile(string(dispFile->text().toAscii().constData()),-1); if((ret!=slsDetectorDefs::FAIL)&&(ret!=-1)){