projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix #510 by disabling removal of the last decoder from the popup
[pulseview.git]
/
pv
/
util.hpp
diff --git
a/pv/util.hpp
b/pv/util.hpp
index 5d65694054ab2c0b2e6a9f652fc736abfc5da8cd..ba6702f79f175f345ddfd814ae6fc1ae2ceeda78 100644
(file)
--- a/
pv/util.hpp
+++ b/
pv/util.hpp
@@
-18,16
+18,21
@@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef PULSEVIEW_UTIL_H
-#define PULSEVIEW_UTIL_H
+#ifndef PULSEVIEW_UTIL_H
PP
+#define PULSEVIEW_UTIL_H
PP
-#include <
math.
h>
+#include <
cmat
h>
#include <QString>
namespace pv {
namespace util {
#include <QString>
namespace pv {
namespace util {
+enum TimeUnit {
+ Time = 1,
+ Samples = 2
+};
+
extern const int FirstSIPrefixPower;
/**
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 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(
* @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
/**
* Formats a given time value with a SI prefix so that the
@@
-71,4
+78,4
@@
QString format_second(double second);
} // namespace util
} // namespace pv
} // namespace util
} // namespace pv
-#endif // PULSEVIEW_UTIL_H
+#endif // PULSEVIEW_UTIL_H
PP