Duplicator and now deleting if not sending to EDA

This commit is contained in:
2022-03-11 12:12:01 -07:00
parent 87700e0370
commit 7a94484d0e
23 changed files with 436 additions and 340 deletions

View File

@ -7,7 +7,7 @@ using System.Text.Json;
namespace Adaptation.FileHandlers.jpeg;
public class Description : IDescription
public class Description : IDescription, Shared.Properties.IDescription
{
public int Test { get; set; }

View File

@ -173,7 +173,9 @@ public class FileRead : Shared.FileRead, IFileRead
_Logistics.ProcessJobID = iProcessData.GetCurrentReactor(this, _Logistics, _Reactors);
if (!iProcessData.Details.Any())
throw new Exception(string.Concat("B) No Data - ", dateTime.Ticks));
if (processData.Text != _LastText || _LastChange < DateTime.Now.AddMinutes(-30).Ticks)
if (processData.Text == _LastText && _LastChange > DateTime.Now.AddMinutes(-30).Ticks)
File.Delete(reportFullPath);
else
{
if (processData.Text != _LastText)
{
@ -185,7 +187,8 @@ public class FileRead : Shared.FileRead, IFileRead
double deviation = standardDeviation * 3;
double upper = average + deviation;
double lower = average - deviation;
string message = $"average:{average};sum:{sum};standardDeviation:{standardDeviation};upper:{upper};lower:{lower};TotalDelta:{processData.TotalDelta};Text:{processData.Text};_PreviousTotalDeltaCollection.Count:{_PreviousTotalDeltaCollection.Count};";
var dynamic = new { average, sum, standardDeviation, upper, lower, processData.TotalDelta, processData.Text, _PreviousTotalDeltaCollection.Count };
string message = JsonSerializer.Serialize(dynamic, new JsonSerializerOptions { WriteIndented = true });
_Log.Debug(message);
if (processData.TotalDelta > upper || processData.TotalDelta < lower)
_SMTP.SendHighPriorityEmailMessage($"Exception:{_CellInstanceConnectionName}", message);