adcs refresh only in developer tab

This commit is contained in:
Dhanya Maliakal 2016-08-24 17:10:07 +02:00
parent 5b5e1e32b3
commit 5d52e41e37
4 changed files with 22 additions and 3 deletions

View File

@ -83,6 +83,8 @@ public:
/** Verifies if output directories for all the receivers exist */ /** Verifies if output directories for all the receivers exist */
int DoesOutputDirExist(){return tab_dataoutput->VerifyOutputDirectory();}; int DoesOutputDirExist(){return tab_dataoutput->VerifyOutputDirectory();};
bool isCurrentlyTabDeveloper();
private: private:
/** The Qt Application */ /** The Qt Application */
QApplication *theApp; QApplication *theApp;

View File

@ -24,6 +24,8 @@ class multiSlsDetector;
#include <QTimer> #include <QTimer>
#include <QString> #include <QString>
#include <QPalette> #include <QPalette>
class qDetectorMain;
/** C++ Include Headers */ /** C++ Include Headers */
#include <string> #include <string>
#include <vector> #include <vector>
@ -62,7 +64,7 @@ public:
* @param parent is the parent tab widget * @param parent is the parent tab widget
* @param detector is the detector returned from the detector tab * @param detector is the detector returned from the detector tab
*/ */
qTabDeveloper(QWidget *parent,multiSlsDetector*& detector); qTabDeveloper(qDetectorMain *parent,multiSlsDetector*& detector);
/** Destructor /** Destructor
*/ */
@ -73,6 +75,8 @@ public:
void StopADCTimer(){if(adcTimer) adcTimer->stop();}; void StopADCTimer(){if(adcTimer) adcTimer->stop();};
private: private:
/** parent widget */
qDetectorMain *thisParent;
/** The sls detector object */ /** The sls detector object */
multiSlsDetector *myDet; multiSlsDetector *myDet;
/** The sls detector object */ /** The sls detector object */

View File

@ -878,4 +878,12 @@ void qDetectorMain::UncheckServer(){
} }
//-------------------------------------------------------------------------------------------------------------------------------------------------
bool qDetectorMain::isCurrentlyTabDeveloper(){
return (tabs->currentIndex()==Developer);
}
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------

View File

@ -5,6 +5,7 @@
* Author: l_maliakal_d * Author: l_maliakal_d
*/ */
#include "qTabDeveloper.h" #include "qTabDeveloper.h"
#include "qDetectorMain.h"
//Project Class Headers //Project Class Headers
#include "slsDetector.h" #include "slsDetector.h"
#include "multiSlsDetector.h" #include "multiSlsDetector.h"
@ -24,8 +25,8 @@ int qTabDeveloper::NUM_ADC_WIDGETS(0);
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
qTabDeveloper::qTabDeveloper(QWidget *parent,multiSlsDetector*& detector): qTabDeveloper::qTabDeveloper(qDetectorMain *parent,multiSlsDetector*& detector):
QWidget(parent), thisParent(parent),
myDet(detector), myDet(detector),
det(0), det(0),
boxDacs(0), boxDacs(0),
@ -52,6 +53,7 @@ qTabDeveloper::qTabDeveloper(QWidget *parent,multiSlsDetector*& detector):
qTabDeveloper::~qTabDeveloper(){ qTabDeveloper::~qTabDeveloper(){
delete myDet; delete myDet;
if(det) delete det; if(det) delete det;
if(thisParent) delete thisParent;
} }
@ -523,6 +525,9 @@ slsDetectorDefs::dacIndex qTabDeveloper::getSLSIndex(int index){
void qTabDeveloper::RefreshAdcs(){ void qTabDeveloper::RefreshAdcs(){
if(!thisParent->isCurrentlyTabDeveloper())
return;
#ifdef VERYVERBOSE #ifdef VERYVERBOSE
cout << "Updating ADCs" <<endl; cout << "Updating ADCs" <<endl;
#endif #endif