Inititial Commit

This commit is contained in:
2023-04-22 21:42:57 -07:00
parent 660b89c129
commit c7995ffd4f
58 changed files with 1312 additions and 905 deletions

View File

@ -91,8 +91,7 @@ public class ProcessDataStandardFormat
string segment;
List<string> body = new();
StringBuilder logistics = new();
if (lines is null)
lines = File.ReadAllLines(reportFullPath);
lines ??= File.ReadAllLines(reportFullPath);
string[] segments;
if (lines.Length < 7)
segments = Array.Empty<string>();
@ -276,8 +275,7 @@ public class ProcessDataStandardFormat
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)
{
StringBuilder result = new();
if (ignoreParameterNames is null)
ignoreParameterNames = new List<string>();
ignoreParameterNames ??= new List<string>();
if (useDateTimeFromSequence && !string.IsNullOrEmpty(format))
throw new Exception();
else if (!useDateTimeFromSequence && string.IsNullOrEmpty(format))
@ -318,7 +316,7 @@ public class ProcessDataStandardFormat
_ = line.Append(logistics.DateTimeFromSequence.ToString(timeFormat));
else if (!useDateTimeFromSequence && keyValuePair.Key == columnDate && keyValuePair.Value[r].Length == format.Length)
_ = 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.TryGetValue(string.Concat(keyValuePair.Key, firstDuplicate), out List<string> value) && value[r].Length == format.Length)
_ = 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)
_ = line.Append(nullData);
@ -357,8 +355,7 @@ public class ProcessDataStandardFormat
if (string.IsNullOrEmpty(lines[i]))
continue;
segments = lines[i].Split(inputSeparator);
if (currentGroup is null)
currentGroup = segments.Length;
currentGroup ??= segments.Length;
if (segments.Length != currentGroup)
{
currentGroup = segments.Length;