diff --git a/slsDetectorSoftware/eigerDetectorServer/slsDetectorFunctionList.c b/slsDetectorSoftware/eigerDetectorServer/slsDetectorFunctionList.c index d6a10d6fd..3777ff3a6 100644 --- a/slsDetectorSoftware/eigerDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorSoftware/eigerDetectorServer/slsDetectorFunctionList.c @@ -236,7 +236,17 @@ int64_t getDetectorId(enum idMode arg){ int getDetectorNumber(){ + int res=0; + //execute and get address + char output[255]; + FILE* sysFile = popen("more /home/root/executables/detid.txt", "r"); + fgets(output, sizeof(output), sysFile); + pclose(sysFile); + sscanf(output,"%d",&res); + printf("detector id: %d\n",res); + +/* int res=0; char hostname[100]; if (gethostname(hostname, sizeof hostname) == 0) @@ -244,6 +254,7 @@ int getDetectorNumber(){ else perror("gethostname"); sscanf(hostname,"%x",&res); +*/ return res; } diff --git a/slsDetectorSoftware/slsDetector/slsDetector.cpp b/slsDetectorSoftware/slsDetector/slsDetector.cpp index 00fde2355..952430b5d 100644 --- a/slsDetectorSoftware/slsDetector/slsDetector.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetector.cpp @@ -3147,8 +3147,8 @@ slsDetectorDefs::detectorSettings slsDetector::setSettings( detectorSettings ise case EIGER: //settings is saved in myMod.reg myMod->reg=thisDetector->currentSettings; - ostfn << thisDetector->settingsDir << ssettings <<"/noise.sn"<< setw(6) << hex << getId(DETECTOR_SERIAL_NUMBER) << setbase(10); - oscfn << thisDetector->calDir << ssettings << "/calibration.sn"<settingsDir << ssettings <<"/noise.sn" << setfill('0') << setw(3) << dec << getId(DETECTOR_SERIAL_NUMBER) << setbase(10); + oscfn << thisDetector->calDir << ssettings << "/calibration.sn" << setfill('0') << setw(3) << dec << getId(DETECTOR_SERIAL_NUMBER) << setbase(10); #ifdef VERBOSE std::cout<< thisDetector->settingsDir<calDir <myDetectorType); @@ -6043,7 +6043,7 @@ int slsDetector::saveSettingsFile(string fname, int imod) { for (int im=mmin; immyDetectorType == EIGER) - ostfn << fname << ".sn" << setw(6) << hex << getId(DETECTOR_SERIAL_NUMBER); + ostfn << fname << ".sn" << setfill('0') << setw(3) << dec << getId(DETECTOR_SERIAL_NUMBER); else ostfn << fname << ".sn" << setfill('0') << setw(3) << hex << getId(MODULE_SERIAL_NUMBER,im); if ((myMod=getModule(im))) { @@ -6126,7 +6126,7 @@ int slsDetector::loadCalibrationFile(string fname, int imod) { ostfn << ".sn" << setfill('0') << setw(3) << hex << getId(MODULE_SERIAL_NUMBER, im); } }else if (fname.find(".sn")==string::npos && fname.find(".cal")==string::npos) { - ostfn << "." << setw(6) << hex << getId(DETECTOR_SERIAL_NUMBER); + ostfn << "." << setfill('0') << setw(3) << dec << getId(DETECTOR_SERIAL_NUMBER); } fn=ostfn.str(); if((myMod=getModule(im))){ @@ -6166,7 +6166,7 @@ int slsDetector::saveCalibrationFile(string fname, int imod) { for (int im=mmin; immyDetectorType == EIGER) - ostfn << fname << ".sn" << setw(6) << hex << getId(DETECTOR_SERIAL_NUMBER); + ostfn << fname << ".sn" << setfill('0') << setw(3) << dec << getId(DETECTOR_SERIAL_NUMBER); else ostfn << fname << ".sn" << setfill('0') << setw(3) << hex << getId(MODULE_SERIAL_NUMBER,im); if ((myMod=getModule(im))) {