]> rtime.felk.cvut.cz Git - hydro.git/blobdiff - app-bohyn/src/utils.h
Added monitoring web system. Minor changes in regulator and in control.
[hydro.git] / app-bohyn / src / utils.h
diff --git a/app-bohyn/src/utils.h b/app-bohyn/src/utils.h
new file mode 100644 (file)
index 0000000..df5a26e
--- /dev/null
@@ -0,0 +1,46 @@
+# ifndef _UTILS_H
+# define _UTILS_H
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <cmath>
+
+#include <QPair>
+#include <QByteArray>
+#include <QString>
+#include <QDateTime>
+
+#include <ul_lib/ulan.h>
+
+#include "defines.h"
+
+unsigned long buf2sn(const QByteArray &_buf);
+
+QByteArray sn2buf(unsigned long mod_sn);
+
+int16_t buf2int16(const QByteArray &_buf);
+
+uint16_t buf2uint16(const QByteArray &_buf);
+
+int takeCid(QByteArray &buf);
+
+int takeLen(QByteArray &buf);
+
+int takeData(QByteArray &buf, int len);
+
+void logToFile(const QString &msg, bool end_new_line=true);
+
+void logDebug(const QByteArray &buf);
+
+QDateTime currentDateTime();
+
+int getRandom();
+
+QList< QPair<QString, QString> > getColorOptions();
+
+QList< QPair<QString, QString> > getOnOffOptions();
+
+QList< QPair<double, QString> > getTimeLabels(int secs_ago);
+
+# endif