/// <summary> /// 开始分拣2组 /// </summary> private void Start_FJ2() { List <string> sortlist = new List <string>(); try { AllSystemStart ass2 = new AllSystemStart(); sortlist = ass2.ReadDBinfo(2); } catch (Exception) { updateListBox("第二组预分拣PLC连接失败", listBox1); return; } List <ErrorDates> Errorlist = new List <ErrorDates>(); int falg = 1; foreach (var item in sortlist) { if (item == "-1") { ErrorDates ed = new ErrorDates(); ed.Index = falg; using (Entities et = new Entities()) { var FJErrors = et.T_WMS_ABNORMALLIST.Where(x => x.AREAPLC == "S7:[FJConnectionGroup-]" && x.PLCINDEX == falg).Select(x => x.ERRORMSG).FirstOrDefault(); ed.ErrorMsg = FJErrors; ed.ErrorTime = DateTime.Now.ToShortTimeString(); } ed.Value = item; Errorlist.Add(ed); } falg++; } SortData.FJList2 = Errorlist; if (Errorlist.Count > 0) { b1_f2.BackColor = Color.Red; updateListBox("预分拣第二组存在故障", listBox1); } else { b1_f2.BackColor = Color.Green; } // GetState(); }
/// <summary> /// 获取读取的DB块集合与故障信息 中心带 /// </summary> private void GetListBoxItems2() { updateListBox(System.DateTime.Now.ToString() + "开始自检", listBox2); updateListBox("自检中,请等待......", listBox2); AllSystemStart ass2 = new AllSystemStart(); List <ErrorInfo> li = ass2.ReadDBinfo_Replenishment(2); foreach (var item in li) { if (item.Value != "0") { updateListBox(item.ErrorMsg, listBox2); } } updateListBox("本次自检结束......", listBox2); }
/// <summary> /// 获取读取的DB块集合与故障信息 入库队列 /// </summary> private void GetListBoxItems4() { updateListBox(System.DateTime.Now.ToString() + "开始自检", listBox4); updateListBox("自检中,请等待......", listBox4); AllSystemStart ass4 = new AllSystemStart(); List <ErrorInfo> li = ass4.ReadDBinfo_inout(4); foreach (var item in li) { if (item.Value != "0") { updateListBox(item.DBAdress + " " + item.ErrorMsg, listBox4); } } updateListBox("本次自检结束......", listBox4); }
private void Start_Replenishment2() { List <ErrorDates> Errors = new List <ErrorDates>(); List <string> InOutlist = new List <string>(); List <ErrorInfo> info; try { AllSystemStart ass = new AllSystemStart(); info = ass.ReadDBinfo_Replenishment(2); } catch (Exception) { updateListBox("补货区PLC连接失败", listBox1); return; } if (info.Where(x => x.Value != "0").Count() != 0 ? true : false) { updateListBox("补货区:中心带存在故障", listBox1); b4_2.BackColor = Color.Red; foreach (var item in info) { if (item.Value != "0") { ErrorDates ed = new ErrorDates(); ed.Value = item.Value; ed.ErrorMsg = item.ErrorMsg; Errors.Add(ed); } } ReplenishmentData.ReplenishmentList2 = Errors; } else { b4_2.BackColor = Color.Green; } }
private void Start_HJStorage2() { List <ErrorDates> Errors = new List <ErrorDates>(); List <ErrorInfo> info; try { AllSystemStart ass = new AllSystemStart(); info = ass.ReadDBinfo_Storage(2); } catch (Exception) { updateListBox("第二组重力式货架PLC连接失败", listBox1); return; } if (info.Where(x => x.Value != "0").Count() != 0 ? true : false) { updateListBox("第二组重力式货架存在故障", listBox1); b5_2.BackColor = Color.Red; foreach (var item in info) { if (item.Value != "0") { ErrorDates ed = new ErrorDates(); ed.Value = item.Value; ed.ErrorMsg = item.ErrorMsg; Errors.Add(ed); } } HJStorage.HJStorageList2 = Errors; } else { b5_2.BackColor = Color.Green; } }
private void Start_InOut4() { List <ErrorDates> Errors = new List <ErrorDates>(); List <string> InOutlist = new List <string>(); List <ErrorInfo> info; try { AllSystemStart ass = new AllSystemStart(); info = ass.ReadDBinfo_inout(4); } catch (Exception) { updateListBox("出入库PLC连接失败", listBox1); return; } if (info.Where(x => x.Value != "0").Count() != 0 ? true : false) { updateListBox("出入库:入库队列存在故障", listBox1); b3_4.BackColor = Color.Red; foreach (var item in info) { if (item.Value != "0") { ErrorDates ed = new ErrorDates(); ed.Value = item.Value; ed.ErrorMsg = item.ErrorMsg; Errors.Add(ed); } } InOutData.InOutDataList4 = Errors; } else { b3_4.BackColor = Color.Green; } }
private void GetListBoxItems2() { updateListBox(System.DateTime.Now.ToString() + "开始自检", listBox2); updateListBox("自检中,请等待......", listBox2); AllSystemStart ass2 = new AllSystemStart(); List <Abnormallists> li = ass2.GetFJOpcServerItem(); str2 = ass2.ReadDBinfo(2); int i = 0; foreach (var item in str2) { if (item != "0") { updateListBox(li[i].ERRORMSG, listBox2); } i++; } updateListBox("本次自检结束......", listBox2); str2.Clear(); }
/// <summary> /// 一组重力式货架 /// </summary> private void GetListBoxItems1() { updateListBox(System.DateTime.Now.ToString() + "开始自检", listBox1); updateListBox("自检中,请等待......", listBox1); AllSystemStart ass1 = new AllSystemStart(); try { List <ErrorInfo> li = ass1.ReadDBinfo_Storage(1); foreach (var item in li) { if (item.Value != "0") { updateListBox(item.ErrorMsg, listBox1); } } updateListBox("本次自检结束......", listBox1); } catch (Exception) { updateListBox("未能成功连接PLC......", listBox2); } }