mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-01-24 05:33:01 +01:00
fixed bug when trimming
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@250 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
@@ -30,10 +30,9 @@ using namespace std;
|
|||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
int main (int argc, char **argv) {
|
int main (int argc, char **argv) {
|
||||||
|
MyApplication *theApp = new MyApplication(argc, argv);
|
||||||
QApplication *theApp = new QApplication(argc, argv);
|
// QApplication *theApp = new QApplication(argc, argv);
|
||||||
theApp->setStyle(new QPlastiqueStyle);//not default when desktop is windows
|
theApp->setStyle(new QPlastiqueStyle);//not default when desktop is windows
|
||||||
theApp->setWindowIcon(QIcon( ":/icons/images/mountain.png" ));
|
theApp->setWindowIcon(QIcon( ":/icons/images/mountain.png" ));
|
||||||
qDetectorMain *det=new qDetectorMain(argc, argv, theApp,0);
|
qDetectorMain *det=new qDetectorMain(argc, argv, theApp,0);
|
||||||
|
|||||||
@@ -630,8 +630,9 @@ void qDrawPlot::SetupMeasurement(){
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "SetupMeasurement function:" << running << endl;
|
cout << "SetupMeasurement function:" << running << endl;
|
||||||
#endif
|
#endif
|
||||||
|
cout<<"begnPixelsX:"<<nPixelsX<<endl;
|
||||||
LockLastImageArray();
|
cout<<"begnPixelsY:"<<nPixelsY<<endl;
|
||||||
|
LockLastImageArray();cout<<"after lockimage"<<endl;
|
||||||
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "locklastimagearray" << endl;
|
cout << "locklastimagearray" << endl;
|
||||||
@@ -644,13 +645,14 @@ void qDrawPlot::SetupMeasurement(){
|
|||||||
//for 2d scans
|
//for 2d scans
|
||||||
currentScanDivLevel = 0;
|
currentScanDivLevel = 0;
|
||||||
//if(plot_in_scope==2)
|
//if(plot_in_scope==2)
|
||||||
if(!running) lastImageNumber = 0;/**Just now */
|
if(!running)
|
||||||
|
lastImageNumber = 0;/**Just now */
|
||||||
|
cout<<"before 2d"<<endl;
|
||||||
//initializing 2d array
|
//initializing 2d array
|
||||||
for(int py=0;py<(int)nPixelsY;py++)
|
for(int py=0;py<(int)nPixelsY;py++)
|
||||||
for(int px=0;px<(int)nPixelsX;px++)
|
for(int px=0;px<(int)nPixelsX;px++)
|
||||||
lastImageArray[py*nPixelsX+px] = 0;
|
lastImageArray[py*nPixelsX+px] = 0;
|
||||||
|
cout<<"end of 2d"<<endl;
|
||||||
//1d with no scan
|
//1d with no scan
|
||||||
if ((!originally2D) && (scanArgument==qDefs::None)){
|
if ((!originally2D) && (scanArgument==qDefs::None)){
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
@@ -662,7 +664,7 @@ void qDrawPlot::SetupMeasurement(){
|
|||||||
minPixelsY = 0;
|
minPixelsY = 0;
|
||||||
startPixel = -0.5;
|
startPixel = -0.5;
|
||||||
endPixel = nPixelsY-0.5;
|
endPixel = nPixelsY-0.5;
|
||||||
}
|
}else cout<<"correct palce"<<endl;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
@@ -715,7 +717,7 @@ void qDrawPlot::SetupMeasurement(){
|
|||||||
cout<<"startPixel:"<<startPixel<<endl;
|
cout<<"startPixel:"<<startPixel<<endl;
|
||||||
cout<<"endPixel:"<<endPixel<<endl<<endl;
|
cout<<"endPixel:"<<endPixel<<endl<<endl;
|
||||||
*/
|
*/
|
||||||
UnlockLastImageArray();
|
UnlockLastImageArray();cout<<"out of setupmeasure"<<endl;
|
||||||
|
|
||||||
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
@@ -760,7 +762,7 @@ int qDrawPlot::GetData(detectorData *data,int fIndex){
|
|||||||
cout << "angle " << data->angles << endl;
|
cout << "angle " << data->angles << endl;
|
||||||
//#endif
|
//#endif
|
||||||
if(!stop_signal){
|
if(!stop_signal){
|
||||||
|
cout<<"before progress"<<endl;
|
||||||
//set progress
|
//set progress
|
||||||
progress=(int)data->progressIndex;
|
progress=(int)data->progressIndex;
|
||||||
currentFrameIndex = fileIOStatic::getIndicesFromFileName(string(data->fileName),currentFileIndex);
|
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;
|
cout << "Received empty file name. Exiting function without updating data for plot." << endl;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#ifdef VERYVERBOSE
|
//#ifdef VERYVERBOSE
|
||||||
cout << "progress:" << progress << endl;
|
cout << "progress:" << progress << endl;
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
// secondary title necessary to differentiate between frames when not saving data
|
// secondary title necessary to differentiate between frames when not saving data
|
||||||
char temp_title[2000];
|
char temp_title[2000];
|
||||||
//findex is used because in the receiver, you cannot know the frame index as many frames are in 1 file.
|
//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
|
//Plot Disabled
|
||||||
if(!plotEnable) return 0;
|
if(!plotEnable) return 0;
|
||||||
|
|
||||||
|
cout<<"before entering angleplot"<<endl;
|
||||||
//angle plotting
|
//angle plotting
|
||||||
if(anglePlot){
|
if(anglePlot){
|
||||||
LockLastImageArray();
|
LockLastImageArray();
|
||||||
@@ -1325,8 +1326,9 @@ void qDrawPlot::UpdatePlot(){
|
|||||||
firstPlot = false;
|
firstPlot = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// update range if required
|
// update range if required
|
||||||
if(XYRangeChanged){
|
if(XYRangeChanged){
|
||||||
if(!IsXYRange[qDefs::XMINIMUM]) XYRangeValues[qDefs::XMINIMUM]= plot1D->GetXMinimum();
|
if(!IsXYRange[qDefs::XMINIMUM]) XYRangeValues[qDefs::XMINIMUM]= plot1D->GetXMinimum();
|
||||||
@@ -1709,8 +1711,10 @@ int qDrawPlot::UpdateTrimbitPlot(bool fromDetector,bool Histogram){
|
|||||||
|
|
||||||
//get trimbits
|
//get trimbits
|
||||||
actualPixelsX = myDet->getTotalNumberOfChannels(slsDetectorDefs::X);
|
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);
|
ret = myDet->getChanRegs(histTrimbits,fromDetector);
|
||||||
|
// cout << "got it!" << endl;
|
||||||
if(!ret){
|
if(!ret){
|
||||||
qDefs::Message(qDefs::WARNING,"No Trimbit data found in shared memory.","qDrawPlot::UpdateTrimbitPlot");
|
qDefs::Message(qDefs::WARNING,"No Trimbit data found in shared memory.","qDrawPlot::UpdateTrimbitPlot");
|
||||||
UnlockLastImageArray();
|
UnlockLastImageArray();
|
||||||
|
|||||||
@@ -584,11 +584,12 @@ void qTabAdvanced::StartTrimming(){
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
cout << "Should never come here. Start Trimming will have only 2 methods. Trimming Method:" << trimmingMode << endl;
|
cout << "Should never come here. Start Trimming will have only 2 methods. Trimming Method:" << trimmingMode << endl;
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//execute
|
//execute
|
||||||
int ret = myDet->executeTrimming(trimmingMode,parameter1,parameter2,-1);
|
int ret = myDet->executeTrimming(trimmingMode,parameter1,parameter2,-1);
|
||||||
|
|
||||||
if((ret!=slsDetectorDefs::FAIL)&&(ret!=-1));
|
if((ret!=slsDetectorDefs::FAIL)&&(ret!=-1));
|
||||||
else
|
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");
|
||||||
|
|||||||
Reference in New Issue
Block a user