/// <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; }
private void PreparePlotterPingCur() { StopTime = DateTime.Now; PingCurMax = 0; PingCurSum = 0; PingCurSum = 0; PingCurCount = 0; ValidPingCurCount = 0; PingCurLst.Clear(); PingPoleLst.Clear(); PingCurPoint = new Point(); PingLenPoint = new Point(); }
private void DoPinging() { if (Pinging) { PingCurCount++; byte cur = ((TjcDataRead)DataRead).PingCur >= 255 ? (byte)255 : (byte)((TjcDataRead)DataRead).PingCur; byte len = ((TjcDataRead)DataRead).PingPoleLength * 100 / 2000 > 100 ? (byte)100 : Convert.ToByte(((TjcDataRead)DataRead).PingPoleLength * 100 / 2000); PingCurLst.Add(cur); PingPoleLst.Add(len); PingLenPoint = new Point(PingCurCount, len); PingCurPoint = new Point(PingCurCount, cur); //开始记录推焦电流和杆长的条件 //数字1000单位为ms,即1s,数字200为计时器的Interval,单位为ms if (PingCurCount > PingStartTime * 1000 / 200 && ((TjcDataRead)DataRead).PingPoleLength > 330 || ((TjcDataRead)DataRead).PingPoleLength < 1100) {//0907平煤杆值330和1100均为参考值,得来的思路:平煤杆刚进炭化室或者达到最大深度时的电流过大 无意义 ValidPingCurCount++; PingCurMax = PingCurMax < cur ? cur : PingCurMax; PingCurSum += cur; //计算平均电流值,是否考虑电流值为0的情况? PingCurAvg = (byte)(PingCurSum / ValidPingCurCount); } } }