mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-20 02:40:03 +02:00
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:
parent
81ac62dd49
commit
6fb45c6c4b
@ -255,7 +255,7 @@
|
||||
<rect>
|
||||
<x>35</x>
|
||||
<y>10</y>
|
||||
<width>322</width>
|
||||
<width>326</width>
|
||||
<height>321</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -834,6 +834,9 @@
|
||||
<property name="whatsThis">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string/>
|
||||
</property>
|
||||
@ -855,7 +858,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="dispFileName">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
@ -879,7 +882,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<item row="2" column="1" colspan="2">
|
||||
<widget class="QSpinBox" name="spinIndex">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
@ -911,6 +914,65 @@
|
||||
</property>
|
||||
</widget>
|
||||
</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>
|
||||
</widget>
|
||||
</widget>
|
||||
|
@ -40,8 +40,8 @@ public:
|
||||
/** Destructor */
|
||||
~qDrawPlot();
|
||||
|
||||
/**is an acquisition running */
|
||||
bool isRunning(){return running;};
|
||||
|
||||
/** Number of x axis pixels */
|
||||
int GetPixelsX(){return nPixelsX;};
|
||||
/** Number of y axis pixels */
|
||||
@ -257,6 +257,7 @@ void ContourSignal(bool);
|
||||
void LogzSignal(bool);
|
||||
void SetZRangeSignal(double,double);
|
||||
void EnableZRangeSignal(bool);
|
||||
void SetCurrentMeasurementSignal(int);
|
||||
|
||||
};
|
||||
|
||||
|
@ -85,7 +85,10 @@ public slots:
|
||||
*/
|
||||
void UpdateFinished();
|
||||
|
||||
|
||||
/** updates the current measurement
|
||||
* @param val the value to be updated
|
||||
*/
|
||||
void SetCurrentMeasurement(int val);
|
||||
|
||||
private slots:
|
||||
/** Set file name
|
||||
|
@ -207,28 +207,25 @@ void qDetectorMain::SetUpDetector(){
|
||||
void qDetectorMain::Initialization(){
|
||||
/** Dockable Plot*/
|
||||
connect(dockWidgetPlot, SIGNAL(topLevelChanged(bool)), this,SLOT(ResizeMainWindow(bool)));
|
||||
|
||||
/** tabs */
|
||||
connect(tabs, SIGNAL(currentChanged(int)), this, SLOT(Refresh(int)));//( QWidget*)));
|
||||
/** Measurement tab*/
|
||||
/** Plot tab */
|
||||
connect(tab_plot,SIGNAL(DisableZoomSignal(bool)),this, SLOT(SetZoomToolTip(bool)));
|
||||
|
||||
/** Plotting */
|
||||
/** When the acquisition is finished, must update the meas tab */
|
||||
connect(tab_measurement, SIGNAL(StartSignal()), this,SLOT(EnableTabs()));
|
||||
connect(tab_measurement, SIGNAL(StopSignal()), this,SLOT(EnableTabs()));
|
||||
/** Plot tab */
|
||||
connect(tab_plot, SIGNAL(DisableZoomSignal(bool)), this,SLOT(SetZoomToolTip(bool)));
|
||||
/** Plotting */
|
||||
/** When the acquisition is finished, must update the meas tab */
|
||||
connect(myPlot, SIGNAL(UpdatingPlotFinished()), this, SLOT(EnableTabs()));
|
||||
connect(myPlot, SIGNAL(UpdatingPlotFinished()), tab_measurement, SLOT(UpdateFinished()));
|
||||
|
||||
|
||||
connect(myPlot, SIGNAL(SetCurrentMeasurementSignal(int)), tab_measurement, SLOT(SetCurrentMeasurement(int)));
|
||||
/** menubar */
|
||||
/** Modes Menu */
|
||||
connect(menuModes,SIGNAL(triggered(QAction*)),SLOT(EnableModes(QAction*)));
|
||||
connect(menuModes, SIGNAL(triggered(QAction*)), this,SLOT(EnableModes(QAction*)));
|
||||
/** Utilities Menu */
|
||||
connect(menuUtilities,SIGNAL(triggered(QAction*)),SLOT(ExecuteUtilities(QAction*)));
|
||||
connect(menuUtilities, SIGNAL(triggered(QAction*)), this,SLOT(ExecuteUtilities(QAction*)));
|
||||
/** Help Menu */
|
||||
connect(menuHelp,SIGNAL(triggered(QAction*)),SLOT(ExecuteHelp(QAction*)));
|
||||
connect(menuHelp, SIGNAL(triggered(QAction*)), this,SLOT(ExecuteHelp(QAction*)));
|
||||
}
|
||||
|
||||
|
||||
|
@ -158,6 +158,7 @@ void qDrawPlot::StartStopDaqToggle(bool stop_if_running){
|
||||
/**Do the following only once before each n measurements */
|
||||
/** Reset Current Measurement */
|
||||
currentMeasurement = 0;
|
||||
emit SetCurrentMeasurementSignal(currentMeasurement);
|
||||
/** Number of Exposures */
|
||||
number_of_exposures= (int)myDet->setTimer(slsDetectorDefs::FRAME_NUMBER,-1);
|
||||
cout<<"\tNumber of Exposures:"<<number_of_exposures<<endl;
|
||||
@ -432,8 +433,8 @@ void qDrawPlot::UpdatePlot(){
|
||||
}
|
||||
/** if a measurement is over */
|
||||
else{
|
||||
emit SetCurrentMeasurementSignal(currentMeasurement);
|
||||
currentMeasurement++;
|
||||
cout<<"currentMeausremet:"<<currentMeasurement<<endl;
|
||||
/** if all the measurements are over */
|
||||
if(currentMeasurement==number_of_measurements){
|
||||
StartStopDaqToggle(true);
|
||||
|
@ -24,6 +24,7 @@ using namespace std;
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
qTabMeasurement::qTabMeasurement(QWidget *parent,slsDetectorUtils*& detector, qDrawPlot*& plot):
|
||||
QWidget(parent),myDet(detector),myPlot(plot){
|
||||
setupUi(this);
|
||||
@ -32,15 +33,19 @@ qTabMeasurement::qTabMeasurement(QWidget *parent,slsDetectorUtils*& detector, qD
|
||||
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
qTabMeasurement::~qTabMeasurement(){
|
||||
delete myDet;
|
||||
delete myPlot;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::SetupWidgetWindow(){
|
||||
/** Timer to update the progress bar **/
|
||||
progressTimer = new QTimer(this);
|
||||
@ -65,8 +70,10 @@ void qTabMeasurement::SetupWidgetWindow(){
|
||||
SetupTimingMode();
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::SetupTimingMode(){
|
||||
/** Get timing mode from detector*/
|
||||
slsDetectorDefs::externalCommunicationMode mode = myDet->setExternalCommunicationMode();
|
||||
@ -148,8 +155,10 @@ void qTabMeasurement::SetupTimingMode(){
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::Initialization(int timingChange){
|
||||
/** These signals are connected only at start up. The others are reinitialized when changing timing mode*/
|
||||
if(!timingChange){
|
||||
@ -183,11 +192,12 @@ void qTabMeasurement::Initialization(int timingChange){
|
||||
connect(spinNumGates,SIGNAL(valueChanged(int)), this, SLOT(setNumGates(int)));//
|
||||
/** Number of Probes**/
|
||||
connect(spinNumProbes,SIGNAL(valueChanged(int)), this, SLOT(setNumProbes(int)));//
|
||||
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::DeInitialization(){
|
||||
/** Number of Frames**/
|
||||
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)));
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::Enable(bool enable){
|
||||
frameTimeResolved->setEnabled(enable);
|
||||
frameNotTimeResolved->setEnabled(enable);
|
||||
@ -217,8 +229,10 @@ void qTabMeasurement::Enable(bool enable){
|
||||
if(!enable) btnStartStop->setEnabled(true);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::setFileName(const QString& fName){
|
||||
myDet->setFileName(fName.toAscii().data());
|
||||
#ifdef VERBOSE
|
||||
@ -226,6 +240,7 @@ void qTabMeasurement::setFileName(const QString& fName){
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
void qTabMeasurement::setRunIndex(int index){
|
||||
@ -238,6 +253,7 @@ void qTabMeasurement::setRunIndex(int index){
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::startStopAcquisition(){
|
||||
if(!btnStartStop->text().compare("Start")){
|
||||
#ifdef VERBOSE
|
||||
@ -265,8 +281,10 @@ void qTabMeasurement::startStopAcquisition(){
|
||||
myPlot->StartStopDaqToggle();
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::UpdateFinished(){
|
||||
disconnect(btnStartStop,SIGNAL(clicked()),this,SLOT(startStopAcquisition()));
|
||||
btnStartStop->setText("Start");
|
||||
@ -278,15 +296,28 @@ void qTabMeasurement::UpdateFinished(){
|
||||
progressTimer->stop();
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void SetCurrentMeasurement(int val){
|
||||
lblCurrentMeasurement->setText("0u");//lblCurrentMeasurement->setText(QString::number(val));
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::UpdateProgress(){
|
||||
|
||||
progressBar->setValue(myPlot->GetProgress());
|
||||
lblProgressIndex->setText(QString::number(myDet->getFileIndex()));
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::setNumFrames(int val){
|
||||
myDet->setTimer(slsDetectorDefs::FRAME_NUMBER,val);
|
||||
#ifdef VERBOSE
|
||||
@ -295,8 +326,10 @@ void qTabMeasurement::setNumFrames(int val){
|
||||
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::setExposureTime(){
|
||||
int64_t exptimeNS;
|
||||
/** Get the value of timer in ns **/
|
||||
@ -322,8 +355,10 @@ void qTabMeasurement::setExposureTime(){
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::setAcquisitionPeriod(){
|
||||
int64_t acqtimeNS;
|
||||
/** Get the value of timer in ns **/
|
||||
@ -347,8 +382,10 @@ void qTabMeasurement::setAcquisitionPeriod(){
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::setNumTriggers(int val){
|
||||
myDet->setTimer(slsDetectorDefs::CYCLES_NUMBER,val);
|
||||
#ifdef VERBOSE
|
||||
@ -356,8 +393,10 @@ void qTabMeasurement::setNumTriggers(int val){
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::setDelay(){
|
||||
int64_t exptimeNS;
|
||||
/** Get the value of timer in ns **/
|
||||
@ -368,8 +407,10 @@ void qTabMeasurement::setDelay(){
|
||||
myDet->setTimer(slsDetectorDefs::DELAY_AFTER_TRIGGER,exptimeNS);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::setNumGates(int val){
|
||||
myDet->setTimer(slsDetectorDefs::GATES_NUMBER,val);
|
||||
#ifdef VERBOSE
|
||||
@ -377,8 +418,10 @@ void qTabMeasurement::setNumGates(int val){
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::setNumProbes(int val){
|
||||
myDet->setTimer(slsDetectorDefs::PROBES_NUMBER,val);
|
||||
#ifdef VERBOSE
|
||||
@ -386,8 +429,10 @@ void qTabMeasurement::setNumProbes(int val){
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::setTimingMode(int mode){
|
||||
#ifdef VERBOSE
|
||||
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*/
|
||||
Initialization(1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -586,7 +629,7 @@ void qTabMeasurement::Refresh(){
|
||||
/** progress label index **/
|
||||
lblProgressIndex->setText(QString::number(myDet->getFileIndex()));
|
||||
/** Progress bar **/
|
||||
progressBar->setValue(myDet->getCurrentProgress());
|
||||
progressBar->setValue((int)myDet->getCurrentProgress());
|
||||
/** Timing mode**/
|
||||
SetupTimingMode();//comboTimingMode->setCurrentIndex((int)myDet->setExternalCommunicationMode());
|
||||
}
|
||||
|
@ -332,8 +332,8 @@ void qTabPlot::SetPlot(){
|
||||
}else if(radioHistogram->isChecked()){
|
||||
myPlot->EnablePlot(true);
|
||||
/**if enable is true, disable everything */
|
||||
box1D->setEnabled(true);
|
||||
box2D->setEnabled(true);
|
||||
box1D->setEnabled(isOneD);
|
||||
box2D->setEnabled(!isOneD);
|
||||
boxSnapshot->setEnabled(true);
|
||||
boxSave->setEnabled(true);
|
||||
boxPlotAxis->setEnabled(true);
|
||||
@ -341,8 +341,8 @@ void qTabPlot::SetPlot(){
|
||||
}else{
|
||||
myPlot->EnablePlot(true);
|
||||
/**if enable is true, disable everything */
|
||||
box1D->setEnabled(true);
|
||||
box2D->setEnabled(true);
|
||||
box1D->setEnabled(isOneD);
|
||||
box2D->setEnabled(!isOneD);
|
||||
boxSnapshot->setEnabled(true);
|
||||
boxSave->setEnabled(true);
|
||||
boxPlotAxis->setEnabled(true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user