12345678910111213141516171819202122232425262728293031323334353637 |
- #include "dogcore.h"
- #include "datacollector.h"
- DogCore::DogCore(QObject *parent) : QObject(parent)
- {
- hour = 255;
- timer = new QTimer(this);
- connect(timer,&QTimer::timeout,this,&DogCore::time_out);
- }
- DogCore::~DogCore()
- {
- }
- void DogCore::time_out()
- {
- chkTime = QDateTime::currentDateTime().toTime_t();
- if((chkTime - dataColShm->time)>30){
- if((system("killall ytDataCollectorCore")) != -1){
- system("/root/bin/ytDataCollectorCore &");
- }
- }
- if((chkTime - dataColShm->influtime)>30){
- if((system("killall ytDeviceTypeInfluxdbWriter")) != -1){
- system("/root/bin/ytDeviceTypeInfluxdbWriter &");
- }
- }
- }
- void DogCore::start()
- {
- time_out();
- timer->start(5000);
- }
|