This repository has been archived by the owner on Jan 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
/
util.h
41 lines (32 loc) · 1.18 KB
/
util.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
Copyright 2013 Jared Wiltshire
This file is part of VAG Blocks.
VAG Blocks is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
VAG Blocks is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with VAG Blocks. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef UTIL_H
#define UTIL_H
#include <QString>
QString toHex(int num, int places = 2);
QString toHex(unsigned int num, int places = 2);
QString intToBinary(int num, int places = 8);
QString uintToBinary(unsigned int num, int places = 8);
QString doubleToStr(double num, int prec = 2);
int fromHex(QString str);
enum {
stdLog = 0x01,
rxTxLog = 0x02,
serialConfigLog = 0x04,
keepAliveLog = 0x08,
responseErrorLog = 0x10,
debugMsgLog = 0x20
};
#endif // UTIL_H