dogcore.cpp 709 B

123456789101112131415161718192021222324252627282930313233
  1. #include "dogcore.h"
  2. #include "dogshm.h"
  3. DogCore::DogCore(QObject *parent) : QObject(parent)
  4. {
  5. timer = new QTimer(this);
  6. connect(timer,&QTimer::timeout,this,&DogCore::time_out);
  7. }
  8. void DogCore::start()
  9. {
  10. timer->start(5000);
  11. }
  12. void DogCore::time_out()
  13. {
  14. uint time = QDateTime::currentDateTime().toTime_t();
  15. if((time-dogshm->data_feedtime)>30){
  16. if((system("killall ytDMPDataServer"))!=-1){
  17. if((system("/root/bin/ytDMPDataServer &"))!=-1){
  18. }
  19. }
  20. }
  21. if((time-dogshm->version_feedtime)>30){
  22. if((system("killall ytDMPVersionServer"))!=-1){
  23. if((system("/root/bin/ytDMPVersionServer &"))!=-1){
  24. }
  25. }
  26. }
  27. }