29 lines
710 B
C#
29 lines
710 B
C#
namespace CommonMessurementUnits
|
|
{
|
|
using CommonMessurementUnits.JsonConverters;
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
[JsonConverter(typeof(FlowConverter))]
|
|
public class Flow : Base
|
|
{
|
|
public double CubicMeterInHour
|
|
{
|
|
get => this.value;
|
|
set => this.value = value;
|
|
}
|
|
|
|
public double LiterInMinute
|
|
{
|
|
get => this.CubicMeterInHour / MinInH * LInm3;
|
|
set => this.CubicMeterInHour = value * MinInH / LInm3;
|
|
}
|
|
|
|
public static implicit operator Flow(double x)
|
|
=> new Flow { value = x };
|
|
|
|
public static implicit operator Flow(double? x)
|
|
=> new Flow { value = x ?? 0 };
|
|
}
|
|
}
|