mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 18:17:59 +02:00
eiger receiver, receiving many packets at a time, with 16,8, 4 bitmode sort of working
This commit is contained in:
@ -2929,8 +2929,8 @@ slsDetectorDefs::detectorSettings slsDetector::setSettings( detectorSettings ise
|
||||
case EIGER:
|
||||
//settings is saved in myMod.reg
|
||||
myMod->reg=thisDetector->currentSettings;
|
||||
ostfn << thisDetector->settingsDir << ssettings <<"/settings."<< setw(6) << hex << getId(DETECTOR_SERIAL_NUMBER) << setbase(10);
|
||||
oscfn << thisDetector->calDir << ssettings << "/calibration."<<setw(6) << hex << getId(DETECTOR_SERIAL_NUMBER) << setbase(10);
|
||||
ostfn << thisDetector->settingsDir << ssettings <<"/noise.sn"<< setw(6) << hex << getId(DETECTOR_SERIAL_NUMBER) << setbase(10);
|
||||
oscfn << thisDetector->calDir << ssettings << "/calibration.sn"<<setw(6) << hex << getId(DETECTOR_SERIAL_NUMBER) << setbase(10);
|
||||
#ifdef VERBOSE
|
||||
std::cout<< thisDetector->settingsDir<<endl<< thisDetector->calDir <<endl;
|
||||
#endif
|
||||
@ -2964,11 +2964,11 @@ slsDetectorDefs::detectorSettings slsDetector::setSettings( detectorSettings ise
|
||||
} else {
|
||||
ostringstream ostfn,oscfn;
|
||||
switch(thisDetector->myDetectorType){
|
||||
case EIGER:
|
||||
case MOENCH:
|
||||
case GOTTHARD:
|
||||
ostfn << thisDetector->settingsDir << ssettings << ssettings << ".settings";
|
||||
break;
|
||||
case EIGER:
|
||||
default:
|
||||
ostfn << thisDetector->settingsDir << ssettings << ssettings << ".trim";
|
||||
break;
|
||||
@ -3556,9 +3556,9 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t){
|
||||
if (t>=0)
|
||||
thisDetector->timerValue[index]=t;
|
||||
}
|
||||
#ifdef VERBOSE
|
||||
//#ifdef VERBOSE
|
||||
std::cout<< "Timer " << index << " set to "<< thisDetector->timerValue[index] << "ns" << std::endl;
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
if ((thisDetector->myDetectorType==MYTHEN)&&(index==PROBES_NUMBER)) {
|
||||
setDynamicRange();
|
||||
@ -4102,12 +4102,12 @@ int slsDetector::setDynamicRange(int n){
|
||||
if(thisDetector->myDetectorType==MYTHEN){
|
||||
if (thisDetector->timerValue[PROBES_NUMBER]!=0)
|
||||
thisDetector->dataBytes=thisDetector->nMod[X]*thisDetector->nMod[Y]*thisDetector->nChips*thisDetector->nChans*4;
|
||||
|
||||
if (retval==32)
|
||||
thisDetector->dynamicRange=24;
|
||||
}
|
||||
|
||||
|
||||
if (retval==32)
|
||||
thisDetector->dynamicRange=24;
|
||||
else
|
||||
thisDetector->dynamicRange=retval;
|
||||
|
||||
|
||||
@ -5660,12 +5660,13 @@ int slsDetector::loadSettingsFile(string fname, int imod) {
|
||||
for (int im=mmin; im<mmax; im++) {
|
||||
ostringstream ostfn;
|
||||
ostfn << fname;
|
||||
if (fname.find(".sn")==string::npos && fname.find(".trim")==string::npos && fname.find(".settings")==string::npos) {
|
||||
ostfn << ".sn" << setfill('0') << setw(3) << hex << getId(MODULE_SERIAL_NUMBER, im);
|
||||
fn=ostfn.str();
|
||||
}
|
||||
if (fname.find(".beb")==string::npos && fname.find(".trim")==string::npos && fname.find(".settings")==string::npos) {
|
||||
ostfn << "." << setw(6) << hex << getId(DETECTOR_SERIAL_NUMBER, im);
|
||||
if(thisDetector->myDetectorType != EIGER){
|
||||
if (fname.find(".sn")==string::npos && fname.find(".trim")==string::npos && fname.find(".settings")==string::npos) {
|
||||
ostfn << ".sn" << setfill('0') << setw(3) << hex << getId(MODULE_SERIAL_NUMBER, im);
|
||||
fn=ostfn.str();
|
||||
}
|
||||
}else if (fname.find(".sn")==string::npos && fname.find(".trim")==string::npos && fname.find(".settings")==string::npos) {
|
||||
ostfn << ".sn" << setw(6) << hex << getId(DETECTOR_SERIAL_NUMBER, im);
|
||||
fn=ostfn.str();
|
||||
}
|
||||
myMod=readSettingsFile(fn, thisDetector->myDetectorType);
|
||||
@ -5697,7 +5698,7 @@ int slsDetector::saveSettingsFile(string fname, int imod) {
|
||||
for (int im=mmin; im<mmax; im++) {
|
||||
ostringstream ostfn;
|
||||
if(thisDetector->myDetectorType == EIGER)
|
||||
ostfn << fname << "." << setw(6) << hex << getId(DETECTOR_SERIAL_NUMBER);
|
||||
ostfn << fname << ".sn" << setw(6) << hex << getId(DETECTOR_SERIAL_NUMBER);
|
||||
else
|
||||
ostfn << fname << ".sn" << setfill('0') << setw(3) << hex << getId(MODULE_SERIAL_NUMBER,im);
|
||||
if ((myMod=getModule(im))) {
|
||||
@ -5725,10 +5726,11 @@ int slsDetector::loadCalibrationFile(string fname, int imod) {
|
||||
for (int im=mmin; im<mmax; im++) {
|
||||
ostringstream ostfn;
|
||||
ostfn << fname ;
|
||||
if (fname.find(".sn")==string::npos && fname.find(".cal")==string::npos) {
|
||||
ostfn << ".sn" << setfill('0') << setw(3) << hex << getId(MODULE_SERIAL_NUMBER, im);
|
||||
}
|
||||
if (fname.find(".beb")==string::npos && fname.find(".cal")==string::npos) {
|
||||
if(thisDetector->myDetectorType != EIGER){
|
||||
if (fname.find(".sn")==string::npos && fname.find(".cal")==string::npos) {
|
||||
ostfn << ".sn" << setfill('0') << setw(3) << hex << getId(MODULE_SERIAL_NUMBER, im);
|
||||
}
|
||||
}else if (fname.find(".sn")==string::npos && fname.find(".cal")==string::npos) {
|
||||
ostfn << "." << setw(6) << hex << getId(DETECTOR_SERIAL_NUMBER);
|
||||
}
|
||||
fn=ostfn.str();
|
||||
@ -5758,7 +5760,7 @@ int slsDetector::saveCalibrationFile(string fname, int imod) {
|
||||
for (int im=mmin; im<mmax; im++) {
|
||||
ostringstream ostfn;
|
||||
if(thisDetector->myDetectorType == EIGER)
|
||||
ostfn << fname << "." << setw(6) << hex << getId(DETECTOR_SERIAL_NUMBER);
|
||||
ostfn << fname << ".sn" << setw(6) << hex << getId(DETECTOR_SERIAL_NUMBER);
|
||||
else
|
||||
ostfn << fname << ".sn" << setfill('0') << setw(3) << hex << getId(MODULE_SERIAL_NUMBER,im);
|
||||
if ((myMod=getModule(im))) {
|
||||
@ -6672,3 +6674,53 @@ void slsDetector::setDetectorHostname(){
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
int slsDetector::enableTenGigabitEthernet(int i){
|
||||
int ret=FAIL;
|
||||
int retval = -1;
|
||||
int fnum=F_ENABLE_TEN_GIGA,fnum2 = F_ENABLE_RECEIVER_TEN_GIGA;
|
||||
char mess[100];
|
||||
|
||||
#ifdef VERBOSE
|
||||
std::cout<< std::endl<< "Enabling / Disabling 10Gbe" << endl;
|
||||
#endif
|
||||
|
||||
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
||||
if (connectControl() == OK){
|
||||
controlSocket->SendDataOnly(&fnum,sizeof(fnum));
|
||||
controlSocket->SendDataOnly(&i,sizeof(i));
|
||||
controlSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
||||
if (ret==FAIL){
|
||||
controlSocket->ReceiveDataOnly(mess,sizeof(mess));
|
||||
std::cout<< "Detector returned error: " << mess << std::endl;
|
||||
setErrorMask((getErrorMask())|(DETECTOR_TEN_GIGA));
|
||||
}
|
||||
controlSocket->ReceiveDataOnly(&retval,sizeof(retval));
|
||||
controlSocket->Disconnect();
|
||||
if (ret==FORCE_UPDATE)
|
||||
updateDetector();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(ret!=FAIL){
|
||||
//must also configuremac
|
||||
if((i != -1)&&(retval == i))
|
||||
configureMAC();
|
||||
|
||||
ret = FAIL;
|
||||
retval=-1;
|
||||
if(setReceiverOnline(ONLINE_FLAG)==ONLINE_FLAG){
|
||||
#ifdef VERBOSE
|
||||
std::cout << "Enabling / Disabling 10Gbe in receiver: " << i << std::endl;
|
||||
#endif
|
||||
if (connectData() == OK)
|
||||
ret=thisReceiver->sendInt(fnum,retval,i);
|
||||
if(ret==FAIL)
|
||||
setErrorMask((getErrorMask())|(RECEIVER_TEN_GIGA));
|
||||
}
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
@ -1627,6 +1627,12 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
|
||||
*/
|
||||
void setDetectorHostname();
|
||||
|
||||
/** enable/disable or 10Gbe
|
||||
* @param i is -1 to get, 0 to disable and 1 to enable
|
||||
/returns if 10Gbe is enabled
|
||||
*/
|
||||
int enableTenGigabitEthernet(int i = -1);
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
@ -682,6 +682,9 @@ slsDetectorCommand::slsDetectorCommand(slsDetectorUtils *det) {
|
||||
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC;
|
||||
i++;
|
||||
|
||||
descrToFuncMap[i].m_pFuncName="iodelay"; //
|
||||
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDAC;
|
||||
i++;
|
||||
|
||||
|
||||
|
||||
@ -854,6 +857,10 @@ slsDetectorCommand::slsDetectorCommand(slsDetectorUtils *det) {
|
||||
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdReceiver;
|
||||
i++;
|
||||
|
||||
descrToFuncMap[i].m_pFuncName="tengiga"; //
|
||||
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdReceiver;
|
||||
i++;
|
||||
|
||||
|
||||
numberOfCommands=i;
|
||||
|
||||
@ -3312,6 +3319,8 @@ string slsDetectorCommand::cmdDAC(int narg, char *args[], int action) {
|
||||
dac=E_Vcn;
|
||||
else if (cmd== "vis")
|
||||
dac=E_Vis;
|
||||
else if (cmd== "iodelay")
|
||||
dac=IO_DELAY;
|
||||
else
|
||||
return string("cannot decode dac ")+cmd;
|
||||
|
||||
@ -3849,6 +3858,12 @@ string slsDetectorCommand::cmdAdvanced(int narg, char *args[], int action) {
|
||||
flag=TOT_MODE;
|
||||
else if (sval=="continous")
|
||||
flag=CONTINOUS_RO;
|
||||
else if (sval=="parallel")
|
||||
flag=PARALLEL;
|
||||
else if (sval=="nonparallel")
|
||||
flag=NONPARALLEL;
|
||||
else if (sval=="safe")
|
||||
flag=SAFE;
|
||||
else
|
||||
return string("could not scan flag ")+string(args[1]);
|
||||
}
|
||||
@ -3865,6 +3880,12 @@ string slsDetectorCommand::cmdAdvanced(int narg, char *args[], int action) {
|
||||
return string("tot");
|
||||
case CONTINOUS_RO:
|
||||
return string("continous");
|
||||
case PARALLEL:
|
||||
return string("parallel");
|
||||
case NONPARALLEL:
|
||||
return string("nonparallel");
|
||||
case SAFE:
|
||||
return string("safe");
|
||||
default:
|
||||
return string("unknown");
|
||||
}
|
||||
@ -3898,13 +3919,13 @@ string slsDetectorCommand::helpAdvanced(int narg, char *args[], int action) {
|
||||
if (action==PUT_ACTION || action==HELP_ACTION) {
|
||||
|
||||
os << "extsig:i mode \t sets the mode of the external signal i. can be \n \t \t \t off, \n \t \t \t gate_in_active_high, \n \t \t \t gate_in_active_low, \n \t \t \t trigger_in_rising_edge, \n \t \t \t trigger_in_falling_edge, \n \t \t \t ro_trigger_in_rising_edge, \n \t \t \t ro_trigger_in_falling_edge, \n \t \t \t gate_out_active_high, \n \t \t \t gate_out_active_low, \n \t \t \t trigger_out_rising_edge, \n \t \t \t trigger_out_falling_edge, \n \t \t \t ro_trigger_out_rising_edge, \n \t \t \t ro_trigger_out_falling_edge" << std::endl;
|
||||
os << "flags mode \t sets the readout flags to mode. can be none, storeinram, tot, continous, unknown" << std::endl;
|
||||
os << "flags mode \t sets the readout flags to mode. can be none, storeinram, tot, continous, parallel, nonparallel, safe, unknown" << std::endl;
|
||||
|
||||
}
|
||||
if (action==GET_ACTION || action==HELP_ACTION) {
|
||||
|
||||
os << "extsig:i \t gets the mode of the external signal i. can be \n \t \t \t off, \n \t \t \t gate_in_active_high, \n \t \t \t gate_in_active_low, \n \t \t \t trigger_in_rising_edge, \n \t \t \t trigger_in_falling_edge, \n \t \t \t ro_trigger_in_rising_edge, \n \t \t \t ro_trigger_in_falling_edge, \n \t \t \t gate_out_active_high, \n \t \t \t gate_out_active_low, \n \t \t \t trigger_out_rising_edge, \n \t \t \t trigger_out_falling_edge, \n \t \t \t ro_trigger_out_rising_edge, \n \t \t \t ro_trigger_out_falling_edge" << std::endl;
|
||||
os << "flags \t gets the readout flags. can be none, storeinram, tot, continous, unknown" << std::endl;
|
||||
os << "flags \t gets the readout flags. can be none, storeinram, tot, continous, parallel, nonparallel, safe, unknown" << std::endl;
|
||||
|
||||
}
|
||||
return os.str();
|
||||
@ -4069,6 +4090,17 @@ string slsDetectorCommand::cmdReceiver(int narg, char *args[], int action) {
|
||||
|
||||
}
|
||||
|
||||
else if(cmd=="tengiga"){
|
||||
if (action==PUT_ACTION){
|
||||
if (!sscanf(args[1],"%d",&ival))
|
||||
return string("Could not scan tengiga input ")+string(args[1]);
|
||||
if(ival>=0)
|
||||
sprintf(answer,"%d",myDet->enableTenGigabitEthernet(ival));
|
||||
}else
|
||||
sprintf(answer,"%d",myDet->enableTenGigabitEthernet());
|
||||
return string(answer);
|
||||
|
||||
}
|
||||
|
||||
return string("could not decode command");
|
||||
|
||||
@ -4082,11 +4114,13 @@ string slsDetectorCommand::helpReceiver(int narg, char *args[], int action) {
|
||||
if (action==PUT_ACTION || action==HELP_ACTION)
|
||||
os << "receiver [status] \t starts/stops the receiver to listen to detector packets. - can be start or stop" << std::endl;
|
||||
os << "r_readfreq \t sets the gui read frequency of the receiver, 0 if gui requests frame, >0 if receiver sends every nth frame to gui" << std::endl;
|
||||
os << "tengiga \t sets system to be configure for 10Gbe if set to 1, else 1Gbe if set to 0" << std::endl;
|
||||
if (action==GET_ACTION || action==HELP_ACTION){
|
||||
os << "receiver \t returns the status of receiver - can be running or idle" << std::endl;
|
||||
os << "framescaught \t returns the number of frames caught by receiver(average for multi)" << std::endl;
|
||||
os << "frameindex \t returns the current frame index of receiver(average for multi)" << std::endl;
|
||||
os << "r_readfreq \t returns the gui read frequency of the receiver" << std::endl;
|
||||
os << "tengiga \t returns 1 if the system is configured for 10Gbe else 0 for 1Gbe" << std::endl;
|
||||
}
|
||||
return os.str();
|
||||
|
||||
|
@ -688,6 +688,13 @@ virtual int setReadReceiverFrequency(int getFromReceiver, int i=-1)=0;
|
||||
*/
|
||||
virtual int enableReceiverCompression(int i = -1)=0;
|
||||
|
||||
/** enable/disable or 10Gbe
|
||||
* @param i is -1 to get, 0 to disable and 1 to enable
|
||||
/returns if 10Gbe is enabled
|
||||
*/
|
||||
virtual int enableTenGigabitEthernet(int i = -1)=0;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user