#ifndef PIHISTORIANDEFS_H
#define PIHISTORIANDEFS_H

#define HISTORIAN_WATCHDOG_TIMEOUT 3000

//PI HISTORIAN modbus table masks
#define HISTORIAN_ZT_DATA_BASE_REG             2000
#define HISTORIAN_MODBUS_ZT_TABLE_DATA_SIZE    50  //Taille de la table = 50 registres (2000 à 2049)

//Flags definitions for HR2000
#define HISTORIAN_ZT1_FN_ENABLED_FLAG_MASK        0x0001
#define HISTORIAN_ZT1_PP_ENABLED_FLAG_MASK        0x0002
#define HISTORIAN_ZT1_PG_ENABLED_FLAG_MASK        0x0004
#define HISTORIAN_ZT2_PP_ENABLED_FLAG_MASK        0x0008
#define HISTORIAN_ZT_MAINTENANCE_MODE_FLAG_MASK   0x0010
#define HISTORIAN_ZT_HPC_COMM_HEALTH_FLAG_MASK    0x0020
#define HISTORIAN_ZT_SEI_COMM_FLAG_MASK           0x0040
#define HISTORIAN_ZT_ZT1_ENABLED_FLAG_MASK        0x0080
#define HISTORIAN_ZT_ZT2_ENABLED_FLAG_MASK        0x0100
#define HISTORIAN_ZT_RESERVED_FLAG_MASK_7         0x0200
#define HISTORIAN_ZT_RESERVED_FLAG_MASK_6         0x0400
#define HISTORIAN_ZT_RESERVED_FLAG_MASK_5         0x0800
#define HISTORIAN_ZT_RESERVED_FLAG_MASK_4         0x1000
#define HISTORIAN_ZT_RESERVED_FLAG_MASK_3         0x2000
#define HISTORIAN_ZT_RESERVED_FLAG_MASK_2         0x4000
#define HISTORIAN_ZT_RESERVED_FLAG_MASK_1         0x8000


#define HISTORIAN_ZT_STATUS_FLAGS_REG_ADD         2000
#define HISTORIAN_PG_CALIBRATION_REG_ADD          2001
#define HISTORIAN_BOOT_DATE_YEAR_REG_ADD          2002
#define HISTORIAN_BOOT_DATE_MONTH_REG_ADD         2003
#define HISTORIAN_BOOT_DATE_DAY_REG_ADD           2004
#define HISTORIAN_BOOT_DATE_HOUR_REG_ADD          2005
#define HISTORIAN_BOOT_DATE_MINUTES_REG_ADD       2006
#define HISTORIAN_BOOT_DATE_SECONDS_REG_ADD       2007
#define HISTORIAN_TRAINS_TOTAL_REG_ADD            2008
#define HISTORIAN_DETECTIONS_TOTAL_REG_ADD        2009
#define HISTORIAN_TRAINS_TODAY_REG_ADD            2010
#define HISTORIAN_DETECTIONS_TODAY_REG_ADD        2011
#define HISTORIAN_FN_DETECTS_TODAY_REG_ADD        2012
#define HISTORIAN_PPI_ZT1_DETECTS_TODAY_REG_ADD   2013
#define HISTORIAN_PPE_ZT1_DETECTS_TODAY_REG_ADD   2014
#define HISTORIAN_PG_DETECTS_TODAY_REG_ADD        2015
#define HISTORIAN_PPI_ZT2_DETECTS_TODAY_REG_ADD   2016
#define HISTORIAN_PPE_ZT2_DETECTS_TODAY_REG_ADD   2017
#define HISTORIAN_LAST_TRAIN_YEAR_REG_ADD         2018
#define HISTORIAN_LAST_TRAIN_MONTH_REG_ADD        2019
#define HISTORIAN_LAST_TRAIN_DAY_REG_ADD          2020
#define HISTORIAN_LAST_TRAIN_HOUR_REG_ADD         2021
#define HISTORIAN_LAST_TRAIN_MINUTE_REG_ADD       2022
#define HISTORIAN_LAST_TRAIN_SECONDS_REG_ADD      2023
#define HISTORIAN_LAST_TRAIN_ZONE_REG_ADD         2024
#define HISTORIAN_LAST_TRAIN_NB_DETECTS_REG_ADD   2025
#define HISTORIAN_LAST_TRAIN_PPI_RK_1_REG_ADD     2026
#define HISTORIAN_LAST_TRAIN_PPI_RK_2_REG_ADD     2027
#define HISTORIAN_LAST_TRAIN_PPI_RK_3_REG_ADD     2028
#define HISTORIAN_LAST_TRAIN_PPI_RK_4_REG_ADD     2029
#define HISTORIAN_LAST_TRAIN_PPE_RK_1_REG_ADD     2030
#define HISTORIAN_LAST_TRAIN_PPE_RK_2_REG_ADD     2031
#define HISTORIAN_LAST_TRAIN_PPE_RK_3_REG_ADD     2032
#define HISTORIAN_LAST_TRAIN_PPE_RK_4_REG_ADD     2033
#define HISTORIAN_LAST_TRAIN_PG_RK_1_REG_ADD      2034
#define HISTORIAN_LAST_TRAIN_PG_RK_2_REG_ADD      2035
#define HISTORIAN_LAST_TRAIN_PG_RK_3_REG_ADD      2036
#define HISTORIAN_LAST_TRAIN_PG_RK_4_REG_ADD      2037
#define HISTORIAN_LAST_TRAIN_FN_RK_1_REG_ADD      2038
#define HISTORIAN_LAST_TRAIN_FN_RK_2_REG_ADD      2039
#define HISTORIAN_LAST_TRAIN_FN_RK_3_REG_ADD      2040
#define HISTORIAN_LAST_TRAIN_FN_RK_4_REG_ADD      2041
#define HISTORIAN_LAST_TRAIN_COMPTAGE_DET_REG_ADD 2042
#define HISTORIAN_LAST_TRAIN_PEQ_REG_ADD          2043
#define HISTORIAN_LAST_TRAIN_TYPE_REG_ADD         2044
#define HISTORIAN_LAST_TRAIN_ID1_REG_ADD          2045
#define HISTORIAN_LAST_TRAIN_ID2_REG_ADD          2046
#define HISTORIAN_LAST_TRAIN_ID3_REG_ADD          2047
#define HISTORIAN_RESERVED_1_REG_ADD              2048
#define HISTORIAN_RESERVED_2_REG_ADD              2049




#endif // PIHISTORIANDEFS_H
