]> rtime.felk.cvut.cz Git - hydro.git/blob - app-bohyn/src/utils.h
Added monitoring web system. Minor changes in regulator and in control.
[hydro.git] / app-bohyn / src / utils.h
1 # ifndef _UTILS_H
2 # define _UTILS_H
3
4 #include <stdlib.h>
5 #include <string.h>
6 #include <stdio.h>
7 #include <cmath>
8
9 #include <QPair>
10 #include <QByteArray>
11 #include <QString>
12 #include <QDateTime>
13
14 #include <ul_lib/ulan.h>
15
16 #include "defines.h"
17
18 unsigned long buf2sn(const QByteArray &_buf);
19
20 QByteArray sn2buf(unsigned long mod_sn);
21
22 int16_t buf2int16(const QByteArray &_buf);
23
24 uint16_t buf2uint16(const QByteArray &_buf);
25
26 int takeCid(QByteArray &buf);
27
28 int takeLen(QByteArray &buf);
29
30 int takeData(QByteArray &buf, int len);
31
32 void logToFile(const QString &msg, bool end_new_line=true);
33
34 void logDebug(const QByteArray &buf);
35
36 QDateTime currentDateTime();
37
38 int getRandom();
39
40 QList< QPair<QString, QString> > getColorOptions();
41
42 QList< QPair<QString, QString> > getOnOffOptions();
43
44 QList< QPair<double, QString> > getTimeLabels(int secs_ago);
45
46 # endif