#ifndef HELPERS_H #define HELPERS_H #include #include #include #include #include #include #include #include #include #include //byte array <-> unsiged short conversion #define SHORT2BYTES(sh,by) {by[0] = (sh>>8) & 0xFF; by[1] = sh & 0xFF;} #define LO(x) (x & 0xFF) #define HI(x) ((x>>8) & 0xFF) #define BYTES2SHORT(by) \ ( \ (static_cast(static_cast((by)[0])) << 8) | \ (static_cast(static_cast((by)[1]))) \ ) #define BYTES2INT(by) \ ( \ (static_cast(static_cast((by)[0])) << 24) | \ (static_cast(static_cast((by)[1])) << 16) | \ (static_cast(static_cast((by)[2])) << 8) | \ (static_cast(static_cast((by)[3]))) \ ) //convert textual representation of IP to array of numbers and/or well-formatted string QString ip2num(QString input, unsigned char* numbers = NULL); //go to the main branch of settings void top (QSettings* settings); //copy settings table void copyQSettings(QSettings* from, QSettings* to); //sleep with processing queues void msleep2(unsigned int ms, unsigned int resolution = 10); //Save data in form of CSV file. The three tables should have the same number of rows. They will be concatenated. Sensormean and sensorstd will be interlaced. void saveCsvFile(QString filename, QList> params, QList> sensormean, QList> sensorstd, QString delimiter = QString(",")); #endif // HELPERS_H