Delete SelfHost PackageReference

cellInstanceVersion.EdaConnection.PortNumber
Convert before throwing the error
CA1862 and GetWeekOfYear for WritePDSF
Removed Open Insight API IFX Directory from Save
dotnet_diagnostic
Delete File if Exists
yml ec fix
net8.0
This commit is contained in:
2024-04-09 12:55:04 -07:00
parent ae47e7dbd5
commit 3355fb3318
89 changed files with 914 additions and 1687 deletions

View File

@ -7,10 +7,6 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Text.Json;
#if NETFRAMEWORK && NET48
using System.Web.Http;
using System.Web.Http.SelfHost;
#endif
namespace Adaptation.FileHandlers.MoveAllFiles;
@ -19,13 +15,7 @@ public class FileRead : Shared.FileRead, IFileRead
#nullable enable
public const string HttpSelfHostConfigurationBaseAddress = "http://localhost:8080/";
public const string OpenInsightApplicationProgrammingInterface = "https://oi-prod-ec-api.mes.infineon.com/api/oiWizard";
private long? _TickOffset;
#if NETFRAMEWORK && NET48
private readonly HttpSelfHostServer? _HttpSelfHostServer;
#endif
public FileRead(ISMTP smtp, Dictionary<string, string> fileParameter, string cellInstanceName, int? connectionCount, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList<ModelObjectParameterDefinition> modelObjectParameters, string equipmentDictionaryName, Dictionary<string, List<long>> dummyRuns, Dictionary<long, List<string>> staticRuns, bool useCyclicalForDescription, bool isEAFHosted) :
base(new Description(), false, smtp, fileParameter, cellInstanceName, connectionCount, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted: connectionCount is null)
@ -39,32 +29,6 @@ public class FileRead : Shared.FileRead, IFileRead
throw new Exception(cellInstanceConnectionName);
if (_IsDuplicator)
throw new Exception(cellInstanceConnectionName);
string barcodeHostFileShare = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "Barcode.Host.FileShare");
if (barcodeHostFileShare != TIBCO.FileRead.BarcodeHostFileShare)
throw new NotSupportedException($"Update configuration for [{nameof(TIBCO.FileRead.BarcodeHostFileShare)}]");
string httpSelfHostConfigurationBaseAddress = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "Http.Self.Host.Configuration.Base.Address");
if (httpSelfHostConfigurationBaseAddress != HttpSelfHostConfigurationBaseAddress)
throw new NotSupportedException($"Update configuration for [{nameof(HttpSelfHostConfigurationBaseAddress)}]");
string lsl2SQLConnectionString = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "ConnectionString.LSL2SQL");
if (lsl2SQLConnectionString != TIBCO.FileRead.LSL2SQLConnectionString)
throw new NotSupportedException($"Update configuration for [{nameof(TIBCO.FileRead.LSL2SQLConnectionString)}]");
string metrologyFileShare = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "Metrology.FileShare");
if (metrologyFileShare != TIBCO.FileRead.MetrologyFileShare)
throw new NotSupportedException($"Update configuration for [{nameof(TIBCO.FileRead.MetrologyFileShare)}]");
string openInsightApplicationProgrammingInterface = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "OpenInsight.Application.Programming.Interface");
if (openInsightApplicationProgrammingInterface != OpenInsightApplicationProgrammingInterface)
throw new NotSupportedException($"Update configuration for [{nameof(OpenInsightApplicationProgrammingInterface)}]");
#if NETFRAMEWORK && NET48
if (!_IsEAFHosted)
_HttpSelfHostServer = null;
else
{
HttpSelfHostConfiguration config = new(httpSelfHostConfigurationBaseAddress);
_ = config.Routes.MapHttpRoute("API Default", "api/{controller}/{id}", new { id = RouteParameter.Optional });
_HttpSelfHostServer = new(config);
_HttpSelfHostServer.OpenAsync().Wait();
}
#endif
}
#nullable disable