Description Name and Test

This commit is contained in:
Mike Phares 2024-04-24 15:59:16 -07:00
parent 13e5e7cccd
commit 9d76773ae5
4 changed files with 29 additions and 6 deletions

View File

@ -166,8 +166,8 @@ public class Description : IDescription, Shared.Properties.IDescription
//
Date = detail.Date,
Lot = processData.MetaData.Date,
Part = $"{processData.MetaData.DeviceType}-{processData.MetaData.DeviceNumber}",
Process = $"{processData.MetaData.DeviceId}",
Part = $"{processData.MetaData.DeviceId}-{processData.MetaData.DeviceType}-{processData.MetaData.DeviceNumber}",
Process = $"{processData.MetaData.DescriptionName}",
Recipe = processData.MetaData.Frequency,
//
Name = detail.Test,

View File

@ -6,7 +6,8 @@ public class MetaData
public int DeviceId { get; set; }
public string DeviceType { get; set; }
public int DeviceNumber { get; set; }
public string Description { get; set; }
public string DescriptionName { get; set; }
public string DescriptionTest { get; set; }
public string Frequency { get; set; }
public string Date { get; set; }
public string System { get; set; }

View File

@ -73,7 +73,8 @@ public class ProcessData : IProcessData
DeviceId = deviceId,
DeviceType = match.Groups["DeviceType"].Value,
DeviceNumber = deviceNumber,
Description = match.Groups["Description"].Value,
DescriptionName = match.Groups["DescriptionName"].Value,
DescriptionTest = match.Groups["DescriptionTest"].Value,
Frequency = match.Groups["Frequency"].Value,
Date = match.Groups["Date"].Value
};
@ -92,7 +93,7 @@ public class ProcessData : IProcessData
if (columns.Length == commaSeparatedValuesConfiguration.Columns)
{
string test = columns[commaSeparatedValuesConfiguration.TestIndex].Trim().Trim('"');
if (test == metaData.Description)
if (test.IndexOf(metaData.DescriptionTest, 0, StringComparison.CurrentCultureIgnoreCase) > -1 && test.IndexOf(metaData.DescriptionName, 0, StringComparison.CurrentCultureIgnoreCase) > -1)
{
for (int i = 1; i < lines.Length; i++)
{
@ -102,7 +103,7 @@ public class ProcessData : IProcessData
columns = line.Split(',').Select(l => l.Trim().Trim('"')).ToArray();
if (columns.Length != commaSeparatedValuesConfiguration.Columns)
continue;
_Details.Add(new Record() { Test = test, Date = columns[0], Value = columns[1], Event = columns[2] });
_Details.Add(new Record() { Test = metaData.DescriptionTest, Date = columns[0], Value = columns[1], Event = columns[2] });
}
MetaData = metaData;
}

View File

@ -61,6 +61,27 @@ public class TRENDLOG
NonThrowTryCatch();
}
#if DEBUG
[Ignore]
#endif
[TestMethod]
public void Staging__v2_52_0__TRENDLOG__csv638465291633220311__Normal()
{
bool validatePDSF = false;
string check = "*.csv.trg";
_TRENDLOG.Staging__v2_52_0__TRENDLOG__csv();
MethodBase methodBase = new StackFrame().GetMethod();
// string check = "Dev *, A*, present-value, *D*-*-*-*.csv.trg";
Assert.IsFalse(string.IsNullOrEmpty(_TRENDLOG.AdaptationTesting.TestContext.FullyQualifiedTestClassName));
string[] variables = _TRENDLOG.AdaptationTesting.GetVariables(methodBase, check, validatePDSF);
IFileRead fileRead = _TRENDLOG.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.IsNotNull(extractResult.Item3);
Assert.IsNotNull(extractResult.Item4);
NonThrowTryCatch();
}
#if DEBUG
[Ignore]
#endif