From dec65d35de7fd3bbd2034402f1f01a2696c9d569 Mon Sep 17 00:00:00 2001
From: YujinChu <YujinChu>
Date: Fri, 8 Sep 2023 08:17:36 +0000
Subject: [PATCH] timestamp fix

---
 AWX_collector.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/AWX_collector.py b/AWX_collector.py
index 88b9715..c2bc9f0 100644
--- a/AWX_collector.py
+++ b/AWX_collector.py
@@ -185,7 +185,7 @@ def cwt_thread(evt, chip_index, port_a_ai_id , port_a_do_id, port_b_ai_id , port
          -> 데이터를 어떻게 할 것이냐
           ->  이전 데이터가 있다면, 이전 데이터를 가지고 더미 데이터로 사용하는 방법 => 안하기로 했었음      
         '''
-        timenow = int(time.time()*1000)
+        timenow_a = int(time.time()*1000)
         isSuccess = True
 
         # PORT A
@@ -205,6 +205,7 @@ def cwt_thread(evt, chip_index, port_a_ai_id , port_a_do_id, port_b_ai_id , port
         except:
             None
         
+        timenow_b = int(time.time()*1000)
         # PORT B
         port_b_do_value = list(b[17:32])
         try:
@@ -224,8 +225,8 @@ def cwt_thread(evt, chip_index, port_a_ai_id , port_a_do_id, port_b_ai_id , port
             None
 
         if isSuccess:
-            queue_a.put([timenow,prev_a_ai, port_a_do_value])
-            queue_b.put([timenow,prev_b_ai, port_b_do_value])
+            queue_a.put([timenow_a,prev_a_ai, port_a_do_value])
+            queue_b.put([timenow_b,prev_b_ai, port_b_do_value])
         else:
             queue_a.put([0,prev_a_ai, port_a_do_value])
             queue_b.put([0,prev_b_ai, port_b_do_value])