Indirectly disabled tickoffset by setting it to 0

This commit is contained in:
2023-03-28 07:32:38 -07:00
parent bc0098bb9b
commit a2be6bef31
6 changed files with 32 additions and 17 deletions

View File

@ -100,7 +100,7 @@ public class FileRead : Shared.FileRead, IFileRead
private Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, DateTime dateTime) private Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, DateTime dateTime)
{ {
Tuple<string, Test[], JsonElement[], List<FileInfo>> results = new(string.Empty, null, null, new List<FileInfo>()); Tuple<string, Test[], JsonElement[], List<FileInfo>> results = new(string.Empty, null, null, new List<FileInfo>());
_TickOffset ??= new FileInfo(reportFullPath).LastWriteTime.Ticks - dateTime.Ticks; _TickOffset ??= 0; // new FileInfo(reportFullPath).LastWriteTime.Ticks - dateTime.Ticks;
_Logistics = new Logistics(this, _TickOffset.Value, reportFullPath, useSplitForMID: true); _Logistics = new Logistics(this, _TickOffset.Value, reportFullPath, useSplitForMID: true);
SetFileParameterLotIDToLogisticsMID(); SetFileParameterLotIDToLogisticsMID();
if (_Logistics.FileInfo.Length < _MinFileLength) if (_Logistics.FileInfo.Length < _MinFileLength)

View File

@ -246,15 +246,15 @@ public partial class ProcessData : IProcessData
return result; return result;
} }
private static (string, string) GetReactorAndRDS(string defaultReactor, string defaultRDS, string text, string formattedText, string[] segments, bool hasRDS) private static (string, string) GetReactorAndRDS(string defaultReactor, string defaultRDS, string text, string formattedText, string[] segments)
{ {
string rds; string rds;
string reactor; string reactor;
if (string.IsNullOrEmpty(text) || segments.Length == 0 || string.IsNullOrEmpty(formattedText) || (segments.Length > 1 && !hasRDS)) if (string.IsNullOrEmpty(text) || segments.Length == 0 || string.IsNullOrEmpty(formattedText))
reactor = defaultReactor; reactor = defaultReactor;
else else
reactor = segments[0]; reactor = segments[0];
if (segments.Length <= 1 || !int.TryParse(segments[1].Replace("QP", string.Empty), out int rdsValue) || rdsValue < 99) if (segments.Length <= 1 || !int.TryParse(segments[1], out int rdsValue) || rdsValue < 99)
rds = defaultRDS; rds = defaultRDS;
else else
rds = segments[1]; rds = segments[1];
@ -266,11 +266,11 @@ public partial class ProcessData : IProcessData
return new(reactor, rds); return new(reactor, rds);
} }
private static (string, string) GetLayerAndPSN(string defaultLayer, string defaultPSN, string[] segments, bool hasRDS) private static (string, string) GetLayerAndPSN(string defaultLayer, string defaultPSN, string[] segments)
{ {
string psn; string psn;
string layer; string layer;
if (segments.Length <= 2 || (segments.Length > 1 && !hasRDS)) if (segments.Length <= 2)
{ {
psn = defaultPSN; psn = defaultPSN;
layer = defaultLayer; layer = defaultLayer;
@ -360,9 +360,9 @@ public partial class ProcessData : IProcessData
segments = cassette.Split(new char[] { '.' }); segments = cassette.Split(new char[] { '.' });
else else
segments = cassette.Split(new char[] { '\u005F' }); segments = cassette.Split(new char[] { '\u005F' });
bool hasRDS = Regex.IsMatch(cassette, "[-]?([QP][0-9]{4,}|[0-9]{5,})[-]?"); // bool hasRDS = Regex.IsMatch(cassette, "[-]?([QP][0-9]{4,}|[0-9]{5,})[-]?");
(reactor, rds) = GetReactorAndRDS(defaultReactor, defaultRDS, text, cassette, segments, hasRDS); (reactor, rds) = GetReactorAndRDS(defaultReactor, defaultRDS, text, cassette, segments);
(layer, psn) = GetLayerAndPSN(defaultLayer, defaultPSN, segments, hasRDS); (layer, psn) = GetLayerAndPSN(defaultLayer, defaultPSN, segments);
zone = GetZone(segments); zone = GetZone(segments);
if (segments.Length <= 3 || segments[3].Length <= 1) if (segments.Length <= 3 || segments[3].Length <= 1)
employee = defaultEmployee; employee = defaultEmployee;

View File

@ -435,7 +435,7 @@ public partial class ProcessData
log.Debug($"****Extract(FDR): DataType = {dataType}"); log.Debug($"****Extract(FDR): DataType = {dataType}");
if (!isBioRad) if (!isBioRad)
{ {
cassetteDateTime = logistics.DateTimeFromSequence.AddTicks(tickOffset).AddTicks(i * -1); cassetteDateTime = logistics.DateTimeFromSequence.AddTicks(i * -1);
results.Add(new Tuple<string, bool, DateTime, string>(cassetteID, isBioRad, cassetteDateTime, dataText)); results.Add(new Tuple<string, bool, DateTime, string>(cassetteID, isBioRad, cassetteDateTime, dataText));
} }
else else
@ -452,7 +452,7 @@ public partial class ProcessData
throw new Exception(); throw new Exception();
count += 1; count += 1;
_ = contents.Clear(); _ = contents.Clear();
cassetteDateTime = logistics.DateTimeFromSequence.AddTicks(tickOffset).AddTicks(count * -1); cassetteDateTime = logistics.DateTimeFromSequence.AddTicks(count * -1);
user = processData.Employee?.ToString() ?? ""; user = processData.Employee?.ToString() ?? "";
recipe = detail.Recipe?.ToString() ?? ""; recipe = detail.Recipe?.ToString() ?? "";
_ = contents.Append("Bio-Rad ").Append("QS400MEPI".PadRight(17)).Append("Recipe: ").Append(recipe.PadRight(25)).AppendLine(processData.Date.ToString(Stratus.Description.GetDateFormat())); _ = contents.Append("Bio-Rad ").Append("QS400MEPI".PadRight(17)).Append("Recipe: ").Append(recipe.PadRight(25)).AppendLine(processData.Date.ToString(Stratus.Description.GetDateFormat()));

View File

@ -22,7 +22,7 @@ steps:
set configuration=Debug set configuration=Debug
echo %configuration% echo %configuration%
echo ##vso[task.setvariable variable=Configuration;]%configuration% echo ##vso[task.setvariable variable=Configuration;]%configuration%
echo ($Configuration) echo $(Configuration)
displayName: Configuration displayName: Configuration
- script: | - script: |
@ -123,6 +123,14 @@ steps:
testRunTitle: "$(GitCommitSeven)-$(Build.BuildId)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)" testRunTitle: "$(GitCommitSeven)-$(Build.BuildId)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)"
searchFolder: "$(System.DefaultWorkingDirectory)" searchFolder: "$(System.DefaultWorkingDirectory)"
- task: PublishTestResults@2
displayName: "Publish Test Results **/coverage.cobertura.xml"
inputs:
testResultsFormat: VSTest
testResultsFiles: "**/coverage.cobertura.xml"
testRunTitle: "$(GitCommitSeven)-$(Build.BuildId)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)"
searchFolder: "$(System.DefaultWorkingDirectory)/TestResults"
- task: mspremier.CreateWorkItem.CreateWorkItem-task.CreateWorkItem@1 - task: mspremier.CreateWorkItem.CreateWorkItem-task.CreateWorkItem@1
displayName: "Create work item" displayName: "Create work item"
inputs: inputs:

View File

@ -22,7 +22,7 @@ steps:
set configuration=Release set configuration=Release
echo %configuration% echo %configuration%
echo ##vso[task.setvariable variable=Configuration;]%configuration% echo ##vso[task.setvariable variable=Configuration;]%configuration%
echo ($Configuration) echo $(Configuration)
displayName: Configuration displayName: Configuration
- script: | - script: |
@ -120,6 +120,14 @@ steps:
testRunTitle: "$(GitCommitSeven)-$(Build.BuildId)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)" testRunTitle: "$(GitCommitSeven)-$(Build.BuildId)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)"
searchFolder: "$(System.DefaultWorkingDirectory)" searchFolder: "$(System.DefaultWorkingDirectory)"
- task: PublishTestResults@2
displayName: "Publish Test Results **/coverage.cobertura.xml"
inputs:
testResultsFormat: VSTest
testResultsFiles: "**/coverage.cobertura.xml"
testRunTitle: "$(GitCommitSeven)-$(Build.BuildId)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)"
searchFolder: "$(System.DefaultWorkingDirectory)/TestResults"
- task: mspremier.CreateWorkItem.CreateWorkItem-task.CreateWorkItem@1 - task: mspremier.CreateWorkItem.CreateWorkItem-task.CreateWorkItem@1
displayName: "Create work item" displayName: "Create work item"
inputs: inputs:

View File

@ -129,11 +129,10 @@ public class Stratus : LoggingUnitTesting, IDisposable
Assert.IsTrue(descriptor.Zone is "1"); Assert.IsTrue(descriptor.Zone is "1");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee));
descriptor = FileHandlers.Stratus.ProcessData.GetDescriptor("P2-LOW-RR"); descriptor = FileHandlers.Stratus.ProcessData.GetDescriptor("P2-LOW-RR");
Assert.IsTrue(!string.IsNullOrEmpty(descriptor.Cassette));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN)); Assert.IsTrue(descriptor.PSN is "RR");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor)); Assert.IsTrue(descriptor.Reactor is "P2");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee));
descriptor = FileHandlers.Stratus.ProcessData.GetDescriptor("i171308.1.51"); descriptor = FileHandlers.Stratus.ProcessData.GetDescriptor("i171308.1.51");
@ -168,7 +167,7 @@ public class Stratus : LoggingUnitTesting, IDisposable
Assert.IsTrue(!string.IsNullOrEmpty(descriptor.Cassette)); Assert.IsTrue(!string.IsNullOrEmpty(descriptor.Cassette));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer));
Assert.IsTrue(descriptor.PSN is "SPLIT4"); Assert.IsTrue(descriptor.PSN is "SPLIT4");
Assert.IsTrue(descriptor.RDS is "QP1414"); Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS));
Assert.IsTrue(descriptor.Reactor is "75"); Assert.IsTrue(descriptor.Reactor is "75");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee));