|
|
|
@ -518,8 +518,6 @@ internal class ProcessDataStandardFormat
|
|
|
|
|
internal static void Write(string path, ProcessDataStandardFormat processDataStandardFormat, List<Metrology.WS.Results>? wsResults)
|
|
|
|
|
{
|
|
|
|
|
List<string> results = new();
|
|
|
|
|
if (processDataStandardFormat.InputPDSF is null)
|
|
|
|
|
throw new NullReferenceException(nameof(processDataStandardFormat.InputPDSF));
|
|
|
|
|
if (processDataStandardFormat.Sequence is null)
|
|
|
|
|
throw new NullReferenceException(nameof(processDataStandardFormat.Sequence));
|
|
|
|
|
string endOffset = "E#######T";
|
|
|
|
@ -557,22 +555,25 @@ internal class ProcessDataStandardFormat
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
results.Add("END_HEADER");
|
|
|
|
|
results.Add(string.Empty);
|
|
|
|
|
List<char> hyphens = new();
|
|
|
|
|
results.AddRange(processDataStandardFormat.InputPDSF.Header.Select(l => $"|{l.Replace('\t', '|')}|"));
|
|
|
|
|
results.Add(string.Empty);
|
|
|
|
|
results.Add($"|{string.Join("|", processDataStandardFormat.InputPDSF.Columns)}|");
|
|
|
|
|
for (int i = 0; i < processDataStandardFormat.InputPDSF.Columns.Count; i++)
|
|
|
|
|
hyphens.Add('-');
|
|
|
|
|
results.Add($"|{string.Join("|", hyphens)}|");
|
|
|
|
|
results.AddRange(processDataStandardFormat.InputPDSF.Body.Select(l => $"|{l.Replace('\t', '|')}|"));
|
|
|
|
|
results.Add(string.Empty);
|
|
|
|
|
results.AddRange(processDataStandardFormat.InputPDSF.Footer.Select(l => $"|{l.Replace('\t', '|')}|"));
|
|
|
|
|
results.Add(string.Empty);
|
|
|
|
|
results.Add("EOF");
|
|
|
|
|
results.Add(string.Empty);
|
|
|
|
|
string json = GetJson(processDataStandardFormat);
|
|
|
|
|
results.Add(json);
|
|
|
|
|
if (processDataStandardFormat.InputPDSF is not null)
|
|
|
|
|
{
|
|
|
|
|
results.Add(string.Empty);
|
|
|
|
|
List<char> hyphens = new();
|
|
|
|
|
results.AddRange(processDataStandardFormat.InputPDSF.Header.Select(l => $"|{l.Replace('\t', '|')}|"));
|
|
|
|
|
results.Add(string.Empty);
|
|
|
|
|
results.Add($"|{string.Join("|", processDataStandardFormat.InputPDSF.Columns)}|");
|
|
|
|
|
for (int i = 0; i < processDataStandardFormat.InputPDSF.Columns.Count; i++)
|
|
|
|
|
hyphens.Add('-');
|
|
|
|
|
results.Add($"|{string.Join("|", hyphens)}|");
|
|
|
|
|
results.AddRange(processDataStandardFormat.InputPDSF.Body.Select(l => $"|{l.Replace('\t', '|')}|"));
|
|
|
|
|
results.Add(string.Empty);
|
|
|
|
|
results.AddRange(processDataStandardFormat.InputPDSF.Footer.Select(l => $"|{l.Replace('\t', '|')}|"));
|
|
|
|
|
results.Add(string.Empty);
|
|
|
|
|
results.Add("EOF");
|
|
|
|
|
results.Add(string.Empty);
|
|
|
|
|
string json = GetJson(processDataStandardFormat);
|
|
|
|
|
results.Add(json);
|
|
|
|
|
}
|
|
|
|
|
File.WriteAllText(path, string.Join(Environment.NewLine, results));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|