Add base classes

This commit is contained in:
Roland Drabesch
2022-04-29 09:12:50 +02:00
parent df68bf87d7
commit 62903f39ec
3 changed files with 79 additions and 0 deletions
@@ -75,6 +75,8 @@
<Compile Include="CordonelSettings.cs" />
<Compile Include="FwUpdateCrypt.cs" />
<Compile Include="FwUpdateSafe.cs" />
<Compile Include="MeterRecovery\RecoverySettings.cs" />
<Compile Include="MeterRecovery\RecoveryRegisterItem.cs" />
<Compile Include="PasswordContainer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ReportTemplate.cs" />
@@ -95,5 +97,6 @@
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Xylem.ServiceFwUpdate.Common.FwUpdateSafe
{
public class RecoveryRegisterItem
{
/// <summary>
/// Registername, use the latest configuration.json to make sure that the adress will be correct
/// </summary>
public string RegisterIdent { get; set; }
/// <summary>
/// Content to write
/// </summary>
public byte[] WriteValue { get; set; }
/// <summary>
/// check if the wirtten value is sett like this
/// Null or not set if a read back is not needed
/// </summary>
public byte[] ReadbackValue { get; set; }
/// <summary>
/// Mark Update as failed if write was not successful
/// </summary>
public bool IsCiritcal { get; set; }
}
}
@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Xylem.ServiceFwUpdate.Common.FwUpdateSafe.MeterRecovery
{
public class RecoverySettings
{
/// <summary>
/// Null if check in not necessary if is an number check it agianst the pcbid from meter
/// </summary>
public int? PrecondidtionCheckPcbID { get; set; }
/// <summary>
/// Null if check in not necessary if is an number check it agianst the radio FRQ
/// </summary>
public int? PrecondidtionCheckRadioFrq { get; set; }
/// <summary>
/// Null till meter handels regions
/// </summary>
public string PrecondidtionCheckRegion { get; set; } = null;
/// <summary>
/// Null till meter handels regions
/// </summary>
public string PrecondidtionCheckFlexnetVersion { get; set; };
/// <summary>
/// List of registers to recover
/// </summary>
public List<RecoveryRegisterItem> RecoveryRegisters { get; set; }
public string GenerateFileName()
{
return $"{PrecondidtionCheckPcbID}_{PrecondidtionCheckRadioFrq}_{PrecondidtionCheckRegion}_{PrecondidtionCheckFlexnetVersion}.config";
}
}
}