public void InitList(DataTable noOpList, string idName, int N) { for (int i = 1; i < noOpList.Columns.Count; i++) { MissDataSerial mds = new MissDataSerial(N, noOpList.Columns[i].ColumnName); mds.InitListItem(noOpList, idName, noOpList.Columns[i].ColumnName); SerialDiffs.Add(mds); } }
public MissDataSerial getAdd(string name, int val) { MissDataSerial ret = new MissDataSerial(Cycle, name); try { int first = OpList[0]; int last = Math.Min(Cycle, OpList[OpList.Count - 1] + 1); if (OpList.Count == 1)//全是它本身 { ret.OpList.Add(last); if (val == 1) { ret.OpList.Add(0); } return(ret); } if (OpList.Count == 2) { if (first > 1) { ret.OpList.Add(first - 1); } ret.OpList.Add(last); if (val == 1) { ret.OpList.Add(0); } return(ret); } if (first > 1) { ret.OpList.Add(first - 1); } for (int i = 1; i < OpList.Count - 1; i++)//从第二个点到倒数第二个点全部加入 { ret.OpList.Add(OpList[i]); } ret.OpList.Add(last); if (val == 1) { ret.OpList.Add(0); //当前值为0,加入数组 } if (ret.OpList.Sum() < Cycle - 1) //当且仅当val=1时出现 { if (val == 0) { } } } catch (Exception e) { } return(ret); }