snapshot works,id works, conversion from seconds to ms,us etc works, number of measurements works

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@14 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
l_maliakal_d
2012-06-26 15:06:55 +00:00
parent b3de7a9051
commit 824da9d4c4
20 changed files with 320 additions and 256 deletions

View File

@ -54,6 +54,40 @@ public:
return valueNS;
};
//-------------------------------------------------------------------------------------------------------------------------------------------------
/** returns the time in the appropriate time unit
* @param unit unit of time
* @param value time in seconds
* returns the corresponding time value
*/
static float getCorrectTime(timeUnit& unit, float value){
int intUnit = (int)SECONDS;
/** hr, min, sec */
if(value>=1){
float newVal = value;
while((newVal>=1)&&(intUnit>=(int)HOURS)){
/** value retains the old value */
value = newVal;
newVal = value/60;
intUnit--;
}
/** returning the previous value*/
unit = (timeUnit)(intUnit+1);
return value;
}
/** ms, us, ns */
else{
while((value<1)&&(intUnit<(int)NANOSECONDS)){
value = value*1000;
intUnit++;
}
unit = (timeUnit)(intUnit);
return value;
}
};
//-------------------------------------------------------------------------------------------------------------------------------------------------
/**displays an error message