29 lines
736 B
C#
29 lines
736 B
C#
using System;
|
|
using Newtonsoft.Json;
|
|
using Xylem.Common.CommonCore.CommonMeasurementUnits.JsonConverters;
|
|
|
|
namespace Xylem.Common.CommonCore.CommonMeasurementUnits
|
|
{
|
|
[JsonConverter(typeof(CurrentConverter))]
|
|
public class Current : Unit
|
|
{
|
|
public Double MilliampereHours
|
|
{
|
|
get => AmpereHours * MAInH;
|
|
set => AmpereHours = value / MAInH;
|
|
}
|
|
|
|
public Double AmpereHours
|
|
{
|
|
get => value;
|
|
set => this.value = value;
|
|
}
|
|
|
|
public static implicit operator Current(Double x)
|
|
=> new Current { value = x };
|
|
|
|
public static implicit operator Current(Double? x)
|
|
=> new Current { value = x ?? 0 };
|
|
}
|
|
}
|