using DTS.Common.Enums.DASFactory;
using DTS.Common.Interface.DASFactory.Diagnostics;
using DTS.DASLib.Command.TDAS;
namespace DTS.DASLib.Service
{
///
/// Each time .Diagnose is called these values
/// are populated. Each IDASCommunication will have one of these objects. It
/// provides information about input voltage to the base unit, like power input,
/// presence of a battery and battery output voltage.
///
public class BaseInputValues : IBaseInputValues
{
///
/// The current input voltage to the base.
///
public double InputMilliVolts { get; set; }
//18740 DataPRO system settings Power setting values for TDAS rack do not change actual power values on device
// added Min/Max valid and tied Valid bool to those values
public virtual bool InputMilliVoltsValid => InputMilliVolts > 1000D * MinimumValidInputVoltage && InputMilliVolts < 1000D * MaximumValidInputVoltage;
///
/// The current input voltage to the base.
///
public double InputVoltage { get; set; }
///
/// The minimum valid input voltage to the base.
///
public double MinimumValidInputVoltage { get; set; } = 6D;
///
/// The maximum valid input voltage to the base.
///
public double MaximumValidInputVoltage { get; set; } = 16D;
public virtual bool BatteryMilliVoltsValid => BatteryMilliVolts > 1000D * MinimumValidBatteryVoltage && BatteryMilliVolts < 1000D * MaximumValidBatteryVoltage;
///
/// The current battery voltage.
///
public double BatteryMilliVolts { get; set; }
///
/// The current battery voltage.
///
public double BatteryVoltage { get; set; }
///
/// battery state of charge - null if not queried
/// can be 0 if not available
/// this is a percentage
///
public double? BatterySoC { get; set; } = null;
///
/// The minimum valid battery voltage to the base.
///
public double MinimumValidBatteryVoltage { get; set; } = 6D;
///
/// The maximum valid battery voltage to the base.
///
public double MaximumValidBatteryVoltage { get; set; } = 16D;
///
/// TRUE if the battery is currently charging.
///
public bool BatteryIsCharging { get; set; }
///
/// Temperature sensed by logic in the hardware, in degrees Celsius.
///
public double TemperatureC { get; set; }
///
/// returns status
///
public virtual string BatteryVoltageStatus { get; set; }
///
/// returns status
///
public virtual string InputVoltageStatus { get; set; }
///
/// returns status
///
public virtual string StatusDisplayBattery { get; set; }
///
/// returns status
///
public virtual string StatusDisplayInput { get; set; }
///
/// returns color
///
public virtual DFConstantsAndEnums.VoltageStatusColor BatteryVoltageStatusColor { get; set; }
///
/// returns color
///
public virtual DFConstantsAndEnums.VoltageStatusColor InputVoltageStatusColor { get; set; }
public double ChargeCapacity { get; set; } = double.NaN;
public bool ChargeCapacityValid => !double.IsNaN(ChargeCapacity) && ChargeCapacity > 0 && ChargeCapacity < 100;
}
}