From 1d152afd6c901ad75f37c693182145e50afce256 Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Mon, 15 Nov 2021 14:47:26 +0100 Subject: [PATCH] Output.FileWriters and Output.Printers changes, ver. 2.27.1807 --- TBF/Properties/AssemblyInfo.cs | 4 ++-- TBF/Rig/Output/FileWriters/Enhanced/Writer.cs | 4 ++-- .../Output/FileWriters/OneFilePerMeter/Writer.cs | 14 ++++++++++---- TBF/Rig/Output/Printers/OnePerMeter/Printer.cs | 3 ++- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/TBF/Properties/AssemblyInfo.cs b/TBF/Properties/AssemblyInfo.cs index df970c23f..ecf6a3fe6 100644 --- a/TBF/Properties/AssemblyInfo.cs +++ b/TBF/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("2.27.1802.0")] -[assembly: AssemblyFileVersion("2.27.1802.0")] +[assembly: AssemblyVersion("2.27.1807.0")] +[assembly: AssemblyFileVersion("2.27.1807.0")] diff --git a/TBF/Rig/Output/FileWriters/Enhanced/Writer.cs b/TBF/Rig/Output/FileWriters/Enhanced/Writer.cs index e2c047e99..727b3d39f 100644 --- a/TBF/Rig/Output/FileWriters/Enhanced/Writer.cs +++ b/TBF/Rig/Output/FileWriters/Enhanced/Writer.cs @@ -192,7 +192,7 @@ namespace TBF.Rig.Output.FileWriters.Enhanced { if (string.IsNullOrEmpty(writerCfg.FileNameFormat)) { - return string.Format("{0}{1:yyMMdd-HHmm}.txt", directory, time); + return Path.Combine(directory, string.Format("{0:yyMMdd-HHmm}.txt", time)); } else { @@ -202,7 +202,7 @@ namespace TBF.Rig.Output.FileWriters.Enhanced } catch { - return string.Format("{0}{1:yyMMdd-HHmm}.txt", directory, time); + return Path.Combine(directory, string.Format("{0:yyMMdd-HHmm}.txt", time)); } } diff --git a/TBF/Rig/Output/FileWriters/OneFilePerMeter/Writer.cs b/TBF/Rig/Output/FileWriters/OneFilePerMeter/Writer.cs index bdfbb4430..a2e8d070e 100644 --- a/TBF/Rig/Output/FileWriters/OneFilePerMeter/Writer.cs +++ b/TBF/Rig/Output/FileWriters/OneFilePerMeter/Writer.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2017 Sensus Metering Systems +/// Copyright (c) 2017-2021 Sensus Slovensko a.s. /// using System; using System.Collections.Generic; @@ -188,12 +188,18 @@ namespace TBF.Rig.Output.FileWriters.OneFilePerMeter try { - if (string.IsNullOrEmpty(writerCfg.FileNameFormat)) throw new Exception(); - return directory + string.Format(writerCfg.FileNameFormat, time); + if (string.IsNullOrEmpty(writerCfg.FileNameFormat)) + { + return Path.Combine(directory, string.Format("{0:yyMMdd-HHmm}.txt", time)); + } + else + { + return Path.Combine(directory, string.Format(writerCfg.FileNameFormat, time)); + } } catch { - return string.Format("{0}{1:yyMMdd-HHmm}.txt", directory, time); + return Path.Combine(directory, string.Format("{0:yyMMdd-HHmm}.txt", time)); } } diff --git a/TBF/Rig/Output/Printers/OnePerMeter/Printer.cs b/TBF/Rig/Output/Printers/OnePerMeter/Printer.cs index eab07a9ab..e9d9b0da9 100644 --- a/TBF/Rig/Output/Printers/OnePerMeter/Printer.cs +++ b/TBF/Rig/Output/Printers/OnePerMeter/Printer.cs @@ -169,7 +169,8 @@ namespace TBF.Rig.Output.Printers.OnePerMeter try { if (string.IsNullOrEmpty(printerCfg.DocName)) throw (new Exception()); - documentName = string.Format(printerCfg.DocName, wm.StartTime(), wm.EndTime(), wm.BatchNr(), wm.WMPosition, wm.SerialNr); + documentName = string.Format(printerCfg.DocName, wm.StartTime(), wm.EndTime(), wm.BatchNr(), wm.WMPosition, wm.SerialNr, wm.SerialNrAux); + /// {0} {1} {2} {3} {4} {5} } catch {