added more accurate temperature sensors for eiger, and to gui

This commit is contained in:
Dhanya Maliakal
2016-07-22 10:40:58 +02:00
parent 6a245d2a98
commit ee26339fd7
8 changed files with 106 additions and 19 deletions

View File

@ -437,9 +437,33 @@ int setHighVoltage(int val, int imod){
}
int getADC(enum detDacIndex ind, int imod){
//get adc value
return 0;
int getADC(enum detAdcIndex ind, int imod){
int retval = -1;
char tempnames[6][20]={"FPGA EXT", "10GE","DCDC", "SODL", "SODR", "FPGA"};
char cstore[255];
switch(ind){
case TEMP_FPGA:
retval=getBebFPGATemp()*1000;
break;
case TEMP_FPGAEXT:
case TEMP_10GE:
case TEMP_DCDC:
case TEMP_SODL:
case TEMP_SODR:
sprintf(cstore,"more /sys/class/hwmon/hwmon%d/device/temp1_input",ind);
FILE* sysFile = popen(cstore, "r");
fgets(cstore, sizeof(cstore), sysFile);
pclose(sysFile);
sscanf(cstore,"%d",&retval);
break;
default:
return -1;
}
printf("Temperature %s: %f°C\n",tempnames[ind],(double)retval/1000.00);
return retval;
}

View File

@ -40,5 +40,7 @@
enum detDacIndex{SVP,VTR,VRF,VRS,SVN,VTGSTV,VCMP_LL,VCMP_LR,CAL,VCMP_RL,RXB_RB,RXB_LB,VCMP_RR,VCP,VCN,VIS,VTHRESHOLD};
enum detAdcIndex{TEMP_FPGAEXT, TEMP_10GE, TEMP_DCDC, TEMP_SODL, TEMP_SODR, TEMP_FPGA};
#endif /* SLSDETECTORSERVER_DEFS_H_ */