private static void ProcessGenerated(Snapshot snapshot, GeneratedEvents.Configuration gec, Instance currentInstanceData, ReturnData currentData)
{
var e = gec.Events.Find(x => x.Name.ToLower() == snapshot.Link.ToLower());
if (e != null)
{
Return returnValue = e.Process(currentInstanceData);
if (snapshot.Value != returnValue.Value)
{
if (returnValue != null)
{
var value = e.Values.Find(x => x.Result.NumVal == returnValue.NumVal);
if (value != null)
{
snapshot.PreviousTimestamp = GetTimestampFromCurrent(value, currentData);
}
}
snapshot.PreviousValue = snapshot.Value;
snapshot.Value = returnValue.Value;
}
snapshot.Timestamp = returnValue.TimeStamp;
}
}