/// <summary> /// 新增加新的用户操作信息 /// </summary> /// <param name="rtuId">操作的终端地址</param> /// <param name="oper">操作类型 </param> /// <param name="loopid">操作回路 </param> public void AddNewRecordItem(int rtuId, OpType oper, int loopid = -1) { // if (isload == false) return; //return; if (IsChecked) { return; } if (!Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems.ContainsKey(rtuId)) { return; } var rtuName = Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems[rtuId].RtuName; foreach (var g in Records) { if (g.RtuId == rtuId && g.Operatr == oper && g.LoopId == loopid) { Records.Remove(g); break; } } var ins = new OperateItem() { RtuName = rtuName, RtuId = rtuId, Operatr = oper, OpTime = DateTime.Now, LoopId = loopid, TimeDifference = null, AnsTime = null, OpPara = -1, }; Records.Insert(0, ins); CurrentItem = ins; if (Records.Count > 300) { ClearRecordItem(); } recalctrlinfo(); }
public OperateItem GerRecord(int rtuId, string opName, string loopName) { if (IsChecked) { return(null); } if (!Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems.ContainsKey(rtuId)) { return(null); } var rtuName = Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems[rtuId].RtuName; //foreach (var g in Records) //{ // if (g.RtuId == rtuId && g.Operatr == oper && g.LoopId == loopid) // { // Records.Remove(g); // break; // } //} var ins = new OperateItem() { RtuName = rtuName, RtuId = rtuId, // Operatr = oper, OperatrName = opName, OpTime = DateTime.Now, // LoopId = loopid, SwitchOutName = loopName, TimeDifference = null, AnsTime = null, //OpPara = -1, }; return(ins); }
public void AddNewRecordSluItem(int rtuId, OpType oper, int ctrlid, int opPara = -1) { // if (isload == false) return; //return; if (IsChecked) { return; } string ctrlName = null; if (!Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems.ContainsKey(rtuId)) { return; } var rtuName = Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems[rtuId].RtuName; var t = EquipmentDataInfoHold.InfoItems[rtuId] as Wlst.Sr.EquipmentInfoHolding.Model.Wj2090Slu; if (ctrlid == 1000) //10 全部 21单数 20 双数 *100 { ctrlName = "全部控制器"; } else if (ctrlid == 2000) { ctrlName = "双数控制器"; } else if (ctrlid == 2100) { ctrlName = "单数控制器"; } else if (ctrlid == -1) { ctrlName = "---"; } else { if (!t.WjSluCtrls.ContainsKey(ctrlid)) { return; } ctrlName = t.WjSluCtrls[ctrlid].RtuName; } foreach (var g in Records) { if (g.RtuId == rtuId && g.Operatr == oper && g.LoopId == ctrlid && g.OpPara == opPara) { Records.Remove(g); break; } } var ins = new OperateItem() { RtuName = rtuName, RtuId = rtuId, Operatr = oper, OpTime = DateTime.Now, LoopId = ctrlid, SwitchOutName = ctrlName, TimeDifference = null, AnsTime = null, OpPara = opPara, }; if (opPara >= 0) { ins.OperatrName = ins.OperatrName + " " + opPara + "0%调光"; } Records.Insert(0, ins); CurrentItem = ins; if (Records.Count > 100) { Records.Clear(); } recalctrlinfo(); }