mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 04:47:14 +02:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user