mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-26 16:20:03 +02:00
gotthard a few changes
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@65 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
parent
4cbd9b2265
commit
57b892267a
@ -136,7 +136,6 @@ int acceptConnection() {
|
|||||||
|
|
||||||
|
|
||||||
if (socketDescriptor>0) {
|
if (socketDescriptor>0) {
|
||||||
//if ((file_des = accept(socketDescriptor,(struct sockaddr *) &addressC, &address_length)) < 0) {
|
|
||||||
if ((file_des = accept(socketDescriptor,(struct sockaddr *) &addressC, &address_length)) < 0) {
|
if ((file_des = accept(socketDescriptor,(struct sockaddr *) &addressC, &address_length)) < 0) {
|
||||||
|
|
||||||
|
|
||||||
@ -195,8 +194,34 @@ int acceptConnection() {
|
|||||||
socketDescriptor=-1;
|
socketDescriptor=-1;
|
||||||
}
|
}
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
|
|
||||||
|
|
||||||
|
struct sockaddr_in6 sa;
|
||||||
|
char str[INET6_ADDRSTRLEN];
|
||||||
|
|
||||||
|
// store this IP address in sa:
|
||||||
|
inet_pton(AF_INET6, "2001:db8:8714:3a90::12", &(sa.sin6_addr));
|
||||||
|
|
||||||
|
// now get it back and print it
|
||||||
|
inet_ntop(AF_INET6, &(sa.sin6_addr), str, INET6_ADDRSTRLEN);
|
||||||
|
|
||||||
|
printf("%s\n\n", str); // prints "2001:db8:8714:3a90::12"
|
||||||
|
|
||||||
|
|
||||||
printf("client connected %d\n", file_des);
|
printf("client connected %d\n", file_des);
|
||||||
|
printf("addressC family %d port %d addr %s\n",addressC.sin_family,addressC.sin_port,inet_ntoa(addressC.sin_addr));//edited
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//strcpy(lastClientIP,inet_ntoa(addressC.sin_addr)); //In case you want to lock the server...
|
||||||
|
|
||||||
|
|
||||||
|
// struct sockaddr_in
|
||||||
|
//{
|
||||||
|
//short int sin_family; /* Famyly of the address*/
|
||||||
|
//unsigned short int sin_port; /* Port */
|
||||||
|
//struct in_addr sin_addr; /* Network address */
|
||||||
|
//unsigned char sin_zero[8]; /* Same size of struct sockaddr */
|
||||||
|
//};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -860,8 +860,8 @@ int setSettings(int i)
|
|||||||
for (ind=0; ind<NDAC; ind++)
|
for (ind=0; ind<NDAC; ind++)
|
||||||
v[ind]=-1;
|
v[ind]=-1;
|
||||||
|
|
||||||
if ((i!=GET_SETTINGS) && ((i>=HIGHGAIN) && (i<= GAIN3)))
|
//if not get settings
|
||||||
{
|
if ((i>=HIGHGAIN) && (i<= GAIN3)) {
|
||||||
v[VREF_DS]=vrefds[i];
|
v[VREF_DS]=vrefds[i];
|
||||||
v[VCASCN_PB]=vcascn[i];
|
v[VCASCN_PB]=vcascn[i];
|
||||||
v[VCASCP_PB]=vcascp[i];
|
v[VCASCP_PB]=vcascp[i];
|
||||||
@ -934,7 +934,6 @@ int setSettings(int i)
|
|||||||
;
|
;
|
||||||
else
|
else
|
||||||
thisSettings=isett;
|
thisSettings=isett;
|
||||||
|
|
||||||
return thisSettings;
|
return thisSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1651,7 +1650,13 @@ int initModulebyNumber(sls_detector_module myMod) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
thisSettings=UNDEFINED;
|
thisSettings=UNDEFINED;
|
||||||
setSettings(GET_SETTINGS);
|
int modSet=setSettings(GET_SETTINGS);
|
||||||
|
printf("\n\n modSet:%d\n\n",modSet);
|
||||||
|
//changing the confGain register
|
||||||
|
//retval=initConfGainByModule(val,imod);
|
||||||
|
//if(retval==-3)
|
||||||
|
// strcpy(mess,"Weird value read back\n");
|
||||||
|
|
||||||
return myMod.reg;
|
return myMod.reg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#define RGSH1VALS {300,200,400}
|
#define RGSH1VALS {300,200,400}
|
||||||
#define RGSH2VALS {260,300,260}
|
#define RGSH2VALS {260,300,260}
|
||||||
|
|
||||||
|
//high,dynamic,low,medium,very high
|
||||||
#define VREFDS_VALS {0,0,200,300,400,500,600}
|
#define VREFDS_VALS {0,0,200,300,400,500,600}
|
||||||
#define VCASCN_VALS {0,0,220,320,420,520,620}
|
#define VCASCN_VALS {0,0,220,320,420,520,620}
|
||||||
#define VCASCP_VALS {0,0,240,340,440,540,640}
|
#define VCASCP_VALS {0,0,240,340,440,540,640}
|
||||||
@ -17,6 +18,7 @@
|
|||||||
#define VINCM_VALS {0,0,300,400,500,600,700}
|
#define VINCM_VALS {0,0,300,400,500,600,700}
|
||||||
#define VREFCOMP_VALS {0,0,320,420,520,620,720}
|
#define VREFCOMP_VALS {0,0,320,420,520,620,720}
|
||||||
#define IBTESTC_VALS {0,0,340,440,540,640,740}
|
#define IBTESTC_VALS {0,0,340,440,540,640,740}
|
||||||
|
#define CONF_GAIN {0,0, 0, 1, 6, 2, 1}//dynamic gain confgain yet to be figured out
|
||||||
|
|
||||||
|
|
||||||
#define DEFAULTGAIN {11.66,9.32,14.99}
|
#define DEFAULTGAIN {11.66,9.32,14.99}
|
||||||
|
@ -855,9 +855,6 @@ int set_dac(int fnum) {
|
|||||||
case HV_POT:
|
case HV_POT:
|
||||||
ireg=HIGH_VOLTAGE;
|
ireg=HIGH_VOLTAGE;
|
||||||
break;
|
break;
|
||||||
case G_CONF_GAIN:
|
|
||||||
ireg=CONFGAIN;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
printf("Unknown DAC/TEMP/HV index %d\n",ind);
|
printf("Unknown DAC/TEMP/HV index %d\n",ind);
|
||||||
sprintf(mess,"Unknown DAC/TEMP/HV index %d\n",ind);
|
sprintf(mess,"Unknown DAC/TEMP/HV index %d\n",ind);
|
||||||
@ -869,11 +866,8 @@ int set_dac(int fnum) {
|
|||||||
if(ireg==-1)
|
if(ireg==-1)
|
||||||
retval=initDACbyIndexDACU(idac,val,imod);
|
retval=initDACbyIndexDACU(idac,val,imod);
|
||||||
else
|
else
|
||||||
{//Conf gain
|
{ //HV or conf gain
|
||||||
if (ireg==CONFGAIN)
|
if(ireg==HIGH_VOLTAGE)
|
||||||
retval=initConfGainByModule(val,imod);
|
|
||||||
//HV or conf gain
|
|
||||||
else if(ireg==HIGH_VOLTAGE)
|
|
||||||
retval=initHighVoltageByModule(val,imod);
|
retval=initHighVoltageByModule(val,imod);
|
||||||
//Temp
|
//Temp
|
||||||
else
|
else
|
||||||
@ -885,7 +879,7 @@ int set_dac(int fnum) {
|
|||||||
printf("DAC/TEMP/HV set to %f V\n", retval);
|
printf("DAC/TEMP/HV set to %f V\n", retval);
|
||||||
#endif
|
#endif
|
||||||
ret=FAIL;
|
ret=FAIL;
|
||||||
if((ireg==HIGH_VOLTAGE)||(ireg==CONFGAIN)){
|
if(ireg==HIGH_VOLTAGE){
|
||||||
if(retval==-2)
|
if(retval==-2)
|
||||||
strcpy(mess,"Invalid Voltage.Valid values are 0,90,110,120,150,180,200");
|
strcpy(mess,"Invalid Voltage.Valid values are 0,90,110,120,150,180,200");
|
||||||
else if(retval==-3)
|
else if(retval==-3)
|
||||||
@ -1326,6 +1320,7 @@ int set_module(int fnum) {
|
|||||||
if (ret==OK) {
|
if (ret==OK) {
|
||||||
#ifdef MCB_FUNCS
|
#ifdef MCB_FUNCS
|
||||||
retval=initModulebyNumber(myModule);
|
retval=initModulebyNumber(myModule);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user