Kaynağa Gözat

Initial commit

mingyue-unimat 1 hafta önce
ebeveyn
işleme
d91fa621ff
2 değiştirilmiş dosya ile 39 ekleme ve 12 silme
  1. 0 12
      README.MD
  2. 39 0
      normalization/constant.py

+ 0 - 12
README.MD

@@ -7,22 +7,10 @@
 |----config #配置文件,包括数据库配置信息(config.py)、配置信息映射模块(communicationConfig.py)
 |----normalization #包含格式化结果输出模块(constant.py),数据判断模块(data_normalization.py),数据获取模块(get_mysql_data.py)
 |----Logs #日志
-|----service #计算服务文件,包含算法计算服务模块(main_single_comp.py),计算服务判断模块(judge_handle_func.py)
 |----main.py #主程序(算法入口)
 
 #使用注意
 >1、只有机组COP计算服务开启才会进行计算
 2、该版本程序只支持单机头机组,暂不支持多机头机组
 
-#版本说明
->版本号:V1.2  更新时间:2021.4.15  更新内容如下:
-1、更改机组结构参数判断逻辑;
-2、优化计算逻辑及数据判断逻辑;
-3、增加制热COP计算分支;
-4、封闭程序漏洞;
-版本号:V1.3 更新时间:2021.5.18   更新内容如下:
-1、增加算法延时触发机制
-2、优化程序BUG
-
-
 

+ 39 - 0
normalization/constant.py

@@ -0,0 +1,39 @@
+def DictResultsAbnormal(dict_input, results_depict):
+    dict_results = {
+        "triggerTime": dict_input['triggerTime'],
+        "userName": dict_input['userName'],
+        "coolingStationName": dict_input['coolingStationName'],
+        "deviceName": dict_input['deviceName'],
+        "deviceId": dict_input['deviceId'],
+        "coolingCapacity": '',
+        "COP": '',
+        "coolingWaterFlow": '',
+        "chilledWaterFlow": '',
+        "resultsDepict": results_depict,
+        "dischargeTempMod": '',
+        "powerTheory": '',
+        "etaMotor": '',
+        "etaRoller": '',
+        "etaIse": ''}
+    return dict_results
+
+
+def DictResultsNormal(dict_results, results_depict):
+    dict_results = {
+        "triggerTime": dict_results['triggerTime'],
+        "userName": dict_results['userName'],
+        "coolingStationName": dict_results['coolingStationName'],
+        "deviceName": dict_results['deviceName'],
+        "deviceId": dict_results['deviceId'],
+        "coolingCapacity": round(dict_results['coolingCapacity'], 1),
+        "COP": round(dict_results['COP'], 2),
+        "coolingWaterFlow": round(dict_results['coolingWaterFlow'],1) if dict_results['coolingWaterFlow'] else '',
+        "chilledWaterFlow": round(dict_results['chilledWaterFlow'], 1) if dict_results['chilledWaterFlow'] else '',
+        "resultsDepict": results_depict,
+        "dischargeTempMod": round(dict_results['dischargeTemp'], 1),
+        "powerTheory": round(dict_results['powerTheory'], 1),
+        "etaMotor": round(dict_results['etaMotor'], 3),
+        "etaRoller": round(dict_results['etaRoller'], 3),
+        "etaIse": round(dict_results['etaIseCal'], 2)}
+    return dict_results
+