Refactor GenesisCommunication to GenesisFullCommunication, including namespace updates, class renaming, file relocations, and csproj adjustments.

This commit is contained in:
Michal Buzik 2026-04-23 09:53:13 +02:00
parent 7170da4a70
commit 9339683a0e
11 changed files with 41 additions and 36 deletions

View File

@ -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(),

View File

@ -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
{

View File

@ -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
/// <summary>
/// Parameterless constructor initializes the parameters
/// </summary>
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;

View File

@ -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

View File

@ -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
{

View File

@ -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
{

View File

@ -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)

View File

@ -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
{

View File

@ -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
{

View File

@ -1735,16 +1735,16 @@
<Compile Include="Rig\TestMethods\GenesisCommunication\GenesisHead\OptoTelegramRaw.cs" />
<Compile Include="Rig\TestMethods\GenesisCommunication\GenesisHead\ProcParams.cs" />
<Compile Include="Rig\TestMethods\GenesisCommunication\GenesisHead\StatusStruct.cs" />
<Compile Include="Rig\TestMethods\GenesisCommunication\Factory.cs" />
<Compile Include="Rig\TestMethods\GenesisCommunication\GenesisCommunicationSeq.cs" />
<Compile Include="Rig\TestMethods\GenesisCommunication\iPerlCommunicationParams.cs" />
<Compile Include="Rig\TestMethods\GenesisCommunication\SequenceConditionOp.cs" />
<Compile Include="Rig\TestMethods\GenesisCommunication\TestMethod.cs" />
<Compile Include="Rig\TestMethods\GenesisCommunication\TestMethodCfg.cs" />
<Compile Include="Rig\TestMethods\GenesisCommunication\TestMethodCfgCtrl.cs">
<Compile Include="Rig\TestMethods\GenesisFullCommunication\Factory.cs" />
<Compile Include="Rig\TestMethods\GenesisFullCommunication\GenesisCommunicationSeq.cs" />
<Compile Include="Rig\TestMethods\GenesisFullCommunication\GenesisCommunicationParams.cs" />
<Compile Include="Rig\TestMethods\GenesisFullCommunication\SequenceConditionOp.cs" />
<Compile Include="Rig\TestMethods\GenesisFullCommunication\TestMethod.cs" />
<Compile Include="Rig\TestMethods\GenesisFullCommunication\TestMethodCfg.cs" />
<Compile Include="Rig\TestMethods\GenesisFullCommunication\TestMethodCfgCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Rig\TestMethods\GenesisCommunication\TestMethodCfgCtrl.designer.cs">
<Compile Include="Rig\TestMethods\GenesisFullCommunication\TestMethodCfgCtrl.designer.cs">
<DependentUpon>TestMethodCfgCtrl.cs</DependentUpon>
</Compile>
<Compile Include="Rig\TestMethods\iPerlCommunication\AllCompletedEventArgs.cs" />
@ -3675,7 +3675,7 @@
<DependentUpon>TestMethodCfgCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Rig\TestMethods\GenesisCommunication\GenesisHead\GenesisHeadCfgCtrl.resx" />
<EmbeddedResource Include="Rig\TestMethods\GenesisCommunication\TestMethodCfgCtrl.resx">
<EmbeddedResource Include="Rig\TestMethods\GenesisFullCommunication\TestMethodCfgCtrl.resx">
<DependentUpon>TestMethodCfgCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Rig\TestMethods\GrabImage\GrabImageCfgCtrl.resx">