Skip to content

Commit

Permalink
FlightData: UtcNow update
Browse files Browse the repository at this point in the history
  • Loading branch information
meee1 committed Jan 10, 2025
1 parent 8899024 commit 743c55d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions GCSViews/FlightData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public partial class FlightData : MyUserControl, IActivate, IDeactivate
/// </summary>
DateTime lastmapposchange = DateTime.MinValue;

DateTime lastscreenupdate = DateTime.Now;
DateTime lastscreenupdate = DateTime.UtcNow;
RollingPointPairList list1 = new RollingPointPairList(1200);
CurveItem list1curve;
PropertyInfo list1item;
Expand Down Expand Up @@ -5324,14 +5324,14 @@ private void txt_messagebox_TextChanged(object sender, EventArgs e)
private void updateBindingSource()
{
// run at 10 hz.
if (lastscreenupdate.AddMilliseconds(100) < DateTime.Now)
if (lastscreenupdate.AddMilliseconds(100) < DateTime.UtcNow)
{
lock (updateBindingSourcelock)
{
// this is an attempt to prevent an invoke queue on the binding update on slow machines
if (updateBindingSourcecount > 0)
{
if (lastscreenupdate < DateTime.Now.AddSeconds(-5))
if (lastscreenupdate < DateTime.UtcNow.AddSeconds(-5))
{
updateBindingSourcecount = 0;
}
Expand Down Expand Up @@ -5407,7 +5407,7 @@ private void updateBindingSourceWork()
//if the tab detached wi have to update it
if (tabQuickDetached) MainV2.comPort.MAV.cs.UpdateCurrentSettings(bindingSourceQuickTab.UpdateDataSource(MainV2.comPort.MAV.cs));

lastscreenupdate = DateTime.Now;
lastscreenupdate = DateTime.UtcNow;
}
catch (Exception ex)
{
Expand Down

0 comments on commit 743c55d

Please sign in to comment.