Commit d8dadf3d authored by 潘栩锋's avatar 潘栩锋 🚴

优化线速度 平均值

parent ce2de262
......@@ -1192,9 +1192,20 @@ namespace FLY.Thick.Blowing.Server
DateTime dt2 = mRollList[mRollList.Count - cnt].dt;
DateTime dt11 = mRollList[mRollList.Count - (cnt - 1)].dt;
TimeSpan ts_last = TimeSpan.FromTicks((dt1 - dt2).Ticks / (cnt - 1));//5次的平均滤波
TimeSpan ts_now = DateTime.Now - dt1;
TimeSpan ts_max = (ts_now > (ts_last + ts_last)) ? ts_now : ts_last;
TimeSpan ts_now = TimeSpan.FromTicks((DateTime.Now - dt11).Ticks / (cnt - 1));
TimeSpan ts_max;
if (ts_now > (ts_last + ts_last))
{
ts_max = ts_now;
}
else
{
ts_max = ts_last;
}
FilmVelocity = RollPerimeter / 1000.0 / ts_max.TotalMinutes;
BufTotalTime = DateTime.Now - mRollList[0].dt;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment