laatzen/Common/CommonMessurementUnits/Flow.cs
2023-09-14 13:04:12 +02:00

29 lines
748 B
C#

using System;
using Newtonsoft.Json;
using Xylem.Common.CommonCore.CommonMeasurementUnits.JsonConverters;
namespace Xylem.Common.CommonCore.CommonMeasurementUnits
{
[JsonConverter(typeof(FlowConverter))]
public class Flow : Unit
{
public Double CubicMeterInHour
{
get => value;
set => this.value = value;
}
public Double LiterInMinute
{
get => CubicMeterInHour / MinInH * LInm3;
set => 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 };
}
}