mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-05-18 10:20:41 +02:00
print receiver configurations for all detectors added
This commit is contained in:
parent
875ee02038
commit
85ccf64175
@ -3868,6 +3868,32 @@ int multiSlsDetector::readRegister(int addr){
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int multiSlsDetector::printReceiverConfiguration(){
|
||||||
|
int i;
|
||||||
|
int ret, ret1=-100;
|
||||||
|
|
||||||
|
std::cout << "Printing Receiver configurations for all detectors..." << std::endl;
|
||||||
|
|
||||||
|
for (i=0; i<thisMultiDetector->numberOfDetectors; i++) {
|
||||||
|
if (detectors[i]) {
|
||||||
|
std::cout << std::endl << "#Detector " << i << ":" << std::endl;
|
||||||
|
|
||||||
|
ret=detectors[i]->printReceiverConfiguration();
|
||||||
|
if(detectors[i]->getErrorMask())
|
||||||
|
setErrorMask(getErrorMask()|(1<<i));
|
||||||
|
if (ret1==-100)
|
||||||
|
ret1=ret;
|
||||||
|
else if (ret!=ret1)
|
||||||
|
ret1=-1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int multiSlsDetector::readConfigurationFile(string const fname){
|
int multiSlsDetector::readConfigurationFile(string const fname){
|
||||||
|
|
||||||
|
|
||||||
@ -3960,6 +3986,8 @@ int multiSlsDetector::readConfigurationFile(string const fname){
|
|||||||
|
|
||||||
infile.close();
|
infile.close();
|
||||||
|
|
||||||
|
if(getDetectorsType() != MYTHEN)
|
||||||
|
printReceiverConfiguration();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
std::cout<< "Error opening configuration file " << fname << " for reading" << std::endl;
|
std::cout<< "Error opening configuration file " << fname << " for reading" << std::endl;
|
||||||
|
@ -388,6 +388,11 @@ class multiSlsDetector : public slsDetectorUtils {
|
|||||||
int exists();
|
int exists();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Prints receiver configuration
|
||||||
|
\returns OK or FAIL
|
||||||
|
*/
|
||||||
|
int printReceiverConfiguration();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Purely virtual function
|
Purely virtual function
|
||||||
|
@ -226,7 +226,7 @@ slsDetector::~slsDetector(){
|
|||||||
} else
|
} else
|
||||||
printf("Shared memory %d detached\n", shmId);
|
printf("Shared memory %d detached\n", shmId);
|
||||||
|
|
||||||
|
delete thisReceiver;
|
||||||
};
|
};
|
||||||
|
|
||||||
slsDetector::slsDetector(char *name, int id, int cport,multiSlsDetector *p) : slsDetectorUtils(),
|
slsDetector::slsDetector(char *name, int id, int cport,multiSlsDetector *p) : slsDetectorUtils(),
|
||||||
@ -5030,6 +5030,8 @@ char* slsDetector::setReceiver(string receiverIP){
|
|||||||
setUDPConnection();
|
setUDPConnection();
|
||||||
if(thisDetector->myDetectorType == EIGER)
|
if(thisDetector->myDetectorType == EIGER)
|
||||||
enableTenGigabitEthernet(thisDetector->tenGigaEnable);
|
enableTenGigabitEthernet(thisDetector->tenGigaEnable);
|
||||||
|
|
||||||
|
printReceiverConfiguration();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5504,6 +5506,25 @@ int slsDetector::resetCounterBlock(int startACQ){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int slsDetector::printReceiverConfiguration(){
|
||||||
|
|
||||||
|
std::cout << "Detector IP:\t\t" << getNetworkParameter(DETECTOR_IP) << std::endl;
|
||||||
|
std::cout << "Detector MAC:\t\t" << getNetworkParameter(DETECTOR_MAC) << std::endl;
|
||||||
|
|
||||||
|
std::cout << "Receiver Hostname:\t" << getNetworkParameter(RECEIVER_HOSTNAME) << std::endl;
|
||||||
|
std::cout << "Receiver UDP IP:\t" << getNetworkParameter(RECEIVER_UDP_IP) << std::endl;
|
||||||
|
std::cout << "Receiver UDP MAC:\t" << getNetworkParameter(RECEIVER_UDP_MAC) << std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
std::cout << "Receiver UDP Port:\t" << getNetworkParameter(RECEIVER_UDP_PORT) << std::endl;
|
||||||
|
if(thisDetector->myDetectorType == EIGER)
|
||||||
|
std::cout << "Receiver UDP Port2:\t" << getNetworkParameter(RECEIVER_UDP_PORT2) << std::endl;
|
||||||
|
|
||||||
|
std::cout << std::endl;
|
||||||
|
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int slsDetector::readConfigurationFile(string const fname){
|
int slsDetector::readConfigurationFile(string const fname){
|
||||||
|
@ -321,6 +321,12 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
|
|||||||
*/
|
*/
|
||||||
int configureMAC();
|
int configureMAC();
|
||||||
|
|
||||||
|
/**
|
||||||
|
Prints receiver configuration
|
||||||
|
\returns OK or FAIL
|
||||||
|
*/
|
||||||
|
int printReceiverConfiguration();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Reads the configuration file fname
|
Reads the configuration file fname
|
||||||
\param fname file name
|
\param fname file name
|
||||||
|
@ -424,6 +424,11 @@ class slsDetectorBase : public virtual slsDetectorDefs, public virtual errorDef
|
|||||||
//int setBeamEnergy(int e){return 2*setThresholdEnergy(e/2);};
|
//int setBeamEnergy(int e){return 2*setThresholdEnergy(e/2);};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Prints receiver configuration
|
||||||
|
\returns OK or FAIL
|
||||||
|
*/
|
||||||
|
virtual int printReceiverConfiguration()=0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Reads the configuration file fname
|
Reads the configuration file fname
|
||||||
@ -431,6 +436,7 @@ class slsDetectorBase : public virtual slsDetectorDefs, public virtual errorDef
|
|||||||
\returns OK or FAIL
|
\returns OK or FAIL
|
||||||
*/
|
*/
|
||||||
virtual int readConfigurationFile(string const fname)=0;
|
virtual int readConfigurationFile(string const fname)=0;
|
||||||
|
|
||||||
virtual int dumpDetectorSetup(string const fname, int level)=0;
|
virtual int dumpDetectorSetup(string const fname, int level)=0;
|
||||||
int dumpDetectorSetup(string const fname){return dumpDetectorSetup(fname,0);};
|
int dumpDetectorSetup(string const fname){return dumpDetectorSetup(fname,0);};
|
||||||
virtual int retrieveDetectorSetup(string const fname, int level)=0;
|
virtual int retrieveDetectorSetup(string const fname, int level)=0;
|
||||||
|
@ -840,6 +840,10 @@ slsDetectorCommand::slsDetectorCommand(slsDetectorUtils *det) {
|
|||||||
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdConfiguration;
|
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdConfiguration;
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
|
descrToFuncMap[i].m_pFuncName="rx_printconfig";
|
||||||
|
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdConfiguration;
|
||||||
|
i++;
|
||||||
|
|
||||||
descrToFuncMap[i].m_pFuncName="parameters";
|
descrToFuncMap[i].m_pFuncName="parameters";
|
||||||
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdConfiguration;
|
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdConfiguration;
|
||||||
i++;
|
i++;
|
||||||
@ -4137,7 +4141,11 @@ string slsDetectorCommand::cmdConfiguration(int narg, char *args[], int action)
|
|||||||
myDet->writeConfigurationFile(sval);
|
myDet->writeConfigurationFile(sval);
|
||||||
}
|
}
|
||||||
return sval;
|
return sval;
|
||||||
} else if (cmd=="parameters") {
|
} else if (cmd=="rx_printconfig"){
|
||||||
|
if (action==PUT_ACTION)
|
||||||
|
return string("cannot put");
|
||||||
|
myDet->printReceiverConfiguration();
|
||||||
|
}else if (cmd=="parameters") {
|
||||||
if (action==PUT_ACTION) {
|
if (action==PUT_ACTION) {
|
||||||
sval=string(args[1]);
|
sval=string(args[1]);
|
||||||
myDet->retrieveDetectorSetup(sval);
|
myDet->retrieveDetectorSetup(sval);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user