Added Hyphen
Dual write PDSF for Metrology Viewer Version Error Message Tests passed net8.0 v2_52_0-Tests v2_52_0-Tests editorconfig editorconfig yml ec fix yaml explicit contents Delete File if Exists dotnet_diagnostic Removed Open Insight API IFX Directory Removed Open Insight API IFX Directory from Save CA1862 and GetWeekOfYear for WritePDSF gitignore cellInstanceVersion.EdaConnection.PortNumber Added Climatec to Test.cs NETFRAMEWORK GetJobIdDirectory Remove and
This commit is contained in:
@ -30,7 +30,6 @@ public class WSRequest
|
||||
public string SineBevelAngle { get; set; }
|
||||
public string XStep { get; set; }
|
||||
public List<json.Detail> Details { get; protected set; }
|
||||
public string ProcessDataStandardFormat { get; set; }
|
||||
|
||||
[Obsolete("For json")] public WSRequest() { }
|
||||
|
||||
@ -38,7 +37,6 @@ public class WSRequest
|
||||
internal WSRequest(IFileRead fileRead, Logistics logistics, List<json.Description> descriptions, string processDataStandardFormat = null)
|
||||
#pragma warning restore IDE0060
|
||||
{
|
||||
ProcessDataStandardFormat = processDataStandardFormat;
|
||||
Id = -1;
|
||||
FilePath = string.Empty;
|
||||
CellName = logistics.MesEntity;
|
||||
@ -75,28 +73,38 @@ public class WSRequest
|
||||
Details.Add(detail);
|
||||
}
|
||||
Date ??= logistics.DateTimeFromSequence.ToString();
|
||||
if (UniqueId is null && Details.Any())
|
||||
if (UniqueId is null && Details.Count != 0)
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
#pragma warning disable IDE0060
|
||||
internal static void PostOpenInsightMetrologyViewerAttachments(IFileRead fileRead, Logistics logistics, string openInsightMetrologyViewerAPI, DateTime dateTime, string json, List<json.Description> descriptions, string matchDirectory)
|
||||
#pragma warning restore IDE0060
|
||||
internal static long GetHeaderId(IFileRead fileRead, Logistics logistics, string openInsightMetrologyViewerAPI, DateTime dateTime, int weekOfYear, string json, List<json.Description> descriptions)
|
||||
{
|
||||
long result;
|
||||
if (string.IsNullOrEmpty(json))
|
||||
{
|
||||
WSRequest wsRequest = new(fileRead, logistics, descriptions);
|
||||
(json, WS.Results wsResults) = WS.SendData(openInsightMetrologyViewerAPI, wsRequest);
|
||||
string directory = Path.Combine(openInsightMetrologyViewerAPI, dateTime.Year.ToString(), $"WW{weekOfYear:00}");
|
||||
(json, WS.Results wsResults) = WS.SendData(openInsightMetrologyViewerAPI, logistics.Sequence, directory, wsRequest);
|
||||
if (!wsResults.Success)
|
||||
throw new Exception(wsResults.ToString());
|
||||
}
|
||||
WS.Results metrologyWSRequest = JsonSerializer.Deserialize<WS.Results>(json, new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
|
||||
long wsResultsHeaderID = metrologyWSRequest.HeaderID;
|
||||
result = metrologyWSRequest.HeaderID;
|
||||
return result;
|
||||
}
|
||||
|
||||
#pragma warning disable IDE0060
|
||||
internal static void PostOpenInsightMetrologyViewerAttachments(IFileRead fileRead, Logistics logistics, string openInsightMetrologyViewerAPI, List<json.Description> descriptions, string matchDirectory, string subGroupId, long headerId, string headerIdDirectory)
|
||||
#pragma warning restore IDE0060
|
||||
{
|
||||
string[] jsonFiles = Directory.GetFiles(matchDirectory, "*.json", SearchOption.TopDirectoryOnly);
|
||||
if (jsonFiles.Length != 1)
|
||||
throw new Exception($"Invalid source file count for <{wsResultsHeaderID}>!{Environment.NewLine}{json}");
|
||||
List<WS.Attachment> headerAttachments = new() { new WS.Attachment(descriptions[0].HeaderUniqueId, "Data.json", jsonFiles.First()) };
|
||||
WS.AttachFiles(openInsightMetrologyViewerAPI, wsResultsHeaderID, headerAttachments, dataAttachments: null);
|
||||
throw new Exception($"Invalid source file count for <{headerId}>!");
|
||||
List<WS.Attachment> headerAttachments = new()
|
||||
{
|
||||
new WS.Attachment(subGroupId, headerId, headerIdDirectory, descriptions[0].HeaderUniqueId, "Data.json", jsonFiles.First())
|
||||
};
|
||||
WS.AttachFiles(openInsightMetrologyViewerAPI, headerAttachments, dataAttachments: null);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user