Skip to content

Commit

Permalink
LogBrowse: limit impact of many params to 100000
Browse files Browse the repository at this point in the history
  • Loading branch information
meee1 committed Aug 8, 2023
1 parent 499ea81 commit 142a91a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions ExtLibs/Utilities/DFLogBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,27 @@ void setlinecount()

linestartoffset.Add((uint)(ans.Item2));
lineCount++;

if (lineCount % 1000000 == 0)
Console.WriteLine("reading lines " + lineCount + " " + ((basestream.Position / (double)length) * 100.0));
}

_count = lineCount;

// build fmt line database to pre seed the FMT message
messageindexline[128].ForEach(a => dflog.FMTLine(this[(int) a]));

try
{
foreach (var item in dflog.logformat)
{
var id = item.Value.Id;
var type = item.Value.Name;
if(messageindex[id].Count != 0)
Console.WriteLine("Seen " + type + " count " + messageindex[id].Count);
}
}
catch { }
}
else
{
Expand Down Expand Up @@ -250,6 +265,7 @@ void setlinecount()

BuildUnitMultiList();

int limitcount = 0;
// used to set the firmware type
foreach (var item in GetEnumeratorType(new[]
{
Expand All @@ -259,6 +275,9 @@ void setlinecount()
// must be the string version to do the firmware type detection - binarylog
var line = this[(int) item.lineno];
//Console.WriteLine();
limitcount++;
if (limitcount > 100000)
break;
}

// try get gps time - when a dfitem is created and no valid gpstime has been establish the messages are parsed to get a valid gpstime
Expand Down
2 changes: 1 addition & 1 deletion Log/LogBrowse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ private void ResetTreeView(List<string> seenmessagetypes, string VehicleType)
treeView1.ShowNodeToolTips = true;
dataModifierHash = new Hashtable();

var parmdata = logdata.GetEnumeratorType("PARM").Select(a =>
var parmdata = logdata.GetEnumeratorType("PARM").Take(100000).Select(a =>
new MAVLink.MAVLinkParam(a["Name"], double.Parse(a["Value"], CultureInfo.InvariantCulture),
MAVLink.MAV_PARAM_TYPE.REAL32));
MainV2.comPort.MAV.param.Clear();
Expand Down

0 comments on commit 142a91a

Please sign in to comment.