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 ((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;
|
||||
}
|
||||
#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("addressC family %d port %d addr %s\n",addressC.sin_family,addressC.sin_port,inet_ntoa(addressC.sin_addr));//edited
|
||||
#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,20 +860,20 @@ int setSettings(int i)
|
||||
for (ind=0; ind<NDAC; ind++)
|
||||
v[ind]=-1;
|
||||
|
||||
if ((i!=GET_SETTINGS) && ((i>=HIGHGAIN) && (i<= GAIN3)))
|
||||
{
|
||||
v[VREF_DS]=vrefds[i];
|
||||
v[VCASCN_PB]=vcascn[i];
|
||||
v[VCASCP_PB]=vcascp[i];
|
||||
v[VOUT_CM]=voutcm[i];
|
||||
v[VCASC_OUT]=vcascout[i];
|
||||
v[VIN_CM]=vincm[i];
|
||||
v[VREF_COMP]=vrefcomp[i];
|
||||
v[IB_TESTC]=ibtestc[i];
|
||||
//if not get settings
|
||||
if ((i>=HIGHGAIN) && (i<= GAIN3)) {
|
||||
v[VREF_DS]=vrefds[i];
|
||||
v[VCASCN_PB]=vcascn[i];
|
||||
v[VCASCP_PB]=vcascp[i];
|
||||
v[VOUT_CM]=voutcm[i];
|
||||
v[VCASC_OUT]=vcascout[i];
|
||||
v[VIN_CM]=vincm[i];
|
||||
v[VREF_COMP]=vrefcomp[i];
|
||||
v[IB_TESTC]=ibtestc[i];
|
||||
|
||||
initDACs(v,ALLMOD);
|
||||
thisSettings=i;
|
||||
}
|
||||
initDACs(v,ALLMOD);
|
||||
thisSettings=i;
|
||||
}
|
||||
|
||||
//check settings for module 0
|
||||
imod=0;
|
||||
@ -934,7 +934,6 @@ int setSettings(int i)
|
||||
;
|
||||
else
|
||||
thisSettings=isett;
|
||||
|
||||
return thisSettings;
|
||||
}
|
||||
|
||||
@ -1651,7 +1650,13 @@ int initModulebyNumber(sls_detector_module myMod) {
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
#define RGSH1VALS {300,200,400}
|
||||
#define RGSH2VALS {260,300,260}
|
||||
|
||||
//high,dynamic,low,medium,very high
|
||||
#define VREFDS_VALS {0,0,200,300,400,500,600}
|
||||
#define VCASCN_VALS {0,0,220,320,420,520,620}
|
||||
#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 VREFCOMP_VALS {0,0,320,420,520,620,720}
|
||||
#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}
|
||||
|
@ -855,9 +855,6 @@ int set_dac(int fnum) {
|
||||
case HV_POT:
|
||||
ireg=HIGH_VOLTAGE;
|
||||
break;
|
||||
case G_CONF_GAIN:
|
||||
ireg=CONFGAIN;
|
||||
break;
|
||||
default:
|
||||
printf("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)
|
||||
retval=initDACbyIndexDACU(idac,val,imod);
|
||||
else
|
||||
{//Conf gain
|
||||
if (ireg==CONFGAIN)
|
||||
retval=initConfGainByModule(val,imod);
|
||||
//HV or conf gain
|
||||
else if(ireg==HIGH_VOLTAGE)
|
||||
{ //HV or conf gain
|
||||
if(ireg==HIGH_VOLTAGE)
|
||||
retval=initHighVoltageByModule(val,imod);
|
||||
//Temp
|
||||
else
|
||||
@ -885,7 +879,7 @@ int set_dac(int fnum) {
|
||||
printf("DAC/TEMP/HV set to %f V\n", retval);
|
||||
#endif
|
||||
ret=FAIL;
|
||||
if((ireg==HIGH_VOLTAGE)||(ireg==CONFGAIN)){
|
||||
if(ireg==HIGH_VOLTAGE){
|
||||
if(retval==-2)
|
||||
strcpy(mess,"Invalid Voltage.Valid values are 0,90,110,120,150,180,200");
|
||||
else if(retval==-3)
|
||||
@ -1326,6 +1320,7 @@ int set_module(int fnum) {
|
||||
if (ret==OK) {
|
||||
#ifdef MCB_FUNCS
|
||||
retval=initModulebyNumber(myModule);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user