计算时附加电缆产品信息
This commit is contained in:
+16
-1
@@ -6,6 +6,7 @@ import os
|
||||
import gzip
|
||||
from io import BytesIO
|
||||
from Manager.history_manager import historyManager
|
||||
from Manager.product_manager import productManager
|
||||
import json
|
||||
from config import *
|
||||
import logging
|
||||
@@ -406,7 +407,21 @@ class CpyMqttClient(QObject):
|
||||
"row_count": str(row_count),
|
||||
"direction": direction
|
||||
}
|
||||
|
||||
|
||||
try:
|
||||
product_info = json.loads(productManager.getCurrentProduct().get("info", "{}"))
|
||||
if product_info:
|
||||
pinfo = {}
|
||||
pinfo["OSC"] = float(product_info["WtOSC"]["bcz"])
|
||||
pinfo["INS"] = float(product_info["WtINS"]["bcz"])
|
||||
pinfo["ISC"] = float(product_info["WtISC"]["bcz"])
|
||||
if pinfo["OSC"] > 0.1 or pinfo["INS"] > 0.1 or pinfo["ISC"] > 0.1:
|
||||
info["product_info"] = pinfo
|
||||
except Exception as e:
|
||||
logger.error(f"Error in getCurrentProduct: {e}")
|
||||
|
||||
logger.info(f"info: {info}")
|
||||
|
||||
# 重置init标志
|
||||
self.init = 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user