From 9339683a0e67243555e1616f807fb2406bd5e64a Mon Sep 17 00:00:00 2001 From: Michal Buzik Date: Thu, 23 Apr 2026 09:53:13 +0200 Subject: [PATCH] Refactor `GenesisCommunication` to `GenesisFullCommunication`, including namespace updates, class renaming, file relocations, and `csproj` adjustments. --- TBF/Rig/TbfComponents.cs | 4 +++- .../Factory.cs | 4 ++-- .../GenesisCommunicationParams.cs} | 18 +++++++++--------- .../GenesisCommunicationSeq.cs | 9 ++++++--- .../SequenceConditionOp.cs | 4 +++- .../TestMethod.cs | 5 ++--- .../TestMethodCfg.cs | 11 +++++------ .../TestMethodCfgCtrl.cs | 2 +- .../TestMethodCfgCtrl.designer.cs | 2 +- .../TestMethodCfgCtrl.resx | 0 TBF/TBF.csproj | 18 +++++++++--------- 11 files changed, 41 insertions(+), 36 deletions(-) rename TBF/Rig/TestMethods/{GenesisCommunication => GenesisFullCommunication}/Factory.cs (87%) rename TBF/Rig/TestMethods/{GenesisCommunication/iPerlCommunicationParams.cs => GenesisFullCommunication/GenesisCommunicationParams.cs} (92%) rename TBF/Rig/TestMethods/{GenesisCommunication => GenesisFullCommunication}/GenesisCommunicationSeq.cs (99%) rename TBF/Rig/TestMethods/{GenesisCommunication => GenesisFullCommunication}/SequenceConditionOp.cs (90%) rename TBF/Rig/TestMethods/{GenesisCommunication => GenesisFullCommunication}/TestMethod.cs (97%) rename TBF/Rig/TestMethods/{GenesisCommunication => GenesisFullCommunication}/TestMethodCfg.cs (90%) rename TBF/Rig/TestMethods/{GenesisCommunication => GenesisFullCommunication}/TestMethodCfgCtrl.cs (99%) rename TBF/Rig/TestMethods/{GenesisCommunication => GenesisFullCommunication}/TestMethodCfgCtrl.designer.cs (99%) rename TBF/Rig/TestMethods/{GenesisCommunication => GenesisFullCommunication}/TestMethodCfgCtrl.resx (100%) diff --git a/TBF/Rig/TbfComponents.cs b/TBF/Rig/TbfComponents.cs index 79fc0b6c0..113396329 100644 --- a/TBF/Rig/TbfComponents.cs +++ b/TBF/Rig/TbfComponents.cs @@ -9,6 +9,7 @@ using log4net; using log4net.Repository.Hierarchy; using TBF.Rig.Generic; using TBF.Rig.Sequences; +using TBF.Rig.TestMethods.GenesisFullCommunication; namespace TBF.Rig { @@ -192,7 +193,8 @@ namespace TBF.Rig new TestMethods.FlyingStartFirstRepetWithMassColl.HeatMeters.Factory(), new TestMethods.FlyingStartTankCollection.Single.Factory(), new TestMethods.FlyingStartTankCollection.Compound.Factory(), - new TestMethods.GenesisCommunication.GenesisHead.Factory(), + new TestMethods.GenesisCommunication.GenesisHead.Factory(), // german implementation of the Genesis communication protocol + new Factory(), new TestMethods.GrabImage.Factory(), new TestMethods.iPerlCommunication.TestMethodFactory(), /// iPerlCommunication new TestMethods.LeakTest.Factory(), diff --git a/TBF/Rig/TestMethods/GenesisCommunication/Factory.cs b/TBF/Rig/TestMethods/GenesisFullCommunication/Factory.cs similarity index 87% rename from TBF/Rig/TestMethods/GenesisCommunication/Factory.cs rename to TBF/Rig/TestMethods/GenesisFullCommunication/Factory.cs index 94da6ce29..c81c78062 100644 --- a/TBF/Rig/TestMethods/GenesisCommunication/Factory.cs +++ b/TBF/Rig/TestMethods/GenesisFullCommunication/Factory.cs @@ -4,9 +4,9 @@ using System.Collections.Generic; using TBF.Rig.Generic; -using TBF.Rig.TestMethods.iPerlCommunication; +using TBF.Rig.TestMethods.GenesisCommunication; -namespace TBF.Rig.TestMethods.GenesisCommunication +namespace TBF.Rig.TestMethods.GenesisFullCommunication { public class Factory : IComponentFactory { diff --git a/TBF/Rig/TestMethods/GenesisCommunication/iPerlCommunicationParams.cs b/TBF/Rig/TestMethods/GenesisFullCommunication/GenesisCommunicationParams.cs similarity index 92% rename from TBF/Rig/TestMethods/GenesisCommunication/iPerlCommunicationParams.cs rename to TBF/Rig/TestMethods/GenesisFullCommunication/GenesisCommunicationParams.cs index e995c359a..5a96d4808 100644 --- a/TBF/Rig/TestMethods/GenesisCommunication/iPerlCommunicationParams.cs +++ b/TBF/Rig/TestMethods/GenesisFullCommunication/GenesisCommunicationParams.cs @@ -11,11 +11,11 @@ using TBF.Resources; using TBF.Rig.Generic; using TBF.Rig.TestMethods.iPerlCommunication; -namespace TBF.Rig.TestMethods.GenesisCommunication +namespace TBF.Rig.TestMethods.GenesisFullCommunication { - public class iPerlCommunicationParams : TestParamsBase, IParamsProvider, ITestParams + public class GenesisCommunicationParams : TestParamsBase, IParamsProvider, ITestParams { - public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(iPerlCommunicationParams) })[0]; + public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(GenesisCommunicationParams) })[0]; public override XmlSerializer GetSerializer() { return Serializer; } public string Activity @@ -157,7 +157,7 @@ namespace TBF.Rig.TestMethods.GenesisCommunication return false; } - void CopyContentTo(iPerlCommunicationParams prms) + void CopyContentTo(GenesisCommunicationParams prms) { prms.Activity = this.Activity; prms.SimultWithPrevious = this.SimultWithPrevious; @@ -166,7 +166,7 @@ namespace TBF.Rig.TestMethods.GenesisCommunication public IParamsProvider Clone() { - iPerlCommunicationParams pars = new iPerlCommunicationParams(); + GenesisCommunicationParams pars = new GenesisCommunicationParams(); CopyContentTo(pars); return pars; } @@ -176,7 +176,7 @@ namespace TBF.Rig.TestMethods.GenesisCommunication if (dbEntity == null) return; try { - iPerlCommunicationParams tmp = Serializer.Deserialize(new StringReader(dbEntity.Parameters)) as iPerlCommunicationParams; + GenesisCommunicationParams tmp = Serializer.Deserialize(new StringReader(dbEntity.Parameters)) as GenesisCommunicationParams; testParamsEntity = dbEntity; componentName = dbEntity.CmpntName; @@ -192,16 +192,16 @@ namespace TBF.Rig.TestMethods.GenesisCommunication /// /// Parameterless constructor initializes the parameters /// - public iPerlCommunicationParams() + public GenesisCommunicationParams() { } - public iPerlCommunicationParams(bool initialize) + public GenesisCommunicationParams(bool initialize) { if (initialize) InitializeAll(); } - public iPerlCommunicationParams(ComponentTest testParamsEntity, string componentName, Test test) + public GenesisCommunicationParams(ComponentTest testParamsEntity, string componentName, Test test) { this.testParamsEntity = testParamsEntity; this.componentName = componentName; diff --git a/TBF/Rig/TestMethods/GenesisCommunication/GenesisCommunicationSeq.cs b/TBF/Rig/TestMethods/GenesisFullCommunication/GenesisCommunicationSeq.cs similarity index 99% rename from TBF/Rig/TestMethods/GenesisCommunication/GenesisCommunicationSeq.cs rename to TBF/Rig/TestMethods/GenesisFullCommunication/GenesisCommunicationSeq.cs index 9f66b5df1..80ba66a18 100644 --- a/TBF/Rig/TestMethods/GenesisCommunication/GenesisCommunicationSeq.cs +++ b/TBF/Rig/TestMethods/GenesisFullCommunication/GenesisCommunicationSeq.cs @@ -15,9 +15,12 @@ using TBF.Rig.Generic; using TBF.Rig.Sequences; using TBF.Rig.TestMethods.iPerlCommunication; using TBF.UiBridge; +using TestMethod = TBF.Rig.TestMethods.GenesisFullCommunication.TestMethod; +using TestMethodCfg = TBF.Rig.TestMethods.GenesisFullCommunication.TestMethodCfg; + /// Point definition -namespace TBF.Rig.TestMethods.GenesisCommunication +namespace TBF.Rig.TestMethods.GenesisFullCommunication { public class GenesisCommunicationSeq : SequenceBase { @@ -32,9 +35,9 @@ namespace TBF.Rig.TestMethods.GenesisCommunication System.Windows.Forms.Form modelessDlg; /// - delegate void iPerlCommFormDlgt(GenesisCommunicationSeq myRef, iPerlCommunication.TestMethod method, Test test, iPerlCommunicationParams testParams); + delegate void iPerlCommFormDlgt(GenesisCommunicationSeq myRef, iPerlCommunication.TestMethod method, Test test, GenesisCommunicationParams testParams); /// - void OpenIPerlCommForm(GenesisCommunicationSeq myRef, iPerlCommunication.TestMethod method, Test test, iPerlCommunicationParams testParams) + void OpenIPerlCommForm(GenesisCommunicationSeq myRef, iPerlCommunication.TestMethod method, Test test, GenesisCommunicationParams testParams) { //TODO solve this wia SmartCommunicationForm diff --git a/TBF/Rig/TestMethods/GenesisCommunication/SequenceConditionOp.cs b/TBF/Rig/TestMethods/GenesisFullCommunication/SequenceConditionOp.cs similarity index 90% rename from TBF/Rig/TestMethods/GenesisCommunication/SequenceConditionOp.cs rename to TBF/Rig/TestMethods/GenesisFullCommunication/SequenceConditionOp.cs index 5cd872d8b..a962ee8d1 100644 --- a/TBF/Rig/TestMethods/GenesisCommunication/SequenceConditionOp.cs +++ b/TBF/Rig/TestMethods/GenesisFullCommunication/SequenceConditionOp.cs @@ -2,7 +2,9 @@ /// Copyright (c) 2022 Sensus Slovensko a.s. /// -namespace TBF.Rig.TestMethods.GenesisCommunication +using TBF.Rig.TestMethods.GenesisCommunication; + +namespace TBF.Rig.TestMethods.GenesisFullCommunication { public enum ConditionID { diff --git a/TBF/Rig/TestMethods/GenesisCommunication/TestMethod.cs b/TBF/Rig/TestMethods/GenesisFullCommunication/TestMethod.cs similarity index 97% rename from TBF/Rig/TestMethods/GenesisCommunication/TestMethod.cs rename to TBF/Rig/TestMethods/GenesisFullCommunication/TestMethod.cs index aad87d9c1..8c44bc3eb 100644 --- a/TBF/Rig/TestMethods/GenesisCommunication/TestMethod.cs +++ b/TBF/Rig/TestMethods/GenesisFullCommunication/TestMethod.cs @@ -9,12 +9,11 @@ using Config.Entities; using log4net; using TBF.Rig.GenericDevices; using TBF.Rig.Sequences; -using TBF.Rig.TestMethods.iPerlCommunication; using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication; using TBF.UiBridge; -using iPerlCommunicationSeq = TBF.Rig.TestMethods.iPerlCommunication.iPerlCommunicationSeq; +using TestMethodCfg = TBF.Rig.TestMethods.GenesisFullCommunication.TestMethodCfg; -namespace TBF.Rig.TestMethods.GenesisCommunication +namespace TBF.Rig.TestMethods.GenesisFullCommunication { public class TestMethod : SmartComponentBase, ISimultTestMethod, ISequenceCondition, ISessionDataMngmnt, ITestMethodSmart { diff --git a/TBF/Rig/TestMethods/GenesisCommunication/TestMethodCfg.cs b/TBF/Rig/TestMethods/GenesisFullCommunication/TestMethodCfg.cs similarity index 90% rename from TBF/Rig/TestMethods/GenesisCommunication/TestMethodCfg.cs rename to TBF/Rig/TestMethods/GenesisFullCommunication/TestMethodCfg.cs index 047baf675..fbcd1f183 100644 --- a/TBF/Rig/TestMethods/GenesisCommunication/TestMethodCfg.cs +++ b/TBF/Rig/TestMethods/GenesisFullCommunication/TestMethodCfg.cs @@ -8,14 +8,13 @@ using System.Xml.Serialization; using Common; using Config.Entities; using TBF.Rig.Generic; -using TBF.Rig.RegisterReaders.CommonRR.IPerl; -using TBF.Rig.TestMethods.iPerlCommunication; -namespace TBF.Rig.TestMethods.GenesisCommunication + +namespace TBF.Rig.TestMethods.GenesisFullCommunication { [XmlRoot("TestMethodCfg")] // Add this attribute to match the XML root - public class TestMethodCfg : ComponentCfgBase, IiPerlTestMethodCfg + public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg { public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0]; public override XmlSerializer GetSerializer() { return Serializer; } @@ -24,7 +23,7 @@ namespace TBF.Rig.TestMethods.GenesisCommunication // public override IParamsProvider GetRuntimeTestParamsProvider() { return TestParams; } - public override IParamsProvider CreateTestParamsProvider() { return new iPerlCommunicationParams(true); } + public override IParamsProvider CreateTestParamsProvider() { return new GenesisCommunicationParams(true); } public override IParamsProvider GetUITestParamsProvider(Test test) { return (test.Method == Name) ? base.GetUITestParamsProvider(test) : null; @@ -47,7 +46,7 @@ namespace TBF.Rig.TestMethods.GenesisCommunication ParityBit = Parity.None; // NFC Interface StopBits = StopBits.Two; // NFC Interface - TestParams = CreateTestParamsProvider() as iPerlCommunicationParams; + TestParams = CreateTestParamsProvider() as GenesisCommunicationParams; } public TestMethodCfg(IComponentFactory factory) diff --git a/TBF/Rig/TestMethods/GenesisCommunication/TestMethodCfgCtrl.cs b/TBF/Rig/TestMethods/GenesisFullCommunication/TestMethodCfgCtrl.cs similarity index 99% rename from TBF/Rig/TestMethods/GenesisCommunication/TestMethodCfgCtrl.cs rename to TBF/Rig/TestMethods/GenesisFullCommunication/TestMethodCfgCtrl.cs index a3ca06902..a56b6c024 100644 --- a/TBF/Rig/TestMethods/GenesisCommunication/TestMethodCfgCtrl.cs +++ b/TBF/Rig/TestMethods/GenesisFullCommunication/TestMethodCfgCtrl.cs @@ -8,7 +8,7 @@ using Common; using TBF.Resources; using TBF.Rig.Generic; -namespace TBF.Rig.TestMethods.GenesisCommunication +namespace TBF.Rig.TestMethods.GenesisFullCommunication { public partial class TestMethodCfgCtrl : Configs.ConfigCtrlUtils, IComponentCfgCtrl { diff --git a/TBF/Rig/TestMethods/GenesisCommunication/TestMethodCfgCtrl.designer.cs b/TBF/Rig/TestMethods/GenesisFullCommunication/TestMethodCfgCtrl.designer.cs similarity index 99% rename from TBF/Rig/TestMethods/GenesisCommunication/TestMethodCfgCtrl.designer.cs rename to TBF/Rig/TestMethods/GenesisFullCommunication/TestMethodCfgCtrl.designer.cs index 593e92fe7..bd03a4f9a 100644 --- a/TBF/Rig/TestMethods/GenesisCommunication/TestMethodCfgCtrl.designer.cs +++ b/TBF/Rig/TestMethods/GenesisFullCommunication/TestMethodCfgCtrl.designer.cs @@ -2,7 +2,7 @@ /// Copyright (c) 2015 Sensus Metering Systems /// Author: Milan Hanajík /// -namespace TBF.Rig.TestMethods.GenesisCommunication +namespace TBF.Rig.TestMethods.GenesisFullCommunication { partial class TestMethodCfgCtrl { diff --git a/TBF/Rig/TestMethods/GenesisCommunication/TestMethodCfgCtrl.resx b/TBF/Rig/TestMethods/GenesisFullCommunication/TestMethodCfgCtrl.resx similarity index 100% rename from TBF/Rig/TestMethods/GenesisCommunication/TestMethodCfgCtrl.resx rename to TBF/Rig/TestMethods/GenesisFullCommunication/TestMethodCfgCtrl.resx diff --git a/TBF/TBF.csproj b/TBF/TBF.csproj index 26d18e16d..4eb0ad26c 100644 --- a/TBF/TBF.csproj +++ b/TBF/TBF.csproj @@ -1735,16 +1735,16 @@ - - - - - - - + + + + + + + UserControl - + TestMethodCfgCtrl.cs @@ -3675,7 +3675,7 @@ TestMethodCfgCtrl.cs - + TestMethodCfgCtrl.cs