Browse Source

add in log message UPS test finished

balbekova 6 years ago
parent
commit
fc70c3493e
2 changed files with 30 additions and 2 deletions
  1. 25 2
      modules/monitor/ups_monitor.c
  2. 5 0
      modules/monitor/ups_monitor.h

+ 25 - 2
modules/monitor/ups_monitor.c

@@ -46,7 +46,6 @@ extern SETTINGS_t sSettings;
 
 
 extern bool flUpdateLog;
 extern bool flUpdateLog;
 
 
-
 /**
 /**
   * @brief  Задача мониторинга параметров UPS
   * @brief  Задача мониторинга параметров UPS
   */
   */
@@ -60,6 +59,7 @@ void UPS_Monitor(void *params)
     // Проверяем флаг подключения UPS
     // Проверяем флаг подключения UPS
    if (UPS.Present)
    if (UPS.Present)
     {
     {
+	  UPS_TestFinishMonitor();
       UPS_LineFailMonitor();
       UPS_LineFailMonitor();
 #if	defined HARDWARE_BT6706 || HARDWARE_BT6708
 #if	defined HARDWARE_BT6706 || HARDWARE_BT6708
       UPS_VACoutputMonitor();
       UPS_VACoutputMonitor();
@@ -75,7 +75,7 @@ void UPS_Monitor(void *params)
     UPS_CriticalAlarmMonitor();
     UPS_CriticalAlarmMonitor();
     UPS_NonCriticalAlarmMonitor();
     UPS_NonCriticalAlarmMonitor();
 #endif
 #endif
-      
+
     vTaskDelay(1000);
     vTaskDelay(1000);
   }
   }
 }
 }
@@ -317,6 +317,27 @@ void UPS_NonCriticalAlarmMonitor(void)
 }
 }
 #endif
 #endif
 
 
+/**
+  * @brief  Мониторинг бита Test in progress
+  */
+void UPS_TestFinishMonitor(void)
+{
+  static uint8_t TestFinishState = 0;
+  uint8_t TestFinishStateCurrent;
+
+  TestFinishStateCurrent = (UPS.Status >> 2) & 0x01;
+
+  // Значение параметра изменилось
+  if (TestFinishStateCurrent != TestFinishState)
+  {
+    if (!TestFinishStateCurrent){
+      log_event_data(LOG_TEST_UPS, "Завершен");
+      flUpdateLog = true;
+    }
+  }
+
+  TestFinishState = TestFinishStateCurrent;
+}
 /**
 /**
   * @brief  Мониторинг бита LainFail
   * @brief  Мониторинг бита LainFail
   */
   */
@@ -770,4 +791,6 @@ void UPS_BatteryConnectMonitor(void)
 }
 }
 
 
 
 
+
+
 /********************************* (C) РОТЕК **********************************/
 /********************************* (C) РОТЕК **********************************/

+ 5 - 0
modules/monitor/ups_monitor.h

@@ -25,6 +25,11 @@ typedef enum
   
   
 } HYST_STATE_t;
 } HYST_STATE_t;
 
 
+/**
+  * @brief  Мониторинг бита Test in progress
+  */
+void UPS_TestFinishMonitor(void);
+
 /**
 /**
   * @brief  Мониторинг бита DI0 state
   * @brief  Мониторинг бита DI0 state
   */
   */