ReSharper: -FwUpdate*

This commit is contained in:
Thomas Wiedebusch
2022-09-12 09:32:50 +02:00
parent 621537cd93
commit 0e3123186b
9 changed files with 42 additions and 35 deletions
+1
View File
@@ -1,6 +1,7 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> <wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/UserDictionary/Words/=accu/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/UserDictionary/Words/=accu/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Applic/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/UserDictionary/Words/=Applic/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Approver/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=binfile/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/UserDictionary/Words/=binfile/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=BUGFIX/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/UserDictionary/Words/=BUGFIX/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Calib/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/UserDictionary/Words/=Calib/@EntryIndexedValue">True</s:Boolean>
@@ -1,5 +1,4 @@
using System; using System;
using System.Collections.Generic;
namespace Xylem.Common.Hardware.WaterMeter.WaterMeterRegisters namespace Xylem.Common.Hardware.WaterMeter.WaterMeterRegisters
{ {
@@ -8,10 +7,6 @@ namespace Xylem.Common.Hardware.WaterMeter.WaterMeterRegisters
/// </summary> /// </summary>
public class MeterTypeRegisters public class MeterTypeRegisters
{ {
/// <summary>
/// registers list for this meter
/// </summary>
//public readonly List<IRegister> Registers;
/// <summary> /// <summary>
/// meter type /// meter type
/// </summary> /// </summary>
@@ -726,8 +726,8 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
public async Task<HttpResponseMessage> GetRecoveryFile(int PcbID, int? RadioFrq, string Region, string FlexnetVersion) public async Task<HttpResponseMessage> GetRecoveryFile(int PcbID, int? RadioFrq, string Region, string FlexnetVersion)
{ {
var file = new RecoverySettings() { PcbID = PcbID, RadioFrequencyMhz = RadioFrq, Region = Region, Release = FlexnetVersion }; var file = new RecoverySettings() { PcbId = PcbID, RadioFrequencyMhz = RadioFrq, Region = Region, Release = FlexnetVersion };
file.RecoveryRegisters = new List<ServiceFwUpdate.Common.FwUpdateSafe.RecoveryRegisterItem>(); file.RecoveryRegisters = new List<RecoveryRegisterItem>();
file.RecoveryRegisters.Add(new RecoveryRegisterItem() { RegisterIdent = "GENESISFLOW_SealDisplay", WriteValue = new byte[] { 0x00, 0x00, 0x00, 0x00 }, IsCiritcal = true, ReadbackValue = new byte[] { 0x00, 0x00, 0x00, 0x00 } }); file.RecoveryRegisters.Add(new RecoveryRegisterItem() { RegisterIdent = "GENESISFLOW_SealDisplay", WriteValue = new byte[] { 0x00, 0x00, 0x00, 0x00 }, IsCiritcal = true, ReadbackValue = new byte[] { 0x00, 0x00, 0x00, 0x00 } });
@@ -182,7 +182,8 @@ namespace Xylem.ServiceFwUpdate.Common.FwUpdateDb
$"&Build={swLicense.Build}&ValidTo={swLicense.ValidTo:yyyy-MM-ddTHH:mm:ss}" + $"&Build={swLicense.Build}&ValidTo={swLicense.ValidTo:yyyy-MM-ddTHH:mm:ss}" +
$"&Description={swLicense.Description ?? "null"}&ProgramNameIsUnique={swLicense.ProgramNameIsUnique}"; $"&Description={swLicense.Description ?? "null"}&ProgramNameIsUnique={swLicense.ProgramNameIsUnique}";
var requestResponse = LocalWebRequest.PostRequestAsyncAndGetContent(url, 1200); var requestResponse = LocalWebRequest.PostRequestAsyncAndGetContent(url, 1200);
if (string.IsNullOrEmpty(requestResponse) && !JsonConvert.DeserializeObject<Boolean>(requestResponse)) if (requestResponse != null && string.IsNullOrEmpty(requestResponse) &&
!JsonConvert.DeserializeObject<Boolean>(requestResponse))
{ {
DbIsConnected = false; DbIsConnected = false;
return false; return false;
@@ -1,6 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Text;
namespace Xylem.ServiceFwUpdate.Common.FwUpdateSafe namespace Xylem.ServiceFwUpdate.Common.FwUpdateSafe
{ {
@@ -1,36 +1,34 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xylem.ServiceFwUpdate.Common.FwUpdateSafe.MeterRecovery;
namespace Xylem.ServiceFwUpdate.Common.FwUpdateSafe namespace Xylem.ServiceFwUpdate.Common.FwUpdateSafe.MeterRecovery
{ {
/// <summary>
/// Recovery of registers in the field
/// </summary>
public class RecoveryRegisterItem public class RecoveryRegisterItem
{ {
/// <summary> /// <summary>
/// Registername, use the latest configuration.json to make sure that the adress will be correct /// Register name, use the latest configuration.json to make sure that the adress will be correct
/// </summary> /// </summary>
public string RegisterIdent { get; set; } public String RegisterIdent { get; set; }
/// <summary> /// <summary>
/// Content to write /// Content to write
/// </summary> /// </summary>
public byte[] WriteValue { get; set; } public Byte[] WriteValue { get; set; }
/// <summary> /// <summary>
/// check if the wirtten value is sett like this /// check if the wirtten value is sett like this
/// Null or not set if a read back is not needed /// Null or not set if a read back is not needed
/// </summary> /// </summary>
public byte[] ReadbackValue { get; set; } public Byte[] ReadbackValue { get; set; }
/// <summary> /// <summary>
/// Mark Update as failed if write was not successful /// Mark Update as failed if write was not successful
/// </summary> /// </summary>
public bool IsCiritcal { get; set; } public Boolean IsCiritcal { get; set; }
/// <summary> /// <summary>
@@ -1,35 +1,35 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Xylem.ServiceFwUpdate.Common.FwUpdateSafe.MeterRecovery namespace Xylem.ServiceFwUpdate.Common.FwUpdateSafe.MeterRecovery
{ {
/// <summary>
///
/// </summary>
public class RecoverySettings public class RecoverySettings
{ {
/// <summary> /// <summary>
/// Null if check in not necessary if is an number check it agianst the pcbid from meter /// Null if check in not necessary if is an number check it agianst the pcbid from meter
/// </summary> /// </summary>
public int? PcbID { get; set; } public Int32? PcbId { get; set; }
/// <summary> /// <summary>
/// Null if check in not necessary if is an number check it agianst the radio FRQ /// Null if check in not necessary if is an number check it agianst the radio FRQ
/// </summary> /// </summary>
public int? RadioFrequencyMhz { get; set; } public Int32? RadioFrequencyMhz { get; set; }
/// <summary> /// <summary>
/// Null till meter handels regions /// Null till meter handles regions
/// </summary> /// </summary>
public string Region { get; set; } = null; public String Region { get; set; } = null;
/// <summary> /// <summary>
/// Null till meter handels regions /// Null till meter handles regions
/// </summary> /// </summary>
public string Release { get; set; } public String Release { get; set; }
/// <summary> /// <summary>
/// User name /// User name
/// </summary> /// </summary>
public string ApproverName { get; set; } public String ApproverName { get; set; }
/// <summary> /// <summary>
@@ -42,9 +42,13 @@ namespace Xylem.ServiceFwUpdate.Common.FwUpdateSafe.MeterRecovery
/// </summary> /// </summary>
public List<RecoveryRegisterItem> RecoveryRegisters { get; set; } public List<RecoveryRegisterItem> RecoveryRegisters { get; set; }
public string GenerateFileName() /// <summary>
/// File name for this recovery register set
/// </summary>
/// <returns></returns>
public String GenerateFileName()
{ {
return $"{PcbID}_{RadioFrequencyMhz}_{Region}_{Release}.config"; return $"{PcbId}_{RadioFrequencyMhz}_{Region}_{Release}.config";
} }
} }
@@ -1,9 +1,21 @@
namespace Xylem.ServiceFwUpdate.Common.FwUpdateSafe.MeterRecovery namespace Xylem.ServiceFwUpdate.Common.FwUpdateSafe.MeterRecovery
{ {
/// <summary>
/// Recovery rules
/// </summary>
public enum RegisterRecoveryAccess public enum RegisterRecoveryAccess
{ {
/// <summary>
/// Set this register always
/// </summary>
SetAlways, SetAlways,
/// <summary>
/// Set register if it has the default value
/// </summary>
SetIfDefault, SetIfDefault,
/// <summary>
/// Set the register if it is zero
/// </summary>
SetIfZero SetIfZero
} }
@@ -1,6 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Text;
namespace Xylem.ServiceFwUpdate.Common.FwUpdateSafe namespace Xylem.ServiceFwUpdate.Common.FwUpdateSafe
{ {