ReSharper on DataPackages

This commit is contained in:
Thomas Wiedebusch
2022-08-24 12:22:39 +02:00
parent 04fb67f861
commit 0f24aac129
5 changed files with 72 additions and 24 deletions
@@ -1,6 +1,5 @@
using System; using System;
using System.Text; using System.Text;
using Xylem.Common.CommonCore.Consts;
using Xylem.Common.Metrology.Measurements; using Xylem.Common.Metrology.Measurements;
namespace Xylem.Common.Hardware.WaterMeter.Genesis.DataPackages.MeasurementRecords namespace Xylem.Common.Hardware.WaterMeter.Genesis.DataPackages.MeasurementRecords
@@ -31,12 +30,12 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.DataPackages.MeasurementRecor
/// <summary> /// <summary>
/// total time of flight in cordonel units /// total time of flight in cordonel units
/// </summary> /// </summary>
public Int32 RAWTotalTimeOfFlight; public Int32 RawTotalTimeOfFlight;
/// <summary> /// <summary>
/// delta time of flight in cordonel units /// delta time of flight in cordonel units
/// </summary> /// </summary>
public Int32 RAWDeltaTimeOfFlight; public Int32 RawDeltaTimeOfFlight;
/// <summary> /// <summary>
/// volume scale (default: 1024) means /// volume scale (default: 1024) means
@@ -1,21 +1,49 @@
using System; using System;
using System.Collections.Generic;
using System.Text;
namespace Xylem.Common.Hardware.WaterMeter.Genesis.DataPackages namespace Xylem.Common.Hardware.WaterMeter.Genesis.DataPackages
{ {
//obs
/// <summary>
/// All parameters needed for radio setup
/// </summary>
public class RadioConfigurationParams public class RadioConfigurationParams
{ {
public string PcbId; /// <summary>
/// Pcb identification
/// </summary>
public String PcbId;
/// <summary>
/// Serial number
/// </summary>
public UInt32 SerialNumber; public UInt32 SerialNumber;
/// <summary>
/// Radio address
/// </summary>
public UInt32 RadioAddress; public UInt32 RadioAddress;
/// <summary>
/// Power level
/// </summary>
public UInt32 PowerLevel; public UInt32 PowerLevel;
/// <summary>
/// Power level option
/// </summary>
public UInt32 PowerLevelOption; public UInt32 PowerLevelOption;
/// <summary>
/// New code for impedance
/// </summary>
public UInt32 ImpedanceCodeNew; public UInt32 ImpedanceCodeNew;
/// <summary>
/// Impedance code option
/// </summary>
public UInt32 ImpedanceCodeOption; public UInt32 ImpedanceCodeOption;
/// <summary>
/// Encryption key
/// </summary>
public Byte[] EncryptionKey; public Byte[] EncryptionKey;
public short? FrqOffset { get; set; } /// <summary>
/// Frequency offset
/// </summary>
public Int16? FrqOffset { get; set; }
} }
} }
@@ -1,17 +1,29 @@
using System; using System;
using System.Collections.Generic;
using System.Text;
namespace Xylem.Common.Hardware.WaterMeter.Genesis.DataPackages namespace Xylem.Common.Hardware.WaterMeter.Genesis.DataPackages
{ {
/// <summary>
///
/// </summary>
public class RegisterToDb public class RegisterToDb
{ {
public RegisterToDb(byte[] adresse, byte[] value) /// <summary>
/// Register address and value to DB
/// </summary>
/// <param name="adresse"></param>
/// <param name="value"></param>
public RegisterToDb(Byte[] adresse, Byte[] value)
{ {
Adresse = adresse; Adresse = adresse;
Value = value; Value = value;
} }
public byte[] Adresse; /// <summary>
public byte[] Value; /// Address
/// </summary>
public Byte[] Adresse;
/// <summary>
/// Value
/// </summary>
public Byte[] Value;
} }
} }
@@ -1,18 +1,27 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Xylem.Common.Hardware.WaterMeter.Genesis.DataPackages namespace Xylem.Common.Hardware.WaterMeter.Genesis.DataPackages
{ {
/// <summary>
/// Temperature Time Of Flight calculation
/// </summary>
public struct TempTofCalc public struct TempTofCalc
{ {
private DateTime refDate; private DateTime _refDate;
private double refTemp; private Double _refTemp;
private double tof; private Double _tof;
public DateTime RefDate { get => refDate; set => refDate = value; } /// <summary>
public double RefTemp { get => refTemp; set => refTemp = value; } /// Reference data
public double Tof { get => tof; set => tof = value; } /// </summary>
public DateTime RefDate { get => _refDate; set => _refDate = value; }
/// <summary>
/// Reference temperature
/// </summary>
public Double RefTemp { get => _refTemp; set => _refTemp = value; }
/// <summary>
/// Time Of Flight
/// </summary>
public Double Tof { get => _tof; set => _tof = value; }
} }
} }
@@ -371,9 +371,9 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.StreamingProtocol
dataProtHRec.RAWTotalTimeOfFlight = dataProtHRec.RawTotalTimeOfFlight =
int.Parse(field[(Int32)ProtHsubString.Ttof], NumberStyles.AllowHexSpecifier); int.Parse(field[(Int32)ProtHsubString.Ttof], NumberStyles.AllowHexSpecifier);
dataProtHRec.RAWDeltaTimeOfFlight = int.Parse(field[(Int32)ProtHsubString.Dtof], NumberStyles.AllowHexSpecifier); dataProtHRec.RawDeltaTimeOfFlight = int.Parse(field[(Int32)ProtHsubString.Dtof], NumberStyles.AllowHexSpecifier);
//Delta raw volume between two samples //Delta raw volume between two samples
dataProtHRec.DeltaVolumeRaw = uint.Parse(field[(Int32)ProtHsubString.RawDVolume], dataProtHRec.DeltaVolumeRaw = uint.Parse(field[(Int32)ProtHsubString.RawDVolume],