From 143b8e2ec209a703c21c0f87709e90f0d752f016 Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周二, 10 12月 2024 14:51:04 +0800
Subject: [PATCH] Merge branch 'master' of http://222.71.245.114:9086/r/LA24030-LuLI_PackageLine
---
CC/iWareCC_ASRS/FormCC.cs | 164 ++++++++++++++++++++----------------------------------
1 files changed, 60 insertions(+), 104 deletions(-)
diff --git a/CC/iWareCC_ASRS/FormCC.cs b/CC/iWareCC_ASRS/FormCC.cs
index c26f950..4206456 100644
--- a/CC/iWareCC_ASRS/FormCC.cs
+++ b/CC/iWareCC_ASRS/FormCC.cs
@@ -37,6 +37,11 @@
{
/// <summary>
+ /// 鍏ㄥ眬-閰嶇疆鎶ヨ淇℃伅鍒楄〃
+ /// </summary>
+ public static DeviceWarningOutput configDeviceWarningList = DeviceWarningHandler.GetConfigWarningList();
+
+ /// <summary>
/// 鍏ㄥ眬鈥旀槸鍚﹀彲浠ヨ繍琛屾墽琛屽嚭搴撴ā寮�
/// </summary>
public static bool IsAllowRunOutMode = false;
@@ -172,31 +177,12 @@
startModelTipsThread.Start();
#region 鑾峰彇璁惧鏁版嵁
- ParameterizedThreadStart parStart1 = new ParameterizedThreadStart(GetSrmInfo);
- Thread thread1 = new Thread(parStart1);
- object o1 = (int)EDevice.涓�鍙峰爢鍨涙満;
- thread1.Start(o1);
-
- ParameterizedThreadStart parStart2 = new ParameterizedThreadStart(GetSrmInfo);
- Thread thread2 = new Thread(parStart2);
- object o2 = (int)EDevice.浜屽彿鍫嗗灈鏈�;
- thread2.Start(o2);
-
- ParameterizedThreadStart parStart3 = new ParameterizedThreadStart(GetSrmInfo);
- Thread thread3 = new Thread(parStart3);
- object o3 = (int)EDevice.涓夊彿鍫嗗灈鏈�;
- thread3.Start(o3);
-
- ParameterizedThreadStart parStart4 = new ParameterizedThreadStart(GetSrmInfo);
- Thread thread4 = new Thread(parStart4);
- object o4 = (int)EDevice.鍥涘彿鍫嗗灈鏈�;
- thread4.Start(o4);
-
-
-
var tskGetStationInfo = new Thread(GetStationInfo);
tskGetStationInfo.Start();
+
+ var _GetStationWarningInfo = new Thread(GetStationWarningInfo);
+ _GetStationWarningInfo.Start();
tskSetSrmLable = new Thread(SrmRead_Label);
@@ -391,84 +377,6 @@
- /// <summary>
- /// 鑾峰彇鍫嗗灈鏈虹殑瀹炴椂淇℃伅
- /// </summary>
- private void GetSrmInfo(object int_device)
- {
- while (true)
- {
- EDevice device = (EDevice)Enum.Parse(typeof(EDevice), int_device.ToString());
- Thread.Sleep(cycleDelay_Device);
- try
- {
- using (var opcClinet = new SrmService.SrmServiceClient())
- {
- srmViewDict[(int)device] = opcClinet.GetSrmInfo((int)device);
- CastToDevice_SrmRealTime(srmViewDict[(int)device]);
- List<String> warningAddressList = new List<string>();
- if (srmViewDict[(int)device].R_WarningDBList != null && srmViewDict[(int)device].R_WarningDBList.Length > 0)
- {
- var waringList = srmViewDict[(int)device].R_WarningDBList.ToList();
- if (waringList != null && waringList.Count > 0)
- {
- for (int i = 0; i < waringList.Count; i++)
- {
- DeviceWarningHandler.SaveWarning(device, iWareCommon.Utils.LogType.DataProcess_BZ39_IssueInboundTask,
- waringList[i].Code, waringList[i].Address, waringList[i].Context);//鏂板鎶ヨ
- warningAddressList.Add(waringList[i].Address);
- }
- }
- }
- DeviceWarningHandler.AutoCloseWarning(device, iWareCommon.Utils.LogType.DataProcess_BZ39_IssueInboundTask, warningAddressList);//鑷姩鍏抽棴鎶ヨ
- }
- }
- catch (Exception ex)
- {
- Log4NetHelper.WriteErrorLog(iWareCommon.Utils.LogType.DataProcess_BZ39_IssueInboundTask, "鑾峰彇" + device.ToString() + "鐨勫疄鏃朵俊鎭紓甯�:" + ex.Message, ex);
- continue;
- }
- };
- }
-
- /// <summary>
- /// 杞崲涓篠RM鐨勫疄鏃剁姸鎬�
- /// </summary>
- /// <param name="view"></param>
- private void CastToDevice_SrmRealTime(SrmView view)
- {
- List<Device_SrmRealTime> realTimeList = new List<Device_SrmRealTime>();
- Device_SrmRealTime obj = new Device_SrmRealTime();
- EDevice device = (EDevice)Enum.Parse(typeof(EDevice), view.R_SrmNo.ToString());
- obj = new Device_SrmRealTime()
- {
- SrmCode = view.R_SrmNo.ToString(),
- SrmName = device.ToString(),
- Mode = view.R_Mode.ToString(),
- ModeName = view.ModeName,
- State = view.R_State.ToString(),
- StateName = view.StateName,
-
- TaskID = view.R_TaskNo.ToString(),
- LiftFull = view.R_LiftFull == 1,
- PosX = view.R_PosX,
- PosY = view.R_PosY,
- PosZ = view.R_PosZ,
- PosZName = EnumberHelper.GetEnumName<ESrmForkPosition>(view.R_PosZ).ToString(),
- // XCoordinate=view.r_xc
-
- SrmToPlace = view.SrmToPlace,
- SrmSourcePlace = view.SrmSourcePlace,
- ZCoordinate = view.R_PosZmm.ToString(),
- XCoordinate = view.R_PosXmm.ToString(),
- YCoordinate = view.R_PosYmm.ToString()
-
- };
- realTimeList.Add(obj);
-
- DeviceSrmRealTimeHandler.Update(realTimeList, iWareCommon.Utils.LogType.DataProcess_BZ39_IssueInboundTask);
-
- }
@@ -603,19 +511,19 @@
this.lbl_Mode_FJ.Text = "璁惧妯″紡:" + PlcHelper.GetModeName(stationView.R_Mode_FJ);
this.lbl_XinTiao_FJ.Text = "蹇冭烦:" + stationView.R_HandShake_FJ;
- this.lbl_Warning_FJ.Text = "蹇冭烦:" + PlcHelper.GetWarningTypeName(stationView.R_Warning_FJ);
+ this.lbl_Warning_FJ.Text = "鎶ヨ绫诲瀷:" + PlcHelper.GetWarningTypeName(stationView.R_Warning_FJ);
this.lbl_Mode_MB.Text = "璁惧妯″紡:" + PlcHelper.GetModeName(stationView.R_Mode_MB);
this.lbl_XinTiao_MB.Text = "蹇冭烦:" + stationView.R_HandShake_MB;
- this.lbl_Warning_MB.Text = "蹇冭烦:" + PlcHelper.GetWarningTypeName(stationView.R_Warning_MB);
+ this.lbl_Warning_MB.Text = "鎶ヨ绫诲瀷:" + PlcHelper.GetWarningTypeName(stationView.R_Warning_MB);
this.lbl_Mode_HB.Text = "璁惧妯″紡:" + PlcHelper.GetModeName(stationView.R_Mode_HB);
this.lbl_XinTiao_HB.Text = "蹇冭烦:" + stationView.R_HandShake_HB;
- this.lbl_Warning_HB.Text = "蹇冭烦:" + PlcHelper.GetWarningTypeName(stationView.R_Warning_HB);
+ this.lbl_Warning_HB.Text = "鎶ヨ绫诲瀷:" + PlcHelper.GetWarningTypeName(stationView.R_Warning_HB);
this.lbl_Mode_FX.Text = "璁惧妯″紡:" + PlcHelper.GetModeName(stationView.R_Mode_FX);
this.lbl_XinTiao_FX.Text = "蹇冭烦:" + stationView.R_HandShake_FX;
- this.lbl_Warning_FX.Text = "蹇冭烦:" + PlcHelper.GetWarningTypeName(stationView.R_Warning_FX);
+ this.lbl_Warning_FX.Text = "鎶ヨ绫诲瀷:" + PlcHelper.GetWarningTypeName(stationView.R_Warning_FX);
////鏄剧ずRGV浠诲姟瀹屾垚鍜屽畬鎴愮‘璁や俊鍙�
//this.lbl_R_RGV_Finish.Text = "RGV浠诲姟瀹屾垚:" + rgvView.R_RGV_Finish;
@@ -696,6 +604,54 @@
}
+ /// <summary>
+ /// 鑾峰彇Station 鎶ヨ淇℃伅
+ /// </summary>
+ /// <param name="obj"></param>
+ private async void GetStationWarningInfo(object obj)
+ {
+ while (true)
+ {
+ Thread.Sleep(1000);//1绉掗挓璇诲彇涓�娆�
+ try
+ {
+ if (stationServiceClient == null)
+ {
+ continue;
+ }
+ iWareCC.StationService.DeviceWarningInfo[] waringList = await stationServiceClient.GetWaringInfoListAsync((int)EDevice.Station, configDeviceWarningList.wmsConfigDeviceWarnings.ToArray());
+
+ //鏄剧ず鎶ヨ淇℃伅
+ List<String> warningCodeList = new List<string>();
+ if (waringList != null && waringList.Length > 0)
+ {
+ for (int i = 0; i < waringList.Length; i++)
+ {
+ var findObj = configDeviceWarningList.wms_config_device_warning_list.Where(x => x.WarningCode == waringList[i].Codek__BackingField).FirstOrDefault();
+ DeviceWarningHandler.SaveWarning(EDevice.Station, iWareCommon.Utils.LogType.StationThreadService,
+ findObj.WarningCode, findObj.DeviceAreaCode, findObj.WarningContent, findObj.DeviceWarningType);//鏂板鎶ヨ
+ warningCodeList.Add(findObj.WarningCode);
+ }
+
+ }
+ else
+ {
+
+ }
+ DeviceWarningHandler.AutoCloseWarning(EDevice.Station, iWareCommon.Utils.LogType.StationThreadService, warningCodeList);//鑷姩鍏抽棴鎶ヨ
+
+ //*/
+ }
+ catch (Exception ex)
+ {
+ rgvView = null;
+ Log4NetHelper.WriteErrorLog(iWareCommon.Utils.LogType.StationThreadService, "鑾峰彇绔欑偣淇℃伅鍑虹幇寮傚父:" + ex.Message, ex);
+ continue;
+ }
+ }
+ }
+
+
#endregion
--
Gitblit v1.9.3