Ready to test v2.39.0
This commit is contained in:
parent
199eb8567a
commit
b97d7ebdb3
13
Adaptation/.vscode/settings.json
vendored
Normal file
13
Adaptation/.vscode/settings.json
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"cSpell.words": [
|
||||||
|
"BIORAD",
|
||||||
|
"CICN",
|
||||||
|
"EQPT",
|
||||||
|
"Hmmssffff",
|
||||||
|
"ipdsf",
|
||||||
|
"ISMTP",
|
||||||
|
"messa",
|
||||||
|
"PDSF",
|
||||||
|
"THFTIRQS"
|
||||||
|
]
|
||||||
|
}
|
@ -1,6 +1,5 @@
|
|||||||
namespace Adaptation.Eaf.Core
|
namespace Adaptation.Eaf.Core;
|
||||||
{
|
|
||||||
public class BackboneComponent
|
public class BackboneComponent
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,6 +1,5 @@
|
|||||||
namespace Adaptation.Eaf.Core
|
namespace Adaptation.Eaf.Core;
|
||||||
{
|
|
||||||
public class BackboneStatusCache
|
public class BackboneStatusCache
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,6 +1,5 @@
|
|||||||
namespace Adaptation.Eaf.Core
|
namespace Adaptation.Eaf.Core;
|
||||||
{
|
|
||||||
public interface ILoggingSetupManager
|
public interface ILoggingSetupManager
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,6 +1,5 @@
|
|||||||
namespace Adaptation.Eaf.Core
|
namespace Adaptation.Eaf.Core;
|
||||||
{
|
|
||||||
public class StatusItem
|
public class StatusItem
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
|
@ -2,8 +2,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Adaptation.Eaf.Core
|
namespace Adaptation.Eaf.Core;
|
||||||
{
|
|
||||||
public class Backbone
|
public class Backbone
|
||||||
{
|
{
|
||||||
public const string STATE_ERROR = "Error";
|
public const string STATE_ERROR = "Error";
|
||||||
@ -30,12 +30,12 @@ namespace Adaptation.Eaf.Core
|
|||||||
protected Dictionary<string, BackboneComponent> BackboneComponents { get; }
|
protected Dictionary<string, BackboneComponent> BackboneComponents { get; }
|
||||||
|
|
||||||
public void AddBackboneComponent(BackboneComponent backboneComponent) { }
|
public void AddBackboneComponent(BackboneComponent backboneComponent) { }
|
||||||
public bool ContainsBackboneComponent(string id) { throw new NotImplementedException(); }
|
public bool ContainsBackboneComponent(string id) => throw new NotImplementedException();
|
||||||
[Obsolete("Use the capabilities exposed via the Status property -> GetAll. Will be removed with next major release.")]
|
[Obsolete("Use the capabilities exposed via the Status property -> GetAll. Will be removed with next major release.")]
|
||||||
public List<StatusItem> GetAllStatuses() { throw new NotImplementedException(); }
|
public List<StatusItem> GetAllStatuses() => throw new NotImplementedException();
|
||||||
public BackboneComponent GetBackboneComponentById(string id) { throw new NotImplementedException(); }
|
public BackboneComponent GetBackboneComponentById(string id) => throw new NotImplementedException();
|
||||||
public List<T> GetBackboneComponentsOfType<T>() { throw new NotImplementedException(); }
|
public List<T> GetBackboneComponentsOfType<T>() => throw new NotImplementedException();
|
||||||
public List<BackboneComponent> GetBackboneComponentsOfType(Type type) { throw new NotImplementedException(); }
|
public List<BackboneComponent> GetBackboneComponentsOfType(Type type) => throw new NotImplementedException();
|
||||||
public void RegisterSubprocess(int pid) { }
|
public void RegisterSubprocess(int pid) { }
|
||||||
[Obsolete("Use the capabilities exposed via the Status property -> SetValue. Will be removed with next major release.")]
|
[Obsolete("Use the capabilities exposed via the Status property -> SetValue. Will be removed with next major release.")]
|
||||||
public void SetStatus(string statusName, string statusValue) { }
|
public void SetStatus(string statusName, string statusValue) { }
|
||||||
@ -45,4 +45,3 @@ namespace Adaptation.Eaf.Core
|
|||||||
protected virtual void StopAllComponents() { }
|
protected virtual void StopAllComponents() { }
|
||||||
protected void StopComponents(List<BackboneComponent> components) { }
|
protected void StopComponents(List<BackboneComponent> components) { }
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,7 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Adaptation.Eaf.Core.Smtp
|
namespace Adaptation.Eaf.Core.Smtp;
|
||||||
{
|
|
||||||
|
|
||||||
public class EmailMessage
|
public class EmailMessage
|
||||||
{
|
{
|
||||||
@ -12,13 +11,11 @@ namespace Adaptation.Eaf.Core.Smtp
|
|||||||
public MailPriority Priority { get; }
|
public MailPriority Priority { get; }
|
||||||
public string Subject { get; }
|
public string Subject { get; }
|
||||||
|
|
||||||
public EmailMessage PriorityHigh() { throw new NotImplementedException(); }
|
public EmailMessage PriorityHigh() => throw new NotImplementedException();
|
||||||
public EmailMessage PriorityLow() { throw new NotImplementedException(); }
|
public EmailMessage PriorityLow() => throw new NotImplementedException();
|
||||||
public EmailMessage PriorityNormal() { throw new NotImplementedException(); }
|
public EmailMessage PriorityNormal() => throw new NotImplementedException();
|
||||||
public EmailMessage SetBody(string body) { throw new NotImplementedException(); }
|
public EmailMessage SetBody(string body) => throw new NotImplementedException();
|
||||||
public EmailMessage SetPriority(MailPriority priority) { throw new NotImplementedException(); }
|
public EmailMessage SetPriority(MailPriority priority) => throw new NotImplementedException();
|
||||||
public EmailMessage SetSubject(string subject) { throw new NotImplementedException(); }
|
public EmailMessage SetSubject(string subject) => throw new NotImplementedException();
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
@ -1,9 +1,6 @@
|
|||||||
namespace Adaptation.Eaf.Core.Smtp
|
namespace Adaptation.Eaf.Core.Smtp;
|
||||||
{
|
|
||||||
|
|
||||||
public interface ISmtp
|
public interface ISmtp
|
||||||
{
|
{
|
||||||
void Send(EmailMessage message);
|
void Send(EmailMessage message);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
@ -1,5 +1,4 @@
|
|||||||
namespace Adaptation.Eaf.Core.Smtp
|
namespace Adaptation.Eaf.Core.Smtp;
|
||||||
{
|
|
||||||
|
|
||||||
public enum MailPriority
|
public enum MailPriority
|
||||||
{
|
{
|
||||||
@ -7,5 +6,3 @@
|
|||||||
Normal = 1,
|
Normal = 1,
|
||||||
High = 2
|
High = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
@ -1,6 +1,5 @@
|
|||||||
namespace Adaptation.Eaf.EquipmentCore.Control
|
namespace Adaptation.Eaf.EquipmentCore.Control;
|
||||||
{
|
|
||||||
public class ChangeDataCollectionHandler
|
public class ChangeDataCollectionHandler
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,6 +1,5 @@
|
|||||||
namespace Adaptation.Eaf.EquipmentCore.Control
|
namespace Adaptation.Eaf.EquipmentCore.Control;
|
||||||
{
|
|
||||||
public class DataCollectionRequest
|
public class DataCollectionRequest
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,6 +1,5 @@
|
|||||||
namespace Adaptation.Eaf.EquipmentCore.Control
|
namespace Adaptation.Eaf.EquipmentCore.Control;
|
||||||
{
|
|
||||||
public class EquipmentEvent
|
public class EquipmentEvent
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,6 +1,5 @@
|
|||||||
namespace Adaptation.Eaf.EquipmentCore.Control
|
namespace Adaptation.Eaf.EquipmentCore.Control;
|
||||||
{
|
|
||||||
public class EquipmentException
|
public class EquipmentException
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,6 +1,5 @@
|
|||||||
namespace Adaptation.Eaf.EquipmentCore.Control
|
namespace Adaptation.Eaf.EquipmentCore.Control;
|
||||||
{
|
|
||||||
public class EquipmentSelfDescription
|
public class EquipmentSelfDescription
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,6 +1,5 @@
|
|||||||
namespace Adaptation.Eaf.EquipmentCore.Control
|
namespace Adaptation.Eaf.EquipmentCore.Control;
|
||||||
{
|
|
||||||
public class GetParameterValuesHandler
|
public class GetParameterValuesHandler
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,6 +1,5 @@
|
|||||||
namespace Adaptation.Eaf.EquipmentCore.Control
|
namespace Adaptation.Eaf.EquipmentCore.Control;
|
||||||
{
|
|
||||||
public interface IConnectionControl
|
public interface IConnectionControl
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,6 +1,5 @@
|
|||||||
namespace Adaptation.Eaf.EquipmentCore.Control
|
namespace Adaptation.Eaf.EquipmentCore.Control;
|
||||||
{
|
|
||||||
public interface IDataTracingHandler
|
public interface IDataTracingHandler
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,6 +1,5 @@
|
|||||||
namespace Adaptation.Eaf.EquipmentCore.Control
|
namespace Adaptation.Eaf.EquipmentCore.Control;
|
||||||
{
|
|
||||||
public interface IEquipmentCommandService
|
public interface IEquipmentCommandService
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,7 +1,7 @@
|
|||||||
using Adaptation.PeerGroup.GCL.Annotations;
|
using Adaptation.PeerGroup.GCL.Annotations;
|
||||||
|
|
||||||
namespace Adaptation.Eaf.EquipmentCore.Control
|
namespace Adaptation.Eaf.EquipmentCore.Control;
|
||||||
{
|
|
||||||
public interface IEquipmentControl : IPackageSource
|
public interface IEquipmentControl : IPackageSource
|
||||||
{
|
{
|
||||||
[NotNull]
|
[NotNull]
|
||||||
@ -13,4 +13,3 @@ namespace Adaptation.Eaf.EquipmentCore.Control
|
|||||||
[NotNull]
|
[NotNull]
|
||||||
IConnectionControl Connection { get; }
|
IConnectionControl Connection { get; }
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,6 +1,5 @@
|
|||||||
namespace Adaptation.Eaf.EquipmentCore.Control
|
namespace Adaptation.Eaf.EquipmentCore.Control;
|
||||||
{
|
|
||||||
public interface IEquipmentSelfDescriptionBuilder
|
public interface IEquipmentSelfDescriptionBuilder
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,6 +1,5 @@
|
|||||||
namespace Adaptation.Eaf.EquipmentCore.Control
|
namespace Adaptation.Eaf.EquipmentCore.Control;
|
||||||
{
|
|
||||||
public interface IPackage
|
public interface IPackage
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,6 +1,5 @@
|
|||||||
namespace Adaptation.Eaf.EquipmentCore.Control
|
namespace Adaptation.Eaf.EquipmentCore.Control;
|
||||||
{
|
|
||||||
public interface ISelfDescriptionLookup
|
public interface ISelfDescriptionLookup
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,6 +1,5 @@
|
|||||||
namespace Adaptation.Eaf.EquipmentCore.Control
|
namespace Adaptation.Eaf.EquipmentCore.Control;
|
||||||
{
|
|
||||||
public interface IVirtualParameterValuesHandler
|
public interface IVirtualParameterValuesHandler
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,6 +1,5 @@
|
|||||||
namespace Adaptation.Eaf.EquipmentCore.Control
|
namespace Adaptation.Eaf.EquipmentCore.Control;
|
||||||
{
|
|
||||||
public class SetParameterValuesHandler
|
public class SetParameterValuesHandler
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,6 +1,5 @@
|
|||||||
namespace Adaptation.Eaf.EquipmentCore.Control
|
namespace Adaptation.Eaf.EquipmentCore.Control;
|
||||||
{
|
|
||||||
public class TraceRequest
|
public class TraceRequest
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
|
@ -3,8 +3,8 @@ using Adaptation.Eaf.EquipmentCore.SelfDescription.ElementDescription;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Adaptation.Eaf.EquipmentCore.Control
|
namespace Adaptation.Eaf.EquipmentCore.Control;
|
||||||
{
|
|
||||||
public interface IEquipmentDataCollection
|
public interface IEquipmentDataCollection
|
||||||
{
|
{
|
||||||
IVirtualParameterValuesHandler VirtualParameterValuesHandler { get; }
|
IVirtualParameterValuesHandler VirtualParameterValuesHandler { get; }
|
||||||
@ -36,4 +36,3 @@ namespace Adaptation.Eaf.EquipmentCore.Control
|
|||||||
void TriggerTraceSample(TraceRequest traceRequest, long sampleId, IEnumerable<ParameterValue> parameters, IPackage sourcePackage);
|
void TriggerTraceSample(TraceRequest traceRequest, long sampleId, IEnumerable<ParameterValue> parameters, IPackage sourcePackage);
|
||||||
void TriggerTraceSample(TraceRequest traceRequest, long sampleId, IEnumerable<ParameterValue> parameters, DateTime equipmentTimeStamp);
|
void TriggerTraceSample(TraceRequest traceRequest, long sampleId, IEnumerable<ParameterValue> parameters, DateTime equipmentTimeStamp);
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,6 +1,5 @@
|
|||||||
namespace Adaptation.Eaf.EquipmentCore.Control
|
namespace Adaptation.Eaf.EquipmentCore.Control;
|
||||||
{
|
|
||||||
public interface IPackageSource
|
public interface IPackageSource
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
|
@ -2,8 +2,8 @@
|
|||||||
using Adaptation.PeerGroup.GCL.Annotations;
|
using Adaptation.PeerGroup.GCL.Annotations;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Adaptation.Eaf.EquipmentCore.DataCollection.Reporting
|
namespace Adaptation.Eaf.EquipmentCore.DataCollection.Reporting;
|
||||||
{
|
|
||||||
public class ParameterValue
|
public class ParameterValue
|
||||||
{
|
{
|
||||||
public ParameterValue(EquipmentParameter definition, object value) { }
|
public ParameterValue(EquipmentParameter definition, object value) { }
|
||||||
@ -14,7 +14,6 @@ namespace Adaptation.Eaf.EquipmentCore.DataCollection.Reporting
|
|||||||
public EquipmentParameter Definition { get; }
|
public EquipmentParameter Definition { get; }
|
||||||
public DateTime Timestamp { get; protected set; }
|
public DateTime Timestamp { get; protected set; }
|
||||||
|
|
||||||
public virtual ParameterValue Clone(EquipmentParameter newDefinition) { throw new NotImplementedException(); }
|
public virtual ParameterValue Clone(EquipmentParameter newDefinition) => throw new NotImplementedException();
|
||||||
public override string ToString() { return base.ToString(); }
|
public override string ToString() => base.ToString();
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,7 +1,7 @@
|
|||||||
using Adaptation.Eaf.EquipmentCore.SelfDescription.ParameterTypes;
|
using Adaptation.Eaf.EquipmentCore.SelfDescription.ParameterTypes;
|
||||||
|
|
||||||
namespace Adaptation.Eaf.EquipmentCore.SelfDescription.ElementDescription
|
namespace Adaptation.Eaf.EquipmentCore.SelfDescription.ElementDescription;
|
||||||
{
|
|
||||||
public class EquipmentParameter
|
public class EquipmentParameter
|
||||||
{
|
{
|
||||||
public EquipmentParameter(EquipmentParameter source, ParameterTypeDefinition typeDefinition) { }
|
public EquipmentParameter(EquipmentParameter source, ParameterTypeDefinition typeDefinition) { }
|
||||||
@ -17,8 +17,6 @@ namespace Adaptation.Eaf.EquipmentCore.SelfDescription.ElementDescription
|
|||||||
public bool IsTransient { get; }
|
public bool IsTransient { get; }
|
||||||
public bool IsReadOnly { get; }
|
public bool IsReadOnly { get; }
|
||||||
|
|
||||||
public override string ToString() { return base.ToString(); }
|
public override string ToString() => base.ToString();
|
||||||
public string ToStringWithDetails() { return base.ToString(); }
|
public string ToStringWithDetails() => base.ToString();
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
@ -1,5 +1,5 @@
|
|||||||
namespace Adaptation.Eaf.EquipmentCore.SelfDescription.ParameterTypes
|
namespace Adaptation.Eaf.EquipmentCore.SelfDescription.ParameterTypes;
|
||||||
{
|
|
||||||
public class Field
|
public class Field
|
||||||
{
|
{
|
||||||
public Field(string name, string description, bool canBeNull, ParameterTypeDefinition typeDefinition) { }
|
public Field(string name, string description, bool canBeNull, ParameterTypeDefinition typeDefinition) { }
|
||||||
@ -9,4 +9,3 @@
|
|||||||
public ParameterTypeDefinition TypeDefinition { get; }
|
public ParameterTypeDefinition TypeDefinition { get; }
|
||||||
public bool CanBeNull { get; }
|
public bool CanBeNull { get; }
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,5 +1,5 @@
|
|||||||
namespace Adaptation.Eaf.EquipmentCore.SelfDescription.ParameterTypes
|
namespace Adaptation.Eaf.EquipmentCore.SelfDescription.ParameterTypes;
|
||||||
{
|
|
||||||
public abstract class ParameterTypeDefinition
|
public abstract class ParameterTypeDefinition
|
||||||
{
|
{
|
||||||
public ParameterTypeDefinition(string name, string description) { }
|
public ParameterTypeDefinition(string name, string description) { }
|
||||||
@ -7,6 +7,5 @@
|
|||||||
public string Name { get; }
|
public string Name { get; }
|
||||||
public string Description { get; }
|
public string Description { get; }
|
||||||
|
|
||||||
public override string ToString() { return base.ToString(); }
|
public override string ToString() => base.ToString();
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,7 +1,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Adaptation.Eaf.EquipmentCore.SelfDescription.ParameterTypes
|
namespace Adaptation.Eaf.EquipmentCore.SelfDescription.ParameterTypes;
|
||||||
{
|
|
||||||
public class StructuredType : ParameterTypeDefinition
|
public class StructuredType : ParameterTypeDefinition
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -9,4 +9,3 @@ namespace Adaptation.Eaf.EquipmentCore.SelfDescription.ParameterTypes
|
|||||||
|
|
||||||
public IList<Field> Fields { get; }
|
public IList<Field> Fields { get; }
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,6 +1,5 @@
|
|||||||
namespace Adaptation.Eaf.Management.ConfigurationData.CellAutomation
|
namespace Adaptation.Eaf.Management.ConfigurationData.CellAutomation;
|
||||||
{
|
|
||||||
public interface IConfigurationObject
|
public interface IConfigurationObject
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Adaptation.Eaf.Management.ConfigurationData.CellAutomation
|
namespace Adaptation.Eaf.Management.ConfigurationData.CellAutomation;
|
||||||
{
|
|
||||||
[System.Runtime.Serialization.DataContractAttribute(IsReference = true)]
|
[System.Runtime.Serialization.DataContractAttribute(IsReference = true)]
|
||||||
public class ModelObjectParameterDefinition : IConfigurationObject
|
public class ModelObjectParameterDefinition : IConfigurationObject
|
||||||
{
|
{
|
||||||
@ -20,7 +20,6 @@ namespace Adaptation.Eaf.Management.ConfigurationData.CellAutomation
|
|||||||
[System.Runtime.Serialization.DataMemberAttribute]
|
[System.Runtime.Serialization.DataMemberAttribute]
|
||||||
public virtual string EnumType { get; set; }
|
public virtual string EnumType { get; set; }
|
||||||
|
|
||||||
public virtual ModelObjectParameterDefinition Clone() { return null; }
|
public virtual ModelObjectParameterDefinition Clone() => null;
|
||||||
public virtual bool IsValidValue(string value) { return false; }
|
public virtual bool IsValidValue(string value) => false;
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,5 +1,5 @@
|
|||||||
namespace Adaptation.Eaf.Management.ConfigurationData.CellAutomation
|
namespace Adaptation.Eaf.Management.ConfigurationData.CellAutomation;
|
||||||
{
|
|
||||||
public enum ModelObjectParameterType
|
public enum ModelObjectParameterType
|
||||||
{
|
{
|
||||||
String = 0,
|
String = 0,
|
||||||
@ -14,4 +14,3 @@
|
|||||||
Float = 9,
|
Float = 9,
|
||||||
Enum = 10
|
Enum = 10
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,8 +1,8 @@
|
|||||||
using Adaptation.PeerGroup.GCL.SecsDriver;
|
using Adaptation.PeerGroup.GCL.SecsDriver;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Adaptation.Eaf.Management.ConfigurationData.Semiconductor.CellInstances
|
namespace Adaptation.Eaf.Management.ConfigurationData.Semiconductor.CellInstances;
|
||||||
{
|
|
||||||
[System.Runtime.Serialization.DataContractAttribute]
|
[System.Runtime.Serialization.DataContractAttribute]
|
||||||
public class SecsConnectionConfiguration
|
public class SecsConnectionConfiguration
|
||||||
{
|
{
|
||||||
@ -41,4 +41,3 @@ namespace Adaptation.Eaf.Management.ConfigurationData.Semiconductor.CellInstance
|
|||||||
[System.Runtime.Serialization.DataMemberAttribute]
|
[System.Runtime.Serialization.DataMemberAttribute]
|
||||||
public virtual TimeSpan T8NetworkIntercharacter { get; set; }
|
public virtual TimeSpan T8NetworkIntercharacter { get; set; }
|
||||||
}
|
}
|
||||||
}
|
|
141
Adaptation/FileHandlers/Archive/FileRead.cs
Normal file
141
Adaptation/FileHandlers/Archive/FileRead.cs
Normal file
@ -0,0 +1,141 @@
|
|||||||
|
using Adaptation.Eaf.Management.ConfigurationData.CellAutomation;
|
||||||
|
using Adaptation.Ifx.Eaf.EquipmentConnector.File.Configuration;
|
||||||
|
using Adaptation.Shared;
|
||||||
|
using Adaptation.Shared.Duplicator;
|
||||||
|
using Adaptation.Shared.Methods;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text.Json;
|
||||||
|
|
||||||
|
namespace Adaptation.FileHandlers.Archive;
|
||||||
|
|
||||||
|
public class FileRead : Shared.FileRead, IFileRead
|
||||||
|
{
|
||||||
|
|
||||||
|
public FileRead(ISMTP smtp, Dictionary<string, string> fileParameter, string cellInstanceName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList<ModelObjectParameterDefinition> modelObjectParameters, string equipmentDictionaryName, Dictionary<string, List<long>> dummyRuns, bool useCyclicalForDescription, bool isEAFHosted) :
|
||||||
|
base(new Description(), false, smtp, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, useCyclicalForDescription, isEAFHosted)
|
||||||
|
{
|
||||||
|
_MinFileLength = 10;
|
||||||
|
_NullData = string.Empty;
|
||||||
|
_Logistics = new Logistics(this);
|
||||||
|
if (_FileParameter is null)
|
||||||
|
throw new Exception(cellInstanceConnectionName);
|
||||||
|
if (_ModelObjectParameterDefinitions is null)
|
||||||
|
throw new Exception(cellInstanceConnectionName);
|
||||||
|
if (!_IsDuplicator)
|
||||||
|
throw new Exception(cellInstanceConnectionName);
|
||||||
|
}
|
||||||
|
|
||||||
|
void IFileRead.Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, Exception exception) => Move(extractResults, exception);
|
||||||
|
|
||||||
|
void IFileRead.WaitForThread() => WaitForThread(thread: null, threadExceptions: null);
|
||||||
|
|
||||||
|
string IFileRead.GetEventDescription()
|
||||||
|
{
|
||||||
|
string result = _Description.GetEventDescription();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> IFileRead.GetHeaderNames()
|
||||||
|
{
|
||||||
|
List<string> results = _Description.GetHeaderNames();
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
|
string[] IFileRead.Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, string to, string from, string resolvedFileLocation, Exception exception)
|
||||||
|
{
|
||||||
|
string[] results = Move(extractResults, to, from, resolvedFileLocation, exception);
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
|
JsonProperty[] IFileRead.GetDefault()
|
||||||
|
{
|
||||||
|
JsonProperty[] results = _Description.GetDefault(this, _Logistics);
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
|
Dictionary<string, string> IFileRead.GetDisplayNamesJsonElement()
|
||||||
|
{
|
||||||
|
Dictionary<string, string> results = _Description.GetDisplayNamesJsonElement(this);
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<IDescription> IFileRead.GetDescriptions(IFileRead fileRead, List<Test> tests, IProcessData processData)
|
||||||
|
{
|
||||||
|
List<IDescription> results = _Description.GetDescriptions(fileRead, _Logistics, tests, processData);
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
|
Tuple<string, Test[], JsonElement[], List<FileInfo>> IFileRead.GetExtractResult(string reportFullPath, string eventName)
|
||||||
|
{
|
||||||
|
Tuple<string, Test[], JsonElement[], List<FileInfo>> results;
|
||||||
|
if (string.IsNullOrEmpty(eventName))
|
||||||
|
throw new Exception();
|
||||||
|
_ReportFullPath = reportFullPath;
|
||||||
|
DateTime dateTime = DateTime.Now;
|
||||||
|
results = GetExtractResult(reportFullPath, dateTime);
|
||||||
|
if (results.Item3 is null)
|
||||||
|
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(results.Item1, Array.Empty<Test>(), JsonSerializer.Deserialize<JsonElement[]>("[]"), results.Item4);
|
||||||
|
if (results.Item3.Length > 0 && _IsEAFHosted)
|
||||||
|
WritePDSF(this, results.Item3);
|
||||||
|
UpdateLastTicksDuration(DateTime.Now.Ticks - dateTime.Ticks);
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
|
Tuple<string, Test[], JsonElement[], List<FileInfo>> IFileRead.ReExtract()
|
||||||
|
{
|
||||||
|
Tuple<string, Test[], JsonElement[], List<FileInfo>> results;
|
||||||
|
List<string> headerNames = _Description.GetHeaderNames();
|
||||||
|
Dictionary<string, string> keyValuePairs = _Description.GetDisplayNamesJsonElement(this);
|
||||||
|
results = ReExtract(this, headerNames, keyValuePairs);
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
|
void IFileRead.CheckTests(Test[] tests, bool extra)
|
||||||
|
{
|
||||||
|
if (_Description is not Description)
|
||||||
|
throw new Exception();
|
||||||
|
}
|
||||||
|
|
||||||
|
void IFileRead.Callback(object state) => throw new Exception(string.Concat("Not ", nameof(_IsDuplicator)));
|
||||||
|
|
||||||
|
private void MoveArchive(DateTime dateTime)
|
||||||
|
{
|
||||||
|
if (dateTime == DateTime.MinValue)
|
||||||
|
{ }
|
||||||
|
string logisticsSequence = _Logistics.Sequence.ToString();
|
||||||
|
string weekOfYear = _Calendar.GetWeekOfYear(_Logistics.DateTimeFromSequence, CalendarWeekRule.FirstDay, DayOfWeek.Sunday).ToString("00");
|
||||||
|
string weekDirectory = string.Concat(_Logistics.DateTimeFromSequence.ToString("yyyy"), "_Week_", weekOfYear, @"\", _Logistics.DateTimeFromSequence.ToString("yyyy-MM-dd"));
|
||||||
|
string jobIdDirectory = string.Concat(_FileConnectorConfiguration.TargetFileLocation, @"\", _Logistics.JobID);
|
||||||
|
if (!Directory.Exists(jobIdDirectory))
|
||||||
|
_ = Directory.CreateDirectory(jobIdDirectory);
|
||||||
|
//string destinationArchiveDirectory = string.Concat(jobIdDirectory, @"\!Archive\", weekDirectory);
|
||||||
|
string destinationArchiveDirectory = string.Concat(Path.GetDirectoryName(_FileConnectorConfiguration.TargetFileLocation), @"\Archive\", _Logistics.JobID, @"\", weekDirectory);
|
||||||
|
if (!Directory.Exists(destinationArchiveDirectory))
|
||||||
|
_ = Directory.CreateDirectory(destinationArchiveDirectory);
|
||||||
|
string[] matchDirectories = new string[] { GetDirectoriesRecursively(jobIdDirectory, logisticsSequence).FirstOrDefault() };
|
||||||
|
if ((matchDirectories is null) || matchDirectories.Length != 1)
|
||||||
|
throw new Exception("Didn't find directory by logistics sequence");
|
||||||
|
string sourceDirectory = Path.GetDirectoryName(matchDirectories[0]);
|
||||||
|
destinationArchiveDirectory = string.Concat(destinationArchiveDirectory, @"\", Path.GetFileName(sourceDirectory));
|
||||||
|
Directory.Move(sourceDirectory, destinationArchiveDirectory);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, DateTime dateTime)
|
||||||
|
{
|
||||||
|
Tuple<string, Test[], JsonElement[], List<FileInfo>> results;
|
||||||
|
Tuple<string, string[], string[]> pdsf = ProcessDataStandardFormat.GetLogisticsColumnsAndBody(reportFullPath);
|
||||||
|
_Logistics = new Logistics(reportFullPath, pdsf.Item1);
|
||||||
|
SetFileParameterLotIDToLogisticsMID();
|
||||||
|
JsonElement[] jsonElements = ProcessDataStandardFormat.GetArray(pdsf);
|
||||||
|
List<Shared.Properties.IDescription> descriptions = GetDuplicatorDescriptions(jsonElements);
|
||||||
|
Tuple<Test[], Dictionary<Test, List<Shared.Properties.IDescription>>> tuple = GetTuple(this, descriptions, extra: false);
|
||||||
|
MoveArchive(dateTime);
|
||||||
|
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(pdsf.Item1, tuple.Item1, jsonElements, new List<FileInfo>());
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -4,8 +4,7 @@ using Adaptation.Shared.Methods;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Adaptation.FileHandlers
|
namespace Adaptation.FileHandlers;
|
||||||
{
|
|
||||||
|
|
||||||
public class CellInstanceConnectionName
|
public class CellInstanceConnectionName
|
||||||
{
|
{
|
||||||
@ -13,16 +12,24 @@ namespace Adaptation.FileHandlers
|
|||||||
internal static IFileRead Get(ISMTP smtp, Dictionary<string, string> fileParameter, string cellInstanceName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList<ModelObjectParameterDefinition> modelObjectParameters, string equipmentDictionaryName, Dictionary<string, List<long>> dummyRuns, bool useCyclicalForDescription, bool isEAFHosted)
|
internal static IFileRead Get(ISMTP smtp, Dictionary<string, string> fileParameter, string cellInstanceName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList<ModelObjectParameterDefinition> modelObjectParameters, string equipmentDictionaryName, Dictionary<string, List<long>> dummyRuns, bool useCyclicalForDescription, bool isEAFHosted)
|
||||||
{
|
{
|
||||||
IFileRead result;
|
IFileRead result;
|
||||||
int levelIsArchive = 7;
|
|
||||||
int levelIsXToArchive = 6;
|
|
||||||
bool isDuplicator = cellInstanceConnectionName.StartsWith(cellInstanceName);
|
bool isDuplicator = cellInstanceConnectionName.StartsWith(cellInstanceName);
|
||||||
if (isDuplicator)
|
if (isDuplicator)
|
||||||
result = new MET08THFTIRQS408M.FileRead(smtp, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, useCyclicalForDescription, isEAFHosted, levelIsXToArchive, levelIsArchive);
|
{
|
||||||
|
string cellInstanceConnectionNameBase = cellInstanceConnectionName.Replace("-", string.Empty);
|
||||||
|
int hyphens = cellInstanceConnectionName.Length - cellInstanceConnectionNameBase.Length;
|
||||||
|
result = hyphens switch
|
||||||
|
{
|
||||||
|
(int)MET08THFTIRQS408M.Hyphen.IsArchive => new Archive.FileRead(smtp, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, useCyclicalForDescription, isEAFHosted),
|
||||||
|
(int)MET08THFTIRQS408M.Hyphen.IsDummy => new Dummy.FileRead(smtp, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, useCyclicalForDescription, isEAFHosted),
|
||||||
|
(int)MET08THFTIRQS408M.Hyphen.IsXToArchive => new ToArchive.FileRead(smtp, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, useCyclicalForDescription, isEAFHosted),
|
||||||
|
_ => new MET08THFTIRQS408M.FileRead(smtp, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, useCyclicalForDescription, isEAFHosted)
|
||||||
|
};
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
result = cellInstanceConnectionName switch
|
result = cellInstanceConnectionName switch
|
||||||
{
|
{
|
||||||
nameof(QS408M) => new QS408M.FileRead(smtp, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, useCyclicalForDescription, isEAFHosted, levelIsXToArchive, levelIsArchive),
|
nameof(QS408M) => new QS408M.FileRead(smtp, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, useCyclicalForDescription, isEAFHosted),
|
||||||
_ => throw new Exception(),
|
_ => throw new Exception(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -30,5 +37,3 @@ namespace Adaptation.FileHandlers
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
308
Adaptation/FileHandlers/Dummy/FileRead.cs
Normal file
308
Adaptation/FileHandlers/Dummy/FileRead.cs
Normal file
@ -0,0 +1,308 @@
|
|||||||
|
using Adaptation.Eaf.Management.ConfigurationData.CellAutomation;
|
||||||
|
using Adaptation.Ifx.Eaf.EquipmentConnector.File.Configuration;
|
||||||
|
using Adaptation.Shared;
|
||||||
|
using Adaptation.Shared.Duplicator;
|
||||||
|
using Adaptation.Shared.Methods;
|
||||||
|
using Infineon.Monitoring.MonA;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.IO;
|
||||||
|
using System.IO.Compression;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text.Json;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
|
namespace Adaptation.FileHandlers.Dummy;
|
||||||
|
|
||||||
|
public class FileRead : Shared.FileRead, IFileRead
|
||||||
|
{
|
||||||
|
|
||||||
|
private readonly Timer _Timer;
|
||||||
|
private int _LastDummyRunIndex;
|
||||||
|
private readonly string[] _CellNames;
|
||||||
|
|
||||||
|
public FileRead(ISMTP smtp, Dictionary<string, string> fileParameter, string cellInstanceName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList<ModelObjectParameterDefinition> modelObjectParameters, string equipmentDictionaryName, Dictionary<string, List<long>> dummyRuns, bool useCyclicalForDescription, bool isEAFHosted) :
|
||||||
|
base(new Description(), false, smtp, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, useCyclicalForDescription, isEAFHosted)
|
||||||
|
{
|
||||||
|
_MinFileLength = 10;
|
||||||
|
_NullData = string.Empty;
|
||||||
|
_Logistics = new Logistics(this);
|
||||||
|
if (_FileParameter is null)
|
||||||
|
throw new Exception(cellInstanceConnectionName);
|
||||||
|
if (_ModelObjectParameterDefinitions is null)
|
||||||
|
throw new Exception(cellInstanceConnectionName);
|
||||||
|
if (!_IsDuplicator)
|
||||||
|
throw new Exception(cellInstanceConnectionName);
|
||||||
|
_LastDummyRunIndex = -1;
|
||||||
|
List<string> cellNames = new();
|
||||||
|
_Timer = new Timer(Callback, null, Timeout.Infinite, Timeout.Infinite);
|
||||||
|
ModelObjectParameterDefinition[] cellInstanceCollection = GetProperties(cellInstanceConnectionName, modelObjectParameters, "CellInstance.", ".Alias");
|
||||||
|
foreach (ModelObjectParameterDefinition modelObjectParameterDefinition in cellInstanceCollection)
|
||||||
|
cellNames.Add(modelObjectParameterDefinition.Name.Split('.')[1]);
|
||||||
|
_CellNames = cellNames.ToArray();
|
||||||
|
if (Debugger.IsAttached || fileConnectorConfiguration.PreProcessingMode == FileConnectorConfiguration.PreProcessingModeEnum.Process)
|
||||||
|
Callback(null);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TimeSpan timeSpan = new(DateTime.Now.AddSeconds(_FileConnectorConfiguration.FileScanningIntervalInSeconds.Value).Ticks - DateTime.Now.Ticks);
|
||||||
|
_ = _Timer.Change((long)timeSpan.TotalMilliseconds, Timeout.Infinite);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void IFileRead.Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, Exception exception) => Move(extractResults, exception);
|
||||||
|
|
||||||
|
void IFileRead.WaitForThread() => WaitForThread(thread: null, threadExceptions: null);
|
||||||
|
|
||||||
|
string IFileRead.GetEventDescription()
|
||||||
|
{
|
||||||
|
string result = _Description.GetEventDescription();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> IFileRead.GetHeaderNames()
|
||||||
|
{
|
||||||
|
List<string> results = _Description.GetHeaderNames();
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
|
string[] IFileRead.Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, string to, string from, string resolvedFileLocation, Exception exception)
|
||||||
|
{
|
||||||
|
string[] results = Move(extractResults, to, from, resolvedFileLocation, exception);
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
|
JsonProperty[] IFileRead.GetDefault()
|
||||||
|
{
|
||||||
|
JsonProperty[] results = _Description.GetDefault(this, _Logistics);
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
|
Dictionary<string, string> IFileRead.GetDisplayNamesJsonElement()
|
||||||
|
{
|
||||||
|
Dictionary<string, string> results = _Description.GetDisplayNamesJsonElement(this);
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<IDescription> IFileRead.GetDescriptions(IFileRead fileRead, List<Test> tests, IProcessData processData)
|
||||||
|
{
|
||||||
|
List<IDescription> results = _Description.GetDescriptions(fileRead, _Logistics, tests, processData);
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
|
Tuple<string, Test[], JsonElement[], List<FileInfo>> IFileRead.GetExtractResult(string reportFullPath, string eventName) => throw new Exception(string.Concat("See ", nameof(CallbackFileExists)));
|
||||||
|
|
||||||
|
Tuple<string, Test[], JsonElement[], List<FileInfo>> IFileRead.ReExtract() => throw new Exception(string.Concat("See ", nameof(CallbackFileExists)));
|
||||||
|
|
||||||
|
void IFileRead.CheckTests(Test[] tests, bool extra)
|
||||||
|
{
|
||||||
|
if (_Description is not Description)
|
||||||
|
throw new Exception();
|
||||||
|
}
|
||||||
|
|
||||||
|
void IFileRead.Callback(object state) => Callback(state);
|
||||||
|
|
||||||
|
private void CallbackInProcessCleared(string sourceArchiveFile, string traceDummyFile, string targetFileLocation, string monARessource, string inProcessDirectory, long sequence, bool warning)
|
||||||
|
{
|
||||||
|
const string site = "sjc";
|
||||||
|
string stateName = string.Concat("Dummy_", _EventName);
|
||||||
|
const string monInURL = "http://moninhttp.sjc.infineon.com/input/text";
|
||||||
|
MonIn monIn = MonIn.GetInstance(monInURL);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (warning)
|
||||||
|
{
|
||||||
|
File.AppendAllLines(traceDummyFile, new string[] { site, monARessource, stateName, State.Warning.ToString() });
|
||||||
|
_ = monIn.SendStatus(site, monARessource, stateName, State.Warning);
|
||||||
|
for (int i = 1; i < 12; i++)
|
||||||
|
Thread.Sleep(500);
|
||||||
|
}
|
||||||
|
ZipFile.ExtractToDirectory(sourceArchiveFile, inProcessDirectory);
|
||||||
|
string[] files = Directory.GetFiles(inProcessDirectory, "*", SearchOption.TopDirectoryOnly);
|
||||||
|
if (files.Length > 250)
|
||||||
|
throw new Exception("Safety net!");
|
||||||
|
foreach (string file in files)
|
||||||
|
File.SetLastWriteTime(file, new DateTime(sequence));
|
||||||
|
if (!_FileConnectorConfiguration.IncludeSubDirectories.Value)
|
||||||
|
{
|
||||||
|
foreach (string file in files)
|
||||||
|
File.Move(file, Path.Combine(targetFileLocation, Path.GetFileName(file)));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string[] directories = Directory.GetDirectories(inProcessDirectory, "*", SearchOption.AllDirectories);
|
||||||
|
foreach (string directory in directories)
|
||||||
|
_ = Directory.CreateDirectory(string.Concat(targetFileLocation, directory.Substring(inProcessDirectory.Length)));
|
||||||
|
foreach (string file in files)
|
||||||
|
File.Move(file, string.Concat(targetFileLocation, file.Substring(inProcessDirectory.Length)));
|
||||||
|
}
|
||||||
|
File.AppendAllLines(traceDummyFile, new string[] { site, monARessource, stateName, State.Ok.ToString() });
|
||||||
|
_ = monIn.SendStatus(site, monARessource, stateName, State.Ok);
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
string subject = string.Concat("Exception:", _CellInstanceConnectionName);
|
||||||
|
string body = string.Concat(exception.Message, Environment.NewLine, Environment.NewLine, exception.StackTrace);
|
||||||
|
try
|
||||||
|
{ _SMTP.SendHighPriorityEmailMessage(subject, body); }
|
||||||
|
catch (Exception) { }
|
||||||
|
File.AppendAllLines(traceDummyFile, new string[] { site, monARessource, stateName, State.Critical.ToString(), exception.Message, exception.StackTrace });
|
||||||
|
_ = monIn.SendStatus(site, monARessource, stateName, State.Critical);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CallbackFileExists(string sourceArchiveFile, string traceDummyFile, string targetFileLocation, string monARessource, long sequence)
|
||||||
|
{
|
||||||
|
string[] files;
|
||||||
|
bool warning = false;
|
||||||
|
if (!_DummyRuns.ContainsKey(monARessource))
|
||||||
|
_DummyRuns.Add(monARessource, new List<long>());
|
||||||
|
if (!_DummyRuns[monARessource].Contains(sequence))
|
||||||
|
_DummyRuns[monARessource].Add(sequence);
|
||||||
|
File.AppendAllLines(traceDummyFile, new string[] { sourceArchiveFile });
|
||||||
|
string inProcessDirectory = Path.Combine(_ProgressPath, "Dummy In-Process", sequence.ToString());
|
||||||
|
if (!Directory.Exists(inProcessDirectory))
|
||||||
|
_ = Directory.CreateDirectory(inProcessDirectory);
|
||||||
|
files = Directory.GetFiles(inProcessDirectory, "*", SearchOption.AllDirectories);
|
||||||
|
if (files.Any())
|
||||||
|
{
|
||||||
|
if (files.Length > 250)
|
||||||
|
throw new Exception("Safety net!");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
foreach (string file in files)
|
||||||
|
File.Delete(file);
|
||||||
|
}
|
||||||
|
catch (Exception) { }
|
||||||
|
}
|
||||||
|
if (_FileConnectorConfiguration.IncludeSubDirectories.Value)
|
||||||
|
files = Directory.GetFiles(targetFileLocation, "*", SearchOption.AllDirectories);
|
||||||
|
else
|
||||||
|
files = Directory.GetFiles(targetFileLocation, "*", SearchOption.TopDirectoryOnly);
|
||||||
|
foreach (string file in files)
|
||||||
|
{
|
||||||
|
if (new FileInfo(file).LastWriteTime.Ticks == sequence)
|
||||||
|
{
|
||||||
|
warning = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CallbackInProcessCleared(sourceArchiveFile, traceDummyFile, targetFileLocation, monARessource, inProcessDirectory, sequence, warning);
|
||||||
|
}
|
||||||
|
|
||||||
|
private string GetCellName(string pathSegment)
|
||||||
|
{
|
||||||
|
string result = string.Empty;
|
||||||
|
foreach (string cellName in _CellNames)
|
||||||
|
{
|
||||||
|
if (pathSegment.ToLower().Contains(cellName.ToLower()))
|
||||||
|
{
|
||||||
|
result = cellName;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (string.IsNullOrEmpty(result))
|
||||||
|
{
|
||||||
|
int count;
|
||||||
|
List<(string CellName, int Count)> cellNames = new();
|
||||||
|
foreach (string cellName in _CellNames)
|
||||||
|
{
|
||||||
|
count = 0;
|
||||||
|
foreach (char @char in cellName.ToLower())
|
||||||
|
count += pathSegment.Length - pathSegment.ToLower().Replace(@char.ToString(), string.Empty).Length;
|
||||||
|
cellNames.Add(new(cellName, count));
|
||||||
|
}
|
||||||
|
result = (from l in cellNames orderby l.CellName.Length, l.Count descending select l.CellName).First();
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Callback(object state)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string pathSegment;
|
||||||
|
string monARessource;
|
||||||
|
DateTime dateTime = DateTime.Now;
|
||||||
|
if (!_FileConnectorConfiguration.TargetFileLocation.Contains(_FileConnectorConfiguration.SourceFileLocation))
|
||||||
|
throw new Exception("Target must start with source");
|
||||||
|
bool check = (dateTime.Hour > 7 && dateTime.Hour < 18 && dateTime.DayOfWeek != DayOfWeek.Sunday && dateTime.DayOfWeek != DayOfWeek.Saturday);
|
||||||
|
if (!_IsEAFHosted || check)
|
||||||
|
{
|
||||||
|
string checkSegment;
|
||||||
|
string checkDirectory;
|
||||||
|
string sourceFileFilter;
|
||||||
|
string sourceArchiveFile;
|
||||||
|
string sourceFileLocation;
|
||||||
|
string weekOfYear = _Calendar.GetWeekOfYear(dateTime, CalendarWeekRule.FirstDay, DayOfWeek.Sunday).ToString("00");
|
||||||
|
string traceDummyDirectory = Path.Combine(Path.GetPathRoot(_TracePath), "TracesDummy", _CellInstanceName, "Source", $"{dateTime:yyyy}___Week_{weekOfYear}");
|
||||||
|
if (!Directory.Exists(traceDummyDirectory))
|
||||||
|
_ = Directory.CreateDirectory(traceDummyDirectory);
|
||||||
|
string traceDummyFile = Path.Combine(traceDummyDirectory, $"{dateTime.Ticks} - {_CellInstanceName}.txt");
|
||||||
|
File.AppendAllText(traceDummyFile, string.Empty);
|
||||||
|
if (_FileConnectorConfiguration.SourceFileLocation.EndsWith("\\"))
|
||||||
|
sourceFileLocation = _FileConnectorConfiguration.SourceFileLocation;
|
||||||
|
else
|
||||||
|
sourceFileLocation = string.Concat(_FileConnectorConfiguration.SourceFileLocation, '\\');
|
||||||
|
for (int i = 0; i < _FileConnectorConfiguration.SourceFileFilters.Count; i++)
|
||||||
|
{
|
||||||
|
_LastDummyRunIndex += 1;
|
||||||
|
if (_LastDummyRunIndex >= _FileConnectorConfiguration.SourceFileFilters.Count)
|
||||||
|
_LastDummyRunIndex = 0;
|
||||||
|
sourceFileFilter = _FileConnectorConfiguration.SourceFileFilters[_LastDummyRunIndex];
|
||||||
|
sourceArchiveFile = Path.GetFullPath(string.Concat(sourceFileLocation, sourceFileFilter));
|
||||||
|
if (File.Exists(sourceArchiveFile))
|
||||||
|
{
|
||||||
|
checkSegment = _FileConnectorConfiguration.TargetFileLocation.Substring(sourceFileLocation.Length);
|
||||||
|
checkDirectory = Path.GetDirectoryName(sourceArchiveFile);
|
||||||
|
for (int z = 0; z < int.MaxValue; z++)
|
||||||
|
{
|
||||||
|
if (checkDirectory.Length < sourceFileLocation.Length || !checkDirectory.StartsWith(sourceFileLocation))
|
||||||
|
break;
|
||||||
|
checkDirectory = Path.GetDirectoryName(checkDirectory);
|
||||||
|
if (Directory.Exists(Path.Combine(checkDirectory, checkSegment)))
|
||||||
|
{
|
||||||
|
checkDirectory = Path.Combine(checkDirectory, checkSegment);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!checkDirectory.EndsWith(checkSegment))
|
||||||
|
throw new Exception("Could not determine dummy target directory for extract!");
|
||||||
|
if (!long.TryParse(Path.GetFileNameWithoutExtension(sourceArchiveFile).Replace("x", string.Empty), out long sequence))
|
||||||
|
throw new Exception("Invalid file name for source archive file!");
|
||||||
|
pathSegment = checkDirectory.Substring(sourceFileLocation.Length);
|
||||||
|
monARessource = GetCellName(pathSegment);
|
||||||
|
if (string.IsNullOrEmpty(monARessource))
|
||||||
|
throw new Exception("Could not determine which cell archive file is associated with!");
|
||||||
|
if (_IsEAFHosted)
|
||||||
|
CallbackFileExists(sourceArchiveFile, traceDummyFile, checkDirectory, monARessource, sequence);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
string subject = string.Concat("Exception:", _CellInstanceConnectionName);
|
||||||
|
string body = string.Concat(exception.Message, Environment.NewLine, Environment.NewLine, exception.StackTrace);
|
||||||
|
try
|
||||||
|
{ _SMTP.SendHighPriorityEmailMessage(subject, body); }
|
||||||
|
catch (Exception) { }
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
TimeSpan timeSpan = new(DateTime.Now.AddSeconds(_FileConnectorConfiguration.FileScanningIntervalInSeconds.Value).Ticks - DateTime.Now.Ticks);
|
||||||
|
_ = _Timer.Change((long)timeSpan.TotalMilliseconds, Timeout.Infinite);
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
string subject = string.Concat("Exception:", _CellInstanceConnectionName);
|
||||||
|
string body = string.Concat(exception.Message, Environment.NewLine, Environment.NewLine, exception.StackTrace);
|
||||||
|
try
|
||||||
|
{ _SMTP.SendHighPriorityEmailMessage(subject, body); }
|
||||||
|
catch (Exception) { }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -16,8 +16,7 @@ using System.Text.Json;
|
|||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
namespace Adaptation.FileHandlers.MET08THFTIRQS408M
|
namespace Adaptation.FileHandlers.MET08THFTIRQS408M;
|
||||||
{
|
|
||||||
|
|
||||||
public class FileRead : Shared.FileRead, IFileRead
|
public class FileRead : Shared.FileRead, IFileRead
|
||||||
{
|
{
|
||||||
@ -39,8 +38,8 @@ namespace Adaptation.FileHandlers.MET08THFTIRQS408M
|
|||||||
private readonly int _HyphenIsXToOpenInsightMetrologyViewer;
|
private readonly int _HyphenIsXToOpenInsightMetrologyViewer;
|
||||||
private readonly int _HyphenIsXToOpenInsightMetrologyViewerAttachments;
|
private readonly int _HyphenIsXToOpenInsightMetrologyViewerAttachments;
|
||||||
|
|
||||||
public FileRead(ISMTP smtp, Dictionary<string, string> fileParameter, string cellInstanceName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList<ModelObjectParameterDefinition> modelObjectParameters, string equipmentDictionaryName, Dictionary<string, List<long>> dummyRuns, bool useCyclicalForDescription, bool isEAFHosted, int hyphenXToArchive, int hyphenIsArchive) :
|
public FileRead(ISMTP smtp, Dictionary<string, string> fileParameter, string cellInstanceName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList<ModelObjectParameterDefinition> modelObjectParameters, string equipmentDictionaryName, Dictionary<string, List<long>> dummyRuns, bool useCyclicalForDescription, bool isEAFHosted) :
|
||||||
base(new Description(), false, smtp, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, useCyclicalForDescription, isEAFHosted, hyphenXToArchive, hyphenIsArchive)
|
base(new Description(), false, smtp, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, useCyclicalForDescription, isEAFHosted)
|
||||||
{
|
{
|
||||||
_MinFileLength = 10;
|
_MinFileLength = 10;
|
||||||
_NullData = string.Empty;
|
_NullData = string.Empty;
|
||||||
@ -51,10 +50,6 @@ namespace Adaptation.FileHandlers.MET08THFTIRQS408M
|
|||||||
throw new Exception(cellInstanceConnectionName);
|
throw new Exception(cellInstanceConnectionName);
|
||||||
if (!_IsDuplicator)
|
if (!_IsDuplicator)
|
||||||
throw new Exception(cellInstanceConnectionName);
|
throw new Exception(cellInstanceConnectionName);
|
||||||
if (hyphenIsArchive != (int)Hyphen.IsArchive)
|
|
||||||
throw new Exception(cellInstanceConnectionName);
|
|
||||||
if (hyphenXToArchive != (int)Hyphen.IsXToArchive)
|
|
||||||
throw new Exception(cellInstanceConnectionName);
|
|
||||||
_LastDummyRunIndex = -1;
|
_LastDummyRunIndex = -1;
|
||||||
if (_HyphenIsNaEDA == 0)
|
if (_HyphenIsNaEDA == 0)
|
||||||
{ }
|
{ }
|
||||||
@ -96,15 +91,9 @@ namespace Adaptation.FileHandlers.MET08THFTIRQS408M
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IFileRead.Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, Exception exception)
|
void IFileRead.Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, Exception exception) => Move(extractResults, exception);
|
||||||
{
|
|
||||||
Move(this, extractResults, exception);
|
|
||||||
}
|
|
||||||
|
|
||||||
void IFileRead.WaitForThread()
|
void IFileRead.WaitForThread() => WaitForThread(thread: null, threadExceptions: null);
|
||||||
{
|
|
||||||
WaitForThread(thread: null, threadExceptions: null);
|
|
||||||
}
|
|
||||||
|
|
||||||
string IFileRead.GetEventDescription()
|
string IFileRead.GetEventDescription()
|
||||||
{
|
{
|
||||||
@ -151,7 +140,7 @@ namespace Adaptation.FileHandlers.MET08THFTIRQS408M
|
|||||||
DateTime dateTime = DateTime.Now;
|
DateTime dateTime = DateTime.Now;
|
||||||
results = GetExtractResult(reportFullPath, dateTime);
|
results = GetExtractResult(reportFullPath, dateTime);
|
||||||
if (results.Item3 is null)
|
if (results.Item3 is null)
|
||||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(results.Item1, new Test[] { }, JsonSerializer.Deserialize<JsonElement[]>("[]"), results.Item4);
|
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(results.Item1, Array.Empty<Test>(), JsonSerializer.Deserialize<JsonElement[]>("[]"), results.Item4);
|
||||||
if (results.Item3.Length > 0 && _IsEAFHosted)
|
if (results.Item3.Length > 0 && _IsEAFHosted)
|
||||||
WritePDSF(this, results.Item3);
|
WritePDSF(this, results.Item3);
|
||||||
UpdateLastTicksDuration(DateTime.Now.Ticks - dateTime.Ticks);
|
UpdateLastTicksDuration(DateTime.Now.Ticks - dateTime.Ticks);
|
||||||
@ -169,34 +158,11 @@ namespace Adaptation.FileHandlers.MET08THFTIRQS408M
|
|||||||
|
|
||||||
void IFileRead.CheckTests(Test[] tests, bool extra)
|
void IFileRead.CheckTests(Test[] tests, bool extra)
|
||||||
{
|
{
|
||||||
if (!(_Description is Description))
|
if (_Description is not Description)
|
||||||
throw new Exception();
|
throw new Exception();
|
||||||
}
|
}
|
||||||
|
|
||||||
void IFileRead.Callback(object state)
|
void IFileRead.Callback(object state) => Callback(state);
|
||||||
{
|
|
||||||
Callback(state);
|
|
||||||
}
|
|
||||||
|
|
||||||
void IFileRead.MoveArchive()
|
|
||||||
{
|
|
||||||
string logisticsSequence = _Logistics.Sequence.ToString();
|
|
||||||
string weekOfYear = _Calendar.GetWeekOfYear(_Logistics.DateTimeFromSequence, CalendarWeekRule.FirstDay, DayOfWeek.Sunday).ToString("00");
|
|
||||||
string weekDirectory = string.Concat(_Logistics.DateTimeFromSequence.ToString("yyyy"), "_Week_", weekOfYear, @"\", _Logistics.DateTimeFromSequence.ToString("yyyy-MM-dd"));
|
|
||||||
string jobIdDirectory = string.Concat(_FileConnectorConfiguration.TargetFileLocation, @"\", _Logistics.JobID);
|
|
||||||
if (!Directory.Exists(jobIdDirectory))
|
|
||||||
Directory.CreateDirectory(jobIdDirectory);
|
|
||||||
//string destinationArchiveDirectory = string.Concat(jobIdDirectory, @"\!Archive\", weekDirectory);
|
|
||||||
string destinationArchiveDirectory = string.Concat(Path.GetDirectoryName(_FileConnectorConfiguration.TargetFileLocation), @"\Archive\", _Logistics.JobID, @"\", weekDirectory);
|
|
||||||
if (!Directory.Exists(destinationArchiveDirectory))
|
|
||||||
Directory.CreateDirectory(destinationArchiveDirectory);
|
|
||||||
string[] matchDirectories = new string[] { GetDirectoriesRecursively(jobIdDirectory, logisticsSequence).FirstOrDefault() };
|
|
||||||
if ((matchDirectories is null) || matchDirectories.Length != 1)
|
|
||||||
throw new Exception("Didn't find directory by logistics sequence");
|
|
||||||
string sourceDirectory = Path.GetDirectoryName(matchDirectories[0]);
|
|
||||||
destinationArchiveDirectory = string.Concat(destinationArchiveDirectory, @"\", Path.GetFileName(sourceDirectory));
|
|
||||||
Directory.Move(sourceDirectory, destinationArchiveDirectory);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected List<QS408M.Description> GetDescriptions(JsonElement[] jsonElements)
|
protected List<QS408M.Description> GetDescriptions(JsonElement[] jsonElements)
|
||||||
{
|
{
|
||||||
@ -240,11 +206,11 @@ namespace Adaptation.FileHandlers.MET08THFTIRQS408M
|
|||||||
if (segments.Length > 2)
|
if (segments.Length > 2)
|
||||||
duplicateDirectory = string.Concat(duplicateDirectory, @"-", segments[2]);
|
duplicateDirectory = string.Concat(duplicateDirectory, @"-", segments[2]);
|
||||||
if (!Directory.Exists(duplicateDirectory))
|
if (!Directory.Exists(duplicateDirectory))
|
||||||
Directory.CreateDirectory(duplicateDirectory);
|
_ = Directory.CreateDirectory(duplicateDirectory);
|
||||||
if ((isDummyRun || isNotUsedInsightMetrologyViewerAttachments || _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0) && _Hyphens != _HyphenIsXToArchive && _Hyphens != _HyphenIsArchive)
|
if ((isDummyRun || isNotUsedInsightMetrologyViewerAttachments || _FileConnectorConfiguration.FileScanningIntervalInSeconds > 0))
|
||||||
{
|
{
|
||||||
if (!Directory.Exists(duplicateDirectory))
|
if (!Directory.Exists(duplicateDirectory))
|
||||||
Directory.CreateDirectory(duplicateDirectory);
|
_ = Directory.CreateDirectory(duplicateDirectory);
|
||||||
string successDirectory;
|
string successDirectory;
|
||||||
if (_Hyphens != _HyphenIsXToAPC)
|
if (_Hyphens != _HyphenIsXToAPC)
|
||||||
successDirectory = string.Empty;
|
successDirectory = string.Empty;
|
||||||
@ -252,7 +218,7 @@ namespace Adaptation.FileHandlers.MET08THFTIRQS408M
|
|||||||
{
|
{
|
||||||
successDirectory = string.Concat(Path.GetDirectoryName(_FileConnectorConfiguration.TargetFileLocation), @"\ViewerPath");
|
successDirectory = string.Concat(Path.GetDirectoryName(_FileConnectorConfiguration.TargetFileLocation), @"\ViewerPath");
|
||||||
if (!Directory.Exists(successDirectory))
|
if (!Directory.Exists(successDirectory))
|
||||||
Directory.CreateDirectory(successDirectory);
|
_ = Directory.CreateDirectory(successDirectory);
|
||||||
}
|
}
|
||||||
List<Tuple<Shared.Properties.IScopeInfo, string>> tuples = new();
|
List<Tuple<Shared.Properties.IScopeInfo, string>> tuples = new();
|
||||||
string duplicateFile = string.Concat(duplicateDirectory, @"\", Path.GetFileName(reportFullPath));
|
string duplicateFile = string.Concat(duplicateDirectory, @"\", Path.GetFileName(reportFullPath));
|
||||||
@ -260,7 +226,7 @@ namespace Adaptation.FileHandlers.MET08THFTIRQS408M
|
|||||||
string weekDirectory = string.Concat(_Logistics.DateTimeFromSequence.ToString("yyyy"), "_Week_", weekOfYear, @"\", _Logistics.DateTimeFromSequence.ToString("yyyy-MM-dd"));
|
string weekDirectory = string.Concat(_Logistics.DateTimeFromSequence.ToString("yyyy"), "_Week_", weekOfYear, @"\", _Logistics.DateTimeFromSequence.ToString("yyyy-MM-dd"));
|
||||||
string logisticsSequenceMemoryDirectory = string.Concat(_MemoryPath, @"\", _EquipmentType, @"\Source\", weekDirectory, @"\", _Logistics.Sequence);
|
string logisticsSequenceMemoryDirectory = string.Concat(_MemoryPath, @"\", _EquipmentType, @"\Source\", weekDirectory, @"\", _Logistics.Sequence);
|
||||||
if (!Directory.Exists(logisticsSequenceMemoryDirectory))
|
if (!Directory.Exists(logisticsSequenceMemoryDirectory))
|
||||||
Directory.CreateDirectory(logisticsSequenceMemoryDirectory);
|
_ = Directory.CreateDirectory(logisticsSequenceMemoryDirectory);
|
||||||
if (_Hyphens == _HyphenIsXToAPC)
|
if (_Hyphens == _HyphenIsXToAPC)
|
||||||
{
|
{
|
||||||
if (!isDummyRun && _IsEAFHosted)
|
if (!isDummyRun && _IsEAFHosted)
|
||||||
@ -318,7 +284,7 @@ namespace Adaptation.FileHandlers.MET08THFTIRQS408M
|
|||||||
File.SetLastWriteTime(reportFullPath, fileInfo.CreationTime);
|
File.SetLastWriteTime(reportFullPath, fileInfo.CreationTime);
|
||||||
string jobIdDirectory = string.Concat(Path.GetDirectoryName(Path.GetDirectoryName(_FileConnectorConfiguration.TargetFileLocation)), @"\", _Logistics.JobID);
|
string jobIdDirectory = string.Concat(Path.GetDirectoryName(Path.GetDirectoryName(_FileConnectorConfiguration.TargetFileLocation)), @"\", _Logistics.JobID);
|
||||||
if (!Directory.Exists(jobIdDirectory))
|
if (!Directory.Exists(jobIdDirectory))
|
||||||
Directory.CreateDirectory(jobIdDirectory);
|
_ = Directory.CreateDirectory(jobIdDirectory);
|
||||||
string[] matchDirectories;
|
string[] matchDirectories;
|
||||||
if (!_IsEAFHosted)
|
if (!_IsEAFHosted)
|
||||||
matchDirectories = new string[] { Path.GetDirectoryName(Path.GetDirectoryName(reportFullPath)) };
|
matchDirectories = new string[] { Path.GetDirectoryName(Path.GetDirectoryName(reportFullPath)) };
|
||||||
@ -372,7 +338,7 @@ namespace Adaptation.FileHandlers.MET08THFTIRQS408M
|
|||||||
if (fileCount > 0 || string.IsNullOrEmpty(checkDirectory))
|
if (fileCount > 0 || string.IsNullOrEmpty(checkDirectory))
|
||||||
{
|
{
|
||||||
File.AppendAllLines(traceDummyFile, new string[] { site, monARessource, stateName, State.Warning.ToString() });
|
File.AppendAllLines(traceDummyFile, new string[] { site, monARessource, stateName, State.Warning.ToString() });
|
||||||
monIn.SendStatus(site, monARessource, stateName, State.Warning);
|
_ = monIn.SendStatus(site, monARessource, stateName, State.Warning);
|
||||||
for (int i = 1; i < 12; i++)
|
for (int i = 1; i < 12; i++)
|
||||||
Thread.Sleep(500);
|
Thread.Sleep(500);
|
||||||
}
|
}
|
||||||
@ -411,12 +377,12 @@ namespace Adaptation.FileHandlers.MET08THFTIRQS408M
|
|||||||
{
|
{
|
||||||
string[] directories = Directory.GetDirectories(inProcessDirectory, "*", SearchOption.AllDirectories);
|
string[] directories = Directory.GetDirectories(inProcessDirectory, "*", SearchOption.AllDirectories);
|
||||||
foreach (string directory in directories)
|
foreach (string directory in directories)
|
||||||
Directory.CreateDirectory(string.Concat(checkDirectory, directory.Substring(inProcessDirectory.Length)));
|
_ = Directory.CreateDirectory(string.Concat(checkDirectory, directory.Substring(inProcessDirectory.Length)));
|
||||||
foreach (string file in files)
|
foreach (string file in files)
|
||||||
File.Move(file, string.Concat(checkDirectory, file.Substring(inProcessDirectory.Length)));
|
File.Move(file, string.Concat(checkDirectory, file.Substring(inProcessDirectory.Length)));
|
||||||
}
|
}
|
||||||
File.AppendAllLines(traceDummyFile, new string[] { site, monARessource, stateName, State.Ok.ToString() });
|
File.AppendAllLines(traceDummyFile, new string[] { site, monARessource, stateName, State.Ok.ToString() });
|
||||||
monIn.SendStatus(site, monARessource, stateName, State.Ok);
|
_ = monIn.SendStatus(site, monARessource, stateName, State.Ok);
|
||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
@ -426,7 +392,7 @@ namespace Adaptation.FileHandlers.MET08THFTIRQS408M
|
|||||||
{ _SMTP.SendHighPriorityEmailMessage(subject, body); }
|
{ _SMTP.SendHighPriorityEmailMessage(subject, body); }
|
||||||
catch (Exception) { }
|
catch (Exception) { }
|
||||||
File.AppendAllLines(traceDummyFile, new string[] { site, monARessource, stateName, State.Critical.ToString(), exception.Message, exception.StackTrace });
|
File.AppendAllLines(traceDummyFile, new string[] { site, monARessource, stateName, State.Critical.ToString(), exception.Message, exception.StackTrace });
|
||||||
monIn.SendStatus(site, monARessource, stateName, State.Critical);
|
_ = monIn.SendStatus(site, monARessource, stateName, State.Critical);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -451,7 +417,7 @@ namespace Adaptation.FileHandlers.MET08THFTIRQS408M
|
|||||||
string weekOfYear = _Calendar.GetWeekOfYear(dateTime, CalendarWeekRule.FirstDay, DayOfWeek.Sunday).ToString("00");
|
string weekOfYear = _Calendar.GetWeekOfYear(dateTime, CalendarWeekRule.FirstDay, DayOfWeek.Sunday).ToString("00");
|
||||||
string traceDummyDirectory = string.Concat(Path.GetPathRoot(_TracePath), @"\TracesDummy\", _CellInstanceName, @"\Source\", dateTime.ToString("yyyy"), "___Week_", weekOfYear);
|
string traceDummyDirectory = string.Concat(Path.GetPathRoot(_TracePath), @"\TracesDummy\", _CellInstanceName, @"\Source\", dateTime.ToString("yyyy"), "___Week_", weekOfYear);
|
||||||
if (!Directory.Exists(traceDummyDirectory))
|
if (!Directory.Exists(traceDummyDirectory))
|
||||||
Directory.CreateDirectory(traceDummyDirectory);
|
_ = Directory.CreateDirectory(traceDummyDirectory);
|
||||||
string traceDummyFile = string.Concat(traceDummyDirectory, @"\", dateTime.Ticks, " - ", _CellInstanceName, ".txt");
|
string traceDummyFile = string.Concat(traceDummyDirectory, @"\", dateTime.Ticks, " - ", _CellInstanceName, ".txt");
|
||||||
File.AppendAllText(traceDummyFile, string.Empty);
|
File.AppendAllText(traceDummyFile, string.Empty);
|
||||||
List<Tuple<string, string, string, string, int>> tuples = new();
|
List<Tuple<string, string, string, string, int>> tuples = new();
|
||||||
@ -498,7 +464,7 @@ namespace Adaptation.FileHandlers.MET08THFTIRQS408M
|
|||||||
inProcessDirectory = string.Concat(progressDirectory, @"\Dummy_in process\", sequence);
|
inProcessDirectory = string.Concat(progressDirectory, @"\Dummy_in process\", sequence);
|
||||||
checkDirectory = inProcessDirectory;
|
checkDirectory = inProcessDirectory;
|
||||||
if (!Directory.Exists(checkDirectory))
|
if (!Directory.Exists(checkDirectory))
|
||||||
Directory.CreateDirectory(checkDirectory);
|
_ = Directory.CreateDirectory(checkDirectory);
|
||||||
files = Directory.GetFiles(checkDirectory, "*", SearchOption.AllDirectories);
|
files = Directory.GetFiles(checkDirectory, "*", SearchOption.AllDirectories);
|
||||||
fileCount = files.Length;
|
fileCount = files.Length;
|
||||||
if (files.Any())
|
if (files.Any())
|
||||||
@ -535,7 +501,7 @@ namespace Adaptation.FileHandlers.MET08THFTIRQS408M
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
TimeSpan timeSpan = new(DateTime.Now.AddSeconds(_FileConnectorConfiguration.FileScanningIntervalInSeconds.Value).Ticks - DateTime.Now.Ticks);
|
TimeSpan timeSpan = new(DateTime.Now.AddSeconds(_FileConnectorConfiguration.FileScanningIntervalInSeconds.Value).Ticks - DateTime.Now.Ticks);
|
||||||
_Timer.Change((long)timeSpan.TotalMilliseconds, Timeout.Infinite);
|
_ = _Timer.Change((long)timeSpan.TotalMilliseconds, Timeout.Infinite);
|
||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
@ -548,5 +514,3 @@ namespace Adaptation.FileHandlers.MET08THFTIRQS408M
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
@ -1,5 +1,4 @@
|
|||||||
namespace Adaptation.FileHandlers.MET08THFTIRQS408M
|
namespace Adaptation.FileHandlers.MET08THFTIRQS408M;
|
||||||
{
|
|
||||||
|
|
||||||
public enum Hyphen
|
public enum Hyphen
|
||||||
{
|
{
|
||||||
@ -14,5 +13,3 @@
|
|||||||
IsDummy,
|
IsDummy,
|
||||||
IsNaEDA
|
IsNaEDA
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
@ -4,8 +4,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Adaptation.FileHandlers.MET08THFTIRQS408M
|
namespace Adaptation.FileHandlers.MET08THFTIRQS408M;
|
||||||
{
|
|
||||||
|
|
||||||
public class ProcessData
|
public class ProcessData
|
||||||
{
|
{
|
||||||
@ -33,7 +32,7 @@ namespace Adaptation.FileHandlers.MET08THFTIRQS408M
|
|||||||
if (logistics is null)
|
if (logistics is null)
|
||||||
{ }
|
{ }
|
||||||
QS408M.Description x = descriptions[0];
|
QS408M.Description x = descriptions[0];
|
||||||
results.Append(x.UniqueId).Append(del).
|
_ = results.Append(x.UniqueId).Append(del).
|
||||||
Append(x.Date).Append(del).
|
Append(x.Date).Append(del).
|
||||||
Append(x.Employee).Append(del).
|
Append(x.Employee).Append(del).
|
||||||
Append(x.Recipe).Append(del).
|
Append(x.Recipe).Append(del).
|
||||||
@ -68,5 +67,3 @@ namespace Adaptation.FileHandlers.MET08THFTIRQS408M
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
@ -4,8 +4,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace Adaptation.FileHandlers.MET08THFTIRQS408M
|
namespace Adaptation.FileHandlers.MET08THFTIRQS408M;
|
||||||
{
|
|
||||||
|
|
||||||
public class WSRequest
|
public class WSRequest
|
||||||
{
|
{
|
||||||
@ -85,5 +84,3 @@ namespace Adaptation.FileHandlers.MET08THFTIRQS408M
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
@ -5,13 +5,11 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
|
||||||
namespace Adaptation.FileHandlers.QS408M
|
namespace Adaptation.FileHandlers.QS408M;
|
||||||
{
|
|
||||||
|
|
||||||
public class Description : IDescription, Shared.Properties.IDescription
|
public class Description : IDescription, Shared.Properties.IDescription
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
public int Test { get; set; }
|
public int Test { get; set; }
|
||||||
public int Count { get; set; }
|
public int Count { get; set; }
|
||||||
public int Index { get; set; }
|
public int Index { get; set; }
|
||||||
@ -48,10 +46,7 @@ namespace Adaptation.FileHandlers.QS408M
|
|||||||
public string StdDev { get; set; }
|
public string StdDev { get; set; }
|
||||||
public string Thickness { get; set; }
|
public string Thickness { get; set; }
|
||||||
|
|
||||||
string IDescription.GetEventDescription()
|
string IDescription.GetEventDescription() => "File Has been read and parsed";
|
||||||
{
|
|
||||||
return "File Has been read and parsed";
|
|
||||||
}
|
|
||||||
|
|
||||||
List<string> IDescription.GetNames(IFileRead fileRead, Logistics logistics)
|
List<string> IDescription.GetNames(IFileRead fileRead, Logistics logistics)
|
||||||
{
|
{
|
||||||
@ -272,5 +267,3 @@ namespace Adaptation.FileHandlers.QS408M
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
@ -1,5 +1,4 @@
|
|||||||
namespace Adaptation.FileHandlers.QS408M
|
namespace Adaptation.FileHandlers.QS408M;
|
||||||
{
|
|
||||||
|
|
||||||
public class Detail
|
public class Detail
|
||||||
{
|
{
|
||||||
@ -9,11 +8,6 @@ namespace Adaptation.FileHandlers.QS408M
|
|||||||
public string Thickness { get; set; }
|
public string Thickness { get; set; }
|
||||||
public string UniqueId { get; set; }
|
public string UniqueId { get; set; }
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString() => string.Concat(Position, ";", Thickness, ";");
|
||||||
{
|
|
||||||
return string.Concat(Position, ";", Thickness, ";");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
@ -9,8 +9,7 @@ using System.Linq;
|
|||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
namespace Adaptation.FileHandlers.QS408M
|
namespace Adaptation.FileHandlers.QS408M;
|
||||||
{
|
|
||||||
|
|
||||||
public class FileRead : Shared.FileRead, IFileRead
|
public class FileRead : Shared.FileRead, IFileRead
|
||||||
{
|
{
|
||||||
@ -18,8 +17,8 @@ namespace Adaptation.FileHandlers.QS408M
|
|||||||
private readonly string _OriginalDataBioRad;
|
private readonly string _OriginalDataBioRad;
|
||||||
private readonly ProcessData _LastProcessData;
|
private readonly ProcessData _LastProcessData;
|
||||||
|
|
||||||
public FileRead(ISMTP smtp, Dictionary<string, string> fileParameter, string cellInstanceName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList<ModelObjectParameterDefinition> modelObjectParameters, string equipmentDictionaryName, Dictionary<string, List<long>> dummyRuns, bool useCyclicalForDescription, bool isEAFHosted, int hyphenXToArchive, int hyphenIsArchive) :
|
public FileRead(ISMTP smtp, Dictionary<string, string> fileParameter, string cellInstanceName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList<ModelObjectParameterDefinition> modelObjectParameters, string equipmentDictionaryName, Dictionary<string, List<long>> dummyRuns, bool useCyclicalForDescription, bool isEAFHosted) :
|
||||||
base(new Description(), true, smtp, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, useCyclicalForDescription, isEAFHosted, hyphenXToArchive, hyphenIsArchive)
|
base(new Description(), true, smtp, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, useCyclicalForDescription, isEAFHosted)
|
||||||
{
|
{
|
||||||
_MinFileLength = 10;
|
_MinFileLength = 10;
|
||||||
_NullData = string.Empty;
|
_NullData = string.Empty;
|
||||||
@ -34,15 +33,9 @@ namespace Adaptation.FileHandlers.QS408M
|
|||||||
_LastProcessData = new();
|
_LastProcessData = new();
|
||||||
}
|
}
|
||||||
|
|
||||||
void IFileRead.Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, Exception exception)
|
void IFileRead.Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, Exception exception) => Move(extractResults, exception);
|
||||||
{
|
|
||||||
Move(this, extractResults, exception);
|
|
||||||
}
|
|
||||||
|
|
||||||
void IFileRead.WaitForThread()
|
void IFileRead.WaitForThread() => WaitForThread(thread: null, threadExceptions: null);
|
||||||
{
|
|
||||||
WaitForThread(thread: null, threadExceptions: null);
|
|
||||||
}
|
|
||||||
|
|
||||||
string IFileRead.GetEventDescription()
|
string IFileRead.GetEventDescription()
|
||||||
{
|
{
|
||||||
@ -89,7 +82,7 @@ namespace Adaptation.FileHandlers.QS408M
|
|||||||
DateTime dateTime = DateTime.Now;
|
DateTime dateTime = DateTime.Now;
|
||||||
results = GetExtractResult(reportFullPath, dateTime);
|
results = GetExtractResult(reportFullPath, dateTime);
|
||||||
if (results.Item3 is null)
|
if (results.Item3 is null)
|
||||||
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(results.Item1, new Test[] { }, JsonSerializer.Deserialize<JsonElement[]>("[]"), results.Item4);
|
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(results.Item1, Array.Empty<Test>(), JsonSerializer.Deserialize<JsonElement[]>("[]"), results.Item4);
|
||||||
if (results.Item3.Length > 0 && _IsEAFHosted)
|
if (results.Item3.Length > 0 && _IsEAFHosted)
|
||||||
WritePDSF(this, results.Item3);
|
WritePDSF(this, results.Item3);
|
||||||
UpdateLastTicksDuration(DateTime.Now.Ticks - dateTime.Ticks);
|
UpdateLastTicksDuration(DateTime.Now.Ticks - dateTime.Ticks);
|
||||||
@ -105,20 +98,9 @@ namespace Adaptation.FileHandlers.QS408M
|
|||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IFileRead.CheckTests(Test[] tests, bool extra)
|
void IFileRead.CheckTests(Test[] tests, bool extra) => throw new Exception(string.Concat("Not ", nameof(_IsDuplicator)));
|
||||||
{
|
|
||||||
throw new Exception(string.Concat("Not ", nameof(_IsDuplicator)));
|
|
||||||
}
|
|
||||||
|
|
||||||
void IFileRead.MoveArchive()
|
void IFileRead.Callback(object state) => throw new Exception(string.Concat("Not ", nameof(_IsDuplicator)));
|
||||||
{
|
|
||||||
throw new Exception(string.Concat("Not ", nameof(_IsDuplicator)));
|
|
||||||
}
|
|
||||||
|
|
||||||
void IFileRead.Callback(object state)
|
|
||||||
{
|
|
||||||
throw new Exception(string.Concat("Not ", nameof(_IsDuplicator)));
|
|
||||||
}
|
|
||||||
|
|
||||||
private Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, DateTime dateTime)
|
private Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, DateTime dateTime)
|
||||||
{
|
{
|
||||||
@ -146,5 +128,3 @@ namespace Adaptation.FileHandlers.QS408M
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
@ -11,8 +11,7 @@ using System.Text;
|
|||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
namespace Adaptation.FileHandlers.QS408M
|
namespace Adaptation.FileHandlers.QS408M;
|
||||||
{
|
|
||||||
|
|
||||||
public partial class ProcessData : IProcessData
|
public partial class ProcessData : IProcessData
|
||||||
{
|
{
|
||||||
@ -59,10 +58,7 @@ namespace Adaptation.FileHandlers.QS408M
|
|||||||
Parse(fileRead, logistics, fileInfoCollection, originalDataBioRad, lastProcessData);
|
Parse(fileRead, logistics, fileInfoCollection, originalDataBioRad, lastProcessData);
|
||||||
}
|
}
|
||||||
|
|
||||||
string IProcessData.GetCurrentReactor(IFileRead fileRead, Logistics logistics, Dictionary<string, string> reactors)
|
string IProcessData.GetCurrentReactor(IFileRead fileRead, Logistics logistics, Dictionary<string, string> reactors) => throw new Exception(string.Concat("See ", nameof(Parse)));
|
||||||
{
|
|
||||||
throw new Exception(string.Concat("See ", nameof(Parse)));
|
|
||||||
}
|
|
||||||
|
|
||||||
Tuple<string, Test[], JsonElement[], List<FileInfo>> IProcessData.GetResults(IFileRead fileRead, Logistics logistics, List<FileInfo> fileInfoCollection)
|
Tuple<string, Test[], JsonElement[], List<FileInfo>> IProcessData.GetResults(IFileRead fileRead, Logistics logistics, List<FileInfo> fileInfoCollection)
|
||||||
{
|
{
|
||||||
@ -300,8 +296,8 @@ namespace Adaptation.FileHandlers.QS408M
|
|||||||
ScanPast("wafer:");
|
ScanPast("wafer:");
|
||||||
}
|
}
|
||||||
Wafer = GetToEOL();
|
Wafer = GetToEOL();
|
||||||
GetToEOL();
|
_ = GetToEOL();
|
||||||
GetToEOL();
|
_ = GetToEOL();
|
||||||
string token = GetToken();
|
string token = GetToken();
|
||||||
int counter = 1;
|
int counter = 1;
|
||||||
while (true)
|
while (true)
|
||||||
@ -390,7 +386,7 @@ namespace Adaptation.FileHandlers.QS408M
|
|||||||
foreach (char c in Title)
|
foreach (char c in Title)
|
||||||
{
|
{
|
||||||
if (char.IsLetterOrDigit(c) || c == '-' || c == '.')
|
if (char.IsLetterOrDigit(c) || c == '-' || c == '.')
|
||||||
titleFixed.Append(c);
|
_ = titleFixed.Append(c);
|
||||||
}
|
}
|
||||||
Title = titleFixed.ToString();
|
Title = titleFixed.ToString();
|
||||||
|
|
||||||
@ -399,7 +395,7 @@ namespace Adaptation.FileHandlers.QS408M
|
|||||||
foreach (char c in Wafer)
|
foreach (char c in Wafer)
|
||||||
{
|
{
|
||||||
if (char.IsLetterOrDigit(c) || c == '-' || c == '.')
|
if (char.IsLetterOrDigit(c) || c == '-' || c == '.')
|
||||||
waferFixed.Append(c);
|
_ = waferFixed.Append(c);
|
||||||
}
|
}
|
||||||
Wafer = waferFixed.ToString();
|
Wafer = waferFixed.ToString();
|
||||||
|
|
||||||
@ -431,5 +427,3 @@ namespace Adaptation.FileHandlers.QS408M
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
140
Adaptation/FileHandlers/ToArchive/FileRead.cs
Normal file
140
Adaptation/FileHandlers/ToArchive/FileRead.cs
Normal file
@ -0,0 +1,140 @@
|
|||||||
|
using Adaptation.Eaf.Management.ConfigurationData.CellAutomation;
|
||||||
|
using Adaptation.Ifx.Eaf.EquipmentConnector.File.Configuration;
|
||||||
|
using Adaptation.Shared;
|
||||||
|
using Adaptation.Shared.Duplicator;
|
||||||
|
using Adaptation.Shared.Methods;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text.Json;
|
||||||
|
|
||||||
|
namespace Adaptation.FileHandlers.ToArchive;
|
||||||
|
|
||||||
|
public class FileRead : Shared.FileRead, IFileRead
|
||||||
|
{
|
||||||
|
|
||||||
|
public FileRead(ISMTP smtp, Dictionary<string, string> fileParameter, string cellInstanceName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList<ModelObjectParameterDefinition> modelObjectParameters, string equipmentDictionaryName, Dictionary<string, List<long>> dummyRuns, bool useCyclicalForDescription, bool isEAFHosted) :
|
||||||
|
base(new Description(), false, smtp, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, useCyclicalForDescription, isEAFHosted)
|
||||||
|
{
|
||||||
|
_MinFileLength = 10;
|
||||||
|
_NullData = string.Empty;
|
||||||
|
_Logistics = new Logistics(this);
|
||||||
|
if (_FileParameter is null)
|
||||||
|
throw new Exception(cellInstanceConnectionName);
|
||||||
|
if (_ModelObjectParameterDefinitions is null)
|
||||||
|
throw new Exception(cellInstanceConnectionName);
|
||||||
|
if (!_IsDuplicator)
|
||||||
|
throw new Exception(cellInstanceConnectionName);
|
||||||
|
}
|
||||||
|
|
||||||
|
void IFileRead.Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, Exception exception)
|
||||||
|
{
|
||||||
|
bool isErrorFile = exception is not null;
|
||||||
|
if (!isErrorFile && !string.IsNullOrEmpty(_Logistics.ReportFullPath))
|
||||||
|
{
|
||||||
|
FileInfo fileInfo = new(_Logistics.ReportFullPath);
|
||||||
|
if (fileInfo.Exists && fileInfo.LastWriteTime < fileInfo.CreationTime)
|
||||||
|
File.SetLastWriteTime(_Logistics.ReportFullPath, fileInfo.CreationTime);
|
||||||
|
}
|
||||||
|
Move(extractResults, exception);
|
||||||
|
}
|
||||||
|
|
||||||
|
void IFileRead.WaitForThread() => WaitForThread(thread: null, threadExceptions: null);
|
||||||
|
|
||||||
|
string IFileRead.GetEventDescription()
|
||||||
|
{
|
||||||
|
string result = _Description.GetEventDescription();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> IFileRead.GetHeaderNames()
|
||||||
|
{
|
||||||
|
List<string> results = _Description.GetHeaderNames();
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
|
string[] IFileRead.Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, string to, string from, string resolvedFileLocation, Exception exception)
|
||||||
|
{
|
||||||
|
string[] results = Move(extractResults, to, from, resolvedFileLocation, exception);
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
|
JsonProperty[] IFileRead.GetDefault()
|
||||||
|
{
|
||||||
|
JsonProperty[] results = _Description.GetDefault(this, _Logistics);
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
|
Dictionary<string, string> IFileRead.GetDisplayNamesJsonElement()
|
||||||
|
{
|
||||||
|
Dictionary<string, string> results = _Description.GetDisplayNamesJsonElement(this);
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<IDescription> IFileRead.GetDescriptions(IFileRead fileRead, List<Test> tests, IProcessData processData)
|
||||||
|
{
|
||||||
|
List<IDescription> results = _Description.GetDescriptions(fileRead, _Logistics, tests, processData);
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
|
Tuple<string, Test[], JsonElement[], List<FileInfo>> IFileRead.GetExtractResult(string reportFullPath, string eventName)
|
||||||
|
{
|
||||||
|
Tuple<string, Test[], JsonElement[], List<FileInfo>> results;
|
||||||
|
if (string.IsNullOrEmpty(eventName))
|
||||||
|
throw new Exception();
|
||||||
|
_ReportFullPath = reportFullPath;
|
||||||
|
DateTime dateTime = DateTime.Now;
|
||||||
|
results = GetExtractResult(reportFullPath, dateTime);
|
||||||
|
if (results.Item3 is null)
|
||||||
|
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(results.Item1, Array.Empty<Test>(), JsonSerializer.Deserialize<JsonElement[]>("[]"), results.Item4);
|
||||||
|
if (results.Item3.Length > 0 && _IsEAFHosted)
|
||||||
|
WritePDSF(this, results.Item3);
|
||||||
|
UpdateLastTicksDuration(DateTime.Now.Ticks - dateTime.Ticks);
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
|
Tuple<string, Test[], JsonElement[], List<FileInfo>> IFileRead.ReExtract()
|
||||||
|
{
|
||||||
|
Tuple<string, Test[], JsonElement[], List<FileInfo>> results;
|
||||||
|
List<string> headerNames = _Description.GetHeaderNames();
|
||||||
|
Dictionary<string, string> keyValuePairs = _Description.GetDisplayNamesJsonElement(this);
|
||||||
|
results = ReExtract(this, headerNames, keyValuePairs);
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
|
void IFileRead.CheckTests(Test[] tests, bool extra)
|
||||||
|
{
|
||||||
|
if (_Description is not Description)
|
||||||
|
throw new Exception();
|
||||||
|
}
|
||||||
|
|
||||||
|
void IFileRead.Callback(object state) => throw new Exception(string.Concat("Not ", nameof(_IsDuplicator)));
|
||||||
|
|
||||||
|
private Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, DateTime dateTime)
|
||||||
|
{
|
||||||
|
if (dateTime == DateTime.MinValue)
|
||||||
|
{ }
|
||||||
|
Tuple<string, Test[], JsonElement[], List<FileInfo>> results = new(string.Empty, null, null, new List<FileInfo>());
|
||||||
|
_Logistics = new Logistics(this, reportFullPath, useSplitForMID: true);
|
||||||
|
SetFileParameterLotIDToLogisticsMID();
|
||||||
|
|
||||||
|
string[] segments = Path.GetFileNameWithoutExtension(reportFullPath).Split('_');
|
||||||
|
string duplicateDirectory = string.Concat(_FileConnectorConfiguration.TargetFileLocation, @"\", segments[0]);
|
||||||
|
if (segments.Length > 2)
|
||||||
|
duplicateDirectory = string.Concat(duplicateDirectory, @"-", segments[2]);
|
||||||
|
if (!Directory.Exists(duplicateDirectory))
|
||||||
|
_ = Directory.CreateDirectory(duplicateDirectory);
|
||||||
|
|
||||||
|
string logisticsSequence = _Logistics.Sequence.ToString();
|
||||||
|
bool isDummyRun = _DummyRuns.Any() && _DummyRuns.ContainsKey(_Logistics.JobID) && _DummyRuns[_Logistics.JobID].Any() && (from l in _DummyRuns[_Logistics.JobID] where l == _Logistics.Sequence select 1).Any();
|
||||||
|
|
||||||
|
List<Tuple<Shared.Properties.IScopeInfo, string>> tuples = new();
|
||||||
|
|
||||||
|
string destinationDirectory = WriteScopeInfo(_ProgressPath, _Logistics, dateTime, duplicateDirectory, tuples);
|
||||||
|
if (isDummyRun)
|
||||||
|
Shared0607(reportFullPath, duplicateDirectory, logisticsSequence, destinationDirectory);
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,5 +1,5 @@
|
|||||||
namespace Adaptation.Ifx.Eaf.Common.Configuration
|
namespace Adaptation.Ifx.Eaf.Common.Configuration;
|
||||||
{
|
|
||||||
[System.Runtime.Serialization.DataContractAttribute]
|
[System.Runtime.Serialization.DataContractAttribute]
|
||||||
public class ConnectionSetting
|
public class ConnectionSetting
|
||||||
{
|
{
|
||||||
@ -10,4 +10,3 @@
|
|||||||
[System.Runtime.Serialization.DataMemberAttribute]
|
[System.Runtime.Serialization.DataMemberAttribute]
|
||||||
public string Value { get; set; }
|
public string Value { get; set; }
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,19 +1,18 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Adaptation.Ifx.Eaf.EquipmentConnector.File.Component
|
namespace Adaptation.Ifx.Eaf.EquipmentConnector.File.Component;
|
||||||
{
|
|
||||||
public class File
|
public class File
|
||||||
{
|
{
|
||||||
public File(string filePath) { throw new NotImplementedException(); }
|
public File(string filePath) => throw new NotImplementedException();
|
||||||
public File(string filePath, DateTime timeFileFound) { throw new NotImplementedException(); }
|
public File(string filePath, DateTime timeFileFound) => throw new NotImplementedException();
|
||||||
|
|
||||||
public string Path { get; }
|
public string Path { get; }
|
||||||
public DateTime TimeFound { get; }
|
public DateTime TimeFound { get; }
|
||||||
public bool IsErrorFile { get; }
|
public bool IsErrorFile { get; }
|
||||||
public Dictionary<string, string> ContentParameters { get; }
|
public Dictionary<string, string> ContentParameters { get; }
|
||||||
|
|
||||||
public File UpdateContentParameters(Dictionary<string, string> contentParameters) { throw new NotImplementedException(); }
|
public File UpdateContentParameters(Dictionary<string, string> contentParameters) => throw new NotImplementedException();
|
||||||
public File UpdateParsingStatus(bool isErrorFile) { throw new NotImplementedException(); }
|
public File UpdateParsingStatus(bool isErrorFile) => throw new NotImplementedException();
|
||||||
}
|
|
||||||
}
|
}
|
@ -2,8 +2,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Adaptation.Ifx.Eaf.EquipmentConnector.File.Component
|
namespace Adaptation.Ifx.Eaf.EquipmentConnector.File.Component;
|
||||||
{
|
|
||||||
public class FilePathGenerator
|
public class FilePathGenerator
|
||||||
{
|
{
|
||||||
public const char PLACEHOLDER_IDENTIFIER = '%';
|
public const char PLACEHOLDER_IDENTIFIER = '%';
|
||||||
@ -15,9 +15,9 @@ namespace Adaptation.Ifx.Eaf.EquipmentConnector.File.Component
|
|||||||
public const string PLACEHOLDER_SUB_FOLDER = "SubFolder";
|
public const string PLACEHOLDER_SUB_FOLDER = "SubFolder";
|
||||||
public const string PLACEHOLDER_CELL_NAME = "CellName";
|
public const string PLACEHOLDER_CELL_NAME = "CellName";
|
||||||
|
|
||||||
public FilePathGenerator(FileConnectorConfiguration config, Dictionary<string, string> customPattern = null) { throw new NotImplementedException(); }
|
public FilePathGenerator(FileConnectorConfiguration config, Dictionary<string, string> customPattern = null) => throw new NotImplementedException();
|
||||||
public FilePathGenerator(FileConnectorConfiguration config, File file, bool isErrorFile = false, Dictionary<string, string> customPattern = null) { throw new NotImplementedException(); }
|
public FilePathGenerator(FileConnectorConfiguration config, File file, bool isErrorFile = false, Dictionary<string, string> customPattern = null) => throw new NotImplementedException();
|
||||||
public FilePathGenerator(FileConnectorConfiguration config, string sourceFilePath, bool isErrorFile = false, Dictionary<string, string> customPattern = null) { throw new NotImplementedException(); }
|
public FilePathGenerator(FileConnectorConfiguration config, string sourceFilePath, bool isErrorFile = false, Dictionary<string, string> customPattern = null) => throw new NotImplementedException();
|
||||||
|
|
||||||
protected string SubFolderPath { get; }
|
protected string SubFolderPath { get; }
|
||||||
protected FileConnectorConfiguration Configuration { get; }
|
protected FileConnectorConfiguration Configuration { get; }
|
||||||
@ -25,11 +25,10 @@ namespace Adaptation.Ifx.Eaf.EquipmentConnector.File.Component
|
|||||||
protected bool IsErrorFile { get; }
|
protected bool IsErrorFile { get; }
|
||||||
protected string DefaultPlaceHolderValue { get; }
|
protected string DefaultPlaceHolderValue { get; }
|
||||||
|
|
||||||
public string GetFullTargetPath() { throw new NotImplementedException(); }
|
public string GetFullTargetPath() => throw new NotImplementedException();
|
||||||
public virtual string GetTargetFileName() { throw new NotImplementedException(); }
|
public virtual string GetTargetFileName() => throw new NotImplementedException();
|
||||||
public string GetTargetFolder(bool throwExceptionIfNotExist = true) { throw new NotImplementedException(); }
|
public string GetTargetFolder(bool throwExceptionIfNotExist = true) => throw new NotImplementedException();
|
||||||
protected virtual string GetSubFolder(string folderPattern, string subFolderPath) { throw new NotImplementedException(); }
|
protected virtual string GetSubFolder(string folderPattern, string subFolderPath) => throw new NotImplementedException();
|
||||||
protected virtual string PrepareFolderPath(string targetFolderPath, string subFolderPath) { throw new NotImplementedException(); }
|
protected virtual string PrepareFolderPath(string targetFolderPath, string subFolderPath) => throw new NotImplementedException();
|
||||||
protected string ReplacePlaceholder(string inputPath) { throw new NotImplementedException(); }
|
protected string ReplacePlaceholder(string inputPath) => throw new NotImplementedException();
|
||||||
}
|
|
||||||
}
|
}
|
@ -2,8 +2,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Adaptation.Ifx.Eaf.EquipmentConnector.File.Configuration
|
namespace Adaptation.Ifx.Eaf.EquipmentConnector.File.Configuration;
|
||||||
{
|
|
||||||
[System.Runtime.Serialization.DataContractAttribute]
|
[System.Runtime.Serialization.DataContractAttribute]
|
||||||
public class FileConnectorConfiguration
|
public class FileConnectorConfiguration
|
||||||
{
|
{
|
||||||
@ -85,7 +85,7 @@ namespace Adaptation.Ifx.Eaf.EquipmentConnector.File.Configuration
|
|||||||
[System.Runtime.Serialization.DataMemberAttribute]
|
[System.Runtime.Serialization.DataMemberAttribute]
|
||||||
public string ErrorTargetFileName { get; set; }
|
public string ErrorTargetFileName { get; set; }
|
||||||
|
|
||||||
public void Initialize() { throw new NotImplementedException(); }
|
public void Initialize() => throw new NotImplementedException();
|
||||||
|
|
||||||
public enum PostProcessingModeEnum
|
public enum PostProcessingModeEnum
|
||||||
{
|
{
|
||||||
@ -132,4 +132,3 @@ namespace Adaptation.Ifx.Eaf.EquipmentConnector.File.Configuration
|
|||||||
IgnoreOlder = 1
|
IgnoreOlder = 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
@ -2,13 +2,12 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Adaptation.Ifx.Eaf.EquipmentConnector.File.SelfDescription
|
namespace Adaptation.Ifx.Eaf.EquipmentConnector.File.SelfDescription;
|
||||||
{
|
|
||||||
public class FileConnectorParameterTypeDefinitionProvider
|
public class FileConnectorParameterTypeDefinitionProvider
|
||||||
{
|
{
|
||||||
public FileConnectorParameterTypeDefinitionProvider() { }
|
public FileConnectorParameterTypeDefinitionProvider() { }
|
||||||
|
|
||||||
public IEnumerable<ParameterTypeDefinition> GetAllParameterTypeDefinition() { return null; }
|
public IEnumerable<ParameterTypeDefinition> GetAllParameterTypeDefinition() => null;
|
||||||
public ParameterTypeDefinition GetParameterTypeDefinition(string name) { return null; }
|
public ParameterTypeDefinition GetParameterTypeDefinition(string name) => null;
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,10 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Adaptation.PeerGroup.GCL.Annotations
|
namespace Adaptation.PeerGroup.GCL.Annotations;
|
||||||
{
|
|
||||||
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.Delegate, AllowMultiple = false, Inherited = true)]
|
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.Delegate, AllowMultiple = false, Inherited = true)]
|
||||||
public sealed class NotNullAttribute : Attribute
|
public sealed class NotNullAttribute : Attribute
|
||||||
{
|
{
|
||||||
public NotNullAttribute() { }
|
public NotNullAttribute() { }
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,8 +1,7 @@
|
|||||||
namespace Adaptation.PeerGroup.GCL.SecsDriver
|
namespace Adaptation.PeerGroup.GCL.SecsDriver;
|
||||||
{
|
|
||||||
public enum HsmsConnectionMode
|
public enum HsmsConnectionMode
|
||||||
{
|
{
|
||||||
Active = 0,
|
Active = 0,
|
||||||
Passive = 1
|
Passive = 1
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,8 +1,7 @@
|
|||||||
namespace Adaptation.PeerGroup.GCL.SecsDriver
|
namespace Adaptation.PeerGroup.GCL.SecsDriver;
|
||||||
{
|
|
||||||
public enum HsmsSessionMode
|
public enum HsmsSessionMode
|
||||||
{
|
{
|
||||||
MultiSession = 0,
|
MultiSession = 0,
|
||||||
SingleSession = 1
|
SingleSession = 1
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,8 +1,7 @@
|
|||||||
namespace Adaptation.PeerGroup.GCL.SecsDriver
|
namespace Adaptation.PeerGroup.GCL.SecsDriver;
|
||||||
{
|
|
||||||
public enum SecsTransportType
|
public enum SecsTransportType
|
||||||
{
|
{
|
||||||
HSMS = 0,
|
HSMS = 0,
|
||||||
Serial = 1
|
Serial = 1
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,5 +1,5 @@
|
|||||||
namespace Adaptation.PeerGroup.GCL.SecsDriver
|
namespace Adaptation.PeerGroup.GCL.SecsDriver;
|
||||||
{
|
|
||||||
public enum SerialBaudRate
|
public enum SerialBaudRate
|
||||||
{
|
{
|
||||||
Baud9600 = 0,
|
Baud9600 = 0,
|
||||||
@ -13,4 +13,3 @@
|
|||||||
Baud57600 = 8,
|
Baud57600 = 8,
|
||||||
Baud115200 = 9
|
Baud115200 = 9
|
||||||
}
|
}
|
||||||
}
|
|
@ -4,8 +4,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
|
||||||
namespace Adaptation.Shared.Duplicator
|
namespace Adaptation.Shared.Duplicator;
|
||||||
{
|
|
||||||
|
|
||||||
public class Description : IDescription, Properties.IDescription
|
public class Description : IDescription, Properties.IDescription
|
||||||
{
|
{
|
||||||
@ -24,10 +23,7 @@ namespace Adaptation.Shared.Duplicator
|
|||||||
public string MID { get; set; }
|
public string MID { get; set; }
|
||||||
public string Date { get; set; } //2021-10-23
|
public string Date { get; set; } //2021-10-23
|
||||||
|
|
||||||
string IDescription.GetEventDescription()
|
string IDescription.GetEventDescription() => "File Has been read and parsed";
|
||||||
{
|
|
||||||
return "File Has been read and parsed";
|
|
||||||
}
|
|
||||||
|
|
||||||
List<string> IDescription.GetNames(IFileRead fileRead, Logistics logistics)
|
List<string> IDescription.GetNames(IFileRead fileRead, Logistics logistics)
|
||||||
{
|
{
|
||||||
@ -144,5 +140,3 @@ namespace Adaptation.Shared.Duplicator
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
@ -1,4 +1,4 @@
|
|||||||
using Adaptation.Eaf.Management.ConfigurationData.CellAutomation;
|
using Adaptation.Eaf.Management.ConfigurationData.CellAutomation;
|
||||||
using Adaptation.Ifx.Eaf.EquipmentConnector.File.Configuration;
|
using Adaptation.Ifx.Eaf.EquipmentConnector.File.Configuration;
|
||||||
using Adaptation.Shared.Methods;
|
using Adaptation.Shared.Methods;
|
||||||
using log4net;
|
using log4net;
|
||||||
@ -12,8 +12,7 @@ using System.Text.Json;
|
|||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
namespace Adaptation.Shared
|
namespace Adaptation.Shared;
|
||||||
{
|
|
||||||
|
|
||||||
public class FileRead : Properties.IFileRead
|
public class FileRead : Properties.IFileRead
|
||||||
{
|
{
|
||||||
@ -35,10 +34,8 @@ namespace Adaptation.Shared
|
|||||||
protected readonly Calendar _Calendar;
|
protected readonly Calendar _Calendar;
|
||||||
protected readonly bool _IsSourceTimer;
|
protected readonly bool _IsSourceTimer;
|
||||||
protected readonly string _VillachPath;
|
protected readonly string _VillachPath;
|
||||||
protected readonly int _HyphenIsArchive;
|
|
||||||
protected readonly string _ProgressPath;
|
protected readonly string _ProgressPath;
|
||||||
protected readonly string _EquipmentType;
|
protected readonly string _EquipmentType;
|
||||||
protected readonly int _HyphenIsXToArchive;
|
|
||||||
protected readonly long _BreakAfterSeconds;
|
protected readonly long _BreakAfterSeconds;
|
||||||
protected readonly string _ExceptionSubject;
|
protected readonly string _ExceptionSubject;
|
||||||
protected readonly string _CellInstanceName;
|
protected readonly string _CellInstanceName;
|
||||||
@ -66,7 +63,7 @@ namespace Adaptation.Shared
|
|||||||
string Properties.IFileRead.CellInstanceConnectionName => _CellInstanceConnectionName;
|
string Properties.IFileRead.CellInstanceConnectionName => _CellInstanceConnectionName;
|
||||||
string Properties.IFileRead.ParameterizedModelObjectDefinitionType => _ParameterizedModelObjectDefinitionType;
|
string Properties.IFileRead.ParameterizedModelObjectDefinitionType => _ParameterizedModelObjectDefinitionType;
|
||||||
|
|
||||||
public FileRead(IDescription description, bool isEvent, ISMTP smtp, Dictionary<string, string> fileParameter, string cellInstanceName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList<ModelObjectParameterDefinition> modelObjectParameters, string equipmentDictionaryName, Dictionary<string, List<long>> dummyRuns, bool useCyclicalForDescription, bool isEAFHosted, int hyphenXToArchive, int hyphenIsArchive)
|
public FileRead(IDescription description, bool isEvent, ISMTP smtp, Dictionary<string, string> fileParameter, string cellInstanceName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList<ModelObjectParameterDefinition> modelObjectParameters, string equipmentDictionaryName, Dictionary<string, List<long>> dummyRuns, bool useCyclicalForDescription, bool isEAFHosted)
|
||||||
{
|
{
|
||||||
_SMTP = smtp;
|
_SMTP = smtp;
|
||||||
_IsEvent = isEvent;
|
_IsEvent = isEvent;
|
||||||
@ -76,9 +73,7 @@ namespace Adaptation.Shared
|
|||||||
_Description = description;
|
_Description = description;
|
||||||
_FileParameter = fileParameter;
|
_FileParameter = fileParameter;
|
||||||
_ReportFullPath = string.Empty;
|
_ReportFullPath = string.Empty;
|
||||||
_HyphenIsArchive = hyphenIsArchive;
|
|
||||||
_CellInstanceName = cellInstanceName;
|
_CellInstanceName = cellInstanceName;
|
||||||
_HyphenIsXToArchive = hyphenXToArchive;
|
|
||||||
_Calendar = new CultureInfo("en-US").Calendar;
|
_Calendar = new CultureInfo("en-US").Calendar;
|
||||||
_Log = LogManager.GetLogger(typeof(FileRead));
|
_Log = LogManager.GetLogger(typeof(FileRead));
|
||||||
_UseCyclicalForDescription = useCyclicalForDescription;
|
_UseCyclicalForDescription = useCyclicalForDescription;
|
||||||
@ -86,9 +81,9 @@ namespace Adaptation.Shared
|
|||||||
_ModelObjectParameterDefinitions = modelObjectParameters;
|
_ModelObjectParameterDefinitions = modelObjectParameters;
|
||||||
_FileConnectorConfiguration = fileConnectorConfiguration;
|
_FileConnectorConfiguration = fileConnectorConfiguration;
|
||||||
_ParameterizedModelObjectDefinitionType = parameterizedModelObjectDefinitionType;
|
_ParameterizedModelObjectDefinitionType = parameterizedModelObjectDefinitionType;
|
||||||
_IsSourceTimer = (fileConnectorConfiguration.SourceFileFilter.StartsWith("*Timer.txt"));
|
_IsSourceTimer = fileConnectorConfiguration.SourceFileFilter.StartsWith("*Timer.txt");
|
||||||
string cellInstanceConnectionNameBase = cellInstanceConnectionName.Replace("-", string.Empty);
|
string cellInstanceConnectionNameBase = cellInstanceConnectionName.Replace("-", string.Empty);
|
||||||
_Hyphens = (cellInstanceConnectionName.Length - cellInstanceConnectionNameBase.Length);
|
_Hyphens = cellInstanceConnectionName.Length - cellInstanceConnectionNameBase.Length;
|
||||||
_ExceptionSubject = string.Concat("Exception:", _CellInstanceConnectionName, _FileConnectorConfiguration?.SourceDirectoryCloaking);
|
_ExceptionSubject = string.Concat("Exception:", _CellInstanceConnectionName, _FileConnectorConfiguration?.SourceDirectoryCloaking);
|
||||||
string suffix;
|
string suffix;
|
||||||
string[] segments = _ParameterizedModelObjectDefinitionType.Split('.');
|
string[] segments = _ParameterizedModelObjectDefinitionType.Split('.');
|
||||||
@ -147,7 +142,7 @@ namespace Adaptation.Shared
|
|||||||
throw new Exception("_Configuration is empty?");
|
throw new Exception("_Configuration is empty?");
|
||||||
if (_FileConnectorConfiguration.TargetFileLocation.Contains('%') || _FileConnectorConfiguration.ErrorTargetFileLocation.Contains('%'))
|
if (_FileConnectorConfiguration.TargetFileLocation.Contains('%') || _FileConnectorConfiguration.ErrorTargetFileLocation.Contains('%'))
|
||||||
throw new Exception("_Configuration is incorrect for a duplicator!");
|
throw new Exception("_Configuration is incorrect for a duplicator!");
|
||||||
if (!(_FileConnectorConfiguration is null))
|
if (_FileConnectorConfiguration is not null)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(_FileConnectorConfiguration.SourceDirectoryCloaking))
|
if (string.IsNullOrEmpty(_FileConnectorConfiguration.SourceDirectoryCloaking))
|
||||||
throw new Exception("SourceDirectoryCloaking is empty?");
|
throw new Exception("SourceDirectoryCloaking is empty?");
|
||||||
@ -157,7 +152,7 @@ namespace Adaptation.Shared
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected string GetPropertyValue(string cellInstanceConnectionName, IList<ModelObjectParameterDefinition> modelObjectParameters, string propertyName)
|
protected static string GetPropertyValue(string cellInstanceConnectionName, IList<ModelObjectParameterDefinition> modelObjectParameters, string propertyName)
|
||||||
{
|
{
|
||||||
string result;
|
string result;
|
||||||
List<string> results = (from l in modelObjectParameters where l.Name == propertyName select l.Value).ToList();
|
List<string> results = (from l in modelObjectParameters where l.Name == propertyName select l.Value).ToList();
|
||||||
@ -167,7 +162,7 @@ namespace Adaptation.Shared
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ModelObjectParameterDefinition[] GetProperties(string cellInstanceConnectionName, IList<ModelObjectParameterDefinition> modelObjectParameters, string propertyNamePrefix)
|
protected static ModelObjectParameterDefinition[] GetProperties(string cellInstanceConnectionName, IList<ModelObjectParameterDefinition> modelObjectParameters, string propertyNamePrefix)
|
||||||
{
|
{
|
||||||
ModelObjectParameterDefinition[] results = (from l in modelObjectParameters where l.Name.StartsWith(propertyNamePrefix) select l).ToArray();
|
ModelObjectParameterDefinition[] results = (from l in modelObjectParameters where l.Name.StartsWith(propertyNamePrefix) select l).ToArray();
|
||||||
if (!results.Any())
|
if (!results.Any())
|
||||||
@ -175,7 +170,7 @@ namespace Adaptation.Shared
|
|||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ModelObjectParameterDefinition[] GetProperties(string cellInstanceConnectionName, IList<ModelObjectParameterDefinition> modelObjectParameters, string propertyNamePrefix, string propertyNameSuffix)
|
protected static ModelObjectParameterDefinition[] GetProperties(string cellInstanceConnectionName, IList<ModelObjectParameterDefinition> modelObjectParameters, string propertyNamePrefix, string propertyNameSuffix)
|
||||||
{
|
{
|
||||||
ModelObjectParameterDefinition[] results = (from l in modelObjectParameters where l.Name.StartsWith(propertyNamePrefix) && l.Name.EndsWith(propertyNameSuffix) select l).ToArray();
|
ModelObjectParameterDefinition[] results = (from l in modelObjectParameters where l.Name.StartsWith(propertyNamePrefix) && l.Name.EndsWith(propertyNameSuffix) select l).ToArray();
|
||||||
if (!results.Any())
|
if (!results.Any())
|
||||||
@ -192,7 +187,7 @@ namespace Adaptation.Shared
|
|||||||
|
|
||||||
protected void WaitForThread(Thread thread, List<Exception> threadExceptions)
|
protected void WaitForThread(Thread thread, List<Exception> threadExceptions)
|
||||||
{
|
{
|
||||||
if (!(thread is null))
|
if (thread is not null)
|
||||||
{
|
{
|
||||||
ThreadState threadState;
|
ThreadState threadState;
|
||||||
for (short i = 0; i < short.MaxValue; i++)
|
for (short i = 0; i < short.MaxValue; i++)
|
||||||
@ -202,7 +197,7 @@ namespace Adaptation.Shared
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
threadState = thread.ThreadState;
|
threadState = thread.ThreadState;
|
||||||
if (threadState != ThreadState.Running && threadState != ThreadState.WaitSleepJoin)
|
if (threadState is not ThreadState.Running and not ThreadState.WaitSleepJoin)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Thread.Sleep(500);
|
Thread.Sleep(500);
|
||||||
@ -221,29 +216,29 @@ namespace Adaptation.Shared
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void CreateProgressDirectory(string progressPath, Logistics logistics, int? duplicator, string[] exceptionLines)
|
protected void CreateProgressDirectory(string[] exceptionLines)
|
||||||
{
|
{
|
||||||
string progressDirectory;
|
string progressDirectory;
|
||||||
StringBuilder stringBuilder = new();
|
StringBuilder stringBuilder = new();
|
||||||
if (duplicator is null || duplicator.Value == 0)
|
if (_Hyphens == 0)
|
||||||
progressDirectory = string.Concat(progressPath, @"\EquipmentIntegration");
|
progressDirectory = Path.Combine(_ProgressPath, _CellInstanceConnectionName);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
stringBuilder.Clear();
|
_ = stringBuilder.Clear();
|
||||||
for (int i = 0; i < duplicator.Value; i++)
|
for (int i = 0; i < _Hyphens; i++)
|
||||||
{
|
{
|
||||||
if (i > 0 && (i % 2) == 0)
|
if (i > 0 && (i % 2) == 0)
|
||||||
stringBuilder.Append(' ');
|
_ = stringBuilder.Append(' ');
|
||||||
stringBuilder.Append('-');
|
_ = stringBuilder.Append('-');
|
||||||
}
|
}
|
||||||
progressDirectory = string.Concat(progressPath, @"\", (duplicator.Value + 1).ToString().PadLeft(2, '0'), " ", stringBuilder).Trim();
|
progressDirectory = string.Concat(_ProgressPath, @"\", (_Hyphens + 1).ToString().PadLeft(2, '0'), " ", stringBuilder).Trim();
|
||||||
}
|
}
|
||||||
DateTime dateTime = DateTime.Now;
|
DateTime dateTime = DateTime.Now;
|
||||||
string weekOfYear = _Calendar.GetWeekOfYear(dateTime, CalendarWeekRule.FirstDay, DayOfWeek.Sunday).ToString("00");
|
string weekOfYear = _Calendar.GetWeekOfYear(dateTime, CalendarWeekRule.FirstDay, DayOfWeek.Sunday).ToString("00");
|
||||||
progressDirectory = string.Concat(progressDirectory, @"\", dateTime.ToString("yyyy"), "_Week_", weekOfYear, @"\", logistics.MID, "_", logistics.Sequence, "_", DateTime.Now.Ticks - logistics.Sequence);
|
progressDirectory = string.Concat(progressDirectory, @"\", dateTime.ToString("yyyy"), "_Week_", weekOfYear, @"\", _Logistics.MID, "_", _Logistics.Sequence, "_", DateTime.Now.Ticks - _Logistics.Sequence);
|
||||||
if (!Directory.Exists(progressDirectory))
|
if (!Directory.Exists(progressDirectory))
|
||||||
Directory.CreateDirectory(progressDirectory);
|
_ = Directory.CreateDirectory(progressDirectory);
|
||||||
if (!(exceptionLines is null))
|
if (exceptionLines is not null)
|
||||||
{
|
{
|
||||||
string fileName = string.Concat(progressDirectory, @"\readme.txt");
|
string fileName = string.Concat(progressDirectory, @"\readme.txt");
|
||||||
try
|
try
|
||||||
@ -255,17 +250,17 @@ namespace Adaptation.Shared
|
|||||||
protected string[] Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, string to, string from, string resolvedFileLocation, Exception exception)
|
protected string[] Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, string to, string from, string resolvedFileLocation, Exception exception)
|
||||||
{
|
{
|
||||||
string[] results;
|
string[] results;
|
||||||
bool isErrorFile = !(exception is null);
|
bool isErrorFile = exception is not null;
|
||||||
if (!to.EndsWith(@"\"))
|
if (!to.EndsWith(@"\"))
|
||||||
string.Concat(to, @"\");
|
_ = string.Concat(to, @"\");
|
||||||
if (!isErrorFile)
|
if (!isErrorFile)
|
||||||
results = new string[] { };
|
results = Array.Empty<string>();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
results = new string[] { _Logistics.Sequence.ToString(), _Logistics.ReportFullPath, from, resolvedFileLocation, to, string.Empty, string.Empty, exception.Message, string.Empty, string.Empty, exception.StackTrace };
|
results = new string[] { _Logistics.Sequence.ToString(), _Logistics.ReportFullPath, from, resolvedFileLocation, to, string.Empty, string.Empty, exception.Message, string.Empty, string.Empty, exception.StackTrace };
|
||||||
Shared0449(to, results);
|
Shared0449(to, results);
|
||||||
}
|
}
|
||||||
if (!(extractResults is null) && !(extractResults.Item4 is null) && extractResults.Item4.Any())
|
if (extractResults is not null && extractResults.Item4 is not null && extractResults.Item4.Any())
|
||||||
{
|
{
|
||||||
string itemFile;
|
string itemFile;
|
||||||
List<string> directories = new();
|
List<string> directories = new();
|
||||||
@ -276,7 +271,7 @@ namespace Adaptation.Shared
|
|||||||
itemFile = sourceFile.FullName.Replace(from, to);
|
itemFile = sourceFile.FullName.Replace(from, to);
|
||||||
Shared1880(itemFile, directories, sourceFile, isErrorFile);
|
Shared1880(itemFile, directories, sourceFile, isErrorFile);
|
||||||
}
|
}
|
||||||
else if (!isErrorFile && !(_Logistics is null))
|
else if (!isErrorFile && _Logistics is not null)
|
||||||
Shared1811(to, sourceFile);
|
Shared1811(to, sourceFile);
|
||||||
}
|
}
|
||||||
Shared0231(directories);
|
Shared0231(directories);
|
||||||
@ -284,7 +279,7 @@ namespace Adaptation.Shared
|
|||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected IEnumerable<string> GetDirectoriesRecursively(string path, string directoryNameSegment = null)
|
protected static IEnumerable<string> GetDirectoriesRecursively(string path, string directoryNameSegment = null)
|
||||||
{
|
{
|
||||||
Queue<string> queue = new();
|
Queue<string> queue = new();
|
||||||
queue.Enqueue(path);
|
queue.Enqueue(path);
|
||||||
@ -319,7 +314,7 @@ namespace Adaptation.Shared
|
|||||||
Directory.Move(matchDirectories[0], result);
|
Directory.Move(matchDirectories[0], result);
|
||||||
result = string.Concat(result, @"\", logistics.Sequence);
|
result = string.Concat(result, @"\", logistics.Sequence);
|
||||||
if (!Directory.Exists(result))
|
if (!Directory.Exists(result))
|
||||||
Directory.CreateDirectory(result);
|
_ = Directory.CreateDirectory(result);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -342,7 +337,7 @@ namespace Adaptation.Shared
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected string GetTupleFile(Logistics logistics, Properties.IScopeInfo scopeInfo, string duplicateDirectory)
|
protected static string GetTupleFile(Logistics logistics, Properties.IScopeInfo scopeInfo, string duplicateDirectory)
|
||||||
{
|
{
|
||||||
string result;
|
string result;
|
||||||
string rds;
|
string rds;
|
||||||
@ -438,7 +433,7 @@ namespace Adaptation.Shared
|
|||||||
try
|
try
|
||||||
{ File.Delete(duplicateFiles[i]); }
|
{ File.Delete(duplicateFiles[i]); }
|
||||||
catch (Exception) { }
|
catch (Exception) { }
|
||||||
stringBuilder.Append("<").Append(duplicateFiles[i]).Append("> ");
|
_ = stringBuilder.Append('<').Append(duplicateFiles[i]).Append("> ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new Exception(string.Concat("After {", _BreakAfterSeconds, "} seconds, right side of {", sourceDirectoryCloaking, "} didn't consume file(s) ", stringBuilder));
|
throw new Exception(string.Concat("After {", _BreakAfterSeconds, "} seconds, right side of {", sourceDirectoryCloaking, "} didn't consume file(s) ", stringBuilder));
|
||||||
@ -491,7 +486,7 @@ namespace Adaptation.Shared
|
|||||||
else
|
else
|
||||||
directory = Path.Combine(_TracePath, _EquipmentType, "Source", _CellInstanceName, _CellInstanceConnectionName);
|
directory = Path.Combine(_TracePath, _EquipmentType, "Source", _CellInstanceName, _CellInstanceConnectionName);
|
||||||
if (!Directory.Exists(directory))
|
if (!Directory.Exists(directory))
|
||||||
Directory.CreateDirectory(directory);
|
_ = Directory.CreateDirectory(directory);
|
||||||
string file = Path.Combine(directory, string.Concat(_Logistics.MesEntity, "_", _Logistics.Sequence, ".ipdsf"));
|
string file = Path.Combine(directory, string.Concat(_Logistics.MesEntity, "_", _Logistics.Sequence, ".ipdsf"));
|
||||||
string lines = ProcessDataStandardFormat.GetPDSFText(fileRead, _Logistics, jsonElements, logisticsText: string.Empty);
|
string lines = ProcessDataStandardFormat.GetPDSFText(fileRead, _Logistics, jsonElements, logisticsText: string.Empty);
|
||||||
File.WriteAllText(file, lines);
|
File.WriteAllText(file, lines);
|
||||||
@ -503,17 +498,13 @@ namespace Adaptation.Shared
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void Move(IFileRead fileRead, Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, Exception exception)
|
protected void Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, Exception exception)
|
||||||
{
|
{
|
||||||
bool isErrorFile = !(exception is null);
|
bool isErrorFile = exception is not null;
|
||||||
if (!isErrorFile && _IsDuplicator)
|
if (!isErrorFile && _IsDuplicator)
|
||||||
{
|
{
|
||||||
if (_Hyphens == _HyphenIsXToArchive)
|
|
||||||
Shared0192();
|
|
||||||
else if (_IsEAFHosted && _Hyphens == _HyphenIsArchive)
|
|
||||||
fileRead.MoveArchive();
|
|
||||||
if (_IsEAFHosted && !string.IsNullOrEmpty(_ProgressPath))
|
if (_IsEAFHosted && !string.IsNullOrEmpty(_ProgressPath))
|
||||||
CreateProgressDirectory(_ProgressPath, _Logistics, _Hyphens, exceptionLines: null);
|
CreateProgressDirectory(exceptionLines: null);
|
||||||
}
|
}
|
||||||
if (!_IsEAFHosted)
|
if (!_IsEAFHosted)
|
||||||
{
|
{
|
||||||
@ -524,10 +515,10 @@ namespace Adaptation.Shared
|
|||||||
to = Path.GetDirectoryName(_FileConnectorConfiguration.TargetFileLocation);
|
to = Path.GetDirectoryName(_FileConnectorConfiguration.TargetFileLocation);
|
||||||
foreach (KeyValuePair<string, string> keyValuePair in _FileParameter)
|
foreach (KeyValuePair<string, string> keyValuePair in _FileParameter)
|
||||||
to = to.Replace(string.Concat('%', keyValuePair.Key, '%'), keyValuePair.Value);
|
to = to.Replace(string.Concat('%', keyValuePair.Key, '%'), keyValuePair.Value);
|
||||||
if (to.Contains("%"))
|
if (to.Contains('%'))
|
||||||
_Log.Debug("Can't debug without EAF Hosting");
|
_Log.Debug("Can't debug without EAF Hosting");
|
||||||
else
|
else
|
||||||
Move(extractResults, to, _FileConnectorConfiguration.SourceFileLocation, resolvedFileLocation: string.Empty, exception: null);
|
_ = Move(extractResults, to, _FileConnectorConfiguration.SourceFileLocation, resolvedFileLocation: string.Empty, exception: null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -592,7 +583,7 @@ namespace Adaptation.Shared
|
|||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Dictionary<Test, List<Properties.IDescription>> GetKeyValuePairs(List<Properties.IDescription> descriptions)
|
protected static Dictionary<Test, List<Properties.IDescription>> GetKeyValuePairs(List<Properties.IDescription> descriptions)
|
||||||
{
|
{
|
||||||
Dictionary<Test, List<Properties.IDescription>> results = new();
|
Dictionary<Test, List<Properties.IDescription>> results = new();
|
||||||
Test testKey;
|
Test testKey;
|
||||||
@ -606,7 +597,7 @@ namespace Adaptation.Shared
|
|||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected List<Properties.IDescription> GetDuplicatorDescriptions(JsonElement[] jsonElements)
|
protected static List<Properties.IDescription> GetDuplicatorDescriptions(JsonElement[] jsonElements)
|
||||||
{
|
{
|
||||||
List<Properties.IDescription> results = new();
|
List<Properties.IDescription> results = new();
|
||||||
Duplicator.Description description;
|
Duplicator.Description description;
|
||||||
@ -621,7 +612,7 @@ namespace Adaptation.Shared
|
|||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Tuple<Test[], Dictionary<Test, List<Properties.IDescription>>> GetTuple(IFileRead fileRead, IEnumerable<Properties.IDescription> descriptions, bool extra = false)
|
protected static Tuple<Test[], Dictionary<Test, List<Properties.IDescription>>> GetTuple(IFileRead fileRead, IEnumerable<Properties.IDescription> descriptions, bool extra = false)
|
||||||
{
|
{
|
||||||
Tuple<Test[], Dictionary<Test, List<Properties.IDescription>>> result;
|
Tuple<Test[], Dictionary<Test, List<Properties.IDescription>>> result;
|
||||||
Dictionary<Test, List<Properties.IDescription>> keyValuePairs = GetKeyValuePairs(descriptions.ToList());
|
Dictionary<Test, List<Properties.IDescription>> keyValuePairs = GetKeyValuePairs(descriptions.ToList());
|
||||||
@ -634,14 +625,14 @@ namespace Adaptation.Shared
|
|||||||
protected void Shared0449(string to, string[] exceptionLines)
|
protected void Shared0449(string to, string[] exceptionLines)
|
||||||
{
|
{
|
||||||
if (_IsDuplicator)
|
if (_IsDuplicator)
|
||||||
CreateProgressDirectory(_ProgressPath, _Logistics, _Hyphens, exceptionLines);
|
CreateProgressDirectory(exceptionLines: null);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string fileName = string.Concat(to, @"\readme.txt");
|
string fileName = string.Concat(to, @"\readme.txt");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (!Directory.Exists(to))
|
if (!Directory.Exists(to))
|
||||||
Directory.CreateDirectory(to);
|
_ = Directory.CreateDirectory(to);
|
||||||
File.WriteAllLines(fileName, exceptionLines);
|
File.WriteAllLines(fileName, exceptionLines);
|
||||||
}
|
}
|
||||||
catch (Exception ex) { _Log.Error(ex.Message); }
|
catch (Exception ex) { _Log.Error(ex.Message); }
|
||||||
@ -660,7 +651,7 @@ namespace Adaptation.Shared
|
|||||||
processingModeEnum = _FileConnectorConfiguration.ErrorPostProcessingMode.Value;
|
processingModeEnum = _FileConnectorConfiguration.ErrorPostProcessingMode.Value;
|
||||||
if (processingModeEnum != FileConnectorConfiguration.PostProcessingModeEnum.Delete && !Directory.Exists(itemDirectory))
|
if (processingModeEnum != FileConnectorConfiguration.PostProcessingModeEnum.Delete && !Directory.Exists(itemDirectory))
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(itemDirectory);
|
_ = Directory.CreateDirectory(itemDirectory);
|
||||||
FileInfo fileInfo = new(_Logistics.ReportFullPath);
|
FileInfo fileInfo = new(_Logistics.ReportFullPath);
|
||||||
Directory.SetCreationTime(itemDirectory, fileInfo.LastWriteTime);
|
Directory.SetCreationTime(itemDirectory, fileInfo.LastWriteTime);
|
||||||
}
|
}
|
||||||
@ -694,14 +685,14 @@ namespace Adaptation.Shared
|
|||||||
string weekDirectory = string.Concat(_Logistics.DateTimeFromSequence.ToString("yyyy"), "_Week_", weekOfYear, @"\", _Logistics.DateTimeFromSequence.ToString("yyyy-MM-dd"));
|
string weekDirectory = string.Concat(_Logistics.DateTimeFromSequence.ToString("yyyy"), "_Week_", weekOfYear, @"\", _Logistics.DateTimeFromSequence.ToString("yyyy-MM-dd"));
|
||||||
string destinationDirectory = string.Concat(jobIdDirectory, @"\_ Ignore 100 bytes\", weekDirectory, @"\", directoryName);
|
string destinationDirectory = string.Concat(jobIdDirectory, @"\_ Ignore 100 bytes\", weekDirectory, @"\", directoryName);
|
||||||
if (!Directory.Exists(destinationDirectory))
|
if (!Directory.Exists(destinationDirectory))
|
||||||
Directory.CreateDirectory(destinationDirectory);
|
_ = Directory.CreateDirectory(destinationDirectory);
|
||||||
File.Move(sourceFile.FullName, string.Concat(destinationDirectory, @"\", sourceFile.Name));
|
File.Move(sourceFile.FullName, string.Concat(destinationDirectory, @"\", sourceFile.Name));
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string[] checkDirectories = Directory.GetDirectories(jobIdDirectory, "*", SearchOption.TopDirectoryOnly);
|
string[] checkDirectories = Directory.GetDirectories(jobIdDirectory, "*", SearchOption.TopDirectoryOnly);
|
||||||
foreach (string checkDirectory in checkDirectories)
|
foreach (string checkDirectory in checkDirectories)
|
||||||
{
|
{
|
||||||
if (!checkDirectory.Contains("_"))
|
if (!checkDirectory.Contains('_'))
|
||||||
continue;
|
continue;
|
||||||
if (Directory.GetDirectories(checkDirectory, "*", SearchOption.TopDirectoryOnly).Any())
|
if (Directory.GetDirectories(checkDirectory, "*", SearchOption.TopDirectoryOnly).Any())
|
||||||
continue;
|
continue;
|
||||||
@ -748,7 +739,7 @@ namespace Adaptation.Shared
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void Shared0607(string reportFullPath, string duplicateDirectory, string logisticsSequence, string destinationDirectory)
|
protected static void Shared0607(string reportFullPath, string duplicateDirectory, string logisticsSequence, string destinationDirectory)
|
||||||
{
|
{
|
||||||
if (destinationDirectory == duplicateDirectory)
|
if (destinationDirectory == duplicateDirectory)
|
||||||
throw new Exception("Check Target File Folder for %LotIDWithLogisticsSequence%_in process on CI (not Duplicator)");
|
throw new Exception("Check Target File Folder for %LotIDWithLogisticsSequence%_in process on CI (not Duplicator)");
|
||||||
@ -763,16 +754,6 @@ namespace Adaptation.Shared
|
|||||||
File.Delete(reportFullPath);
|
File.Delete(reportFullPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void Shared0192()
|
|
||||||
{
|
|
||||||
if (!string.IsNullOrEmpty(_Logistics.ReportFullPath))
|
|
||||||
{
|
|
||||||
FileInfo fileInfo = new(_Logistics.ReportFullPath);
|
|
||||||
if (fileInfo.Exists && fileInfo.LastWriteTime < fileInfo.CreationTime)
|
|
||||||
File.SetLastWriteTime(_Logistics.ReportFullPath, fileInfo.CreationTime);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected string[] Shared1567(string reportFullPath, List<Tuple<Properties.IScopeInfo, string>> tuples)
|
protected string[] Shared1567(string reportFullPath, List<Tuple<Properties.IScopeInfo, string>> tuples)
|
||||||
{
|
{
|
||||||
string[] results;
|
string[] results;
|
||||||
@ -780,7 +761,7 @@ namespace Adaptation.Shared
|
|||||||
string logisticsSequence = _Logistics.Sequence.ToString();
|
string logisticsSequence = _Logistics.Sequence.ToString();
|
||||||
string jobIdDirectory = string.Concat(Path.GetDirectoryName(Path.GetDirectoryName(_FileConnectorConfiguration.TargetFileLocation)), @"\", _Logistics.JobID);
|
string jobIdDirectory = string.Concat(Path.GetDirectoryName(Path.GetDirectoryName(_FileConnectorConfiguration.TargetFileLocation)), @"\", _Logistics.JobID);
|
||||||
if (!Directory.Exists(jobIdDirectory))
|
if (!Directory.Exists(jobIdDirectory))
|
||||||
Directory.CreateDirectory(jobIdDirectory);
|
_ = Directory.CreateDirectory(jobIdDirectory);
|
||||||
string[] matchDirectories;
|
string[] matchDirectories;
|
||||||
if (!_IsEAFHosted)
|
if (!_IsEAFHosted)
|
||||||
matchDirectories = new string[] { Path.GetDirectoryName(Path.GetDirectoryName(reportFullPath)) };
|
matchDirectories = new string[] { Path.GetDirectoryName(Path.GetDirectoryName(reportFullPath)) };
|
||||||
@ -791,7 +772,7 @@ namespace Adaptation.Shared
|
|||||||
string fileName = Path.GetFileNameWithoutExtension(reportFullPath);
|
string fileName = Path.GetFileNameWithoutExtension(reportFullPath);
|
||||||
string sequenceDirectory = string.Concat(matchDirectories[0], @"\", logisticsSequence);
|
string sequenceDirectory = string.Concat(matchDirectories[0], @"\", logisticsSequence);
|
||||||
if (!Directory.Exists(sequenceDirectory))
|
if (!Directory.Exists(sequenceDirectory))
|
||||||
Directory.CreateDirectory(sequenceDirectory);
|
_ = Directory.CreateDirectory(sequenceDirectory);
|
||||||
foreach (Tuple<Properties.IScopeInfo, string> tuple in tuples)
|
foreach (Tuple<Properties.IScopeInfo, string> tuple in tuples)
|
||||||
{
|
{
|
||||||
fileName = string.Concat(sequenceDirectory, @"\", fileName, "_", tuple.Item1.FileNameWithoutExtension, ".pdsfc");
|
fileName = string.Concat(sequenceDirectory, @"\", fileName, "_", tuple.Item1.FileNameWithoutExtension, ".pdsfc");
|
||||||
@ -816,19 +797,17 @@ namespace Adaptation.Shared
|
|||||||
string ecCharacterizationSi = Path.GetDirectoryName(Path.GetDirectoryName(jobIdDirectory));
|
string ecCharacterizationSi = Path.GetDirectoryName(Path.GetDirectoryName(jobIdDirectory));
|
||||||
string destinationJobIdDirectory = string.Concat(ecCharacterizationSi, @"\Processed\", _Logistics.JobID);
|
string destinationJobIdDirectory = string.Concat(ecCharacterizationSi, @"\Processed\", _Logistics.JobID);
|
||||||
if (!Directory.Exists(destinationJobIdDirectory))
|
if (!Directory.Exists(destinationJobIdDirectory))
|
||||||
Directory.CreateDirectory(destinationJobIdDirectory);
|
_ = Directory.CreateDirectory(destinationJobIdDirectory);
|
||||||
destinationJobIdDirectory = string.Concat(destinationJobIdDirectory, @"\", Path.GetFileName(destinationDirectory).Split(new string[] { logisticsSequence }, StringSplitOptions.None)[0], _Logistics.DateTimeFromSequence.ToString("yyyy-MM-dd_hh;mm_tt_"), DateTime.Now.Ticks - _Logistics.Sequence);
|
destinationJobIdDirectory = string.Concat(destinationJobIdDirectory, @"\", Path.GetFileName(destinationDirectory).Split(new string[] { logisticsSequence }, StringSplitOptions.None)[0], _Logistics.DateTimeFromSequence.ToString("yyyy-MM-dd_hh;mm_tt_"), DateTime.Now.Ticks - _Logistics.Sequence);
|
||||||
string sequenceDirectory = string.Concat(destinationJobIdDirectory, @"\", logisticsSequence);
|
string sequenceDirectory = string.Concat(destinationJobIdDirectory, @"\", logisticsSequence);
|
||||||
string jsonFileName = string.Concat(sequenceDirectory, @"\", Path.GetFileNameWithoutExtension(reportFullPath), ".json");
|
string jsonFileName = string.Concat(sequenceDirectory, @"\", Path.GetFileNameWithoutExtension(reportFullPath), ".json");
|
||||||
Directory.Move(destinationDirectory, destinationJobIdDirectory);
|
Directory.Move(destinationDirectory, destinationJobIdDirectory);
|
||||||
if (!Directory.Exists(sequenceDirectory))
|
if (!Directory.Exists(sequenceDirectory))
|
||||||
Directory.CreateDirectory(sequenceDirectory);
|
_ = Directory.CreateDirectory(sequenceDirectory);
|
||||||
File.Copy(reportFullPath, string.Concat(sequenceDirectory, @"\", Path.GetFileName(reportFullPath)), overwrite: true);
|
File.Copy(reportFullPath, string.Concat(sequenceDirectory, @"\", Path.GetFileName(reportFullPath)), overwrite: true);
|
||||||
File.WriteAllText(jsonFileName, json);
|
File.WriteAllText(jsonFileName, json);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
// 2022-02-14 -> Shared - FileRead
|
||||||
|
|
||||||
// 2021-12-17 -> Shared - FileRead
|
|
@ -1,11 +1,10 @@
|
|||||||
using Adaptation.Shared.Methods;
|
using Adaptation.Shared.Methods;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace Adaptation.Shared
|
namespace Adaptation.Shared;
|
||||||
{
|
|
||||||
|
|
||||||
public class Logistics : ILogistics
|
public class Logistics : ILogistics
|
||||||
{
|
{
|
||||||
@ -166,7 +165,7 @@ namespace Adaptation.Shared
|
|||||||
Logistics2 logistics2;
|
Logistics2 logistics2;
|
||||||
Tags = new List<string>();
|
Tags = new List<string>();
|
||||||
Logistics2 = new List<Logistics2>();
|
Logistics2 = new List<Logistics2>();
|
||||||
for (int i = 1; i < Logistics1.Count(); i++)
|
for (int i = 1; i < Logistics1.Count; i++)
|
||||||
{
|
{
|
||||||
if (Logistics1[i].StartsWith("LOGISTICS_2"))
|
if (Logistics1[i].StartsWith("LOGISTICS_2"))
|
||||||
{
|
{
|
||||||
@ -174,32 +173,20 @@ namespace Adaptation.Shared
|
|||||||
Logistics2.Add(logistics2);
|
Logistics2.Add(logistics2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (int i = Logistics1.Count() - 1; i > -1; i--)
|
for (int i = Logistics1.Count - 1; i > -1; i--)
|
||||||
{
|
{
|
||||||
if (Logistics1[i].StartsWith("LOGISTICS_2"))
|
if (Logistics1[i].StartsWith("LOGISTICS_2"))
|
||||||
Logistics1.RemoveAt(i);
|
Logistics1.RemoveAt(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Logistics ShallowCopy()
|
public Logistics ShallowCopy() => (Logistics)MemberwiseClone();
|
||||||
{
|
|
||||||
return (Logistics)MemberwiseClone();
|
|
||||||
}
|
|
||||||
|
|
||||||
private string DefaultMesEntity(DateTime dateTime)
|
private static string DefaultMesEntity(DateTime dateTime) => string.Concat(dateTime.Ticks, "_MES_ENTITY");
|
||||||
{
|
|
||||||
return string.Concat(dateTime.Ticks, "_MES_ENTITY");
|
|
||||||
}
|
|
||||||
|
|
||||||
internal string GetLotViaMostCommonMethod()
|
internal string GetLotViaMostCommonMethod() => MID.Substring(0, MID.Length - 2);
|
||||||
{
|
|
||||||
return MID.Substring(0, MID.Length - 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
internal string GetPocketNumberViaMostCommonMethod()
|
internal string GetPocketNumberViaMostCommonMethod() => MID.Substring(MID.Length - 2);
|
||||||
{
|
|
||||||
return MID.Substring(MID.Length - 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
internal void Update(string dateTime, string processJobID, string mid)
|
internal void Update(string dateTime, string processJobID, string mid)
|
||||||
{
|
{
|
||||||
@ -219,5 +206,3 @@ namespace Adaptation.Shared
|
|||||||
Logistics2 = new List<Logistics2>();
|
Logistics2 = new List<Logistics2>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
@ -1,7 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Adaptation.Shared
|
namespace Adaptation.Shared;
|
||||||
{
|
|
||||||
|
|
||||||
public class Logistics2 : Methods.ILogistics2
|
public class Logistics2 : Methods.ILogistics2
|
||||||
{
|
{
|
||||||
@ -77,5 +76,3 @@ namespace Adaptation.Shared
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
@ -1,8 +1,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
|
||||||
namespace Adaptation.Shared.Methods
|
namespace Adaptation.Shared.Methods;
|
||||||
{
|
|
||||||
|
|
||||||
public interface IDescription
|
public interface IDescription
|
||||||
{
|
{
|
||||||
@ -21,5 +20,3 @@ namespace Adaptation.Shared.Methods
|
|||||||
List<IDescription> GetDescriptions(IFileRead fileRead, Logistics logistics, List<Test> tests, IProcessData iProcessData);
|
List<IDescription> GetDescriptions(IFileRead fileRead, Logistics logistics, List<Test> tests, IProcessData iProcessData);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
@ -3,12 +3,11 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
|
||||||
namespace Adaptation.Shared.Methods
|
namespace Adaptation.Shared.Methods;
|
||||||
{
|
|
||||||
|
|
||||||
public interface IFileRead : Properties.IFileRead
|
public interface IFileRead : Properties.IFileRead
|
||||||
{
|
{
|
||||||
void MoveArchive();
|
|
||||||
void WaitForThread();
|
void WaitForThread();
|
||||||
JsonProperty[] GetDefault();
|
JsonProperty[] GetDefault();
|
||||||
void Callback(object state);
|
void Callback(object state);
|
||||||
@ -21,6 +20,5 @@ namespace Adaptation.Shared.Methods
|
|||||||
void Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, Exception exception = null);
|
void Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, Exception exception = null);
|
||||||
Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, string eventName);
|
Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, string eventName);
|
||||||
string[] Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, string to, string from, string resolvedFileLocation, Exception exception);
|
string[] Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, string to, string from, string resolvedFileLocation, Exception exception);
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
@ -1,8 +1,5 @@
|
|||||||
namespace Adaptation.Shared.Methods
|
namespace Adaptation.Shared.Methods;
|
||||||
{
|
|
||||||
|
|
||||||
public interface ILogistics : Properties.ILogistics
|
public interface ILogistics : Properties.ILogistics
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
@ -1,8 +1,5 @@
|
|||||||
namespace Adaptation.Shared.Methods
|
namespace Adaptation.Shared.Methods;
|
||||||
{
|
|
||||||
|
|
||||||
public interface ILogistics2 : Properties.ILogistics2
|
public interface ILogistics2 : Properties.ILogistics2
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
@ -3,8 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
|
||||||
namespace Adaptation.Shared.Methods
|
namespace Adaptation.Shared.Methods;
|
||||||
{
|
|
||||||
|
|
||||||
public interface IProcessData : Properties.IProcessData
|
public interface IProcessData : Properties.IProcessData
|
||||||
{
|
{
|
||||||
@ -13,5 +12,3 @@ namespace Adaptation.Shared.Methods
|
|||||||
Tuple<string, Test[], JsonElement[], List<FileInfo>> GetResults(IFileRead fileRead, Logistics logistics, List<FileInfo> fileInfoCollection);
|
Tuple<string, Test[], JsonElement[], List<FileInfo>> GetResults(IFileRead fileRead, Logistics logistics, List<FileInfo> fileInfoCollection);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
@ -1,9 +1,8 @@
|
|||||||
namespace Adaptation.Shared.Methods
|
namespace Adaptation.Shared.Methods;
|
||||||
{
|
|
||||||
public interface ISMTP
|
public interface ISMTP
|
||||||
{
|
{
|
||||||
void SendLowPriorityEmailMessage(string subject, string body);
|
void SendLowPriorityEmailMessage(string subject, string body);
|
||||||
void SendHighPriorityEmailMessage(string subject, string body);
|
void SendHighPriorityEmailMessage(string subject, string body);
|
||||||
void SendNormalPriorityEmailMessage(string subject, string body);
|
void SendNormalPriorityEmailMessage(string subject, string body);
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,8 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
namespace Adaptation.Shared.Metrology
|
namespace Adaptation.Shared.Metrology;
|
||||||
{
|
|
||||||
|
|
||||||
public class ScopeInfo : Properties.IScopeInfo
|
public class ScopeInfo : Properties.IScopeInfo
|
||||||
{
|
{
|
||||||
@ -296,11 +295,6 @@ namespace Adaptation.Shared.Metrology
|
|||||||
FileName = string.Concat(FileNameWithoutExtension, ".txt");
|
FileName = string.Concat(FileNameWithoutExtension, ".txt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public ScopeInfo ShallowCopy()
|
public ScopeInfo ShallowCopy() => (ScopeInfo)MemberwiseClone();
|
||||||
{
|
|
||||||
return (ScopeInfo)MemberwiseClone();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
@ -1,5 +1,4 @@
|
|||||||
namespace Adaptation.Shared.Metrology
|
namespace Adaptation.Shared.Metrology;
|
||||||
{
|
|
||||||
|
|
||||||
public partial class WS
|
public partial class WS
|
||||||
{
|
{
|
||||||
@ -20,5 +19,3 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
@ -1,8 +1,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
|
||||||
namespace Adaptation.Shared.Metrology
|
namespace Adaptation.Shared.Metrology;
|
||||||
{
|
|
||||||
|
|
||||||
public partial class WS
|
public partial class WS
|
||||||
{
|
{
|
||||||
@ -22,12 +21,7 @@ namespace Adaptation.Shared.Metrology
|
|||||||
public List<string> Warnings { get; set; }
|
public List<string> Warnings { get; set; }
|
||||||
|
|
||||||
// this is just a helper function to make displaying the results easier
|
// this is just a helper function to make displaying the results easier
|
||||||
public override string ToString()
|
public override string ToString() => JsonSerializer.Serialize(this, GetType());
|
||||||
{
|
|
||||||
return JsonSerializer.Serialize(this, GetType());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -4,25 +4,24 @@ using System.Net.Http;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
|
||||||
namespace Adaptation.Shared.Metrology
|
namespace Adaptation.Shared.Metrology;
|
||||||
{
|
|
||||||
|
|
||||||
public partial class WS
|
public partial class WS
|
||||||
{
|
{
|
||||||
|
|
||||||
public static Tuple<string, Results> SendData(string url, object payload, int timeoutSeconds = 120)
|
public static Tuple<string, Results> SendData(string url, object payload, int timeoutSeconds = 120)
|
||||||
{
|
{
|
||||||
Results results = new Results();
|
Results results = new();
|
||||||
string resultsJson = string.Empty;
|
string resultsJson = string.Empty;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string json = JsonSerializer.Serialize(payload, payload.GetType());
|
string json = JsonSerializer.Serialize(payload, payload.GetType());
|
||||||
if (string.IsNullOrEmpty(url) || !url.Contains(":") || !url.Contains("."))
|
if (string.IsNullOrEmpty(url) || !url.Contains(":") || !url.Contains("."))
|
||||||
throw new Exception("Invalid URL");
|
throw new Exception("Invalid URL");
|
||||||
using (HttpClient httpClient = new HttpClient())
|
using (HttpClient httpClient = new())
|
||||||
{
|
{
|
||||||
httpClient.Timeout = new TimeSpan(0, 0, 0, timeoutSeconds, 0);
|
httpClient.Timeout = new TimeSpan(0, 0, 0, timeoutSeconds, 0);
|
||||||
HttpRequestMessage httpRequestMessage = new HttpRequestMessage
|
HttpRequestMessage httpRequestMessage = new()
|
||||||
{
|
{
|
||||||
RequestUri = new Uri(url),
|
RequestUri = new Uri(url),
|
||||||
Method = HttpMethod.Post,
|
Method = HttpMethod.Post,
|
||||||
@ -38,10 +37,10 @@ namespace Adaptation.Shared.Metrology
|
|||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Exception exception = e;
|
Exception exception = e;
|
||||||
StringBuilder stringBuilder = new StringBuilder();
|
StringBuilder stringBuilder = new();
|
||||||
while (!(exception is null))
|
while (exception is not null)
|
||||||
{
|
{
|
||||||
stringBuilder.AppendLine(exception.Message);
|
_ = stringBuilder.AppendLine(exception.Message);
|
||||||
exception = exception.InnerException;
|
exception = exception.InnerException;
|
||||||
}
|
}
|
||||||
if (results.Errors is null)
|
if (results.Errors is null)
|
||||||
@ -62,8 +61,7 @@ namespace Adaptation.Shared.Metrology
|
|||||||
// also, this has been made synchronous
|
// also, this has been made synchronous
|
||||||
public static void AttachFile(string url, long attachToHeaderId, string attachToDataUniqueId, byte[] fileContents, string fileName, int timeoutSeconds = 60)
|
public static void AttachFile(string url, long attachToHeaderId, string attachToDataUniqueId, byte[] fileContents, string fileName, int timeoutSeconds = 60)
|
||||||
{
|
{
|
||||||
using (HttpClient httpClient = new HttpClient())
|
using HttpClient httpClient = new();
|
||||||
{
|
|
||||||
string requestUrl = url + "/attachment?headerid=" + attachToHeaderId.ToString();
|
string requestUrl = url + "/attachment?headerid=" + attachToHeaderId.ToString();
|
||||||
if (!string.IsNullOrWhiteSpace(attachToDataUniqueId))
|
if (!string.IsNullOrWhiteSpace(attachToDataUniqueId))
|
||||||
{
|
{
|
||||||
@ -75,8 +73,8 @@ namespace Adaptation.Shared.Metrology
|
|||||||
|
|
||||||
httpClient.Timeout = new TimeSpan(0, 0, 0, timeoutSeconds, 0);
|
httpClient.Timeout = new TimeSpan(0, 0, 0, timeoutSeconds, 0);
|
||||||
|
|
||||||
MultipartFormDataContent multipartFormDataContent = new MultipartFormDataContent();
|
MultipartFormDataContent multipartFormDataContent = new();
|
||||||
ByteArrayContent byteArrayContent = new ByteArrayContent(fileContents);
|
ByteArrayContent byteArrayContent = new(fileContents);
|
||||||
byteArrayContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream");
|
byteArrayContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream");
|
||||||
|
|
||||||
multipartFormDataContent.Add(byteArrayContent, "attachment", fileName);
|
multipartFormDataContent.Add(byteArrayContent, "attachment", fileName);
|
||||||
@ -90,18 +88,17 @@ namespace Adaptation.Shared.Metrology
|
|||||||
|
|
||||||
throw new Exception("Attachment failed: " + resultBody);
|
throw new Exception("Attachment failed: " + resultBody);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public static void AttachFiles(string url, long headerID, List<Attachment> headerAttachments = null, List<Attachment> dataAttachments = null)
|
public static void AttachFiles(string url, long headerID, List<Attachment> headerAttachments = null, List<Attachment> dataAttachments = null)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (!(headerAttachments is null))
|
if (headerAttachments is not null)
|
||||||
{
|
{
|
||||||
foreach (Attachment attachment in headerAttachments)
|
foreach (Attachment attachment in headerAttachments)
|
||||||
AttachFile(url, headerID, "", System.IO.File.ReadAllBytes(attachment.SourceFileName), attachment.DestinationFileName);
|
AttachFile(url, headerID, "", System.IO.File.ReadAllBytes(attachment.SourceFileName), attachment.DestinationFileName);
|
||||||
}
|
}
|
||||||
if (!(dataAttachments is null))
|
if (dataAttachments is not null)
|
||||||
{
|
{
|
||||||
foreach (Attachment attachment in dataAttachments)
|
foreach (Attachment attachment in dataAttachments)
|
||||||
AttachFile(url, headerID, attachment.UniqueId, System.IO.File.ReadAllBytes(attachment.SourceFileName), attachment.DestinationFileName);
|
AttachFile(url, headerID, attachment.UniqueId, System.IO.File.ReadAllBytes(attachment.SourceFileName), attachment.DestinationFileName);
|
||||||
@ -111,10 +108,10 @@ namespace Adaptation.Shared.Metrology
|
|||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Exception exception = e;
|
Exception exception = e;
|
||||||
StringBuilder stringBuilder = new StringBuilder();
|
StringBuilder stringBuilder = new();
|
||||||
while (!(exception is null))
|
while (exception is not null)
|
||||||
{
|
{
|
||||||
stringBuilder.AppendLine(exception.Message);
|
_ = stringBuilder.AppendLine(exception.Message);
|
||||||
exception = exception.InnerException;
|
exception = exception.InnerException;
|
||||||
}
|
}
|
||||||
//MessageBox.Show(msgs.ToString(), "Exception", //MessageBoxButtons.OK, //MessageBoxIcon.Error);
|
//MessageBox.Show(msgs.ToString(), "Exception", //MessageBoxButtons.OK, //MessageBoxIcon.Error);
|
||||||
@ -123,5 +120,3 @@ namespace Adaptation.Shared.Metrology
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
@ -1,5 +1,4 @@
|
|||||||
namespace Adaptation.Shared
|
namespace Adaptation.Shared;
|
||||||
{
|
|
||||||
|
|
||||||
public enum ParameterType
|
public enum ParameterType
|
||||||
{
|
{
|
||||||
@ -9,5 +8,3 @@ namespace Adaptation.Shared
|
|||||||
Boolean = 4,
|
Boolean = 4,
|
||||||
StructuredType = 5
|
StructuredType = 5
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
@ -7,8 +7,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
|
||||||
namespace Adaptation.Shared
|
namespace Adaptation.Shared;
|
||||||
{
|
|
||||||
|
|
||||||
public class ProcessDataStandardFormat
|
public class ProcessDataStandardFormat
|
||||||
{
|
{
|
||||||
@ -38,29 +37,29 @@ namespace Adaptation.Shared
|
|||||||
string format = "MM/dd/yyyy HH:mm:ss";
|
string format = "MM/dd/yyyy HH:mm:ss";
|
||||||
StringBuilder stringBuilder = new();
|
StringBuilder stringBuilder = new();
|
||||||
lines = new string[] { "HEADER_TAG\tHEADER_VALUE", "FORMAT\t2.00", "NUMBER_PASSES\t0001", string.Concat("HEADER_OFFSET\t", headerOffset), string.Concat("DATA_OFFSET\t", dataOffset), string.Concat("END_OFFSET\t", endOffset) }.ToList();
|
lines = new string[] { "HEADER_TAG\tHEADER_VALUE", "FORMAT\t2.00", "NUMBER_PASSES\t0001", string.Concat("HEADER_OFFSET\t", headerOffset), string.Concat("DATA_OFFSET\t", dataOffset), string.Concat("END_OFFSET\t", endOffset) }.ToList();
|
||||||
stringBuilder.Append("\"Time\"").Append('\t');
|
_ = stringBuilder.Append("\"Time\"").Append('\t');
|
||||||
stringBuilder.Append("\"A_LOGISTICS\"").Append('\t');
|
_ = stringBuilder.Append("\"A_LOGISTICS\"").Append('\t');
|
||||||
stringBuilder.Append("\"B_LOGISTICS\"").Append('\t');
|
_ = stringBuilder.Append("\"B_LOGISTICS\"").Append('\t');
|
||||||
for (int i = 0; i < jsonElements.Length;)
|
for (int i = 0; i < jsonElements.Length;)
|
||||||
{
|
{
|
||||||
foreach (JsonProperty jsonProperty in jsonElements[0].EnumerateObject())
|
foreach (JsonProperty jsonProperty in jsonElements[0].EnumerateObject())
|
||||||
{
|
{
|
||||||
columns += 1;
|
columns += 1;
|
||||||
stringBuilder.Append("\"").Append(jsonProperty.Name).Append("\"").Append('\t');
|
_ = stringBuilder.Append('"').Append(jsonProperty.Name).Append('"').Append('\t');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
stringBuilder.Remove(stringBuilder.Length - 1, 1);
|
_ = stringBuilder.Remove(stringBuilder.Length - 1, 1);
|
||||||
lines.Add(stringBuilder.ToString());
|
lines.Add(stringBuilder.ToString());
|
||||||
for (int i = 0; i < jsonElements.Length; i++)
|
for (int i = 0; i < jsonElements.Length; i++)
|
||||||
{
|
{
|
||||||
stringBuilder.Clear();
|
_ = stringBuilder.Clear();
|
||||||
stringBuilder.Append("0.1").Append('\t');
|
_ = stringBuilder.Append("0.1").Append('\t');
|
||||||
stringBuilder.Append("1").Append('\t');
|
_ = stringBuilder.Append('1').Append('\t');
|
||||||
stringBuilder.Append("2").Append('\t');
|
_ = stringBuilder.Append('2').Append('\t');
|
||||||
foreach (JsonProperty jsonProperty in jsonElements[i].EnumerateObject())
|
foreach (JsonProperty jsonProperty in jsonElements[i].EnumerateObject())
|
||||||
stringBuilder.Append(jsonProperty.Value).Append('\t');
|
_ = stringBuilder.Append(jsonProperty.Value).Append('\t');
|
||||||
stringBuilder.Remove(stringBuilder.Length - 1, 1);
|
_ = stringBuilder.Remove(stringBuilder.Length - 1, 1);
|
||||||
lines.Add(stringBuilder.ToString());
|
lines.Add(stringBuilder.ToString());
|
||||||
}
|
}
|
||||||
lines.Add(string.Concat("NUM_DATA_ROWS ", jsonElements.Length.ToString().PadLeft(9, '0')));
|
lines.Add(string.Concat("NUM_DATA_ROWS ", jsonElements.Length.ToString().PadLeft(9, '0')));
|
||||||
@ -78,9 +77,9 @@ namespace Adaptation.Shared
|
|||||||
lines.Add(string.Concat("LOGISTICS_2", '\t', "B_CHAMBER=;B_INFO=", fileRead.EventName, ";B_INFO2=", fileRead.EquipmentType, ";B_JOBID=", fileRead.CellInstanceName, ";B_MES_ENTITY=", fileRead.MesEntity, ";B_MID=", logistics.MID, ";B_NULL_DATA=", fileRead.NullData, ";B_PPID=NO_PPID;B_PROCESS_JOBID=", logistics.ProcessJobID, ";B_PRODUCT=;B_SEQUENCE=", logistics.Sequence, ";B_WAFER_ID=;"));
|
lines.Add(string.Concat("LOGISTICS_2", '\t', "B_CHAMBER=;B_INFO=", fileRead.EventName, ";B_INFO2=", fileRead.EquipmentType, ";B_JOBID=", fileRead.CellInstanceName, ";B_MES_ENTITY=", fileRead.MesEntity, ";B_MID=", logistics.MID, ";B_NULL_DATA=", fileRead.NullData, ";B_PPID=NO_PPID;B_PROCESS_JOBID=", logistics.ProcessJobID, ";B_PRODUCT=;B_SEQUENCE=", logistics.Sequence, ";B_WAFER_ID=;"));
|
||||||
lines.Add("END_HEADER");
|
lines.Add("END_HEADER");
|
||||||
}
|
}
|
||||||
stringBuilder.Clear();
|
_ = stringBuilder.Clear();
|
||||||
foreach (string line in lines)
|
foreach (string line in lines)
|
||||||
stringBuilder.AppendLine(line);
|
_ = stringBuilder.AppendLine(line);
|
||||||
result = stringBuilder.ToString();
|
result = stringBuilder.ToString();
|
||||||
result = result.Replace(headerOffset, result.IndexOf("NUM_DATA_ROWS").ToString().PadLeft(9, '0')).
|
result = result.Replace(headerOffset, result.IndexOf("NUM_DATA_ROWS").ToString().PadLeft(9, '0')).
|
||||||
Replace(dataOffset, result.IndexOf('"').ToString().PadLeft(9, '0')).
|
Replace(dataOffset, result.IndexOf('"').ToString().PadLeft(9, '0')).
|
||||||
@ -98,7 +97,7 @@ namespace Adaptation.Shared
|
|||||||
lines = File.ReadAllLines(reportFullPath);
|
lines = File.ReadAllLines(reportFullPath);
|
||||||
string[] segments;
|
string[] segments;
|
||||||
if (lines.Length < 7)
|
if (lines.Length < 7)
|
||||||
segments = new string[] { };
|
segments = Array.Empty<string>();
|
||||||
else
|
else
|
||||||
segments = lines[6].Trim().Split('\t');
|
segments = lines[6].Trim().Split('\t');
|
||||||
List<string> columns = new();
|
List<string> columns = new();
|
||||||
@ -121,7 +120,7 @@ namespace Adaptation.Shared
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool lookForLogistics = false;
|
bool lookForLogistics = false;
|
||||||
for (int r = 7; r < lines.Count(); r++)
|
for (int r = 7; r < lines.Length; r++)
|
||||||
{
|
{
|
||||||
if (lines[r].StartsWith("NUM_DATA_ROWS"))
|
if (lines[r].StartsWith("NUM_DATA_ROWS"))
|
||||||
lookForLogistics = true;
|
lookForLogistics = true;
|
||||||
@ -132,11 +131,11 @@ namespace Adaptation.Shared
|
|||||||
}
|
}
|
||||||
if (lines[r].StartsWith("LOGISTICS_1"))
|
if (lines[r].StartsWith("LOGISTICS_1"))
|
||||||
{
|
{
|
||||||
for (int i = r; i < lines.Count(); i++)
|
for (int i = r; i < lines.Length; i++)
|
||||||
{
|
{
|
||||||
if (lines[r].StartsWith("END_HEADER"))
|
if (lines[r].StartsWith("END_HEADER"))
|
||||||
break;
|
break;
|
||||||
logistics.AppendLine(lines[i]);
|
_ = logistics.AppendLine(lines[i]);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -159,14 +158,14 @@ namespace Adaptation.Shared
|
|||||||
StringBuilder stringBuilder = new();
|
StringBuilder stringBuilder = new();
|
||||||
foreach (string bodyLine in bodyLines)
|
foreach (string bodyLine in bodyLines)
|
||||||
{
|
{
|
||||||
stringBuilder.Append('{');
|
_ = stringBuilder.Append('{');
|
||||||
segments = bodyLine.Trim().Split('\t');
|
segments = bodyLine.Trim().Split('\t');
|
||||||
if (!lookForNumbers)
|
if (!lookForNumbers)
|
||||||
{
|
{
|
||||||
for (int c = 1; c < segments.Length; c++)
|
for (int c = 1; c < segments.Length; c++)
|
||||||
{
|
{
|
||||||
value = segments[c].Replace("\"", "\\\"").Replace("\\", "\\\\");
|
value = segments[c].Replace("\"", "\\\"").Replace("\\", "\\\\");
|
||||||
stringBuilder.Append('"').Append(columns[c]).Append("\":\"").Append(value).Append("\",");
|
_ = stringBuilder.Append('"').Append(columns[c]).Append("\":\"").Append(value).Append("\",");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -175,17 +174,17 @@ namespace Adaptation.Shared
|
|||||||
{
|
{
|
||||||
value = segments[c].Replace("\"", "\\\"").Replace("\\", "\\\\");
|
value = segments[c].Replace("\"", "\\\"").Replace("\\", "\\\\");
|
||||||
if (string.IsNullOrEmpty(value))
|
if (string.IsNullOrEmpty(value))
|
||||||
stringBuilder.Append('"').Append(columns[c]).Append("\":").Append(value).Append("null,");
|
_ = stringBuilder.Append('"').Append(columns[c]).Append("\":").Append(value).Append("null,");
|
||||||
else if (value.All(char.IsDigit))
|
else if (value.All(char.IsDigit))
|
||||||
stringBuilder.Append('"').Append(columns[c]).Append("\":").Append(value).Append(",");
|
_ = stringBuilder.Append('"').Append(columns[c]).Append("\":").Append(value).Append(',');
|
||||||
else
|
else
|
||||||
stringBuilder.Append('"').Append(columns[c]).Append("\":\"").Append(value).Append("\",");
|
_ = stringBuilder.Append('"').Append(columns[c]).Append("\":\"").Append(value).Append("\",");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stringBuilder.Remove(stringBuilder.Length - 1, 1);
|
_ = stringBuilder.Remove(stringBuilder.Length - 1, 1);
|
||||||
stringBuilder.AppendLine("},");
|
_ = stringBuilder.AppendLine("},");
|
||||||
}
|
}
|
||||||
stringBuilder.Remove(stringBuilder.Length - 3, 3);
|
_ = stringBuilder.Remove(stringBuilder.Length - 3, 3);
|
||||||
results = JsonSerializer.Deserialize<JsonElement[]>(string.Concat("[", stringBuilder, "]"));
|
results = JsonSerializer.Deserialize<JsonElement[]>(string.Concat("[", stringBuilder, "]"));
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
@ -268,25 +267,13 @@ namespace Adaptation.Shared
|
|||||||
return string.Concat(((int)searchFor).ToString().PadLeft(2, '0'), separator, searchFor.ToString().Replace("In", string.Concat(separator, "In")).Replace("Ex", string.Concat(separator, "Ex")));
|
return string.Concat(((int)searchFor).ToString().PadLeft(2, '0'), separator, searchFor.ToString().Replace("In", string.Concat(separator, "In")).Replace("Ex", string.Concat(separator, "Ex")));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string EquipmentIntegration(bool addSpaces = true, char separator = ' ')
|
public static string EquipmentIntegration(bool addSpaces = true, char separator = ' ') => GetString(SearchFor.EquipmentIntegration, addSpaces, separator);
|
||||||
{
|
|
||||||
return GetString(SearchFor.EquipmentIntegration, addSpaces, separator);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string BusinessIntegration(bool addSpaces = true, char separator = ' ')
|
public static string BusinessIntegration(bool addSpaces = true, char separator = ' ') => GetString(SearchFor.BusinessIntegration, addSpaces, separator);
|
||||||
{
|
|
||||||
return GetString(SearchFor.BusinessIntegration, addSpaces, separator);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string SystemExport(bool addSpaces = true, char separator = ' ')
|
public static string SystemExport(bool addSpaces = true, char separator = ' ') => GetString(SearchFor.SystemExport, addSpaces, separator);
|
||||||
{
|
|
||||||
return GetString(SearchFor.SystemExport, addSpaces, separator);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string Archive(bool addSpaces = true, char separator = ' ')
|
public static string Archive(bool addSpaces = true, char separator = ' ') => GetString(SearchFor.Archive, addSpaces, separator);
|
||||||
{
|
|
||||||
return GetString(SearchFor.Archive, addSpaces, separator);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string GetLines(Logistics logistics, Properties.IScopeInfo scopeInfo, List<string> names, Dictionary<string, List<string>> keyValuePairs, string dateFormat, string timeFormat, List<string> pairedParameterNames, bool useDateTimeFromSequence = true, string format = "", List<string> ignoreParameterNames = null)
|
public static string GetLines(Logistics logistics, Properties.IScopeInfo scopeInfo, List<string> names, Dictionary<string, List<string>> keyValuePairs, string dateFormat, string timeFormat, List<string> pairedParameterNames, bool useDateTimeFromSequence = true, string format = "", List<string> ignoreParameterNames = null)
|
||||||
{
|
{
|
||||||
@ -301,7 +288,7 @@ namespace Adaptation.Shared
|
|||||||
const string columnDate = "Date";
|
const string columnDate = "Date";
|
||||||
const string columnTime = "Time";
|
const string columnTime = "Time";
|
||||||
const string firstDuplicate = "_1";
|
const string firstDuplicate = "_1";
|
||||||
result.AppendLine(scopeInfo.Header);
|
_ = result.AppendLine(scopeInfo.Header);
|
||||||
StringBuilder line = new();
|
StringBuilder line = new();
|
||||||
if (logistics.NullData is null)
|
if (logistics.NullData is null)
|
||||||
nullData = string.Empty;
|
nullData = string.Empty;
|
||||||
@ -310,8 +297,8 @@ namespace Adaptation.Shared
|
|||||||
int count = (from l in keyValuePairs select l.Value.Count).Min();
|
int count = (from l in keyValuePairs select l.Value.Count).Min();
|
||||||
for (int r = 0; r < count; r++)
|
for (int r = 0; r < count; r++)
|
||||||
{
|
{
|
||||||
line.Clear();
|
_ = line.Clear();
|
||||||
line.Append("!");
|
_ = line.Append('!');
|
||||||
foreach (KeyValuePair<string, List<string>> keyValuePair in keyValuePairs)
|
foreach (KeyValuePair<string, List<string>> keyValuePair in keyValuePairs)
|
||||||
{
|
{
|
||||||
if (!names.Contains(keyValuePair.Key))
|
if (!names.Contains(keyValuePair.Key))
|
||||||
@ -323,29 +310,29 @@ namespace Adaptation.Shared
|
|||||||
if (string.IsNullOrEmpty(keyValuePair.Value[r]) || keyValuePair.Value[r] == nullData)
|
if (string.IsNullOrEmpty(keyValuePair.Value[r]) || keyValuePair.Value[r] == nullData)
|
||||||
continue;
|
continue;
|
||||||
else
|
else
|
||||||
result.Append(line).Append(keyValuePair.Key).Append(';').AppendLine(keyValuePair.Value[r]);
|
_ = result.Append(line).Append(keyValuePair.Key).Append(';').AppendLine(keyValuePair.Value[r]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (useDateTimeFromSequence && keyValuePair.Key == columnDate)
|
if (useDateTimeFromSequence && keyValuePair.Key == columnDate)
|
||||||
line.Append(logistics.DateTimeFromSequence.ToString(dateFormat));
|
_ = line.Append(logistics.DateTimeFromSequence.ToString(dateFormat));
|
||||||
else if (useDateTimeFromSequence && keyValuePair.Key == columnTime)
|
else if (useDateTimeFromSequence && keyValuePair.Key == columnTime)
|
||||||
line.Append(logistics.DateTimeFromSequence.ToString(timeFormat));
|
_ = line.Append(logistics.DateTimeFromSequence.ToString(timeFormat));
|
||||||
else if (!useDateTimeFromSequence && keyValuePair.Key == columnDate && keyValuePair.Value[r].Length == format.Length)
|
else if (!useDateTimeFromSequence && keyValuePair.Key == columnDate && keyValuePair.Value[r].Length == format.Length)
|
||||||
line.Append(DateTime.ParseExact(keyValuePair.Value[r], format, CultureInfo.InvariantCulture).ToString(dateFormat));
|
_ = line.Append(DateTime.ParseExact(keyValuePair.Value[r], format, CultureInfo.InvariantCulture).ToString(dateFormat));
|
||||||
else if (!useDateTimeFromSequence && keyValuePair.Key == columnTime && keyValuePairs.ContainsKey(string.Concat(keyValuePair.Key, firstDuplicate)) && keyValuePairs[string.Concat(keyValuePair.Key, firstDuplicate)][r].Length == format.Length)
|
else if (!useDateTimeFromSequence && keyValuePair.Key == columnTime && keyValuePairs.ContainsKey(string.Concat(keyValuePair.Key, firstDuplicate)) && keyValuePairs[string.Concat(keyValuePair.Key, firstDuplicate)][r].Length == format.Length)
|
||||||
line.Append(DateTime.ParseExact(keyValuePairs[string.Concat(keyValuePair.Key, firstDuplicate)][r], format, CultureInfo.InvariantCulture).ToString(timeFormat));
|
_ = line.Append(DateTime.ParseExact(keyValuePairs[string.Concat(keyValuePair.Key, firstDuplicate)][r], format, CultureInfo.InvariantCulture).ToString(timeFormat));
|
||||||
else if (string.IsNullOrEmpty(keyValuePair.Value[r]) || keyValuePair.Value[r] == nullData)
|
else if (string.IsNullOrEmpty(keyValuePair.Value[r]) || keyValuePair.Value[r] == nullData)
|
||||||
line.Append(nullData);
|
_ = line.Append(nullData);
|
||||||
else
|
else
|
||||||
line.Append(keyValuePair.Value[r]);
|
_ = line.Append(keyValuePair.Value[r]);
|
||||||
line.Append(';');
|
_ = line.Append(';');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!pairedParameterNames.Any())
|
if (!pairedParameterNames.Any())
|
||||||
{
|
{
|
||||||
line.Remove(line.Length - 1, 1);
|
_ = line.Remove(line.Length - 1, 1);
|
||||||
result.AppendLine(line.ToString());
|
_ = result.AppendLine(line.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result.ToString();
|
return result.ToString();
|
||||||
@ -401,19 +388,19 @@ namespace Adaptation.Shared
|
|||||||
vs[s] = segments[s].Length;
|
vs[s] = segments[s].Length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stringBuilder.Clear();
|
_ = stringBuilder.Clear();
|
||||||
for (int s = 0; s < segments.Length; s++)
|
for (int s = 0; s < segments.Length; s++)
|
||||||
stringBuilder.Append((s + 1).ToString().PadLeft(vs[s], ' ')).Append(outputSeperator);
|
_ = stringBuilder.Append((s + 1).ToString().PadLeft(vs[s], ' ')).Append(outputSeperator);
|
||||||
stringBuilder.Remove(stringBuilder.Length - 1, 1);
|
_ = stringBuilder.Remove(stringBuilder.Length - 1, 1);
|
||||||
results.Add(stringBuilder.ToString());
|
results.Add(stringBuilder.ToString());
|
||||||
for (int i = group[0]; i <= group[1]; i++)
|
for (int i = group[0]; i <= group[1]; i++)
|
||||||
{
|
{
|
||||||
line = lines[i];
|
line = lines[i];
|
||||||
stringBuilder.Clear();
|
_ = stringBuilder.Clear();
|
||||||
segments = line.Split(inputSeperator);
|
segments = line.Split(inputSeperator);
|
||||||
for (int s = 0; s < segments.Length; s++)
|
for (int s = 0; s < segments.Length; s++)
|
||||||
stringBuilder.Append(segments[s].PadLeft(vs[s], ' ')).Append(outputSeperator);
|
_ = stringBuilder.Append(segments[s].PadLeft(vs[s], ' ')).Append(outputSeperator);
|
||||||
stringBuilder.Remove(stringBuilder.Length - 1, 1);
|
_ = stringBuilder.Remove(stringBuilder.Length - 1, 1);
|
||||||
results.Add(stringBuilder.ToString());
|
results.Add(stringBuilder.ToString());
|
||||||
}
|
}
|
||||||
results.Add(string.Empty);
|
results.Add(string.Empty);
|
||||||
@ -422,5 +409,3 @@ namespace Adaptation.Shared
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
@ -1,5 +1,4 @@
|
|||||||
namespace Adaptation.Shared.Properties
|
namespace Adaptation.Shared.Properties;
|
||||||
{
|
|
||||||
|
|
||||||
public interface IDescription
|
public interface IDescription
|
||||||
{
|
{
|
||||||
@ -9,5 +8,3 @@ namespace Adaptation.Shared.Properties
|
|||||||
int Index { get; }
|
int Index { get; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
@ -1,5 +1,4 @@
|
|||||||
namespace Adaptation.Shared.Properties
|
namespace Adaptation.Shared.Properties;
|
||||||
{
|
|
||||||
|
|
||||||
public interface IFileRead
|
public interface IFileRead
|
||||||
{
|
{
|
||||||
@ -16,5 +15,3 @@ namespace Adaptation.Shared.Properties
|
|||||||
string CellInstanceConnectionName { get; }
|
string CellInstanceConnectionName { get; }
|
||||||
string ParameterizedModelObjectDefinitionType { get; }
|
string ParameterizedModelObjectDefinitionType { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
@ -1,8 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Adaptation.Shared.Properties
|
namespace Adaptation.Shared.Properties;
|
||||||
{
|
|
||||||
|
|
||||||
public interface ILogistics
|
public interface ILogistics
|
||||||
{
|
{
|
||||||
@ -21,5 +20,3 @@ namespace Adaptation.Shared.Properties
|
|||||||
public List<Logistics2> Logistics2 { get; set; }
|
public List<Logistics2> Logistics2 { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
@ -1,5 +1,4 @@
|
|||||||
namespace Adaptation.Shared.Properties
|
namespace Adaptation.Shared.Properties;
|
||||||
{
|
|
||||||
|
|
||||||
public interface ILogistics2
|
public interface ILogistics2
|
||||||
{
|
{
|
||||||
@ -13,5 +12,3 @@ namespace Adaptation.Shared.Properties
|
|||||||
public string Recipe { get; }
|
public string Recipe { get; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
@ -1,7 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Adaptation.Shared.Properties
|
namespace Adaptation.Shared.Properties;
|
||||||
{
|
|
||||||
|
|
||||||
public interface IProcessData
|
public interface IProcessData
|
||||||
{
|
{
|
||||||
@ -9,5 +8,3 @@ namespace Adaptation.Shared.Properties
|
|||||||
List<object> Details { get; }
|
List<object> Details { get; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
@ -1,7 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Adaptation.Shared.Properties
|
namespace Adaptation.Shared.Properties;
|
||||||
{
|
|
||||||
|
|
||||||
public interface IScopeInfo
|
public interface IScopeInfo
|
||||||
{
|
{
|
||||||
@ -16,5 +15,3 @@ namespace Adaptation.Shared.Properties
|
|||||||
string FileNameWithoutExtension { get; }
|
string FileNameWithoutExtension { get; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
@ -1,5 +1,4 @@
|
|||||||
namespace Adaptation.Shared
|
namespace Adaptation.Shared;
|
||||||
{
|
|
||||||
|
|
||||||
public enum Test
|
public enum Test
|
||||||
{
|
{
|
||||||
@ -21,15 +20,20 @@ namespace Adaptation.Shared
|
|||||||
DailyRPMXY = 18,
|
DailyRPMXY = 18,
|
||||||
Denton = 9,
|
Denton = 9,
|
||||||
DiffusionLength = 45,
|
DiffusionLength = 45,
|
||||||
|
GRATXTCenter = 51,
|
||||||
|
GRATXTEdge = 52, //Largest
|
||||||
|
GrowthRateXML = 50,
|
||||||
Hall = 10,
|
Hall = 10,
|
||||||
HgCV = 23,
|
HgCV = 23,
|
||||||
|
JVXRD = 47,
|
||||||
Lehighton = 13,
|
Lehighton = 13,
|
||||||
|
LogbookCAC = 49,
|
||||||
Microscope = 46,
|
Microscope = 46,
|
||||||
MonthlyCV = 4,
|
MonthlyCV = 4,
|
||||||
MonthlyHall = 11,
|
MonthlyHall = 11,
|
||||||
MonthlyXRD = 32,
|
MonthlyXRD = 32,
|
||||||
Photoreflectance = 22,
|
Photoreflectance = 22,
|
||||||
PlatoA = 48, //Largest
|
PlatoA = 48,
|
||||||
RPMAverage = 16,
|
RPMAverage = 16,
|
||||||
RPMPLRatio = 17,
|
RPMPLRatio = 17,
|
||||||
RPMXY = 15,
|
RPMXY = 15,
|
||||||
@ -50,8 +54,5 @@ namespace Adaptation.Shared
|
|||||||
WeeklyXRDSLStks = 43,
|
WeeklyXRDSLStks = 43,
|
||||||
WeeklyXRDXRR = 44,
|
WeeklyXRDXRR = 44,
|
||||||
XRDWeightedAverage = 31,
|
XRDWeightedAverage = 31,
|
||||||
JVXRD = 47,
|
XRDXY = 30,
|
||||||
XRDXY = 30
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
@ -7,19 +7,16 @@ using System.Diagnostics;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
namespace _Tests.CreateSelfDescription.Staging.v2_36_3
|
namespace _Tests.CreateSelfDescription.Staging.v2_36_3;
|
||||||
{
|
|
||||||
|
|
||||||
[TestClass]
|
[TestClass]
|
||||||
public class BIORAD2 : EAFLoggingUnitTesting
|
public class BIORAD2 : EAFLoggingUnitTesting
|
||||||
{
|
{
|
||||||
|
internal static BIORAD2 EAFLoggingUnitTesting { get; private set; }
|
||||||
private static BIORAD2 _EAFLoggingUnitTesting;
|
|
||||||
internal static BIORAD2 EAFLoggingUnitTesting => _EAFLoggingUnitTesting;
|
|
||||||
|
|
||||||
public BIORAD2() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
public BIORAD2() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||||
{
|
{
|
||||||
if (_EAFLoggingUnitTesting is null)
|
if (EAFLoggingUnitTesting is null)
|
||||||
throw new Exception();
|
throw new Exception();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,10 +27,10 @@ namespace _Tests.CreateSelfDescription.Staging.v2_36_3
|
|||||||
[ClassInitialize]
|
[ClassInitialize]
|
||||||
public static void ClassInitialize(TestContext testContext)
|
public static void ClassInitialize(TestContext testContext)
|
||||||
{
|
{
|
||||||
if (_EAFLoggingUnitTesting is null)
|
if (EAFLoggingUnitTesting is null)
|
||||||
_EAFLoggingUnitTesting = new BIORAD2(testContext);
|
EAFLoggingUnitTesting = new BIORAD2(testContext);
|
||||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize"));
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize"));
|
||||||
string[] fileNameAndText = _EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName);
|
string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName);
|
||||||
File.WriteAllText(fileNameAndText[0], fileNameAndText[1]);
|
File.WriteAllText(fileNameAndText[0], fileNameAndText[1]);
|
||||||
File.WriteAllText(fileNameAndText[2], fileNameAndText[3]);
|
File.WriteAllText(fileNameAndText[2], fileNameAndText[3]);
|
||||||
}
|
}
|
||||||
@ -41,10 +38,10 @@ namespace _Tests.CreateSelfDescription.Staging.v2_36_3
|
|||||||
[ClassCleanup()]
|
[ClassCleanup()]
|
||||||
public static void ClassCleanup()
|
public static void ClassCleanup()
|
||||||
{
|
{
|
||||||
if (!(_EAFLoggingUnitTesting.Logger is null))
|
if (EAFLoggingUnitTesting.Logger is not null)
|
||||||
_EAFLoggingUnitTesting.Logger.LogInformation("Cleanup");
|
EAFLoggingUnitTesting.Logger.LogInformation("Cleanup");
|
||||||
if (!(_EAFLoggingUnitTesting is null))
|
if (EAFLoggingUnitTesting is not null)
|
||||||
_EAFLoggingUnitTesting.Dispose();
|
EAFLoggingUnitTesting.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -52,15 +49,13 @@ namespace _Tests.CreateSelfDescription.Staging.v2_36_3
|
|||||||
{
|
{
|
||||||
string check = "*.txt";
|
string check = "*.txt";
|
||||||
MethodBase methodBase = new StackFrame().GetMethod();
|
MethodBase methodBase = new StackFrame().GetMethod();
|
||||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||||
string[] fileNameAndJson = _EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||||
IFileRead fileRead = _EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -7,19 +7,16 @@ using System.Diagnostics;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
namespace _Tests.CreateSelfDescription.Staging.v2_36_3
|
namespace _Tests.CreateSelfDescription.Staging.v2_36_3;
|
||||||
{
|
|
||||||
|
|
||||||
[TestClass]
|
[TestClass]
|
||||||
public class BIORAD3 : EAFLoggingUnitTesting
|
public class BIORAD3 : EAFLoggingUnitTesting
|
||||||
{
|
{
|
||||||
|
internal static BIORAD3 EAFLoggingUnitTesting { get; private set; }
|
||||||
private static BIORAD3 _EAFLoggingUnitTesting;
|
|
||||||
internal static BIORAD3 EAFLoggingUnitTesting => _EAFLoggingUnitTesting;
|
|
||||||
|
|
||||||
public BIORAD3() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
public BIORAD3() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||||
{
|
{
|
||||||
if (_EAFLoggingUnitTesting is null)
|
if (EAFLoggingUnitTesting is null)
|
||||||
throw new Exception();
|
throw new Exception();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,10 +27,10 @@ namespace _Tests.CreateSelfDescription.Staging.v2_36_3
|
|||||||
[ClassInitialize]
|
[ClassInitialize]
|
||||||
public static void ClassInitialize(TestContext testContext)
|
public static void ClassInitialize(TestContext testContext)
|
||||||
{
|
{
|
||||||
if (_EAFLoggingUnitTesting is null)
|
if (EAFLoggingUnitTesting is null)
|
||||||
_EAFLoggingUnitTesting = new BIORAD3(testContext);
|
EAFLoggingUnitTesting = new BIORAD3(testContext);
|
||||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize"));
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize"));
|
||||||
string[] fileNameAndText = _EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName);
|
string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName);
|
||||||
File.WriteAllText(fileNameAndText[0], fileNameAndText[1]);
|
File.WriteAllText(fileNameAndText[0], fileNameAndText[1]);
|
||||||
File.WriteAllText(fileNameAndText[2], fileNameAndText[3]);
|
File.WriteAllText(fileNameAndText[2], fileNameAndText[3]);
|
||||||
}
|
}
|
||||||
@ -41,10 +38,10 @@ namespace _Tests.CreateSelfDescription.Staging.v2_36_3
|
|||||||
[ClassCleanup()]
|
[ClassCleanup()]
|
||||||
public static void ClassCleanup()
|
public static void ClassCleanup()
|
||||||
{
|
{
|
||||||
if (!(_EAFLoggingUnitTesting.Logger is null))
|
if (EAFLoggingUnitTesting.Logger is not null)
|
||||||
_EAFLoggingUnitTesting.Logger.LogInformation("Cleanup");
|
EAFLoggingUnitTesting.Logger.LogInformation("Cleanup");
|
||||||
if (!(_EAFLoggingUnitTesting is null))
|
if (EAFLoggingUnitTesting is not null)
|
||||||
_EAFLoggingUnitTesting.Dispose();
|
EAFLoggingUnitTesting.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -52,15 +49,13 @@ namespace _Tests.CreateSelfDescription.Staging.v2_36_3
|
|||||||
{
|
{
|
||||||
string check = "*.txt";
|
string check = "*.txt";
|
||||||
MethodBase methodBase = new StackFrame().GetMethod();
|
MethodBase methodBase = new StackFrame().GetMethod();
|
||||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||||
string[] fileNameAndJson = _EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||||
IFileRead fileRead = _EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -7,19 +7,16 @@ using System.Diagnostics;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
namespace _Tests.CreateSelfDescription.Staging.v2_36_3
|
namespace _Tests.CreateSelfDescription.Staging.v2_36_3;
|
||||||
{
|
|
||||||
|
|
||||||
[TestClass]
|
[TestClass]
|
||||||
public class MET08THFTIRQS408M : EAFLoggingUnitTesting
|
public class MET08THFTIRQS408M : EAFLoggingUnitTesting
|
||||||
{
|
{
|
||||||
|
internal static MET08THFTIRQS408M EAFLoggingUnitTesting { get; private set; }
|
||||||
private static MET08THFTIRQS408M _EAFLoggingUnitTesting;
|
|
||||||
internal static MET08THFTIRQS408M EAFLoggingUnitTesting => _EAFLoggingUnitTesting;
|
|
||||||
|
|
||||||
public MET08THFTIRQS408M() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
public MET08THFTIRQS408M() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||||
{
|
{
|
||||||
if (_EAFLoggingUnitTesting is null)
|
if (EAFLoggingUnitTesting is null)
|
||||||
throw new Exception();
|
throw new Exception();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,10 +27,10 @@ namespace _Tests.CreateSelfDescription.Staging.v2_36_3
|
|||||||
[ClassInitialize]
|
[ClassInitialize]
|
||||||
public static void ClassInitialize(TestContext testContext)
|
public static void ClassInitialize(TestContext testContext)
|
||||||
{
|
{
|
||||||
if (_EAFLoggingUnitTesting is null)
|
if (EAFLoggingUnitTesting is null)
|
||||||
_EAFLoggingUnitTesting = new MET08THFTIRQS408M(testContext);
|
EAFLoggingUnitTesting = new MET08THFTIRQS408M(testContext);
|
||||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize"));
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize"));
|
||||||
string[] fileNameAndText = _EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName);
|
string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName);
|
||||||
File.WriteAllText(fileNameAndText[0], fileNameAndText[1]);
|
File.WriteAllText(fileNameAndText[0], fileNameAndText[1]);
|
||||||
File.WriteAllText(fileNameAndText[2], fileNameAndText[3]);
|
File.WriteAllText(fileNameAndText[2], fileNameAndText[3]);
|
||||||
}
|
}
|
||||||
@ -41,10 +38,10 @@ namespace _Tests.CreateSelfDescription.Staging.v2_36_3
|
|||||||
[ClassCleanup()]
|
[ClassCleanup()]
|
||||||
public static void ClassCleanup()
|
public static void ClassCleanup()
|
||||||
{
|
{
|
||||||
if (!(_EAFLoggingUnitTesting.Logger is null))
|
if (EAFLoggingUnitTesting.Logger is not null)
|
||||||
_EAFLoggingUnitTesting.Logger.LogInformation("Cleanup");
|
EAFLoggingUnitTesting.Logger.LogInformation("Cleanup");
|
||||||
if (!(_EAFLoggingUnitTesting is null))
|
if (EAFLoggingUnitTesting is not null)
|
||||||
_EAFLoggingUnitTesting.Dispose();
|
EAFLoggingUnitTesting.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -52,13 +49,13 @@ namespace _Tests.CreateSelfDescription.Staging.v2_36_3
|
|||||||
{
|
{
|
||||||
string check = "~IsXToOpenInsightMetrologyViewer";
|
string check = "~IsXToOpenInsightMetrologyViewer";
|
||||||
MethodBase methodBase = new StackFrame().GetMethod();
|
MethodBase methodBase = new StackFrame().GetMethod();
|
||||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||||
string[] fileNameAndJson = _EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||||
IFileRead fileRead = _EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -66,13 +63,13 @@ namespace _Tests.CreateSelfDescription.Staging.v2_36_3
|
|||||||
{
|
{
|
||||||
string check = "~IsXToIQSSi";
|
string check = "~IsXToIQSSi";
|
||||||
MethodBase methodBase = new StackFrame().GetMethod();
|
MethodBase methodBase = new StackFrame().GetMethod();
|
||||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||||
string[] fileNameAndJson = _EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||||
IFileRead fileRead = _EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -80,13 +77,13 @@ namespace _Tests.CreateSelfDescription.Staging.v2_36_3
|
|||||||
{
|
{
|
||||||
string check = "~IsXToOpenInsight";
|
string check = "~IsXToOpenInsight";
|
||||||
MethodBase methodBase = new StackFrame().GetMethod();
|
MethodBase methodBase = new StackFrame().GetMethod();
|
||||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||||
string[] fileNameAndJson = _EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||||
IFileRead fileRead = _EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -94,13 +91,13 @@ namespace _Tests.CreateSelfDescription.Staging.v2_36_3
|
|||||||
{
|
{
|
||||||
string check = "~IsXToOpenInsightMetrologyViewerAttachments";
|
string check = "~IsXToOpenInsightMetrologyViewerAttachments";
|
||||||
MethodBase methodBase = new StackFrame().GetMethod();
|
MethodBase methodBase = new StackFrame().GetMethod();
|
||||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||||
string[] fileNameAndJson = _EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||||
IFileRead fileRead = _EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -108,13 +105,13 @@ namespace _Tests.CreateSelfDescription.Staging.v2_36_3
|
|||||||
{
|
{
|
||||||
string check = "~IsXToAPC";
|
string check = "~IsXToAPC";
|
||||||
MethodBase methodBase = new StackFrame().GetMethod();
|
MethodBase methodBase = new StackFrame().GetMethod();
|
||||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||||
string[] fileNameAndJson = _EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||||
IFileRead fileRead = _EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -122,13 +119,13 @@ namespace _Tests.CreateSelfDescription.Staging.v2_36_3
|
|||||||
{
|
{
|
||||||
string check = "~IsXToSPaCe";
|
string check = "~IsXToSPaCe";
|
||||||
MethodBase methodBase = new StackFrame().GetMethod();
|
MethodBase methodBase = new StackFrame().GetMethod();
|
||||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||||
string[] fileNameAndJson = _EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||||
IFileRead fileRead = _EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -136,13 +133,13 @@ namespace _Tests.CreateSelfDescription.Staging.v2_36_3
|
|||||||
{
|
{
|
||||||
string check = "~IsXToArchive";
|
string check = "~IsXToArchive";
|
||||||
MethodBase methodBase = new StackFrame().GetMethod();
|
MethodBase methodBase = new StackFrame().GetMethod();
|
||||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||||
string[] fileNameAndJson = _EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||||
IFileRead fileRead = _EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -150,13 +147,13 @@ namespace _Tests.CreateSelfDescription.Staging.v2_36_3
|
|||||||
{
|
{
|
||||||
string check = "~IsArchive";
|
string check = "~IsArchive";
|
||||||
MethodBase methodBase = new StackFrame().GetMethod();
|
MethodBase methodBase = new StackFrame().GetMethod();
|
||||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||||
string[] fileNameAndJson = _EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||||
IFileRead fileRead = _EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -164,15 +161,13 @@ namespace _Tests.CreateSelfDescription.Staging.v2_36_3
|
|||||||
{
|
{
|
||||||
string check = "~IsDummy";
|
string check = "~IsDummy";
|
||||||
MethodBase methodBase = new StackFrame().GetMethod();
|
MethodBase methodBase = new StackFrame().GetMethod();
|
||||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||||
string[] fileNameAndJson = _EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||||
IFileRead fileRead = _EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,61 @@
|
|||||||
|
using Adaptation.Shared.Methods;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
|
using Shared;
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
|
namespace _Tests.CreateSelfDescription.Staging.v2_39_0;
|
||||||
|
|
||||||
|
[TestClass]
|
||||||
|
public class BIORAD2 : EAFLoggingUnitTesting
|
||||||
|
{
|
||||||
|
internal static BIORAD2 EAFLoggingUnitTesting { get; private set; }
|
||||||
|
|
||||||
|
public BIORAD2() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||||
|
{
|
||||||
|
if (EAFLoggingUnitTesting is null)
|
||||||
|
throw new Exception();
|
||||||
|
}
|
||||||
|
|
||||||
|
public BIORAD2(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
[ClassInitialize]
|
||||||
|
public static void ClassInitialize(TestContext testContext)
|
||||||
|
{
|
||||||
|
if (EAFLoggingUnitTesting is null)
|
||||||
|
EAFLoggingUnitTesting = new BIORAD2(testContext);
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize"));
|
||||||
|
string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName);
|
||||||
|
File.WriteAllText(fileNameAndText[0], fileNameAndText[1]);
|
||||||
|
File.WriteAllText(fileNameAndText[2], fileNameAndText[3]);
|
||||||
|
}
|
||||||
|
|
||||||
|
[ClassCleanup()]
|
||||||
|
public static void ClassCleanup()
|
||||||
|
{
|
||||||
|
if (EAFLoggingUnitTesting.Logger is not null)
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation("Cleanup");
|
||||||
|
if (EAFLoggingUnitTesting is not null)
|
||||||
|
EAFLoggingUnitTesting.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Staging__v2_39_0__BIORAD2__QS408M()
|
||||||
|
{
|
||||||
|
string check = "*.txt";
|
||||||
|
MethodBase methodBase = new StackFrame().GetMethod();
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||||
|
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||||
|
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||||
|
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||||
|
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||||
|
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
using Adaptation.Shared.Methods;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
|
using Shared;
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
|
namespace _Tests.CreateSelfDescription.Staging.v2_39_0;
|
||||||
|
|
||||||
|
[TestClass]
|
||||||
|
public class BIORAD3 : EAFLoggingUnitTesting
|
||||||
|
{
|
||||||
|
internal static BIORAD3 EAFLoggingUnitTesting { get; private set; }
|
||||||
|
|
||||||
|
public BIORAD3() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||||
|
{
|
||||||
|
if (EAFLoggingUnitTesting is null)
|
||||||
|
throw new Exception();
|
||||||
|
}
|
||||||
|
|
||||||
|
public BIORAD3(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
[ClassInitialize]
|
||||||
|
public static void ClassInitialize(TestContext testContext)
|
||||||
|
{
|
||||||
|
if (EAFLoggingUnitTesting is null)
|
||||||
|
EAFLoggingUnitTesting = new BIORAD3(testContext);
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize"));
|
||||||
|
string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName);
|
||||||
|
File.WriteAllText(fileNameAndText[0], fileNameAndText[1]);
|
||||||
|
File.WriteAllText(fileNameAndText[2], fileNameAndText[3]);
|
||||||
|
}
|
||||||
|
|
||||||
|
[ClassCleanup()]
|
||||||
|
public static void ClassCleanup()
|
||||||
|
{
|
||||||
|
if (EAFLoggingUnitTesting.Logger is not null)
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation("Cleanup");
|
||||||
|
if (EAFLoggingUnitTesting is not null)
|
||||||
|
EAFLoggingUnitTesting.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Staging__v2_39_0__BIORAD3__QS408M()
|
||||||
|
{
|
||||||
|
string check = "*.txt";
|
||||||
|
MethodBase methodBase = new StackFrame().GetMethod();
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||||
|
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||||
|
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||||
|
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||||
|
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||||
|
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,173 @@
|
|||||||
|
using Adaptation.Shared.Methods;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
|
using Shared;
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
|
namespace _Tests.CreateSelfDescription.Staging.v2_39_0;
|
||||||
|
|
||||||
|
[TestClass]
|
||||||
|
public class MET08THFTIRQS408M : EAFLoggingUnitTesting
|
||||||
|
{
|
||||||
|
internal static MET08THFTIRQS408M EAFLoggingUnitTesting { get; private set; }
|
||||||
|
|
||||||
|
public MET08THFTIRQS408M() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||||
|
{
|
||||||
|
if (EAFLoggingUnitTesting is null)
|
||||||
|
throw new Exception();
|
||||||
|
}
|
||||||
|
|
||||||
|
public MET08THFTIRQS408M(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
[ClassInitialize]
|
||||||
|
public static void ClassInitialize(TestContext testContext)
|
||||||
|
{
|
||||||
|
if (EAFLoggingUnitTesting is null)
|
||||||
|
EAFLoggingUnitTesting = new MET08THFTIRQS408M(testContext);
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize"));
|
||||||
|
string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName);
|
||||||
|
File.WriteAllText(fileNameAndText[0], fileNameAndText[1]);
|
||||||
|
File.WriteAllText(fileNameAndText[2], fileNameAndText[3]);
|
||||||
|
}
|
||||||
|
|
||||||
|
[ClassCleanup()]
|
||||||
|
public static void ClassCleanup()
|
||||||
|
{
|
||||||
|
if (EAFLoggingUnitTesting.Logger is not null)
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation("Cleanup");
|
||||||
|
if (EAFLoggingUnitTesting is not null)
|
||||||
|
EAFLoggingUnitTesting.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M()
|
||||||
|
{
|
||||||
|
string check = "~IsXToOpenInsightMetrologyViewer";
|
||||||
|
MethodBase methodBase = new StackFrame().GetMethod();
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||||
|
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||||
|
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||||
|
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||||
|
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||||
|
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M_()
|
||||||
|
{
|
||||||
|
string check = "~IsXToIQSSi";
|
||||||
|
MethodBase methodBase = new StackFrame().GetMethod();
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||||
|
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||||
|
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||||
|
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||||
|
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||||
|
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M__()
|
||||||
|
{
|
||||||
|
string check = "~IsXToOpenInsight";
|
||||||
|
MethodBase methodBase = new StackFrame().GetMethod();
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||||
|
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||||
|
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||||
|
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||||
|
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||||
|
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M___()
|
||||||
|
{
|
||||||
|
string check = "~IsXToOpenInsightMetrologyViewerAttachments";
|
||||||
|
MethodBase methodBase = new StackFrame().GetMethod();
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||||
|
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||||
|
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||||
|
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||||
|
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||||
|
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M____()
|
||||||
|
{
|
||||||
|
string check = "~IsXToAPC";
|
||||||
|
MethodBase methodBase = new StackFrame().GetMethod();
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||||
|
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||||
|
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||||
|
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||||
|
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||||
|
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M_____()
|
||||||
|
{
|
||||||
|
string check = "~IsXToSPaCe";
|
||||||
|
MethodBase methodBase = new StackFrame().GetMethod();
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||||
|
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||||
|
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||||
|
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||||
|
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||||
|
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M______()
|
||||||
|
{
|
||||||
|
string check = "~IsXToArchive";
|
||||||
|
MethodBase methodBase = new StackFrame().GetMethod();
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||||
|
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||||
|
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||||
|
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||||
|
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||||
|
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M_______()
|
||||||
|
{
|
||||||
|
string check = "~IsArchive";
|
||||||
|
MethodBase methodBase = new StackFrame().GetMethod();
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||||
|
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||||
|
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||||
|
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||||
|
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||||
|
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M________()
|
||||||
|
{
|
||||||
|
string check = "~IsDummy";
|
||||||
|
MethodBase methodBase = new StackFrame().GetMethod();
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||||
|
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||||
|
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||||
|
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||||
|
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||||
|
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||||
|
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,7 +1,6 @@
|
|||||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
|
|
||||||
namespace _Tests.Extract.Staging.v2_36_3
|
namespace _Tests.Extract.Staging.v2_36_3;
|
||||||
{
|
|
||||||
|
|
||||||
[TestClass]
|
[TestClass]
|
||||||
public class BIORAD2
|
public class BIORAD2
|
||||||
@ -17,12 +16,7 @@ namespace _Tests.Extract.Staging.v2_36_3
|
|||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void Staging__v2_36_3__BIORAD2__QS408M()
|
public void Staging__v2_36_3__BIORAD2__QS408M() => _BIORAD2.Staging__v2_36_3__BIORAD2__QS408M();
|
||||||
{
|
|
||||||
_BIORAD2.Staging__v2_36_3__BIORAD2__QS408M();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,8 +8,7 @@ using System.IO;
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
|
||||||
namespace _Tests.Extract.Staging.v2_36_3
|
namespace _Tests.Extract.Staging.v2_36_3;
|
||||||
{
|
|
||||||
|
|
||||||
[TestClass]
|
[TestClass]
|
||||||
public class BIORAD3
|
public class BIORAD3
|
||||||
@ -25,10 +24,7 @@ namespace _Tests.Extract.Staging.v2_36_3
|
|||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void Staging__v2_36_3__BIORAD3__QS408M()
|
public void Staging__v2_36_3__BIORAD3__QS408M() => _BIORAD3.Staging__v2_36_3__BIORAD3__QS408M();
|
||||||
{
|
|
||||||
_BIORAD3.Staging__v2_36_3__BIORAD3__QS408M();
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void Staging__v2_36_3__BIORAD3__QS408M637406016892454000__ReactorAndRDS()
|
public void Staging__v2_36_3__BIORAD3__QS408M637406016892454000__ReactorAndRDS()
|
||||||
@ -44,7 +40,7 @@ namespace _Tests.Extract.Staging.v2_36_3
|
|||||||
Assert.IsFalse(string.IsNullOrEmpty(extractResult?.Item1));
|
Assert.IsFalse(string.IsNullOrEmpty(extractResult?.Item1));
|
||||||
Assert.IsTrue(extractResult.Item3.Length > 0, "extractResult Array Length check!");
|
Assert.IsTrue(extractResult.Item3.Length > 0, "extractResult Array Length check!");
|
||||||
Assert.IsNotNull(extractResult.Item4);
|
Assert.IsNotNull(extractResult.Item4);
|
||||||
Logistics logistics = new Logistics(fileRead);
|
Logistics logistics = new(fileRead);
|
||||||
dateTime = Adaptation.FileHandlers.QS408M.ProcessData.GetDateTime(logistics, string.Empty);
|
dateTime = Adaptation.FileHandlers.QS408M.ProcessData.GetDateTime(logistics, string.Empty);
|
||||||
Assert.IsTrue(dateTime == logistics.DateTimeFromSequence);
|
Assert.IsTrue(dateTime == logistics.DateTimeFromSequence);
|
||||||
dateTime = Adaptation.FileHandlers.QS408M.ProcessData.GetDateTime(logistics, "Tue Nov 10 12:03:56 1970");
|
dateTime = Adaptation.FileHandlers.QS408M.ProcessData.GetDateTime(logistics, "Tue Nov 10 12:03:56 1970");
|
||||||
@ -62,8 +58,6 @@ namespace _Tests.Extract.Staging.v2_36_3
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// dotnet build --runtime win-x64
|
// dotnet build --runtime win-x64
|
||||||
// dotnet test --runtime win-x64 --no-build --filter "FullyQualifiedName~_Tests.Extract.Staging.v2_36_3" --% -- TestRunParameters.Parameter(name=\"Debug\", value=\"Debugger.IsAttached\")
|
// dotnet test --runtime win-x64 --no-build --filter "FullyQualifiedName~_Tests.Extract.Staging.v2_36_3" --% -- TestRunParameters.Parameter(name=\"Debug\", value=\"Debugger.IsAttached\")
|
||||||
// dotnet test --runtime win-x64 --no-build --filter "FullyQualifiedName~_Tests.Extract.Staging.v2_36_3 & ClassName~BIORAD3" --% -- TestRunParameters.Parameter(name=\"Debug\", value=\"Debugger.IsAttached\")
|
// dotnet test --runtime win-x64 --no-build --filter "FullyQualifiedName~_Tests.Extract.Staging.v2_36_3 & ClassName~BIORAD3" --% -- TestRunParameters.Parameter(name=\"Debug\", value=\"Debugger.IsAttached\")
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
|
|
||||||
namespace _Tests.Extract.Staging.v2_36_3
|
namespace _Tests.Extract.Staging.v2_36_3;
|
||||||
{
|
|
||||||
|
|
||||||
[TestClass]
|
[TestClass]
|
||||||
public class MET08THFTIRQS408M
|
public class MET08THFTIRQS408M
|
||||||
@ -17,60 +16,31 @@ namespace _Tests.Extract.Staging.v2_36_3
|
|||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M()
|
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M() => _MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M();
|
||||||
{
|
|
||||||
_MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M();
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M_()
|
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M_() => _MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M_();
|
||||||
{
|
|
||||||
_MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M_();
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M__()
|
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M__() => _MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M__();
|
||||||
{
|
|
||||||
_MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M__();
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M___()
|
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M___() => _MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M___();
|
||||||
{
|
|
||||||
_MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M___();
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M____()
|
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M____() => _MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M____();
|
||||||
{
|
|
||||||
_MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M____();
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M_____()
|
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M_____() => _MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M_____();
|
||||||
{
|
|
||||||
_MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M_____();
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M______()
|
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M______() => _MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M______();
|
||||||
{
|
|
||||||
_MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M______();
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M_______()
|
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M_______() => _MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M_______();
|
||||||
{
|
|
||||||
_MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M_______();
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M________()
|
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M________() => _MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M________();
|
||||||
{
|
|
||||||
_MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M________();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
21
Adaptation/_Tests/Extract/Staging/v2.39.0/BIORAD2.cs
Normal file
21
Adaptation/_Tests/Extract/Staging/v2.39.0/BIORAD2.cs
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
|
|
||||||
|
namespace _Tests.Extract.Staging.v2_39_0;
|
||||||
|
|
||||||
|
[TestClass]
|
||||||
|
public class BIORAD2
|
||||||
|
{
|
||||||
|
|
||||||
|
private static CreateSelfDescription.Staging.v2_39_0.BIORAD2 _BIORAD2;
|
||||||
|
|
||||||
|
[ClassInitialize]
|
||||||
|
public static void ClassInitialize(TestContext testContext)
|
||||||
|
{
|
||||||
|
CreateSelfDescription.Staging.v2_39_0.BIORAD2.ClassInitialize(testContext);
|
||||||
|
_BIORAD2 = CreateSelfDescription.Staging.v2_39_0.BIORAD2.EAFLoggingUnitTesting;
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Staging__v2_39_0__BIORAD2__QS408M() => _BIORAD2.Staging__v2_39_0__BIORAD2__QS408M();
|
||||||
|
|
||||||
|
}
|
59
Adaptation/_Tests/Extract/Staging/v2.39.0/BIORAD3.cs
Normal file
59
Adaptation/_Tests/Extract/Staging/v2.39.0/BIORAD3.cs
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
using Adaptation.Shared;
|
||||||
|
using Adaptation.Shared.Methods;
|
||||||
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Text.Json;
|
||||||
|
|
||||||
|
namespace _Tests.Extract.Staging.v2_39_0;
|
||||||
|
|
||||||
|
[TestClass]
|
||||||
|
public class BIORAD3
|
||||||
|
{
|
||||||
|
|
||||||
|
private static CreateSelfDescription.Staging.v2_39_0.BIORAD3 _BIORAD3;
|
||||||
|
|
||||||
|
[ClassInitialize]
|
||||||
|
public static void ClassInitialize(TestContext testContext)
|
||||||
|
{
|
||||||
|
CreateSelfDescription.Staging.v2_39_0.BIORAD3.ClassInitialize(testContext);
|
||||||
|
_BIORAD3 = CreateSelfDescription.Staging.v2_39_0.BIORAD3.EAFLoggingUnitTesting;
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Staging__v2_39_0__BIORAD3__QS408M() => _BIORAD3.Staging__v2_39_0__BIORAD3__QS408M();
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Staging__v2_39_0__BIORAD3__QS408M637406016892454000__ReactorAndRDS()
|
||||||
|
{
|
||||||
|
DateTime dateTime;
|
||||||
|
string check = "*.txt";
|
||||||
|
_BIORAD3.Staging__v2_39_0__BIORAD3__QS408M();
|
||||||
|
MethodBase methodBase = new StackFrame().GetMethod();
|
||||||
|
string[] variables = _BIORAD3.AdaptationTesting.GetVariables(methodBase, check);
|
||||||
|
Tuple<string, string[], string[]> pdsf = Helpers.Metrology.GetLogisticsColumnsAndBody(variables[2], variables[4]);
|
||||||
|
IFileRead fileRead = _BIORAD3.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false);
|
||||||
|
Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResult = fileRead.ReExtract();
|
||||||
|
Assert.IsFalse(string.IsNullOrEmpty(extractResult?.Item1));
|
||||||
|
Assert.IsTrue(extractResult.Item3.Length > 0, "extractResult Array Length check!");
|
||||||
|
Assert.IsNotNull(extractResult.Item4);
|
||||||
|
Logistics logistics = new(fileRead);
|
||||||
|
dateTime = Adaptation.FileHandlers.QS408M.ProcessData.GetDateTime(logistics, string.Empty);
|
||||||
|
Assert.IsTrue(dateTime == logistics.DateTimeFromSequence);
|
||||||
|
dateTime = Adaptation.FileHandlers.QS408M.ProcessData.GetDateTime(logistics, "Tue Nov 10 12:03:56 1970");
|
||||||
|
Assert.IsTrue(dateTime == logistics.DateTimeFromSequence);
|
||||||
|
Tuple<string, string[], string[]> pdsfNew = Helpers.Metrology.GetLogisticsColumnsAndBody(fileRead, logistics, extractResult, pdsf);
|
||||||
|
Helpers.Metrology.CompareSave(variables[5], pdsf, pdsfNew);
|
||||||
|
string[] json = Helpers.Metrology.GetItem2(pdsf, pdsfNew);
|
||||||
|
Helpers.Metrology.CompareSaveJSON(variables[5], json);
|
||||||
|
Assert.IsTrue(json[0] == json[1], "Item2 check!");
|
||||||
|
string[] join = Helpers.Metrology.GetItem3(pdsf, pdsfNew);
|
||||||
|
Helpers.Metrology.CompareSaveTSV(variables[5], join);
|
||||||
|
Assert.IsTrue(join[0] == join[1], "Item3 (Join) check!");
|
||||||
|
Helpers.Metrology.UpdatePassDirectory(variables[2]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,45 @@
|
|||||||
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
|
|
||||||
|
namespace _Tests.Extract.Staging.v2_39_0;
|
||||||
|
|
||||||
|
[TestClass]
|
||||||
|
public class MET08THFTIRQS408M
|
||||||
|
{
|
||||||
|
|
||||||
|
private static CreateSelfDescription.Staging.v2_39_0.MET08THFTIRQS408M _MET08THFTIRQS408M;
|
||||||
|
|
||||||
|
[ClassInitialize]
|
||||||
|
public static void ClassInitialize(TestContext testContext)
|
||||||
|
{
|
||||||
|
CreateSelfDescription.Staging.v2_39_0.MET08THFTIRQS408M.ClassInitialize(testContext);
|
||||||
|
_MET08THFTIRQS408M = CreateSelfDescription.Staging.v2_39_0.MET08THFTIRQS408M.EAFLoggingUnitTesting;
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M() => _MET08THFTIRQS408M.Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M();
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M_() => _MET08THFTIRQS408M.Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M_();
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M__() => _MET08THFTIRQS408M.Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M__();
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M___() => _MET08THFTIRQS408M.Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M___();
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M____() => _MET08THFTIRQS408M.Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M____();
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M_____() => _MET08THFTIRQS408M.Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M_____();
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M______() => _MET08THFTIRQS408M.Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M______();
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M_______() => _MET08THFTIRQS408M.Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M_______();
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M________() => _MET08THFTIRQS408M.Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M________();
|
||||||
|
|
||||||
|
}
|
@ -9,8 +9,7 @@ using System.Linq;
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
|
||||||
namespace _Tests.Helpers
|
namespace _Tests.Helpers;
|
||||||
{
|
|
||||||
|
|
||||||
public class Metrology
|
public class Metrology
|
||||||
{
|
{
|
||||||
@ -35,7 +34,7 @@ namespace _Tests.Helpers
|
|||||||
string[] pdsfFiles;
|
string[] pdsfFiles;
|
||||||
pdsfFiles = Directory.GetFiles(searchDirectory, searchPattern, SearchOption.TopDirectoryOnly);
|
pdsfFiles = Directory.GetFiles(searchDirectory, searchPattern, SearchOption.TopDirectoryOnly);
|
||||||
if (!pdsfFiles.Any())
|
if (!pdsfFiles.Any())
|
||||||
Process.Start("explorer.exe", searchDirectory);
|
_ = Process.Start("explorer.exe", searchDirectory);
|
||||||
Assert.IsTrue(pdsfFiles.Any(), "GetFiles check");
|
Assert.IsTrue(pdsfFiles.Any(), "GetFiles check");
|
||||||
results = GetLogisticsColumnsAndBody(pdsfFiles[0]);
|
results = GetLogisticsColumnsAndBody(pdsfFiles[0]);
|
||||||
}
|
}
|
||||||
@ -59,7 +58,7 @@ namespace _Tests.Helpers
|
|||||||
|
|
||||||
internal static string[] GetItem2(Tuple<string, string[], string[]> pdsf, Tuple<string, string[], string[]> pdsfNew)
|
internal static string[] GetItem2(Tuple<string, string[], string[]> pdsf, Tuple<string, string[], string[]> pdsfNew)
|
||||||
{
|
{
|
||||||
JsonSerializerOptions jsonSerializerOptions = new JsonSerializerOptions() { WriteIndented = true };
|
JsonSerializerOptions jsonSerializerOptions = new() { WriteIndented = true };
|
||||||
string jsonOld = JsonSerializer.Serialize(pdsf.Item2, pdsf.Item2.GetType(), jsonSerializerOptions);
|
string jsonOld = JsonSerializer.Serialize(pdsf.Item2, pdsf.Item2.GetType(), jsonSerializerOptions);
|
||||||
string jsonNew = JsonSerializer.Serialize(pdsfNew.Item2, pdsfNew.Item2.GetType(), jsonSerializerOptions);
|
string jsonNew = JsonSerializer.Serialize(pdsfNew.Item2, pdsfNew.Item2.GetType(), jsonSerializerOptions);
|
||||||
return new string[] { jsonOld, jsonNew };
|
return new string[] { jsonOld, jsonNew };
|
||||||
@ -109,7 +108,6 @@ namespace _Tests.Helpers
|
|||||||
if (after.Length < ticks.Length)
|
if (after.Length < ticks.Length)
|
||||||
{
|
{
|
||||||
connectionName = after;
|
connectionName = after;
|
||||||
connectionNameAndTicks = ticks;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -129,7 +127,7 @@ namespace _Tests.Helpers
|
|||||||
{
|
{
|
||||||
if (join[0] != join[1])
|
if (join[0] != join[1])
|
||||||
{
|
{
|
||||||
Process.Start("explorer.exe", textFileDirectory);
|
_ = Process.Start("explorer.exe", textFileDirectory);
|
||||||
File.WriteAllText(Path.Combine(textFileDirectory, "0.tsv"), join[0]);
|
File.WriteAllText(Path.Combine(textFileDirectory, "0.tsv"), join[0]);
|
||||||
File.WriteAllText(Path.Combine(textFileDirectory, "1.tsv"), join[1]);
|
File.WriteAllText(Path.Combine(textFileDirectory, "1.tsv"), join[1]);
|
||||||
}
|
}
|
||||||
@ -139,7 +137,7 @@ namespace _Tests.Helpers
|
|||||||
{
|
{
|
||||||
if (json[0] != json[1])
|
if (json[0] != json[1])
|
||||||
{
|
{
|
||||||
Process.Start("explorer.exe", textFileDirectory);
|
_ = Process.Start("explorer.exe", textFileDirectory);
|
||||||
File.WriteAllText(Path.Combine(textFileDirectory, "0.json"), json[0]);
|
File.WriteAllText(Path.Combine(textFileDirectory, "0.json"), json[0]);
|
||||||
File.WriteAllText(Path.Combine(textFileDirectory, "1.json"), json[1]);
|
File.WriteAllText(Path.Combine(textFileDirectory, "1.json"), json[1]);
|
||||||
}
|
}
|
||||||
@ -149,12 +147,10 @@ namespace _Tests.Helpers
|
|||||||
{
|
{
|
||||||
if (pdsf.Item1 != pdsfNew.Item1)
|
if (pdsf.Item1 != pdsfNew.Item1)
|
||||||
{
|
{
|
||||||
Process.Start("explorer.exe", textFileDirectory);
|
_ = Process.Start("explorer.exe", textFileDirectory);
|
||||||
File.WriteAllText(Path.Combine(textFileDirectory, "0.dat"), pdsf.Item1);
|
File.WriteAllText(Path.Combine(textFileDirectory, "0.dat"), pdsf.Item1);
|
||||||
File.WriteAllText(Path.Combine(textFileDirectory, "1.dat"), pdsfNew.Item1);
|
File.WriteAllText(Path.Combine(textFileDirectory, "1.dat"), pdsfNew.Item1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
@ -20,8 +20,7 @@ using System.Xml;
|
|||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
namespace Shared
|
namespace Shared;
|
||||||
{
|
|
||||||
|
|
||||||
public class AdaptationTesting : ISMTP
|
public class AdaptationTesting : ISMTP
|
||||||
{
|
{
|
||||||
@ -50,20 +49,11 @@ namespace Shared
|
|||||||
public Dictionary<string, string> ParameterizedModelObjectDefinitionTypes => _ParameterizedModelObjectDefinitionTypes;
|
public Dictionary<string, string> ParameterizedModelObjectDefinitionTypes => _ParameterizedModelObjectDefinitionTypes;
|
||||||
public Dictionary<string, List<Tuple<string, string>>> EquipmentDictionaryEventDescriptions => _EquipmentDictionaryEventDescriptions;
|
public Dictionary<string, List<Tuple<string, string>>> EquipmentDictionaryEventDescriptions => _EquipmentDictionaryEventDescriptions;
|
||||||
|
|
||||||
void ISMTP.SendLowPriorityEmailMessage(string subject, string body)
|
void ISMTP.SendLowPriorityEmailMessage(string subject, string body) => throw new NotImplementedException();
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ISMTP.SendHighPriorityEmailMessage(string subject, string body)
|
void ISMTP.SendHighPriorityEmailMessage(string subject, string body) => throw new NotImplementedException();
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ISMTP.SendNormalPriorityEmailMessage(string subject, string body)
|
void ISMTP.SendNormalPriorityEmailMessage(string subject, string body) => throw new NotImplementedException();
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public AdaptationTesting(TestContext testContext, bool skipEquipmentDictionary)
|
public AdaptationTesting(TestContext testContext, bool skipEquipmentDictionary)
|
||||||
{
|
{
|
||||||
@ -83,13 +73,13 @@ namespace Shared
|
|||||||
_EquipmentDictionaryEventDescriptions = new Dictionary<string, List<Tuple<string, string>>>();
|
_EquipmentDictionaryEventDescriptions = new Dictionary<string, List<Tuple<string, string>>>();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected string GetEnvironment(TestContext testContext)
|
protected static string GetEnvironment(TestContext testContext)
|
||||||
{
|
{
|
||||||
string result = testContext.TestName.Split('_')[0];
|
string result = testContext.TestName.Split('_')[0];
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected string GetHostNameAndPort(string environment)
|
protected static string GetHostNameAndPort(string environment)
|
||||||
{
|
{
|
||||||
string result;
|
string result;
|
||||||
result = environment switch
|
result = environment switch
|
||||||
@ -127,7 +117,7 @@ namespace Shared
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected string GetCellInstanceConnectionName(string cellInstanceConnectionName)
|
protected static string GetCellInstanceConnectionName(string cellInstanceConnectionName)
|
||||||
{
|
{
|
||||||
string result;
|
string result;
|
||||||
if (string.IsNullOrEmpty(cellInstanceConnectionName) || cellInstanceConnectionName[cellInstanceConnectionName.Length - 1] != '_')
|
if (string.IsNullOrEmpty(cellInstanceConnectionName) || cellInstanceConnectionName[cellInstanceConnectionName.Length - 1] != '_')
|
||||||
@ -135,8 +125,8 @@ namespace Shared
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
bool check = false;
|
bool check = false;
|
||||||
List<char> chars = new List<char>();
|
List<char> chars = new();
|
||||||
StringBuilder stringBuilder = new StringBuilder();
|
StringBuilder stringBuilder = new();
|
||||||
for (int i = cellInstanceConnectionName.Length - 1; i > -1; i--)
|
for (int i = cellInstanceConnectionName.Length - 1; i > -1; i--)
|
||||||
{
|
{
|
||||||
if (!check && cellInstanceConnectionName[i] != '_')
|
if (!check && cellInstanceConnectionName[i] != '_')
|
||||||
@ -147,7 +137,7 @@ namespace Shared
|
|||||||
chars.Add(cellInstanceConnectionName[i]);
|
chars.Add(cellInstanceConnectionName[i]);
|
||||||
}
|
}
|
||||||
for (int i = chars.Count - 1; i > -1; i--)
|
for (int i = chars.Count - 1; i > -1; i--)
|
||||||
stringBuilder.Append(chars[i]);
|
_ = stringBuilder.Append(chars[i]);
|
||||||
result = stringBuilder.ToString();
|
result = stringBuilder.ToString();
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@ -202,7 +192,7 @@ namespace Shared
|
|||||||
string after = methodBaseName.Substring(before.Length);
|
string after = methodBaseName.Substring(before.Length);
|
||||||
string versionDirectory = Path.Combine(testResultsDirectory, _Environment, cellInstanceName, cellInstanceVersionName);
|
string versionDirectory = Path.Combine(testResultsDirectory, _Environment, cellInstanceName, cellInstanceVersionName);
|
||||||
if (!Directory.Exists(versionDirectory))
|
if (!Directory.Exists(versionDirectory))
|
||||||
Directory.CreateDirectory(versionDirectory);
|
_ = Directory.CreateDirectory(versionDirectory);
|
||||||
comment = segments[segments.Length - 1];
|
comment = segments[segments.Length - 1];
|
||||||
if (after.Length < ticks.Length || after == comment)
|
if (after.Length < ticks.Length || after == comment)
|
||||||
{
|
{
|
||||||
@ -223,7 +213,7 @@ namespace Shared
|
|||||||
ticks = connectionNameAndTicks.Substring(cellInstanceConnectionNameFromMethodBaseName.Length);
|
ticks = connectionNameAndTicks.Substring(cellInstanceConnectionNameFromMethodBaseName.Length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (string.IsNullOrEmpty(ticks) || string.IsNullOrEmpty(cellInstanceConnectionNameFromMethodBaseName) || !long.TryParse(ticks, out long _))
|
if (string.IsNullOrEmpty(ticks) || string.IsNullOrEmpty(cellInstanceConnectionNameFromMethodBaseName) || !long.TryParse(ticks, out _))
|
||||||
{
|
{
|
||||||
ticks = string.Empty;
|
ticks = string.Empty;
|
||||||
comment = string.Empty;
|
comment = string.Empty;
|
||||||
@ -233,7 +223,7 @@ namespace Shared
|
|||||||
string methodBaseNameWithActualCICN = GetMethodBaseNameWithActualCICN(methodBaseName, rawCellInstanceName, cellInstanceConnectionNameFromMethodBaseName, cellInstanceConnectionName, ticks);
|
string methodBaseNameWithActualCICN = GetMethodBaseNameWithActualCICN(methodBaseName, rawCellInstanceName, cellInstanceConnectionNameFromMethodBaseName, cellInstanceConnectionName, ticks);
|
||||||
if (string.IsNullOrEmpty(ticks))
|
if (string.IsNullOrEmpty(ticks))
|
||||||
{
|
{
|
||||||
textFiles = new string[] { };
|
textFiles = Array.Empty<string>();
|
||||||
fileFullName = Path.Combine(versionDirectory, methodBaseNameWithActualCICN, $"{cellInstanceConnectionNameFromMethodBaseName}.json");
|
fileFullName = Path.Combine(versionDirectory, methodBaseNameWithActualCICN, $"{cellInstanceConnectionNameFromMethodBaseName}.json");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -243,10 +233,10 @@ namespace Shared
|
|||||||
fileFullName = Path.Combine(versionDirectory, segments[0], $"{cellInstanceConnectionNameFromMethodBaseName}.json");
|
fileFullName = Path.Combine(versionDirectory, segments[0], $"{cellInstanceConnectionNameFromMethodBaseName}.json");
|
||||||
if (!Directory.Exists(textDirectory))
|
if (!Directory.Exists(textDirectory))
|
||||||
{
|
{
|
||||||
textFiles = new string[] { };
|
textFiles = Array.Empty<string>();
|
||||||
string renameDirectory = Path.Combine(Path.GetDirectoryName(textDirectory), $"_Rename - {Path.GetFileName(textDirectory)}");
|
string renameDirectory = Path.Combine(Path.GetDirectoryName(textDirectory), $"_Rename - {Path.GetFileName(textDirectory)}");
|
||||||
Directory.CreateDirectory(renameDirectory);
|
_ = Directory.CreateDirectory(renameDirectory);
|
||||||
Process.Start("explorer.exe", renameDirectory);
|
_ = Process.Start("explorer.exe", renameDirectory);
|
||||||
File.WriteAllText(Path.Combine(renameDirectory, $"{nameof(FileConnectorConfiguration.SourceFileFilter)}.txt"), string.Empty);
|
File.WriteAllText(Path.Combine(renameDirectory, $"{nameof(FileConnectorConfiguration.SourceFileFilter)}.txt"), string.Empty);
|
||||||
File.WriteAllText(Path.Combine(renameDirectory, $"{nameof(FileConnectorConfiguration.SourceFileLocation)}.txt"), string.Empty);
|
File.WriteAllText(Path.Combine(renameDirectory, $"{nameof(FileConnectorConfiguration.SourceFileLocation)}.txt"), string.Empty);
|
||||||
}
|
}
|
||||||
@ -255,7 +245,7 @@ namespace Shared
|
|||||||
textFiles = Directory.GetFiles(textDirectory, "*.txt", SearchOption.TopDirectoryOnly);
|
textFiles = Directory.GetFiles(textDirectory, "*.txt", SearchOption.TopDirectoryOnly);
|
||||||
if (!textFiles.Any())
|
if (!textFiles.Any())
|
||||||
{
|
{
|
||||||
Process.Start("explorer.exe", textDirectory);
|
_ = Process.Start("explorer.exe", textDirectory);
|
||||||
File.WriteAllText(Path.Combine(textDirectory, "_ Why.why"), string.Empty);
|
File.WriteAllText(Path.Combine(textDirectory, "_ Why.why"), string.Empty);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -282,54 +272,27 @@ namespace Shared
|
|||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal string GetEnvironment(string[] segments)
|
internal static string GetEnvironment(string[] segments) => segments[0];
|
||||||
{
|
|
||||||
return segments[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
internal string GetRawCellInstanceName(string[] segments)
|
internal static string GetRawCellInstanceName(string[] segments) => segments[1];
|
||||||
{
|
|
||||||
return segments[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
internal string GetCellInstanceName(string[] segments)
|
internal static string GetCellInstanceName(string[] segments) => segments[2];
|
||||||
{
|
|
||||||
return segments[2];
|
|
||||||
}
|
|
||||||
|
|
||||||
internal string GetCellInstanceVersionName(string[] segments)
|
internal static string GetCellInstanceVersionName(string[] segments) => segments[3];
|
||||||
{
|
|
||||||
return segments[3];
|
|
||||||
}
|
|
||||||
|
|
||||||
internal string GetCellInstanceConnectionNameFromMethodBaseName(string[] segments)
|
internal static string GetCellInstanceConnectionNameFromMethodBaseName(string[] segments) => segments[4];
|
||||||
{
|
|
||||||
return segments[4];
|
|
||||||
}
|
|
||||||
|
|
||||||
internal string GetCellInstanceConnectionName(string[] segments)
|
internal static string GetCellInstanceConnectionName(string[] segments) => segments[5];
|
||||||
{
|
|
||||||
return segments[5];
|
|
||||||
}
|
|
||||||
|
|
||||||
internal string GetTicks(string[] segments)
|
internal static string GetTicks(string[] segments) => segments[6];
|
||||||
{
|
|
||||||
return segments[6];
|
|
||||||
}
|
|
||||||
|
|
||||||
internal string GetComment(string[] segments)
|
internal static string GetComment(string[] segments) => segments[7];
|
||||||
{
|
|
||||||
return segments[7];
|
|
||||||
}
|
|
||||||
|
|
||||||
internal FileInfo GetFileName(string[] segments)
|
internal static FileInfo GetFileName(string[] segments) => new(segments[8]);
|
||||||
{
|
|
||||||
return new FileInfo(segments[8]);
|
|
||||||
}
|
|
||||||
|
|
||||||
internal string[] GetTextFiles(string[] segments)
|
internal static string[] GetTextFiles(string[] segments)
|
||||||
{
|
{
|
||||||
List<string> results = new List<string>();
|
List<string> results = new();
|
||||||
if (segments.Length > 8)
|
if (segments.Length > 8)
|
||||||
{
|
{
|
||||||
for (int i = 9; i < segments.Length; i++)
|
for (int i = 9; i < segments.Length; i++)
|
||||||
@ -338,24 +301,24 @@ namespace Shared
|
|||||||
return results.ToArray();
|
return results.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Stream ToStream(string @this)
|
protected static Stream ToStream(string @this)
|
||||||
{
|
{
|
||||||
MemoryStream memoryStream = new MemoryStream();
|
MemoryStream memoryStream = new();
|
||||||
StreamWriter streamWriter = new StreamWriter(memoryStream);
|
StreamWriter streamWriter = new(memoryStream);
|
||||||
streamWriter.Write(@this);
|
streamWriter.Write(@this);
|
||||||
streamWriter.Flush();
|
streamWriter.Flush();
|
||||||
memoryStream.Position = 0;
|
memoryStream.Position = 0;
|
||||||
return memoryStream;
|
return memoryStream;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal T ParseXML<T>(string @this, bool throwExceptions) where T : class
|
internal static T ParseXML<T>(string @this, bool throwExceptions) where T : class
|
||||||
{
|
{
|
||||||
object result = null;
|
object result = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Stream stream = ToStream(@this.Trim());
|
Stream stream = ToStream(@this.Trim());
|
||||||
XmlReader xmlReader = XmlReader.Create(stream, new XmlReaderSettings() { ConformanceLevel = ConformanceLevel.Document });
|
XmlReader xmlReader = XmlReader.Create(stream, new XmlReaderSettings() { ConformanceLevel = ConformanceLevel.Document });
|
||||||
XmlSerializer xmlSerializer = new XmlSerializer(typeof(T), typeof(T).GetNestedTypes());
|
XmlSerializer xmlSerializer = new(typeof(T), typeof(T).GetNestedTypes());
|
||||||
result = xmlSerializer.Deserialize(xmlReader);
|
result = xmlSerializer.Deserialize(xmlReader);
|
||||||
stream.Dispose();
|
stream.Dispose();
|
||||||
}
|
}
|
||||||
@ -367,7 +330,7 @@ namespace Shared
|
|||||||
return result as T;
|
return result as T;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected CellInstanceVersion GetCellInstanceVersion(string url)
|
protected static CellInstanceVersion GetCellInstanceVersion(string url)
|
||||||
{
|
{
|
||||||
CellInstanceVersion result;
|
CellInstanceVersion result;
|
||||||
byte[] byteArray;
|
byte[] byteArray;
|
||||||
@ -408,11 +371,11 @@ namespace Shared
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Dictionary<string, int[]> GetComponentModelComponentsIndexes(CellInstanceVersion cellInstanceVersion, string cellInstanceConnectionName)
|
protected static Dictionary<string, int[]> GetComponentModelComponentsIndexes(CellInstanceVersion cellInstanceVersion, string cellInstanceConnectionName)
|
||||||
{
|
{
|
||||||
Dictionary<string, int[]> results = new Dictionary<string, int[]>();
|
Dictionary<string, int[]> results = new();
|
||||||
ComponentsCellComponent componentsCellComponent;
|
ComponentsCellComponent componentsCellComponent;
|
||||||
if (!(cellInstanceVersion.ComponentModel.Components is null))
|
if (cellInstanceVersion.ComponentModel.Components is not null)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < cellInstanceVersion.ComponentModel.Components.Length; i++)
|
for (int i = 0; i < cellInstanceVersion.ComponentModel.Components.Length; i++)
|
||||||
{
|
{
|
||||||
@ -430,7 +393,7 @@ namespace Shared
|
|||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected int[] GetCellInstanceConnectionNameIndexes(string cellInstanceConnectionName, Dictionary<string, int[]> componentModelComponentsIndexes)
|
protected static int[] GetCellInstanceConnectionNameIndexes(string cellInstanceConnectionName, Dictionary<string, int[]> componentModelComponentsIndexes)
|
||||||
{
|
{
|
||||||
int[] result;
|
int[] result;
|
||||||
if (string.IsNullOrEmpty(cellInstanceConnectionName))
|
if (string.IsNullOrEmpty(cellInstanceConnectionName))
|
||||||
@ -444,40 +407,22 @@ namespace Shared
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected bool GetNoEvents(ComponentsCellComponentCellComponent componentsCellComponentCellComponent)
|
protected string[] GetCSharpTextB(FileInfo fileInfo, string cellInstanceName, string cellInstanceVersionName, CellInstanceVersion cellInstanceVersion)
|
||||||
{
|
{
|
||||||
bool result = componentsCellComponentCellComponent.Equipment.EquipmentDictionaries?.CellEquipmentDictionaryReference?.DictionaryName is null;
|
List<string> results = new();
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected string GetEquipmentDictionaryName(ComponentsCellComponentCellComponent componentsCellComponentCellComponent, bool noEvents, string defaultEquipmentDictionaryName)
|
|
||||||
{
|
|
||||||
string result;
|
|
||||||
if (noEvents)
|
|
||||||
result = defaultEquipmentDictionaryName;
|
|
||||||
else
|
|
||||||
result = componentsCellComponentCellComponent.Equipment.EquipmentDictionaries.CellEquipmentDictionaryReference.DictionaryName;
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected string[] GetCSharpTextB(string cellInstanceName, string cellInstanceVersionName, CellInstanceVersion cellInstanceVersion, FileInfo fileInfo)
|
|
||||||
{
|
|
||||||
List<string> results = new List<string>();
|
|
||||||
string check;
|
string check;
|
||||||
bool noEvents;
|
|
||||||
string loopName;
|
string loopName;
|
||||||
string equipmentTypeName;
|
string equipmentTypeName;
|
||||||
string equipmentDictionaryName;
|
|
||||||
string methodName = string.Empty;
|
string methodName = string.Empty;
|
||||||
string extractText = string.Empty;
|
string extractText = string.Empty;
|
||||||
string defaultEquipmentDictionaryName;
|
StringBuilder stringBuilder = new();
|
||||||
string createSelfDescriptionText = string.Empty;
|
string createSelfDescriptionText = string.Empty;
|
||||||
StringBuilder stringBuilder = new StringBuilder();
|
|
||||||
List<string> componentsCellComponentCellComponentEquipmentNames = new();
|
List<string> componentsCellComponentCellComponentEquipmentNames = new();
|
||||||
string cellInstanceNameWithoutHyphen = cellInstanceName.Replace('-', '_');
|
string cellInstanceNameWithoutHyphen = cellInstanceName.Replace('-', '_');
|
||||||
ComponentsCellComponentCellComponent componentsCellComponentCellComponent;
|
ComponentsCellComponentCellComponent componentsCellComponentCellComponent;
|
||||||
List<string> componentsCellComponentCellComponentEquipmentTypeNames = new();
|
List<string> componentsCellComponentCellComponentEquipmentTypeNames = new();
|
||||||
string cellInstanceVersionNameAsCode = cellInstanceVersionName.Replace('.', '_');
|
string cellInstanceVersionNameAsCode = cellInstanceVersionName.Replace('.', '_');
|
||||||
|
List<string> componentsCellComponentCellComponentEquipmentDictionaryNames = new();
|
||||||
const string sourceDirectoryCloaking = nameof(FileConnectorConfiguration.SourceDirectoryCloaking);
|
const string sourceDirectoryCloaking = nameof(FileConnectorConfiguration.SourceDirectoryCloaking);
|
||||||
for (int i = 1; i < 3; i++)
|
for (int i = 1; i < 3; i++)
|
||||||
{
|
{
|
||||||
@ -487,14 +432,13 @@ namespace Shared
|
|||||||
loopName = "CreateSelfDescription";
|
loopName = "CreateSelfDescription";
|
||||||
else
|
else
|
||||||
throw new Exception();
|
throw new Exception();
|
||||||
defaultEquipmentDictionaryName = string.Empty;
|
|
||||||
if (i == 2)
|
if (i == 2)
|
||||||
stringBuilder.
|
_ = stringBuilder.
|
||||||
AppendLine("using Microsoft.VisualStudio.TestTools.UnitTesting;").
|
AppendLine("using Microsoft.VisualStudio.TestTools.UnitTesting;").
|
||||||
AppendLine("using Shared;").
|
AppendLine("using Shared;").
|
||||||
AppendLine("using System.Diagnostics;");
|
AppendLine("using System.Diagnostics;");
|
||||||
else if (i == 1)
|
else if (i == 1)
|
||||||
stringBuilder.
|
_ = stringBuilder.
|
||||||
AppendLine("using Adaptation.Shared.Methods;").
|
AppendLine("using Adaptation.Shared.Methods;").
|
||||||
AppendLine("using Microsoft.Extensions.Logging;").
|
AppendLine("using Microsoft.Extensions.Logging;").
|
||||||
AppendLine("using Microsoft.VisualStudio.TestTools.UnitTesting;").
|
AppendLine("using Microsoft.VisualStudio.TestTools.UnitTesting;").
|
||||||
@ -508,19 +452,19 @@ namespace Shared
|
|||||||
AppendLine("using System.Threading;");
|
AppendLine("using System.Threading;");
|
||||||
else
|
else
|
||||||
throw new Exception();
|
throw new Exception();
|
||||||
stringBuilder.AppendLine().
|
_ = stringBuilder.AppendLine().
|
||||||
Append("namespace _Tests.").Append(loopName).Append('.').Append(_Environment).Append('.').AppendLine(cellInstanceVersionNameAsCode).
|
Append("namespace _Tests.").Append(loopName).Append('.').Append(_Environment).Append('.').AppendLine(cellInstanceVersionNameAsCode).
|
||||||
AppendLine("{").
|
AppendLine("{").
|
||||||
AppendLine().
|
AppendLine().
|
||||||
AppendLine("[TestClass]");
|
AppendLine("[TestClass]");
|
||||||
if (i == 2)
|
if (i == 2)
|
||||||
stringBuilder.
|
_ = stringBuilder.
|
||||||
Append("public class ").AppendLine(cellInstanceNameWithoutHyphen).
|
Append("public class ").AppendLine(cellInstanceNameWithoutHyphen).
|
||||||
AppendLine("{").
|
AppendLine("{").
|
||||||
AppendLine().
|
AppendLine().
|
||||||
Append("private static CreateSelfDescription.").Append(_Environment).Append('.').Append(cellInstanceVersionNameAsCode).Append('.').Append(cellInstanceNameWithoutHyphen).Append(" _").Append(cellInstanceNameWithoutHyphen).AppendLine(";");
|
Append("private static CreateSelfDescription.").Append(_Environment).Append('.').Append(cellInstanceVersionNameAsCode).Append('.').Append(cellInstanceNameWithoutHyphen).Append(" _").Append(cellInstanceNameWithoutHyphen).AppendLine(";");
|
||||||
else if (i == 1)
|
else if (i == 1)
|
||||||
stringBuilder.
|
_ = stringBuilder.
|
||||||
Append("public class ").Append(cellInstanceNameWithoutHyphen).AppendLine(" : EAFLoggingUnitTesting").
|
Append("public class ").Append(cellInstanceNameWithoutHyphen).AppendLine(" : EAFLoggingUnitTesting").
|
||||||
AppendLine("{").
|
AppendLine("{").
|
||||||
AppendLine().
|
AppendLine().
|
||||||
@ -529,9 +473,9 @@ namespace Shared
|
|||||||
else
|
else
|
||||||
throw new Exception();
|
throw new Exception();
|
||||||
if (i == 2)
|
if (i == 2)
|
||||||
stringBuilder.AppendLine();
|
_ = stringBuilder.AppendLine();
|
||||||
else if (i == 1)
|
else if (i == 1)
|
||||||
stringBuilder.
|
_ = stringBuilder.
|
||||||
AppendLine().
|
AppendLine().
|
||||||
Append("public ").Append(cellInstanceNameWithoutHyphen).AppendLine("() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false)").
|
Append("public ").Append(cellInstanceNameWithoutHyphen).AppendLine("() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false)").
|
||||||
AppendLine("{").
|
AppendLine("{").
|
||||||
@ -545,17 +489,17 @@ namespace Shared
|
|||||||
AppendLine();
|
AppendLine();
|
||||||
else
|
else
|
||||||
throw new Exception();
|
throw new Exception();
|
||||||
stringBuilder.
|
_ = stringBuilder.
|
||||||
AppendLine("[ClassInitialize]").
|
AppendLine("[ClassInitialize]").
|
||||||
AppendLine("public static void ClassInitialize(TestContext testContext)").
|
AppendLine("public static void ClassInitialize(TestContext testContext)").
|
||||||
AppendLine("{");
|
AppendLine("{");
|
||||||
if (i == 2)
|
if (i == 2)
|
||||||
stringBuilder.
|
_ = stringBuilder.
|
||||||
Append("CreateSelfDescription.").Append(_Environment).Append('.').Append(cellInstanceVersionNameAsCode).Append('.').Append(cellInstanceNameWithoutHyphen).AppendLine(".ClassInitialize(testContext);").
|
Append("CreateSelfDescription.").Append(_Environment).Append('.').Append(cellInstanceVersionNameAsCode).Append('.').Append(cellInstanceNameWithoutHyphen).AppendLine(".ClassInitialize(testContext);").
|
||||||
Append("_").Append(cellInstanceNameWithoutHyphen).Append(" = CreateSelfDescription.").Append(_Environment).Append('.').Append(cellInstanceVersionNameAsCode).Append('.').Append(cellInstanceNameWithoutHyphen).AppendLine(".EAFLoggingUnitTesting;").
|
Append('_').Append(cellInstanceNameWithoutHyphen).Append(" = CreateSelfDescription.").Append(_Environment).Append('.').Append(cellInstanceVersionNameAsCode).Append('.').Append(cellInstanceNameWithoutHyphen).AppendLine(".EAFLoggingUnitTesting;").
|
||||||
AppendLine("}");
|
AppendLine("}");
|
||||||
else if (i == 1)
|
else if (i == 1)
|
||||||
stringBuilder.
|
_ = stringBuilder.
|
||||||
AppendLine("if (_EAFLoggingUnitTesting is null)").
|
AppendLine("if (_EAFLoggingUnitTesting is null)").
|
||||||
Append("_EAFLoggingUnitTesting = new ").Append(cellInstanceNameWithoutHyphen).AppendLine("(testContext);").
|
Append("_EAFLoggingUnitTesting = new ").Append(cellInstanceNameWithoutHyphen).AppendLine("(testContext);").
|
||||||
AppendLine("_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, \" - ClassInitialize\"));").
|
AppendLine("_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, \" - ClassInitialize\"));").
|
||||||
@ -566,9 +510,9 @@ namespace Shared
|
|||||||
else
|
else
|
||||||
throw new Exception();
|
throw new Exception();
|
||||||
if (i == 2)
|
if (i == 2)
|
||||||
stringBuilder.AppendLine();
|
_ = stringBuilder.AppendLine();
|
||||||
else if (i == 1)
|
else if (i == 1)
|
||||||
stringBuilder.
|
_ = stringBuilder.
|
||||||
AppendLine().
|
AppendLine().
|
||||||
AppendLine("[ClassCleanup()]").
|
AppendLine("[ClassCleanup()]").
|
||||||
AppendLine("public static void ClassCleanup()").
|
AppendLine("public static void ClassCleanup()").
|
||||||
@ -586,18 +530,8 @@ namespace Shared
|
|||||||
if (componentsCellComponent.Children.Length != 1)
|
if (componentsCellComponent.Children.Length != 1)
|
||||||
continue;
|
continue;
|
||||||
componentsCellComponentCellComponent = componentsCellComponent.Children[0];
|
componentsCellComponentCellComponent = componentsCellComponent.Children[0];
|
||||||
noEvents = GetNoEvents(componentsCellComponentCellComponent);
|
if (componentsCellComponentCellComponent.Equipment.EquipmentDictionaries?.CellEquipmentDictionaryReference?.DictionaryName is not null)
|
||||||
if (noEvents)
|
componentsCellComponentCellComponentEquipmentDictionaryNames.Add(componentsCellComponentCellComponent.Equipment.EquipmentDictionaries?.CellEquipmentDictionaryReference?.DictionaryName);
|
||||||
continue;
|
|
||||||
defaultEquipmentDictionaryName = GetEquipmentDictionaryName(componentsCellComponentCellComponent, noEvents, defaultEquipmentDictionaryName);
|
|
||||||
}
|
|
||||||
if (string.IsNullOrEmpty(defaultEquipmentDictionaryName))
|
|
||||||
throw new Exception("At least one dictionary name should be marked as used in EAF CI!");
|
|
||||||
foreach (ComponentsCellComponent componentsCellComponent in cellInstanceVersion.ComponentModel.Components)
|
|
||||||
{
|
|
||||||
if (componentsCellComponent.Children.Length != 1)
|
|
||||||
continue;
|
|
||||||
componentsCellComponentCellComponent = componentsCellComponent.Children[0];
|
|
||||||
componentsCellComponentCellComponentEquipmentNames.Add(componentsCellComponentCellComponent.Equipment.Name);
|
componentsCellComponentCellComponentEquipmentNames.Add(componentsCellComponentCellComponent.Equipment.Name);
|
||||||
componentsCellComponentCellComponentEquipmentTypeNames.Add(componentsCellComponentCellComponent.Equipment.EquipmentType.Name);
|
componentsCellComponentCellComponentEquipmentTypeNames.Add(componentsCellComponentCellComponent.Equipment.EquipmentType.Name);
|
||||||
methodName = $"{_Environment}__{cellInstanceVersionNameAsCode}__{cellInstanceNameWithoutHyphen}__{componentsCellComponentCellComponent.Equipment.Name.Replace('-', '_')}";
|
methodName = $"{_Environment}__{cellInstanceVersionNameAsCode}__{cellInstanceNameWithoutHyphen}__{componentsCellComponentCellComponent.Equipment.Name.Replace('-', '_')}";
|
||||||
@ -607,40 +541,38 @@ namespace Shared
|
|||||||
check = (from l in componentsCellComponentCellComponent.Equipment.ConnectionSettings.Setting where l.Name == sourceDirectoryCloaking select l.Value).FirstOrDefault();
|
check = (from l in componentsCellComponentCellComponent.Equipment.ConnectionSettings.Setting where l.Name == sourceDirectoryCloaking select l.Value).FirstOrDefault();
|
||||||
if (string.IsNullOrEmpty(check))
|
if (string.IsNullOrEmpty(check))
|
||||||
check = componentsCellComponentCellComponent.Equipment.SourceFileFilter;
|
check = componentsCellComponentCellComponent.Equipment.SourceFileFilter;
|
||||||
stringBuilder.
|
_ = stringBuilder.
|
||||||
AppendLine("[TestMethod]").
|
AppendLine("[TestMethod]").
|
||||||
Append("public void ").Append(methodName).AppendLine("()").
|
Append("public void ").Append(methodName).AppendLine("()").
|
||||||
AppendLine("{");
|
AppendLine("{");
|
||||||
if (i == 2)
|
if (i == 2)
|
||||||
stringBuilder.Append("_").Append(cellInstanceNameWithoutHyphen).Append('.').Append(methodName).AppendLine("();");
|
_ = stringBuilder.Append('_').Append(cellInstanceNameWithoutHyphen).Append('.').Append(methodName).AppendLine("();");
|
||||||
else if (i == 1)
|
else if (i == 1)
|
||||||
{
|
{
|
||||||
if (componentsCellComponentCellComponent.Equipment.EquipmentType.Version != cellInstanceVersionName)
|
if (componentsCellComponentCellComponent.Equipment.EquipmentType.Version != cellInstanceVersionName)
|
||||||
throw new Exception("Versions should match!");
|
throw new Exception("Versions should match!");
|
||||||
equipmentTypeName = componentsCellComponentCellComponent.Equipment.EquipmentType.Name;
|
equipmentTypeName = componentsCellComponentCellComponent.Equipment.EquipmentType.Name;
|
||||||
noEvents = GetNoEvents(componentsCellComponentCellComponent);
|
_ = stringBuilder.
|
||||||
equipmentDictionaryName = GetEquipmentDictionaryName(componentsCellComponentCellComponent, noEvents, defaultEquipmentDictionaryName);
|
Append("string check = \"").Append(check.Split('\\').Last()).AppendLine("\";").
|
||||||
stringBuilder.
|
|
||||||
Append("string check = \"").Append(check).AppendLine("\";").
|
|
||||||
AppendLine("MethodBase methodBase = new StackFrame().GetMethod();").
|
AppendLine("MethodBase methodBase = new StackFrame().GetMethod();").
|
||||||
AppendLine("_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, \" - Getting configuration\"));").
|
AppendLine("_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, \" - Getting configuration\"));").
|
||||||
AppendLine("string[] fileNameAndJson = _EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);").
|
AppendLine("string[] fileNameAndJson = _EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);").
|
||||||
AppendLine("Assert.IsTrue(fileNameAndJson[1].Contains(check));").
|
AppendLine("Assert.IsTrue(fileNameAndJson[1].Contains(check));").
|
||||||
AppendLine("File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);");
|
AppendLine("File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);");
|
||||||
if (componentsCellComponentCellComponent.Equipment.EquipmentType.Name == componentsCellComponentCellComponentEquipmentTypeNames[0])
|
if (componentsCellComponentCellComponent.Equipment.EquipmentType.Name == componentsCellComponentCellComponentEquipmentTypeNames[0])
|
||||||
stringBuilder.
|
_ = stringBuilder.
|
||||||
AppendLine("IFileRead fileRead = _EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);").
|
AppendLine("IFileRead fileRead = _EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);").
|
||||||
AppendLine("Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));");
|
AppendLine("Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));");
|
||||||
stringBuilder.
|
_ = stringBuilder.
|
||||||
AppendLine("_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, \" - Exit\"));");
|
AppendLine("_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, \" - Exit\"));");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
throw new Exception();
|
throw new Exception();
|
||||||
stringBuilder.
|
_ = stringBuilder.
|
||||||
AppendLine("}").
|
AppendLine("}").
|
||||||
AppendLine();
|
AppendLine();
|
||||||
}
|
}
|
||||||
stringBuilder.
|
_ = stringBuilder.
|
||||||
AppendLine("}").
|
AppendLine("}").
|
||||||
AppendLine().
|
AppendLine().
|
||||||
AppendLine("}").
|
AppendLine("}").
|
||||||
@ -655,14 +587,14 @@ namespace Shared
|
|||||||
createSelfDescriptionText = stringBuilder.ToString().Trim();
|
createSelfDescriptionText = stringBuilder.ToString().Trim();
|
||||||
else
|
else
|
||||||
throw new Exception();
|
throw new Exception();
|
||||||
stringBuilder.Clear();
|
_ = stringBuilder.Clear();
|
||||||
}
|
}
|
||||||
if (string.IsNullOrEmpty(cellInstanceVersion.FrozenBy))
|
if (componentsCellComponentCellComponentEquipmentDictionaryNames.Any() && string.IsNullOrEmpty(cellInstanceVersion.FrozenBy))
|
||||||
{
|
{
|
||||||
if (!cellInstanceVersion.CellCommunicatingRule.Contains('.') || !(from l in componentsCellComponentCellComponentEquipmentNames where l == cellInstanceVersion.CellCommunicatingRule.Split('.')[0] select true).Any())
|
if (!cellInstanceVersion.CellCommunicatingRule.EndsWith(".Communicating") || !(from l in componentsCellComponentCellComponentEquipmentNames where l == cellInstanceVersion.CellCommunicatingRule.Split('.')[0] select true).Any())
|
||||||
throw new Exception("CellCommunicatingRule not correct in Mango!");
|
throw new Exception($"{methodName} - CellCommunicatingRule not correct in Mango!");
|
||||||
if (!cellInstanceVersion.CellNotCommunicatingRule.Contains('.') || !(from l in componentsCellComponentCellComponentEquipmentNames where l == cellInstanceVersion.CellNotCommunicatingRule.Split('.')[0] select true).Any())
|
if (!cellInstanceVersion.CellNotCommunicatingRule.EndsWith(".NotCommunicating") || !(from l in componentsCellComponentCellComponentEquipmentNames where l == cellInstanceVersion.CellNotCommunicatingRule.Split('.')[0] select true).Any())
|
||||||
throw new Exception("CellNotCommunicatingRule not correct in Mango!");
|
throw new Exception($"{methodName} - CellNotCommunicatingRule not correct in Mango!");
|
||||||
}
|
}
|
||||||
string versionLevelDirectory = Path.GetDirectoryName(fileInfo.DirectoryName);
|
string versionLevelDirectory = Path.GetDirectoryName(fileInfo.DirectoryName);
|
||||||
results.Add(Path.Combine(versionLevelDirectory, $"{cellInstanceName}-0-CreateSelfDescription.txt"));
|
results.Add(Path.Combine(versionLevelDirectory, $"{cellInstanceName}-0-CreateSelfDescription.txt"));
|
||||||
@ -672,11 +604,12 @@ namespace Shared
|
|||||||
return results.ToArray();
|
return results.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected FileConnectorConfiguration GetFileConnectorConfiguration(string json, ComponentsCellComponentCellComponent componentsCellComponentCellComponent)
|
protected static FileConnectorConfiguration GetFileConnectorConfiguration(string json, ComponentsCellComponentCellComponent componentsCellComponentCellComponent)
|
||||||
{
|
{
|
||||||
FileConnectorConfiguration result;
|
FileConnectorConfiguration result;
|
||||||
const string sourceDirectoryCloaking = nameof(FileConnectorConfiguration.SourceDirectoryCloaking);
|
const string sourceDirectoryCloaking = nameof(FileConnectorConfiguration.SourceDirectoryCloaking);
|
||||||
JsonSerializerOptions jsonSerializerOptions = new JsonSerializerOptions { Converters = { new JsonStringEnumConverter(JsonNamingPolicy.CamelCase) } };
|
JsonSerializerOptions jsonSerializerOptions = new()
|
||||||
|
{ Converters = { new JsonStringEnumConverter(JsonNamingPolicy.CamelCase) } };
|
||||||
json = json.Replace(string.Concat("\"", nameof(FileConnectorConfiguration.ConnectionSettings), "\":"), string.Concat("\"Ignore", nameof(FileConnectorConfiguration.ConnectionSettings), "\":"));
|
json = json.Replace(string.Concat("\"", nameof(FileConnectorConfiguration.ConnectionSettings), "\":"), string.Concat("\"Ignore", nameof(FileConnectorConfiguration.ConnectionSettings), "\":"));
|
||||||
result = JsonSerializer.Deserialize<FileConnectorConfiguration>(json, jsonSerializerOptions);
|
result = JsonSerializer.Deserialize<FileConnectorConfiguration>(json, jsonSerializerOptions);
|
||||||
if (string.IsNullOrEmpty(result.SourceFileFilter))
|
if (string.IsNullOrEmpty(result.SourceFileFilter))
|
||||||
@ -691,7 +624,7 @@ namespace Shared
|
|||||||
result.FolderAgeCheckIndividualSubFolders = false;
|
result.FolderAgeCheckIndividualSubFolders = false;
|
||||||
result.ConnectionSettings = new List<ConnectionSetting>();
|
result.ConnectionSettings = new List<ConnectionSetting>();
|
||||||
result.SourceFileFilters = result.SourceFileFilter.Split('|').ToList();
|
result.SourceFileFilters = result.SourceFileFilter.Split('|').ToList();
|
||||||
if (!(componentsCellComponentCellComponent.Equipment?.ConnectionSettings is null))
|
if (componentsCellComponentCellComponent.Equipment?.ConnectionSettings is not null)
|
||||||
{
|
{
|
||||||
foreach (Setting setting in componentsCellComponentCellComponent.Equipment.ConnectionSettings.Setting)
|
foreach (Setting setting in componentsCellComponentCellComponent.Equipment.ConnectionSettings.Setting)
|
||||||
result.ConnectionSettings.Add(new ConnectionSetting(null, null) { Name = setting.Name, Value = setting.Value });
|
result.ConnectionSettings.Add(new ConnectionSetting(null, null) { Name = setting.Name, Value = setting.Value });
|
||||||
@ -727,7 +660,7 @@ namespace Shared
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected EquipmentTypeVersion GetEquipmentTypeVersion(string url)
|
protected static EquipmentTypeVersion GetEquipmentTypeVersion(string url)
|
||||||
{
|
{
|
||||||
EquipmentTypeVersion result;
|
EquipmentTypeVersion result;
|
||||||
byte[] byteArray;
|
byte[] byteArray;
|
||||||
@ -752,7 +685,7 @@ namespace Shared
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Tuple<string, string, string, EquipmentTypeVersion> GetEquipmentTypeVersionTuple(string cellInstanceName, string cellInstanceVersionName, CellInstanceVersion cellInstanceVersion, string cellInstanceConnectionName)
|
protected Tuple<string, string, string, EquipmentTypeVersion> GetEquipmentTypeVersionTuple(CellInstanceVersion cellInstanceVersion, string cellInstanceConnectionName)
|
||||||
{
|
{
|
||||||
Tuple<string, string, string, EquipmentTypeVersion> result;
|
Tuple<string, string, string, EquipmentTypeVersion> result;
|
||||||
EquipmentTypeVersion equipmentTypeVersion;
|
EquipmentTypeVersion equipmentTypeVersion;
|
||||||
@ -786,7 +719,8 @@ namespace Shared
|
|||||||
protected IList<ModelObjectParameterDefinition> GetModelObjectParameters(string json)
|
protected IList<ModelObjectParameterDefinition> GetModelObjectParameters(string json)
|
||||||
{
|
{
|
||||||
IList<ModelObjectParameterDefinition> results;
|
IList<ModelObjectParameterDefinition> results;
|
||||||
JsonSerializerOptions jsonSerializerOptions = new JsonSerializerOptions { Converters = { new JsonStringEnumConverter(JsonNamingPolicy.CamelCase) } };
|
JsonSerializerOptions jsonSerializerOptions = new()
|
||||||
|
{ Converters = { new JsonStringEnumConverter(JsonNamingPolicy.CamelCase) } };
|
||||||
JsonElement jsonElement = JsonSerializer.Deserialize<JsonElement>(json);
|
JsonElement jsonElement = JsonSerializer.Deserialize<JsonElement>(json);
|
||||||
string parameters = "Parameters";
|
string parameters = "Parameters";
|
||||||
string fileHandlerObjectTypes = nameof(FileHandlerObjectTypes);
|
string fileHandlerObjectTypes = nameof(FileHandlerObjectTypes);
|
||||||
@ -835,8 +769,10 @@ namespace Shared
|
|||||||
{
|
{
|
||||||
if (componentsCellComponentCellComponentEquipment?.EquipmentDictionaries.CellEquipmentDictionaryReference is null)
|
if (componentsCellComponentCellComponentEquipment?.EquipmentDictionaries.CellEquipmentDictionaryReference is null)
|
||||||
{
|
{
|
||||||
equipmentDictionaryName = equipmentTypeVersion.Dictionaries.EquipmentTypeDictionaryReference.DictionaryName;
|
// equipmentDictionaryName = equipmentTypeVersion.Dictionaries.EquipmentTypeDictionaryReference.DictionaryName;
|
||||||
equipmentDictionaryVersionName = equipmentTypeVersion.Dictionaries.EquipmentTypeDictionaryReference.DictionaryVersion;
|
// equipmentDictionaryVersionName = equipmentTypeVersion.Dictionaries.EquipmentTypeDictionaryReference.DictionaryVersion;
|
||||||
|
equipmentDictionaryName = string.Empty;
|
||||||
|
equipmentDictionaryVersionName = string.Empty;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -848,7 +784,7 @@ namespace Shared
|
|||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected EquipmentDictionaryVersion GetEquipmentDictionaryVersion(string url)
|
protected static EquipmentDictionaryVersion GetEquipmentDictionaryVersion(string url)
|
||||||
{
|
{
|
||||||
EquipmentDictionaryVersion result;
|
EquipmentDictionaryVersion result;
|
||||||
string xml;
|
string xml;
|
||||||
@ -870,7 +806,7 @@ namespace Shared
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Tuple<string, string, string, EquipmentDictionaryVersion> GetEquipmentDictionaryVersionTuple(string cellInstanceName, string cellInstanceVersionName, CellInstanceVersion cellInstanceVersion, string cellInstanceConnectionName, EquipmentTypeVersion equipmentTypeVersion)
|
protected Tuple<string, string, string, EquipmentDictionaryVersion> GetEquipmentDictionaryVersionTuple(CellInstanceVersion cellInstanceVersion, string cellInstanceConnectionName, EquipmentTypeVersion equipmentTypeVersion)
|
||||||
{
|
{
|
||||||
Tuple<string, string, string, EquipmentDictionaryVersion> result;
|
Tuple<string, string, string, EquipmentDictionaryVersion> result;
|
||||||
string equipmentDictionaryName;
|
string equipmentDictionaryName;
|
||||||
@ -915,6 +851,8 @@ namespace Shared
|
|||||||
results = new List<Tuple<string, string>>();
|
results = new List<Tuple<string, string>>();
|
||||||
else if (string.IsNullOrEmpty(equipmentDictionaryVersionTuple.Item1))
|
else if (string.IsNullOrEmpty(equipmentDictionaryVersionTuple.Item1))
|
||||||
throw new Exception();
|
throw new Exception();
|
||||||
|
else if (equipmentDictionaryVersionTuple?.Item4?.Events?.Event is null)
|
||||||
|
results = new List<Tuple<string, string>>();
|
||||||
else if (_EquipmentDictionaryEventDescriptions.ContainsKey(equipmentDictionaryVersionTuple.Item1))
|
else if (_EquipmentDictionaryEventDescriptions.ContainsKey(equipmentDictionaryVersionTuple.Item1))
|
||||||
results = _EquipmentDictionaryEventDescriptions[equipmentDictionaryVersionTuple.Item1];
|
results = _EquipmentDictionaryEventDescriptions[equipmentDictionaryVersionTuple.Item1];
|
||||||
else
|
else
|
||||||
@ -933,15 +871,16 @@ namespace Shared
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Dictionary<string, object> GetKeyValuePairs(string cellInstanceName, string cellInstanceVersionName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList<ModelObjectParameterDefinition> modelObjectParameters, List<Tuple<string, string>> equipmentDictionaryIsAlwaysEnabledEvents)
|
protected Dictionary<string, object> GetKeyValuePairs(string cellInstanceName, string cellInstanceVersionName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList<ModelObjectParameterDefinition> modelObjectParameters, string equipmentDictionaryName, List<Tuple<string, string>> equipmentDictionaryIsAlwaysEnabledEvents)
|
||||||
{
|
{
|
||||||
Dictionary<string, object> results = new Dictionary<string, object>
|
Dictionary<string, object> results = new()
|
||||||
{
|
{
|
||||||
{ nameof(Environment), _Environment },
|
{ nameof(Environment), _Environment },
|
||||||
{ nameof(HostNameAndPort), _HostNameAndPort },
|
{ nameof(HostNameAndPort), _HostNameAndPort },
|
||||||
{ nameof(cellInstanceName), cellInstanceName },
|
{ nameof(cellInstanceName), cellInstanceName },
|
||||||
{ nameof(equipmentTypeName), equipmentTypeName },
|
{ nameof(equipmentTypeName), equipmentTypeName },
|
||||||
{ nameof(cellInstanceVersionName), cellInstanceVersionName },
|
{ nameof(cellInstanceVersionName), cellInstanceVersionName },
|
||||||
|
{ nameof(equipmentDictionaryName), equipmentDictionaryName },
|
||||||
{ nameof(cellInstanceConnectionName), cellInstanceConnectionName },
|
{ nameof(cellInstanceConnectionName), cellInstanceConnectionName },
|
||||||
{ nameof(FileConnectorConfiguration), fileConnectorConfiguration },
|
{ nameof(FileConnectorConfiguration), fileConnectorConfiguration },
|
||||||
{ nameof(IList<ModelObjectParameterDefinition>), modelObjectParameters },
|
{ nameof(IList<ModelObjectParameterDefinition>), modelObjectParameters },
|
||||||
@ -960,9 +899,9 @@ namespace Shared
|
|||||||
string cellInstanceVersionName = GetCellInstanceVersionName(segments);
|
string cellInstanceVersionName = GetCellInstanceVersionName(segments);
|
||||||
string cellInstanceConnectionName = GetCellInstanceConnectionName(segments);
|
string cellInstanceConnectionName = GetCellInstanceConnectionName(segments);
|
||||||
if (!string.IsNullOrEmpty(cellInstanceConnectionName) && !Directory.Exists(fileInfo.DirectoryName))
|
if (!string.IsNullOrEmpty(cellInstanceConnectionName) && !Directory.Exists(fileInfo.DirectoryName))
|
||||||
Directory.CreateDirectory(fileInfo.Directory.FullName);
|
_ = Directory.CreateDirectory(fileInfo.Directory.FullName);
|
||||||
Tuple<string, CellInstanceVersion> cellInstanceVersionTuple = GetCellInstanceVersionTuple(cellInstanceName, cellInstanceVersionName);
|
Tuple<string, CellInstanceVersion> cellInstanceVersionTuple = GetCellInstanceVersionTuple(cellInstanceName, cellInstanceVersionName);
|
||||||
results = GetCSharpTextB(cellInstanceName, cellInstanceVersionName, cellInstanceVersionTuple.Item2, fileInfo);
|
results = GetCSharpTextB(fileInfo, cellInstanceName, cellInstanceVersionName, cellInstanceVersionTuple.Item2);
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -975,15 +914,15 @@ namespace Shared
|
|||||||
string cellInstanceVersionName = GetCellInstanceVersionName(segments);
|
string cellInstanceVersionName = GetCellInstanceVersionName(segments);
|
||||||
string cellInstanceConnectionName = GetCellInstanceConnectionName(segments);
|
string cellInstanceConnectionName = GetCellInstanceConnectionName(segments);
|
||||||
if (!string.IsNullOrEmpty(cellInstanceConnectionName) && !Directory.Exists(fileInfo.DirectoryName))
|
if (!string.IsNullOrEmpty(cellInstanceConnectionName) && !Directory.Exists(fileInfo.DirectoryName))
|
||||||
Directory.CreateDirectory(fileInfo.Directory.FullName);
|
_ = Directory.CreateDirectory(fileInfo.Directory.FullName);
|
||||||
Tuple<string, CellInstanceVersion> cellInstanceVersionTuple = GetCellInstanceVersionTuple(cellInstanceName, cellInstanceVersionName);
|
Tuple<string, CellInstanceVersion> cellInstanceVersionTuple = GetCellInstanceVersionTuple(cellInstanceName, cellInstanceVersionName);
|
||||||
Tuple<string, FileConnectorConfiguration> fileConnectorConfigurationTuple = GetFileConnectorConfigurationTuple(cellInstanceVersionTuple, cellInstanceConnectionName);
|
Tuple<string, FileConnectorConfiguration> fileConnectorConfigurationTuple = GetFileConnectorConfigurationTuple(cellInstanceVersionTuple, cellInstanceConnectionName);
|
||||||
Tuple<string, string, string, EquipmentTypeVersion> equipmentTypeVersionTuple = GetEquipmentTypeVersionTuple(cellInstanceName, cellInstanceVersionName, cellInstanceVersionTuple.Item2, cellInstanceConnectionName);
|
Tuple<string, string, string, EquipmentTypeVersion> equipmentTypeVersionTuple = GetEquipmentTypeVersionTuple(cellInstanceVersionTuple.Item2, cellInstanceConnectionName);
|
||||||
Tuple<string, string> parameterizedModelObjectDefinitionTypeTuple = GetParameterizedModelObjectDefinitionTypeTuple(equipmentTypeVersionTuple);
|
Tuple<string, string> parameterizedModelObjectDefinitionTypeTuple = GetParameterizedModelObjectDefinitionTypeTuple(equipmentTypeVersionTuple);
|
||||||
Tuple<string, IList<ModelObjectParameterDefinition>> modelObjectParametersTuple = GetModelObjectParameters(equipmentTypeVersionTuple);
|
Tuple<string, IList<ModelObjectParameterDefinition>> modelObjectParametersTuple = GetModelObjectParameters(equipmentTypeVersionTuple);
|
||||||
Tuple<string, string, string, EquipmentDictionaryVersion> equipmentDictionaryVersionTuple = GetEquipmentDictionaryVersionTuple(cellInstanceName, cellInstanceVersionName, cellInstanceVersionTuple.Item2, cellInstanceConnectionName, equipmentTypeVersionTuple.Item4);
|
Tuple<string, string, string, EquipmentDictionaryVersion> equipmentDictionaryVersionTuple = GetEquipmentDictionaryVersionTuple(cellInstanceVersionTuple.Item2, cellInstanceConnectionName, equipmentTypeVersionTuple.Item4);
|
||||||
Tuple<string, List<Tuple<string, string>>> equipmentDictionaryIsAlwaysEnabledEventsTuple = GetEquipmentDictionaryIsAlwaysEnabledEventsTuple(equipmentDictionaryVersionTuple);
|
Tuple<string, List<Tuple<string, string>>> equipmentDictionaryIsAlwaysEnabledEventsTuple = GetEquipmentDictionaryIsAlwaysEnabledEventsTuple(equipmentDictionaryVersionTuple);
|
||||||
Dictionary<string, object> objects = GetKeyValuePairs(cellInstanceName, cellInstanceVersionName, cellInstanceConnectionName, fileConnectorConfigurationTuple.Item2, equipmentTypeVersionTuple.Item2, parameterizedModelObjectDefinitionTypeTuple.Item2, modelObjectParametersTuple.Item2, equipmentDictionaryIsAlwaysEnabledEventsTuple.Item2);
|
Dictionary<string, object> objects = GetKeyValuePairs(cellInstanceName, cellInstanceVersionName, cellInstanceConnectionName, fileConnectorConfigurationTuple.Item2, equipmentTypeVersionTuple.Item2, parameterizedModelObjectDefinitionTypeTuple.Item2, modelObjectParametersTuple.Item2, equipmentDictionaryVersionTuple.Item2, equipmentDictionaryIsAlwaysEnabledEventsTuple.Item2);
|
||||||
string json = JsonSerializer.Serialize(objects, new JsonSerializerOptions { WriteIndented = true });
|
string json = JsonSerializer.Serialize(objects, new JsonSerializerOptions { WriteIndented = true });
|
||||||
results = new string[] { fileInfo.FullName, json };
|
results = new string[] { fileInfo.FullName, json };
|
||||||
return results;
|
return results;
|
||||||
@ -996,16 +935,19 @@ namespace Shared
|
|||||||
FileInfo fileInfo = GetFileName(segments);
|
FileInfo fileInfo = GetFileName(segments);
|
||||||
string cellInstanceName = GetCellInstanceName(segments);
|
string cellInstanceName = GetCellInstanceName(segments);
|
||||||
string cellInstanceVersionName = GetCellInstanceVersionName(segments);
|
string cellInstanceVersionName = GetCellInstanceVersionName(segments);
|
||||||
Dictionary<string, string> fileParameter = new Dictionary<string, string>();
|
Dictionary<string, string> fileParameter = new();
|
||||||
string cellInstanceConnectionName = GetCellInstanceConnectionName(segments);
|
string cellInstanceConnectionName = GetCellInstanceConnectionName(segments);
|
||||||
if (!string.IsNullOrEmpty(cellInstanceConnectionName) && !Directory.Exists(fileInfo.DirectoryName))
|
if (!string.IsNullOrEmpty(cellInstanceConnectionName) && !Directory.Exists(fileInfo.DirectoryName))
|
||||||
Directory.CreateDirectory(fileInfo.Directory.FullName);
|
_ = Directory.CreateDirectory(fileInfo.Directory.FullName);
|
||||||
Dictionary<string, List<long>> dummyRuns = new Dictionary<string, List<long>>();
|
Dictionary<string, List<long>> dummyRuns = new();
|
||||||
Tuple<string, CellInstanceVersion> cellInstanceVersionTuple = GetCellInstanceVersionTuple(cellInstanceName, cellInstanceVersionName);
|
Tuple<string, CellInstanceVersion> cellInstanceVersionTuple = GetCellInstanceVersionTuple(cellInstanceName, cellInstanceVersionName);
|
||||||
Tuple<string, FileConnectorConfiguration> fileConnectorConfigurationTuple = GetFileConnectorConfigurationTuple(cellInstanceVersionTuple, cellInstanceConnectionName);
|
Tuple<string, FileConnectorConfiguration> fileConnectorConfigurationTuple = GetFileConnectorConfigurationTuple(cellInstanceVersionTuple, cellInstanceConnectionName);
|
||||||
Tuple<string, string, string, EquipmentTypeVersion> equipmentTypeVersionTuple = GetEquipmentTypeVersionTuple(cellInstanceName, cellInstanceVersionName, cellInstanceVersionTuple.Item2, cellInstanceConnectionName);
|
Tuple<string, string, string, EquipmentTypeVersion> equipmentTypeVersionTuple = GetEquipmentTypeVersionTuple(cellInstanceVersionTuple.Item2, cellInstanceConnectionName);
|
||||||
Tuple<string, string> parameterizedModelObjectDefinitionTypeTuple = GetParameterizedModelObjectDefinitionTypeTuple(equipmentTypeVersionTuple);
|
Tuple<string, string> parameterizedModelObjectDefinitionTypeTuple = GetParameterizedModelObjectDefinitionTypeTuple(equipmentTypeVersionTuple);
|
||||||
Tuple<string, IList<ModelObjectParameterDefinition>> modelObjectParametersTuple = GetModelObjectParameters(equipmentTypeVersionTuple);
|
Tuple<string, IList<ModelObjectParameterDefinition>> modelObjectParametersTuple = GetModelObjectParameters(equipmentTypeVersionTuple);
|
||||||
|
Tuple<string, string, string, EquipmentDictionaryVersion> equipmentDictionaryVersionTuple = GetEquipmentDictionaryVersionTuple(cellInstanceVersionTuple.Item2, cellInstanceConnectionName, equipmentTypeVersionTuple.Item4);
|
||||||
|
|
||||||
|
_ = GetEquipmentDictionaryIsAlwaysEnabledEventsTuple(equipmentDictionaryVersionTuple);
|
||||||
if (!string.IsNullOrEmpty(sourceFileLocation) && sourceFileLocation != fileConnectorConfigurationTuple.Item2.SourceFileLocation)
|
if (!string.IsNullOrEmpty(sourceFileLocation) && sourceFileLocation != fileConnectorConfigurationTuple.Item2.SourceFileLocation)
|
||||||
fileConnectorConfigurationTuple.Item2.SourceFileLocation = sourceFileLocation;
|
fileConnectorConfigurationTuple.Item2.SourceFileLocation = sourceFileLocation;
|
||||||
if (!string.IsNullOrEmpty(sourceFileFilter) && sourceFileFilter != fileConnectorConfigurationTuple.Item2.SourceFileFilter)
|
if (!string.IsNullOrEmpty(sourceFileFilter) && sourceFileFilter != fileConnectorConfigurationTuple.Item2.SourceFileFilter)
|
||||||
@ -1013,7 +955,7 @@ namespace Shared
|
|||||||
fileConnectorConfigurationTuple.Item2.SourceFileFilter = sourceFileFilter;
|
fileConnectorConfigurationTuple.Item2.SourceFileFilter = sourceFileFilter;
|
||||||
fileConnectorConfigurationTuple.Item2.SourceFileFilters = sourceFileFilter.Split('|').ToList();
|
fileConnectorConfigurationTuple.Item2.SourceFileFilters = sourceFileFilter.Split('|').ToList();
|
||||||
}
|
}
|
||||||
result = Adaptation.FileHandlers.CellInstanceConnectionName.Get(this, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfigurationTuple.Item2, equipmentTypeVersionTuple.Item2, parameterizedModelObjectDefinitionTypeTuple.Item2, modelObjectParametersTuple.Item2, dummyRuns, useCyclicalForDescription, isEAFHosted: false);
|
result = Adaptation.FileHandlers.CellInstanceConnectionName.Get(this, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfigurationTuple.Item2, equipmentTypeVersionTuple.Item2, parameterizedModelObjectDefinitionTypeTuple.Item2, modelObjectParametersTuple.Item2, equipmentDictionaryVersionTuple.Item2, dummyRuns, useCyclicalForDescription, isEAFHosted: false);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1061,7 +1003,7 @@ namespace Shared
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!Directory.Exists(fileInfo.Directory.FullName))
|
if (!Directory.Exists(fileInfo.Directory.FullName))
|
||||||
Directory.CreateDirectory(fileInfo.Directory.FullName);
|
_ = Directory.CreateDirectory(fileInfo.Directory.FullName);
|
||||||
if (!fileInfo.Exists)
|
if (!fileInfo.Exists)
|
||||||
throw new Exception();
|
throw new Exception();
|
||||||
string json = File.ReadAllText(fileInfo.FullName);
|
string json = File.ReadAllText(fileInfo.FullName);
|
||||||
@ -1073,7 +1015,8 @@ namespace Shared
|
|||||||
JsonElement fileConnectorConfigurationJsonElement = jsonElement.GetProperty(nameof(FileConnectorConfiguration));
|
JsonElement fileConnectorConfigurationJsonElement = jsonElement.GetProperty(nameof(FileConnectorConfiguration));
|
||||||
if (fileConnectorConfigurationJsonElement.ValueKind != JsonValueKind.Object)
|
if (fileConnectorConfigurationJsonElement.ValueKind != JsonValueKind.Object)
|
||||||
throw new Exception();
|
throw new Exception();
|
||||||
JsonSerializerOptions jsonSerializerOptions = new JsonSerializerOptions { Converters = { new JsonStringEnumConverter(JsonNamingPolicy.CamelCase) } };
|
JsonSerializerOptions jsonSerializerOptions = new()
|
||||||
|
{ Converters = { new JsonStringEnumConverter(JsonNamingPolicy.CamelCase) } };
|
||||||
FileConnectorConfiguration fileConnectorConfiguration = JsonSerializer.Deserialize<FileConnectorConfiguration>(fileConnectorConfigurationJsonElement.ToString(), jsonSerializerOptions);
|
FileConnectorConfiguration fileConnectorConfiguration = JsonSerializer.Deserialize<FileConnectorConfiguration>(fileConnectorConfigurationJsonElement.ToString(), jsonSerializerOptions);
|
||||||
if (!string.IsNullOrEmpty(sourceFileFilter))
|
if (!string.IsNullOrEmpty(sourceFileFilter))
|
||||||
fileConnectorConfiguration.SourceFileFilter = sourceFileFilter;
|
fileConnectorConfiguration.SourceFileFilter = sourceFileFilter;
|
||||||
@ -1114,6 +1057,5 @@ namespace Shared
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
// namespace _Tests.Helpers { public class AdaptationTesting { } }
|
// namespace _Tests.Helpers { public class AdaptationTesting { } }
|
||||||
|
// 2022-02-02 -> AdaptationTesting
|
@ -1,8 +1,7 @@
|
|||||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Shared
|
namespace Shared;
|
||||||
{
|
|
||||||
|
|
||||||
public class EAFLoggingUnitTesting : LoggingUnitTesting, IDisposable
|
public class EAFLoggingUnitTesting : LoggingUnitTesting, IDisposable
|
||||||
{
|
{
|
||||||
@ -20,11 +19,6 @@ namespace Shared
|
|||||||
_AdaptationTesting = new AdaptationTesting(testContext, skipEquipmentDictionary);
|
_AdaptationTesting = new AdaptationTesting(testContext, skipEquipmentDictionary);
|
||||||
}
|
}
|
||||||
|
|
||||||
public new void Dispose()
|
public new void Dispose() => base.Dispose();
|
||||||
{
|
|
||||||
base.Dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
@ -2,8 +2,7 @@ using System;
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace Shared
|
namespace Shared;
|
||||||
{
|
|
||||||
|
|
||||||
public class IsEnvironment
|
public class IsEnvironment
|
||||||
{
|
{
|
||||||
@ -167,5 +166,3 @@ namespace Shared
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
@ -5,8 +5,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
namespace Shared
|
namespace Shared;
|
||||||
{
|
|
||||||
|
|
||||||
public class LoggingUnitTesting : UnitTesting, IDisposable
|
public class LoggingUnitTesting : UnitTesting, IDisposable
|
||||||
{
|
{
|
||||||
@ -36,7 +35,7 @@ namespace Shared
|
|||||||
{
|
{
|
||||||
LogLevel logLevel;
|
LogLevel logLevel;
|
||||||
IConfigurationSection configurationSection;
|
IConfigurationSection configurationSection;
|
||||||
List<LogLevel> logLevels = new List<LogLevel>();
|
List<LogLevel> logLevels = new();
|
||||||
string defaultLogLevelSection = "Logging:LogLevel:Default";
|
string defaultLogLevelSection = "Logging:LogLevel:Default";
|
||||||
string log4netProviderLogLevelSection = "Logging:LogLevel:Log4netProvider";
|
string log4netProviderLogLevelSection = "Logging:LogLevel:Log4netProvider";
|
||||||
string[] sections = new string[] { defaultLogLevelSection, log4netProviderLogLevelSection };
|
string[] sections = new string[] { defaultLogLevelSection, log4netProviderLogLevelSection };
|
||||||
@ -67,7 +66,7 @@ namespace Shared
|
|||||||
{
|
{
|
||||||
string result = string.Empty;
|
string result = string.Empty;
|
||||||
string traceFile;
|
string traceFile;
|
||||||
List<string> directories = new List<string>();
|
List<string> directories = new();
|
||||||
Environment.SpecialFolder[] specialFolders = new Environment.SpecialFolder[]
|
Environment.SpecialFolder[] specialFolders = new Environment.SpecialFolder[]
|
||||||
{
|
{
|
||||||
Environment.SpecialFolder.LocalApplicationData,
|
Environment.SpecialFolder.LocalApplicationData,
|
||||||
@ -89,7 +88,7 @@ namespace Shared
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (!Directory.Exists(result))
|
if (!Directory.Exists(result))
|
||||||
Directory.CreateDirectory(result);
|
_ = Directory.CreateDirectory(result);
|
||||||
traceFile = string.Concat(result, @"\", DateTime.Now.Ticks, ".txt");
|
traceFile = string.Concat(result, @"\", DateTime.Now.Ticks, ".txt");
|
||||||
File.WriteAllText(traceFile, traceFile);
|
File.WriteAllText(traceFile, traceFile);
|
||||||
File.Delete(traceFile);
|
File.Delete(traceFile);
|
||||||
@ -103,11 +102,6 @@ namespace Shared
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose() => _LoggerFactory.Dispose();
|
||||||
{
|
|
||||||
_LoggerFactory.Dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
|||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
namespace Shared.PasteSpecialXml.EAF.XML.API.ConfigurationData
|
namespace Shared.PasteSpecialXml.EAF.XML.API.ConfigurationData;
|
||||||
{
|
|
||||||
[XmlRoot(ElementName = "ChildBackboneMembers", Namespace = "http://schemas.datacontract.org/2004/07/EafManagement.Configuration.Services")]
|
[XmlRoot(ElementName = "ChildBackboneMembers", Namespace = "http://schemas.datacontract.org/2004/07/EafManagement.Configuration.Services")]
|
||||||
public class ChildBackboneMembers
|
public class ChildBackboneMembers
|
||||||
{
|
{
|
||||||
@ -21,5 +21,3 @@ namespace Shared.PasteSpecialXml.EAF.XML.API.ConfigurationData
|
|||||||
[XmlAttribute(AttributeName = "i", Namespace = "http://www.w3.org/2000/xmlns/")]
|
[XmlAttribute(AttributeName = "i", Namespace = "http://www.w3.org/2000/xmlns/")]
|
||||||
public string I { get; set; }
|
public string I { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user