From c733a6f12bc6f8e7f206ef8173e8991041248c36 Mon Sep 17 00:00:00 2001 From: schangxiang@126.com <schangxiang@126.com> Date: 周二, 10 12月 2024 14:47:19 +0800 Subject: [PATCH] 22 --- SDA/iWareSda/Devices/4-Station/StationModel/StationEntity.cs | 42 +++++++++++++++++++++++++++++++++++++++++- 1 files changed, 41 insertions(+), 1 deletions(-) diff --git a/SDA/iWareSda/Devices/4-Station/StationModel/StationEntity.cs b/SDA/iWareSda/Devices/4-Station/StationModel/StationEntity.cs index b7e1bf6..8b0141d 100644 --- a/SDA/iWareSda/Devices/4-Station/StationModel/StationEntity.cs +++ b/SDA/iWareSda/Devices/4-Station/StationModel/StationEntity.cs @@ -592,7 +592,8 @@ /// <param name="placey"></param> /// <param name="msg"></param> /// <returns></returns> - public bool WriteSurroundTaskInfo(string stationCode, short taskID, short length, short width, short cartonhigh, short cartonwidth, short placex, short placey, out string msg) + public bool WriteSurroundTaskInfo(string stationCode, short taskID, short length, short width, short cartonhigh, short cartonwidth, + short placex, short placey, out string msg, bool isNgFlag) { try { @@ -661,6 +662,17 @@ return false; } + //澧炲姞鍐欏叆NG鏍囪 + if (isNgFlag) + { + b2 = this.plcService.WriteValuePoint(stationObj.W_NgFlag, true, view_stationObj.W_NgFlag); + if (!b2.result) + { + msg = string.Format("鍚慡tation鍦板潃{0} 鍐� NG鍖呮爣璁� " + true + "澶辫触,杩斿洖缁撴灉:" + b2.resMsg, + stationObj.W_NgFlag); + return false; + } + } return true; } @@ -779,6 +791,34 @@ } } + public bool WriteStation_NgFlag(string stationCode, bool value, out string msg) + { + try + { + msg = ""; + var stationObj = this.DBBlockForWrite.W_StationForWriteCommList.Where(x => x.StationCode == stationCode).FirstOrDefault(); + + var view_stationObj = this.View.W_StationForWriteCommList.Where(x => x.StationCode == stationCode).FirstOrDefault(); + MessageModel b2 = this.plcService.WriteValuePoint(stationObj.W_NgFlag, value, view_stationObj.W_NgFlag); + if (!b2.result) + { + msg = string.Format("鍚慡tation" + stationCode + " 鍐欏叆 NG鍖呮爣璁� 鍦板潃{0} 鍐� " + value + "澶辫触,杩斿洖缁撴灉:" + b2.resMsg, + stationObj.W_OutboundFinishConfirm); + return false; + } + + return true; + } + catch (Exception ex) + { + msg = ex.Message; + var logcontext = string.Format("鍚慡tatio NG鍖呮爣璁� 鍑虹幇寮傚父:" + JsonConvert.SerializeObject(ex), + ""); + Log4NetHelper.WriteErrorLog(Station_CacheEntity.curLogType, logcontext, ex); + return false; + } + } + /// <summary> /// 鍐欏叆 浜哄伐鏀捐 /// </summary> -- Gitblit v1.9.3