Correction de la remise à zéro des données du jour dans Historien
This commit is contained in:
@@ -17,6 +17,7 @@ CPIHistorianManager::CPIHistorianManager(CModbusRepository *PIHistorianRepo, int
|
||||
connect(mHistorianTimer,SIGNAL(timeout()),this,SLOT(HistorianTimerExpired()));
|
||||
|
||||
|
||||
mTodaysDate = QDate::currentDate();
|
||||
mNbPassagesToday = 0;
|
||||
mNbDeclToday = 0;
|
||||
mNbDeclTotal = 0;
|
||||
@@ -572,28 +573,28 @@ int CPIHistorianManager::NewZT2Passage(CZTPassageInfo ZT2PassageInfo)
|
||||
}
|
||||
void CPIHistorianManager::StartHistorianTimer()
|
||||
{
|
||||
QTime Time = QTime::currentTime();
|
||||
int Delay = Time.msecsTo(QTime(23,59,59,999));
|
||||
if(Delay < 0)
|
||||
{
|
||||
Delay += MSECS_IN_A_DAY;
|
||||
}
|
||||
|
||||
mHistorianTimer->start(Delay);
|
||||
mHistorianTimer->start(PI_HISTORIAN_DAILY_RESET_CHECK_TIMEOUT);
|
||||
|
||||
}
|
||||
|
||||
void CPIHistorianManager::HistorianTimerExpired()
|
||||
{
|
||||
mNbFNToday = 0;
|
||||
mNbPGToday = 0;
|
||||
mNbPPIZT1Today = 0;
|
||||
mNbPPEZT1Today = 0;
|
||||
mNbPPIZT2Today = 0;
|
||||
mNbPPEZT2Today = 0;
|
||||
mNbDeclToday = 0;
|
||||
if(mTodaysDate != QDate::currentDate())
|
||||
{
|
||||
mNbFNToday = 0;
|
||||
mNbPGToday = 0;
|
||||
mNbPPIZT1Today = 0;
|
||||
mNbPPEZT1Today = 0;
|
||||
mNbPPIZT2Today = 0;
|
||||
mNbPPEZT2Today = 0;
|
||||
mNbDeclToday = 0;
|
||||
|
||||
mTodaysDate = QDate::currentDate();
|
||||
|
||||
CEngLog::instance()->AddLogString("Reset des stats historien du jour",2);
|
||||
|
||||
}
|
||||
|
||||
StartHistorianTimer();
|
||||
|
||||
CEngLog::instance()->AddLogString("Reset des stats historien du jour",2);
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "ZTData.h"
|
||||
|
||||
#define PI_HISTORIAN_MODBUS_DEVICE_ID 1
|
||||
#define MSECS_IN_A_DAY (24 * 60 * 60 * 1000)
|
||||
#define PI_HISTORIAN_DAILY_RESET_CHECK_TIMEOUT 60000 //60 seconds
|
||||
|
||||
class CPIHistorianManager : public QObject
|
||||
{
|
||||
@@ -33,6 +33,7 @@ public:
|
||||
|
||||
QTimer *mHistorianTimer;
|
||||
void StartHistorianTimer();
|
||||
QDate mTodaysDate;
|
||||
|
||||
private:
|
||||
QList<CPIHistorianSession*> mHistorianSessionsList; //Les sessions établies par le serveur sont gardées dans cette liste
|
||||
|
||||
+4
-1
@@ -29,9 +29,12 @@
|
||||
#ifndef ZTVERSION_H
|
||||
#define ZTVERSION_H
|
||||
|
||||
#define ZT_SOFT_VERSION "V1.28"
|
||||
#define ZT_SOFT_VERSION "V1.29"
|
||||
|
||||
//LOG DES CHANGEMENTS
|
||||
//Version 1.29
|
||||
//-Tentative de faire marcher le reset des données Historien du jour
|
||||
|
||||
//Version 1.28
|
||||
//Corrections à l'interface historien:
|
||||
//-Correction du Nb de déclenchements aujourd'hui qui n'est pas remis à zéro
|
||||
|
||||
Reference in New Issue
Block a user