public bool stepIn(LotReaderDeviceElement lotinfo, Lot lot, LotReaderFinishedArgs Args, TrackInParameter p1) { bool flag = true; //进站 MethodReturnResult result = null; using (WipEngineerServiceClient client = new WipEngineerServiceClient()) { if (lot.StateFlag == EnumLotState.WaitTrackIn) { result = client.TrackInLot(p1); if (result.Code == 0) { Args.TransferMsg = string.Format("批次:{0} 进站成功", lotinfo.LotNumber); flag = true; } else { Args.TransferMsg = string.Format("批次:{0} 进站失败", lotinfo.LotNumber); //存储读头扫码结果信息 Args.TransferMsg = Args.TransferMsg + "-------------"; if (OnLotReaderFinished != null) { CommonFun.eventInvoket(() => { OnLotReaderFinished(this, Args); }); } flag = false; } } } ErrorLog(null, Args.TransferMsg); return(flag); }
public bool stepOut(LotReaderDeviceElement lotinfo, Lot lot, LotReaderFinishedArgs Args, TrackOutParameter p) { bool flag = true; //出站 MethodReturnResult result = null; using (WipEngineerServiceClient client = new WipEngineerServiceClient()) { if (lot.StateFlag == EnumLotState.WaitTrackOut) { IDictionary <string, IList <TransactionParameter> > dicParams = new Dictionary <string, IList <TransactionParameter> >(); //获取工序参数列表。 IList <RouteStepParameter> lstRouteStepParameter = GetParameterList(lot.RouteName, lot.RouteStepName, EnumLotState.WaitTrackOut); if (lstRouteStepParameter != null) { #region 组织批次附加代码 foreach (RouteStepParameter item in lstRouteStepParameter) { if (!dicParams.ContainsKey(lot.Key)) { dicParams.Add(lot.Key, new List <TransactionParameter>()); } string val = null; if (item.Key.ParameterName == "电池片批号" || item.Key.ParameterName == "电池片小包装号") { val = GetCellLotList(item.MaterialType, lot.LineCode, lot.RouteStepName, lot.OrderNumber, p.EquipmentCode); } else { val = GetParameterLotList(item.MaterialType, lot.LineCode, lot.RouteStepName, lot.OrderNumber, p.EquipmentCode); } TransactionParameter tp = new TransactionParameter() { Index = item.ParamIndex, Name = item.Key.ParameterName, Value = val }; dicParams[lot.Key].Add(tp); } p.Paramters = dicParams; #endregion } MethodReturnResult resultTrackOut = client.TrackOutLot(p); if (resultTrackOut.Code == 0) { Args.TransferMsg = string.Format("批次:{0} {1}出站成功", lotinfo.LotNumber, p.RouteOperationName); flag = true; } else { flag = false; Args.TransferMsg = string.Format("批次:{0} {1}出站失败 => ", lotinfo.LotNumber, p.RouteOperationName) + resultTrackOut.Message; } //存储读头扫码结果信息 Args.TransferMsg = Args.TransferMsg + "-------------"; if (OnLotReaderFinished != null) { CommonFun.eventInvoket(() => { OnLotReaderFinished(this, Args); }); } } } ErrorLog(null, Args.TransferMsg); return(flag); }