Recipe
This commit is contained in:
parent
1e9c485a65
commit
b20bc99117
@ -222,8 +222,6 @@ public class ProcessData : IProcessData
|
|||||||
|
|
||||||
private void Parse(IFileRead fileRead, List<FileInfo> fileInfoCollection, int startX, int startY, int endX, int endY, List<(string, Color[])> colorCollections, List<int> previousTotalDeltaCollection, string lastText)
|
private void Parse(IFileRead fileRead, List<FileInfo> fileInfoCollection, int startX, int startY, int endX, int endY, List<(string, Color[])> colorCollections, List<int> previousTotalDeltaCollection, string lastText)
|
||||||
{
|
{
|
||||||
Recipe = string.Empty;
|
|
||||||
_Log.Debug("TODO: Get recipe");
|
|
||||||
Red = 0;
|
Red = 0;
|
||||||
Green = 0;
|
Green = 0;
|
||||||
int delta;
|
int delta;
|
||||||
@ -264,8 +262,8 @@ public class ProcessData : IProcessData
|
|||||||
totalDeltaCollection.Add(new(file, totalDelta));
|
totalDeltaCollection.Add(new(file, totalDelta));
|
||||||
}
|
}
|
||||||
totalDeltaCollection = (from l in totalDeltaCollection orderby l.TotalDelta select l).ToList();
|
totalDeltaCollection = (from l in totalDeltaCollection orderby l.TotalDelta select l).ToList();
|
||||||
string closestMatchFile = totalDeltaCollection[0].File;
|
Recipe = Path.GetFileNameWithoutExtension(totalDeltaCollection[0].File);
|
||||||
string[] closestMatchFileNameSplit = Path.GetFileNameWithoutExtension(closestMatchFile).Split('-');
|
string[] closestMatchFileNameSplit = Recipe.Split('-');
|
||||||
Text = closestMatchFileNameSplit.Last().TrimStart();
|
Text = closestMatchFileNameSplit.Last().TrimStart();
|
||||||
TotalDelta = totalDeltaCollection[0].TotalDelta;
|
TotalDelta = totalDeltaCollection[0].TotalDelta;
|
||||||
string textFileName = Get(fileRead, ".txt", $"{TotalDelta} - {Text}");
|
string textFileName = Get(fileRead, ".txt", $"{TotalDelta} - {Text}");
|
||||||
@ -283,6 +281,7 @@ public class ProcessData : IProcessData
|
|||||||
double upper = average + deviation;
|
double upper = average + deviation;
|
||||||
double lower = average - deviation;
|
double lower = average - deviation;
|
||||||
string message = $"average:{average};sum:{sum};standardDeviation:{standardDeviation};upper:{upper};lower:{lower};TotalDelta:{TotalDelta};Text:{Text};previousTotalDeltaCollection.Count:{previousTotalDeltaCollection.Count};";
|
string message = $"average:{average};sum:{sum};standardDeviation:{standardDeviation};upper:{upper};lower:{lower};TotalDelta:{TotalDelta};Text:{Text};previousTotalDeltaCollection.Count:{previousTotalDeltaCollection.Count};";
|
||||||
|
_Log.Debug(message);
|
||||||
if (TotalDelta > upper)
|
if (TotalDelta > upper)
|
||||||
throw new Exception(message);
|
throw new Exception(message);
|
||||||
if (TotalDelta < lower)
|
if (TotalDelta < lower)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user