Skip to content

Commit cfec58b

Browse files
author
rdelhommer
committed
add micro liters per minute
1 parent 3f5daf4 commit cfec58b

File tree

6 files changed

+46
-0
lines changed

6 files changed

+46
-0
lines changed

UnitsNet.Tests/CustomCode/FlowTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,7 @@ public class FlowTests : FlowTestsBase
3434
protected override double UsGallonsPerMinuteInOneCubicMeterPerSecond => 15850.323141489;
3535

3636
protected override double LitersPerMinuteInOneCubicMeterPerSecond => 60000.00000;
37+
38+
protected override double MicroLitersPerMinuteInOneCubicMeterPerSecond => 60000000000.00000;
3739
}
3840
}

UnitsNet.Tests/GeneratedCode/FlowTestsBase.g.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public abstract partial class FlowTestsBase
4040
protected abstract double CubicMetersPerHourInOneCubicMeterPerSecond { get; }
4141
protected abstract double CubicMetersPerSecondInOneCubicMeterPerSecond { get; }
4242
protected abstract double LitersPerMinuteInOneCubicMeterPerSecond { get; }
43+
protected abstract double MicroLitersPerMinuteInOneCubicMeterPerSecond { get; }
4344
protected abstract double MillionUsGallonsPerDayInOneCubicMeterPerSecond { get; }
4445
protected abstract double UsGallonsPerMinuteInOneCubicMeterPerSecond { get; }
4546

@@ -48,6 +49,7 @@ public abstract partial class FlowTestsBase
4849
protected virtual double CubicMetersPerHourTolerance { get { return 1e-5; } }
4950
protected virtual double CubicMetersPerSecondTolerance { get { return 1e-5; } }
5051
protected virtual double LitersPerMinuteTolerance { get { return 1e-5; } }
52+
protected virtual double MicroLitersPerMinuteTolerance { get { return 1e-5; } }
5153
protected virtual double MillionUsGallonsPerDayTolerance { get { return 1e-5; } }
5254
protected virtual double UsGallonsPerMinuteTolerance { get { return 1e-5; } }
5355
// ReSharper restore VirtualMemberNeverOverriden.Global
@@ -60,6 +62,7 @@ public void CubicMeterPerSecondToFlowUnits()
6062
Assert.AreEqual(CubicMetersPerHourInOneCubicMeterPerSecond, cubicmeterpersecond.CubicMetersPerHour, CubicMetersPerHourTolerance);
6163
Assert.AreEqual(CubicMetersPerSecondInOneCubicMeterPerSecond, cubicmeterpersecond.CubicMetersPerSecond, CubicMetersPerSecondTolerance);
6264
Assert.AreEqual(LitersPerMinuteInOneCubicMeterPerSecond, cubicmeterpersecond.LitersPerMinute, LitersPerMinuteTolerance);
65+
Assert.AreEqual(MicroLitersPerMinuteInOneCubicMeterPerSecond, cubicmeterpersecond.MicroLitersPerMinute, MicroLitersPerMinuteTolerance);
6366
Assert.AreEqual(MillionUsGallonsPerDayInOneCubicMeterPerSecond, cubicmeterpersecond.MillionUsGallonsPerDay, MillionUsGallonsPerDayTolerance);
6467
Assert.AreEqual(UsGallonsPerMinuteInOneCubicMeterPerSecond, cubicmeterpersecond.UsGallonsPerMinute, UsGallonsPerMinuteTolerance);
6568
}
@@ -71,6 +74,7 @@ public void FromValueAndUnit()
7174
Assert.AreEqual(1, Flow.From(1, FlowUnit.CubicMeterPerHour).CubicMetersPerHour, CubicMetersPerHourTolerance);
7275
Assert.AreEqual(1, Flow.From(1, FlowUnit.CubicMeterPerSecond).CubicMetersPerSecond, CubicMetersPerSecondTolerance);
7376
Assert.AreEqual(1, Flow.From(1, FlowUnit.LitersPerMinute).LitersPerMinute, LitersPerMinuteTolerance);
77+
Assert.AreEqual(1, Flow.From(1, FlowUnit.MicroLitersPerMinute).MicroLitersPerMinute, MicroLitersPerMinuteTolerance);
7478
Assert.AreEqual(1, Flow.From(1, FlowUnit.MillionUsGallonsPerDay).MillionUsGallonsPerDay, MillionUsGallonsPerDayTolerance);
7579
Assert.AreEqual(1, Flow.From(1, FlowUnit.UsGallonsPerMinute).UsGallonsPerMinute, UsGallonsPerMinuteTolerance);
7680
}
@@ -83,6 +87,7 @@ public void As()
8387
Assert.AreEqual(CubicMetersPerHourInOneCubicMeterPerSecond, cubicmeterpersecond.As(FlowUnit.CubicMeterPerHour), CubicMetersPerHourTolerance);
8488
Assert.AreEqual(CubicMetersPerSecondInOneCubicMeterPerSecond, cubicmeterpersecond.As(FlowUnit.CubicMeterPerSecond), CubicMetersPerSecondTolerance);
8589
Assert.AreEqual(LitersPerMinuteInOneCubicMeterPerSecond, cubicmeterpersecond.As(FlowUnit.LitersPerMinute), LitersPerMinuteTolerance);
90+
Assert.AreEqual(MicroLitersPerMinuteInOneCubicMeterPerSecond, cubicmeterpersecond.As(FlowUnit.MicroLitersPerMinute), MicroLitersPerMinuteTolerance);
8691
Assert.AreEqual(MillionUsGallonsPerDayInOneCubicMeterPerSecond, cubicmeterpersecond.As(FlowUnit.MillionUsGallonsPerDay), MillionUsGallonsPerDayTolerance);
8792
Assert.AreEqual(UsGallonsPerMinuteInOneCubicMeterPerSecond, cubicmeterpersecond.As(FlowUnit.UsGallonsPerMinute), UsGallonsPerMinuteTolerance);
8893
}
@@ -95,6 +100,7 @@ public void ConversionRoundTrip()
95100
Assert.AreEqual(1, Flow.FromCubicMetersPerHour(cubicmeterpersecond.CubicMetersPerHour).CubicMetersPerSecond, CubicMetersPerHourTolerance);
96101
Assert.AreEqual(1, Flow.FromCubicMetersPerSecond(cubicmeterpersecond.CubicMetersPerSecond).CubicMetersPerSecond, CubicMetersPerSecondTolerance);
97102
Assert.AreEqual(1, Flow.FromLitersPerMinute(cubicmeterpersecond.LitersPerMinute).CubicMetersPerSecond, LitersPerMinuteTolerance);
103+
Assert.AreEqual(1, Flow.FromMicroLitersPerMinute(cubicmeterpersecond.MicroLitersPerMinute).CubicMetersPerSecond, MicroLitersPerMinuteTolerance);
98104
Assert.AreEqual(1, Flow.FromMillionUsGallonsPerDay(cubicmeterpersecond.MillionUsGallonsPerDay).CubicMetersPerSecond, MillionUsGallonsPerDayTolerance);
99105
Assert.AreEqual(1, Flow.FromUsGallonsPerMinute(cubicmeterpersecond.UsGallonsPerMinute).CubicMetersPerSecond, UsGallonsPerMinuteTolerance);
100106
}

UnitsNet/GeneratedCode/Enums/FlowUnit.g.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public enum FlowUnit
2929
CubicMeterPerHour,
3030
CubicMeterPerSecond,
3131
LitersPerMinute,
32+
MicroLitersPerMinute,
3233
MillionUsGallonsPerDay,
3334
UsGallonsPerMinute,
3435
}

UnitsNet/GeneratedCode/UnitClasses/Flow.g.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ public double LitersPerMinute
8686
get { return _cubicMetersPerSecond*60000.00000; }
8787
}
8888

89+
/// <summary>
90+
/// Get Flow in MicroLitersPerMinute.
91+
/// </summary>
92+
public double MicroLitersPerMinute
93+
{
94+
get { return _cubicMetersPerSecond*60000000000.00000; }
95+
}
96+
8997
/// <summary>
9098
/// Get Flow in MillionUsGallonsPerDay.
9199
/// </summary>
@@ -143,6 +151,14 @@ public static Flow FromLitersPerMinute(double litersperminute)
143151
return new Flow(litersperminute/60000.00000);
144152
}
145153

154+
/// <summary>
155+
/// Get Flow from MicroLitersPerMinute.
156+
/// </summary>
157+
public static Flow FromMicroLitersPerMinute(double microlitersperminute)
158+
{
159+
return new Flow(microlitersperminute/60000000000.00000);
160+
}
161+
146162
/// <summary>
147163
/// Get Flow from MillionUsGallonsPerDay.
148164
/// </summary>
@@ -178,6 +194,8 @@ public static Flow From(double value, FlowUnit fromUnit)
178194
return FromCubicMetersPerSecond(value);
179195
case FlowUnit.LitersPerMinute:
180196
return FromLitersPerMinute(value);
197+
case FlowUnit.MicroLitersPerMinute:
198+
return FromMicroLitersPerMinute(value);
181199
case FlowUnit.MillionUsGallonsPerDay:
182200
return FromMillionUsGallonsPerDay(value);
183201
case FlowUnit.UsGallonsPerMinute:
@@ -323,6 +341,8 @@ public double As(FlowUnit unit)
323341
return CubicMetersPerSecond;
324342
case FlowUnit.LitersPerMinute:
325343
return LitersPerMinute;
344+
case FlowUnit.MicroLitersPerMinute:
345+
return MicroLitersPerMinute;
326346
case FlowUnit.MillionUsGallonsPerDay:
327347
return MillionUsGallonsPerDay;
328348
case FlowUnit.UsGallonsPerMinute:

UnitsNet/GeneratedCode/UnitSystem.Default.g.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,11 @@ private static readonly ReadOnlyCollection<UnitLocalization> DefaultLocalization
565565
{
566566
new AbbreviationsForCulture("en-US", "LPM"),
567567
}),
568+
new CulturesForEnumValue((int) FlowUnit.MicroLitersPerMinute,
569+
new[]
570+
{
571+
new AbbreviationsForCulture("en-US", "μLPM"),
572+
}),
568573
new CulturesForEnumValue((int) FlowUnit.MillionUsGallonsPerDay,
569574
new[]
570575
{

UnitsNet/Scripts/UnitDefinitions/Flow.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,18 @@
7070
"Abbreviations": [ "LPM" ]
7171
}
7272
]
73+
},
74+
{
75+
"SingularName": "MicroLitersPerMinute",
76+
"PluralName": "MicroLitersPerMinute",
77+
"FromUnitToBaseFunc": "x/60000000000.00000",
78+
"FromBaseToUnitFunc": "x*60000000000.00000",
79+
"Localization": [
80+
{
81+
"Culture": "en-US",
82+
"Abbreviations": [ "μLPM" ]
83+
}
84+
]
7385
},
7486
{
7587
"SingularName": "UsGallonsPerMinute",

0 commit comments

Comments
 (0)