Add IndexOf property to WSRequest and Description classes; implement getValue function in recipes-and-patterns.js

This commit is contained in:
2025-10-09 12:02:06 -07:00
parent 5c2a3c97e9
commit ad82130732
20 changed files with 836 additions and 604 deletions

View File

@ -19,6 +19,7 @@ public class FileRead : Shared.FileRead, IFileRead
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 OpenInsightApplicationProgrammingInterface = @"http://oi-metrology-viewer-api.mes.infineon.com:8080/api/oiWizard";
public const string IQSConnectionString = @"Data Source=messqlec1.infineon.com\PROD1,53959;Initial Catalog=IRMNSPC;Integrated Security=True";
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;
@ -38,6 +39,9 @@ public class FileRead : Shared.FileRead, IFileRead
string barcodeHostFileShare = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "Barcode.Host.FileShare");
if (barcodeHostFileShare != BarcodeHostFileShare)
throw new NotSupportedException($"Update configuration for [{nameof(BarcodeHostFileShare)}]");
string iqsConnectionString = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "IQS.ConnectionString");
if (iqsConnectionString != IQSConnectionString)
throw new NotSupportedException($"Update configuration for [{nameof(IQSConnectionString)}]");
string lsl2SQLConnectionString = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "ConnectionString.LSL2SQL");
if (lsl2SQLConnectionString != LSL2SQLConnectionString)
throw new NotSupportedException($"Update configuration for [{nameof(LSL2SQLConnectionString)}]");
@ -53,14 +57,14 @@ public class FileRead : Shared.FileRead, IFileRead
string tibcoParameterSubjectPrefix = GetPropertyValue(cellInstanceConnectionName, tibcoParameters, "TIBCO.IFX_SUBJECT_PREFIX");
string tibcoParameterConfigurationLocation = GetPropertyValue(cellInstanceConnectionName, tibcoParameters, "TIBCO.IFX_CONFIGURATION_LOCATION");
string tibcoParameterConfigurationLocationCopy = GetPropertyValue(cellInstanceConnectionName, tibcoParameters, "TIBCO.IFX_CONFIGURATION_LOCATION_LOCAL_COPY");
if (!Directory.Exists(MetrologyFileShare))
if (!Directory.Exists(metrologyFileShare))
throw new Exception($"Unable to access file-share <{MetrologyFileShare}>");
if (!Directory.Exists(BarcodeHostFileShare))
if (!Directory.Exists(barcodeHostFileShare))
throw new Exception($"Unable to access file-share <{BarcodeHostFileShare}>");
if (_IsEAFHosted)
{
HttpClient httpClient = new() { BaseAddress = new(OpenInsightApplicationProgrammingInterface) };
Transport.Main.Initialize(smtp, cellInstanceName, fileConnectorConfiguration, LSL2SQLConnectionString, MetrologyFileShare, BarcodeHostFileShare, httpClient);
HttpClient httpClient = new() { BaseAddress = new(openInsightApplicationProgrammingInterface) };
Transport.Main.Initialize(smtp, cellInstanceName, fileConnectorConfiguration, iqsConnectionString, lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, httpClient);
if (!string.IsNullOrEmpty(fileConnectorConfiguration.SourceFileLocation))
_ = Transport.Main.Setup(useSleep: true, setIfxTransport: true, tibcoParameterChannel, tibcoParameterSubjectPrefix, tibcoParameterConfigurationLocation, tibcoParameterConfigurationLocationCopy, tibcoParameterSubject);
else

View File

@ -1,3 +1,4 @@
using com.sun.corba.se.spi.orbutil.fsm;
using System;
using System.Collections.Generic;
using System.Data;
@ -26,6 +27,7 @@ public partial class Job
public string? LastUpdateUser { get; }
public string? LotName { get; }
public string? LotState { get; }
public string? NextJobName { get; }
public string? PackageName { get; }
public string? ProcessSpecName { get; }
public string? ProcessType { get; }
@ -41,7 +43,7 @@ public partial class Job
public DateTime DateTime { get; }
public List<Item> Items { get; }
public Job(string lsl2SQLConnectionString, string metrologyFileShare, string barcodeHostFileShare, HttpClient httpClient, string mid, DateTime enteredDateTimeFilter, DateTime loadSignatureDateTimeFilter)
public Job(string iqsSQLConnectionString, string lsl2SQLConnectionString, string metrologyFileShare, string barcodeHostFileShare, HttpClient httpClient, string mid, DateTime enteredDateTimeFilter, DateTime loadSignatureDateTimeFilter)
{
const int zero = 0;
Items = new List<Item>();
@ -87,7 +89,7 @@ public partial class Job
common = Get(input, httpClient);
}
bool isValid = IsValid(common.RDSNumber);
if (isValid)
if (isValid && common.RunDataSheetRoot is null)
commonB = GetWithValidRDS(lsl2SQLConnectionString, enteredDateTimeFilter, loadSignatureDateTimeFilter, common.Layer, common.PSN, common.RDSNumber, common.ReactorNumber, common.Zone);
else if (common.WorkOrder is null || common.WorkOrder.IsWorkOrder || common.RDSNumber.HasValue)
commonB = Get(lsl2SQLConnectionString, enteredDateTimeFilter, loadSignatureDateTimeFilter, common);
@ -108,18 +110,32 @@ public partial class Job
catch (Exception)
{ runDataSheetRoot = null; }
}
string? basicType;
string? jobNames = GetJobNames(input);
if (string.IsNullOrEmpty(jobNames) || commonB.RDSNumber is null || commonB.ReactorNumber is null || string.IsNullOrEmpty(commonB.PSN))
basicType = hyphen;
else
{
int? runCount;
string commandText = GetCommandText(commonB, jobNames);
try
{ runCount = GetScalar(iqsSQLConnectionString, commandText); }
catch (Exception)
{ runCount = null; }
basicType = runCount is null ? hyphen : runCount.ToString();
}
Qty = "1";
Status = hyphen; // INFO
CreationUser = hyphen; // ?
LotState = hyphen; // LAYER2
LotState = basicType; // LAYER2
Equipment = input.MesEntity; // ?
PackageName = hyphen; // WAFER_ID
Qty2 = input.Sequence; // SEQUENCE
RecipeName = input.Recipe; // PPID
BasicType = basicType; // BASIC_TYPE
IsAreaSi = input.Area == "Si"; // N/A
StateModel = input.EquipmentType; // ?
JobName = DateTime.Ticks.ToString(); // ?
BasicType = GetComment(hyphen, runDataSheetRoot, commonB); // BASIC_TYPE
AutomationMode = string.Concat(DateTime.Ticks, ".", input.MesEntity); // ?
SpecName = !string.IsNullOrEmpty(commonB.Layer) ? commonB.Layer : hyphen; // LAYER
ProductName = !string.IsNullOrEmpty(commonB.PSN) ? commonB.PSN : hyphen; // PRODUCT
@ -131,26 +147,19 @@ public partial class Job
}
}
private static string GetComment(string hyphen, RunDataSheetRoot? runDataSheetRoot, CommonB commonB)
{
string result;
string? loadLockSide = commonB.LoadLockSide;
if (string.IsNullOrEmpty(loadLockSide) && commonB.RDSNumber is not null)
loadLockSide = runDataSheetRoot?.RunDataSheet?.LoadLockSide;
if (string.IsNullOrEmpty(loadLockSide) || string.IsNullOrEmpty(commonB.ReactorType))
result = hyphen;
else
private static string? GetJobNames(Input input) =>
input.EquipmentType switch
{
string loadLockSideFull = loadLockSide switch
{
"L" => "Left",
"R" => "Right",
_ => loadLockSide,
};
result = $"{loadLockSideFull} - {commonB.ReactorType}";
}
return result;
}
"MET08ANLYSDIFAAST230" => "'SPV01'",
"MET08DDUPSFS6420" => "'TENCOR1','TENCOR2','TENCOR3'",
"MET08DDUPSP1TBI" => "'SP101'",
"MET08RESIHGCV" => "'HGCV1','HGCV2','HGCV3'",
"MET08RESIMAPCDE" => "'CDE1','CDE2','CDE3','CDE4','CDE5','CDE6'",
"MET08RESISRP2100" => "'SRP'",
"MET08THFTIRQS408M" => "'BIORAD2','BIORAD3','BIORAD4','BIORAD5'",
"MET08THFTIRSTRATUS" => "'BIORAD4','BIORAD5'",
_ => null,
};
private static int? GetReactorNumber(Input input)
{
@ -564,12 +573,12 @@ public partial class Job
return result;
}
private static string GetRunJson(string lsl2SQLConnectionString, string commandText)
private static string GetRunJson(string connectionString, string commandText)
{
StringBuilder result = new();
try
{
using SqlConnection sqlConnection = new(lsl2SQLConnectionString);
using SqlConnection sqlConnection = new(connectionString);
sqlConnection.Open();
using SqlCommand sqlCommand = new(commandText, sqlConnection);
SqlDataReader sqlDataReader = sqlCommand.ExecuteReader(CommandBehavior.SequentialAccess);
@ -583,6 +592,27 @@ public partial class Job
return result.ToString();
}
private static int? GetScalar(string connectionString, string commandText)
{
int? result;
try
{
using SqlConnection sqlConnection = new(connectionString);
sqlConnection.Open();
using SqlCommand sqlCommand = new(commandText, sqlConnection);
object scalar = sqlCommand.ExecuteScalar();
if (scalar is null || !int.TryParse(scalar.ToString(), out int value))
result = null;
else
result = value;
}
catch (Exception)
{
result = null;
}
return result;
}
private static string GetCommandText(DateTime enteredDateTimeFilter, DateTime loadSignatureDateTimeFilter, int? rds, int? workOrderNumber, int? workOrderCassette, int? slot, int? reactor)
{ // cSpell:disable
List<string> results = new();
@ -788,4 +818,27 @@ public partial class Job
zone: zone);
}
private static string GetCommandText(CommonB commonB, string jobNames)
{ // cSpell:disable
List<string> results = new();
results.Add(" select count(se.f_sgrp) count_se_sgrp ");
results.Add(" from [spcepiworld].[dbo].[sgrp_ext] se ");
results.Add(" join [spcepiworld].[dbo].[prcs_dat] pr ");
results.Add(" on se.f_prcs = pr.f_prcs ");
results.Add(" join [spcepiworld].[dbo].[job_dat] jd ");
results.Add(" on se.f_job = jd.f_job ");
results.Add(" join [spcepiworld].[dbo].[part_lot] pl ");
results.Add(" on se.f_lot = pl.f_lot ");
results.Add(" join [spcepiworld].[dbo].[part_dat] pd ");
results.Add(" on se.f_part = pd.f_part ");
results.Add(" join [spcepiworld].[dbo].[test_dat] td ");
results.Add(" on se.f_test = td.f_test ");
results.Add(" where se.f_flag = 0 ");
results.Add($" and pl.f_name = '{commonB.RDSNumber}' ");
results.Add($" and pr.f_name = '{commonB.ReactorNumber}' ");
results.Add($" and pd.f_name = '{commonB.PSN}' ");
results.Add($" and jd.f_name in ({jobNames}) ");
return string.Join(Environment.NewLine, results);
} // cSpell:restore
}

View File

@ -17,19 +17,21 @@ internal partial class Main
private static object _IfxTransport;
private static string _CellInstanceName;
private static string _MetrologyFileShare;
private static string _IQSConnectionString;
private static string _BarcodeHostFileShare;
private static string _LSL2SQLConnectionString;
private static string _TibcoParameterSubjectPrefix;
private static HttpClient _HttpClient;
private static FileConnectorConfiguration _FileConnectorConfiguration;
internal static void Initialize(ISMTP smtp, string cellInstanceName, FileConnectorConfiguration fileConnectorConfiguration, string lsl2SQLConnectionString, string metrologyFileShare, string barcodeHostFileShare, HttpClient httpClient)
internal static void Initialize(ISMTP smtp, string cellInstanceName, FileConnectorConfiguration fileConnectorConfiguration, string iqsConnectionString, string lsl2SQLConnectionString, string metrologyFileShare, string barcodeHostFileShare, HttpClient httpClient)
{
_SMTP = smtp;
_IfxTransport = null;
_HttpClient = httpClient;
_CellInstanceName = cellInstanceName;
_MetrologyFileShare = metrologyFileShare;
_IQSConnectionString = iqsConnectionString;
_TibcoParameterSubjectPrefix = string.Empty;
_BarcodeHostFileShare = barcodeHostFileShare;
_LSL2SQLConnectionString = lsl2SQLConnectionString;
@ -190,7 +192,7 @@ internal partial class Main
string mid = GetJobsMID(envelopeDocument);
DateTime enteredDateTimeFilter = dateTime.AddDays(-356);
DateTime loadSignatureDateTimeFilter = dateTime.AddDays(-4);
Job job = new(_LSL2SQLConnectionString, _MetrologyFileShare, _BarcodeHostFileShare, _HttpClient, mid, enteredDateTimeFilter, loadSignatureDateTimeFilter);
Job job = new(_IQSConnectionString, _LSL2SQLConnectionString, _MetrologyFileShare, _BarcodeHostFileShare, _HttpClient, mid, enteredDateTimeFilter, loadSignatureDateTimeFilter);
if (job.IsAreaSi)
{
IfxDoc sendReply = GetJobsReply(job);

View File

@ -6,15 +6,17 @@ public class RunDataSheet
{
[JsonConstructor]
public RunDataSheet(string loadLockSide, int psn, int reactor)
public RunDataSheet(string loadLockSide, int psn, int reactor, string reactorType)
{
PSN = psn;
LoadLockSide = loadLockSide;
Reactor = reactor;
ReactorType = reactorType;
}
[JsonPropertyName("loadLockSide")] public string LoadLockSide { get; } // { init; get; }
[JsonPropertyName("PSN")] public int PSN { get; } // { init; get; }
[JsonPropertyName("reactor")] public int Reactor { get; } // { init; get; }
[JsonPropertyName("reactorType")] public string ReactorType { get; } // { init; get; }
}