set current measurement dont work

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@17 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
l_maliakal_d 2012-07-04 15:09:29 +00:00
parent 81ac62dd49
commit 6fb45c6c4b
7 changed files with 139 additions and 32 deletions

View File

@ -255,7 +255,7 @@
<rect> <rect>
<x>35</x> <x>35</x>
<y>10</y> <y>10</y>
<width>322</width> <width>326</width>
<height>321</height> <height>321</height>
</rect> </rect>
</property> </property>
@ -834,6 +834,9 @@
<property name="whatsThis"> <property name="whatsThis">
<string/> <string/>
</property> </property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="suffix"> <property name="suffix">
<string/> <string/>
</property> </property>
@ -855,7 +858,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="1" column="1" colspan="2">
<widget class="QLineEdit" name="dispFileName"> <widget class="QLineEdit" name="dispFileName">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@ -879,7 +882,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="2" column="1" colspan="2">
<widget class="QSpinBox" name="spinIndex"> <widget class="QSpinBox" name="spinIndex">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@ -911,6 +914,65 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="2">
<widget class="QLabel" name="lblCurrentMeasurement">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>193</red>
<green>193</green>
<blue>193</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</widget> </widget>

View File

@ -40,8 +40,8 @@ public:
/** Destructor */ /** Destructor */
~qDrawPlot(); ~qDrawPlot();
/**is an acquisition running */
bool isRunning(){return running;}; bool isRunning(){return running;};
/** Number of x axis pixels */ /** Number of x axis pixels */
int GetPixelsX(){return nPixelsX;}; int GetPixelsX(){return nPixelsX;};
/** Number of y axis pixels */ /** Number of y axis pixels */
@ -257,6 +257,7 @@ void ContourSignal(bool);
void LogzSignal(bool); void LogzSignal(bool);
void SetZRangeSignal(double,double); void SetZRangeSignal(double,double);
void EnableZRangeSignal(bool); void EnableZRangeSignal(bool);
void SetCurrentMeasurementSignal(int);
}; };

View File

@ -85,7 +85,10 @@ public slots:
*/ */
void UpdateFinished(); void UpdateFinished();
/** updates the current measurement
* @param val the value to be updated
*/
void SetCurrentMeasurement(int val);
private slots: private slots:
/** Set file name /** Set file name

View File

@ -206,29 +206,26 @@ void qDetectorMain::SetUpDetector(){
void qDetectorMain::Initialization(){ void qDetectorMain::Initialization(){
/** Dockable Plot*/ /** Dockable Plot*/
connect(dockWidgetPlot,SIGNAL(topLevelChanged(bool)),this,SLOT(ResizeMainWindow(bool))); connect(dockWidgetPlot, SIGNAL(topLevelChanged(bool)), this,SLOT(ResizeMainWindow(bool)));
/** tabs */ /** tabs */
connect(tabs,SIGNAL(currentChanged(int)),this, SLOT(Refresh(int)));//( QWidget*))); connect(tabs, SIGNAL(currentChanged(int)), this, SLOT(Refresh(int)));//( QWidget*)));
/** Measurement tab*/ /** Measurement tab*/
connect(tab_measurement, SIGNAL(StartSignal()), this,SLOT(EnableTabs()));
connect(tab_measurement, SIGNAL(StopSignal()), this,SLOT(EnableTabs()));
/** Plot tab */ /** Plot tab */
connect(tab_plot,SIGNAL(DisableZoomSignal(bool)),this, SLOT(SetZoomToolTip(bool))); connect(tab_plot, SIGNAL(DisableZoomSignal(bool)), this,SLOT(SetZoomToolTip(bool)));
/** Plotting */ /** Plotting */
/** When the acquisition is finished, must update the meas tab */ /** When the acquisition is finished, must update the meas tab */
connect(tab_measurement, SIGNAL(StartSignal()), this,SLOT(EnableTabs())); connect(myPlot, SIGNAL(UpdatingPlotFinished()), this, SLOT(EnableTabs()));
connect(tab_measurement, SIGNAL(StopSignal()), this,SLOT(EnableTabs())); connect(myPlot, SIGNAL(UpdatingPlotFinished()), tab_measurement, SLOT(UpdateFinished()));
connect(myPlot, SIGNAL(UpdatingPlotFinished()), this,SLOT(EnableTabs())); connect(myPlot, SIGNAL(SetCurrentMeasurementSignal(int)), tab_measurement, SLOT(SetCurrentMeasurement(int)));
connect(myPlot, SIGNAL(UpdatingPlotFinished()), tab_measurement,SLOT(UpdateFinished()));
/** menubar */ /** menubar */
/** Modes Menu */ /** Modes Menu */
connect(menuModes,SIGNAL(triggered(QAction*)),SLOT(EnableModes(QAction*))); connect(menuModes, SIGNAL(triggered(QAction*)), this,SLOT(EnableModes(QAction*)));
/** Utilities Menu */ /** Utilities Menu */
connect(menuUtilities,SIGNAL(triggered(QAction*)),SLOT(ExecuteUtilities(QAction*))); connect(menuUtilities, SIGNAL(triggered(QAction*)), this,SLOT(ExecuteUtilities(QAction*)));
/** Help Menu */ /** Help Menu */
connect(menuHelp,SIGNAL(triggered(QAction*)),SLOT(ExecuteHelp(QAction*))); connect(menuHelp, SIGNAL(triggered(QAction*)), this,SLOT(ExecuteHelp(QAction*)));
} }

View File

@ -158,6 +158,7 @@ void qDrawPlot::StartStopDaqToggle(bool stop_if_running){
/**Do the following only once before each n measurements */ /**Do the following only once before each n measurements */
/** Reset Current Measurement */ /** Reset Current Measurement */
currentMeasurement = 0; currentMeasurement = 0;
emit SetCurrentMeasurementSignal(currentMeasurement);
/** Number of Exposures */ /** Number of Exposures */
number_of_exposures= (int)myDet->setTimer(slsDetectorDefs::FRAME_NUMBER,-1); number_of_exposures= (int)myDet->setTimer(slsDetectorDefs::FRAME_NUMBER,-1);
cout<<"\tNumber of Exposures:"<<number_of_exposures<<endl; cout<<"\tNumber of Exposures:"<<number_of_exposures<<endl;
@ -432,8 +433,8 @@ void qDrawPlot::UpdatePlot(){
} }
/** if a measurement is over */ /** if a measurement is over */
else{ else{
emit SetCurrentMeasurementSignal(currentMeasurement);
currentMeasurement++; currentMeasurement++;
cout<<"currentMeausremet:"<<currentMeasurement<<endl;
/** if all the measurements are over */ /** if all the measurements are over */
if(currentMeasurement==number_of_measurements){ if(currentMeasurement==number_of_measurements){
StartStopDaqToggle(true); StartStopDaqToggle(true);

View File

@ -24,6 +24,7 @@ using namespace std;
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
qTabMeasurement::qTabMeasurement(QWidget *parent,slsDetectorUtils*& detector, qDrawPlot*& plot): qTabMeasurement::qTabMeasurement(QWidget *parent,slsDetectorUtils*& detector, qDrawPlot*& plot):
QWidget(parent),myDet(detector),myPlot(plot){ QWidget(parent),myDet(detector),myPlot(plot){
setupUi(this); setupUi(this);
@ -32,15 +33,19 @@ qTabMeasurement::qTabMeasurement(QWidget *parent,slsDetectorUtils*& detector, qD
} }
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
qTabMeasurement::~qTabMeasurement(){ qTabMeasurement::~qTabMeasurement(){
delete myDet; delete myDet;
delete myPlot; delete myPlot;
} }
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabMeasurement::SetupWidgetWindow(){ void qTabMeasurement::SetupWidgetWindow(){
/** Timer to update the progress bar **/ /** Timer to update the progress bar **/
progressTimer = new QTimer(this); progressTimer = new QTimer(this);
@ -65,8 +70,10 @@ void qTabMeasurement::SetupWidgetWindow(){
SetupTimingMode(); SetupTimingMode();
} }
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabMeasurement::SetupTimingMode(){ void qTabMeasurement::SetupTimingMode(){
/** Get timing mode from detector*/ /** Get timing mode from detector*/
slsDetectorDefs::externalCommunicationMode mode = myDet->setExternalCommunicationMode(); slsDetectorDefs::externalCommunicationMode mode = myDet->setExternalCommunicationMode();
@ -148,8 +155,10 @@ void qTabMeasurement::SetupTimingMode(){
} }
} }
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabMeasurement::Initialization(int timingChange){ void qTabMeasurement::Initialization(int timingChange){
/** These signals are connected only at start up. The others are reinitialized when changing timing mode*/ /** These signals are connected only at start up. The others are reinitialized when changing timing mode*/
if(!timingChange){ if(!timingChange){
@ -183,11 +192,12 @@ void qTabMeasurement::Initialization(int timingChange){
connect(spinNumGates,SIGNAL(valueChanged(int)), this, SLOT(setNumGates(int)));// connect(spinNumGates,SIGNAL(valueChanged(int)), this, SLOT(setNumGates(int)));//
/** Number of Probes**/ /** Number of Probes**/
connect(spinNumProbes,SIGNAL(valueChanged(int)), this, SLOT(setNumProbes(int)));// connect(spinNumProbes,SIGNAL(valueChanged(int)), this, SLOT(setNumProbes(int)));//
} }
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabMeasurement::DeInitialization(){ void qTabMeasurement::DeInitialization(){
/** Number of Frames**/ /** Number of Frames**/
disconnect(spinNumFrames,SIGNAL(valueChanged(int)), this, SLOT(setNumFrames(int))); disconnect(spinNumFrames,SIGNAL(valueChanged(int)), this, SLOT(setNumFrames(int)));
@ -208,8 +218,10 @@ void qTabMeasurement::DeInitialization(){
disconnect(spinNumProbes,SIGNAL(valueChanged(int)), this, SLOT(setNumProbes(int))); disconnect(spinNumProbes,SIGNAL(valueChanged(int)), this, SLOT(setNumProbes(int)));
} }
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabMeasurement::Enable(bool enable){ void qTabMeasurement::Enable(bool enable){
frameTimeResolved->setEnabled(enable); frameTimeResolved->setEnabled(enable);
frameNotTimeResolved->setEnabled(enable); frameNotTimeResolved->setEnabled(enable);
@ -217,8 +229,10 @@ void qTabMeasurement::Enable(bool enable){
if(!enable) btnStartStop->setEnabled(true); if(!enable) btnStartStop->setEnabled(true);
} }
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabMeasurement::setFileName(const QString& fName){ void qTabMeasurement::setFileName(const QString& fName){
myDet->setFileName(fName.toAscii().data()); myDet->setFileName(fName.toAscii().data());
#ifdef VERBOSE #ifdef VERBOSE
@ -226,6 +240,7 @@ void qTabMeasurement::setFileName(const QString& fName){
#endif #endif
} }
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabMeasurement::setRunIndex(int index){ void qTabMeasurement::setRunIndex(int index){
@ -238,6 +253,7 @@ void qTabMeasurement::setRunIndex(int index){
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabMeasurement::startStopAcquisition(){ void qTabMeasurement::startStopAcquisition(){
if(!btnStartStop->text().compare("Start")){ if(!btnStartStop->text().compare("Start")){
#ifdef VERBOSE #ifdef VERBOSE
@ -265,8 +281,10 @@ void qTabMeasurement::startStopAcquisition(){
myPlot->StartStopDaqToggle(); myPlot->StartStopDaqToggle();
} }
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabMeasurement::UpdateFinished(){ void qTabMeasurement::UpdateFinished(){
disconnect(btnStartStop,SIGNAL(clicked()),this,SLOT(startStopAcquisition())); disconnect(btnStartStop,SIGNAL(clicked()),this,SLOT(startStopAcquisition()));
btnStartStop->setText("Start"); btnStartStop->setText("Start");
@ -278,15 +296,28 @@ void qTabMeasurement::UpdateFinished(){
progressTimer->stop(); progressTimer->stop();
} }
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
void SetCurrentMeasurement(int val){
lblCurrentMeasurement->setText("0u");//lblCurrentMeasurement->setText(QString::number(val));
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabMeasurement::UpdateProgress(){ void qTabMeasurement::UpdateProgress(){
progressBar->setValue(myPlot->GetProgress()); progressBar->setValue(myPlot->GetProgress());
lblProgressIndex->setText(QString::number(myDet->getFileIndex())); lblProgressIndex->setText(QString::number(myDet->getFileIndex()));
} }
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabMeasurement::setNumFrames(int val){ void qTabMeasurement::setNumFrames(int val){
myDet->setTimer(slsDetectorDefs::FRAME_NUMBER,val); myDet->setTimer(slsDetectorDefs::FRAME_NUMBER,val);
#ifdef VERBOSE #ifdef VERBOSE
@ -295,8 +326,10 @@ void qTabMeasurement::setNumFrames(int val){
} }
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabMeasurement::setExposureTime(){ void qTabMeasurement::setExposureTime(){
int64_t exptimeNS; int64_t exptimeNS;
/** Get the value of timer in ns **/ /** Get the value of timer in ns **/
@ -322,8 +355,10 @@ void qTabMeasurement::setExposureTime(){
} }
} }
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabMeasurement::setAcquisitionPeriod(){ void qTabMeasurement::setAcquisitionPeriod(){
int64_t acqtimeNS; int64_t acqtimeNS;
/** Get the value of timer in ns **/ /** Get the value of timer in ns **/
@ -347,8 +382,10 @@ void qTabMeasurement::setAcquisitionPeriod(){
} }
} }
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabMeasurement::setNumTriggers(int val){ void qTabMeasurement::setNumTriggers(int val){
myDet->setTimer(slsDetectorDefs::CYCLES_NUMBER,val); myDet->setTimer(slsDetectorDefs::CYCLES_NUMBER,val);
#ifdef VERBOSE #ifdef VERBOSE
@ -356,8 +393,10 @@ void qTabMeasurement::setNumTriggers(int val){
#endif #endif
} }
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabMeasurement::setDelay(){ void qTabMeasurement::setDelay(){
int64_t exptimeNS; int64_t exptimeNS;
/** Get the value of timer in ns **/ /** Get the value of timer in ns **/
@ -368,8 +407,10 @@ void qTabMeasurement::setDelay(){
myDet->setTimer(slsDetectorDefs::DELAY_AFTER_TRIGGER,exptimeNS); myDet->setTimer(slsDetectorDefs::DELAY_AFTER_TRIGGER,exptimeNS);
} }
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabMeasurement::setNumGates(int val){ void qTabMeasurement::setNumGates(int val){
myDet->setTimer(slsDetectorDefs::GATES_NUMBER,val); myDet->setTimer(slsDetectorDefs::GATES_NUMBER,val);
#ifdef VERBOSE #ifdef VERBOSE
@ -377,8 +418,10 @@ void qTabMeasurement::setNumGates(int val){
#endif #endif
} }
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabMeasurement::setNumProbes(int val){ void qTabMeasurement::setNumProbes(int val){
myDet->setTimer(slsDetectorDefs::PROBES_NUMBER,val); myDet->setTimer(slsDetectorDefs::PROBES_NUMBER,val);
#ifdef VERBOSE #ifdef VERBOSE
@ -386,8 +429,10 @@ void qTabMeasurement::setNumProbes(int val){
#endif #endif
} }
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabMeasurement::setTimingMode(int mode){ void qTabMeasurement::setTimingMode(int mode){
#ifdef VERBOSE #ifdef VERBOSE
cout<<"Setting Timing mode to " << comboTimingMode->currentText().toAscii().data()<<endl; cout<<"Setting Timing mode to " << comboTimingMode->currentText().toAscii().data()<<endl;
@ -570,8 +615,6 @@ void qTabMeasurement::setTimingMode(int mode){
/** To reconnect all the signals after changing their values*/ /** To reconnect all the signals after changing their values*/
Initialization(1); Initialization(1);
} }
@ -586,7 +629,7 @@ void qTabMeasurement::Refresh(){
/** progress label index **/ /** progress label index **/
lblProgressIndex->setText(QString::number(myDet->getFileIndex())); lblProgressIndex->setText(QString::number(myDet->getFileIndex()));
/** Progress bar **/ /** Progress bar **/
progressBar->setValue(myDet->getCurrentProgress()); progressBar->setValue((int)myDet->getCurrentProgress());
/** Timing mode**/ /** Timing mode**/
SetupTimingMode();//comboTimingMode->setCurrentIndex((int)myDet->setExternalCommunicationMode()); SetupTimingMode();//comboTimingMode->setCurrentIndex((int)myDet->setExternalCommunicationMode());
} }

View File

@ -332,8 +332,8 @@ void qTabPlot::SetPlot(){
}else if(radioHistogram->isChecked()){ }else if(radioHistogram->isChecked()){
myPlot->EnablePlot(true); myPlot->EnablePlot(true);
/**if enable is true, disable everything */ /**if enable is true, disable everything */
box1D->setEnabled(true); box1D->setEnabled(isOneD);
box2D->setEnabled(true); box2D->setEnabled(!isOneD);
boxSnapshot->setEnabled(true); boxSnapshot->setEnabled(true);
boxSave->setEnabled(true); boxSave->setEnabled(true);
boxPlotAxis->setEnabled(true); boxPlotAxis->setEnabled(true);
@ -341,8 +341,8 @@ void qTabPlot::SetPlot(){
}else{ }else{
myPlot->EnablePlot(true); myPlot->EnablePlot(true);
/**if enable is true, disable everything */ /**if enable is true, disable everything */
box1D->setEnabled(true); box1D->setEnabled(isOneD);
box2D->setEnabled(true); box2D->setEnabled(!isOneD);
boxSnapshot->setEnabled(true); boxSnapshot->setEnabled(true);
boxSave->setEnabled(true); boxSave->setEnabled(true);
boxPlotAxis->setEnabled(true); boxPlotAxis->setEnabled(true);