From f92f06042907f92f75f6e4cf68a43854d2de8027 Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周一, 23 12月 2024 17:08:47 +0800
Subject: [PATCH] 22
---
CC/iWareCC_ASRS/ThreadService/02_BZ39工位(补板后工位)/DataProcess_RobotBuffer_ModeChange.cs | 181 +++++++++++++++++++++++++-------------------
1 files changed, 103 insertions(+), 78 deletions(-)
diff --git "a/CC/iWareCC_ASRS/ThreadService/02_BZ39\345\267\245\344\275\215\357\274\210\350\241\245\346\235\277\345\220\216\345\267\245\344\275\215\357\274\211/DataProcess_RobotBuffer_ModeChange.cs" "b/CC/iWareCC_ASRS/ThreadService/02_BZ39\345\267\245\344\275\215\357\274\210\350\241\245\346\235\277\345\220\216\345\267\245\344\275\215\357\274\211/DataProcess_RobotBuffer_ModeChange.cs"
index 97019c4..7341d69 100644
--- "a/CC/iWareCC_ASRS/ThreadService/02_BZ39\345\267\245\344\275\215\357\274\210\350\241\245\346\235\277\345\220\216\345\267\245\344\275\215\357\274\211/DataProcess_RobotBuffer_ModeChange.cs"
+++ "b/CC/iWareCC_ASRS/ThreadService/02_BZ39\345\267\245\344\275\215\357\274\210\350\241\245\346\235\277\345\220\216\345\267\245\344\275\215\357\274\211/DataProcess_RobotBuffer_ModeChange.cs"
@@ -1,84 +1,109 @@
-锘縰sing Admin.NET.Application;
-using iWareCC.Common.Helper;
-using iWareCC.StationService;
-using iWareCommon.Common.Globle;
-using iWareCommon.Utils;
-using iWareModel;
-using iWareSql.DataAccess;
-using iWareSql.DBModel;
-using iWareSql.WmsDBModel;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.ServiceModel.Configuration;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
-using WZ.Useful.Commons;
-using XiGang.Core.Model;
+锘�//using Admin.NET.Application;
+//using iWareCC.Common.Helper;
+//using iWareCC.StationService;
+//using iWareCommon.Common.Globle;
+//using iWareCommon.Utils;
+//using iWareModel;
+//using iWareSql.DataAccess;
+//using iWareSql.DBModel;
+//using iWareSql.WmsDBModel;
+//using System;
+//using System.Collections.Generic;
+//using System.Linq;
+//using System.ServiceModel.Configuration;
+//using System.Text;
+//using System.Threading;
+//using System.Threading.Tasks;
+//using WZ.Useful.Commons;
+//using XiGang.Core.Model;
-namespace iWareCC.ThreadService
-{
- /// <summary>
- /// 鏈哄櫒浜虹紦瀛樺矝 妯″紡鍒囨崲 澶勭悊
- /// </summary>
- public static class DataProcess_RobotBuffer_ModeChange
- {
- public static async void Handler()
- {
- var alertMsg = "";
- LogType logType = LogType.DataProcess_BZ39;
- while (true)
- {
- Thread.Sleep(2000);//浼戠湢2绉掞紝灏嗕紤鐪犲啓鍒板墠闈紝鏄负浜嗕笅闈㈢殑continue鏂规硶鎵ц鍚庝笉鏄剧ず閿欒淇℃伅鐨勬彁绀猴紒锛侊紒銆怑ditBy shaocx,2022-05-24銆�
- SystemWarningMsg._lbl_alert_DataProcess_BZ39 = string.Empty;
- try
- {
- if (SystemValue.isAllowRuning_DataProcess_BZ39 && SystemValue.isStartedModel)
- {
+//namespace iWareCC.ThreadService
+//{
+// /// <summary>
+// /// 鏈哄櫒浜虹紦瀛樺矝 妯″紡鍒囨崲 澶勭悊
+// /// </summary>
+// public static class DataProcess_RobotBuffer_ModeChange
+// {
+// public static async void Handler()
+// {
+// var alertMsg = "";
+// LogType logType = LogType.DataProcess_RobotBuffer_ModeChange;
+// while (true)
+// {
+// Thread.Sleep(2000);//浼戠湢2绉掞紝灏嗕紤鐪犲啓鍒板墠闈紝鏄负浜嗕笅闈㈢殑continue鏂规硶鎵ц鍚庝笉鏄剧ず閿欒淇℃伅鐨勬彁绀猴紒锛侊紒銆怑ditBy shaocx,2022-05-24銆�
+// SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_ModeChange = string.Empty;
+// try
+// {//SystemValue.isAllowRuning_DataProcess_RobotBuffer_ModeChange &&
+// if ( SystemValue.isStartedModel)
+// {
+// var rgvLocation = StationLocationEnum.BZ39.ToString();
+// if (FormCC.IsAllowRunOutMode)
+// {
+// using (WmsDBModel wmsDB = new WmsDBModel())
+// {
+// var rbRunMode = wmsDB.wms_rbline_runmode.FirstOrDefault();
- if (FormCC.IsAllowRunOutMode)
- {
- using (WmsDBModel wmsDB = new WmsDBModel())
- {
- var rbRunMode = wmsDB.wms_rbline_runmode.FirstOrDefault();
- if (rbRunMode.LineRunMode == (int)RbRunModeEnum.鍑哄簱妯″紡)
- {
- SystemWarningMsg._lbl_alert_DataProcess_BZ39 = $"宸茬粡鏄嚭搴撴ā寮忎簡,姝ゆ寰幆缁撴潫";
- continue;
- }
- rbRunMode.LineRunMode = (int)RbRunModeEnum.鍑哄簱妯″紡;
- rbRunMode.LineRunModeName = RbRunModeEnum.鍑哄簱妯″紡.ToString();
- rbRunMode.UpdateTime = DateTime.Now;
+// if (TaskHandler.ValidateNoFinishOutTaskForRobotBuffer(wmsDB))
+// {//涓嶅瓨鍦�
+// rbRunMode.LineRunMode = (int)RbRunModeEnum.鍏ュ簱妯″紡;
+// rbRunMode.LineRunModeName = RbRunModeEnum.鍏ュ簱妯″紡.ToString();
+// rbRunMode.UpdateTime = DateTime.Now;
- //鎺ㄩ�佺粰PLC鍒囨崲妯″紡
- //using (StationServiceClient client = new StationServiceClient())
- //{
- // var res = await client.WriteOutStoreTaskInfoAsync((int)EDevice.Station, rgvLocation, doTask.PlaceCode, Convert.ToInt32(doTask.TaskNo));
- // if (!res.result)
- // {
- // SystemWarningMsg._lbl_alert_DataProcess_BZ39 = $"{rgvLocation.ToString()}-涓嬪彂鍑哄簱浠诲姟 澶辫触,WriteOutStoreTaskInfoAsync 杩斿洖:{res.resMsg}";
- // continue;
- // }
- // else
- // {
- // Log4NetHelper.WriteInfoLog(logType, $"{rgvLocation.ToString()}-涓嬪彂鍑哄簱浠诲姟 鎴愬姛,WriteOutStoreTaskInfoAsync锛屽弬鏁�: 绔欑偣{rgvLocation}");
- // }
- //}
+// //鎺ㄩ�佺粰PLC鍒囨崲妯″紡
+// using (StationServiceClient client = new StationServiceClient())
+// {
+// var res = await client.ChangeModeAsync((int)EDevice.Station, (int)RbRunModeEnum.鍏ュ簱妯″紡, rgvLocation);
+// if (!res.result)
+// {
+// SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_ModeChange = $"{rgvLocation.ToString()}-鎺ㄩ�佺粰PLC鍒囨崲妯″紡 澶辫触,ChangeModeAsync 杩斿洖:{res.resMsg}";
+// continue;
+// }
+// else
+// {
+// Log4NetHelper.WriteInfoLog(logType, $"{rgvLocation.ToString()}-鎺ㄩ�佺粰PLC鍒囨崲妯″紡 鎴愬姛,ChangeModeAsync锛屽弬鏁�: 绔欑偣{rgvLocation}");
+// }
+// }
+// FormCC.IsAllowRunOutMode = false;
+// }
+// else
+// {//瀛樺湪
+// if (rbRunMode.LineRunMode == (int)RbRunModeEnum.鍑哄簱妯″紡)
+// {
+// SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_ModeChange = $"宸茬粡鏄嚭搴撴ā寮忎簡,姝ゆ寰幆缁撴潫";
+// continue;
+// }
+// rbRunMode.LineRunMode = (int)RbRunModeEnum.鍑哄簱妯″紡;
+// rbRunMode.LineRunModeName = RbRunModeEnum.鍑哄簱妯″紡.ToString();
+// rbRunMode.UpdateTime = DateTime.Now;
+// //鎺ㄩ�佺粰PLC鍒囨崲妯″紡
+// using (StationServiceClient client = new StationServiceClient())
+// {
+// var res = await client.ChangeModeAsync((int)EDevice.Station, (int)RbRunModeEnum.鍑哄簱妯″紡, rgvLocation);
+// if (!res.result)
+// {
+// SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_ModeChange = $"{rgvLocation.ToString()}-鎺ㄩ�佺粰PLC鍒囨崲妯″紡 澶辫触,ChangeModeAsync 杩斿洖:{res.resMsg}";
+// continue;
+// }
+// else
+// {
+// Log4NetHelper.WriteInfoLog(logType, $"{rgvLocation.ToString()}-鎺ㄩ�佺粰PLC鍒囨崲妯″紡 鎴愬姛,ChangeModeAsync锛屽弬鏁�: 绔欑偣{rgvLocation}");
+// }
+// }
+// }
- wmsDB.SaveChanges();
- }
- }
- }
- }
- catch (Exception ex)
- {
- SystemWarningMsg._lbl_alert_DataProcess_BZ39 += " 鍑虹幇寮傚父:" + ex.Message + SysGloble.SPLIT_STR;
- Log4NetHelper.WriteErrorLog(logType, " 鍑虹幇寮傚父锛�" + ex.Message, ex);
- }
- }
- }
+// wmsDB.SaveChanges();
+// }
+// }
+// }
+// }
+// catch (Exception ex)
+// {
+// SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_ModeChange += " 鍑虹幇寮傚父:" + ex.Message + SysGloble.SPLIT_STR;
+// Log4NetHelper.WriteErrorLog(logType, " 鍑虹幇寮傚父锛�" + ex.Message, ex);
+// }
+// }
+// }
- }
-}
+// }
+//}
--
Gitblit v1.9.3