mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-29 17:40:01 +02:00
checking conditions before trimming and settings include low noise now, so a few changes
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@224 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
parent
f2a77be1b2
commit
440b244b66
@ -1250,7 +1250,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
<y>20</y>
|
<y>20</y>
|
||||||
<width>348</width>
|
<width>346</width>
|
||||||
<height>26</height>
|
<height>26</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@ -1284,7 +1284,7 @@
|
|||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>9</width>
|
<width>7</width>
|
||||||
<height>10</height>
|
<height>10</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
@ -1313,7 +1313,7 @@
|
|||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>9</width>
|
<width>7</width>
|
||||||
<height>10</height>
|
<height>10</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
@ -1342,7 +1342,7 @@
|
|||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>9</width>
|
<width>7</width>
|
||||||
<height>10</height>
|
<height>10</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
@ -95,6 +95,11 @@
|
|||||||
<string>Very High Gain</string>
|
<string>Very High Gain</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Low Noise</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Undefined</string>
|
<string>Undefined</string>
|
||||||
|
@ -57,7 +57,7 @@ private:
|
|||||||
/** expert mode */
|
/** expert mode */
|
||||||
bool expertMode;
|
bool expertMode;
|
||||||
|
|
||||||
enum{Standard,Fast,HighGain,DynamicGain,LowGain,MediumGain,VeryHighGain,Undefined,Uninitialized,NumSettings};
|
enum{Standard,Fast,HighGain,DynamicGain,LowGain,MediumGain,VeryHighGain,LowNoise,Undefined,Uninitialized,NumSettings};
|
||||||
|
|
||||||
/** To be able to index items on a combo box */
|
/** To be able to index items on a combo box */
|
||||||
QStandardItemModel* model;
|
QStandardItemModel* model;
|
||||||
|
@ -97,7 +97,7 @@ void qTabAdvanced::SetupWidgetWindow(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//logs
|
//logs and trimming
|
||||||
if(!isAngular && !isEnergy) boxLogs->setEnabled(false);
|
if(!isAngular && !isEnergy) boxLogs->setEnabled(false);
|
||||||
else{
|
else{
|
||||||
if(!isAngular) chkAngularLog->setEnabled(false);
|
if(!isAngular) chkAngularLog->setEnabled(false);
|
||||||
@ -114,7 +114,7 @@ void qTabAdvanced::SetupWidgetWindow(){
|
|||||||
btnGroup->addButton(btnGetTrimbits,1);
|
btnGroup->addButton(btnGetTrimbits,1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
trimmingMode = slsDetectorDefs::NOISE_TRIMMING;
|
||||||
|
|
||||||
//network
|
//network
|
||||||
|
|
||||||
@ -302,12 +302,12 @@ void qTabAdvanced::SetThreshold(){
|
|||||||
|
|
||||||
void qTabAdvanced::SetOutputFile(){
|
void qTabAdvanced::SetOutputFile(){
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "Setting Output File for Trimming" << endl;
|
cout << "Setting Output File for Trimming:" << endl;
|
||||||
#endif
|
#endif
|
||||||
QString dirPath = dispFile->text().section('/',0,-2,QString::SectionIncludeLeadingSep);
|
QString dirPath = dispFile->text().section('/',0,-2,QString::SectionIncludeLeadingSep);
|
||||||
cout<<"directory:"<<dirPath.toAscii().constData()<<"..."<<endl;
|
cout << "Directory:" << dirPath.toAscii().constData() << "." << endl;
|
||||||
QString fName = dispFile->text().section('/',-1);
|
QString fName = dispFile->text().section('/',-1);
|
||||||
cout<<"file name:"<<fName.toAscii().constData()<<"..."<<endl;
|
cout << "File Name:" << fName.toAscii().constData() << "." << endl;
|
||||||
//checks if directory exists and file name is not empty
|
//checks if directory exists and file name is not empty
|
||||||
if((QFile::exists(dirPath))&&(!fName.isEmpty())){
|
if((QFile::exists(dirPath))&&(!fName.isEmpty())){
|
||||||
|
|
||||||
@ -359,7 +359,7 @@ void qTabAdvanced::SetOutputFile(){
|
|||||||
|
|
||||||
void qTabAdvanced::BrowseOutputFile(){
|
void qTabAdvanced::BrowseOutputFile(){
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "Browsing Output Dir for Trimming:" << endl;
|
cout << "Browsing Output Dir for Trimming" << endl;
|
||||||
#endif
|
#endif
|
||||||
QString fName = dispFile->text();
|
QString fName = dispFile->text();
|
||||||
//dialog
|
//dialog
|
||||||
@ -441,6 +441,7 @@ int qTabAdvanced::validateBeforeTrimming(){
|
|||||||
cout << "Validating conditions before Trimming" << endl;
|
cout << "Validating conditions before Trimming" << endl;
|
||||||
#endif
|
#endif
|
||||||
char temp[100];
|
char temp[100];
|
||||||
|
string message = "<nobr>All conditions satisfied for Trimming.</nobr><br>";
|
||||||
switch(detType){
|
switch(detType){
|
||||||
case slsDetectorDefs::MYTHEN:
|
case slsDetectorDefs::MYTHEN:
|
||||||
|
|
||||||
@ -453,43 +454,47 @@ int qTabAdvanced::validateBeforeTrimming(){
|
|||||||
"<nobr>Could not set dynamic range to ") + string(temp)+string(".</nobr><br>"
|
"<nobr>Could not set dynamic range to ") + string(temp)+string(".</nobr><br>"
|
||||||
"Trimming Aborted."),"qTabAdvanced::validateBeforeTrimming");
|
"Trimming Aborted."),"qTabAdvanced::validateBeforeTrimming");
|
||||||
return slsDetectorDefs::FAIL;
|
return slsDetectorDefs::FAIL;
|
||||||
}
|
}else
|
||||||
|
message.append(string("<nobr><b>Dynamic Range</b> has been changed to ") + string(temp) + string(".<nobr><br>"));
|
||||||
}
|
}
|
||||||
//frames
|
//frames
|
||||||
if((int)myDet->setTimer(slsDetectorDefs::FRAME_NUMBER,-1) != TRIMMING_FRAME_NUMBER){
|
if((int)myDet->setTimer(slsDetectorDefs::FRAME_NUMBER,-1) != TRIMMING_FRAME_NUMBER){
|
||||||
if((int)myDet->setTimer(slsDetectorDefs::FRAME_NUMBER,TRIMMING_FRAME_NUMBER) != TRIMMING_FRAME_NUMBER){
|
|
||||||
sprintf(temp,"%d",TRIMMING_FRAME_NUMBER);
|
sprintf(temp,"%d",TRIMMING_FRAME_NUMBER);
|
||||||
|
if((int)myDet->setTimer(slsDetectorDefs::FRAME_NUMBER,TRIMMING_FRAME_NUMBER) != TRIMMING_FRAME_NUMBER){
|
||||||
qDefs::Message(qDefs::WARNING,
|
qDefs::Message(qDefs::WARNING,
|
||||||
string("<nobr>Trimming Pre-condition not satisfied:</nobr><br>"
|
string("<nobr>Trimming Pre-condition not satisfied:</nobr><br>"
|
||||||
"<nobr>Could not set <b>Number of Frames</b> to ") + string(temp)+string(".</nobr><br>"
|
"<nobr>Could not set <b>Number of Frames</b> to ") + string(temp)+string(".</nobr><br>"
|
||||||
"Trimming Aborted."),"qTabAdvanced::validateBeforeTrimming");
|
"Trimming Aborted."),"qTabAdvanced::validateBeforeTrimming");
|
||||||
return slsDetectorDefs::FAIL;
|
return slsDetectorDefs::FAIL;
|
||||||
}
|
}else
|
||||||
|
message.append(string("<nobr><b>Number of Frames</b> has been changed to ") + string(temp) + string(".<nobr><br>"));
|
||||||
}
|
}
|
||||||
//trigger
|
//trigger
|
||||||
if((int)myDet->setTimer(slsDetectorDefs::CYCLES_NUMBER,-1) != TRIMMING_TRIGGER_NUMBER){
|
if((int)myDet->setTimer(slsDetectorDefs::CYCLES_NUMBER,-1) != TRIMMING_TRIGGER_NUMBER){
|
||||||
if((int)myDet->setTimer(slsDetectorDefs::CYCLES_NUMBER,TRIMMING_TRIGGER_NUMBER) != TRIMMING_TRIGGER_NUMBER){
|
|
||||||
sprintf(temp,"%d",TRIMMING_TRIGGER_NUMBER);
|
sprintf(temp,"%d",TRIMMING_TRIGGER_NUMBER);
|
||||||
|
if((int)myDet->setTimer(slsDetectorDefs::CYCLES_NUMBER,TRIMMING_TRIGGER_NUMBER) != TRIMMING_TRIGGER_NUMBER){
|
||||||
qDefs::Message(qDefs::WARNING,
|
qDefs::Message(qDefs::WARNING,
|
||||||
string("<nobr>Trimming Pre-condition not satisfied:</nobr><br>"
|
string("<nobr>Trimming Pre-condition not satisfied:</nobr><br>"
|
||||||
"<nobr>Could not set <b>Number of Triggers</b> to ") + string(temp)+string(".</nobr><br>"
|
"<nobr>Could not set <b>Number of Triggers</b> to ") + string(temp)+string(".</nobr><br>"
|
||||||
"Trimming Aborted."),"qTabAdvanced::validateBeforeTrimming");
|
"Trimming Aborted."),"qTabAdvanced::validateBeforeTrimming");
|
||||||
return slsDetectorDefs::FAIL;
|
return slsDetectorDefs::FAIL;
|
||||||
}
|
}else
|
||||||
|
message.append(string("<nobr><b>Number of Triggers</b> has been changed to ") + string(temp) + string(".<nobr><br>"));
|
||||||
}
|
}
|
||||||
//probes
|
//probes
|
||||||
if((int)myDet->setTimer(slsDetectorDefs::PROBES_NUMBER,-1) != TRIMMING_PROBE_NUMBER){
|
if((int)myDet->setTimer(slsDetectorDefs::PROBES_NUMBER,-1) != TRIMMING_PROBE_NUMBER){
|
||||||
if((int)myDet->setTimer(slsDetectorDefs::PROBES_NUMBER,TRIMMING_PROBE_NUMBER) != TRIMMING_PROBE_NUMBER){
|
|
||||||
sprintf(temp,"%d",TRIMMING_PROBE_NUMBER);
|
sprintf(temp,"%d",TRIMMING_PROBE_NUMBER);
|
||||||
|
if((int)myDet->setTimer(slsDetectorDefs::PROBES_NUMBER,TRIMMING_PROBE_NUMBER) != TRIMMING_PROBE_NUMBER){
|
||||||
qDefs::Message(qDefs::WARNING,
|
qDefs::Message(qDefs::WARNING,
|
||||||
string("<nobr>Trimming Pre-condition not satisfied:</nobr><br>"
|
string("<nobr>Trimming Pre-condition not satisfied:</nobr><br>"
|
||||||
"<nobr>Could not set <b>Number of Probes</b> to ") + string(temp)+string(".</nobr><br>"
|
"<nobr>Could not set <b>Number of Probes</b> to ") + string(temp)+string(".</nobr><br>"
|
||||||
"Trimming Aborted."),"qTabAdvanced::validateBeforeTrimming");
|
"Trimming Aborted."),"qTabAdvanced::validateBeforeTrimming");
|
||||||
return slsDetectorDefs::FAIL;
|
return slsDetectorDefs::FAIL;
|
||||||
}
|
}else
|
||||||
|
message.append(string("<nobr><b>Number of Probes</b> has been changed to ") + string(temp) + string(".<nobr><br>"));
|
||||||
}
|
}
|
||||||
//Setting
|
//Setting
|
||||||
if((int)myDet->getSettings() == slsDetectorDefs::UNINITIALIZED){
|
if(myDet->getSettings() == slsDetectorDefs::UNINITIALIZED){
|
||||||
if(qDefs::Message(qDefs::QUESTION,
|
if(qDefs::Message(qDefs::QUESTION,
|
||||||
string("<nobr>Trimming Pre-condition not satisfied:</nobr><br>")+
|
string("<nobr>Trimming Pre-condition not satisfied:</nobr><br>")+
|
||||||
string("<nobr><b>Settings</b> cannot be <b>Uninitialized</b> to start Trimming.</nobr><br>"
|
string("<nobr><b>Settings</b> cannot be <b>Uninitialized</b> to start Trimming.</nobr><br>"
|
||||||
@ -507,16 +512,20 @@ int qTabAdvanced::validateBeforeTrimming(){
|
|||||||
"<nobr>Could not change <b>Settings</b> to <b>Standard</b></nobr><br>"
|
"<nobr>Could not change <b>Settings</b> to <b>Standard</b></nobr><br>"
|
||||||
"Trimming Aborted."),"qTabAdvanced::validateBeforeTrimming");
|
"Trimming Aborted."),"qTabAdvanced::validateBeforeTrimming");
|
||||||
return slsDetectorDefs::FAIL;
|
return slsDetectorDefs::FAIL;
|
||||||
|
}else
|
||||||
|
message.append(string("<nobr><b>Settings</b> has been changed to Standard.<nobr><br>"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
|
|
||||||
qDefs::Message(qDefs::INFORMATION,"<nobr>All conditions satisfied for Trimming.</nobr><br>"
|
|
||||||
"<nobr>Initiating Trimming...</nobr>","qTabAdvanced::validateBeforeTrimming");
|
|
||||||
return slsDetectorDefs::OK;
|
|
||||||
default:
|
default:
|
||||||
return slsDetectorDefs::FAIL;
|
return slsDetectorDefs::FAIL;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message.append("<nobr>Initiating Trimming...</nobr>");
|
||||||
|
qDefs::Message(qDefs::INFORMATION,message,"qTabAdvanced::validateBeforeTrimming");
|
||||||
|
return slsDetectorDefs::OK;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -565,7 +574,7 @@ void qTabAdvanced::StartTrimming(){
|
|||||||
if(!optimize) parameter2 = 0;
|
if(!optimize) parameter2 = 0;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
cout << "Should never come here. Start Trimming will have only 2 methods." << endl;
|
cout << "Should never come here. Start Trimming will have only 2 methods. Trimming Method:" << trimmingMode << endl;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,15 +93,17 @@ void qTabSettings::SetupDetectorSettings(){
|
|||||||
item[(int)LowGain]->setEnabled(false);
|
item[(int)LowGain]->setEnabled(false);
|
||||||
item[(int)MediumGain]->setEnabled(false);
|
item[(int)MediumGain]->setEnabled(false);
|
||||||
item[(int)VeryHighGain]->setEnabled(false);
|
item[(int)VeryHighGain]->setEnabled(false);
|
||||||
|
item[(int)LowNoise]->setEnabled(false);
|
||||||
break;
|
break;
|
||||||
case slsDetectorDefs::EIGER:
|
case slsDetectorDefs::EIGER:
|
||||||
item[(int)Standard]->setEnabled(false);
|
item[(int)Standard]->setEnabled(true);
|
||||||
item[(int)Fast]->setEnabled(false);
|
item[(int)Fast]->setEnabled(false);
|
||||||
item[(int)HighGain]->setEnabled(false);
|
item[(int)HighGain]->setEnabled(true);
|
||||||
item[(int)DynamicGain]->setEnabled(false);
|
item[(int)DynamicGain]->setEnabled(false);
|
||||||
item[(int)LowGain]->setEnabled(false);
|
item[(int)LowGain]->setEnabled(false);
|
||||||
item[(int)MediumGain]->setEnabled(false);
|
item[(int)MediumGain]->setEnabled(false);
|
||||||
item[(int)VeryHighGain]->setEnabled(false);
|
item[(int)VeryHighGain]->setEnabled(false);
|
||||||
|
item[(int)LowNoise]->setEnabled(true);
|
||||||
break;
|
break;
|
||||||
case slsDetectorDefs::MOENCH:
|
case slsDetectorDefs::MOENCH:
|
||||||
case slsDetectorDefs::GOTTHARD:
|
case slsDetectorDefs::GOTTHARD:
|
||||||
@ -112,6 +114,7 @@ void qTabSettings::SetupDetectorSettings(){
|
|||||||
item[(int)LowGain]->setEnabled(true);
|
item[(int)LowGain]->setEnabled(true);
|
||||||
item[(int)MediumGain]->setEnabled(true);
|
item[(int)MediumGain]->setEnabled(true);
|
||||||
item[(int)VeryHighGain]->setEnabled(true);
|
item[(int)VeryHighGain]->setEnabled(true);
|
||||||
|
item[(int)LowNoise]->setEnabled(false);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
qDefs::Message(qDefs::CRITICAL,"Unknown detector type. Exiting GUI.","qTabSettings::SetupDetectorSettings");
|
qDefs::Message(qDefs::CRITICAL,"Unknown detector type. Exiting GUI.","qTabSettings::SetupDetectorSettings");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user