private void FindPlcInfo(PlcInfoSimple p, List <PlcInfo> dplc, List <List <PlcInfo> > mplc) { if (p.Area == null) { return; } if (dplc == null || mplc == null || dplc.Count == 0 || mplc.Count == 0 ) { return; } foreach (PlcInfo p0 in dplc) { if ((p0.RelAddr == p.Addr) && (p0.StrArea.Equals(p.Area.Trim()))) { p.SetPlcInfo(p0); return; } } for (int i = 0; i < mplc.Count; i++) { for (int j = 0; j < mplc[i].Count; j++) { if ((mplc[i][j].RelAddr == p.Addr) && (mplc[i][j].StrArea.Equals(p.Area.Trim()))) { p.SetPlcInfo(mplc[i][j]); return; } } } }
public void SetDValue(string str1, string str2, List <PlcInfoSimple> pLst, int num) { PlcInfoSimple p = getPsFromPslLst(str1, str2, pLst); if (p != null) { evokDevice.SetDValue(p, num); } else { MessageBox.Show(Constant.SetDataFail); } }
public void SetMPsOff(string str1, string str2, List <PlcInfoSimple> pLst) { PlcInfoSimple p = getPsFromPslLst(str1, str2, pLst); if (p != null) { evokDevice.SetMValueOFF(p); } else { MessageBox.Show(Constant.SetDataFail); } }
public void SetOutEdit(string str1, string str2, List <PlcInfoSimple> pLst) { PlcInfoSimple p = getPsFromPslLst(str1, str2, pLst); if (p != null) { p.IsInEdit = false; } else { MessageBox.Show(Constant.SetDataFail); } }
public void SetEvokDevice(EvokXJDevice evokDevice0) { evokDevice = evokDevice0; //手动页面的操作功能在这里进行 if (evokDevice.DataFormLst.Count > 1 && evokDevice.DataFormLst[1].Rows.Count > 0) { psLstHand.Clear(); foreach (DataRow dr in evokDevice.DataFormLst[1].Rows) { if (dr == null) { continue; } string name = dr["bin"].ToString(); if (!string.IsNullOrWhiteSpace(name)) { PlcInfoSimple p = new PlcInfoSimple(name); psLstHand.Add(p); } } } }