| | |
| | | /// <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 |
| | | { |
| | |
| | | return false; |
| | | } |
| | | |
| | | //增加写入NG标记 |
| | | if (isNgFlag) |
| | | { |
| | | b2 = this.plcService.WriteValuePoint(stationObj.W_NgFlag, true, view_stationObj.W_NgFlag); |
| | | if (!b2.result) |
| | | { |
| | | msg = string.Format("向Station地址{0} 写 NG包标记 " + true + "失败,返回结果:" + b2.resMsg, |
| | | stationObj.W_NgFlag); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | return true; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | 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("向Station" + stationCode + " 写入 NG包标记 地址{0} 写 " + value + "失败,返回结果:" + b2.resMsg, |
| | | stationObj.W_OutboundFinishConfirm); |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | msg = ex.Message; |
| | | var logcontext = string.Format("向Statio NG包标记 出现异常:" + JsonConvert.SerializeObject(ex), |
| | | ""); |
| | | Log4NetHelper.WriteErrorLog(Station_CacheEntity.curLogType, logcontext, ex); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 写入 人工放行 |
| | | /// </summary> |