mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-07 10:30:41 +02:00
done update
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@88 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
parent
fceb4d63f8
commit
80bbea0b6f
@ -2844,6 +2844,7 @@ int slsDetector::setThresholdEnergy(int e_eV, int imod, detectorSettings isetti
|
||||
|
||||
|
||||
detectorSettings slsDetector::setSettings( detectorSettings isettings, int imod){
|
||||
std::cout<<"dfgfdgdgdf"<<endl;
|
||||
#ifdef VERBOSE
|
||||
std::cout<< "slsDetector setSettings "<< std::endl;
|
||||
#endif
|
||||
@ -5066,14 +5067,22 @@ int slsDetector::getScanPrecision(int iscan){
|
||||
|
||||
|
||||
char* slsDetector::setClientIP(string clientIP){
|
||||
int wrongFormat=1;
|
||||
struct sockaddr_in sa;
|
||||
int result = inet_pton(AF_INET, clientIP.c_str(), &(sa.sin_addr));
|
||||
if((!result)||(clientIP.length()>15))
|
||||
return ("IP Address should be VALID and in xxx.xxx.xxx.xxx format");
|
||||
else
|
||||
sprintf(thisDetector->clientIP,clientIP.c_str());
|
||||
return thisDetector->clientIP;
|
||||
};
|
||||
if(clientIP.length()==15){
|
||||
if((clientIP[3]==':')&&(clientIP[7]==':')&&(clientIP[11]==':')){
|
||||
int result = inet_pton(AF_INET, clientIP.c_str(), &(sa.sin_addr));
|
||||
if(result!=0){
|
||||
sprintf(thisDetector->clientIP,clientIP.c_str());
|
||||
wrongFormat=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!wrongFormat)
|
||||
return thisDetector->clientIP;
|
||||
else
|
||||
return ("IP Address should be VALID and in xxx.xxx.xxx.xxx format");
|
||||
}
|
||||
|
||||
|
||||
char* slsDetector::setClientMAC(string clientMAC){
|
||||
@ -5092,6 +5101,20 @@ char* slsDetector::setClientMAC(string clientMAC){
|
||||
|
||||
|
||||
|
||||
|
||||
int slsDetector::configureMAC(){
|
||||
if(!strcmp(getClientIP(),"none"))
|
||||
return -1;
|
||||
else if(!strcmp(getClientMAC(),"none"))
|
||||
return -1;
|
||||
|
||||
cout<<"\n\ndfgfdgklfdhgldf\n\n\n";
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
string slsDetector::executeLine(int narg, char *args[], int action) {
|
||||
|
||||
|
||||
@ -6349,10 +6372,11 @@ string slsDetector::executeLine(int narg, char *args[], int action) {
|
||||
sprintf(answer,"%d", setSpeed(TOT_DUTY_CYCLE));
|
||||
return string(answer);
|
||||
//gotthard
|
||||
}/*else if (var=="configuremac") {
|
||||
configureMAC();
|
||||
}else if (var=="configuremac") {
|
||||
if(configureMAC()==-1)
|
||||
return string("client ip address/client mac address not valid");
|
||||
return string("mac configuration completed");
|
||||
}*/
|
||||
}
|
||||
return ("Unknown command");
|
||||
|
||||
}
|
||||
@ -7743,6 +7767,7 @@ int slsDetector::getPositions(float *pos){
|
||||
|
||||
|
||||
|
||||
|
||||
int slsDetector::readConfigurationFile(string const fname){
|
||||
|
||||
|
||||
|
@ -360,6 +360,11 @@ typedef struct sharedSlsDetector {
|
||||
*/
|
||||
static int exists(int i);
|
||||
|
||||
/**
|
||||
configures mac for gotthard readout
|
||||
*/
|
||||
int configureMAC();
|
||||
|
||||
/**
|
||||
Purely virtual function
|
||||
Should be implemented in the specific detector class
|
||||
@ -374,11 +379,6 @@ typedef struct sharedSlsDetector {
|
||||
*/
|
||||
virtual int writeConfigurationFile(string const fname);
|
||||
|
||||
/**
|
||||
configures mac for gotthard readout
|
||||
*/
|
||||
int configureMAC();
|
||||
|
||||
/*
|
||||
It should be possible to dump all the settings of the detector (including trimbits, threshold energy, gating/triggering, acquisition time etc.
|
||||
in a file and retrieve it for repeating the measurement with identicals ettings, if necessary
|
||||
|
Loading…
x
Reference in New Issue
Block a user