Merge branch 'jungfraunew' into esrfchanges

This commit is contained in:
maliakal_d 2018-04-26 16:37:33 +02:00
commit 501d2478a5
8 changed files with 49 additions and 39 deletions

View File

@ -2236,9 +2236,9 @@ void qDrawPlot::toDoublePixelData(double* dest, char* source,int size, int datab
// only data plot // only data plot
else { else {
for (ichan = 0; ichan < size; ++ichan) { for (ichan = 0; ichan < size; ++ichan) {
if ( (*((u_int16_t*)source)) == 0xFFFF ) /*if ( (*((u_int16_t*)source)) == 0xFFFF )
dest[ichan] = 0xFFFF; dest[ichan] = 0xFFFF;
else else*/
dest[ichan] = ((*((u_int16_t*)source)) & 0x3FFF); dest[ichan] = ((*((u_int16_t*)source)) & 0x3FFF);
source += 2; source += 2;
} }

View File

@ -302,6 +302,8 @@
#define DAQ_SETTINGS_MSK (DAQ_HIGH_GAIN_MSK | DAQ_FIX_GAIN_MSK | DAQ_FRCE_SWTCH_GAIN_MSK) #define DAQ_SETTINGS_MSK (DAQ_HIGH_GAIN_MSK | DAQ_FIX_GAIN_MSK | DAQ_FRCE_SWTCH_GAIN_MSK)
#define DAQ_HIGH_GAIN_OFST (0) #define DAQ_HIGH_GAIN_OFST (0)
#define DAQ_HIGH_GAIN_MSK (0x00000001 << DAQ_HIGH_GAIN_OFST) #define DAQ_HIGH_GAIN_MSK (0x00000001 << DAQ_HIGH_GAIN_OFST)
#define DAQ_FIX_GAIN_DYNMC_VAL ((0x0 << DAQ_HIGH_GAIN_OFST) & DAQ_HIGH_GAIN_MSK)
#define DAQ_FIX_GAIN_HIGHGAIN_VAL ((0x1 << DAQ_HIGH_GAIN_OFST) & DAQ_HIGH_GAIN_MSK)
#define DAQ_FIX_GAIN_OFST (1) #define DAQ_FIX_GAIN_OFST (1)
#define DAQ_FIX_GAIN_MSK (0x00000003 << DAQ_FIX_GAIN_OFST) #define DAQ_FIX_GAIN_MSK (0x00000003 << DAQ_FIX_GAIN_OFST)
#define DAQ_FIX_GAIN_STG_1_VAL ((0x1 << DAQ_FIX_GAIN_OFST) & DAQ_FIX_GAIN_MSK) #define DAQ_FIX_GAIN_STG_1_VAL ((0x1 << DAQ_FIX_GAIN_OFST) & DAQ_FIX_GAIN_MSK)

View File

@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsDetectorSoftware/jungfrauDetectorServer Path: slsDetectorsPackage/slsDetectorSoftware/jungfrauDetectorServer
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repsitory UUID: 03e781a0ac53cb73af5d00003a131383125ab40f Repsitory UUID: c9675d111a61075ebe4031ec6bdf285a76be0fce
Revision: 141 Revision: 142
Branch: jungfraunew Branch: jungfraunew
Last Changed Author: Dhanya_Thattil Last Changed Author: Dhanya_Thattil
Last Changed Rev: 3776 Last Changed Rev: 3777
Last Changed Date: 2018-04-23 16:06:57.000000002 +0200 ./RegisterDefs.h Last Changed Date: 2018-04-26 15:44:15.000000002 +0200 ./RegisterDefs.h

View File

@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git" #define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "03e781a0ac53cb73af5d00003a131383125ab40f" #define GITREPUUID "c9675d111a61075ebe4031ec6bdf285a76be0fce"
#define GITAUTH "Dhanya_Thattil" #define GITAUTH "Dhanya_Thattil"
#define GITREV 0x3776 #define GITREV 0x3777
#define GITDATE 0x20180423 #define GITDATE 0x20180426
#define GITBRANCH "jungfraunew" #define GITBRANCH "jungfraunew"

View File

@ -406,6 +406,8 @@ void setupDetector() {
setTimer(ACQUISITION_TIME, DEFAULT_EXPTIME); setTimer(ACQUISITION_TIME, DEFAULT_EXPTIME);
setTimer(FRAME_PERIOD, DEFAULT_PERIOD); setTimer(FRAME_PERIOD, DEFAULT_PERIOD);
setTimer(DELAY_AFTER_TRIGGER, DEFAULT_DELAY); setTimer(DELAY_AFTER_TRIGGER, DEFAULT_DELAY);
setTimer(STORAGE_CELL_NUMBER, DEFAULT_NUM_STRG_CLLS);
selectStoragecellStart(DEFAULT_STRG_CLL_STRT);
/*setSpeed(CLOCK_DIVIDER, HALF_SPEED); depends if all the previous stuff works*/ /*setSpeed(CLOCK_DIVIDER, HALF_SPEED); depends if all the previous stuff works*/
setTiming(DEFAULT_TIMING_MODE); setTiming(DEFAULT_TIMING_MODE);
setHighVoltage(DEFAULT_HIGH_VOLTAGE); setHighVoltage(DEFAULT_HIGH_VOLTAGE);
@ -824,7 +826,7 @@ enum detectorSettings setSettings(enum detectorSettings sett, int imod){
break; break;
case DYNAMICHG0: case DYNAMICHG0:
bus_w(DAQ_REG, bus_r(DAQ_REG) & ~DAQ_SETTINGS_MSK); bus_w(DAQ_REG, bus_r(DAQ_REG) & ~DAQ_SETTINGS_MSK);
bus_w(DAQ_REG, bus_r(DAQ_REG) | DAQ_HIGH_GAIN_MSK); bus_w(DAQ_REG, bus_r(DAQ_REG) | DAQ_FIX_GAIN_HIGHGAIN_VAL);
printf("\nConfigured settings - Dyanmic High Gain 0, DAQ Reg: 0x%x\n", bus_r(DAQ_REG)); printf("\nConfigured settings - Dyanmic High Gain 0, DAQ Reg: 0x%x\n", bus_r(DAQ_REG));
break; break;
case FIXGAIN1: case FIXGAIN1:
@ -862,37 +864,37 @@ enum detectorSettings setSettings(enum detectorSettings sett, int imod){
enum detectorSettings getSettings(){ enum detectorSettings getSettings(){
uint32_t val = bus_r(DAQ_REG); uint32_t val = bus_r(DAQ_REG) & DAQ_SETTINGS_MSK;
printf("\nGetting Settings\n Reading DAQ Register :0x%x\n", val); printf("\nGetting Settings\n Reading DAQ Register :0x%x\n", val);
if (val & DAQ_FRCE_GAIN_STG_2_VAL) { switch(val) {
thisSettings = FORCESWITCHG2; case DAQ_FIX_GAIN_DYNMC_VAL:
printf("Settings read: FORCESWITCHG2\n");
}
else if (val & DAQ_FRCE_GAIN_STG_1_VAL) {
thisSettings = FORCESWITCHG1;
printf("Settings read: FORCESWITCHG1\n");
}
else if (val & DAQ_FIX_GAIN_STG_2_VAL) {
thisSettings = FIXGAIN2;
printf("Settings read: FIXGAIN2\n");
}
else if (val & DAQ_FIX_GAIN_STG_1_VAL) {
thisSettings = FIXGAIN1;
printf("Settings read: FIXGAIN1\n");
}
else if (val & DAQ_HIGH_GAIN_MSK) {
thisSettings = DYNAMICHG0;
printf("Settings read: DYNAMICHG0\n");
}
else {
thisSettings = DYNAMICGAIN; thisSettings = DYNAMICGAIN;
printf("Settings read: DYNAMICGAIN\n"); printf("Settings read: DYNAMICGAIN\n");
break;
case DAQ_FIX_GAIN_HIGHGAIN_VAL:
thisSettings = DYNAMICHG0;
printf("Settings read: DYNAMICHG0\n");
break;
case DAQ_FIX_GAIN_STG_1_VAL:
thisSettings = FIXGAIN1;
printf("Settings read: FIXGAIN1\n");
break;
case DAQ_FIX_GAIN_STG_2_VAL:
thisSettings = FIXGAIN2;
printf("Settings read: FIXGAIN2\n");
break;
case DAQ_FRCE_GAIN_STG_1_VAL:
thisSettings = FORCESWITCHG1;
printf("Settings read: FORCESWITCHG1\n");
break;
case DAQ_FRCE_GAIN_STG_2_VAL:
thisSettings = FORCESWITCHG2;
printf("Settings read: FORCESWITCHG2\n");
break;
default:
thisSettings = UNDEFINED;
printf("Settings read: Undefined. Value read:0x%x\n", val);
} }
return thisSettings; return thisSettings;

View File

@ -71,6 +71,8 @@ enum NETWORKINDEX { TXN_FRAME };
#define DEFAULT_SETTINGS (DYNAMICGAIN) #define DEFAULT_SETTINGS (DYNAMICGAIN)
#define DEFAULT_TX_UDP_PORT (0x7e9a) #define DEFAULT_TX_UDP_PORT (0x7e9a)
#define DEFAULT_TMP_THRSHLD (65*1000) //milli degree Celsius #define DEFAULT_TMP_THRSHLD (65*1000) //milli degree Celsius
#define DEFAULT_NUM_STRG_CLLS (0)
#define DEFAULT_STRG_CLL_STRT (0xf)
/* Defines in the Firmware */ /* Defines in the Firmware */
#define FIX_PATT_VAL (0xACDC2014) #define FIX_PATT_VAL (0xACDC2014)

View File

@ -5607,7 +5607,11 @@ int storage_cell_start(int file_des) {
cprintf(RED, "Warning: %s", mess); cprintf(RED, "Warning: %s", mess);
} }
#ifdef SLS_DETECTOR_FUNCTION_LIST #ifdef SLS_DETECTOR_FUNCTION_LIST
else { else if (arg > MAX_STORAGE_CELL_VAL) {
ret=FAIL;
strcpy(mess,"Max Storage cell number should not exceed 15\n");
cprintf(RED, "Warning: %s", mess);
} else {
#ifdef VERBOSE #ifdef VERBOSE
printf("Storage cell start to %d\n", arg); printf("Storage cell start to %d\n", arg);
#endif #endif