Fotobot
Get data from your photovoltaic plant
maintenance.cpp
Go to the documentation of this file.
1 
7 #include "maintenance.h"
8 #include "database.h"
9 #include "static.h"
10 
11 MAINTENANCE::MAINTENANCE(QObject *parent) : QObject(parent) {
12  QTimer *timer = new QTimer(this);
13  timer->setInterval(3600000); // 60 minutes
14  timer->setSingleShot(false);
15  timer->start();
16  connect (timer, SIGNAL(timeout()),
17  this, SLOT(slotMaintenance()));
18 }
19 
20 void MAINTENANCE::slotMaintenance() {
21  QTime initime = QTime::currentTime();
22  if (initime.hour() > 2) {
23  return;
24  }
25  // Dělá se pouze v noci
26  qDebug() << "maintenance begin";
27  Static::db->execMaintenance();
28  qDebug() << "maintenance end:" << initime.msecsTo(QTime::currentTime()) << "msecs";
29 }
30 
void execMaintenance()
Database maintenance.
Definition: database.cpp:1158