diff --git a/config.json b/config.json index e6b0791..7b8db0d 100644 --- a/config.json +++ b/config.json @@ -1,6 +1,6 @@ { "get_data_interval": 10, - "set_zero_temperature": "n", + "set_zero_temperature": "y", "ref_zero_point": { "oilInFlowRate": 4016, "oilOutFlowRate": 3995, diff --git a/framework.yaml b/framework.yaml index af6b27e..c548821 100644 --- a/framework.yaml +++ b/framework.yaml @@ -8,5 +8,5 @@ spec: package: requirements.txt # 설치할 Python 패키지 정보 파일입니다.(기본 값은 requirement.txt 입니다.) runtime: python3.9 stackbase: - tagName: v1.0.3 # Stackbase(gitea)에 릴리즈 태그명 입니다. + tagName: v1.0.4 # Stackbase(gitea)에 릴리즈 태그명 입니다. repoName: aquarack-sensor-collector # Satackbase(gitea)에 저장될 저장소 이릅니다. diff --git a/main.py b/main.py index 6d5343f..26d11fb 100644 --- a/main.py +++ b/main.py @@ -21,11 +21,12 @@ def get_point_temperature(serial_obj): try: res = serial_obj.read_holding_registers(address=32, count=32, slave=2) - # print(res) + for i, j in zip(t_col, points): res_dict[i] = res.registers[j - 1] * 0.1 except Exception as e: pass + return res_dict def get_keyence_devices(serial_obj): @@ -47,15 +48,15 @@ def get_keyence_devices(serial_obj): try: res = serial_obj.read_holding_registers(address=50, count=8, slave=5) - print(f'k_col: {k_col} g_zero: {g_zero_point}') + for i, j in enumerate(k_col): if i % 2 == 0: res_dict[j] = ((res.registers[i] - g_zero_point[i // 2]) / 16000) * 300 - print(f'[{j}] Flow_rate: {res_dict[j]:.6f}L') else: res_dict[j] = ((res.registers[i] - 4000) / 16000) * 100 except Exception as e: pass + return res_dict def init_zero_detection(serial_obj, config_dict): @@ -120,7 +121,7 @@ def runAction(): sleep_time = int(interval / cnt_limit) - (diff * 0.001) cnt += 1 if cnt == cnt_limit: - snd_data = {key: value / cnt_limit for key, value in sum_data.items() if value != 0.0} + snd_data = {key: value / cnt_limit for key, value in sum_data.items()} sdtcloud.pubMessage(snd_data) cnt = 0 sum_data = init_data_dict()