From 1b38b348b5d4a12c9f32068ef038c3f92125b745 Mon Sep 17 00:00:00 2001 From: "support.sampyo" Date: Tue, 26 Mar 2024 11:09:36 +0000 Subject: [PATCH] Commit message --- framework.yaml | 2 +- main.py | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/framework.yaml b/framework.yaml index 2bc9572..ad0a766 100644 --- a/framework.yaml +++ b/framework.yaml @@ -7,5 +7,5 @@ spec: virtualEnv: base # 사용할 가상환경 이름입니다. package: requirements.txt # 설치할 Python 패키지 정보 파일입니다.(기본 값은 requirement.txt 입니다.) stackbase: - tagName: v0.0.10 # Stackbase(gitea)에 릴리즈 태그명 입니다. + tagName: v0.0.11 # Stackbase(gitea)에 릴리즈 태그명 입니다. repoName: sampyo-dio # Stackbase(gitea)에 저장될 저장소 이릅니다. diff --git a/main.py b/main.py index f6c526a..2f9f263 100644 --- a/main.py +++ b/main.py @@ -63,7 +63,12 @@ def Measure_Weight(client): def Calculate_Concentration(weight): global data, volume_water data['data']['weight'] = weight - result = (float(weight) * volume_water * 128.5) - 126.11 # 1000 / 531 = 1.883239171 + # result = (float(weight) * volume_water * 128.5) - 126.11 # 1000 / 531 = 1.883239171 + tmp1 = weight * volume_water + tmp2 = tmp1 * 128.5 + tmp3 = tmp2 - 126.11 + + print(f'volume_water: { data['data']['concentration'] = result # print(f'{weight}, {result}') @@ -316,7 +321,7 @@ if __name__ == "__main__": with open('./config.json', encoding='UTF-8') as f: jsonData = json.load(f) - volume_water = float(jsonData['volume-water']) / 1000.0 + volume_water = 1000.0 / float(jsonData['volume-water']) modbus_addr = jsonData['modbus-server']['address'] modbus_port = jsonData['modbus-server']['port']