Skip to content

Commit 922552d

Browse files
EosBandimeee1
authored andcommitted
Only rename log for GPS datetime if it is after 1990-01-01
1 parent 551863e commit 922552d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Log/LogDownloadMavLink.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ async Task<string> GetLog(ushort no, string fileName)
235235
dflb.Clear();
236236
GC.Collect();
237237

238-
// rename log is we have a valid gps time
239-
if (logtime != DateTime.MinValue)
238+
// rename log fs we have a valid gps time, logtime is after 1990-01-01, since some GPS does not use Unix epoch for invalid time.
239+
if (logtime.Year >= 1990)
240240
{
241241
string newlogfilename = Settings.Instance.LogDir + Path.DirectorySeparatorChar
242242
+ MainV2.comPort.MAV.aptype.ToString() +
@@ -402,7 +402,7 @@ private void UpdateProgress(uint min, uint max, uint current)
402402
if (current > 0 && current < max)
403403
{
404404
var per = (current / (double)max) * 100;
405-
405+
406406
var elapsed = DateTime.Now - start;
407407
if (elapsed.TotalSeconds == 0)
408408
elapsed = TimeSpan.FromSeconds(1);

0 commit comments

Comments
 (0)