/// <summary> /// 推焦完成后记录StokingInfo的数据 /// 更新装煤计划 /// </summary> private void PingDataPart2() { if (pgInfo == null) { PingDataPart1(); } if (StokingPlanIndex >= 0) { if (PMJob) { CokeRoom.StokingPlan.RemoveRange(0, StokingPlanIndex + 1); } else { CokeRoom.StokingPlan.RemoveAt(StokingPlanIndex); } } pgInfo.EndTime = DateTime.Now; pgInfo.MaxCur = PingCurMax; pgInfo.AvgCur = PingCurAvg; pgInfo.CurArr = Convert.ToBase64String(PingCurLst.ToArray()); pgInfo.PoleArr = Convert.ToBase64String(PingPoleLst.ToArray()); PingInfoHelper p = new PingInfoHelper(new DbAppDataContext(Setting.ConnectionStr), pgInfo, false); p.RecToDB(); pgInfo = null; }
/// <summary> /// 推焦开始时PushInfo数据 /// 已考虑当StokingPlanIndex小于0时对信息的记录 /// </summary> private void PingDataPart1() { DateTime invalidTime = Convert.ToDateTime("2012-04-03 13:14"); bool valid = StokingPlanIndex >= 0; MStokingPlan m = valid ? CokeRoom.StokingPlan[StokingPlanIndex] : (CokeRoom.StokingPlan.Count > 0 ? new MStokingPlan(CokeRoom.StokingPlan[0]) : new MStokingPlan(1, Convert.ToDateTime("2012-04-03 13:14"), 1, 1)); pgInfo = new PgInfo(); pgInfo.Room = m.RoomNum;//20171122应为计划装煤炉号; pgInfo.PlanPushTime = m.StokingTime.AddMinutes(-5); pgInfo.PlanPingTime = m.StokingTime; pgInfo.TRoom = (byte)RoomNum; pgInfo.TPRoom = (byte)PingRoomNum; pgInfo.MRoom = (byte)Communication.MJob.RoomNum; pgInfo.TAddr = DataRead.PhysicalAddr; //pInfo.mAddr = Communication.JobCar[3].DataRead.PhysicalAddr;//20170904 和装煤车的通讯还未调试完毕 pgInfo.MAddr = Communication.MJob.DataRead.PhysicalAddr; pgInfo.BeginTime = Convert.ToDateTime(StokingTime); pgInfo.LockInfo = 0;//0906 pgInfo.Period = valid ? m.Period : (byte)0; pgInfo.Group = valid ? m.Group : (byte)0; pgInfo.PlanIndex = StokingPlanIndex; pgInfo.PlanCount = CokeRoom.StokingPlan.Count; PingInfoHelper p = new PingInfoHelper(new DbAppDataContext(Setting.ConnectionStr), pgInfo, true); p.RecToDB(); }