} //当前配送缸号 //开始执行 public static void WashingExcute(View_WashingModel model) { CurrentWashingaModel = model; WashingCurrentPotCode = model.PotCode; WashingCurrentPotName = potList.FirstOrDefault(s => s.PotCode == WashingCurrentPotCode).PotName; washingformulaStatus.FormulaStart(ParamClass);//开始写入配方状态 0; }
/// <summary> /// 皂洗剂请求 /// </summary> private void WashingRequest(string deviceCode, string potCode, string materialquantity, string cabientwaterquantity, IPAddress remoteIP) { decimal ovalue1, ovalue2; if (Golbal.MyWashingList.FindAll(s => s.DeviceCode == deviceCode).Count() > 0) { tcpclass.SendString(remoteIP, "请稍后再试!"); return; } if (decimal.TryParse(materialquantity, out ovalue1) && decimal.TryParse(cabientwaterquantity, out ovalue2)) { DS_DeviceModel devicemodel = deviceDAL.GetDeviceByCode(deviceCode); if (devicemodel == null) { tcpclass.SendString(remoteIP, "请求失败!"); } else { if (ovalue1 + ovalue2 > devicemodel.StandardQuantity) { tcpclass.SendString(remoteIP, "总量不能超过" + devicemodel.StandardQuantity.Value.ToString("0.00L")); } else if (ovalue1 + ovalue2 == 0) { tcpclass.SendString(remoteIP, "请修改请求量"); } else { View_WashingModel washingmodel = new View_WashingModel(); washingmodel.Id = Guid.NewGuid(); washingmodel.BarCode = Golbal.ConvertDateTimeInt(DateTime.Now).ToString(); washingmodel.MaterialQuantity = ovalue1; washingmodel.CabientWaterQuantity = ovalue2; washingmodel.DeviceId = devicemodel.Id; washingmodel.DeviceCode = devicemodel.Code; washingmodel.DeviceName = devicemodel.Name; washingmodel.ClientIP = remoteIP.ToString(); washingmodel.Devicetype = devicemodel.Type; washingmodel.PotCode = potCode; Golbal.MyWashingList.Add(washingmodel); tcpclass.SendString(remoteIP, "请求成功"); } } } }