Skip to content

Commit

Permalink
Better display in FindLoop
Browse files Browse the repository at this point in the history
  • Loading branch information
HakanL committed Sep 16, 2020
1 parent b7f6892 commit f92fd11
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions Utils/DMXrecorder/PostProcessor/Command/FindLoop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void Execute()
var firstData = new Dictionary<int, byte[]>();
var currentData = new Dictionary<int, byte[]>();

var diffList = new List<Tuple<double, long>>();
var diffList = new List<(double Match, long Position)>();

long currentPos = 0;

Expand Down Expand Up @@ -62,16 +62,16 @@ public void Execute()
}

if (diff.HasValue)
diffList.Add(Tuple.Create((double)diff.Value / dataElements, pos));
diffList.Add(((double)diff.Value / dataElements, pos));
}
}

diffList = diffList.OrderBy(x => x.Item1).ToList();
diffList = diffList.OrderBy(x => x.Match).ThenByDescending(x => x.Position).ToList();

foreach (var match in diffList.Take(10))
{
Console.WriteLine("Pos {0:P2} Mismatch {1:P2} TrimPos: {2}", (double)match.Item2 / currentPos, match.Item1 / 100.0,
match.Item2);
Console.WriteLine("Pos {0,6:P1} Mismatch {1,7:P2} TrimPos: {2}", (double)match.Position / currentPos, match.Match / 100.0,
match.Position);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Utils/DMXrecorder/PostProcessor/Command/TrimBlack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ namespace Animatroller.PostProcessor.Command
{
public class TrimBlack : ICommand
{
private Common.IFileReader fileReader;
private Common.IFileWriter fileWriter;
private readonly Common.IFileReader fileReader;
private readonly Common.IFileWriter fileWriter;

public TrimBlack(Common.IFileReader fileReader, Common.IFileWriter fileWriter)
{
Expand Down

0 comments on commit f92fd11

Please sign in to comment.