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

修改 flyad7 的 timegrid 里面的时间为最后一个数据的时间。与AD盒逻辑一致

parent c4205399
......@@ -913,6 +913,8 @@ namespace FLY.Simulation.Flyad7
}
}
public int HardwareVersion { get; set; } = 2;
struct SyncPos2Item
{
public bool At01;//? or At10
......
......@@ -376,6 +376,8 @@ namespace FlyADBase
calSpeed.Reset();
Init2();
lastTimeGridTime = DateTime.MinValue;
}
#region FObj
......@@ -801,15 +803,16 @@ namespace FlyADBase
data = pack.data;
advPushTimeGrid(dt, data);
double ts_ms = 1.28;
//long ticks = (long)((ts_ms * data.Length) * TimeSpan.TicksPerMillisecond);
//dt -= TimeSpan.FromTicks(ticks);
TimeSpan ts = TimeSpan.FromTicks((long)(1.28 * TimeSpan.TicksPerMillisecond));
if (lastTimeGridTime != DateTime.MinValue)
ts = TimeSpan.FromTicks((dt - lastTimeGridTime).Ticks / data.Length);
lastTimeGridTime = dt;
TimeGridEvent?.Invoke(
this,
new TimeGridEventArgs(
dt,
TimeSpan.FromTicks((long)(ts_ms * TimeSpan.TicksPerMillisecond)),
ts,
data));
}
break;
......@@ -1343,7 +1346,7 @@ namespace FlyADBase
/// ad值不会被机架修正
/// </summary>
public event TimeGridEventHandler TimeGridEvent;
DateTime lastTimeGridTime;
/// <summary>
......
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