|  |  |  | 
|---|
|  |  |  | /// <param name=""></param> | 
|---|
|  |  |  | /// <param name=""></param> | 
|---|
|  |  |  | /// <returns></returns> | 
|---|
|  |  |  | public bool WritePalletizingTaskInfo(string stationCode, int taskID, bool isLast,bool isFirst, short length, short width, short height, short rotate, short toplace, short placeX, short placeY, short placeZ, out string msg) | 
|---|
|  |  |  | public bool WritePalletizingTaskInfo(string stationCode, int taskID, short length, short width, short height, short rotate, short toplace, short placeX, short placeY, short placeZ,short lastnum, out string msg) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | try | 
|---|
|  |  |  | { | 
|---|
|  |  |  | 
|---|
|  |  |  | stationObj.W_Inbound_TaskID); | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | b2 = this.plcService.WriteValuePoint(stationObj.W_EndMark, isLast, view_stationObj.W_EndMark); | 
|---|
|  |  |  | if (!b2.result) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | msg = string.Format("向Station地址{0} 写 是否末板 " + isLast + "失败,返回结果:" + b2.resMsg, | 
|---|
|  |  |  | stationObj.W_Destination_In); | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | b2 = this.plcService.WriteValuePoint(stationObj.W_FirstMark, isFirst, view_stationObj.W_FirstMark); | 
|---|
|  |  |  | if (!b2.result) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | msg = string.Format("向Station地址{0} 写 是否首板 " + isFirst + "失败,返回结果:" + b2.resMsg, | 
|---|
|  |  |  | stationObj.W_Destination_In); | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | b2 = this.plcService.WriteValuePoint(stationObj.W_Length, length, view_stationObj.W_Length); | 
|---|
|  |  |  | if (!b2.result) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | 
|---|
|  |  |  | stationObj.W_Height); | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | b2 = this.plcService.WriteValuePoint(stationObj.W_PalletizingBucketType, lastnum, view_stationObj.W_PalletizingBucketType); | 
|---|
|  |  |  | if (!b2.result) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | msg = string.Format("向Station地址{0} 写 首末板 " + lastnum + "失败,返回结果:" + b2.resMsg, | 
|---|
|  |  |  | stationObj.W_Height); | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | b2 = this.plcService.WriteValuePoint(stationObj.W_DataFinish, true, view_stationObj.W_DataFinish); | 
|---|
|  |  |  | if (!b2.result) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | 
|---|
|  |  |  | /// <param name="placey"></param> | 
|---|
|  |  |  | /// <param name="msg"></param> | 
|---|
|  |  |  | /// <returns></returns> | 
|---|
|  |  |  | public bool WriteSurroundTaskInfo(string stationCode, int 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) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | try | 
|---|
|  |  |  | { | 
|---|
|  |  |  | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | /// 写入站点任务完成确认 | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | /// <param name="stationCode"></param> | 
|---|
|  |  |  | /// <param name="value"></param> | 
|---|
|  |  |  | /// <param name="msg"></param> | 
|---|
|  |  |  | /// <returns></returns> | 
|---|
|  |  |  | public bool WriteStation_ACK(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_DataFinish, value, view_stationObj.W_DataFinish); | 
|---|
|  |  |  | if (!b2.result) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | msg = string.Format("向Station" + stationCode + " 写入任务完成确认 地址{0} 写  " + value + "失败,返回结果:" + b2.resMsg, | 
|---|
|  |  |  | stationObj.W_OutboundFinishConfirm); | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return true; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | catch (Exception ex) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | msg = ex.Message; | 
|---|
|  |  |  | var logcontext = string.Format("向Statio 出库任务完成确认 出现异常:" + JsonConvert.SerializeObject(ex), | 
|---|
|  |  |  | ""); | 
|---|
|  |  |  | Log4NetHelper.WriteErrorLog(Station_CacheEntity.curLogType, logcontext, ex); | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | public bool WriteSurround_FinishACK(string stationCode, bool value, out string msg) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | try | 
|---|