|
OpenHantek
|
#include <cmath>#include <QApplication>#include <QLocale>#include <QStringList>#include <libusb-1.0/libusb.h>#include "utils/printutils.h"Functions | |
| QString | valueToString (double value, Unit unit, int precision) |
| Converts double to string containing value and (prefix+)unit (Counterpart to stringToValue). More... | |
| double | stringToValue (const QString &text, Unit unit, bool *ok) |
| Converts string containing value and (prefix+)unit to double (Counterpart to valueToString). More... | |
| QString | hexDump (unsigned char *data, unsigned int length) |
| Returns the hex dump for the given data. More... | |
| unsigned int | hexParse (const QString dump, uint8_t *data, unsigned int length) |
| QString hexDump | ( | unsigned char * | data, |
| unsigned int | length | ||
| ) |
Returns the hex dump for the given data.
| data | Pointer to the data bytes that should be dumped. |
| length | The length of the data array in bytes. |
| unsigned int hexParse | ( | const QString | dump, |
| uint8_t * | data, | ||
| unsigned int | length | ||
| ) |
| double stringToValue | ( | const QString & | text, |
| Unit | unit, | ||
| bool * | ok = nullptr |
||
| ) |
Converts string containing value and (prefix+)unit to double (Counterpart to valueToString).
| text | The text containing the value and its unit. |
| unit | The base unit of the value. |
| ok | Pointer to a success-flag, true on success, false on error. |
| QString valueToString | ( | double | value, |
| Unit | unit, | ||
| int | precision = -1 |
||
| ) |
Converts double to string containing value and (prefix+)unit (Counterpart to stringToValue).
| value | The value in prefixless units. |
| unit | The unit for the value. |
| precision | Significant digits, 0 for integer, -1 for auto. |