reduced gui_client crashes

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@168 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
l_maliakal_d 2013-03-19 16:00:38 +00:00
parent b7629f6c67
commit 303d84b24a
7 changed files with 37 additions and 15 deletions

View File

@ -9,6 +9,7 @@
// Project Class Headers // Project Class Headers
#include "MySocketTCP.h" #include "MySocketTCP.h"
#include "slsDetectorBase.h" #include "slsDetectorBase.h"
// C++ Include Headers // C++ Include Headers
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
@ -16,14 +17,15 @@ using namespace std;
//-------------------------------------------------------------------------------------------------------------------------------------------------
int main(int argc, char *argv[])
{ int main(int argc, char *argv[]){
qClient *cl =new qClient(argv[1]); qClient *cl =new qClient(argv[1]);
cl->executeLine(argc-2, argv+2); cl->executeLine(argc-2, argv+2);
delete cl; delete cl;
} }
@ -43,6 +45,14 @@ qClient::qClient(char* hostname){
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
qClient::~qClient() {
if(mySocket) delete mySocket;
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
int qClient::executeLine(int narg, char *args[]){ int qClient::executeLine(int narg, char *args[]){
char arg[MAX_STR_LENGTH] = ""; char arg[MAX_STR_LENGTH] = "";

View File

@ -27,7 +27,7 @@ public:
/** \short The constructor*/ /** \short The constructor*/
qClient(char* hostname); qClient(char* hostname);
/** Destructor */ /** Destructor */
virtual ~qClient(){}; virtual ~qClient();
/**Execute command*/ /**Execute command*/
int executeLine(int narg, char *args[]); int executeLine(int narg, char *args[]);
@ -44,6 +44,7 @@ private:
/** client socket */ /** client socket */
MySocketTCP *mySocket; MySocketTCP *mySocket;
}; };

View File

@ -72,6 +72,10 @@ public:
*/ */
void Refresh(); void Refresh();
/** To stop ADC Timer when starting acquisition
*/
void StopADCTimer(){adcTimer->stop();};
private: private:
/** The sls detector object */ /** The sls detector object */
multiSlsDetector *myDet; multiSlsDetector *myDet;

View File

@ -2,10 +2,10 @@
#define SVNURL "file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui" #define SVNURL "file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui"
//#define SVNREPPATH "" //#define SVNREPPATH ""
#define SVNREPUUID "af1100a4-978c-4157-bff7-07162d2ba061" #define SVNREPUUID "af1100a4-978c-4157-bff7-07162d2ba061"
//#define SVNREV 0x152 //#define SVNREV 0x167
//#define SVNKIND "" //#define SVNKIND ""
//#define SVNSCHED "" //#define SVNSCHED ""
#define SVNAUTH "l_maliakal_d" #define SVNAUTH "l_maliakal_d"
#define SVNREV 0x152 #define SVNREV 0x167
#define SVNDATE 0x20130306 #define SVNDATE 0x20130315
// //

View File

@ -721,14 +721,20 @@ void qDetectorMain::EnableTabs(){
//moved to here, so that its all in order, instead of signals and different threads //moved to here, so that its all in order, instead of signals and different threads
if(!enable) { if(!enable) {
//stop the adc timer in gotthard
if(tab_developer->isEnabled())
tab_developer->StopADCTimer();
//set the plot type first(acccss shared memory) //set the plot type first(acccss shared memory)
tab_plot->SetScanArgument(); tab_plot->SetScanArgument();
//sets running to true //sets running to true
myPlot->StartStopDaqToggle(); myPlot->StartStopDaqToggle();
} }
else//to enable scan box else{//to enable scan box
tab_plot->Refresh(); tab_plot->Refresh();
//to start adc timer
if(tab_developer->isEnabled())
tab_developer->Refresh();
}
} }

View File

@ -46,10 +46,10 @@ qDrawPlot::~qDrawPlot(){
Clear1DPlot(); Clear1DPlot();
for(QVector<SlsQtH1D*>::iterator h = plot1D_hists.begin();h!=plot1D_hists.end();h++) delete *h; for(QVector<SlsQtH1D*>::iterator h = plot1D_hists.begin();h!=plot1D_hists.end();h++) delete *h;
plot1D_hists.clear(); plot1D_hists.clear();
delete[] lastImageArray; lastImageArray=0; if(lastImageArray) delete[] lastImageArray; lastImageArray=0;
StartOrStopThread(0); StartOrStopThread(0);
delete myDet; delete myDet;
for(int i=0;i<MAXCloneWindows;i++) delete winClone[i]; for(int i=0;i<MAXCloneWindows;i++) if(winClone[i]) delete winClone[i];
} }
@ -469,10 +469,10 @@ void qDrawPlot::SetScanArgument(int scanArg){
}else backwardScanPlot = false; }else backwardScanPlot = false;
//1d //1d
if(histXAxis) delete [] histXAxis; histXAxis = new double [nPixelsX]; if(histXAxis) delete [] histXAxis; histXAxis = new double [nPixelsX];
if(histYAxis[0]) delete [] histYAxis[0];histYAxis[0] = new double [nPixelsX];
if(histYAxis[0]) delete [] histYAxis[0]; histYAxis[0] = new double [nPixelsX];
//2d //2d
if(lastImageArray) delete [] lastImageArray; lastImageArray = new double[nPixelsY*nPixelsX]; if(lastImageArray) delete [] lastImageArray; lastImageArray = new double[nPixelsY*nPixelsX];

View File

@ -259,10 +259,11 @@ void qTabSettings::Refresh(){
// Number of Modules // Number of Modules
int numMod = myDet->setNumberOfModules();
#ifdef VERBOSE #ifdef VERBOSE
cout << "Getting number of modules" << endl; cout << "Getting number of modules:" << numMod << endl;
#endif #endif
spinNumModules->setValue(myDet->setNumberOfModules()); spinNumModules->setValue(numMod);
// Dynamic Range // Dynamic Range
#ifdef VERBOSE #ifdef VERBOSE