You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
|
#ifndef WORKFORDB_H
|
|
|
|
|
|
#define WORKFORDB_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
|
#include "databasesql.h"
|
|
|
|
|
|
|
|
|
|
|
|
class WorkForDB : public QObject
|
|
|
|
|
|
{
|
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
WorkForDB(QObject *parent = 0){ m_pDb = NULL; };
|
|
|
|
|
|
~WorkForDB(){};
|
|
|
|
|
|
void setDB(DataBaseSql* pDB){ m_pDb = pDB; };
|
|
|
|
|
|
public slots:
|
|
|
|
|
|
void doWork(const QString& strTime, const int &ncount)
|
|
|
|
|
|
{
|
|
|
|
|
|
QString str;
|
|
|
|
|
|
if (m_pDb){
|
|
|
|
|
|
m_pDb->DelDatasByTime(strTime);
|
|
|
|
|
|
m_pDb->DelWarnDataByCount(1, ncount);
|
|
|
|
|
|
m_pDb->DelWarnDataByCount(4, ncount);
|
|
|
|
|
|
}
|
|
|
|
|
|
emit resultReady(str);
|
|
|
|
|
|
};
|
|
|
|
|
|
private:
|
|
|
|
|
|
class DataBaseSql *m_pDb;
|
|
|
|
|
|
signals:
|
|
|
|
|
|
void resultReady(QString str);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // WORKFORDB_H
|