Ready to test
This commit is contained in:
@ -6,6 +6,7 @@ using Adaptation.Shared.Methods;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Net.Http;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
|
||||||
namespace Adaptation.FileHandlers.TIBCO;
|
namespace Adaptation.FileHandlers.TIBCO;
|
||||||
@ -17,6 +18,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
|||||||
|
|
||||||
public const string BarcodeHostFileShare = @"\\mesfs.infineon.com\EC_Metrology_Si\BarcodeHost\API";
|
public const string BarcodeHostFileShare = @"\\mesfs.infineon.com\EC_Metrology_Si\BarcodeHost\API";
|
||||||
public const string MetrologyFileShare = @"\\mesfs.infineon.com\EC_Metrology_Si\WorkMaterialOut\API";
|
public const string MetrologyFileShare = @"\\mesfs.infineon.com\EC_Metrology_Si\WorkMaterialOut\API";
|
||||||
|
public const string OpenInsightApplicationProgrammingInterface = @"http://oi-prod-ec-api.mes.infineon.com/api/oiWizard";
|
||||||
public const string LSL2SQLConnectionString = @"Data Source=messqlec1.infineon.com\PROD1,53959;Initial Catalog=LSL2SQL;Persist Security Info=True;User ID=srpadmin;Password=0okm9ijn;";
|
public const string LSL2SQLConnectionString = @"Data Source=messqlec1.infineon.com\PROD1,53959;Initial Catalog=LSL2SQL;Persist Security Info=True;User ID=srpadmin;Password=0okm9ijn;";
|
||||||
|
|
||||||
private long? _TickOffset;
|
private long? _TickOffset;
|
||||||
@ -42,6 +44,9 @@ public class FileRead : Shared.FileRead, IFileRead
|
|||||||
string metrologyFileShare = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "Metrology.FileShare");
|
string metrologyFileShare = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "Metrology.FileShare");
|
||||||
if (metrologyFileShare != MetrologyFileShare)
|
if (metrologyFileShare != MetrologyFileShare)
|
||||||
throw new NotSupportedException($"Update configuration for [{nameof(MetrologyFileShare)}]");
|
throw new NotSupportedException($"Update configuration for [{nameof(MetrologyFileShare)}]");
|
||||||
|
string openInsightApplicationProgrammingInterface = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "OpenInsight.Application.Programming.Interface");
|
||||||
|
if (openInsightApplicationProgrammingInterface != OpenInsightApplicationProgrammingInterface)
|
||||||
|
throw new NotSupportedException($"Update configuration for [{nameof(OpenInsightApplicationProgrammingInterface)}]");
|
||||||
ModelObjectParameterDefinition[] tibcoParameters = GetProperties(cellInstanceConnectionName, modelObjectParameters, "TIBCO.");
|
ModelObjectParameterDefinition[] tibcoParameters = GetProperties(cellInstanceConnectionName, modelObjectParameters, "TIBCO.");
|
||||||
string tibcoParameterChannel = GetPropertyValue(cellInstanceConnectionName, tibcoParameters, "TIBCO.IFX_CHANNEL");
|
string tibcoParameterChannel = GetPropertyValue(cellInstanceConnectionName, tibcoParameters, "TIBCO.IFX_CHANNEL");
|
||||||
string tibcoParameterSubject = GetPropertyValue(cellInstanceConnectionName, tibcoParameters, "TIBCO.IFX_SUBJECT");
|
string tibcoParameterSubject = GetPropertyValue(cellInstanceConnectionName, tibcoParameters, "TIBCO.IFX_SUBJECT");
|
||||||
@ -54,7 +59,8 @@ public class FileRead : Shared.FileRead, IFileRead
|
|||||||
throw new Exception($"Unable to access file-share <{BarcodeHostFileShare}>");
|
throw new Exception($"Unable to access file-share <{BarcodeHostFileShare}>");
|
||||||
if (_IsEAFHosted)
|
if (_IsEAFHosted)
|
||||||
{
|
{
|
||||||
Transport.Main.Initialize(smtp, cellInstanceName, fileConnectorConfiguration, LSL2SQLConnectionString, MetrologyFileShare, BarcodeHostFileShare);
|
HttpClient httpClient = new() { BaseAddress = new(OpenInsightApplicationProgrammingInterface) };
|
||||||
|
Transport.Main.Initialize(smtp, cellInstanceName, fileConnectorConfiguration, LSL2SQLConnectionString, MetrologyFileShare, BarcodeHostFileShare, httpClient);
|
||||||
if (!string.IsNullOrEmpty(fileConnectorConfiguration.SourceFileLocation))
|
if (!string.IsNullOrEmpty(fileConnectorConfiguration.SourceFileLocation))
|
||||||
_ = Transport.Main.Setup(useSleep: true, setIfxTransport: true, tibcoParameterChannel, tibcoParameterSubjectPrefix, tibcoParameterConfigurationLocation, tibcoParameterConfigurationLocationCopy, tibcoParameterSubject);
|
_ = Transport.Main.Setup(useSleep: true, setIfxTransport: true, tibcoParameterChannel, tibcoParameterSubjectPrefix, tibcoParameterConfigurationLocation, tibcoParameterConfigurationLocationCopy, tibcoParameterSubject);
|
||||||
else
|
else
|
||||||
|
@ -5,9 +5,11 @@ using System.Data.SqlClient;
|
|||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Net.Http;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Adaptation.FileHandlers.TIBCO.Transport;
|
namespace Adaptation.FileHandlers.TIBCO.Transport;
|
||||||
|
|
||||||
@ -37,7 +39,7 @@ public partial class Job
|
|||||||
public DateTime DateTime { get; }
|
public DateTime DateTime { get; }
|
||||||
public List<Item> Items { get; }
|
public List<Item> Items { get; }
|
||||||
|
|
||||||
public Job(string lsl2SQLConnectionString, string metrologyFileShare, string barcodeHostFileShare, string mid)
|
public Job(string lsl2SQLConnectionString, string metrologyFileShare, string barcodeHostFileShare, HttpClient httpClient, string mid)
|
||||||
{
|
{
|
||||||
const int zero = 0;
|
const int zero = 0;
|
||||||
Items = new List<Item>();
|
Items = new List<Item>();
|
||||||
@ -59,7 +61,10 @@ public partial class Job
|
|||||||
DateTime = DateTime.Now;
|
DateTime = DateTime.Now;
|
||||||
else
|
else
|
||||||
DateTime = new DateTime(sequence);
|
DateTime = new DateTime(sequence);
|
||||||
if (!string.IsNullOrEmpty(input.MID) && !string.IsNullOrEmpty(input.MesEntity) && Regex.IsMatch(input.MID, reactorNumberPattern) && input.MesEntity is bioRad2 or bioRad3)
|
const string dep08CEPIEPSILON = "DEP08CEPIEPSILON";
|
||||||
|
if (input.EquipmentType == dep08CEPIEPSILON)
|
||||||
|
(common, workOrder) = Get(input, httpClient);
|
||||||
|
else if (!string.IsNullOrEmpty(input.MID) && !string.IsNullOrEmpty(input.MesEntity) && Regex.IsMatch(input.MID, reactorNumberPattern) && input.MesEntity is bioRad2 or bioRad3)
|
||||||
(common, workOrder) = Get(input, barcodeHostFileShare);
|
(common, workOrder) = Get(input, barcodeHostFileShare);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -348,6 +353,63 @@ public partial class Job
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static (Common common, WorkOrder workOrder) Get(Input input, HttpClient httpClient)
|
||||||
|
{
|
||||||
|
int? rds;
|
||||||
|
string psn;
|
||||||
|
Common common;
|
||||||
|
WorkOrder workOrder;
|
||||||
|
Task<Stream> streamTask;
|
||||||
|
string zone = string.Empty;
|
||||||
|
string layer = string.Empty;
|
||||||
|
Task<HttpResponseMessage> httpResponseMessageTask;
|
||||||
|
JsonSerializerOptions jsonSerializerOptions = new() { PropertyNameCaseInsensitive = true };
|
||||||
|
int? reactor = !int.TryParse(input.MID.Substring(0, 2), out int reactorNumber) ? null : reactorNumber;
|
||||||
|
httpResponseMessageTask = httpClient.GetAsync($"{httpClient.BaseAddress}/reactors/{reactor}");
|
||||||
|
httpResponseMessageTask.Wait();
|
||||||
|
if (httpResponseMessageTask.Result.StatusCode != System.Net.HttpStatusCode.OK)
|
||||||
|
throw new Exception($"Unable to OI <{httpResponseMessageTask.Result.StatusCode}>");
|
||||||
|
streamTask = httpResponseMessageTask.Result.Content.ReadAsStreamAsync();
|
||||||
|
streamTask.Wait();
|
||||||
|
if (!streamTask.Result.CanRead)
|
||||||
|
throw new NullReferenceException(nameof(streamTask));
|
||||||
|
ReactorRoot? reactorRoot = JsonSerializer.Deserialize<ReactorRoot>(streamTask.Result, jsonSerializerOptions);
|
||||||
|
streamTask.Result.Dispose();
|
||||||
|
if (reactorRoot is null || reactor != reactorRoot.Reactor.ReactorNo || reactorRoot.Reactor.LoadedRDS is null || reactorRoot.Reactor.LoadedRDS.Length < 1)
|
||||||
|
{
|
||||||
|
rds = null;
|
||||||
|
psn = string.Empty;
|
||||||
|
workOrder = new(null, null, null, null, false);
|
||||||
|
common = new(layer, psn, rds, reactor, zone);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rds = reactorRoot.Reactor.LoadedRDS[0];
|
||||||
|
workOrder = new(null, null, null, null, false);
|
||||||
|
httpResponseMessageTask = httpClient.GetAsync($"{httpClient.BaseAddress}/materials/rds/{rds}");
|
||||||
|
httpResponseMessageTask.Wait();
|
||||||
|
if (httpResponseMessageTask.Result.StatusCode != System.Net.HttpStatusCode.OK)
|
||||||
|
throw new Exception($"Unable to OI <{httpResponseMessageTask.Result.StatusCode}>");
|
||||||
|
streamTask = httpResponseMessageTask.Result.Content.ReadAsStreamAsync();
|
||||||
|
streamTask.Wait();
|
||||||
|
if (!streamTask.Result.CanRead)
|
||||||
|
throw new NullReferenceException(nameof(streamTask));
|
||||||
|
RunDataSheetRoot? runDataSheetRoot = JsonSerializer.Deserialize<RunDataSheetRoot>(streamTask.Result, jsonSerializerOptions);
|
||||||
|
streamTask.Result.Dispose();
|
||||||
|
if (runDataSheetRoot is null || reactor != runDataSheetRoot.RunDataSheet.Reactor)
|
||||||
|
{
|
||||||
|
psn = string.Empty;
|
||||||
|
common = new(layer, psn, rds, reactor, zone);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
psn = runDataSheetRoot.RunDataSheet.PSN.ToString();
|
||||||
|
common = new(layer, psn, rds, reactor, zone);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new(common, workOrder);
|
||||||
|
}
|
||||||
|
|
||||||
private static (Common common, WorkOrder workOrder) Get(Input input, string barcodeHostFileShare)
|
private static (Common common, WorkOrder workOrder) Get(Input input, string barcodeHostFileShare)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(barcodeHostFileShare) || !Directory.Exists(barcodeHostFileShare))
|
if (string.IsNullOrEmpty(barcodeHostFileShare) || !Directory.Exists(barcodeHostFileShare))
|
||||||
|
@ -5,6 +5,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Net.Http;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
namespace Adaptation.FileHandlers.TIBCO.Transport;
|
namespace Adaptation.FileHandlers.TIBCO.Transport;
|
||||||
@ -19,12 +20,14 @@ internal partial class Main
|
|||||||
private static string _BarcodeHostFileShare;
|
private static string _BarcodeHostFileShare;
|
||||||
private static string _LSL2SQLConnectionString;
|
private static string _LSL2SQLConnectionString;
|
||||||
private static string _TibcoParameterSubjectPrefix;
|
private static string _TibcoParameterSubjectPrefix;
|
||||||
|
private static HttpClient _HttpClient;
|
||||||
private static FileConnectorConfiguration _FileConnectorConfiguration;
|
private static FileConnectorConfiguration _FileConnectorConfiguration;
|
||||||
|
|
||||||
internal static void Initialize(ISMTP smtp, string cellInstanceName, FileConnectorConfiguration fileConnectorConfiguration, string lsl2SQLConnectionString, string metrologyFileShare, string barcodeHostFileShare)
|
internal static void Initialize(ISMTP smtp, string cellInstanceName, FileConnectorConfiguration fileConnectorConfiguration, string lsl2SQLConnectionString, string metrologyFileShare, string barcodeHostFileShare, HttpClient httpClient)
|
||||||
{
|
{
|
||||||
_SMTP = smtp;
|
_SMTP = smtp;
|
||||||
_IfxTransport = null;
|
_IfxTransport = null;
|
||||||
|
_HttpClient = httpClient;
|
||||||
_CellInstanceName = cellInstanceName;
|
_CellInstanceName = cellInstanceName;
|
||||||
_MetrologyFileShare = metrologyFileShare;
|
_MetrologyFileShare = metrologyFileShare;
|
||||||
_TibcoParameterSubjectPrefix = string.Empty;
|
_TibcoParameterSubjectPrefix = string.Empty;
|
||||||
@ -186,7 +189,7 @@ internal partial class Main
|
|||||||
if (!subject.Contains(_TibcoParameterSubjectPrefix))
|
if (!subject.Contains(_TibcoParameterSubjectPrefix))
|
||||||
throw new Exception("Invalid Subject");
|
throw new Exception("Invalid Subject");
|
||||||
mid = GetJobsMID(envelopeDocument);
|
mid = GetJobsMID(envelopeDocument);
|
||||||
Job job = new(_LSL2SQLConnectionString, _MetrologyFileShare, _BarcodeHostFileShare, mid);
|
Job job = new(_LSL2SQLConnectionString, _MetrologyFileShare, _BarcodeHostFileShare, _HttpClient, mid);
|
||||||
if (job.IsAreaSi)
|
if (job.IsAreaSi)
|
||||||
{
|
{
|
||||||
IfxDoc sendReply = GetJobsReply(job);
|
IfxDoc sendReply = GetJobsReply(job);
|
||||||
|
18
Adaptation/FileHandlers/TIBCO/Transport/Reactor.cs
Normal file
18
Adaptation/FileHandlers/TIBCO/Transport/Reactor.cs
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace Adaptation.FileHandlers.TIBCO.Transport;
|
||||||
|
|
||||||
|
public class Reactor
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonConstructor]
|
||||||
|
public Reactor(int reactorNo, int[] loadedRDS)
|
||||||
|
{
|
||||||
|
ReactorNo = reactorNo;
|
||||||
|
LoadedRDS = loadedRDS;
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonPropertyName("reactorNo")] public int ReactorNo { get; } // { init; get; }
|
||||||
|
[JsonPropertyName("loadedRDS")] public int[] LoadedRDS { get; } // { init; get; }
|
||||||
|
|
||||||
|
}
|
14
Adaptation/FileHandlers/TIBCO/Transport/ReactorRoot.cs
Normal file
14
Adaptation/FileHandlers/TIBCO/Transport/ReactorRoot.cs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace Adaptation.FileHandlers.TIBCO.Transport;
|
||||||
|
|
||||||
|
public class ReactorRoot
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonConstructor]
|
||||||
|
public ReactorRoot(Reactor reactor) =>
|
||||||
|
Reactor = reactor;
|
||||||
|
|
||||||
|
[JsonPropertyName("reactor")] public Reactor Reactor { get; } // { init; get; }
|
||||||
|
|
||||||
|
}
|
18
Adaptation/FileHandlers/TIBCO/Transport/RunDataSheet.cs
Normal file
18
Adaptation/FileHandlers/TIBCO/Transport/RunDataSheet.cs
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace Adaptation.FileHandlers.TIBCO.Transport;
|
||||||
|
|
||||||
|
public class RunDataSheet
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonConstructor]
|
||||||
|
public RunDataSheet(int psn, int reactor)
|
||||||
|
{
|
||||||
|
PSN = psn;
|
||||||
|
Reactor = reactor;
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonPropertyName("PSN")] public int PSN { get; } // { init; get; }
|
||||||
|
[JsonPropertyName("reactor")] public int Reactor { get; } // { init; get; }
|
||||||
|
|
||||||
|
}
|
14
Adaptation/FileHandlers/TIBCO/Transport/RunDataSheetRoot.cs
Normal file
14
Adaptation/FileHandlers/TIBCO/Transport/RunDataSheetRoot.cs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace Adaptation.FileHandlers.TIBCO.Transport;
|
||||||
|
|
||||||
|
public class RunDataSheetRoot
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonConstructor]
|
||||||
|
public RunDataSheetRoot(RunDataSheet runDataSheet) =>
|
||||||
|
RunDataSheet = runDataSheet;
|
||||||
|
|
||||||
|
[JsonPropertyName("rds")] public RunDataSheet RunDataSheet { get; } // { init; get; }
|
||||||
|
|
||||||
|
}
|
@ -3,6 +3,7 @@ using Microsoft.Extensions.Logging;
|
|||||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using System.Net.Http;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
namespace Adaptation._Tests.Static;
|
namespace Adaptation._Tests.Static;
|
||||||
@ -47,34 +48,42 @@ public class Job : LoggingUnitTesting, IDisposable
|
|||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void TestJobA()
|
public void TestJobA()
|
||||||
{
|
{
|
||||||
|
string mid;
|
||||||
FileHandlers.TIBCO.Transport.Job job;
|
FileHandlers.TIBCO.Transport.Job job;
|
||||||
MethodBase methodBase = new StackFrame().GetMethod();
|
MethodBase methodBase = new StackFrame().GetMethod();
|
||||||
string metrologyFileShare = FileHandlers.TIBCO.FileRead.MetrologyFileShare;
|
string metrologyFileShare = FileHandlers.TIBCO.FileRead.MetrologyFileShare;
|
||||||
string barcodeHostFileShare = FileHandlers.TIBCO.FileRead.BarcodeHostFileShare;
|
string barcodeHostFileShare = FileHandlers.TIBCO.FileRead.BarcodeHostFileShare;
|
||||||
string lsl2SQLConnectionString = FileHandlers.TIBCO.FileRead.LSL2SQLConnectionString;
|
string lsl2SQLConnectionString = FileHandlers.TIBCO.FileRead.LSL2SQLConnectionString;
|
||||||
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||||
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"12-123456-1234\", \"Recipe\": \"Recipe\"}");
|
HttpClient httpClient = new() { BaseAddress = new(FileHandlers.TIBCO.FileRead.OpenInsightApplicationProgrammingInterface) };
|
||||||
|
mid = "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"12-123456-1234\", \"Recipe\": \"Recipe\"}";
|
||||||
|
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, httpClient, mid);
|
||||||
Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType)); // == "21");
|
Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType)); // == "21");
|
||||||
Assert.IsTrue(job.LotName == "123456");
|
Assert.IsTrue(job.LotName == "123456");
|
||||||
Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName)); // == "4609");
|
Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName)); // == "4609");
|
||||||
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"-544481-\", \"Recipe\": \"Recipe\"}");
|
mid = "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"-544481-\", \"Recipe\": \"Recipe\"}";
|
||||||
|
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, httpClient, mid);
|
||||||
Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType)); // == "51");
|
Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType)); // == "51");
|
||||||
Assert.IsTrue(job.LotName == "544481");
|
Assert.IsTrue(job.LotName == "544481");
|
||||||
Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName)); // == "5158");
|
Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName)); // == "5158");
|
||||||
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"00-544481-0000\", \"Recipe\": \"Recipe\"}");
|
mid = "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"00-544481-0000\", \"Recipe\": \"Recipe\"}";
|
||||||
|
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, httpClient, mid);
|
||||||
Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType)); // == "51");
|
Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType)); // == "51");
|
||||||
Assert.IsTrue(job.LotName == "544481");
|
Assert.IsTrue(job.LotName == "544481");
|
||||||
Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName)); // == "5158");
|
Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName)); // == "5158");
|
||||||
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, "{\"Area\": \"Si\", \"EquipmentType\": \"MET08THFTIRQS408M\", \"MesEntity\": \"BIORAD2\", \"Sequence\": \"123456789\", \"MID\": \"37--\", \"Recipe\": \"Recipe\"}");
|
mid = "{\"Area\": \"Si\", \"EquipmentType\": \"MET08THFTIRQS408M\", \"MesEntity\": \"BIORAD2\", \"Sequence\": \"123456789\", \"MID\": \"37--\", \"Recipe\": \"Recipe\"}";
|
||||||
|
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, httpClient, mid);
|
||||||
Assert.IsTrue(job.ProcessType == "37");
|
Assert.IsTrue(job.ProcessType == "37");
|
||||||
Assert.IsTrue(!string.IsNullOrEmpty(job.LotName)); // == "549918");
|
Assert.IsTrue(!string.IsNullOrEmpty(job.LotName)); // == "549918");
|
||||||
Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName)); // == "5101");
|
Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName)); // == "5101");
|
||||||
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"00-o171308.1.51-0000\", \"Recipe\": \"Recipe\", \"Slot\": \"11\"}");
|
mid = "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"00-o171308.1.51-0000\", \"Recipe\": \"Recipe\", \"Slot\": \"11\"}";
|
||||||
|
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, httpClient, mid);
|
||||||
Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType)); // == "54");
|
Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType)); // == "54");
|
||||||
Assert.IsTrue(!string.IsNullOrEmpty(job.LotName)); // == "547000");
|
Assert.IsTrue(!string.IsNullOrEmpty(job.LotName)); // == "547000");
|
||||||
Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName)); // == "4445");
|
Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName)); // == "4445");
|
||||||
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||||
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE5\", \"Sequence\": \"638163023363575829\", \"MID\": \"B48\", \"Recipe\": \"lsl_6in \"}");
|
mid = "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE5\", \"Sequence\": \"638163023363575829\", \"MID\": \"B48\", \"Recipe\": \"lsl_6in \"}";
|
||||||
|
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, httpClient, mid);
|
||||||
Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType)); // == "54");
|
Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType)); // == "54");
|
||||||
Assert.IsTrue(!string.IsNullOrEmpty(job.LotName)); // == "547000");
|
Assert.IsTrue(!string.IsNullOrEmpty(job.LotName)); // == "547000");
|
||||||
Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName)); // == "4445");
|
Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName)); // == "4445");
|
||||||
@ -92,7 +101,9 @@ public class Job : LoggingUnitTesting, IDisposable
|
|||||||
string barcodeHostFileShare = FileHandlers.TIBCO.FileRead.BarcodeHostFileShare;
|
string barcodeHostFileShare = FileHandlers.TIBCO.FileRead.BarcodeHostFileShare;
|
||||||
string lsl2SQLConnectionString = FileHandlers.TIBCO.FileRead.LSL2SQLConnectionString;
|
string lsl2SQLConnectionString = FileHandlers.TIBCO.FileRead.LSL2SQLConnectionString;
|
||||||
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||||
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"P1234\", \"Recipe\": \"Recipe\"}");
|
HttpClient httpClient = new() { BaseAddress = new(FileHandlers.TIBCO.FileRead.OpenInsightApplicationProgrammingInterface) };
|
||||||
|
string mid = "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"P1234\", \"Recipe\": \"Recipe\"}";
|
||||||
|
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, httpClient, mid);
|
||||||
Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType));
|
Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType));
|
||||||
Assert.IsTrue(!string.IsNullOrEmpty(job.LotName));
|
Assert.IsTrue(!string.IsNullOrEmpty(job.LotName));
|
||||||
Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName));
|
Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName));
|
||||||
@ -110,7 +121,28 @@ public class Job : LoggingUnitTesting, IDisposable
|
|||||||
string barcodeHostFileShare = FileHandlers.TIBCO.FileRead.BarcodeHostFileShare;
|
string barcodeHostFileShare = FileHandlers.TIBCO.FileRead.BarcodeHostFileShare;
|
||||||
string lsl2SQLConnectionString = FileHandlers.TIBCO.FileRead.LSL2SQLConnectionString;
|
string lsl2SQLConnectionString = FileHandlers.TIBCO.FileRead.LSL2SQLConnectionString;
|
||||||
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||||
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"BIORAD3\", \"Sequence\": \"638234699589174855\", \"MID\": \"33--\", \"Recipe\": \"Recipe\"}");
|
HttpClient httpClient = new() { BaseAddress = new(FileHandlers.TIBCO.FileRead.OpenInsightApplicationProgrammingInterface) };
|
||||||
|
string mid = "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"BIORAD3\", \"Sequence\": \"638234699589174855\", \"MID\": \"33--\", \"Recipe\": \"Recipe\"}";
|
||||||
|
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, httpClient, mid);
|
||||||
|
Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType));
|
||||||
|
Assert.IsTrue(!string.IsNullOrEmpty(job.LotName));
|
||||||
|
Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName));
|
||||||
|
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||||
|
NonThrowTryCatch();
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void TestJobD()
|
||||||
|
{
|
||||||
|
FileHandlers.TIBCO.Transport.Job job;
|
||||||
|
MethodBase methodBase = new StackFrame().GetMethod();
|
||||||
|
string metrologyFileShare = FileHandlers.TIBCO.FileRead.MetrologyFileShare;
|
||||||
|
string barcodeHostFileShare = FileHandlers.TIBCO.FileRead.BarcodeHostFileShare;
|
||||||
|
string lsl2SQLConnectionString = FileHandlers.TIBCO.FileRead.LSL2SQLConnectionString;
|
||||||
|
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||||
|
HttpClient httpClient = new() { BaseAddress = new(FileHandlers.TIBCO.FileRead.OpenInsightApplicationProgrammingInterface) };
|
||||||
|
string mid = "{\"Area\": \"Si\", \"EquipmentType\": \"DEP08CEPIEPSILON\", \"MesEntity\": \"32\", \"Sequence\": \"638234699589174855\", \"MID\": \"32--\", \"Recipe\": \"Recipe\"}";
|
||||||
|
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, httpClient, mid);
|
||||||
Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType));
|
Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType));
|
||||||
Assert.IsTrue(!string.IsNullOrEmpty(job.LotName));
|
Assert.IsTrue(!string.IsNullOrEmpty(job.LotName));
|
||||||
Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName));
|
Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName));
|
||||||
|
@ -125,7 +125,11 @@
|
|||||||
<Compile Include="Adaptation\FileHandlers\TIBCO\Transport\Job.cs" />
|
<Compile Include="Adaptation\FileHandlers\TIBCO\Transport\Job.cs" />
|
||||||
<Compile Include="Adaptation\FileHandlers\TIBCO\Transport\Logistics.cs" />
|
<Compile Include="Adaptation\FileHandlers\TIBCO\Transport\Logistics.cs" />
|
||||||
<Compile Include="Adaptation\FileHandlers\TIBCO\Transport\Main.cs" />
|
<Compile Include="Adaptation\FileHandlers\TIBCO\Transport\Main.cs" />
|
||||||
|
<Compile Include="Adaptation\FileHandlers\TIBCO\Transport\Reactor.cs" />
|
||||||
|
<Compile Include="Adaptation\FileHandlers\TIBCO\Transport\ReactorRoot.cs" />
|
||||||
<Compile Include="Adaptation\FileHandlers\TIBCO\Transport\Run.cs" />
|
<Compile Include="Adaptation\FileHandlers\TIBCO\Transport\Run.cs" />
|
||||||
|
<Compile Include="Adaptation\FileHandlers\TIBCO\Transport\RunDataSheet.cs" />
|
||||||
|
<Compile Include="Adaptation\FileHandlers\TIBCO\Transport\RunDataSheetRoot.cs" />
|
||||||
<Compile Include="Adaptation\FileHandlers\TIBCO\Transport\WorkMaterialOut.cs" />
|
<Compile Include="Adaptation\FileHandlers\TIBCO\Transport\WorkMaterialOut.cs" />
|
||||||
<Compile Include="Adaptation\FileHandlers\TIBCO\Transport\WorkOrder.cs" />
|
<Compile Include="Adaptation\FileHandlers\TIBCO\Transport\WorkOrder.cs" />
|
||||||
<Compile Include="Adaptation\FileHandlers\txt\Description.cs" />
|
<Compile Include="Adaptation\FileHandlers\txt\Description.cs" />
|
||||||
|
Reference in New Issue
Block a user