From 2b3e0dfa32d629e01cd02704b496b44a4758d142 Mon Sep 17 00:00:00 2001 From: Michal Buzik Date: Mon, 23 Feb 2026 15:55:24 +0100 Subject: [PATCH] Remove `SharedComponents` + UNI shows Serial Nr Remove `SharedComponents` references and legacy `LiveLogCache` logic: - Eliminate unused `SharedComponents` references across the solution to streamline dependencies. - Comment out `LiveLogCache` interactions in multiple modules, transitioning to alternative or undefined logging mechanisms. - Add optional `regReadersOptional` parameters to `ShowCycleBeginFormOp` methods for improved flexibility. - Introduce `ITestMethodSmart` interface to support smart reader functionality. - Add new `LogCacheAppender` configuration to `log4netConfig.xml` for diagnostic use. - Update project files to remove outdated references and include newly introduced files. --- AppDiagnostic/AppDiagnostic.csproj | 6 --- AppDiagnostic/LogAdapter.cs | 26 ++++----- AppDiagnostic/LogFilter.cs | 50 ++++++++--------- AppDiagnostic/MainForm.cs | 53 +++++++------------ TBF.sln | 14 ----- TBF/Rig/ControlBoard/Uni/UniCB.cs | 1 - TBF/Rig/DataEntry/Combined/EntryForm.cs | 2 +- TBF/Rig/DataEntry/HeatMeters12/EntryForm.cs | 2 +- TBF/Rig/DataEntry/HeatMeters6/EntryForm.cs | 2 +- TBF/Rig/DataEntry/S620/EntryForm.cs | 2 +- .../DataEntry/Single/EntryFormNoStartEnd.cs | 2 +- .../Standard12/EntryFormNoStartEnd.cs | 2 +- .../Standard24/EntryFormNoStartEnd.cs | 2 +- .../DataEntry/Standard24/TestStartEndForm.cs | 5 +- .../Standard48/EntryFormNoStartEnd.cs | 2 +- .../Standard6/EntryFormNoStartEnd.cs | 2 +- TBF/Rig/DataEntry/StandardCamera/EntryForm.cs | 2 +- .../StandartCameraPurchaseOrder/EntryForm.cs | 2 +- TBF/Rig/DataEntry/Uni/CycleBgEnForm.cs | 11 ++++ TBF/Rig/DataEntry/Uni/EntryFormNoStartEnd.cs | 2 +- TBF/Rig/DataEntry/iPerl/EntryForm.cs | 2 +- TBF/Rig/GenericDevices/IHasCycleBeginForm.cs | 2 +- TBF/Rig/GenericDevices/ITestMethodSmart.cs | 11 ++++ TBF/Rig/Modbus/PumpFM/DanfossVLT/Pump.cs | 3 +- TBF/Rig/Modbus/PumpFM/Grundfoss/Pump.cs | 4 +- .../KPackE/DataEntryForRadio/EntryForm.cs | 2 +- .../PulsesFromUniCB/RRProcParams.cs | 3 +- .../StandingStartStop/RRProcParams.cs | 5 +- TBF/Rig/Sequences/MainSeq.cs | 24 +++++++-- .../FlyingStartMassCollectionMassFlowSeq.cs | 3 +- TBF/Rig/TestMethods/PMaxTest/PMaxTestSeq.cs | 5 +- .../RegValve.cs | 1 - TBF/TBF.csproj | 5 +- TBF/UI/MainWnd.cs | 12 ++--- .../bin/Debug/SampleConfig/log4netConfig.xml | 10 +++- .../Release/SampleConfig/log4netConfig.xml | 10 +++- 36 files changed, 150 insertions(+), 142 deletions(-) create mode 100644 TBF/Rig/GenericDevices/ITestMethodSmart.cs diff --git a/AppDiagnostic/AppDiagnostic.csproj b/AppDiagnostic/AppDiagnostic.csproj index 65f8e8e7a..60dc6196c 100644 --- a/AppDiagnostic/AppDiagnostic.csproj +++ b/AppDiagnostic/AppDiagnostic.csproj @@ -91,11 +91,5 @@ - - - {8f942729-f454-4c99-ba6c-746962065ae3} - SharedComponents - - \ No newline at end of file diff --git a/AppDiagnostic/LogAdapter.cs b/AppDiagnostic/LogAdapter.cs index 38164c555..e82d44f74 100644 --- a/AppDiagnostic/LogAdapter.cs +++ b/AppDiagnostic/LogAdapter.cs @@ -1,4 +1,4 @@ -using SharedComponents; + using System; using System.Collections.Generic; using System.Drawing; @@ -83,22 +83,22 @@ namespace AppDiagnostic var selectedIndices = _listView.SelectedIndices.Cast().ToList(); // Načítanie logov - var logs = LiveLogCache.Instance.GetLogs(0, LiveLogCache.Instance.GetCount()) - .Where(log => string.IsNullOrEmpty(_filterText) || - log.IndexOf(_filterText, StringComparison.OrdinalIgnoreCase) >= 0) - .ToList(); + // var logs = LiveLogCache.Instance.GetLogs(0, LiveLogCache.Instance.GetCount()) + // .Where(log => string.IsNullOrEmpty(_filterText) || + // log.IndexOf(_filterText, StringComparison.OrdinalIgnoreCase) >= 0) + // .ToList(); // Vymazanie existujúcich položiek a pridanie nových _listView.Items.Clear(); - foreach (var log in logs) - { - var item = new ListViewItem(log) - { - BackColor = _listView.Items.Count % 2 == 0 ? Color.White : Color.FromArgb(240, 240, 240) - }; - _listView.Items.Add(item); - } + // foreach (var log in logs) + // { + // var item = new ListViewItem(log) + // { + // BackColor = _listView.Items.Count % 2 == 0 ? Color.White : Color.FromArgb(240, 240, 240) + // }; + // _listView.Items.Add(item); + // } // Obnovenie označených položiek foreach (var index in selectedIndices) diff --git a/AppDiagnostic/LogFilter.cs b/AppDiagnostic/LogFilter.cs index d4e1d666a..d43417da2 100644 --- a/AppDiagnostic/LogFilter.cs +++ b/AppDiagnostic/LogFilter.cs @@ -1,4 +1,4 @@ -using SharedComponents; + using System; using System.Collections.Generic; using System.Drawing; @@ -45,32 +45,32 @@ namespace AppDiagnostic _listView.Items.Clear(); // Načítame všetky logy (ideálne z cache alebo databázy) - var logs = LiveLogCache.Instance.GetLogs(0, LiveLogCache.Instance.Logs.Count); + //var logs = LiveLogCache.Instance.GetLogs(0, LiveLogCache.Instance.Logs.Count); // Pridáme len tie logy, ktoré spĺňajú filter - foreach (var log in logs) - { - if (log.ToLower().Contains(_filterText)) // Kontrola, či log obsahuje filter text - { - var listViewItem = new ListViewItem(log); - - // Striedanie farieb riadkov - if (_listView.Items.Count % 2 == 0) // Párny index => biela - { - listViewItem.BackColor = Color.White; - } - else // Nepárny index => svetlá sivá - { - listViewItem.BackColor = Color.FromArgb(240, 240, 240); // Veľmi svetlá sivá - } - - // Pridanie efektu pre novú položku - ApplyNewItemEffect(listViewItem); - - // Pridanie položky do ListView - _listView.Items.Add(listViewItem); - } - } + // foreach (var log in logs) + // { + // if (log.ToLower().Contains(_filterText)) // Kontrola, či log obsahuje filter text + // { + // var listViewItem = new ListViewItem(log); + // + // // Striedanie farieb riadkov + // if (_listView.Items.Count % 2 == 0) // Párny index => biela + // { + // listViewItem.BackColor = Color.White; + // } + // else // Nepárny index => svetlá sivá + // { + // listViewItem.BackColor = Color.FromArgb(240, 240, 240); // Veľmi svetlá sivá + // } + // + // // Pridanie efektu pre novú položku + // ApplyNewItemEffect(listViewItem); + // + // // Pridanie položky do ListView + // _listView.Items.Add(listViewItem); + // } + // } } } catch (Exception ex) diff --git a/AppDiagnostic/MainForm.cs b/AppDiagnostic/MainForm.cs index c7cde1328..2a6eb31ca 100644 --- a/AppDiagnostic/MainForm.cs +++ b/AppDiagnostic/MainForm.cs @@ -1,19 +1,6 @@ -using log4net.Config; -using log4net; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using System.Windows.Forms; -using log4net.Appender; -using SharedComponents; -using static System.Windows.Forms.VisualStyles.VisualStyleElement; -using System.IO; // Pre File.WriteAllLines a prácu so súbormi -using System.Linq; +// Pre File.WriteAllLines a prácu so súbormi namespace AppDiagnostic { @@ -78,16 +65,16 @@ namespace AppDiagnostic } // Získajte nové logy od posledného indexu - var logs = LiveLogCache.Instance.GetLogs(lastDisplayedLogIndex, LiveLogCache.Instance.Logs.Count - lastDisplayedLogIndex); + //var logs = LiveLogCache.Instance.GetLogs(lastDisplayedLogIndex, LiveLogCache.Instance.Logs.Count - lastDisplayedLogIndex); // Pridajte len nové logy - foreach (var log in logs) - { - memoListView.Items.Add(new ListViewItem(log)); - } + // foreach (var log in logs) + // { + // memoListView.Items.Add(new ListViewItem(log)); + // } // Aktualizujte posledný zobrazený index - lastDisplayedLogIndex = LiveLogCache.Instance.Logs.Count; + //lastDisplayedLogIndex = LiveLogCache.Instance.Logs.Count; // Ak je autoScrollEnabled, posuňte sa na posledný záznam if (autoScrollEnabled && memoListView.Items.Count > 0) @@ -117,7 +104,7 @@ namespace AppDiagnostic { //LiveLogCache.Instance.AddLog("Nový log z hlavnej aplikácie"); - LiveLogCache.Instance.ClearLogs(); + //LiveLogCache.Instance.ClearLogs(); ClearListView(); } @@ -211,10 +198,10 @@ namespace AppDiagnostic try { // Načítanie všetkých logov z LiveLogCache - var logs = LiveLogCache.Instance.GetLogs(0, LiveLogCache.Instance.GetCount()); + //var logs = LiveLogCache.Instance.GetLogs(0, LiveLogCache.Instance.GetCount()); // Uloženie logov do vybraného súboru - File.WriteAllLines(saveFileDialog.FileName, logs); + //File.WriteAllLines(saveFileDialog.FileName, logs); MessageBox.Show("Logs saved successfully.", "Save TBF live logs", MessageBoxButtons.OK, MessageBoxIcon.Information); } @@ -245,19 +232,19 @@ namespace AppDiagnostic _logAdapter._filterText = string.Empty; // Načítanie logov od indexu vybraného riadku - var logs = LiveLogCache.Instance.GetLogs(selectedIndex, LiveLogCache.Instance.GetCount() - selectedIndex); + //var logs = LiveLogCache.Instance.GetLogs(selectedIndex, LiveLogCache.Instance.GetCount() - selectedIndex); // Obnovenie ListView s novými údajmi memoListView.BeginUpdate(); memoListView.Items.Clear(); - foreach (var log in logs) - { - var item = new ListViewItem(log) - { - BackColor = memoListView.Items.Count % 2 == 0 ? Color.White : Color.FromArgb(240, 240, 240) - }; - memoListView.Items.Add(item); - } + // foreach (var log in logs) + // { + // var item = new ListViewItem(log) + // { + // BackColor = memoListView.Items.Count % 2 == 0 ? Color.White : Color.FromArgb(240, 240, 240) + // }; + // memoListView.Items.Add(item); + // } memoListView.EndUpdate(); } } diff --git a/TBF.sln b/TBF.sln index 2dc522326..9600e49d8 100644 --- a/TBF.sln +++ b/TBF.sln @@ -111,8 +111,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppDiagnostic", "AppDiagnos {8F942729-F454-4C99-BA6C-746962065AE3} = {8F942729-F454-4C99-BA6C-746962065AE3} EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharedComponents", "SharedComponents\SharedComponents.csproj", "{8F942729-F454-4C99-BA6C-746962065AE3}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sensus.iPerl.RfidCom", "..\iPerlHead\Sensus.iPerl.RfidCom\Sensus.iPerl.RfidCom.csproj", "{A3E14180-7F00-42E5-94A9-8DB62EAD6EE8}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sensus.iPerl.TestConsole", "..\iPerlHead\Sensus.iPerl.TestConsole\Sensus.iPerl.TestConsole.csproj", "{5025ED8B-A94F-4E58-8BE0-68481B061609}" @@ -491,18 +489,6 @@ Global {FA9ABAD1-7184-4295-ADE8-D44F2E3DE6B2}.Release|Mixed Platforms.Build.0 = Release|Any CPU {FA9ABAD1-7184-4295-ADE8-D44F2E3DE6B2}.Release|x86.ActiveCfg = Release|Any CPU {FA9ABAD1-7184-4295-ADE8-D44F2E3DE6B2}.Release|x86.Build.0 = Release|Any CPU - {8F942729-F454-4C99-BA6C-746962065AE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8F942729-F454-4C99-BA6C-746962065AE3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8F942729-F454-4C99-BA6C-746962065AE3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {8F942729-F454-4C99-BA6C-746962065AE3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {8F942729-F454-4C99-BA6C-746962065AE3}.Debug|x86.ActiveCfg = Debug|Any CPU - {8F942729-F454-4C99-BA6C-746962065AE3}.Debug|x86.Build.0 = Debug|Any CPU - {8F942729-F454-4C99-BA6C-746962065AE3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8F942729-F454-4C99-BA6C-746962065AE3}.Release|Any CPU.Build.0 = Release|Any CPU - {8F942729-F454-4C99-BA6C-746962065AE3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {8F942729-F454-4C99-BA6C-746962065AE3}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {8F942729-F454-4C99-BA6C-746962065AE3}.Release|x86.ActiveCfg = Release|Any CPU - {8F942729-F454-4C99-BA6C-746962065AE3}.Release|x86.Build.0 = Release|Any CPU {A3E14180-7F00-42E5-94A9-8DB62EAD6EE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A3E14180-7F00-42E5-94A9-8DB62EAD6EE8}.Debug|Any CPU.Build.0 = Debug|Any CPU {A3E14180-7F00-42E5-94A9-8DB62EAD6EE8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU diff --git a/TBF/Rig/ControlBoard/Uni/UniCB.cs b/TBF/Rig/ControlBoard/Uni/UniCB.cs index ef5dd1d33..188e98ac0 100644 --- a/TBF/Rig/ControlBoard/Uni/UniCB.cs +++ b/TBF/Rig/ControlBoard/Uni/UniCB.cs @@ -18,7 +18,6 @@ using TBF.Rig.GenericDevices; using TBF.Rig.Sequences; using TBF.UiBridge; using AppDiagnostic; -using SharedComponents; namespace TBF.Rig.ControlBoard.Uni { diff --git a/TBF/Rig/DataEntry/Combined/EntryForm.cs b/TBF/Rig/DataEntry/Combined/EntryForm.cs index eb4a64af8..1cf067a51 100644 --- a/TBF/Rig/DataEntry/Combined/EntryForm.cs +++ b/TBF/Rig/DataEntry/Combined/EntryForm.cs @@ -81,7 +81,7 @@ namespace TBF.Rig.DataEntry.Combined /// Reference to the operation - public IOperation ShowCycleBeginFormOp() + public IOperation ShowCycleBeginFormOp( IRegReader[] regReadersOptional = null) { if (currentOp != CurrentOp.None) throw new Exception("Sequence error"); currentOp = CurrentOp.ShowFormAtCycleBeginning; diff --git a/TBF/Rig/DataEntry/HeatMeters12/EntryForm.cs b/TBF/Rig/DataEntry/HeatMeters12/EntryForm.cs index 572280835..447d75ee8 100644 --- a/TBF/Rig/DataEntry/HeatMeters12/EntryForm.cs +++ b/TBF/Rig/DataEntry/HeatMeters12/EntryForm.cs @@ -96,7 +96,7 @@ namespace TBF.Rig.DataEntry.HeatMeters12 /// Reference to the operation - public IOperation ShowCycleBeginFormOp() + public IOperation ShowCycleBeginFormOp( IRegReader[] regReadersOptional = null) { if (currentOp != CurrentOp.None) throw new Exception("Sequence error"); currentOp = CurrentOp.ShowFormAtCycleBeginning; diff --git a/TBF/Rig/DataEntry/HeatMeters6/EntryForm.cs b/TBF/Rig/DataEntry/HeatMeters6/EntryForm.cs index 97965e1f4..d34497280 100644 --- a/TBF/Rig/DataEntry/HeatMeters6/EntryForm.cs +++ b/TBF/Rig/DataEntry/HeatMeters6/EntryForm.cs @@ -95,7 +95,7 @@ namespace TBF.Rig.DataEntry.HeatMeters6 } /// Reference to the operation - public IOperation ShowCycleBeginFormOp() + public IOperation ShowCycleBeginFormOp( IRegReader[] regReadersOptional = null) { if (currentOp != CurrentOp.None) throw new Exception("Sequence error"); currentOp = CurrentOp.ShowFormAtCycleBeginning; diff --git a/TBF/Rig/DataEntry/S620/EntryForm.cs b/TBF/Rig/DataEntry/S620/EntryForm.cs index d3d562f4d..d51668f1d 100644 --- a/TBF/Rig/DataEntry/S620/EntryForm.cs +++ b/TBF/Rig/DataEntry/S620/EntryForm.cs @@ -89,7 +89,7 @@ namespace TBF.Rig.DataEntry.S620 /// Reference to the operation - public IOperation ShowCycleBeginFormOp() + public IOperation ShowCycleBeginFormOp( IRegReader[] regReadersOptional = null) { if (currentOp != CurrentOp.None) throw new Exception("Sequence error"); currentOp = CurrentOp.ShowFormAtCycleBeginning; diff --git a/TBF/Rig/DataEntry/Single/EntryFormNoStartEnd.cs b/TBF/Rig/DataEntry/Single/EntryFormNoStartEnd.cs index 7aba67818..147275627 100644 --- a/TBF/Rig/DataEntry/Single/EntryFormNoStartEnd.cs +++ b/TBF/Rig/DataEntry/Single/EntryFormNoStartEnd.cs @@ -81,7 +81,7 @@ namespace TBF.Rig.DataEntry.Single /// Reference to the operation - public IOperation ShowCycleBeginFormOp() + public IOperation ShowCycleBeginFormOp( IRegReader[] regReadersOptional = null) { if (currentOp != CurrentOp.None) throw new Exception("Sequence error"); currentOp = CurrentOp.ShowFormAtCycleBeginning; diff --git a/TBF/Rig/DataEntry/Standard12/EntryFormNoStartEnd.cs b/TBF/Rig/DataEntry/Standard12/EntryFormNoStartEnd.cs index fa208c85a..c7586f7b0 100644 --- a/TBF/Rig/DataEntry/Standard12/EntryFormNoStartEnd.cs +++ b/TBF/Rig/DataEntry/Standard12/EntryFormNoStartEnd.cs @@ -81,7 +81,7 @@ namespace TBF.Rig.DataEntry.Standard12 /// Reference to the operation - public IOperation ShowCycleBeginFormOp() + public IOperation ShowCycleBeginFormOp( IRegReader[] regReadersOptional = null) { if (currentOp != CurrentOp.None) throw new Exception("Sequence error"); currentOp = CurrentOp.ShowFormAtCycleBeginning; diff --git a/TBF/Rig/DataEntry/Standard24/EntryFormNoStartEnd.cs b/TBF/Rig/DataEntry/Standard24/EntryFormNoStartEnd.cs index d7a0d5572..a3a34e6f4 100644 --- a/TBF/Rig/DataEntry/Standard24/EntryFormNoStartEnd.cs +++ b/TBF/Rig/DataEntry/Standard24/EntryFormNoStartEnd.cs @@ -83,7 +83,7 @@ namespace TBF.Rig.DataEntry.Standard24 /// Reference to the operation - public IOperation ShowCycleBeginFormOp() + public IOperation ShowCycleBeginFormOp( IRegReader[] regReadersOptional = null) { if (currentOp != CurrentOp.None) throw new Exception("Sequence error"); this.currentOp = CurrentOp.ShowFormAtCycleBeginning; diff --git a/TBF/Rig/DataEntry/Standard24/TestStartEndForm.cs b/TBF/Rig/DataEntry/Standard24/TestStartEndForm.cs index a54aa7c54..d43724228 100644 --- a/TBF/Rig/DataEntry/Standard24/TestStartEndForm.cs +++ b/TBF/Rig/DataEntry/Standard24/TestStartEndForm.cs @@ -1,7 +1,6 @@ using Common; -using Config; using log4net; -using SharedComponents; + /// /// Copyright (c) 2015-2018 Sensus Slovensko a.s. /// @@ -644,7 +643,7 @@ namespace TBF.Rig.DataEntry.Standard24 [Conditional("DIAG_LOG_TestStartEndForm1")] public static void Log1(string format, params object[] args) { - LiveLogCache.Instance.AddLog(string.Format(format, args)); + //LiveLogCache.Instance.AddLog(string.Format(format, args)); } } } diff --git a/TBF/Rig/DataEntry/Standard48/EntryFormNoStartEnd.cs b/TBF/Rig/DataEntry/Standard48/EntryFormNoStartEnd.cs index 1a784a1d6..73d7bd0d7 100644 --- a/TBF/Rig/DataEntry/Standard48/EntryFormNoStartEnd.cs +++ b/TBF/Rig/DataEntry/Standard48/EntryFormNoStartEnd.cs @@ -81,7 +81,7 @@ namespace TBF.Rig.DataEntry.Standard48 /// Reference to the operation - public IOperation ShowCycleBeginFormOp() + public IOperation ShowCycleBeginFormOp( IRegReader[] regReadersOptional = null) { if (currentOp != CurrentOp.None) throw new Exception("Sequence error"); currentOp = CurrentOp.ShowFormAtCycleBeginning; diff --git a/TBF/Rig/DataEntry/Standard6/EntryFormNoStartEnd.cs b/TBF/Rig/DataEntry/Standard6/EntryFormNoStartEnd.cs index 642c64b9a..a1654fa17 100644 --- a/TBF/Rig/DataEntry/Standard6/EntryFormNoStartEnd.cs +++ b/TBF/Rig/DataEntry/Standard6/EntryFormNoStartEnd.cs @@ -77,7 +77,7 @@ namespace TBF.Rig.DataEntry.Standard6 /// Reference to the operation - public IOperation ShowCycleBeginFormOp() + public IOperation ShowCycleBeginFormOp( IRegReader[] regReadersOptional = null) { if (currentOp != CurrentOp.None) throw new Exception("Sequence error"); currentOp = CurrentOp.ShowFormAtCycleBeginning; diff --git a/TBF/Rig/DataEntry/StandardCamera/EntryForm.cs b/TBF/Rig/DataEntry/StandardCamera/EntryForm.cs index 4a714b4ff..a8e08ef2e 100644 --- a/TBF/Rig/DataEntry/StandardCamera/EntryForm.cs +++ b/TBF/Rig/DataEntry/StandardCamera/EntryForm.cs @@ -158,7 +158,7 @@ namespace TBF.Rig.DataEntry.StandardCamera /// Reference to the operation - public IOperation ShowCycleBeginFormOp() + public IOperation ShowCycleBeginFormOp( IRegReader[] regReadersOptional = null) { if (currentOp != CurrentOp.None) throw new Exception("Sequence error"); currentOp = CurrentOp.ShowFormAtCycleBeginning; diff --git a/TBF/Rig/DataEntry/StandartCameraPurchaseOrder/EntryForm.cs b/TBF/Rig/DataEntry/StandartCameraPurchaseOrder/EntryForm.cs index 96ea9e4a9..091605cbf 100644 --- a/TBF/Rig/DataEntry/StandartCameraPurchaseOrder/EntryForm.cs +++ b/TBF/Rig/DataEntry/StandartCameraPurchaseOrder/EntryForm.cs @@ -165,7 +165,7 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder /// Reference to the operation - public IOperation ShowCycleBeginFormOp() + public IOperation ShowCycleBeginFormOp( IRegReader[] regReadersOptional = null) { if (currentOp != CurrentOp.None) throw new Exception("Sequence error"); currentOp = CurrentOp.ShowFormAtCycleBeginning; diff --git a/TBF/Rig/DataEntry/Uni/CycleBgEnForm.cs b/TBF/Rig/DataEntry/Uni/CycleBgEnForm.cs index 9939550c1..47ddf614d 100644 --- a/TBF/Rig/DataEntry/Uni/CycleBgEnForm.cs +++ b/TBF/Rig/DataEntry/Uni/CycleBgEnForm.cs @@ -49,6 +49,8 @@ namespace TBF.Rig.DataEntry.Uni readonly Label[] labels; /// Labels for water meter numbers readonly ComboBox[,] comboBoxes; /// Combo boxes for values in columns readonly CheckBox[] checkBoxes; /// Check boxes for water meter enable/disable + /// + bool readSerialNoByRegisterReader = true; readonly MultiPurposeBtnFunction multiPurposeButtonFn; bool multiPurposeButtonFlag; @@ -700,6 +702,15 @@ namespace TBF.Rig.DataEntry.Uni /// string firstSN = comboBoxes[k, firstIx].Text; + + + if (readSerialNoByRegisterReader) + { + //TODO read serail number from register reader + log.Debug("Read serial number from register reader!"); + + } + int firstSnNr; int startIx = firstSN.IndexOfAny(digits); if (startIx >= 0) diff --git a/TBF/Rig/DataEntry/Uni/EntryFormNoStartEnd.cs b/TBF/Rig/DataEntry/Uni/EntryFormNoStartEnd.cs index 008af64fa..6d7808b91 100644 --- a/TBF/Rig/DataEntry/Uni/EntryFormNoStartEnd.cs +++ b/TBF/Rig/DataEntry/Uni/EntryFormNoStartEnd.cs @@ -150,7 +150,7 @@ namespace TBF.Rig.DataEntry.Uni /// Reference to the operation - public IOperation ShowCycleBeginFormOp() + public IOperation ShowCycleBeginFormOp( IRegReader[] regReadersOptional = null) { if (currentOp != CurrentOp.None) throw new Exception("Sequence error"); currentOp = CurrentOp.FormAtCycleBeginning; diff --git a/TBF/Rig/DataEntry/iPerl/EntryForm.cs b/TBF/Rig/DataEntry/iPerl/EntryForm.cs index 3a175b684..ceb32da38 100644 --- a/TBF/Rig/DataEntry/iPerl/EntryForm.cs +++ b/TBF/Rig/DataEntry/iPerl/EntryForm.cs @@ -80,7 +80,7 @@ namespace TBF.Rig.DataEntry.iPerl /// Reference to the operation - public IOperation ShowCycleBeginFormOp() + public IOperation ShowCycleBeginFormOp( IRegReader[] regReadersOptional = null) { if (currentOp != CurrentOp.None) throw new Exception("Sequence error"); currentOp = CurrentOp.ShowFormAtCycleBeginning; diff --git a/TBF/Rig/GenericDevices/IHasCycleBeginForm.cs b/TBF/Rig/GenericDevices/IHasCycleBeginForm.cs index 5479b3f8a..418de1947 100644 --- a/TBF/Rig/GenericDevices/IHasCycleBeginForm.cs +++ b/TBF/Rig/GenericDevices/IHasCycleBeginForm.cs @@ -11,6 +11,6 @@ namespace TBF.Rig.GenericDevices /// Displays form at the beginning of the cycle (usually to enter S/N). /// /// Operation to be used in the sequence - IOperation ShowCycleBeginFormOp(); + IOperation ShowCycleBeginFormOp( IRegReader[] regReadersOptional = null); } } diff --git a/TBF/Rig/GenericDevices/ITestMethodSmart.cs b/TBF/Rig/GenericDevices/ITestMethodSmart.cs new file mode 100644 index 000000000..b7cb466f2 --- /dev/null +++ b/TBF/Rig/GenericDevices/ITestMethodSmart.cs @@ -0,0 +1,11 @@ +namespace TBF.Rig.GenericDevices +{ + /// + /// * mark test method from smart family devices + /// * (this Test method is used for devices that support smart reader) + /// + public interface ITestMethodSmart + { + + } +} \ No newline at end of file diff --git a/TBF/Rig/Modbus/PumpFM/DanfossVLT/Pump.cs b/TBF/Rig/Modbus/PumpFM/DanfossVLT/Pump.cs index 9fbe16d0f..8d3787761 100644 --- a/TBF/Rig/Modbus/PumpFM/DanfossVLT/Pump.cs +++ b/TBF/Rig/Modbus/PumpFM/DanfossVLT/Pump.cs @@ -2,7 +2,6 @@ using Dirichlet.Numerics; using log4net; using SchematicDrawing; -using SharedComponents; /// /// Copyright (c) 2020 Sensus Slovensko a.s. /// @@ -355,7 +354,7 @@ namespace TBF.Rig.Modbus.PumpFM.DanfossVLT [Conditional("DIAG_LOG_PUMP")] public static void Log1(string format, params object[] args) { - LiveLogCache.Instance.AddLog(string.Format(format, args)); + //LiveLogCache.Instance.AddLog(string.Format(format, args)); } } } diff --git a/TBF/Rig/Modbus/PumpFM/Grundfoss/Pump.cs b/TBF/Rig/Modbus/PumpFM/Grundfoss/Pump.cs index ba8792c0b..c09d54220 100644 --- a/TBF/Rig/Modbus/PumpFM/Grundfoss/Pump.cs +++ b/TBF/Rig/Modbus/PumpFM/Grundfoss/Pump.cs @@ -2,7 +2,7 @@ using Dirichlet.Numerics; using log4net; using SchematicDrawing; -using SharedComponents; + /// /// Copyright (c) 2020 Sensus Slovensko a.s. /// @@ -491,7 +491,7 @@ namespace TBF.Rig.Modbus.PumpFM.Grundfoss [Conditional("DIAG_LOG_PUMP")] public static void Log1(string format, params object[] args) { - LiveLogCache.Instance.AddLog(string.Format(format, args)); + //LiveLogCache.Instance.AddLog(string.Format(format, args)); } } } diff --git a/TBF/Rig/RegisterReaders/KPackE/DataEntryForRadio/EntryForm.cs b/TBF/Rig/RegisterReaders/KPackE/DataEntryForRadio/EntryForm.cs index b88f90518..9f2a85a0c 100644 --- a/TBF/Rig/RegisterReaders/KPackE/DataEntryForRadio/EntryForm.cs +++ b/TBF/Rig/RegisterReaders/KPackE/DataEntryForRadio/EntryForm.cs @@ -89,7 +89,7 @@ namespace TBF.Rig.RegisterReaders.KPackE.DataEntryForRadio /// Reference to the operation - public IOperation ShowCycleBeginFormOp() + public IOperation ShowCycleBeginFormOp( IRegReader[] regReadersOptional = null) { if (currentOp != CurrentOp.None) throw new Exception("Sequence error"); currentOp = CurrentOp.ShowFormAtCycleBeginning; diff --git a/TBF/Rig/RegisterReaders/PulsesFromUniCB/RRProcParams.cs b/TBF/Rig/RegisterReaders/PulsesFromUniCB/RRProcParams.cs index 5f0149ab7..cae2599f2 100644 --- a/TBF/Rig/RegisterReaders/PulsesFromUniCB/RRProcParams.cs +++ b/TBF/Rig/RegisterReaders/PulsesFromUniCB/RRProcParams.cs @@ -1,7 +1,6 @@ using Common; using Config.Entities; using log4net; -using SharedComponents; /// /// Copyright (c) 2021 Sensus Slovensko a.s. @@ -205,7 +204,7 @@ namespace TBF.Rig.RegisterReaders.PulsesFromUniCB [Conditional("DIAG_LOG_MASS1")] public static void Log1(string format, params object[] args) { - LiveLogCache.Instance.AddLog(string.Format(format, args)); + //LiveLogCache.Instance.AddLog(string.Format(format, args)); } } } diff --git a/TBF/Rig/RegisterReaders/StandingStartStop/RRProcParams.cs b/TBF/Rig/RegisterReaders/StandingStartStop/RRProcParams.cs index 5eb5d81ce..a2687c742 100644 --- a/TBF/Rig/RegisterReaders/StandingStartStop/RRProcParams.cs +++ b/TBF/Rig/RegisterReaders/StandingStartStop/RRProcParams.cs @@ -1,7 +1,7 @@ using Common; using Config.Entities; using log4net; -using SharedComponents; + /// /// Copyright (c) 2013-2015 Sensus Metering Systems @@ -10,7 +10,6 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; -using System.Text; using System.Xml.Serialization; using TBF.Resources; using TBF.Rig.Generic; @@ -189,7 +188,7 @@ namespace TBF.Rig.RegisterReaders.StandingStartStop [Conditional("DIAG_LOG_MASS1")] public static void Log1(string format, params object[] args) { - LiveLogCache.Instance.AddLog(string.Format(format, args)); + //LiveLogCache.Instance.AddLog(string.Format(format, args)); } } } diff --git a/TBF/Rig/Sequences/MainSeq.cs b/TBF/Rig/Sequences/MainSeq.cs index 664120b5a..4ef2273c4 100644 --- a/TBF/Rig/Sequences/MainSeq.cs +++ b/TBF/Rig/Sequences/MainSeq.cs @@ -18,7 +18,6 @@ using TBF.Rig.Network.RestAPI; using TBF.Rig.Network.RestAPI.facade; using TBF.Rig.Output.Printers.GroupPrinting.Single; using TBF.UiBridge; -using SharedComponents; using System.Text; namespace TBF.Rig.Sequences @@ -508,7 +507,26 @@ namespace TBF.Rig.Sequences /// /// This is a normal batch (not a restored one) => Display 'Cycle Begin Form' /// - if (!OpenCycleBeginForm()) + /// Open iPerlCommunicationForm + if (simultWithPurgingTests.Count > 0) + { + ProcessData.RegisterReaders = StateMachine.GetMetersPath(simultWithPurgingTests[0]).RegisterReaders; + } + else + { + //get throw test instances and if Smart Reader SerialNo found use it + for (int i = 0; i < StateMachine.TestInstances.Length; i++) + { + Test test = StateMachine.TestInstances[i].Test; + if (test is ITestMethodSmart) + { + ProcessData.RegisterReaders = StateMachine.GetMetersPath(test).RegisterReaders; + break; + } + } + } + + if (!OpenCycleBeginForm(ProcessData.RegisterReaders)) { goto stop; } @@ -1536,7 +1554,7 @@ namespace TBF.Rig.Sequences } // ✍️ Uloženie do vlastného logu - LiveLogCache.Instance.AddLog(logBuilder.ToString()); + //LiveLogCache.Instance.AddLog(logBuilder.ToString()); Bridge.OnError(this, "Chyba pri aktualizácii výsledkov v MySQL."); goto error; diff --git a/TBF/Rig/TestMethods/FlyingStartMassCollectionMassFlow/FlyingStartMassCollectionMassFlowSeq.cs b/TBF/Rig/TestMethods/FlyingStartMassCollectionMassFlow/FlyingStartMassCollectionMassFlowSeq.cs index 7cdbc0b89..60cfd2d97 100644 --- a/TBF/Rig/TestMethods/FlyingStartMassCollectionMassFlow/FlyingStartMassCollectionMassFlowSeq.cs +++ b/TBF/Rig/TestMethods/FlyingStartMassCollectionMassFlow/FlyingStartMassCollectionMassFlowSeq.cs @@ -2,7 +2,6 @@ using Config.Entities; using FluentNHibernate.Data; using log4net; -using SharedComponents; /// /// Copyright (c) 2013-2021 Sensus Slovensko a.s. /// @@ -1394,7 +1393,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollectionMassFlow [Conditional("DIAG_LOG_MASS1")] public static void Log1(string format, params object[] args) { - LiveLogCache.Instance.AddLog(string.Format(format, args)); + //LiveLogCache.Instance.AddLog(string.Format(format, args)); } } } diff --git a/TBF/Rig/TestMethods/PMaxTest/PMaxTestSeq.cs b/TBF/Rig/TestMethods/PMaxTest/PMaxTestSeq.cs index 01e322335..9731242af 100644 --- a/TBF/Rig/TestMethods/PMaxTest/PMaxTestSeq.cs +++ b/TBF/Rig/TestMethods/PMaxTest/PMaxTestSeq.cs @@ -1,7 +1,6 @@ using Common; -using Config.Entities; using log4net; -using SharedComponents; + /// /// Copyright (c) 2015-2021 Sensus Slovensko a.s. /// @@ -558,7 +557,7 @@ namespace TBF.Rig.TestMethods.PMaxTest [Conditional("DIAG_LOG_PUMP2")] public static void Log1(string format, params object[] args) { - LiveLogCache.Instance.AddLog(string.Format(format, args)); + //LiveLogCache.Instance.AddLog(string.Format(format, args)); } } } diff --git a/TBF/Rig/Uni/RegValveLowRegulTimeSaturation/RegValve.cs b/TBF/Rig/Uni/RegValveLowRegulTimeSaturation/RegValve.cs index 526d042ed..e65ad389e 100644 --- a/TBF/Rig/Uni/RegValveLowRegulTimeSaturation/RegValve.cs +++ b/TBF/Rig/Uni/RegValveLowRegulTimeSaturation/RegValve.cs @@ -7,7 +7,6 @@ using log4net; using SchematicDrawing; using TBF.Rig.ControlBoard.Uni; using TBF.Boxes; -using SharedComponents; namespace TBF.Rig.Uni.RegValveLowRegulTimeSaturation { diff --git a/TBF/TBF.csproj b/TBF/TBF.csproj index 76a112d68..f8ce60b82 100644 --- a/TBF/TBF.csproj +++ b/TBF/TBF.csproj @@ -658,6 +658,7 @@ + @@ -3795,10 +3796,6 @@ {0f79ca69-9dbc-41f3-a6fc-5a2937365343} SchematicDrawing - - {8f942729-f454-4c99-ba6c-746962065ae3} - SharedComponents - {211b5e3f-9996-48a7-abde-c878dd2d71c2} SharedDatabase diff --git a/TBF/UI/MainWnd.cs b/TBF/UI/MainWnd.cs index d4b017169..f6ea755b0 100644 --- a/TBF/UI/MainWnd.cs +++ b/TBF/UI/MainWnd.cs @@ -13,13 +13,9 @@ using Common; using Config.Entities; using Dirichlet.Numerics; using SchematicDrawing; -using SharedDatabase; using TBF.Resources; using TBF.UiBridge; using TBF.UI.Shared; -using AppDiagnostic; -using SharedComponents; -using System.Diagnostics; namespace TBF.UI { @@ -1165,12 +1161,12 @@ namespace TBF.UI ILog loger = LogManager.GetLogger("logCache"); log.Debug("ahoj, ideme");*/ - LiveLogCache.Instance.AddLog("=== Live diagnostic entry ==="); - DiagApi liveDiagApi = new DiagApi(); + //LiveLogCache.Instance.AddLog("=== Live diagnostic entry ==="); + //DiagApi liveDiagApi = new DiagApi(); /*try { - // Predpokladme, e ApplicationDiagnostic.exe je v rovnakom adresri ako hlavn aplikcia + // Predpoklad�me, �e ApplicationDiagnostic.exe je v rovnakom adres�ri ako hlavn� aplik�cia string exePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "AppDiagnostic.exe"); if (File.Exists(exePath)) @@ -1178,7 +1174,7 @@ namespace TBF.UI ProcessStartInfo startInfo = new ProcessStartInfo { FileName = exePath, - UseShellExecute = true // Spust aplikciu ako samostatn proces + UseShellExecute = true // Spust� aplik�ciu ako samostatn� proces }; System.Diagnostics.Process.Start(startInfo); } diff --git a/TBFTests/bin/Debug/SampleConfig/log4netConfig.xml b/TBFTests/bin/Debug/SampleConfig/log4netConfig.xml index 338d53558..44205cd62 100644 --- a/TBFTests/bin/Debug/SampleConfig/log4netConfig.xml +++ b/TBFTests/bin/Debug/SampleConfig/log4netConfig.xml @@ -38,12 +38,20 @@ + + + + + - + + + + diff --git a/TBFTests/bin/Release/SampleConfig/log4netConfig.xml b/TBFTests/bin/Release/SampleConfig/log4netConfig.xml index 338d53558..44205cd62 100644 --- a/TBFTests/bin/Release/SampleConfig/log4netConfig.xml +++ b/TBFTests/bin/Release/SampleConfig/log4netConfig.xml @@ -38,12 +38,20 @@ + + + + + - + + + +