245 lines
6.9 KiB
C#
245 lines
6.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Xylem.Common.CommonCore.Consts;
|
|
using Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol;
|
|
using Xylem.Common.Hardware.WaterMeter.Genesis.Applications;
|
|
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisConfig;
|
|
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore.Consts;
|
|
using Xylem.Common.Hardware.WaterMeter.Genesis.Registers;
|
|
using Xylem.Common.Hardware.WaterMeter.WaterMeterCore;
|
|
|
|
namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
|
{
|
|
/// <summary>
|
|
/// Interface of special GenesisMeter derived from IMeter
|
|
/// </summary>
|
|
public interface IGenesisMeter : IMeter
|
|
{
|
|
#region properties
|
|
/// <summary>
|
|
/// Represent <see cref="Register.Configexchange.PcbSerialNumber" />
|
|
/// proposed for login
|
|
/// </summary>
|
|
String PcbId
|
|
{
|
|
get;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Transmit protocol access for underlie objects to change response timeout
|
|
/// </summary>
|
|
ITransmitProtocol TransmitProtocol{ get; }
|
|
|
|
/// <summary>
|
|
/// List of all present meter applications installed in meter
|
|
/// </summary>
|
|
List<MeterApplications> MeterAppListVersion
|
|
{
|
|
get;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Successfully logged on to meter
|
|
/// </summary>
|
|
Boolean IsLoggedOn
|
|
{
|
|
get;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Core revision of boot code.
|
|
/// </summary>
|
|
Int32? CoreRevision
|
|
{
|
|
get;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Core revision of boot code as string.
|
|
/// </summary>
|
|
String StrCoreRevision
|
|
{
|
|
get;
|
|
}
|
|
|
|
/// <summary>
|
|
/// This is the FLEXNETVERSION version which describes the entire packet.
|
|
/// </summary>
|
|
String FwVersion
|
|
{
|
|
get;
|
|
}
|
|
|
|
/// <summary>
|
|
/// This is the FLEXNETVERSION version which describes the entire packet.
|
|
/// </summary>
|
|
UInt32? InstalledFwVersion
|
|
{
|
|
get;
|
|
}
|
|
|
|
/// <summary>
|
|
/// This is the Metrology Lookup Table CRC.
|
|
/// </summary>
|
|
String LutCrc
|
|
{
|
|
get;
|
|
}
|
|
|
|
/// <summary>
|
|
/// This is the meter size.
|
|
/// </summary>
|
|
String MeterSize
|
|
{
|
|
get;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Length of the meter.
|
|
/// </summary>
|
|
String MeterLength { get; set; }
|
|
|
|
/// <summary>
|
|
/// Pressure sensor assembled to meter.
|
|
/// </summary>
|
|
Boolean PressureSensorAssembled
|
|
{
|
|
get;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Region (EMEA, NA or China).
|
|
/// </summary>
|
|
String Region
|
|
{
|
|
get;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Radio frequency in MHz (433 or 868 or null).
|
|
/// </summary>
|
|
Int32? RadioFrequencyMhz
|
|
{
|
|
get;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Metrology upgrade permission.
|
|
/// </summary>
|
|
Byte MetrologyUpgradePermission
|
|
{
|
|
set; get;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Order number under which this meter has to be produced
|
|
/// </summary>
|
|
Int32 OrderNumber
|
|
{
|
|
set; get;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Radio address
|
|
/// </summary>
|
|
Int64 RadioAddress
|
|
{
|
|
set; get;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Process configuration
|
|
/// </summary>
|
|
ProcessConfig Configuration
|
|
{
|
|
get;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Customer serial number for informal issues
|
|
/// </summary>
|
|
String CustomerSerialNumber
|
|
{
|
|
get; set;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region methods
|
|
|
|
/// <summary>
|
|
/// Check region and size.
|
|
/// After reading the version, all valid registers are going to be selected.
|
|
/// </summary>
|
|
void CheckRegionSizeLutCrc();
|
|
|
|
/// <summary>
|
|
/// Reset the empty pipe alarm
|
|
/// </summary>
|
|
void ResetAlarm(Alarm clear);
|
|
|
|
/// <summary>
|
|
/// Upload app list to database
|
|
/// </summary>
|
|
/// <param name="progressName"></param>
|
|
/// <param name="version"></param>
|
|
/// <returns></returns>
|
|
StatusReturn PushProgress(String progressName, String version);
|
|
|
|
/// <summary>
|
|
/// Clear password to force new password reading
|
|
/// </summary>
|
|
void ClearPassword();
|
|
|
|
/// <summary>
|
|
/// Executes all StoreConfiguration and StoreCalibration for each application.
|
|
/// </summary>
|
|
/// <returns>true if all configurations are stored</returns>
|
|
Boolean StoreAllConfigurations();
|
|
|
|
/// <summary>
|
|
/// Login with identical password as last time to avoid get password from database
|
|
/// </summary>
|
|
Boolean ReLogin();
|
|
|
|
/// <summary>
|
|
/// Returns meter registers
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
MeterRegisters GetConfigRegistersDefinitions();
|
|
|
|
/// <summary>
|
|
/// Common routine for reboot being able to override this routine which will be called in
|
|
/// MeteResetPsu to simulate a reboot.
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
StatusReturn RebootGenesis();
|
|
|
|
/// <summary>
|
|
/// Write Register, optional: wait for result and validate,
|
|
/// write register will ALWAYS log the data DON'T use for password write
|
|
/// </summary>
|
|
/// <typeparam name="T">Data type of Register</typeparam>
|
|
/// <param name="regName">Register name</param>
|
|
/// <param name="value">Value to save as byte array in raw format</param>
|
|
/// <param name="waitForResult">wait until result is ready</param>
|
|
/// <param name="checkRegister">check the content of the register by read back</param>
|
|
/// <param name="skipRetryErrorCode">skip retries on this error code return</param>
|
|
/// <returns>true on successful operation</returns>
|
|
Boolean WriteRegister<T>(String regName, T value, Boolean waitForResult = true,
|
|
Boolean checkRegister = false, UInt16 skipRetryErrorCode = CommunicationConfig.SkipRetryErrorCode);
|
|
|
|
/// <summary>
|
|
/// Read Register and return byte array
|
|
/// </summary>
|
|
/// <param name="regName">Register name</param>
|
|
/// <param name="expectedLength">expected length for response</param>
|
|
/// <param name="skipRetryErrorCode">skip retries on this error code return</param>
|
|
/// <returns>value as byte array in raw format or null</returns>
|
|
Byte[] ReadRegister(String regName, Int32? expectedLength = null,
|
|
UInt16 skipRetryErrorCode = CommunicationConfig.SkipRetryErrorCode);
|
|
|
|
#endregion
|
|
}
|
|
}
|