OpenInsightCommonGatewayInterfaceReactorStatesStatus
This commit is contained in:
2022-03-22 12:08:11 -07:00
parent 2070234bdf
commit ef74d7a85a
5 changed files with 42 additions and 35 deletions

View File

@ -35,40 +35,31 @@ public class ProcessData
return result.ToString();
}
internal static void PostOpenInsightMetrologyViewerAttachments(IFileRead fileRead, Logistics logistics, string openInsightMetrologyViewerAPI, DateTime dateTime, string logisticsSequenceMemoryDirectory, List<jpeg.Description> descriptions, string matchDirectory)
internal static async void PutOpenInsightCommonGatewayInterfaceReactorStatesStatus(IFileRead fileRead, Logistics logistics, HttpClient httpClient, List<jpeg.Description> descriptions)
{
if (fileRead is null)
{ }
if (logistics is null)
{ }
if (openInsightMetrologyViewerAPI is null)
{ }
if (dateTime == DateTime.MinValue)
{ }
if (logisticsSequenceMemoryDirectory is null)
{ }
if (descriptions is null)
{ }
if (matchDirectory is null)
{ }
//Not used
}
internal static void PostOpenInsightCommonGatewayInterfaceContacts(IFileRead fileRead, Logistics logistics, string openInsightMetrologyViewerAPI, DateTime dateTime, string logisticsSequenceMemoryDirectory, List<jpeg.Description> descriptions)
{
if (fileRead is null)
{ }
if (logistics is null)
{ }
if (openInsightMetrologyViewerAPI is null)
{ }
if (dateTime == DateTime.MinValue)
{ }
if (logisticsSequenceMemoryDirectory is null)
{ }
if (descriptions is null)
{ }
//Not used
HttpContent httpContent = null;
string status = descriptions[0].MID;
string reactorNumber = logistics.MesEntity.Substring(1);
string statusDateTime = logistics.DateTimeFromSequence.ToString("MM-dd-yyyy HH:mm:ss");
Uri uri = new($"{httpClient.BaseAddress.OriginalString}reactno={reactorNumber}&status={status}&statusdtm={statusDateTime}");
try
{
HttpResponseMessage httpResponseMessage = await httpClient.PutAsync(uri, httpContent);
if (httpResponseMessage.StatusCode is System.Net.HttpStatusCode.OK)
{
string content = await httpResponseMessage.Content.ReadAsStringAsync();
if (string.IsNullOrEmpty(content))
{ }
}
}
catch (Exception ex)
{
status = ex.Message;
if (string.IsNullOrEmpty(status))
{ }
}
}
}