angle done, more of trimming...save, load, yet to fix number of probes

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@45 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
l_maliakal_d 2012-08-31 15:09:13 +00:00
parent 4686cb9c0e
commit a25b74c9ab
9 changed files with 204 additions and 46 deletions

View File

@ -188,6 +188,10 @@
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Number of Triggers to be expected.
#cycles#</string>
</property>
<property name="text">
<string>Number of Triggers:</string>
</property>
@ -205,8 +209,8 @@
</sizepolicy>
</property>
<property name="toolTip">
<string>Run index (automatically incremented)
#index#</string>
<string>Number of Triggers to be expected.
#cycles#</string>
</property>
<property name="statusTip">
<string/>
@ -221,7 +225,7 @@
<string/>
</property>
<property name="minimum">
<number>1</number>
<number>0</number>
</property>
<property name="maximum">
<number>2000000000</number>
@ -236,6 +240,10 @@
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>The Delay between Trigger Edge and Start of Exposure ( or Readout).
#delay#</string>
</property>
<property name="text">
<string>Delay After Trigger:</string>
</property>
@ -253,8 +261,8 @@
</sizepolicy>
</property>
<property name="toolTip">
<string>Frame period between exposures.
#period#</string>
<string>The Delay between Trigger Edge and Start of Exposure ( or Readout).
#delay#</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
@ -281,6 +289,10 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>The Delay between Trigger Edge and Start of Exposure ( or Readout).
#delay#</string>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
@ -330,6 +342,10 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Number of Gate Signals per Frame.
#gates#</string>
</property>
<property name="text">
<string>Number of Gates:</string>
</property>
@ -347,8 +363,8 @@
</sizepolicy>
</property>
<property name="toolTip">
<string>Run index (automatically incremented)
#index#</string>
<string>Number of Gate Signals per Frame.
#gates#</string>
</property>
<property name="statusTip">
<string/>
@ -363,7 +379,7 @@
<string/>
</property>
<property name="minimum">
<number>1</number>
<number>0</number>
</property>
<property name="maximum">
<number>2000000000</number>
@ -384,6 +400,10 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>The data are accumulated over several (frames) pump-cycles. Set cycles to 1.
#probes#</string>
</property>
<property name="text">
<string>Number of Probes:</string>
</property>
@ -401,8 +421,8 @@
</sizepolicy>
</property>
<property name="toolTip">
<string>Run index (automatically incremented)
#index#</string>
<string>The data are accumulated over several (frames) pump-cycles. Set cycles to 1.
#probes#</string>
</property>
<property name="statusTip">
<string/>
@ -417,7 +437,7 @@
<string/>
</property>
<property name="minimum">
<number>1</number>
<number>0</number>
</property>
<property name="maximum">
<number>2000000000</number>
@ -626,8 +646,15 @@
<bool>false</bool>
</property>
<property name="toolTip">
<string>Frame period between exposures.
#period#</string>
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;table style=&quot;-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;&quot;&gt;
&lt;tr&gt;
&lt;td style=&quot;border: none;&quot;&gt;
&lt;p align=&quot;justify&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Frame period between exposures. &lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; #period#&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Acquisition Period:</string>
@ -646,8 +673,15 @@
</sizepolicy>
</property>
<property name="toolTip">
<string>Frame period between exposures.
#period#</string>
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;table style=&quot;-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;&quot;&gt;
&lt;tr&gt;
&lt;td style=&quot;border: none;&quot;&gt;
&lt;p align=&quot;justify&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Frame period between exposures. &lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; #period#&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
@ -674,6 +708,17 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;table style=&quot;-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;&quot;&gt;
&lt;tr&gt;
&lt;td style=&quot;border: none;&quot;&gt;
&lt;p align=&quot;justify&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Frame period between exposures. &lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; #period#&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>

View File

@ -111,7 +111,6 @@ private:
/**if the developer tab should be enabled,known from command line */
int isDeveloper;
/**Sets up the layout of the widget
* */
void SetUpWidgetWindow();

View File

@ -6,7 +6,7 @@ UI_HEADERS_DIR = forms/include
RESOURCES += icons.qrc
DEFINES += VERBOSE DACS_INT #VERYVERBOSE
DEFINES += VERBOSE #VERYVERBOSE #DACS_INT
target.path += $(DESTDIR)

View File

@ -97,15 +97,15 @@ void qDetectorMain::SetUpWidgetWindow(){
tabs = new MyTabWidget(this);
layoutTabs->addWidget(tabs);
// creating all the tab widgets
tab_messages = new qTabMessages (this, myDet);
tab_measurement = new qTabMeasurement (this, myDet,myPlot);
tab_dataoutput = new qTabDataOutput (this, myDet, detID);
tab_plot = new qTabPlot (this, myDet,myPlot);
tab_actions = new qTabActions (this, myDet);
tab_settings = new qTabSettings (this, myDet, detID);
tab_advanced = new qTabAdvanced (this, myDet);
tab_debugging = new qTabDebugging (this, myDet);
tab_developer = new qTabDeveloper (this, myDet);
tab_messages = new qTabMessages (this, myDet); cout<<"Messages ready"<<endl;
tab_measurement = new qTabMeasurement (this, myDet,myPlot); cout<<"Measurement ready"<<endl;
tab_dataoutput = new qTabDataOutput (this, myDet, detID); cout<<"DataOutput ready"<<endl;
tab_plot = new qTabPlot (this, myDet,myPlot); cout<<"Plot ready"<<endl;
tab_actions = new qTabActions (this, myDet); cout<<"Actions ready"<<endl;
tab_settings = new qTabSettings (this, myDet, detID); cout<<"Settings ready"<<endl;
tab_advanced = new qTabAdvanced (this, myDet); cout<<"Advanced ready"<<endl;
tab_debugging = new qTabDebugging (this, myDet); cout<<"Debugging ready"<<endl;
tab_developer = new qTabDeveloper (this, myDet); cout<<"Developer ready"<<endl;
// creating the scroll area widgets for the tabs
for(int i=0;i<NumberOfTabs;i++){
scroll[i] = new QScrollArea;
@ -154,6 +154,8 @@ void qDetectorMain::SetUpWidgetWindow(){
dockWidgetPlot->setFloating(false);
dockWidgetPlot->setFeatures(QDockWidget::NoDockWidgetFeatures);
tabs->setTabEnabled(Developer,isDeveloper);
if(!digitalDetector) actionExpert->setEnabled(false);
// Other setup
//Height of plot and central widget
@ -323,8 +325,9 @@ void qDetectorMain::ExecuteUtilities(QAction *action){
tr("Detector Setup files (*.det)"));
// Gets called when cancelled as well
if (!fName.isEmpty()){
myDet->retrieveDetectorSetup(string(fName.toAscii().constData()));
qDefs::InfoMessage("The parameters have been successfully setup.","Main");
if(myDet->retrieveDetectorSetup(string(fName.toAscii().constData()))!=slsDetectorDefs::FAIL)
qDefs::InfoMessage("The Setup Parameters have been loaded successfully.","Main");
else qDefs::WarningMessage("The Loading of Setup Parameters has failed.","Main");
}
}
else if(action==actionSaveSetup){
@ -337,8 +340,9 @@ void qDetectorMain::ExecuteUtilities(QAction *action){
tr("Detector Setup files (*.det) "));
// Gets called when cancelled as well
if (!fName.isEmpty()){
myDet->dumpDetectorSetup(string(fName.toAscii().constData()));
qDefs::InfoMessage("The setup parameters have been successfully saved.","Main");
if(myDet->dumpDetectorSetup(string(fName.toAscii().constData()))!=slsDetectorDefs::FAIL)
qDefs::InfoMessage("The Setup Parameters have been saved successfully.","Main");
else qDefs::WarningMessage("The Saving of Setup Parameters has failed.","Main");
}
}
else if(action==actionMeasurementWizard){
@ -356,8 +360,9 @@ void qDetectorMain::ExecuteUtilities(QAction *action){
tr("Configuration files (*.config)"));
// Gets called when cancelled as well
if (!fName.isEmpty()){
myDet->readConfigurationFile(string(fName.toAscii().constData()));
qDefs::InfoMessage("The parameters have been successfully configured.","Main");
if(myDet->readConfigurationFile(string(fName.toAscii().constData()))!=slsDetectorDefs::FAIL)
qDefs::InfoMessage("The Configuration Parameters have been configured successfully.","Main");
else qDefs::WarningMessage("The Loading of Configuration Parameters has failed.","Main");
}
}
else if(action==actionSaveConfiguration){
@ -370,8 +375,9 @@ void qDetectorMain::ExecuteUtilities(QAction *action){
tr("Configuration files (*.config) "));
// Gets called when cancelled as well
if (!fName.isEmpty()){
myDet->writeConfigurationFile(string(fName.toAscii().constData()));
qDefs::InfoMessage("The configuration parameters have been successfully saved.","Main");
if(myDet->writeConfigurationFile(string(fName.toAscii().constData()))!=slsDetectorDefs::FAIL)
qDefs::InfoMessage("The Configuration Parameters have been saved successfully.","Main");
else qDefs::WarningMessage("The Saving of Configuration Parameters has failed.","Main");
}
}
else if(action==actionLoadTrimbits){
@ -384,8 +390,104 @@ void qDetectorMain::ExecuteUtilities(QAction *action){
tr("Trimbit files (*.trim *.sn*)"));
// Gets called when cancelled as well
if (!fName.isEmpty()){
//myDet->readConfigurationFile(string(fName.toAscii().constData()));
qDefs::InfoMessage("The parameters have been successfully configured.","Main");
if(myDet->loadSettingsFile(string(fName.toAscii().constData()),-1)!=slsDetectorDefs::FAIL)
qDefs::InfoMessage("The Trimbits have been loaded successfully.","Main");
else qDefs::WarningMessage("The Loading of Trimbits has failed.","Main");
}
}
else if(action==actionSaveTrimbits){
#ifdef VERBOSE
cout << "Saving Trimbits" << endl;
#endif
QString fName = QString(myDet->getFilePath().c_str());
fName = QFileDialog::getSaveFileName(this,
tr("Save Current Detector Trimbits"),fName,
tr("Trimbit files (*.trim *.sn*) "));
// Gets called when cancelled as well
if (!fName.isEmpty()){
if(myDet->saveSettingsFile(string(fName.toAscii().constData()),-1)!=slsDetectorDefs::FAIL)
qDefs::InfoMessage("The Trimbits have been saved successfully.","Main");
else qDefs::WarningMessage("The Saving of Trimbits has failed.","Main");
}
}
else if(action==actionLoadCalibration){
#ifdef VERBOSE
cout << "Loading Calibration Data" << endl;
#endif
QString fName = QString(myDet->getFilePath().c_str());
fName = QFileDialog::getOpenFileName(this,
tr("Load Detector Calibration Data"),fName,
tr("Calibration files (*.cal *.sn*)"));
// Gets called when cancelled as well
if (!fName.isEmpty()){
int nMod = myDet->setNumberOfModules();
slsDetector *detector;
slsDetectorDefs::sls_detector_module *myMod=NULL;
string sFname= fName.toAscii().constData();
double gain,offset;
for(int i=0;i<nMod;i++){
string fn = sFname;
detector = myDet->getSlsDetector(i);
if(detector){
if (sFname.find(".cal")==string::npos) {
if (sFname.find(".sn")==string::npos && sFname.find(".cal")) {
ostringstream ostfn;
ostfn << sFname << ".sn" << setfill('0') << setw(3) << hex << myDet->getId(slsDetectorDefs::MODULE_SERIAL_NUMBER, i);
fn=ostfn.str();
}}
if(detector->readCalibrationFile(fn,gain,offset)==-1)
qDefs::WarningMessage(string("Could not open Calibration File.\n")+ fn,"Main");
else{
if(myMod = detector->getModule(i)){
myMod->gain = gain;
myMod->offset = offset;
detector->setModule(*myMod);
detector->deleteModule(myMod);
}
}
}
detector = NULL;
}
//if(energyConversion::readCalibrationFile(string(fName.toAscii().constData()),-1)!=slsDetectorDefs::FAIL)
// qDefs::InfoMessage("The Calibration Data have been loaded successfully.","Main");
//else qDefs::WarningMessage("The Loading of Calibration Data has failed.","Main");
}
}
else if(action==actionSaveCalibration){
#ifdef VERBOSE
cout << "Saving Calibration Data" << endl;
#endif
QString fName = QString(myDet->getFilePath().c_str());
fName = QFileDialog::getSaveFileName(this,
tr("Save Current Detector Calibration Data"),fName,
tr("Calibration files (*.cal *.sn*) "));
// Gets called when cancelled as well
if (!fName.isEmpty()){
int nMod = myDet->setNumberOfModules();
cout<<"nmode:"<<nMod<<endl;
slsDetector *detector;
slsDetectorDefs::sls_detector_module *myMod=NULL;
string sFname= fName.toAscii().constData();
double gain,offset;
for(int i=0;i<nMod;i++){
string fn = sFname;
detector = myDet->getSlsDetector(i);
if(detector){
ostringstream ostfn;
ostfn << sFname << ".sn" << setfill('0') << setw(3) << hex << myDet->getId(slsDetectorDefs::MODULE_SERIAL_NUMBER, i);
fn=ostfn.str();
if(myMod = detector->getModule(i)){
if(detector->writeCalibrationFile(fn,myMod->gain,myMod->offset)==-1)
qDefs::WarningMessage(string("Could not open Calibration File.\n")+ fn,"Main");
detector->deleteModule(myMod);
}
}
detector = NULL;
}
//if(energyConversion::writeCalibrationFile(string(fName.toAscii().constData()),-1)!=slsDetectorDefs::FAIL)
// qDefs::InfoMessage("The Calibration Data have been saved successfully.","Main");
//else qDefs::WarningMessage("The Saving of Calibration Data has failed.","Main");
}
}

View File

@ -211,9 +211,14 @@ void qDrawPlot::StartStopDaqToggle(bool stop_if_running){
//get #scansets for level 0 and level 1
int numScan0 = myDet->getScanSteps(0); numScan0 = ((numScan0==0)?1:numScan0);
int numScan1 = myDet->getScanSteps(1); numScan1 = ((numScan1==0)?1:numScan1);
int numPos = myDet->getPositions(); numPos = ((numPos==0) ?1:numPos);
number_of_exposures = number_of_frames * numScan0 * numScan1 * numPos;
number_of_exposures = number_of_frames * numScan0 * numScan1;
if(anglePlot) {
int numPos = myDet->getPositions(); //numPos = ((numPos==0) ?1:numPos);
number_of_exposures = numScan0 * numScan1;/*number_of_exposures * numPos;*/
}
cout << "\tNumber of Exposures:" << number_of_exposures << endl;
// ExposureTime
@ -616,7 +621,7 @@ void qDrawPlot::Clear1DPlot(){
void qDrawPlot::UpdatePlot(){
#ifdef VERYVERBOSE
cout << "Entering UpdatePlot function" << endl;
/*cout << "Entering UpdatePlot function" << endl;*/
#endif
plot_update_timer->stop();
@ -628,7 +633,7 @@ void qDrawPlot::UpdatePlot(){
if(lastImageNumber){
if(histNBins){
#ifdef VERYVERBOSE
cout << "Last Image Number: " << lastImageNumber << endl;
/*cout << "Last Image Number: " << lastImageNumber << endl;*/
#endif
Clear1DPlot();
plot1D->SetXTitle(histXAxisTitle.toAscii().constData());

View File

@ -44,13 +44,14 @@ void qTabDebugging::SetupWidgetWindow(){
else lblModule->setText("Module Number:");
// loading combo box module numbers
int max = myDet->setNumberOfModules(GET_FLAG,slsDetectorDefs::X)*myDet->setNumberOfModules(GET_FLAG,slsDetectorDefs::Y);
for(int i=0;i<max;i++){
int max = myDet->setNumberOfModules();
/* for(int i=0;i<max;i++){
slsDetector *s = myDet->getSlsDetector(i);
if(s->setTCPSocket()!=slsDetectorDefs::FAIL){
comboModule->addItem(QString::number(i));
}
}
}*/
}
//-------------------------------------------------------------------------------------------------------------------------------------------------

View File

@ -154,7 +154,7 @@ void qTabDeveloper::SetupWidgetWindow(){
void qTabDeveloper::Initialization(){
connect(adcTimer, SIGNAL(timeout()), this, SLOT(RefreshAdcs()));
if(NUM_ADC_WIDGETS) connect(adcTimer, SIGNAL(timeout()), this, SLOT(RefreshAdcs()));
for(int i=0;i<NUM_DAC_WIDGETS;i++)
connect(spinDacs[i], SIGNAL(editingFinished(int)), this, SLOT(SetDacValues(int)));
@ -262,6 +262,7 @@ slsDetectorDefs::dacIndex qTabDeveloper::getSLSIndex(int index){
Refresh();
break;
}
break;
case slsDetectorDefs::EIGER:
return slsDetectorDefs::HUMIDITY;
/**fill in here*/
@ -283,11 +284,13 @@ slsDetectorDefs::dacIndex qTabDeveloper::getSLSIndex(int index){
Refresh();
break;
}
break;
default:
qDefs::ErrorMessage(string("Unknown detector type:")+myDet->slsDetectorBase::getDetectorType(detType),"Developer");
exit(-1);
break;
}
return slsDetectorDefs::HUMIDITY;
}
@ -316,7 +319,7 @@ void qTabDeveloper::Refresh(){
for(int i=0;i<NUM_DAC_WIDGETS;i++)
spinDacs[i]->setValue((double)myDet->setDAC(-1,getSLSIndex(i)));
//adcs
RefreshAdcs();
if(NUM_ADC_WIDGETS) RefreshAdcs();
//gotthard -high voltage
if(detType == slsDetectorDefs::GOTTHARD){

View File

@ -493,7 +493,7 @@ void qTabPlot::SetFrequency(){
void qTabPlot::EnableScanBox(){
#ifdef VERYVERBOSE
cout << "Entering Enable Scan Box() \t mode:" << mode << " \t id:" << id << endl;
cout << "Entering Enable Scan Box()" << endl;
#endif
int mode0 = myDet->getScanMode(0);

View File

@ -41,6 +41,9 @@ void qTabSettings::SetupWidgetWindow(){
SetupDetectorSettings();
comboSettings->setCurrentIndex(myDet->getSettings(detID));
//threshold
spinThreshold->setValue(myDet->getThresholdEnergy());
//expert mode is not enabled initially
lblThreshold->setEnabled(false);
spinThreshold->setEnabled(false);