git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@29 af1100a4-978c-4157-bff7-07162d2ba061

This commit is contained in:
l_maliakal_d 2012-08-17 10:29:46 +00:00
parent 30c11d7589
commit 423a47cd9e
10 changed files with 486 additions and 158 deletions

View File

@ -232,8 +232,6 @@
<addaction name="actionOpenConfiguration"/>
<addaction name="actionSaveConfiguration"/>
<addaction name="separator"/>
<addaction name="actionEnergyCalibration"/>
<addaction name="actionAngularCalibration"/>
</widget>
<widget class="QMenu" name="menuModes">
<property name="title">

View File

@ -0,0 +1,350 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>EnergyCalibrationObject</class>
<widget class="QWizard" name="EnergyCalibrationObject">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>500</width>
<height>300</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Energy Calibration</string>
</property>
<property name="sizeGripEnabled">
<bool>false</bool>
</property>
<property name="wizardStyle">
<enum>QWizard::ModernStyle</enum>
</property>
<property name="subTitleFormat">
<enum>Qt::AutoText</enum>
</property>
<widget class="QWizardPage" name="pageSetup">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="cursor">
<cursorShape>ArrowCursor</cursorShape>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="title">
<string/>
</property>
<property name="subTitle">
<string>&lt;font color = &quot;darkblue&quot;&gt;Calibration Setup&lt;/font&gt;</string>
</property>
<attribute name="pageId">
<string notr="true"/>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin">
<number>30</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<property name="verticalSpacing">
<number>5</number>
</property>
<item row="2" column="0" colspan="2">
<widget class="QRadioButton" name="radioNew">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Start New Calibration</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QRadioButton" name="radioExisting">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Add to Existing Calibration</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="QRadioButton" name="radioGenerate">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Generate Calibration Files</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="checkBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Detector Online</string>
</property>
</widget>
</item>
<item row="1" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>15</height>
</size>
</property>
</spacer>
</item>
<item row="6" column="0" colspan="2">
<widget class="QLabel" name="lblMessage">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>&lt;font color=&quot;red&quot;&gt;No File Selected&lt;/font&gt;</string>
</property>
</widget>
</item>
<item row="5" column="1">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWizardPage" name="pageSummary">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="subTitle">
<string>&lt;font color = &quot;darkblue&quot;&gt;Summary of the Calibration&lt;/font&gt;</string>
</property>
<attribute name="pageId">
<string notr="true"/>
</attribute>
<layout class="QGridLayout" name="gridLayout_3">
<property name="leftMargin">
<number>30</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Settings:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBox">
<item>
<property name="text">
<string>Standard</string>
</property>
</item>
<item>
<property name="text">
<string>Fast</string>
</property>
</item>
<item>
<property name="text">
<string>High Gain</string>
</property>
</item>
<item>
<property name="text">
<string>Dynamic Gain</string>
</property>
</item>
<item>
<property name="text">
<string>Low Gain</string>
</property>
</item>
<item>
<property name="text">
<string>Medium Gain</string>
</property>
</item>
<item>
<property name="text">
<string>Very High Gain</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Number of Modules:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="spinBox"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Serial Numbers:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBox_2">
<property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Number of energies:</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Energies:</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWizardPage" name="wizardPage3">
<property name="subTitle">
<string>&lt;font color = &quot;darkblue&quot;&gt;Add Calibration Step&lt;/font&gt;</string>
</property>
<attribute name="pageId">
<string notr="true"/>
</attribute>
</widget>
<widget class="QWizardPage" name="wizardPage4">
<property name="subTitle">
<string>&lt;font color = &quot;darkblue&quot;&gt;Add Calibration Step OFFLINE&lt;/font&gt;</string>
</property>
<attribute name="pageId">
<string notr="true"/>
</attribute>
</widget>
<widget class="QWizardPage" name="wizardPage5">
<property name="subTitle">
<string>&lt;font color = &quot;darkblue&quot;&gt;Finalize Calibration&lt;/font&gt;</string>
</property>
<attribute name="pageId">
<string notr="true"/>
</attribute>
</widget>
<widget class="QWizardPage" name="wizardPage6">
<property name="subTitle">
<string>&lt;font color = &quot;darkblue&quot;&gt;Fit Module&lt;/font&gt;</string>
</property>
<attribute name="pageId">
<string notr="true"/>
</attribute>
</widget>
<widget class="QWizardPage" name="wizardPage7">
<property name="subTitle">
<string>&lt;font color = &quot;darkblue&quot;&gt;Linear Fit of Module&lt;/font&gt;</string>
</property>
<attribute name="pageId">
<string notr="true"/>
</attribute>
</widget>
<widget class="QWizardPage" name="wizardPage8">
<property name="subTitle">
<string>&lt;font color = &quot;darkblue&quot;&gt;Error&lt;/font&gt;</string>
</property>
<attribute name="pageId">
<string notr="true"/>
</attribute>
</widget>
<widget class="QWizardPage" name="wizardPage9">
<property name="subTitle">
<string>&lt;font color = &quot;darkblue&quot;&gt;Calibrating...&lt;/font&gt;</string>
</property>
<attribute name="pageId">
<string notr="true"/>
</attribute>
</widget>
<widget class="QWizardPage" name="wizardPage10">
<property name="subTitle">
<string>&lt;font color = &quot;darkblue&quot;&gt;Finished&lt;/font&gt;</string>
</property>
<attribute name="pageId">
<string notr="true"/>
</attribute>
</widget>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -44,101 +44,6 @@
<string>PushButton</string>
</property>
</widget>
<widget class="QPushButton" name="btnTemp">
<property name="geometry">
<rect>
<x>10</x>
<y>14</y>
<width>91</width>
<height>41</height>
</rect>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Gets both the temperature of ADC and FPGA</string>
</property>
<property name="text">
<string>Get
Temperature</string>
</property>
</widget>
<widget class="QLineEdit" name="dispTempFpga">
<property name="geometry">
<rect>
<x>180</x>
<y>40</y>
<width>151</width>
<height>21</height>
</rect>
</property>
<property name="toolTip">
<string>Reads temperature of FPGA.
#temp_fpga#</string>
</property>
<property name="frame">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
<widget class="QLabel" name="label_10">
<property name="geometry">
<rect>
<x>120</x>
<y>10</y>
<width>41</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>ADC:</string>
</property>
</widget>
<widget class="QLabel" name="label_11">
<property name="geometry">
<rect>
<x>120</x>
<y>40</y>
<width>41</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>FPGA:</string>
</property>
</widget>
<widget class="QLineEdit" name="dispTempAdc">
<property name="geometry">
<rect>
<x>180</x>
<y>10</y>
<width>151</width>
<height>21</height>
</rect>
</property>
<property name="toolTip">
<string>Reads temperature of ADC.
#temp_adc#</string>
</property>
<property name="inputMask">
<string/>
</property>
<property name="frame">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</widget>
<resources/>
<connections/>

View File

@ -28,6 +28,8 @@ class multiSlsDetector;
#include <QGridLayout>
#include <QResizeEvent>
#include <iostream>
using namespace std;
/** To Over-ride the QTabWidget class to get the tabBar */
class MyTabWidget:public QTabWidget{
@ -103,6 +105,7 @@ private:
qTabDeveloper *tab_developer;
/**Messages tab */
qTabMessages *tab_messages;
/**if the developer tab should be enabled,known from command line */
int isDeveloper;

View File

@ -0,0 +1,59 @@
/*
* qEnergyCalibration.h
*
* Created on: May 10, 2012
* Author: l_maliakal_d
*/
#ifndef QENERGY_CALIBRATION_H_
#define QENERGY_CALIBRATION_H_
/** Form Header */
#include "ui_form_energy_calibration.h"
/** Project Class Headers */
class multiSlsDetector;
/**
*@short sets up the advanced parameters
*/
class qEnergyCalibration:public QWizard, private Ui::EnergyCalibrationObject{
Q_OBJECT
public:
/** \short The constructor
* @param parent is the parent tab widget
* @param detector is the detector returned from the detector tab
*/
qEnergyCalibration(QWidget *parent,multiSlsDetector*& detector);
/** Destructor
*/
~qEnergyCalibration();
/** To refresh and update widgets
*/
void Refresh();
private:
/** The sls detector object */
multiSlsDetector *myDet;
/** Sets up the widget
*/
void SetupWidgetWindow();
/** Sets up all the slots and signals
*/
void Initialization();
private slots:
};
#endif /* QENERGY_CALIBRATION_H_ */

View File

@ -39,9 +39,6 @@ private:
/** The sls detector object */
multiSlsDetector *myDet;
/** The sls detector object type*/
int myDetType;
/** Sets up the widget
*/
void SetupWidgetWindow();
@ -50,14 +47,10 @@ private:
*/
void Initialization();
/** Enables/Disables all the widgets
*/
void Enable(bool enable);
private slots:
/** Get Temperature data
*/
void getTemperature();
};

View File

@ -357,16 +357,6 @@ void qDetectorMain::ExecuteUtilities(QAction *action){
qDefs::InfoMessage("The configuration parameters have been successfully saved.","Main");
}
}
else if(action==actionEnergyCalibration){
#ifdef VERBOSE
cout << "Executing Energy Calibration" << endl;
#endif
}
else{
#ifdef VERBOSE
cout << "Executing Angular Calibration" << endl;
#endif
}
Refresh(tabs->currentIndex());
}

View File

@ -0,0 +1,58 @@
/*
* qEnergyCalibration.cpp
*
* Created on: May 10, 2012
* Author: l_maliakal_d
*/
#include "qEnergyCalibration.h"
#include "qDefs.h"
/** Project Class Headers */
#include "slsDetector.h"
#include "multiSlsDetector.h"
/** C++ Include Headers */
#include<iostream>
using namespace std;
qEnergyCalibration::qEnergyCalibration(QWidget *parent,multiSlsDetector*& detector):QWizard(parent),myDet(detector){
setupUi(this);
SetupWidgetWindow();
Initialization();
}
qEnergyCalibration::~qEnergyCalibration(){
delete myDet;
}
void qEnergyCalibration::SetupWidgetWindow(){
}
void qEnergyCalibration::Initialization(){
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
void qEnergyCalibration::Refresh(){
}
//-------------------------------------------------------------------------------------------------------------------------------------------------

View File

@ -18,7 +18,6 @@ using namespace std;
qTabAdvanced::qTabAdvanced(QWidget *parent,multiSlsDetector*& detector):QWidget(parent),myDet(detector){
setupUi(this);
myDetType = (int)myDet->getDetectorsType();
SetupWidgetWindow();
Initialization();
}
@ -34,48 +33,16 @@ qTabAdvanced::~qTabAdvanced(){
void qTabAdvanced::SetupWidgetWindow(){
/** Temperature */
if(myDetType==slsDetectorDefs::GOTTHARD)
getTemperature(); //check if gotthard???
else{
btnTemp->setEnabled(false);
dispTempAdc->setEnabled(false);
dispTempFpga->setEnabled(false);
}
}
void qTabAdvanced::Initialization(){
/** Temperature */
connect(btnTemp,SIGNAL(clicked()),this,SLOT(getTemperature()));//check if gotthard???
}
void qTabAdvanced::Enable(bool enable){
btnTemp->setEnabled(enable);
dispTempAdc->setEnabled(enable);
dispTempFpga->setEnabled(enable);
pushButton->setEnabled(enable);
}
void qTabAdvanced::getTemperature(){
char ctemp[200];
/** adc */
double tempadc = myDet->getADC(slsDetectorDefs::TEMPERATURE_ADC);
sprintf(ctemp,"%f%cC",tempadc,0x00B0);
dispTempAdc->setText(QString(ctemp));
/** fpga */
double tempfpga = myDet->getADC(slsDetectorDefs::TEMPERATURE_FPGA);
sprintf(ctemp,"%f%cC",tempfpga,0x00B0);
dispTempFpga->setText(QString(ctemp));
#ifdef VERBOSE
cout<<"Temperature of ADC: "<<tempadc<<"°C and FPGA: "<<tempfpga<<"°C"<<endl;
#endif
}
//-------------------------------------------------------------------------------------------------------------------------------------------------

View File

@ -489,14 +489,15 @@ void qTabMeasurement::SetTimingMode(int mode){
if(myDet->setExternalCommunicationMode(slsDetectorDefs::AUTO_TIMING)==slsDetectorDefs::AUTO_TIMING)
success = true;
break;
case Auto://Number of Frames, Exposure Time, Acquisition Period
case Auto://#Frames, ExpTime, Period
setNumTriggers(1);
lblNumFrames->setEnabled(true); spinNumFrames->setEnabled(true);
lblExpTime->setEnabled(true); spinExpTime->setEnabled(true); comboExpUnit->setEnabled(true);
lblPeriod->setEnabled(true); spinPeriod->setEnabled(true); comboPeriodUnit->setEnabled(true);
if(myDet->setExternalCommunicationMode(slsDetectorDefs::AUTO_TIMING)==slsDetectorDefs::AUTO_TIMING)
success = true;
break;
case Trigger_Exp_Series://Number of Frames, Exposure Time, Acquisition Period, Number of Triggers, Delay
case Trigger_Exp_Series://#Frames, #Triggers, ExpTime, Period, Delay
lblNumFrames->setEnabled(true); spinNumFrames->setEnabled(true);
lblExpTime->setEnabled(true); spinExpTime->setEnabled(true); comboExpUnit->setEnabled(true);
lblPeriod->setEnabled(true); spinPeriod->setEnabled(true); comboPeriodUnit->setEnabled(true);
@ -505,13 +506,15 @@ void qTabMeasurement::SetTimingMode(int mode){
if(myDet->setExternalCommunicationMode(slsDetectorDefs::TRIGGER_EXPOSURE)==slsDetectorDefs::TRIGGER_EXPOSURE)
success = true;
break;
case Trigger_Frame://Exposure Time, Number of Triggers
case Trigger_Frame://ExpTime, #Triggers
setNumFrames(1);
lblExpTime->setEnabled(true); spinExpTime->setEnabled(true); comboExpUnit->setEnabled(true);
lblNumTriggers->setEnabled(true); spinNumTriggers->setEnabled(true);
if(myDet->setExternalCommunicationMode(slsDetectorDefs::TRIGGER_FRAME)==slsDetectorDefs::TRIGGER_FRAME)
success = true;
break;
case Trigger_Readout://Number of Frames, Exposure Time, Acquisition Period, Delay
case Trigger_Readout://#Frames, ExpTime, Period, Delay
setNumTriggers(1);
lblNumFrames->setEnabled(true); spinNumFrames->setEnabled(true);
lblExpTime->setEnabled(true); spinExpTime->setEnabled(true); comboExpUnit->setEnabled(true);
lblPeriod->setEnabled(true); spinPeriod->setEnabled(true); comboPeriodUnit->setEnabled(true);
@ -519,13 +522,14 @@ void qTabMeasurement::SetTimingMode(int mode){
if(myDet->setExternalCommunicationMode(slsDetectorDefs::TRIGGER_READOUT)==slsDetectorDefs::TRIGGER_READOUT)
success = true;
break;
case Gated://Number of Frames, Number of Gates
case Gated://#Frames, #Gates
setNumTriggers(1);
lblNumFrames->setEnabled(true); spinNumFrames->setEnabled(true);
lblNumGates->setEnabled(true); spinNumGates->setEnabled(true);
if(myDet->setExternalCommunicationMode(slsDetectorDefs::GATE_FIX_NUMBER)==slsDetectorDefs::GATE_FIX_NUMBER)
success = true;
break;
case Gated_Start://Number of Frames, Exposure Time, Acquisition Period, Number of Triggers, Number of Gates
case Gated_Start://#Frames, #Triggers, #Gates, ExpTime, Period
lblNumFrames->setEnabled(true); spinNumFrames->setEnabled(true);
lblExpTime->setEnabled(true); spinExpTime->setEnabled(true); comboExpUnit->setEnabled(true);
lblPeriod->setEnabled(true); spinPeriod->setEnabled(true); comboPeriodUnit->setEnabled(true);
@ -534,7 +538,8 @@ void qTabMeasurement::SetTimingMode(int mode){
if(myDet->setExternalCommunicationMode(slsDetectorDefs::GATE_WITH_START_TRIGGER)==slsDetectorDefs::GATE_WITH_START_TRIGGER)
success = true;
break;
case Trigger_Window://Number of Triggers
case Trigger_Window://#Triggers
setNumFrames(1);
lblNumTriggers->setEnabled(true); spinNumTriggers->setEnabled(true);
if(myDet->setExternalCommunicationMode(slsDetectorDefs::TRIGGER_WINDOW)==slsDetectorDefs::TRIGGER_WINDOW)
success = true;