29 lines
748 B
C#
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 };
|
|
}
|
|
}
|