Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TelemetryLogGraph: Fix some messages not being graphed #1465

Merged
merged 1 commit into from
Feb 4, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 18 additions & 5 deletions Log/MavlinkLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -744,9 +744,20 @@ private void BUT_graphmavlog_Click(object sender, EventArgs e)
0x600000,0x006000,0x000060,0x606000,0x600060,0x006060,
0xA00000,0x00A000,0x0000A0,0xA0A000,0xA000A0,0x00A0A0,
0xE00000,0x00E000,0x0000E0,0xE0E000,0xE000E0,0x00E0E0, */
};

// Form selectform;
};

// Form selectform;

private static string ReplaceLastOccurrence(string Source, string Find, string Replace)
{
int place = Source.LastIndexOf(Find);

if (place == -1)
return Source;

string result = Source.Remove(place, Find.Length).Insert(place, Replace);
return result;
}

private List<string> GetLogFileValidFields(string logfile)
{
Expand Down Expand Up @@ -827,7 +838,8 @@ private List<string> GetLogFileValidFields(string logfile)

if (true)
{
string packetname = test.Name.Replace("mavlink_", "").Replace("_t", "").ToUpper();
string packetname = ReplaceLastOccurrence(test.Name, "_t", "");
packetname = packetname.Replace("mavlink_", "").ToUpper();

if (!packetdata.ContainsKey(packetname))
{
Expand Down Expand Up @@ -1206,7 +1218,8 @@ private void ResetTreeView(List<string> seenmessagetypes)
{
var items = item.Split('.');

var item1text = items[0].Replace("mavlink_", "").Replace("_t", "").ToUpper();
var item1text = ReplaceLastOccurrence(items[0], "_t", "");
item1text = item1text.Replace("mavlink_", "").ToUpper();
var item2text = items[1];

if (!addedrootnodes.ContainsKey(item1text))
Expand Down