using System; using System.Collections.Generic; using System.Text.Json; namespace Shared.Metrology; public class Duplicator { public class Description : IProcessDataDescription { public int Test { get; set; } public int Count { get; set; } public int Index { get; set; } // public string? EventName { get; set; } public string? NullData { get; set; } public string? JobID { get; set; } public string? Sequence { get; set; } public string? MesEntity { get; set; } public string? ReportFullPath { get; set; } public string? ProcessJobID { get; set; } public string? MID { get; set; } public string? Date { get; set; } //2021-02-22 public string GetEventDescription() => "File Has been read and parsed"; public List GetHeaderNames(ILogic logic, ConfigDataBase configDataBase) { List results = new(); return results; } public List GetDetailNames(ILogic logic, ConfigDataBase configDataBase) { List results = new(); return results; } public List GetParameterNames(ILogic logic, ConfigDataBase configDataBase) { List results = new(); return results; } public List GetPairedParameterNames(ILogic logic, ConfigDataBase configDataBase) { List results = new(); return results; } public List GetIgnoreParameterNames(ILogic logic, ConfigDataBase configDataBase, Test test) { List results = new(); return results; } public List GetNames(ILogic logic, ConfigDataBase configDataBase) { List results = new(); IProcessDataDescription processDataDescription = GetDefault(logic, configDataBase); string json = JsonSerializer.Serialize(processDataDescription, processDataDescription.GetType()); object @object = JsonSerializer.Deserialize(json); if (@object is not JsonElement jsonElement) throw new Exception(); foreach (JsonProperty jsonProperty in jsonElement.EnumerateObject()) results.Add(jsonProperty.Name); return results; } public IProcessDataDescription GetDisplayNames(ILogic logic, ConfigDataBase configDataBase) { Description result = new(); return result; } public IProcessDataDescription GetDefault(ILogic logic, ConfigDataBase configDataBase) { Description result = new() { Test = -1, Count = 0, Index = -1, // EventName = configDataBase.GetEventName(), NullData = string.Empty, JobID = logic.Logistics.JobID, Sequence = logic.Logistics.Sequence.ToString(), MesEntity = logic.Logistics.MesEntity, ReportFullPath = logic.Logistics.ReportFullPath, ProcessJobID = logic.Logistics.ProcessJobID, MID = logic.Logistics.MID, Date = logic.Logistics.DateTimeFromSequence.ToUniversalTime().ToString("MM/dd/yyyy HH:mm:ss"), }; return result; } public List GetDescription(ILogic logic, ConfigDataBase configDataBase, List tests, IProcessData iProcessData) { List results = new(); return results; } } }