X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Futil.hpp;h=ba6702f79f175f345ddfd814ae6fc1ae2ceeda78;hb=ac98198803da204ae26da8592c6e81a912b4a1af;hp=f75c95721d9df142691d2f44b12db2a7ca7895ea;hpb=7a01bd3654ed046216308fa64edfd79be7cd525f;p=pulseview.git diff --git a/pv/util.hpp b/pv/util.hpp index f75c957..ba6702f 100644 --- a/pv/util.hpp +++ b/pv/util.hpp @@ -28,6 +28,11 @@ namespace pv { namespace util { +enum TimeUnit { + Time = 1, + Samples = 2 +}; + extern const int FirstSIPrefixPower; /** @@ -51,13 +56,15 @@ QString format_si_value( * @param prefix The number of the prefix, from 0 for 'femto' up to * 8 for 'giga'. If prefix is set to -1, the prefix will be calculated. * @param unit The unit of quantity. - * @param precision The number of digits after the decimal separator. + * @param precision The number of digits after the decimal separator or period (.). + * @param step_size The delta between two consecutive time markers (if applicable). * @param sign Whether or not to add a sign also for positive numbers. * * @return The formated value. */ QString format_time( - double t, int prefix = -1, unsigned precision = 0, bool sign = true); + double t, int prefix = -1, TimeUnit unit = Time, unsigned precision = 0, + double step_size = 0, bool sign = true); /** * Formats a given time value with a SI prefix so that the