From 8dc41efad296bb943ff694e185f20ee38ccc7a50 Mon Sep 17 00:00:00 2001 From: Maliakal Dhanya Date: Mon, 1 Dec 2014 10:54:31 +0100 Subject: [PATCH 1/5] changed to linux argument type with -- --- slsDetectorGui/src/qDetectorMain.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/slsDetectorGui/src/qDetectorMain.cpp b/slsDetectorGui/src/qDetectorMain.cpp index bfb4df3d6..ef741ea56 100644 --- a/slsDetectorGui/src/qDetectorMain.cpp +++ b/slsDetectorGui/src/qDetectorMain.cpp @@ -47,20 +47,23 @@ int main (int argc, char **argv) { qDetectorMain::qDetectorMain(int argc, char **argv, QApplication *app, QWidget *parent) : QMainWindow(parent), theApp(app),myDet(0),detID(0),myPlot(0),tabs(0),isDeveloper(0){ - +bool found; string configFName = ""; // Getting all the command line arguments for(int iarg=1; iarg Date: Wed, 14 Jan 2015 10:43:41 +0100 Subject: [PATCH 2/5] revision update --- slsDetectorGui/gitInfo.txt | 8 ++++---- slsDetectorGui/include/gitInfoGui.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/slsDetectorGui/gitInfo.txt b/slsDetectorGui/gitInfo.txt index fe983e3a1..2c642a1c6 100644 --- a/slsDetectorGui/gitInfo.txt +++ b/slsDetectorGui/gitInfo.txt @@ -1,9 +1,9 @@ Path: slsDetectorsPackage/calibrationWizards URL: origin git@gitorious.psi.ch:sls_det_software/sls_detector_gui.git Repository Root: origin git@gitorious.psi.ch:sls_det_software/sls_detector_gui.git -Repsitory UUID: a6b29560c2d5dc8de95db22956b6a9ab29a0a688 -Revision: 282 +Repsitory UUID: 81c5629da13fd8658d00bcad89e5fcbb9d901ef7 +Revision: 288 Branch: master Last Changed Author: Maliakal_Dhanya -Last Changed Rev: 282 -Last Changed Date: 2014-09-10 14:39:02 +0200 +Last Changed Rev: 288 +Last Changed Date: 2014-12-01 10:54:31 +0100 diff --git a/slsDetectorGui/include/gitInfoGui.h b/slsDetectorGui/include/gitInfoGui.h index c8e4e0f3d..e52ff8fee 100644 --- a/slsDetectorGui/include/gitInfoGui.h +++ b/slsDetectorGui/include/gitInfoGui.h @@ -1,11 +1,11 @@ //#define SVNPATH "" #define SVNURL "git@gitorious.psi.ch:sls_det_software/sls_detector_gui.git" //#define SVNREPPATH "" -#define SVNREPUUID "a6b29560c2d5dc8de95db22956b6a9ab29a0a688" -//#define SVNREV 0x282 +#define SVNREPUUID "81c5629da13fd8658d00bcad89e5fcbb9d901ef7" +//#define SVNREV 0x288 //#define SVNKIND "" //#define SVNSCHED "" #define SVNAUTH "Maliakal_Dhanya" -#define SVNREV 0x282 -#define SVNDATE 0x20140910 +#define SVNREV 0x288 +#define SVNDATE 0x20141201 // From 3fa51917051ca6a5a3e297fdc6dc95fed0ce33ef Mon Sep 17 00:00:00 2001 From: Dhanya Maliakal Date: Mon, 23 Feb 2015 15:26:14 +0100 Subject: [PATCH 3/5] so that the dacs dont go negative in the gui, default timer reduced to 200ms so more frames can be shown --- slsDetectorGui/include/qDrawPlot.h | 2 +- slsDetectorGui/src/qTabDeveloper.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/slsDetectorGui/include/qDrawPlot.h b/slsDetectorGui/include/qDrawPlot.h index 2b09e840e..0b709b57d 100644 --- a/slsDetectorGui/include/qDrawPlot.h +++ b/slsDetectorGui/include/qDrawPlot.h @@ -481,7 +481,7 @@ double XYRangeValues[4]; bool IsXYRange[4]; /** Default timer between plots*/ -static const double PLOT_TIMER_MS = 250; +static const double PLOT_TIMER_MS = 200; /** Specific timer value between plots */ double timerValue; /** every nth frame when to plot */ diff --git a/slsDetectorGui/src/qTabDeveloper.cpp b/slsDetectorGui/src/qTabDeveloper.cpp index e2470b20a..258653f27 100644 --- a/slsDetectorGui/src/qTabDeveloper.cpp +++ b/slsDetectorGui/src/qTabDeveloper.cpp @@ -220,6 +220,7 @@ void qTabDeveloper::CreateDACWidgets(){ for(int i=0;isetMinimum(-1); spinDacs[i]->setMaximum(10000); lblDacsmV[i]= new QLabel("",boxDacs); From 848569b216b5f9dac8cf929400fce306d309f89a Mon Sep 17 00:00:00 2001 From: Dhanya Maliakal Date: Mon, 2 Mar 2015 14:04:27 +0100 Subject: [PATCH 4/5] print receiver configurations and some error messages upon exit --- slsDetectorGui/src/qDetectorMain.cpp | 4 ++-- slsDetectorGui/src/qTabAdvanced.cpp | 7 +++++++ slsDetectorGui/src/qTabDeveloper.cpp | 2 ++ slsDetectorGui/src/qTabMeasurement.cpp | 2 ++ slsDetectorGui/src/qTabSettings.cpp | 1 + 5 files changed, 14 insertions(+), 2 deletions(-) diff --git a/slsDetectorGui/src/qDetectorMain.cpp b/slsDetectorGui/src/qDetectorMain.cpp index ef741ea56..527b68540 100644 --- a/slsDetectorGui/src/qDetectorMain.cpp +++ b/slsDetectorGui/src/qDetectorMain.cpp @@ -183,6 +183,7 @@ void qDetectorMain::SetUpWidgetWindow(){ // Default zoom Tool Tip zoomToolTip = dockWidgetPlot->toolTip(); + } @@ -207,9 +208,7 @@ void qDetectorMain::SetUpDetector(const string fName){ //if hostname doesnt exist even in shared memory if(!host.length()){ -#ifdef VERBOSE cout << endl << "No Detector Connected." << endl; -#endif qDefs::Message(qDefs::CRITICAL,"No Detectors Connected. ","qDetectorMain::SetUpDetector"); exit(-1); } @@ -237,6 +236,7 @@ void qDetectorMain::SetUpDetector(const string fName){ default: string detName = myDet->slsDetectorBase::getDetectorType(detType); qDefs::checkErrorMessage(myDet,"qDetectorMain::SetUpDetector"); + cout << "ERROR: " + host + " has unknown detector type \"" + detName + "\". Exiting GUI." << endl; string errorMess = host+string(" has unknown detector type \"")+ detName+string("\". Exiting GUI."); qDefs::Message(qDefs::CRITICAL,errorMess,"qDetectorMain::SetUpDetector"); diff --git a/slsDetectorGui/src/qTabAdvanced.cpp b/slsDetectorGui/src/qTabAdvanced.cpp index f07da9530..4a60b237a 100644 --- a/slsDetectorGui/src/qTabAdvanced.cpp +++ b/slsDetectorGui/src/qTabAdvanced.cpp @@ -177,6 +177,13 @@ void qTabAdvanced::SetupWidgetWindow(){ cout << "Getting ROI" << endl; updateROIList(); + + // print receiver configurations + if(myDet->getDetectorsType() != slsDetectorDefs::MYTHEN){ + cout << endl; + myDet->printReceiverConfiguration(); + } + Initialization(); qDefs::checkErrorMessage(det,"qTabAdvanced::SetupWidgetWindow"); diff --git a/slsDetectorGui/src/qTabDeveloper.cpp b/slsDetectorGui/src/qTabDeveloper.cpp index 258653f27..3c865bfa4 100644 --- a/slsDetectorGui/src/qTabDeveloper.cpp +++ b/slsDetectorGui/src/qTabDeveloper.cpp @@ -134,6 +134,7 @@ void qTabDeveloper::SetupWidgetWindow(){ break; default: + cout << "ERROR: Unknown detector type: " + myDet->slsDetectorBase::getDetectorType(detType) << endl; qDefs::Message(qDefs::CRITICAL,string("Unknown detector type:")+myDet->slsDetectorBase::getDetectorType(detType),"qTabDeveloper::SetupWidgetWindow"); exit(-1); break; @@ -388,6 +389,7 @@ slsDetectorDefs::dacIndex qTabDeveloper::getSLSIndex(int index){ } break; default: + cout << "Unknown detector type:" + myDet->slsDetectorBase::getDetectorType(detType) << endl; qDefs::Message(qDefs::CRITICAL,string("Unknown detector type:")+myDet->slsDetectorBase::getDetectorType(detType),"qTabDeveloper::getSLSIndex"); qDefs::checkErrorMessage(myDet,"qTabDeveloper::getSLSIndex"); exit(-1); diff --git a/slsDetectorGui/src/qTabMeasurement.cpp b/slsDetectorGui/src/qTabMeasurement.cpp index 5e6952b56..eb0eb3095 100644 --- a/slsDetectorGui/src/qTabMeasurement.cpp +++ b/slsDetectorGui/src/qTabMeasurement.cpp @@ -152,6 +152,7 @@ void qTabMeasurement::SetupTimingMode(){ item[(int)Gated_Start]->setEnabled(false); break; default: + cout << "Unknown detector type." << endl; qDefs::Message(qDefs::CRITICAL,"Unknown detector type.","qTabMeasurement::SetupTimingMode"); exit(-1); break; @@ -683,6 +684,7 @@ void qTabMeasurement::SetTimingMode(int mode){ success = true; break; default: + cout << "Timing mode unknown to GUI" << endl; //This should never happen qDefs::Message(qDefs::CRITICAL,"Timing mode unknown to GUI","qTabMeasurement::SetTimingMode"); qDefs::checkErrorMessage(myDet,"qTabMeasurement::SetTimingMode"); diff --git a/slsDetectorGui/src/qTabSettings.cpp b/slsDetectorGui/src/qTabSettings.cpp index e886bc9ba..91d76cdb7 100644 --- a/slsDetectorGui/src/qTabSettings.cpp +++ b/slsDetectorGui/src/qTabSettings.cpp @@ -144,6 +144,7 @@ void qTabSettings::SetupDetectorSettings(){ item[(int)LowNoise]->setEnabled(false); break; default: + cout << "Unknown detector type. Exiting GUI." << endl; qDefs::Message(qDefs::CRITICAL,"Unknown detector type. Exiting GUI.","qTabSettings::SetupDetectorSettings"); exit(-1); break; From 71ad7ae2f03d77b8de2f521f80a8ed12c60b1cf0 Mon Sep 17 00:00:00 2001 From: Dhanya Maliakal Date: Thu, 5 Mar 2015 15:30:21 +0100 Subject: [PATCH 5/5] some pointers deleted equalled to null --- slsDetectorGui/src/qDrawPlot.cpp | 17 +++++++++-------- slsDetectorGui/src/qTabActions.cpp | 6 +++--- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/slsDetectorGui/src/qDrawPlot.cpp b/slsDetectorGui/src/qDrawPlot.cpp index 308be8e78..c5ff3f6de 100644 --- a/slsDetectorGui/src/qDrawPlot.cpp +++ b/slsDetectorGui/src/qDrawPlot.cpp @@ -49,8 +49,8 @@ qDrawPlot::~qDrawPlot(){ plot1D_hists.clear(); if(lastImageArray) delete[] lastImageArray; lastImageArray=0; StartOrStopThread(0); - delete myDet; - for(int i=0;i::iterator h = plot1D_hists.begin(); h!=plot1D_hists.end();h++) + for(QVector::iterator h = plot1D_hists.begin(); h!=plot1D_hists.end();h++){ (*h)->Detach(plot1D); + //do not delete *h or h. + } plotHistogram->detach(); } @@ -1719,8 +1721,7 @@ 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){ @@ -1896,8 +1897,8 @@ void qDrawPlot::RecalculatePedestal(){ pedestalCount = 0; //create array - if(pedestalVals) delete [] pedestalVals; pedestalVals = new double[nPixelsX*nPixelsY]; - if(tempPedestalVals) delete [] tempPedestalVals; tempPedestalVals = new double[nPixelsX*nPixelsY]; + if(pedestalVals) delete [] pedestalVals; pedestalVals = new double[nPixelsX*nPixelsY]; + if(tempPedestalVals) delete [] tempPedestalVals; tempPedestalVals = new double[nPixelsX*nPixelsY]; //reset all values for(unsigned int px=0;px<(nPixelsX*nPixelsY);px++) pedestalVals[px] = 0; diff --git a/slsDetectorGui/src/qTabActions.cpp b/slsDetectorGui/src/qTabActions.cpp index 80dea2508..f6044683a 100644 --- a/slsDetectorGui/src/qTabActions.cpp +++ b/slsDetectorGui/src/qTabActions.cpp @@ -197,7 +197,7 @@ void qTabActions::SetupWidgetWindow(){ //load positions if(lblName[NumPositions]->isEnabled()){ //delete existing positions - if (positions) delete [] positions; + if (positions) {delete [] positions; positions = NULL;} //get number of positions int numPos=myDet->getPositions(); comboPos->setMaxCount(numPos); @@ -404,7 +404,7 @@ void qTabActions::SetPosition(){ } //delete existing positions - if (positions) delete [] positions; + if (positions) {delete [] positions; positions = NULL;} positions=new double[comboPos->count()]; //copying the list for(int i=0;icount();i++) @@ -483,7 +483,7 @@ void qTabActions::Refresh(){ if(lblName[NumPositions]->isEnabled()){ //delete existing positions - if (positions) delete [] positions; + if (positions) {delete [] positions; positions = NULL;} //get number of positions int numPos=myDet->getPositions(); comboPos->setMaxCount(numPos);