diff --git a/UnitsNet.Tests/CustomCode/HeatFluxTests.cs b/UnitsNet.Tests/CustomCode/HeatFluxTests.cs
new file mode 100644
index 0000000000..7b9a24687b
--- /dev/null
+++ b/UnitsNet.Tests/CustomCode/HeatFluxTests.cs
@@ -0,0 +1,88 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated (once) by \generate-code.bat, but will not be
+// regenerated when it already exists. The purpose of creating this file is to make
+// it easier to remember to implement all the unit conversion test cases.
+//
+// Whenever a new unit is added to this quantity and \generate-code.bat is run,
+// the base test class will get a new abstract property and cause a compile error
+// in this derived class, reminding the developer to implement the test case
+// for the new unit.
+//
+// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
+//
+// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
+// Add Extensions\MyQuantityExtensions.cs to decorate quantities with new behavior.
+// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities.
+//
+//
+//------------------------------------------------------------------------------
+
+// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com).
+// https://github.com/angularsen/UnitsNet
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+
+using System;
+using Xunit;
+
+namespace UnitsNet.Tests.CustomCode
+{
+ public class HeatFluxTests : HeatFluxTestsBase
+ {
+ protected override double BtusPerHourSquareFootInOneWattPerSquareMeter => 3.16998331e-1;
+ protected override double BtusPerMinuteSquareFootInOneWattPerSquareMeter => 5.28330551e-3;
+ protected override double BtusPerSecondSquareFootInOneWattPerSquareMeter => 8.80550918e-5;
+ protected override double BtusPerSecondSquareInchInOneWattPerSquareMeter => 6.11493693e-7;
+ protected override double CaloriesPerSecondSquareCentimeterInOneWattPerSquareMeter => 2.388458966e-5;
+ protected override double CentiwattsPerSquareMeterInOneWattPerSquareMeter => 1e2;
+ protected override double DeciwattsPerSquareMeterInOneWattPerSquareMeter => 1e1;
+ protected override double KilocaloriesPerSecondSquareCentimeterInOneWattPerSquareMeter => 2.388458966e-8;
+ protected override double KilocaloriesPerHourSquareMeterInOneWattPerSquareMeter => 8.59845227859e-1;
+ protected override double KilowattsPerSquareMeterInOneWattPerSquareMeter => 1e-3;
+ protected override double MicrowattsPerSquareMeterInOneWattPerSquareMeter => 1e6;
+ protected override double MilliwattsPerSquareMeterInOneWattPerSquareMeter => 1e3;
+ protected override double NanowattsPerSquareMeterInOneWattPerSquareMeter => 1e9;
+ protected override double WattsPerSquareFootInOneWattPerSquareMeter => 9.290304e-2;
+ protected override double WattsPerSquareInchInOneWattPerSquareMeter => 6.4516e-4;
+ protected override double WattsPerSquareMeterInOneWattPerSquareMeter => 1;
+
+ [Fact]
+ public void PowerDividedByAreaEqualsHeatFlux()
+ {
+ HeatFlux heatFlux = Power.FromWatts(12) / Area.FromSquareMeters(3);
+ Assert.Equal(heatFlux, HeatFlux.FromWattsPerSquareMeter(4));
+ }
+
+ [Fact]
+ public void HeatFluxTimesAreaEqualsPower()
+ {
+ Power power = HeatFlux.FromWattsPerSquareMeter(3) * Area.FromSquareMeters(4);
+ Assert.Equal(power, Power.FromWatts(12));
+ }
+
+ [Fact]
+ public void PowerDividedByHeatFluxEqualsArea()
+ {
+ Area area = Power.FromWatts(12) / HeatFlux.FromWattsPerSquareMeter(3);
+ Assert.Equal(area, Area.FromSquareMeters(4));
+ }
+ }
+}
diff --git a/UnitsNet.Tests/GeneratedCode/HeatFluxTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/HeatFluxTestsBase.g.cs
new file mode 100644
index 0000000000..48efc387cf
--- /dev/null
+++ b/UnitsNet.Tests/GeneratedCode/HeatFluxTestsBase.g.cs
@@ -0,0 +1,269 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by \generate-code.bat.
+//
+// Changes to this file will be lost when the code is regenerated.
+// The build server regenerates the code before each build and a pre-build
+// step will regenerate the code on each local build.
+//
+// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
+//
+// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
+// Add Extensions\MyQuantityExtensions.cs to decorate quantities with new behavior.
+// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities.
+//
+//
+//------------------------------------------------------------------------------
+
+// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com).
+// https://github.com/angularsen/UnitsNet
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using UnitsNet.Units;
+using Xunit;
+
+// Disable build warning CS1718: Comparison made to same variable; did you mean to compare something else?
+#pragma warning disable 1718
+
+// ReSharper disable once CheckNamespace
+namespace UnitsNet.Tests
+{
+ ///
+ /// Test of HeatFlux.
+ ///
+// ReSharper disable once PartialTypeWithSinglePart
+ public abstract partial class HeatFluxTestsBase
+ {
+ protected abstract double BtusPerHourSquareFootInOneWattPerSquareMeter { get; }
+ protected abstract double BtusPerMinuteSquareFootInOneWattPerSquareMeter { get; }
+ protected abstract double BtusPerSecondSquareFootInOneWattPerSquareMeter { get; }
+ protected abstract double BtusPerSecondSquareInchInOneWattPerSquareMeter { get; }
+ protected abstract double CaloriesPerSecondSquareCentimeterInOneWattPerSquareMeter { get; }
+ protected abstract double CentiwattsPerSquareMeterInOneWattPerSquareMeter { get; }
+ protected abstract double DeciwattsPerSquareMeterInOneWattPerSquareMeter { get; }
+ protected abstract double KilocaloriesPerHourSquareMeterInOneWattPerSquareMeter { get; }
+ protected abstract double KilocaloriesPerSecondSquareCentimeterInOneWattPerSquareMeter { get; }
+ protected abstract double KilowattsPerSquareMeterInOneWattPerSquareMeter { get; }
+ protected abstract double MicrowattsPerSquareMeterInOneWattPerSquareMeter { get; }
+ protected abstract double MilliwattsPerSquareMeterInOneWattPerSquareMeter { get; }
+ protected abstract double NanowattsPerSquareMeterInOneWattPerSquareMeter { get; }
+ protected abstract double WattsPerSquareFootInOneWattPerSquareMeter { get; }
+ protected abstract double WattsPerSquareInchInOneWattPerSquareMeter { get; }
+ protected abstract double WattsPerSquareMeterInOneWattPerSquareMeter { get; }
+
+// ReSharper disable VirtualMemberNeverOverriden.Global
+ protected virtual double BtusPerHourSquareFootTolerance { get { return 1e-5; } }
+ protected virtual double BtusPerMinuteSquareFootTolerance { get { return 1e-5; } }
+ protected virtual double BtusPerSecondSquareFootTolerance { get { return 1e-5; } }
+ protected virtual double BtusPerSecondSquareInchTolerance { get { return 1e-5; } }
+ protected virtual double CaloriesPerSecondSquareCentimeterTolerance { get { return 1e-5; } }
+ protected virtual double CentiwattsPerSquareMeterTolerance { get { return 1e-5; } }
+ protected virtual double DeciwattsPerSquareMeterTolerance { get { return 1e-5; } }
+ protected virtual double KilocaloriesPerHourSquareMeterTolerance { get { return 1e-5; } }
+ protected virtual double KilocaloriesPerSecondSquareCentimeterTolerance { get { return 1e-5; } }
+ protected virtual double KilowattsPerSquareMeterTolerance { get { return 1e-5; } }
+ protected virtual double MicrowattsPerSquareMeterTolerance { get { return 1e-5; } }
+ protected virtual double MilliwattsPerSquareMeterTolerance { get { return 1e-5; } }
+ protected virtual double NanowattsPerSquareMeterTolerance { get { return 1e-5; } }
+ protected virtual double WattsPerSquareFootTolerance { get { return 1e-5; } }
+ protected virtual double WattsPerSquareInchTolerance { get { return 1e-5; } }
+ protected virtual double WattsPerSquareMeterTolerance { get { return 1e-5; } }
+// ReSharper restore VirtualMemberNeverOverriden.Global
+
+ [Fact]
+ public void WattPerSquareMeterToHeatFluxUnits()
+ {
+ HeatFlux wattpersquaremeter = HeatFlux.FromWattsPerSquareMeter(1);
+ AssertEx.EqualTolerance(BtusPerHourSquareFootInOneWattPerSquareMeter, wattpersquaremeter.BtusPerHourSquareFoot, BtusPerHourSquareFootTolerance);
+ AssertEx.EqualTolerance(BtusPerMinuteSquareFootInOneWattPerSquareMeter, wattpersquaremeter.BtusPerMinuteSquareFoot, BtusPerMinuteSquareFootTolerance);
+ AssertEx.EqualTolerance(BtusPerSecondSquareFootInOneWattPerSquareMeter, wattpersquaremeter.BtusPerSecondSquareFoot, BtusPerSecondSquareFootTolerance);
+ AssertEx.EqualTolerance(BtusPerSecondSquareInchInOneWattPerSquareMeter, wattpersquaremeter.BtusPerSecondSquareInch, BtusPerSecondSquareInchTolerance);
+ AssertEx.EqualTolerance(CaloriesPerSecondSquareCentimeterInOneWattPerSquareMeter, wattpersquaremeter.CaloriesPerSecondSquareCentimeter, CaloriesPerSecondSquareCentimeterTolerance);
+ AssertEx.EqualTolerance(CentiwattsPerSquareMeterInOneWattPerSquareMeter, wattpersquaremeter.CentiwattsPerSquareMeter, CentiwattsPerSquareMeterTolerance);
+ AssertEx.EqualTolerance(DeciwattsPerSquareMeterInOneWattPerSquareMeter, wattpersquaremeter.DeciwattsPerSquareMeter, DeciwattsPerSquareMeterTolerance);
+ AssertEx.EqualTolerance(KilocaloriesPerHourSquareMeterInOneWattPerSquareMeter, wattpersquaremeter.KilocaloriesPerHourSquareMeter, KilocaloriesPerHourSquareMeterTolerance);
+ AssertEx.EqualTolerance(KilocaloriesPerSecondSquareCentimeterInOneWattPerSquareMeter, wattpersquaremeter.KilocaloriesPerSecondSquareCentimeter, KilocaloriesPerSecondSquareCentimeterTolerance);
+ AssertEx.EqualTolerance(KilowattsPerSquareMeterInOneWattPerSquareMeter, wattpersquaremeter.KilowattsPerSquareMeter, KilowattsPerSquareMeterTolerance);
+ AssertEx.EqualTolerance(MicrowattsPerSquareMeterInOneWattPerSquareMeter, wattpersquaremeter.MicrowattsPerSquareMeter, MicrowattsPerSquareMeterTolerance);
+ AssertEx.EqualTolerance(MilliwattsPerSquareMeterInOneWattPerSquareMeter, wattpersquaremeter.MilliwattsPerSquareMeter, MilliwattsPerSquareMeterTolerance);
+ AssertEx.EqualTolerance(NanowattsPerSquareMeterInOneWattPerSquareMeter, wattpersquaremeter.NanowattsPerSquareMeter, NanowattsPerSquareMeterTolerance);
+ AssertEx.EqualTolerance(WattsPerSquareFootInOneWattPerSquareMeter, wattpersquaremeter.WattsPerSquareFoot, WattsPerSquareFootTolerance);
+ AssertEx.EqualTolerance(WattsPerSquareInchInOneWattPerSquareMeter, wattpersquaremeter.WattsPerSquareInch, WattsPerSquareInchTolerance);
+ AssertEx.EqualTolerance(WattsPerSquareMeterInOneWattPerSquareMeter, wattpersquaremeter.WattsPerSquareMeter, WattsPerSquareMeterTolerance);
+ }
+
+ [Fact]
+ public void FromValueAndUnit()
+ {
+ AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.BtuPerHourSquareFoot).BtusPerHourSquareFoot, BtusPerHourSquareFootTolerance);
+ AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.BtuPerMinuteSquareFoot).BtusPerMinuteSquareFoot, BtusPerMinuteSquareFootTolerance);
+ AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.BtuPerSecondSquareFoot).BtusPerSecondSquareFoot, BtusPerSecondSquareFootTolerance);
+ AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.BtuPerSecondSquareInch).BtusPerSecondSquareInch, BtusPerSecondSquareInchTolerance);
+ AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.CaloriePerSecondSquareCentimeter).CaloriesPerSecondSquareCentimeter, CaloriesPerSecondSquareCentimeterTolerance);
+ AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.CentiwattPerSquareMeter).CentiwattsPerSquareMeter, CentiwattsPerSquareMeterTolerance);
+ AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.DeciwattPerSquareMeter).DeciwattsPerSquareMeter, DeciwattsPerSquareMeterTolerance);
+ AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.KilocaloriePerHourSquareMeter).KilocaloriesPerHourSquareMeter, KilocaloriesPerHourSquareMeterTolerance);
+ AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.KilocaloriePerSecondSquareCentimeter).KilocaloriesPerSecondSquareCentimeter, KilocaloriesPerSecondSquareCentimeterTolerance);
+ AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.KilowattPerSquareMeter).KilowattsPerSquareMeter, KilowattsPerSquareMeterTolerance);
+ AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.MicrowattPerSquareMeter).MicrowattsPerSquareMeter, MicrowattsPerSquareMeterTolerance);
+ AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.MilliwattPerSquareMeter).MilliwattsPerSquareMeter, MilliwattsPerSquareMeterTolerance);
+ AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.NanowattPerSquareMeter).NanowattsPerSquareMeter, NanowattsPerSquareMeterTolerance);
+ AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.WattPerSquareFoot).WattsPerSquareFoot, WattsPerSquareFootTolerance);
+ AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.WattPerSquareInch).WattsPerSquareInch, WattsPerSquareInchTolerance);
+ AssertEx.EqualTolerance(1, HeatFlux.From(1, HeatFluxUnit.WattPerSquareMeter).WattsPerSquareMeter, WattsPerSquareMeterTolerance);
+ }
+
+ [Fact]
+ public void As()
+ {
+ var wattpersquaremeter = HeatFlux.FromWattsPerSquareMeter(1);
+ AssertEx.EqualTolerance(BtusPerHourSquareFootInOneWattPerSquareMeter, wattpersquaremeter.As(HeatFluxUnit.BtuPerHourSquareFoot), BtusPerHourSquareFootTolerance);
+ AssertEx.EqualTolerance(BtusPerMinuteSquareFootInOneWattPerSquareMeter, wattpersquaremeter.As(HeatFluxUnit.BtuPerMinuteSquareFoot), BtusPerMinuteSquareFootTolerance);
+ AssertEx.EqualTolerance(BtusPerSecondSquareFootInOneWattPerSquareMeter, wattpersquaremeter.As(HeatFluxUnit.BtuPerSecondSquareFoot), BtusPerSecondSquareFootTolerance);
+ AssertEx.EqualTolerance(BtusPerSecondSquareInchInOneWattPerSquareMeter, wattpersquaremeter.As(HeatFluxUnit.BtuPerSecondSquareInch), BtusPerSecondSquareInchTolerance);
+ AssertEx.EqualTolerance(CaloriesPerSecondSquareCentimeterInOneWattPerSquareMeter, wattpersquaremeter.As(HeatFluxUnit.CaloriePerSecondSquareCentimeter), CaloriesPerSecondSquareCentimeterTolerance);
+ AssertEx.EqualTolerance(CentiwattsPerSquareMeterInOneWattPerSquareMeter, wattpersquaremeter.As(HeatFluxUnit.CentiwattPerSquareMeter), CentiwattsPerSquareMeterTolerance);
+ AssertEx.EqualTolerance(DeciwattsPerSquareMeterInOneWattPerSquareMeter, wattpersquaremeter.As(HeatFluxUnit.DeciwattPerSquareMeter), DeciwattsPerSquareMeterTolerance);
+ AssertEx.EqualTolerance(KilocaloriesPerHourSquareMeterInOneWattPerSquareMeter, wattpersquaremeter.As(HeatFluxUnit.KilocaloriePerHourSquareMeter), KilocaloriesPerHourSquareMeterTolerance);
+ AssertEx.EqualTolerance(KilocaloriesPerSecondSquareCentimeterInOneWattPerSquareMeter, wattpersquaremeter.As(HeatFluxUnit.KilocaloriePerSecondSquareCentimeter), KilocaloriesPerSecondSquareCentimeterTolerance);
+ AssertEx.EqualTolerance(KilowattsPerSquareMeterInOneWattPerSquareMeter, wattpersquaremeter.As(HeatFluxUnit.KilowattPerSquareMeter), KilowattsPerSquareMeterTolerance);
+ AssertEx.EqualTolerance(MicrowattsPerSquareMeterInOneWattPerSquareMeter, wattpersquaremeter.As(HeatFluxUnit.MicrowattPerSquareMeter), MicrowattsPerSquareMeterTolerance);
+ AssertEx.EqualTolerance(MilliwattsPerSquareMeterInOneWattPerSquareMeter, wattpersquaremeter.As(HeatFluxUnit.MilliwattPerSquareMeter), MilliwattsPerSquareMeterTolerance);
+ AssertEx.EqualTolerance(NanowattsPerSquareMeterInOneWattPerSquareMeter, wattpersquaremeter.As(HeatFluxUnit.NanowattPerSquareMeter), NanowattsPerSquareMeterTolerance);
+ AssertEx.EqualTolerance(WattsPerSquareFootInOneWattPerSquareMeter, wattpersquaremeter.As(HeatFluxUnit.WattPerSquareFoot), WattsPerSquareFootTolerance);
+ AssertEx.EqualTolerance(WattsPerSquareInchInOneWattPerSquareMeter, wattpersquaremeter.As(HeatFluxUnit.WattPerSquareInch), WattsPerSquareInchTolerance);
+ AssertEx.EqualTolerance(WattsPerSquareMeterInOneWattPerSquareMeter, wattpersquaremeter.As(HeatFluxUnit.WattPerSquareMeter), WattsPerSquareMeterTolerance);
+ }
+
+ [Fact]
+ public void ConversionRoundTrip()
+ {
+ HeatFlux wattpersquaremeter = HeatFlux.FromWattsPerSquareMeter(1);
+ AssertEx.EqualTolerance(1, HeatFlux.FromBtusPerHourSquareFoot(wattpersquaremeter.BtusPerHourSquareFoot).WattsPerSquareMeter, BtusPerHourSquareFootTolerance);
+ AssertEx.EqualTolerance(1, HeatFlux.FromBtusPerMinuteSquareFoot(wattpersquaremeter.BtusPerMinuteSquareFoot).WattsPerSquareMeter, BtusPerMinuteSquareFootTolerance);
+ AssertEx.EqualTolerance(1, HeatFlux.FromBtusPerSecondSquareFoot(wattpersquaremeter.BtusPerSecondSquareFoot).WattsPerSquareMeter, BtusPerSecondSquareFootTolerance);
+ AssertEx.EqualTolerance(1, HeatFlux.FromBtusPerSecondSquareInch(wattpersquaremeter.BtusPerSecondSquareInch).WattsPerSquareMeter, BtusPerSecondSquareInchTolerance);
+ AssertEx.EqualTolerance(1, HeatFlux.FromCaloriesPerSecondSquareCentimeter(wattpersquaremeter.CaloriesPerSecondSquareCentimeter).WattsPerSquareMeter, CaloriesPerSecondSquareCentimeterTolerance);
+ AssertEx.EqualTolerance(1, HeatFlux.FromCentiwattsPerSquareMeter(wattpersquaremeter.CentiwattsPerSquareMeter).WattsPerSquareMeter, CentiwattsPerSquareMeterTolerance);
+ AssertEx.EqualTolerance(1, HeatFlux.FromDeciwattsPerSquareMeter(wattpersquaremeter.DeciwattsPerSquareMeter).WattsPerSquareMeter, DeciwattsPerSquareMeterTolerance);
+ AssertEx.EqualTolerance(1, HeatFlux.FromKilocaloriesPerHourSquareMeter(wattpersquaremeter.KilocaloriesPerHourSquareMeter).WattsPerSquareMeter, KilocaloriesPerHourSquareMeterTolerance);
+ AssertEx.EqualTolerance(1, HeatFlux.FromKilocaloriesPerSecondSquareCentimeter(wattpersquaremeter.KilocaloriesPerSecondSquareCentimeter).WattsPerSquareMeter, KilocaloriesPerSecondSquareCentimeterTolerance);
+ AssertEx.EqualTolerance(1, HeatFlux.FromKilowattsPerSquareMeter(wattpersquaremeter.KilowattsPerSquareMeter).WattsPerSquareMeter, KilowattsPerSquareMeterTolerance);
+ AssertEx.EqualTolerance(1, HeatFlux.FromMicrowattsPerSquareMeter(wattpersquaremeter.MicrowattsPerSquareMeter).WattsPerSquareMeter, MicrowattsPerSquareMeterTolerance);
+ AssertEx.EqualTolerance(1, HeatFlux.FromMilliwattsPerSquareMeter(wattpersquaremeter.MilliwattsPerSquareMeter).WattsPerSquareMeter, MilliwattsPerSquareMeterTolerance);
+ AssertEx.EqualTolerance(1, HeatFlux.FromNanowattsPerSquareMeter(wattpersquaremeter.NanowattsPerSquareMeter).WattsPerSquareMeter, NanowattsPerSquareMeterTolerance);
+ AssertEx.EqualTolerance(1, HeatFlux.FromWattsPerSquareFoot(wattpersquaremeter.WattsPerSquareFoot).WattsPerSquareMeter, WattsPerSquareFootTolerance);
+ AssertEx.EqualTolerance(1, HeatFlux.FromWattsPerSquareInch(wattpersquaremeter.WattsPerSquareInch).WattsPerSquareMeter, WattsPerSquareInchTolerance);
+ AssertEx.EqualTolerance(1, HeatFlux.FromWattsPerSquareMeter(wattpersquaremeter.WattsPerSquareMeter).WattsPerSquareMeter, WattsPerSquareMeterTolerance);
+ }
+
+ [Fact]
+ public void ArithmeticOperators()
+ {
+ HeatFlux v = HeatFlux.FromWattsPerSquareMeter(1);
+ AssertEx.EqualTolerance(-1, -v.WattsPerSquareMeter, WattsPerSquareMeterTolerance);
+ AssertEx.EqualTolerance(2, (HeatFlux.FromWattsPerSquareMeter(3)-v).WattsPerSquareMeter, WattsPerSquareMeterTolerance);
+ AssertEx.EqualTolerance(2, (v + v).WattsPerSquareMeter, WattsPerSquareMeterTolerance);
+ AssertEx.EqualTolerance(10, (v*10).WattsPerSquareMeter, WattsPerSquareMeterTolerance);
+ AssertEx.EqualTolerance(10, (10*v).WattsPerSquareMeter, WattsPerSquareMeterTolerance);
+ AssertEx.EqualTolerance(2, (HeatFlux.FromWattsPerSquareMeter(10)/5).WattsPerSquareMeter, WattsPerSquareMeterTolerance);
+ AssertEx.EqualTolerance(2, HeatFlux.FromWattsPerSquareMeter(10)/HeatFlux.FromWattsPerSquareMeter(5), WattsPerSquareMeterTolerance);
+ }
+
+ [Fact]
+ public void ComparisonOperators()
+ {
+ HeatFlux oneWattPerSquareMeter = HeatFlux.FromWattsPerSquareMeter(1);
+ HeatFlux twoWattsPerSquareMeter = HeatFlux.FromWattsPerSquareMeter(2);
+
+ Assert.True(oneWattPerSquareMeter < twoWattsPerSquareMeter);
+ Assert.True(oneWattPerSquareMeter <= twoWattsPerSquareMeter);
+ Assert.True(twoWattsPerSquareMeter > oneWattPerSquareMeter);
+ Assert.True(twoWattsPerSquareMeter >= oneWattPerSquareMeter);
+
+ Assert.False(oneWattPerSquareMeter > twoWattsPerSquareMeter);
+ Assert.False(oneWattPerSquareMeter >= twoWattsPerSquareMeter);
+ Assert.False(twoWattsPerSquareMeter < oneWattPerSquareMeter);
+ Assert.False(twoWattsPerSquareMeter <= oneWattPerSquareMeter);
+ }
+
+ [Fact]
+ public void CompareToIsImplemented()
+ {
+ HeatFlux wattpersquaremeter = HeatFlux.FromWattsPerSquareMeter(1);
+ Assert.Equal(0, wattpersquaremeter.CompareTo(wattpersquaremeter));
+ Assert.True(wattpersquaremeter.CompareTo(HeatFlux.Zero) > 0);
+ Assert.True(HeatFlux.Zero.CompareTo(wattpersquaremeter) < 0);
+ }
+
+ [Fact]
+ public void CompareToThrowsOnTypeMismatch()
+ {
+ HeatFlux wattpersquaremeter = HeatFlux.FromWattsPerSquareMeter(1);
+ Assert.Throws(() => wattpersquaremeter.CompareTo(new object()));
+ }
+
+ [Fact]
+ public void CompareToThrowsOnNull()
+ {
+ HeatFlux wattpersquaremeter = HeatFlux.FromWattsPerSquareMeter(1);
+ Assert.Throws(() => wattpersquaremeter.CompareTo(null));
+ }
+
+
+ [Fact]
+ public void EqualityOperators()
+ {
+ HeatFlux a = HeatFlux.FromWattsPerSquareMeter(1);
+ HeatFlux b = HeatFlux.FromWattsPerSquareMeter(2);
+
+// ReSharper disable EqualExpressionComparison
+ Assert.True(a == a);
+ Assert.True(a != b);
+
+ Assert.False(a == b);
+ Assert.False(a != a);
+// ReSharper restore EqualExpressionComparison
+ }
+
+ [Fact]
+ public void EqualsIsImplemented()
+ {
+ HeatFlux v = HeatFlux.FromWattsPerSquareMeter(1);
+ Assert.True(v.Equals(HeatFlux.FromWattsPerSquareMeter(1), HeatFlux.FromWattsPerSquareMeter(WattsPerSquareMeterTolerance)));
+ Assert.False(v.Equals(HeatFlux.Zero, HeatFlux.FromWattsPerSquareMeter(WattsPerSquareMeterTolerance)));
+ }
+
+ [Fact]
+ public void EqualsReturnsFalseOnTypeMismatch()
+ {
+ HeatFlux wattpersquaremeter = HeatFlux.FromWattsPerSquareMeter(1);
+ Assert.False(wattpersquaremeter.Equals(new object()));
+ }
+
+ [Fact]
+ public void EqualsReturnsFalseOnNull()
+ {
+ HeatFlux wattpersquaremeter = HeatFlux.FromWattsPerSquareMeter(1);
+ Assert.False(wattpersquaremeter.Equals(null));
+ }
+ }
+}
diff --git a/UnitsNet/CustomCode/Quantities/HeatFlux.extra.cs b/UnitsNet/CustomCode/Quantities/HeatFlux.extra.cs
new file mode 100644
index 0000000000..8568ec1283
--- /dev/null
+++ b/UnitsNet/CustomCode/Quantities/HeatFlux.extra.cs
@@ -0,0 +1,41 @@
+// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com).
+// https://github.com/angularsen/UnitsNet
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+namespace UnitsNet
+{
+ // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components
+ // Public structures can't have any members other than public fields, and those fields must be value types or strings.
+ // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic.
+#if WINDOWS_UWP
+ public sealed partial class HeatFlux
+#else
+ public partial struct HeatFlux
+#endif
+ {
+ // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx
+#if !WINDOWS_UWP
+ public static Power operator *(HeatFlux heatFlux, Area area)
+ {
+ return Power.FromWatts(heatFlux.WattsPerSquareMeter * area.SquareMeters);
+ }
+#endif
+ }
+}
diff --git a/UnitsNet/CustomCode/Quantities/Power.extra.cs b/UnitsNet/CustomCode/Quantities/Power.extra.cs
index f4f484aefa..52a5d0f9a5 100644
--- a/UnitsNet/CustomCode/Quantities/Power.extra.cs
+++ b/UnitsNet/CustomCode/Quantities/Power.extra.cs
@@ -86,6 +86,16 @@ public partial struct Power
{
return MassFlow.FromKilogramsPerSecond(power.Watts / specificEnergy.JoulesPerKilogram);
}
+
+ public static HeatFlux operator /(Power power, Area area)
+ {
+ return HeatFlux.FromWattsPerSquareMeter(power.Watts / area.SquareMeters);
+ }
+
+ public static Area operator /(Power power, HeatFlux heatFlux)
+ {
+ return Area.FromSquareMeters( power.Watts / heatFlux.WattsPerSquareMeter );
+ }
#endif
}
-}
\ No newline at end of file
+}
diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToHeatFluxExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToHeatFluxExtensions.g.cs
new file mode 100644
index 0000000000..c273a40e62
--- /dev/null
+++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToHeatFluxExtensions.g.cs
@@ -0,0 +1,593 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by \generate-code.bat.
+//
+// Changes to this file will be lost when the code is regenerated.
+// The build server regenerates the code before each build and a pre-build
+// step will regenerate the code on each local build.
+//
+// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
+//
+// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
+// Add Extensions\MyQuantityExtensions.cs to decorate quantities with new behavior.
+// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities.
+//
+//
+//------------------------------------------------------------------------------
+
+// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com).
+// https://github.com/angularsen/UnitsNet
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+
+// Windows Runtime Component does not support extension methods and method overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx
+#if !WINDOWS_UWP
+namespace UnitsNet.Extensions.NumberToHeatFlux
+{
+ public static class NumberToHeatFluxExtensions
+ {
+ #region BtuPerHourSquareFoot
+
+ ///
+ public static HeatFlux BtusPerHourSquareFoot(this int value) => HeatFlux.FromBtusPerHourSquareFoot(value);
+
+ ///
+ public static HeatFlux? BtusPerHourSquareFoot(this int? value) => HeatFlux.FromBtusPerHourSquareFoot(value);
+
+ ///
+ public static HeatFlux BtusPerHourSquareFoot(this long value) => HeatFlux.FromBtusPerHourSquareFoot(value);
+
+ ///
+ public static HeatFlux? BtusPerHourSquareFoot(this long? value) => HeatFlux.FromBtusPerHourSquareFoot(value);
+
+ ///
+ public static HeatFlux BtusPerHourSquareFoot(this double value) => HeatFlux.FromBtusPerHourSquareFoot(value);
+
+ ///
+ public static HeatFlux? BtusPerHourSquareFoot(this double? value) => HeatFlux.FromBtusPerHourSquareFoot(value);
+
+ ///
+ public static HeatFlux BtusPerHourSquareFoot(this float value) => HeatFlux.FromBtusPerHourSquareFoot(value);
+
+ ///
+ public static HeatFlux? BtusPerHourSquareFoot(this float? value) => HeatFlux.FromBtusPerHourSquareFoot(value);
+
+ ///
+ public static HeatFlux BtusPerHourSquareFoot(this decimal value) => HeatFlux.FromBtusPerHourSquareFoot(Convert.ToDouble(value));
+
+ ///
+ public static HeatFlux? BtusPerHourSquareFoot(this decimal? value) => HeatFlux.FromBtusPerHourSquareFoot(value == null ? (double?)null : Convert.ToDouble(value.Value));
+
+ #endregion
+
+ #region BtuPerMinuteSquareFoot
+
+ ///
+ public static HeatFlux BtusPerMinuteSquareFoot(this int value) => HeatFlux.FromBtusPerMinuteSquareFoot(value);
+
+ ///
+ public static HeatFlux? BtusPerMinuteSquareFoot(this int? value) => HeatFlux.FromBtusPerMinuteSquareFoot(value);
+
+ ///
+ public static HeatFlux BtusPerMinuteSquareFoot(this long value) => HeatFlux.FromBtusPerMinuteSquareFoot(value);
+
+ ///
+ public static HeatFlux? BtusPerMinuteSquareFoot(this long? value) => HeatFlux.FromBtusPerMinuteSquareFoot(value);
+
+ ///
+ public static HeatFlux BtusPerMinuteSquareFoot(this double value) => HeatFlux.FromBtusPerMinuteSquareFoot(value);
+
+ ///
+ public static HeatFlux? BtusPerMinuteSquareFoot(this double? value) => HeatFlux.FromBtusPerMinuteSquareFoot(value);
+
+ ///
+ public static HeatFlux BtusPerMinuteSquareFoot(this float value) => HeatFlux.FromBtusPerMinuteSquareFoot(value);
+
+ ///
+ public static HeatFlux? BtusPerMinuteSquareFoot(this float? value) => HeatFlux.FromBtusPerMinuteSquareFoot(value);
+
+ ///
+ public static HeatFlux BtusPerMinuteSquareFoot(this decimal value) => HeatFlux.FromBtusPerMinuteSquareFoot(Convert.ToDouble(value));
+
+ ///
+ public static HeatFlux? BtusPerMinuteSquareFoot(this decimal? value) => HeatFlux.FromBtusPerMinuteSquareFoot(value == null ? (double?)null : Convert.ToDouble(value.Value));
+
+ #endregion
+
+ #region BtuPerSecondSquareFoot
+
+ ///
+ public static HeatFlux BtusPerSecondSquareFoot(this int value) => HeatFlux.FromBtusPerSecondSquareFoot(value);
+
+ ///
+ public static HeatFlux? BtusPerSecondSquareFoot(this int? value) => HeatFlux.FromBtusPerSecondSquareFoot(value);
+
+ ///
+ public static HeatFlux BtusPerSecondSquareFoot(this long value) => HeatFlux.FromBtusPerSecondSquareFoot(value);
+
+ ///
+ public static HeatFlux? BtusPerSecondSquareFoot(this long? value) => HeatFlux.FromBtusPerSecondSquareFoot(value);
+
+ ///
+ public static HeatFlux BtusPerSecondSquareFoot(this double value) => HeatFlux.FromBtusPerSecondSquareFoot(value);
+
+ ///
+ public static HeatFlux? BtusPerSecondSquareFoot(this double? value) => HeatFlux.FromBtusPerSecondSquareFoot(value);
+
+ ///
+ public static HeatFlux BtusPerSecondSquareFoot(this float value) => HeatFlux.FromBtusPerSecondSquareFoot(value);
+
+ ///
+ public static HeatFlux? BtusPerSecondSquareFoot(this float? value) => HeatFlux.FromBtusPerSecondSquareFoot(value);
+
+ ///
+ public static HeatFlux BtusPerSecondSquareFoot(this decimal value) => HeatFlux.FromBtusPerSecondSquareFoot(Convert.ToDouble(value));
+
+ ///
+ public static HeatFlux? BtusPerSecondSquareFoot(this decimal? value) => HeatFlux.FromBtusPerSecondSquareFoot(value == null ? (double?)null : Convert.ToDouble(value.Value));
+
+ #endregion
+
+ #region BtuPerSecondSquareInch
+
+ ///
+ public static HeatFlux BtusPerSecondSquareInch(this int value) => HeatFlux.FromBtusPerSecondSquareInch(value);
+
+ ///
+ public static HeatFlux? BtusPerSecondSquareInch(this int? value) => HeatFlux.FromBtusPerSecondSquareInch(value);
+
+ ///
+ public static HeatFlux BtusPerSecondSquareInch(this long value) => HeatFlux.FromBtusPerSecondSquareInch(value);
+
+ ///
+ public static HeatFlux? BtusPerSecondSquareInch(this long? value) => HeatFlux.FromBtusPerSecondSquareInch(value);
+
+ ///
+ public static HeatFlux BtusPerSecondSquareInch(this double value) => HeatFlux.FromBtusPerSecondSquareInch(value);
+
+ ///
+ public static HeatFlux? BtusPerSecondSquareInch(this double? value) => HeatFlux.FromBtusPerSecondSquareInch(value);
+
+ ///
+ public static HeatFlux BtusPerSecondSquareInch(this float value) => HeatFlux.FromBtusPerSecondSquareInch(value);
+
+ ///
+ public static HeatFlux? BtusPerSecondSquareInch(this float? value) => HeatFlux.FromBtusPerSecondSquareInch(value);
+
+ ///
+ public static HeatFlux BtusPerSecondSquareInch(this decimal value) => HeatFlux.FromBtusPerSecondSquareInch(Convert.ToDouble(value));
+
+ ///
+ public static HeatFlux? BtusPerSecondSquareInch(this decimal? value) => HeatFlux.FromBtusPerSecondSquareInch(value == null ? (double?)null : Convert.ToDouble(value.Value));
+
+ #endregion
+
+ #region CaloriePerSecondSquareCentimeter
+
+ ///
+ public static HeatFlux CaloriesPerSecondSquareCentimeter(this int value) => HeatFlux.FromCaloriesPerSecondSquareCentimeter(value);
+
+ ///
+ public static HeatFlux? CaloriesPerSecondSquareCentimeter(this int? value) => HeatFlux.FromCaloriesPerSecondSquareCentimeter(value);
+
+ ///
+ public static HeatFlux CaloriesPerSecondSquareCentimeter(this long value) => HeatFlux.FromCaloriesPerSecondSquareCentimeter(value);
+
+ ///
+ public static HeatFlux? CaloriesPerSecondSquareCentimeter(this long? value) => HeatFlux.FromCaloriesPerSecondSquareCentimeter(value);
+
+ ///
+ public static HeatFlux CaloriesPerSecondSquareCentimeter(this double value) => HeatFlux.FromCaloriesPerSecondSquareCentimeter(value);
+
+ ///
+ public static HeatFlux? CaloriesPerSecondSquareCentimeter(this double? value) => HeatFlux.FromCaloriesPerSecondSquareCentimeter(value);
+
+ ///
+ public static HeatFlux CaloriesPerSecondSquareCentimeter(this float value) => HeatFlux.FromCaloriesPerSecondSquareCentimeter(value);
+
+ ///
+ public static HeatFlux? CaloriesPerSecondSquareCentimeter(this float? value) => HeatFlux.FromCaloriesPerSecondSquareCentimeter(value);
+
+ ///
+ public static HeatFlux CaloriesPerSecondSquareCentimeter(this decimal value) => HeatFlux.FromCaloriesPerSecondSquareCentimeter(Convert.ToDouble(value));
+
+ ///
+ public static HeatFlux? CaloriesPerSecondSquareCentimeter(this decimal? value) => HeatFlux.FromCaloriesPerSecondSquareCentimeter(value == null ? (double?)null : Convert.ToDouble(value.Value));
+
+ #endregion
+
+ #region CentiwattPerSquareMeter
+
+ ///
+ public static HeatFlux CentiwattsPerSquareMeter(this int value) => HeatFlux.FromCentiwattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux? CentiwattsPerSquareMeter(this int? value) => HeatFlux.FromCentiwattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux CentiwattsPerSquareMeter(this long value) => HeatFlux.FromCentiwattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux? CentiwattsPerSquareMeter(this long? value) => HeatFlux.FromCentiwattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux CentiwattsPerSquareMeter(this double value) => HeatFlux.FromCentiwattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux? CentiwattsPerSquareMeter(this double? value) => HeatFlux.FromCentiwattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux CentiwattsPerSquareMeter(this float value) => HeatFlux.FromCentiwattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux? CentiwattsPerSquareMeter(this float? value) => HeatFlux.FromCentiwattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux CentiwattsPerSquareMeter(this decimal value) => HeatFlux.FromCentiwattsPerSquareMeter(Convert.ToDouble(value));
+
+ ///
+ public static HeatFlux? CentiwattsPerSquareMeter(this decimal? value) => HeatFlux.FromCentiwattsPerSquareMeter(value == null ? (double?)null : Convert.ToDouble(value.Value));
+
+ #endregion
+
+ #region DeciwattPerSquareMeter
+
+ ///
+ public static HeatFlux DeciwattsPerSquareMeter(this int value) => HeatFlux.FromDeciwattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux? DeciwattsPerSquareMeter(this int? value) => HeatFlux.FromDeciwattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux DeciwattsPerSquareMeter(this long value) => HeatFlux.FromDeciwattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux? DeciwattsPerSquareMeter(this long? value) => HeatFlux.FromDeciwattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux DeciwattsPerSquareMeter(this double value) => HeatFlux.FromDeciwattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux? DeciwattsPerSquareMeter(this double? value) => HeatFlux.FromDeciwattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux DeciwattsPerSquareMeter(this float value) => HeatFlux.FromDeciwattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux? DeciwattsPerSquareMeter(this float? value) => HeatFlux.FromDeciwattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux DeciwattsPerSquareMeter(this decimal value) => HeatFlux.FromDeciwattsPerSquareMeter(Convert.ToDouble(value));
+
+ ///
+ public static HeatFlux? DeciwattsPerSquareMeter(this decimal? value) => HeatFlux.FromDeciwattsPerSquareMeter(value == null ? (double?)null : Convert.ToDouble(value.Value));
+
+ #endregion
+
+ #region KilocaloriePerHourSquareMeter
+
+ ///
+ public static HeatFlux KilocaloriesPerHourSquareMeter(this int value) => HeatFlux.FromKilocaloriesPerHourSquareMeter(value);
+
+ ///
+ public static HeatFlux? KilocaloriesPerHourSquareMeter(this int? value) => HeatFlux.FromKilocaloriesPerHourSquareMeter(value);
+
+ ///
+ public static HeatFlux KilocaloriesPerHourSquareMeter(this long value) => HeatFlux.FromKilocaloriesPerHourSquareMeter(value);
+
+ ///
+ public static HeatFlux? KilocaloriesPerHourSquareMeter(this long? value) => HeatFlux.FromKilocaloriesPerHourSquareMeter(value);
+
+ ///
+ public static HeatFlux KilocaloriesPerHourSquareMeter(this double value) => HeatFlux.FromKilocaloriesPerHourSquareMeter(value);
+
+ ///
+ public static HeatFlux? KilocaloriesPerHourSquareMeter(this double? value) => HeatFlux.FromKilocaloriesPerHourSquareMeter(value);
+
+ ///
+ public static HeatFlux KilocaloriesPerHourSquareMeter(this float value) => HeatFlux.FromKilocaloriesPerHourSquareMeter(value);
+
+ ///
+ public static HeatFlux? KilocaloriesPerHourSquareMeter(this float? value) => HeatFlux.FromKilocaloriesPerHourSquareMeter(value);
+
+ ///
+ public static HeatFlux KilocaloriesPerHourSquareMeter(this decimal value) => HeatFlux.FromKilocaloriesPerHourSquareMeter(Convert.ToDouble(value));
+
+ ///
+ public static HeatFlux? KilocaloriesPerHourSquareMeter(this decimal? value) => HeatFlux.FromKilocaloriesPerHourSquareMeter(value == null ? (double?)null : Convert.ToDouble(value.Value));
+
+ #endregion
+
+ #region KilocaloriePerSecondSquareCentimeter
+
+ ///
+ public static HeatFlux KilocaloriesPerSecondSquareCentimeter(this int value) => HeatFlux.FromKilocaloriesPerSecondSquareCentimeter(value);
+
+ ///
+ public static HeatFlux? KilocaloriesPerSecondSquareCentimeter(this int? value) => HeatFlux.FromKilocaloriesPerSecondSquareCentimeter(value);
+
+ ///
+ public static HeatFlux KilocaloriesPerSecondSquareCentimeter(this long value) => HeatFlux.FromKilocaloriesPerSecondSquareCentimeter(value);
+
+ ///
+ public static HeatFlux? KilocaloriesPerSecondSquareCentimeter(this long? value) => HeatFlux.FromKilocaloriesPerSecondSquareCentimeter(value);
+
+ ///
+ public static HeatFlux KilocaloriesPerSecondSquareCentimeter(this double value) => HeatFlux.FromKilocaloriesPerSecondSquareCentimeter(value);
+
+ ///
+ public static HeatFlux? KilocaloriesPerSecondSquareCentimeter(this double? value) => HeatFlux.FromKilocaloriesPerSecondSquareCentimeter(value);
+
+ ///
+ public static HeatFlux KilocaloriesPerSecondSquareCentimeter(this float value) => HeatFlux.FromKilocaloriesPerSecondSquareCentimeter(value);
+
+ ///
+ public static HeatFlux? KilocaloriesPerSecondSquareCentimeter(this float? value) => HeatFlux.FromKilocaloriesPerSecondSquareCentimeter(value);
+
+ ///
+ public static HeatFlux KilocaloriesPerSecondSquareCentimeter(this decimal value) => HeatFlux.FromKilocaloriesPerSecondSquareCentimeter(Convert.ToDouble(value));
+
+ ///
+ public static HeatFlux? KilocaloriesPerSecondSquareCentimeter(this decimal? value) => HeatFlux.FromKilocaloriesPerSecondSquareCentimeter(value == null ? (double?)null : Convert.ToDouble(value.Value));
+
+ #endregion
+
+ #region KilowattPerSquareMeter
+
+ ///
+ public static HeatFlux KilowattsPerSquareMeter(this int value) => HeatFlux.FromKilowattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux? KilowattsPerSquareMeter(this int? value) => HeatFlux.FromKilowattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux KilowattsPerSquareMeter(this long value) => HeatFlux.FromKilowattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux? KilowattsPerSquareMeter(this long? value) => HeatFlux.FromKilowattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux KilowattsPerSquareMeter(this double value) => HeatFlux.FromKilowattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux? KilowattsPerSquareMeter(this double? value) => HeatFlux.FromKilowattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux KilowattsPerSquareMeter(this float value) => HeatFlux.FromKilowattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux? KilowattsPerSquareMeter(this float? value) => HeatFlux.FromKilowattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux KilowattsPerSquareMeter(this decimal value) => HeatFlux.FromKilowattsPerSquareMeter(Convert.ToDouble(value));
+
+ ///
+ public static HeatFlux? KilowattsPerSquareMeter(this decimal? value) => HeatFlux.FromKilowattsPerSquareMeter(value == null ? (double?)null : Convert.ToDouble(value.Value));
+
+ #endregion
+
+ #region MicrowattPerSquareMeter
+
+ ///
+ public static HeatFlux MicrowattsPerSquareMeter(this int value) => HeatFlux.FromMicrowattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux? MicrowattsPerSquareMeter(this int? value) => HeatFlux.FromMicrowattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux MicrowattsPerSquareMeter(this long value) => HeatFlux.FromMicrowattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux? MicrowattsPerSquareMeter(this long? value) => HeatFlux.FromMicrowattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux MicrowattsPerSquareMeter(this double value) => HeatFlux.FromMicrowattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux? MicrowattsPerSquareMeter(this double? value) => HeatFlux.FromMicrowattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux MicrowattsPerSquareMeter(this float value) => HeatFlux.FromMicrowattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux? MicrowattsPerSquareMeter(this float? value) => HeatFlux.FromMicrowattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux MicrowattsPerSquareMeter(this decimal value) => HeatFlux.FromMicrowattsPerSquareMeter(Convert.ToDouble(value));
+
+ ///
+ public static HeatFlux? MicrowattsPerSquareMeter(this decimal? value) => HeatFlux.FromMicrowattsPerSquareMeter(value == null ? (double?)null : Convert.ToDouble(value.Value));
+
+ #endregion
+
+ #region MilliwattPerSquareMeter
+
+ ///
+ public static HeatFlux MilliwattsPerSquareMeter(this int value) => HeatFlux.FromMilliwattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux? MilliwattsPerSquareMeter(this int? value) => HeatFlux.FromMilliwattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux MilliwattsPerSquareMeter(this long value) => HeatFlux.FromMilliwattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux? MilliwattsPerSquareMeter(this long? value) => HeatFlux.FromMilliwattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux MilliwattsPerSquareMeter(this double value) => HeatFlux.FromMilliwattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux? MilliwattsPerSquareMeter(this double? value) => HeatFlux.FromMilliwattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux MilliwattsPerSquareMeter(this float value) => HeatFlux.FromMilliwattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux? MilliwattsPerSquareMeter(this float? value) => HeatFlux.FromMilliwattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux MilliwattsPerSquareMeter(this decimal value) => HeatFlux.FromMilliwattsPerSquareMeter(Convert.ToDouble(value));
+
+ ///
+ public static HeatFlux? MilliwattsPerSquareMeter(this decimal? value) => HeatFlux.FromMilliwattsPerSquareMeter(value == null ? (double?)null : Convert.ToDouble(value.Value));
+
+ #endregion
+
+ #region NanowattPerSquareMeter
+
+ ///
+ public static HeatFlux NanowattsPerSquareMeter(this int value) => HeatFlux.FromNanowattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux? NanowattsPerSquareMeter(this int? value) => HeatFlux.FromNanowattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux NanowattsPerSquareMeter(this long value) => HeatFlux.FromNanowattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux? NanowattsPerSquareMeter(this long? value) => HeatFlux.FromNanowattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux NanowattsPerSquareMeter(this double value) => HeatFlux.FromNanowattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux? NanowattsPerSquareMeter(this double? value) => HeatFlux.FromNanowattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux NanowattsPerSquareMeter(this float value) => HeatFlux.FromNanowattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux? NanowattsPerSquareMeter(this float? value) => HeatFlux.FromNanowattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux NanowattsPerSquareMeter(this decimal value) => HeatFlux.FromNanowattsPerSquareMeter(Convert.ToDouble(value));
+
+ ///
+ public static HeatFlux? NanowattsPerSquareMeter(this decimal? value) => HeatFlux.FromNanowattsPerSquareMeter(value == null ? (double?)null : Convert.ToDouble(value.Value));
+
+ #endregion
+
+ #region WattPerSquareFoot
+
+ ///
+ public static HeatFlux WattsPerSquareFoot(this int value) => HeatFlux.FromWattsPerSquareFoot(value);
+
+ ///
+ public static HeatFlux? WattsPerSquareFoot(this int? value) => HeatFlux.FromWattsPerSquareFoot(value);
+
+ ///
+ public static HeatFlux WattsPerSquareFoot(this long value) => HeatFlux.FromWattsPerSquareFoot(value);
+
+ ///
+ public static HeatFlux? WattsPerSquareFoot(this long? value) => HeatFlux.FromWattsPerSquareFoot(value);
+
+ ///
+ public static HeatFlux WattsPerSquareFoot(this double value) => HeatFlux.FromWattsPerSquareFoot(value);
+
+ ///
+ public static HeatFlux? WattsPerSquareFoot(this double? value) => HeatFlux.FromWattsPerSquareFoot(value);
+
+ ///
+ public static HeatFlux WattsPerSquareFoot(this float value) => HeatFlux.FromWattsPerSquareFoot(value);
+
+ ///
+ public static HeatFlux? WattsPerSquareFoot(this float? value) => HeatFlux.FromWattsPerSquareFoot(value);
+
+ ///
+ public static HeatFlux WattsPerSquareFoot(this decimal value) => HeatFlux.FromWattsPerSquareFoot(Convert.ToDouble(value));
+
+ ///
+ public static HeatFlux? WattsPerSquareFoot(this decimal? value) => HeatFlux.FromWattsPerSquareFoot(value == null ? (double?)null : Convert.ToDouble(value.Value));
+
+ #endregion
+
+ #region WattPerSquareInch
+
+ ///
+ public static HeatFlux WattsPerSquareInch(this int value) => HeatFlux.FromWattsPerSquareInch(value);
+
+ ///
+ public static HeatFlux? WattsPerSquareInch(this int? value) => HeatFlux.FromWattsPerSquareInch(value);
+
+ ///
+ public static HeatFlux WattsPerSquareInch(this long value) => HeatFlux.FromWattsPerSquareInch(value);
+
+ ///
+ public static HeatFlux? WattsPerSquareInch(this long? value) => HeatFlux.FromWattsPerSquareInch(value);
+
+ ///
+ public static HeatFlux WattsPerSquareInch(this double value) => HeatFlux.FromWattsPerSquareInch(value);
+
+ ///
+ public static HeatFlux? WattsPerSquareInch(this double? value) => HeatFlux.FromWattsPerSquareInch(value);
+
+ ///
+ public static HeatFlux WattsPerSquareInch(this float value) => HeatFlux.FromWattsPerSquareInch(value);
+
+ ///
+ public static HeatFlux? WattsPerSquareInch(this float? value) => HeatFlux.FromWattsPerSquareInch(value);
+
+ ///
+ public static HeatFlux WattsPerSquareInch(this decimal value) => HeatFlux.FromWattsPerSquareInch(Convert.ToDouble(value));
+
+ ///
+ public static HeatFlux? WattsPerSquareInch(this decimal? value) => HeatFlux.FromWattsPerSquareInch(value == null ? (double?)null : Convert.ToDouble(value.Value));
+
+ #endregion
+
+ #region WattPerSquareMeter
+
+ ///
+ public static HeatFlux WattsPerSquareMeter(this int value) => HeatFlux.FromWattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux? WattsPerSquareMeter(this int? value) => HeatFlux.FromWattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux WattsPerSquareMeter(this long value) => HeatFlux.FromWattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux? WattsPerSquareMeter(this long? value) => HeatFlux.FromWattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux WattsPerSquareMeter(this double value) => HeatFlux.FromWattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux? WattsPerSquareMeter(this double? value) => HeatFlux.FromWattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux WattsPerSquareMeter(this float value) => HeatFlux.FromWattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux? WattsPerSquareMeter(this float? value) => HeatFlux.FromWattsPerSquareMeter(value);
+
+ ///
+ public static HeatFlux WattsPerSquareMeter(this decimal value) => HeatFlux.FromWattsPerSquareMeter(Convert.ToDouble(value));
+
+ ///
+ public static HeatFlux? WattsPerSquareMeter(this decimal? value) => HeatFlux.FromWattsPerSquareMeter(value == null ? (double?)null : Convert.ToDouble(value.Value));
+
+ #endregion
+
+ }
+}
+#endif
diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs
new file mode 100644
index 0000000000..07d4788874
--- /dev/null
+++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs
@@ -0,0 +1,1332 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by \generate-code.bat.
+//
+// Changes to this file will be lost when the code is regenerated.
+// The build server regenerates the code before each build and a pre-build
+// step will regenerate the code on each local build.
+//
+// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
+//
+// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
+// Add Extensions\MyQuantityExtensions.cs to decorate quantities with new behavior.
+// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities.
+//
+//
+//------------------------------------------------------------------------------
+
+// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com).
+// https://github.com/angularsen/UnitsNet
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Text.RegularExpressions;
+using System.Linq;
+using JetBrains.Annotations;
+using UnitsNet.Units;
+
+// ReSharper disable once CheckNamespace
+
+namespace UnitsNet
+{
+ ///
+ /// Heat flux is the flow of energy per unit of area per unit of time
+ ///
+ // ReSharper disable once PartialTypeWithSinglePart
+
+ // Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components
+ // Public structures can't have any members other than public fields, and those fields must be value types or strings.
+ // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic.
+#if WINDOWS_UWP
+ public sealed partial class HeatFlux
+#else
+ public partial struct HeatFlux : IComparable, IComparable
+#endif
+ {
+ ///
+ /// The numeric value this quantity was constructed with.
+ ///
+ private readonly double _value;
+
+ ///
+ /// The unit this quantity was constructed with.
+ ///
+ private readonly HeatFluxUnit? _unit;
+
+ ///
+ /// The numeric value this quantity was constructed with.
+ ///
+#if WINDOWS_UWP
+ public double Value => Convert.ToDouble(_value);
+#else
+ public double Value => _value;
+#endif
+
+ ///
+ /// The unit this quantity was constructed with -or- if default ctor was used.
+ ///
+ public HeatFluxUnit Unit => _unit.GetValueOrDefault(BaseUnit);
+
+ // Windows Runtime Component requires a default constructor
+#if WINDOWS_UWP
+ public HeatFlux()
+ {
+ _value = 0;
+ _unit = BaseUnit;
+ }
+#endif
+
+ [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")]
+ public HeatFlux(double wattspersquaremeter)
+ {
+ _value = Convert.ToDouble(wattspersquaremeter);
+ _unit = BaseUnit;
+ }
+
+ ///
+ /// Creates the quantity with the given numeric value and unit.
+ ///
+ /// Numeric value.
+ /// Unit representation.
+ /// Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.
+#if WINDOWS_UWP
+ private
+#else
+ public
+#endif
+ HeatFlux(double numericValue, HeatFluxUnit unit)
+ {
+ _value = numericValue;
+ _unit = unit;
+ }
+
+ // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods
+ ///
+ /// Creates the quantity with the given value assuming the base unit WattPerSquareMeter.
+ ///
+ /// Value assuming base unit WattPerSquareMeter.
+#if WINDOWS_UWP
+ private
+#else
+ [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")]
+ public
+#endif
+ HeatFlux(long wattspersquaremeter) : this(Convert.ToDouble(wattspersquaremeter), BaseUnit) { }
+
+ // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods
+ // Windows Runtime Component does not support decimal type
+ ///
+ /// Creates the quantity with the given value assuming the base unit WattPerSquareMeter.
+ ///
+ /// Value assuming base unit WattPerSquareMeter.
+#if WINDOWS_UWP
+ private
+#else
+ [Obsolete("Use the constructor that takes a unit parameter. This constructor will be removed in a future version.")]
+ public
+#endif
+ HeatFlux(decimal wattspersquaremeter) : this(Convert.ToDouble(wattspersquaremeter), BaseUnit) { }
+
+ #region Properties
+
+ ///
+ /// The of this quantity.
+ ///
+ public static QuantityType QuantityType => QuantityType.HeatFlux;
+
+ ///
+ /// The base unit representation of this quantity for the numeric value stored internally. All conversions go via this value.
+ ///
+ public static HeatFluxUnit BaseUnit => HeatFluxUnit.WattPerSquareMeter;
+
+ ///
+ /// All units of measurement for the HeatFlux quantity.
+ ///
+ public static HeatFluxUnit[] Units { get; } = Enum.GetValues(typeof(HeatFluxUnit)).Cast().ToArray();
+ ///
+ /// Get HeatFlux in BtusPerHourSquareFoot.
+ ///
+ public double BtusPerHourSquareFoot => As(HeatFluxUnit.BtuPerHourSquareFoot);
+ ///
+ /// Get HeatFlux in BtusPerMinuteSquareFoot.
+ ///
+ public double BtusPerMinuteSquareFoot => As(HeatFluxUnit.BtuPerMinuteSquareFoot);
+ ///
+ /// Get HeatFlux in BtusPerSecondSquareFoot.
+ ///
+ public double BtusPerSecondSquareFoot => As(HeatFluxUnit.BtuPerSecondSquareFoot);
+ ///
+ /// Get HeatFlux in BtusPerSecondSquareInch.
+ ///
+ public double BtusPerSecondSquareInch => As(HeatFluxUnit.BtuPerSecondSquareInch);
+ ///
+ /// Get HeatFlux in CaloriesPerSecondSquareCentimeter.
+ ///
+ public double CaloriesPerSecondSquareCentimeter => As(HeatFluxUnit.CaloriePerSecondSquareCentimeter);
+ ///
+ /// Get HeatFlux in CentiwattsPerSquareMeter.
+ ///
+ public double CentiwattsPerSquareMeter => As(HeatFluxUnit.CentiwattPerSquareMeter);
+ ///
+ /// Get HeatFlux in DeciwattsPerSquareMeter.
+ ///
+ public double DeciwattsPerSquareMeter => As(HeatFluxUnit.DeciwattPerSquareMeter);
+ ///
+ /// Get HeatFlux in KilocaloriesPerHourSquareMeter.
+ ///
+ public double KilocaloriesPerHourSquareMeter => As(HeatFluxUnit.KilocaloriePerHourSquareMeter);
+ ///
+ /// Get HeatFlux in KilocaloriesPerSecondSquareCentimeter.
+ ///
+ public double KilocaloriesPerSecondSquareCentimeter => As(HeatFluxUnit.KilocaloriePerSecondSquareCentimeter);
+ ///
+ /// Get HeatFlux in KilowattsPerSquareMeter.
+ ///
+ public double KilowattsPerSquareMeter => As(HeatFluxUnit.KilowattPerSquareMeter);
+ ///
+ /// Get HeatFlux in MicrowattsPerSquareMeter.
+ ///
+ public double MicrowattsPerSquareMeter => As(HeatFluxUnit.MicrowattPerSquareMeter);
+ ///
+ /// Get HeatFlux in MilliwattsPerSquareMeter.
+ ///
+ public double MilliwattsPerSquareMeter => As(HeatFluxUnit.MilliwattPerSquareMeter);
+ ///
+ /// Get HeatFlux in NanowattsPerSquareMeter.
+ ///
+ public double NanowattsPerSquareMeter => As(HeatFluxUnit.NanowattPerSquareMeter);
+ ///
+ /// Get HeatFlux in WattsPerSquareFoot.
+ ///
+ public double WattsPerSquareFoot => As(HeatFluxUnit.WattPerSquareFoot);
+ ///
+ /// Get HeatFlux in WattsPerSquareInch.
+ ///
+ public double WattsPerSquareInch => As(HeatFluxUnit.WattPerSquareInch);
+ ///
+ /// Get HeatFlux in WattsPerSquareMeter.
+ ///
+ public double WattsPerSquareMeter => As(HeatFluxUnit.WattPerSquareMeter);
+
+ #endregion
+
+ #region Static
+
+ public static HeatFlux Zero => new HeatFlux(0, BaseUnit);
+
+ ///
+ /// Get HeatFlux from BtusPerHourSquareFoot.
+ ///
+#if WINDOWS_UWP
+ [Windows.Foundation.Metadata.DefaultOverload]
+ public static HeatFlux FromBtusPerHourSquareFoot(double btusperhoursquarefoot)
+#else
+ public static HeatFlux FromBtusPerHourSquareFoot(QuantityValue btusperhoursquarefoot)
+#endif
+ {
+ double value = (double) btusperhoursquarefoot;
+ return new HeatFlux(value, HeatFluxUnit.BtuPerHourSquareFoot);
+ }
+
+ ///
+ /// Get HeatFlux from BtusPerMinuteSquareFoot.
+ ///
+#if WINDOWS_UWP
+ [Windows.Foundation.Metadata.DefaultOverload]
+ public static HeatFlux FromBtusPerMinuteSquareFoot(double btusperminutesquarefoot)
+#else
+ public static HeatFlux FromBtusPerMinuteSquareFoot(QuantityValue btusperminutesquarefoot)
+#endif
+ {
+ double value = (double) btusperminutesquarefoot;
+ return new HeatFlux(value, HeatFluxUnit.BtuPerMinuteSquareFoot);
+ }
+
+ ///
+ /// Get HeatFlux from BtusPerSecondSquareFoot.
+ ///
+#if WINDOWS_UWP
+ [Windows.Foundation.Metadata.DefaultOverload]
+ public static HeatFlux FromBtusPerSecondSquareFoot(double btuspersecondsquarefoot)
+#else
+ public static HeatFlux FromBtusPerSecondSquareFoot(QuantityValue btuspersecondsquarefoot)
+#endif
+ {
+ double value = (double) btuspersecondsquarefoot;
+ return new HeatFlux(value, HeatFluxUnit.BtuPerSecondSquareFoot);
+ }
+
+ ///
+ /// Get HeatFlux from BtusPerSecondSquareInch.
+ ///
+#if WINDOWS_UWP
+ [Windows.Foundation.Metadata.DefaultOverload]
+ public static HeatFlux FromBtusPerSecondSquareInch(double btuspersecondsquareinch)
+#else
+ public static HeatFlux FromBtusPerSecondSquareInch(QuantityValue btuspersecondsquareinch)
+#endif
+ {
+ double value = (double) btuspersecondsquareinch;
+ return new HeatFlux(value, HeatFluxUnit.BtuPerSecondSquareInch);
+ }
+
+ ///
+ /// Get HeatFlux from CaloriesPerSecondSquareCentimeter.
+ ///
+#if WINDOWS_UWP
+ [Windows.Foundation.Metadata.DefaultOverload]
+ public static HeatFlux FromCaloriesPerSecondSquareCentimeter(double caloriespersecondsquarecentimeter)
+#else
+ public static HeatFlux FromCaloriesPerSecondSquareCentimeter(QuantityValue caloriespersecondsquarecentimeter)
+#endif
+ {
+ double value = (double) caloriespersecondsquarecentimeter;
+ return new HeatFlux(value, HeatFluxUnit.CaloriePerSecondSquareCentimeter);
+ }
+
+ ///
+ /// Get HeatFlux from CentiwattsPerSquareMeter.
+ ///
+#if WINDOWS_UWP
+ [Windows.Foundation.Metadata.DefaultOverload]
+ public static HeatFlux FromCentiwattsPerSquareMeter(double centiwattspersquaremeter)
+#else
+ public static HeatFlux FromCentiwattsPerSquareMeter(QuantityValue centiwattspersquaremeter)
+#endif
+ {
+ double value = (double) centiwattspersquaremeter;
+ return new HeatFlux(value, HeatFluxUnit.CentiwattPerSquareMeter);
+ }
+
+ ///
+ /// Get HeatFlux from DeciwattsPerSquareMeter.
+ ///
+#if WINDOWS_UWP
+ [Windows.Foundation.Metadata.DefaultOverload]
+ public static HeatFlux FromDeciwattsPerSquareMeter(double deciwattspersquaremeter)
+#else
+ public static HeatFlux FromDeciwattsPerSquareMeter(QuantityValue deciwattspersquaremeter)
+#endif
+ {
+ double value = (double) deciwattspersquaremeter;
+ return new HeatFlux(value, HeatFluxUnit.DeciwattPerSquareMeter);
+ }
+
+ ///
+ /// Get HeatFlux from KilocaloriesPerHourSquareMeter.
+ ///
+#if WINDOWS_UWP
+ [Windows.Foundation.Metadata.DefaultOverload]
+ public static HeatFlux FromKilocaloriesPerHourSquareMeter(double kilocaloriesperhoursquaremeter)
+#else
+ public static HeatFlux FromKilocaloriesPerHourSquareMeter(QuantityValue kilocaloriesperhoursquaremeter)
+#endif
+ {
+ double value = (double) kilocaloriesperhoursquaremeter;
+ return new HeatFlux(value, HeatFluxUnit.KilocaloriePerHourSquareMeter);
+ }
+
+ ///
+ /// Get HeatFlux from KilocaloriesPerSecondSquareCentimeter.
+ ///
+#if WINDOWS_UWP
+ [Windows.Foundation.Metadata.DefaultOverload]
+ public static HeatFlux FromKilocaloriesPerSecondSquareCentimeter(double kilocaloriespersecondsquarecentimeter)
+#else
+ public static HeatFlux FromKilocaloriesPerSecondSquareCentimeter(QuantityValue kilocaloriespersecondsquarecentimeter)
+#endif
+ {
+ double value = (double) kilocaloriespersecondsquarecentimeter;
+ return new HeatFlux(value, HeatFluxUnit.KilocaloriePerSecondSquareCentimeter);
+ }
+
+ ///
+ /// Get HeatFlux from KilowattsPerSquareMeter.
+ ///
+#if WINDOWS_UWP
+ [Windows.Foundation.Metadata.DefaultOverload]
+ public static HeatFlux FromKilowattsPerSquareMeter(double kilowattspersquaremeter)
+#else
+ public static HeatFlux FromKilowattsPerSquareMeter(QuantityValue kilowattspersquaremeter)
+#endif
+ {
+ double value = (double) kilowattspersquaremeter;
+ return new HeatFlux(value, HeatFluxUnit.KilowattPerSquareMeter);
+ }
+
+ ///
+ /// Get HeatFlux from MicrowattsPerSquareMeter.
+ ///
+#if WINDOWS_UWP
+ [Windows.Foundation.Metadata.DefaultOverload]
+ public static HeatFlux FromMicrowattsPerSquareMeter(double microwattspersquaremeter)
+#else
+ public static HeatFlux FromMicrowattsPerSquareMeter(QuantityValue microwattspersquaremeter)
+#endif
+ {
+ double value = (double) microwattspersquaremeter;
+ return new HeatFlux(value, HeatFluxUnit.MicrowattPerSquareMeter);
+ }
+
+ ///
+ /// Get HeatFlux from MilliwattsPerSquareMeter.
+ ///
+#if WINDOWS_UWP
+ [Windows.Foundation.Metadata.DefaultOverload]
+ public static HeatFlux FromMilliwattsPerSquareMeter(double milliwattspersquaremeter)
+#else
+ public static HeatFlux FromMilliwattsPerSquareMeter(QuantityValue milliwattspersquaremeter)
+#endif
+ {
+ double value = (double) milliwattspersquaremeter;
+ return new HeatFlux(value, HeatFluxUnit.MilliwattPerSquareMeter);
+ }
+
+ ///
+ /// Get HeatFlux from NanowattsPerSquareMeter.
+ ///
+#if WINDOWS_UWP
+ [Windows.Foundation.Metadata.DefaultOverload]
+ public static HeatFlux FromNanowattsPerSquareMeter(double nanowattspersquaremeter)
+#else
+ public static HeatFlux FromNanowattsPerSquareMeter(QuantityValue nanowattspersquaremeter)
+#endif
+ {
+ double value = (double) nanowattspersquaremeter;
+ return new HeatFlux(value, HeatFluxUnit.NanowattPerSquareMeter);
+ }
+
+ ///
+ /// Get HeatFlux from WattsPerSquareFoot.
+ ///
+#if WINDOWS_UWP
+ [Windows.Foundation.Metadata.DefaultOverload]
+ public static HeatFlux FromWattsPerSquareFoot(double wattspersquarefoot)
+#else
+ public static HeatFlux FromWattsPerSquareFoot(QuantityValue wattspersquarefoot)
+#endif
+ {
+ double value = (double) wattspersquarefoot;
+ return new HeatFlux(value, HeatFluxUnit.WattPerSquareFoot);
+ }
+
+ ///
+ /// Get HeatFlux from WattsPerSquareInch.
+ ///
+#if WINDOWS_UWP
+ [Windows.Foundation.Metadata.DefaultOverload]
+ public static HeatFlux FromWattsPerSquareInch(double wattspersquareinch)
+#else
+ public static HeatFlux FromWattsPerSquareInch(QuantityValue wattspersquareinch)
+#endif
+ {
+ double value = (double) wattspersquareinch;
+ return new HeatFlux(value, HeatFluxUnit.WattPerSquareInch);
+ }
+
+ ///
+ /// Get HeatFlux from WattsPerSquareMeter.
+ ///
+#if WINDOWS_UWP
+ [Windows.Foundation.Metadata.DefaultOverload]
+ public static HeatFlux FromWattsPerSquareMeter(double wattspersquaremeter)
+#else
+ public static HeatFlux FromWattsPerSquareMeter(QuantityValue wattspersquaremeter)
+#endif
+ {
+ double value = (double) wattspersquaremeter;
+ return new HeatFlux(value, HeatFluxUnit.WattPerSquareMeter);
+ }
+
+ // Windows Runtime Component does not support nullable types (double?): https://msdn.microsoft.com/en-us/library/br230301.aspx
+#if !WINDOWS_UWP
+ ///
+ /// Get nullable HeatFlux from nullable BtusPerHourSquareFoot.
+ ///
+ public static HeatFlux? FromBtusPerHourSquareFoot(QuantityValue? btusperhoursquarefoot)
+ {
+ if (btusperhoursquarefoot.HasValue)
+ {
+ return FromBtusPerHourSquareFoot(btusperhoursquarefoot.Value);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ ///
+ /// Get nullable HeatFlux from nullable BtusPerMinuteSquareFoot.
+ ///
+ public static HeatFlux? FromBtusPerMinuteSquareFoot(QuantityValue? btusperminutesquarefoot)
+ {
+ if (btusperminutesquarefoot.HasValue)
+ {
+ return FromBtusPerMinuteSquareFoot(btusperminutesquarefoot.Value);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ ///
+ /// Get nullable HeatFlux from nullable BtusPerSecondSquareFoot.
+ ///
+ public static HeatFlux? FromBtusPerSecondSquareFoot(QuantityValue? btuspersecondsquarefoot)
+ {
+ if (btuspersecondsquarefoot.HasValue)
+ {
+ return FromBtusPerSecondSquareFoot(btuspersecondsquarefoot.Value);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ ///
+ /// Get nullable HeatFlux from nullable BtusPerSecondSquareInch.
+ ///
+ public static HeatFlux? FromBtusPerSecondSquareInch(QuantityValue? btuspersecondsquareinch)
+ {
+ if (btuspersecondsquareinch.HasValue)
+ {
+ return FromBtusPerSecondSquareInch(btuspersecondsquareinch.Value);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ ///
+ /// Get nullable HeatFlux from nullable CaloriesPerSecondSquareCentimeter.
+ ///
+ public static HeatFlux? FromCaloriesPerSecondSquareCentimeter(QuantityValue? caloriespersecondsquarecentimeter)
+ {
+ if (caloriespersecondsquarecentimeter.HasValue)
+ {
+ return FromCaloriesPerSecondSquareCentimeter(caloriespersecondsquarecentimeter.Value);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ ///
+ /// Get nullable HeatFlux from nullable CentiwattsPerSquareMeter.
+ ///
+ public static HeatFlux? FromCentiwattsPerSquareMeter(QuantityValue? centiwattspersquaremeter)
+ {
+ if (centiwattspersquaremeter.HasValue)
+ {
+ return FromCentiwattsPerSquareMeter(centiwattspersquaremeter.Value);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ ///
+ /// Get nullable HeatFlux from nullable DeciwattsPerSquareMeter.
+ ///
+ public static HeatFlux? FromDeciwattsPerSquareMeter(QuantityValue? deciwattspersquaremeter)
+ {
+ if (deciwattspersquaremeter.HasValue)
+ {
+ return FromDeciwattsPerSquareMeter(deciwattspersquaremeter.Value);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ ///
+ /// Get nullable HeatFlux from nullable KilocaloriesPerHourSquareMeter.
+ ///
+ public static HeatFlux? FromKilocaloriesPerHourSquareMeter(QuantityValue? kilocaloriesperhoursquaremeter)
+ {
+ if (kilocaloriesperhoursquaremeter.HasValue)
+ {
+ return FromKilocaloriesPerHourSquareMeter(kilocaloriesperhoursquaremeter.Value);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ ///
+ /// Get nullable HeatFlux from nullable KilocaloriesPerSecondSquareCentimeter.
+ ///
+ public static HeatFlux? FromKilocaloriesPerSecondSquareCentimeter(QuantityValue? kilocaloriespersecondsquarecentimeter)
+ {
+ if (kilocaloriespersecondsquarecentimeter.HasValue)
+ {
+ return FromKilocaloriesPerSecondSquareCentimeter(kilocaloriespersecondsquarecentimeter.Value);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ ///
+ /// Get nullable HeatFlux from nullable KilowattsPerSquareMeter.
+ ///
+ public static HeatFlux? FromKilowattsPerSquareMeter(QuantityValue? kilowattspersquaremeter)
+ {
+ if (kilowattspersquaremeter.HasValue)
+ {
+ return FromKilowattsPerSquareMeter(kilowattspersquaremeter.Value);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ ///
+ /// Get nullable HeatFlux from nullable MicrowattsPerSquareMeter.
+ ///
+ public static HeatFlux? FromMicrowattsPerSquareMeter(QuantityValue? microwattspersquaremeter)
+ {
+ if (microwattspersquaremeter.HasValue)
+ {
+ return FromMicrowattsPerSquareMeter(microwattspersquaremeter.Value);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ ///
+ /// Get nullable HeatFlux from nullable MilliwattsPerSquareMeter.
+ ///
+ public static HeatFlux? FromMilliwattsPerSquareMeter(QuantityValue? milliwattspersquaremeter)
+ {
+ if (milliwattspersquaremeter.HasValue)
+ {
+ return FromMilliwattsPerSquareMeter(milliwattspersquaremeter.Value);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ ///
+ /// Get nullable HeatFlux from nullable NanowattsPerSquareMeter.
+ ///
+ public static HeatFlux? FromNanowattsPerSquareMeter(QuantityValue? nanowattspersquaremeter)
+ {
+ if (nanowattspersquaremeter.HasValue)
+ {
+ return FromNanowattsPerSquareMeter(nanowattspersquaremeter.Value);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ ///
+ /// Get nullable HeatFlux from nullable WattsPerSquareFoot.
+ ///
+ public static HeatFlux? FromWattsPerSquareFoot(QuantityValue? wattspersquarefoot)
+ {
+ if (wattspersquarefoot.HasValue)
+ {
+ return FromWattsPerSquareFoot(wattspersquarefoot.Value);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ ///
+ /// Get nullable HeatFlux from nullable WattsPerSquareInch.
+ ///
+ public static HeatFlux? FromWattsPerSquareInch(QuantityValue? wattspersquareinch)
+ {
+ if (wattspersquareinch.HasValue)
+ {
+ return FromWattsPerSquareInch(wattspersquareinch.Value);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ ///
+ /// Get nullable HeatFlux from nullable WattsPerSquareMeter.
+ ///
+ public static HeatFlux? FromWattsPerSquareMeter(QuantityValue? wattspersquaremeter)
+ {
+ if (wattspersquaremeter.HasValue)
+ {
+ return FromWattsPerSquareMeter(wattspersquaremeter.Value);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+#endif
+
+ ///
+ /// Dynamically convert from value and unit enum to .
+ ///
+ /// Value to convert from.
+ /// Unit to convert from.
+ /// HeatFlux unit value.
+#if WINDOWS_UWP
+ // Fix name conflict with parameter "value"
+ [return: System.Runtime.InteropServices.WindowsRuntime.ReturnValueName("returnValue")]
+ public static HeatFlux From(double value, HeatFluxUnit fromUnit)
+#else
+ public static HeatFlux From(QuantityValue value, HeatFluxUnit fromUnit)
+#endif
+ {
+ return new HeatFlux((double)value, fromUnit);
+ }
+
+ // Windows Runtime Component does not support nullable types (double?): https://msdn.microsoft.com/en-us/library/br230301.aspx
+#if !WINDOWS_UWP
+ ///
+ /// Dynamically convert from value and unit enum to .
+ ///
+ /// Value to convert from.
+ /// Unit to convert from.
+ /// HeatFlux unit value.
+ public static HeatFlux? From(QuantityValue? value, HeatFluxUnit fromUnit)
+ {
+ if (!value.HasValue)
+ {
+ return null;
+ }
+
+ return new HeatFlux((double)value.Value, fromUnit);
+ }
+#endif
+
+ ///
+ /// Get unit abbreviation string.
+ ///
+ /// Unit to get abbreviation for.
+ /// Unit abbreviation string.
+ [UsedImplicitly]
+ public static string GetAbbreviation(HeatFluxUnit unit)
+ {
+ return GetAbbreviation(unit, null);
+ }
+
+ ///
+ /// Get unit abbreviation string.
+ ///
+ /// Unit to get abbreviation for.
+#if WINDOWS_UWP
+ /// Name of culture (ex: "en-US") to use for localization. Defaults to 's default culture.
+#else
+ /// Format to use for localization. Defaults to .
+#endif
+ /// Unit abbreviation string.
+ [UsedImplicitly]
+ public static string GetAbbreviation(
+ HeatFluxUnit unit,
+#if WINDOWS_UWP
+ [CanBeNull] string cultureName)
+#else
+ [CanBeNull] IFormatProvider provider)
+#endif
+ {
+#if WINDOWS_UWP
+ // Windows Runtime Component does not support CultureInfo and IFormatProvider types, so we use culture name for public methods: https://msdn.microsoft.com/en-us/library/br230301.aspx
+ IFormatProvider provider = cultureName == null ? UnitSystem.DefaultCulture : new CultureInfo(cultureName);
+#else
+ provider = provider ?? UnitSystem.DefaultCulture;
+#endif
+
+ return UnitSystem.GetCached(provider).GetDefaultAbbreviation(unit);
+ }
+
+ #endregion
+
+ #region Arithmetic Operators
+
+ // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx
+#if !WINDOWS_UWP
+ public static HeatFlux operator -(HeatFlux right)
+ {
+ return new HeatFlux(-right.Value, right.Unit);
+ }
+
+ public static HeatFlux operator +(HeatFlux left, HeatFlux right)
+ {
+ return new HeatFlux(left.Value + right.AsBaseNumericType(left.Unit), left.Unit);
+ }
+
+ public static HeatFlux operator -(HeatFlux left, HeatFlux right)
+ {
+ return new HeatFlux(left.Value - right.AsBaseNumericType(left.Unit), left.Unit);
+ }
+
+ public static HeatFlux operator *(double left, HeatFlux right)
+ {
+ return new HeatFlux(left * right.Value, right.Unit);
+ }
+
+ public static HeatFlux operator *(HeatFlux left, double right)
+ {
+ return new HeatFlux(left.Value * right, left.Unit);
+ }
+
+ public static HeatFlux operator /(HeatFlux left, double right)
+ {
+ return new HeatFlux(left.Value / right, left.Unit);
+ }
+
+ public static double operator /(HeatFlux left, HeatFlux right)
+ {
+ return left.WattsPerSquareMeter / right.WattsPerSquareMeter;
+ }
+#endif
+
+ #endregion
+
+ #region Equality / IComparable
+
+ public int CompareTo(object obj)
+ {
+ if (obj == null) throw new ArgumentNullException("obj");
+ if (!(obj is HeatFlux)) throw new ArgumentException("Expected type HeatFlux.", "obj");
+ return CompareTo((HeatFlux) obj);
+ }
+
+ // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods
+#if WINDOWS_UWP
+ internal
+#else
+ public
+#endif
+ int CompareTo(HeatFlux other)
+ {
+ return AsBaseUnitWattsPerSquareMeter().CompareTo(other.AsBaseUnitWattsPerSquareMeter());
+ }
+
+ // Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx
+#if !WINDOWS_UWP
+ public static bool operator <=(HeatFlux left, HeatFlux right)
+ {
+ return left.Value <= right.AsBaseNumericType(left.Unit);
+ }
+
+ public static bool operator >=(HeatFlux left, HeatFlux right)
+ {
+ return left.Value >= right.AsBaseNumericType(left.Unit);
+ }
+
+ public static bool operator <(HeatFlux left, HeatFlux right)
+ {
+ return left.Value < right.AsBaseNumericType(left.Unit);
+ }
+
+ public static bool operator >(HeatFlux left, HeatFlux right)
+ {
+ return left.Value > right.AsBaseNumericType(left.Unit);
+ }
+
+ [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")]
+ public static bool operator ==(HeatFlux left, HeatFlux right)
+ {
+ // ReSharper disable once CompareOfFloatsByEqualityOperator
+ return left.Value == right.AsBaseNumericType(left.Unit);
+ }
+
+ [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")]
+ public static bool operator !=(HeatFlux left, HeatFlux right)
+ {
+ // ReSharper disable once CompareOfFloatsByEqualityOperator
+ return left.Value != right.AsBaseNumericType(left.Unit);
+ }
+#endif
+
+ [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")]
+ public override bool Equals(object obj)
+ {
+ if (obj == null || GetType() != obj.GetType())
+ {
+ return false;
+ }
+
+ return AsBaseUnitWattsPerSquareMeter().Equals(((HeatFlux) obj).AsBaseUnitWattsPerSquareMeter());
+ }
+
+ ///
+ /// Compare equality to another HeatFlux by specifying a max allowed difference.
+ /// Note that it is advised against specifying zero difference, due to the nature
+ /// of floating point operations and using System.Double internally.
+ ///
+ /// Other quantity to compare to.
+ /// Max error allowed.
+ /// True if the difference between the two values is not greater than the specified max.
+ public bool Equals(HeatFlux other, HeatFlux maxError)
+ {
+ return Math.Abs(AsBaseUnitWattsPerSquareMeter() - other.AsBaseUnitWattsPerSquareMeter()) <= maxError.AsBaseUnitWattsPerSquareMeter();
+ }
+
+ public override int GetHashCode()
+ {
+ return new { Value, Unit }.GetHashCode();
+ }
+
+ #endregion
+
+ #region Conversion
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(HeatFluxUnit unit)
+ {
+ if (Unit == unit)
+ {
+ return (double)Value;
+ }
+
+ double baseUnitValue = AsBaseUnitWattsPerSquareMeter();
+
+ switch (unit)
+ {
+ case HeatFluxUnit.BtuPerHourSquareFoot: return baseUnitValue/3.15459075;
+ case HeatFluxUnit.BtuPerMinuteSquareFoot: return baseUnitValue/1.89275445e2;
+ case HeatFluxUnit.BtuPerSecondSquareFoot: return baseUnitValue/1.13565267e4;
+ case HeatFluxUnit.BtuPerSecondSquareInch: return baseUnitValue/1.63533984e6;
+ case HeatFluxUnit.CaloriePerSecondSquareCentimeter: return baseUnitValue/4.1868e4;
+ case HeatFluxUnit.CentiwattPerSquareMeter: return (baseUnitValue) / 1e-2d;
+ case HeatFluxUnit.DeciwattPerSquareMeter: return (baseUnitValue) / 1e-1d;
+ case HeatFluxUnit.KilocaloriePerHourSquareMeter: return baseUnitValue/1.163;
+ case HeatFluxUnit.KilocaloriePerSecondSquareCentimeter: return (baseUnitValue/4.1868e4) / 1e3d;
+ case HeatFluxUnit.KilowattPerSquareMeter: return (baseUnitValue) / 1e3d;
+ case HeatFluxUnit.MicrowattPerSquareMeter: return (baseUnitValue) / 1e-6d;
+ case HeatFluxUnit.MilliwattPerSquareMeter: return (baseUnitValue) / 1e-3d;
+ case HeatFluxUnit.NanowattPerSquareMeter: return (baseUnitValue) / 1e-9d;
+ case HeatFluxUnit.WattPerSquareFoot: return baseUnitValue/1.07639e1;
+ case HeatFluxUnit.WattPerSquareInch: return baseUnitValue/1.5500031e3;
+ case HeatFluxUnit.WattPerSquareMeter: return baseUnitValue;
+
+ default:
+ throw new NotImplementedException("unit: " + unit);
+ }
+ }
+
+ #endregion
+
+ #region Parsing
+
+ ///
+ /// Parse a string with one or two quantities of the format "<quantity> <unit>".
+ ///
+ /// String to parse. Typically in the form: {number} {unit}
+ ///
+ /// Length.Parse("5.5 m", new CultureInfo("en-US"));
+ ///
+ /// The value of 'str' cannot be null.
+ ///
+ /// Expected string to have one or two pairs of quantity and unit in the format
+ /// "<quantity> <unit>". Eg. "5.5 m" or "1ft 2in"
+ ///
+ ///
+ /// More than one unit is represented by the specified unit abbreviation.
+ /// Example: Volume.Parse("1 cup") will throw, because it can refer to any of
+ /// , and .
+ ///
+ ///
+ /// If anything else goes wrong, typically due to a bug or unhandled case.
+ /// We wrap exceptions in to allow you to distinguish
+ /// Units.NET exceptions from other exceptions.
+ ///
+ public static HeatFlux Parse(string str)
+ {
+ return Parse(str, null);
+ }
+
+ ///
+ /// Parse a string with one or two quantities of the format "<quantity> <unit>".
+ ///
+ /// String to parse. Typically in the form: {number} {unit}
+#if WINDOWS_UWP
+ /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture.
+#else
+ /// Format to use when parsing number and unit. Defaults to .
+#endif
+ ///
+ /// Length.Parse("5.5 m", new CultureInfo("en-US"));
+ ///
+ /// The value of 'str' cannot be null.
+ ///
+ /// Expected string to have one or two pairs of quantity and unit in the format
+ /// "<quantity> <unit>". Eg. "5.5 m" or "1ft 2in"
+ ///
+ ///
+ /// More than one unit is represented by the specified unit abbreviation.
+ /// Example: Volume.Parse("1 cup") will throw, because it can refer to any of
+ /// , and .
+ ///
+ ///
+ /// If anything else goes wrong, typically due to a bug or unhandled case.
+ /// We wrap exceptions in to allow you to distinguish
+ /// Units.NET exceptions from other exceptions.
+ ///
+ public static HeatFlux Parse(
+ string str,
+#if WINDOWS_UWP
+ [CanBeNull] string cultureName)
+#else
+ [CanBeNull] IFormatProvider provider)
+#endif
+ {
+ if (str == null) throw new ArgumentNullException("str");
+
+#if WINDOWS_UWP
+ // Windows Runtime Component does not support CultureInfo and IFormatProvider types, so we use culture name for public methods: https://msdn.microsoft.com/en-us/library/br230301.aspx
+ IFormatProvider provider = cultureName == null ? UnitSystem.DefaultCulture : new CultureInfo(cultureName);
+#else
+ provider = provider ?? UnitSystem.DefaultCulture;
+#endif
+
+ return QuantityParser.Parse(str, provider,
+ delegate(string value, string unit, IFormatProvider formatProvider2)
+ {
+ double parsedValue = double.Parse(value, formatProvider2);
+ HeatFluxUnit parsedUnit = ParseUnit(unit, formatProvider2);
+ return From(parsedValue, parsedUnit);
+ }, (x, y) => FromWattsPerSquareMeter(x.WattsPerSquareMeter + y.WattsPerSquareMeter));
+ }
+
+ ///
+ /// Try to parse a string with one or two quantities of the format "<quantity> <unit>".
+ ///
+ /// String to parse. Typically in the form: {number} {unit}
+ /// Resulting unit quantity if successful.
+ ///
+ /// Length.Parse("5.5 m", new CultureInfo("en-US"));
+ ///
+ public static bool TryParse([CanBeNull] string str, out HeatFlux result)
+ {
+ return TryParse(str, null, out result);
+ }
+
+ ///
+ /// Try to parse a string with one or two quantities of the format "<quantity> <unit>".
+ ///
+ /// String to parse. Typically in the form: {number} {unit}
+#if WINDOWS_UWP
+ /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture.
+#else
+ /// Format to use when parsing number and unit. Defaults to .
+#endif
+ /// Resulting unit quantity if successful.
+ ///
+ /// Length.Parse("5.5 m", new CultureInfo("en-US"));
+ ///
+ public static bool TryParse(
+ [CanBeNull] string str,
+#if WINDOWS_UWP
+ [CanBeNull] string cultureName,
+#else
+ [CanBeNull] IFormatProvider provider,
+#endif
+ out HeatFlux result)
+ {
+#if WINDOWS_UWP
+ // Windows Runtime Component does not support CultureInfo and IFormatProvider types, so we use culture name for public methods: https://msdn.microsoft.com/en-us/library/br230301.aspx
+ IFormatProvider provider = cultureName == null ? UnitSystem.DefaultCulture : new CultureInfo(cultureName);
+#else
+ provider = provider ?? UnitSystem.DefaultCulture;
+#endif
+ try
+ {
+
+ result = Parse(
+ str,
+#if WINDOWS_UWP
+ cultureName);
+#else
+ provider);
+#endif
+
+ return true;
+ }
+ catch
+ {
+ result = default(HeatFlux);
+ return false;
+ }
+ }
+
+ ///
+ /// Parse a unit string.
+ ///
+ /// String to parse. Typically in the form: {number} {unit}
+ ///
+ /// Length.ParseUnit("m", new CultureInfo("en-US"));
+ ///
+ /// The value of 'str' cannot be null.
+ /// Error parsing string.
+ public static HeatFluxUnit ParseUnit(string str)
+ {
+ return ParseUnit(str, (IFormatProvider)null);
+ }
+
+ ///
+ /// Parse a unit string.
+ ///
+ /// String to parse. Typically in the form: {number} {unit}
+ /// Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to 's default culture.
+ ///
+ /// Length.ParseUnit("m", new CultureInfo("en-US"));
+ ///
+ /// The value of 'str' cannot be null.
+ /// Error parsing string.
+ [Obsolete("Use overload that takes IFormatProvider instead of culture name. This method was only added to support WindowsRuntimeComponent and will be removed from other .NET targets.")]
+ public static HeatFluxUnit ParseUnit(string str, [CanBeNull] string cultureName)
+ {
+ return ParseUnit(str, cultureName == null ? null : new CultureInfo(cultureName));
+ }
+
+ ///
+ /// Parse a unit string.
+ ///
+ /// String to parse. Typically in the form: {number} {unit}
+ /// Format to use when parsing number and unit. Defaults to .
+ ///
+ /// Length.ParseUnit("m", new CultureInfo("en-US"));
+ ///
+ /// The value of 'str' cannot be null.
+ /// Error parsing string.
+
+ // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods
+#if WINDOWS_UWP
+ internal
+#else
+ public
+#endif
+ static HeatFluxUnit ParseUnit(string str, IFormatProvider provider = null)
+ {
+ if (str == null) throw new ArgumentNullException("str");
+
+ var unitSystem = UnitSystem.GetCached(provider);
+ var unit = unitSystem.Parse(str.Trim());
+
+ if (unit == HeatFluxUnit.Undefined)
+ {
+ var newEx = new UnitsNetException("Error parsing string. The unit is not a recognized HeatFluxUnit.");
+ newEx.Data["input"] = str;
+ newEx.Data["provider"] = provider?.ToString() ?? "(null)";
+ throw newEx;
+ }
+
+ return unit;
+ }
+
+ #endregion
+
+ [Obsolete("This is no longer used since we will instead use the quantity's Unit value as default.")]
+ ///
+ /// Set the default unit used by ToString(). Default is WattPerSquareMeter
+ ///
+ public static HeatFluxUnit ToStringDefaultUnit { get; set; } = HeatFluxUnit.WattPerSquareMeter;
+
+ ///
+ /// Get default string representation of value and unit.
+ ///
+ /// String representation.
+ public override string ToString()
+ {
+ return ToString(Unit);
+ }
+
+ ///
+ /// Get string representation of value and unit. Using current UI culture and two significant digits after radix.
+ ///
+ /// Unit representation to use.
+ /// String representation.
+ public string ToString(HeatFluxUnit unit)
+ {
+ return ToString(unit, null, 2);
+ }
+
+ ///
+ /// Get string representation of value and unit. Using two significant digits after radix.
+ ///
+ /// Unit representation to use.
+#if WINDOWS_UWP
+ /// Name of culture (ex: "en-US") to use for localization and number formatting. Defaults to 's default culture.
+#else
+ /// Format to use for localization and number formatting. Defaults to .
+#endif
+ /// String representation.
+ public string ToString(
+ HeatFluxUnit unit,
+#if WINDOWS_UWP
+ [CanBeNull] string cultureName)
+#else
+ [CanBeNull] IFormatProvider provider)
+#endif
+ {
+ return ToString(
+ unit,
+#if WINDOWS_UWP
+ cultureName,
+#else
+ provider,
+#endif
+ 2);
+ }
+
+ ///
+ /// Get string representation of value and unit.
+ ///
+ /// Unit representation to use.
+#if WINDOWS_UWP
+ /// Name of culture (ex: "en-US") to use for localization and number formatting. Defaults to 's default culture.
+#else
+ /// Format to use for localization and number formatting. Defaults to .
+#endif
+ /// The number of significant digits after the radix point.
+ /// String representation.
+ [UsedImplicitly]
+ public string ToString(
+ HeatFluxUnit unit,
+#if WINDOWS_UWP
+ [CanBeNull] string cultureName,
+#else
+ [CanBeNull] IFormatProvider provider,
+#endif
+ int significantDigitsAfterRadix)
+ {
+ double value = As(unit);
+ string format = UnitFormatter.GetFormat(value, significantDigitsAfterRadix);
+ return ToString(
+ unit,
+#if WINDOWS_UWP
+ cultureName,
+#else
+ provider,
+#endif
+ format);
+ }
+
+ ///
+ /// Get string representation of value and unit.
+ ///
+#if WINDOWS_UWP
+ /// Name of culture (ex: "en-US") to use for localization and number formatting. Defaults to 's default culture.
+#else
+ /// Format to use for localization and number formatting. Defaults to .
+#endif
+ /// Unit representation to use.
+ /// String format to use. Default: "{0:0.##} {1} for value and unit abbreviation respectively."
+ /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1.
+ /// String representation.
+ [UsedImplicitly]
+ public string ToString(
+ HeatFluxUnit unit,
+#if WINDOWS_UWP
+ [CanBeNull] string cultureName,
+#else
+ [CanBeNull] IFormatProvider provider,
+#endif
+ [NotNull] string format,
+ [NotNull] params object[] args)
+ {
+ if (format == null) throw new ArgumentNullException(nameof(format));
+ if (args == null) throw new ArgumentNullException(nameof(args));
+
+#if WINDOWS_UWP
+ // Windows Runtime Component does not support CultureInfo and IFormatProvider types, so we use culture name for public methods: https://msdn.microsoft.com/en-us/library/br230301.aspx
+ IFormatProvider provider = cultureName == null ? UnitSystem.DefaultCulture : new CultureInfo(cultureName);
+#else
+ provider = provider ?? UnitSystem.DefaultCulture;
+#endif
+
+ double value = As(unit);
+ object[] formatArgs = UnitFormatter.GetFormatArgs(unit, value, provider, args);
+ return string.Format(provider, format, formatArgs);
+ }
+
+ ///
+ /// Represents the largest possible value of HeatFlux
+ ///
+ public static HeatFlux MaxValue => new HeatFlux(double.MaxValue, BaseUnit);
+
+ ///
+ /// Represents the smallest possible value of HeatFlux
+ ///
+ public static HeatFlux MinValue => new HeatFlux(double.MinValue, BaseUnit);
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double AsBaseUnitWattsPerSquareMeter()
+ {
+ if (Unit == HeatFluxUnit.WattPerSquareMeter) { return _value; }
+
+ switch (Unit)
+ {
+ case HeatFluxUnit.BtuPerHourSquareFoot: return _value*3.15459075;
+ case HeatFluxUnit.BtuPerMinuteSquareFoot: return _value*1.89275445e2;
+ case HeatFluxUnit.BtuPerSecondSquareFoot: return _value*1.13565267e4;
+ case HeatFluxUnit.BtuPerSecondSquareInch: return _value*1.63533984e6;
+ case HeatFluxUnit.CaloriePerSecondSquareCentimeter: return _value*4.1868e4;
+ case HeatFluxUnit.CentiwattPerSquareMeter: return (_value) * 1e-2d;
+ case HeatFluxUnit.DeciwattPerSquareMeter: return (_value) * 1e-1d;
+ case HeatFluxUnit.KilocaloriePerHourSquareMeter: return _value*1.163;
+ case HeatFluxUnit.KilocaloriePerSecondSquareCentimeter: return (_value*4.1868e4) * 1e3d;
+ case HeatFluxUnit.KilowattPerSquareMeter: return (_value) * 1e3d;
+ case HeatFluxUnit.MicrowattPerSquareMeter: return (_value) * 1e-6d;
+ case HeatFluxUnit.MilliwattPerSquareMeter: return (_value) * 1e-3d;
+ case HeatFluxUnit.NanowattPerSquareMeter: return (_value) * 1e-9d;
+ case HeatFluxUnit.WattPerSquareFoot: return _value*1.07639e1;
+ case HeatFluxUnit.WattPerSquareInch: return _value*1.5500031e3;
+ case HeatFluxUnit.WattPerSquareMeter: return _value;
+ default:
+ throw new NotImplementedException("Unit not implemented: " + Unit);
+ }
+ }
+
+ /// Convenience method for working with internal numeric type.
+ private double AsBaseNumericType(HeatFluxUnit unit) => Convert.ToDouble(As(unit));
+ }
+}
diff --git a/UnitsNet/GeneratedCode/QuantityType.g.cs b/UnitsNet/GeneratedCode/QuantityType.g.cs
index 5f1af9ff1e..7103adcdb9 100644
--- a/UnitsNet/GeneratedCode/QuantityType.g.cs
+++ b/UnitsNet/GeneratedCode/QuantityType.g.cs
@@ -86,6 +86,7 @@ public enum QuantityType
ForceChangeRate,
ForcePerLength,
Frequency,
+ HeatFlux,
Illuminance,
Information,
Irradiance,
diff --git a/UnitsNet/GeneratedCode/UnitSystem.Default.g.cs b/UnitsNet/GeneratedCode/UnitSystem.Default.g.cs
index 4f27072774..06c9b46681 100644
--- a/UnitsNet/GeneratedCode/UnitSystem.Default.g.cs
+++ b/UnitsNet/GeneratedCode/UnitSystem.Default.g.cs
@@ -1731,6 +1731,90 @@ private static readonly ReadOnlyCollection DefaultLocalization
new AbbreviationsForCulture("en-US", "THz"),
}),
}),
+ new UnitLocalization(typeof (HeatFluxUnit),
+ new[]
+ {
+ new CulturesForEnumValue((int) HeatFluxUnit.BtuPerHourSquareFoot,
+ new[]
+ {
+ new AbbreviationsForCulture("en-US", "BTU/h·ft²"),
+ }),
+ new CulturesForEnumValue((int) HeatFluxUnit.BtuPerMinuteSquareFoot,
+ new[]
+ {
+ new AbbreviationsForCulture("en-US", "BTU/min·ft²"),
+ }),
+ new CulturesForEnumValue((int) HeatFluxUnit.BtuPerSecondSquareFoot,
+ new[]
+ {
+ new AbbreviationsForCulture("en-US", "BTU/s·ft²"),
+ }),
+ new CulturesForEnumValue((int) HeatFluxUnit.BtuPerSecondSquareInch,
+ new[]
+ {
+ new AbbreviationsForCulture("en-US", "BTU/s·in²"),
+ }),
+ new CulturesForEnumValue((int) HeatFluxUnit.CaloriePerSecondSquareCentimeter,
+ new[]
+ {
+ new AbbreviationsForCulture("en-US", "cal/s·cm²"),
+ }),
+ new CulturesForEnumValue((int) HeatFluxUnit.CentiwattPerSquareMeter,
+ new[]
+ {
+ new AbbreviationsForCulture("en-US", "cW/m²"),
+ }),
+ new CulturesForEnumValue((int) HeatFluxUnit.DeciwattPerSquareMeter,
+ new[]
+ {
+ new AbbreviationsForCulture("en-US", "dW/m²"),
+ }),
+ new CulturesForEnumValue((int) HeatFluxUnit.KilocaloriePerHourSquareMeter,
+ new[]
+ {
+ new AbbreviationsForCulture("en-US", "kcal/h·m²"),
+ }),
+ new CulturesForEnumValue((int) HeatFluxUnit.KilocaloriePerSecondSquareCentimeter,
+ new[]
+ {
+ new AbbreviationsForCulture("en-US", "kcal/s·cm²"),
+ }),
+ new CulturesForEnumValue((int) HeatFluxUnit.KilowattPerSquareMeter,
+ new[]
+ {
+ new AbbreviationsForCulture("en-US", "kW/m²"),
+ }),
+ new CulturesForEnumValue((int) HeatFluxUnit.MicrowattPerSquareMeter,
+ new[]
+ {
+ new AbbreviationsForCulture("en-US", "µW/m²"),
+ }),
+ new CulturesForEnumValue((int) HeatFluxUnit.MilliwattPerSquareMeter,
+ new[]
+ {
+ new AbbreviationsForCulture("en-US", "mW/m²"),
+ }),
+ new CulturesForEnumValue((int) HeatFluxUnit.NanowattPerSquareMeter,
+ new[]
+ {
+ new AbbreviationsForCulture("en-US", "nW/m²"),
+ }),
+ new CulturesForEnumValue((int) HeatFluxUnit.WattPerSquareFoot,
+ new[]
+ {
+ new AbbreviationsForCulture("en-US", "W/ft²"),
+ }),
+ new CulturesForEnumValue((int) HeatFluxUnit.WattPerSquareInch,
+ new[]
+ {
+ new AbbreviationsForCulture("en-US", "W/in²"),
+ }),
+ new CulturesForEnumValue((int) HeatFluxUnit.WattPerSquareMeter,
+ new[]
+ {
+ new AbbreviationsForCulture("en-US", "W/m²"),
+ }),
+ }),
new UnitLocalization(typeof (IlluminanceUnit),
new[]
{
diff --git a/UnitsNet/GeneratedCode/Units/HeatFluxUnit.g.cs b/UnitsNet/GeneratedCode/Units/HeatFluxUnit.g.cs
new file mode 100644
index 0000000000..7c131c0664
--- /dev/null
+++ b/UnitsNet/GeneratedCode/Units/HeatFluxUnit.g.cs
@@ -0,0 +1,62 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by \generate-code.bat.
+//
+// Changes to this file will be lost when the code is regenerated.
+// The build server regenerates the code before each build and a pre-build
+// step will regenerate the code on each local build.
+//
+// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
+//
+// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
+// Add Extensions\MyQuantityExtensions.cs to decorate quantities with new behavior.
+// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities.
+//
+//
+//------------------------------------------------------------------------------
+
+// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com).
+// https://github.com/angularsen/UnitsNet
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+// ReSharper disable once CheckNamespace
+namespace UnitsNet.Units
+{
+ public enum HeatFluxUnit
+ {
+ Undefined = 0,
+ BtuPerHourSquareFoot,
+ BtuPerMinuteSquareFoot,
+ BtuPerSecondSquareFoot,
+ BtuPerSecondSquareInch,
+ CaloriePerSecondSquareCentimeter,
+ CentiwattPerSquareMeter,
+ DeciwattPerSquareMeter,
+ KilocaloriePerHourSquareMeter,
+ KilocaloriePerSecondSquareCentimeter,
+ KilowattPerSquareMeter,
+ MicrowattPerSquareMeter,
+ MilliwattPerSquareMeter,
+ NanowattPerSquareMeter,
+ WattPerSquareFoot,
+ WattPerSquareInch,
+ WattPerSquareMeter,
+ }
+}
diff --git a/UnitsNet/UnitDefinitions/HeatFlux.json b/UnitsNet/UnitDefinitions/HeatFlux.json
new file mode 100644
index 0000000000..ef532cb0b0
--- /dev/null
+++ b/UnitsNet/UnitDefinitions/HeatFlux.json
@@ -0,0 +1,117 @@
+{
+ "Name": "HeatFlux",
+ "BaseUnit": "WattPerSquareMeter",
+ "XmlDoc": "Heat flux is the flow of energy per unit of area per unit of time",
+ "Units": [
+ {
+ "SingularName": "WattPerSquareMeter",
+ "PluralName": "WattsPerSquareMeter",
+ "FromUnitToBaseFunc": "x",
+ "FromBaseToUnitFunc": "x",
+ "Prefixes": [ "Nano", "Micro", "Milli", "Centi", "Deci", "Kilo" ],
+ "Localization": [
+ {
+ "Culture": "en-US",
+ "Abbreviations": [ "W/m²" ]
+ }
+ ]
+ },
+ {
+ "SingularName": "WattPerSquareInch",
+ "PluralName": "WattsPerSquareInch",
+ "FromUnitToBaseFunc": "x*1.5500031e3",
+ "FromBaseToUnitFunc": "x/1.5500031e3",
+ "Localization": [
+ {
+ "Culture": "en-US",
+ "Abbreviations": [ "W/in²" ]
+ }
+ ]
+ },
+ {
+ "SingularName": "WattPerSquareFoot",
+ "PluralName": "WattsPerSquareFoot",
+ "FromUnitToBaseFunc": "x*1.07639e1",
+ "FromBaseToUnitFunc": "x/1.07639e1",
+ "Localization": [
+ {
+ "Culture": "en-US",
+ "Abbreviations": [ "W/ft²" ]
+ }
+ ]
+ },
+ {
+ "SingularName": "BtuPerSecondSquareInch",
+ "PluralName": "BtusPerSecondSquareInch",
+ "FromUnitToBaseFunc": "x*1.63533984e6",
+ "FromBaseToUnitFunc": "x/1.63533984e6",
+ "Localization": [
+ {
+ "Culture": "en-US",
+ "Abbreviations": [ "BTU/s·in²" ]
+ }
+ ]
+ },
+ {
+ "SingularName": "BtuPerSecondSquareFoot",
+ "PluralName": "BtusPerSecondSquareFoot",
+ "FromUnitToBaseFunc": "x*1.13565267e4",
+ "FromBaseToUnitFunc": "x/1.13565267e4",
+ "Localization": [
+ {
+ "Culture": "en-US",
+ "Abbreviations": [ "BTU/s·ft²" ]
+ }
+ ]
+ },
+ {
+ "SingularName": "BtuPerMinuteSquareFoot",
+ "PluralName": "BtusPerMinuteSquareFoot",
+ "FromUnitToBaseFunc": "x*1.89275445e2",
+ "FromBaseToUnitFunc": "x/1.89275445e2",
+ "Localization": [
+ {
+ "Culture": "en-US",
+ "Abbreviations": [ "BTU/min·ft²" ]
+ }
+ ]
+ },
+ {
+ "SingularName": "BtuPerHourSquareFoot",
+ "PluralName": "BtusPerHourSquareFoot",
+ "FromUnitToBaseFunc": "x*3.15459075",
+ "FromBaseToUnitFunc": "x/3.15459075",
+ "Localization": [
+ {
+ "Culture": "en-US",
+ "Abbreviations": [ "BTU/h·ft²" ]
+ }
+ ]
+ },
+ {
+ "SingularName": "CaloriePerSecondSquareCentimeter",
+ "PluralName": "CaloriesPerSecondSquareCentimeter",
+ "FromUnitToBaseFunc": "x*4.1868e4",
+ "FromBaseToUnitFunc": "x/4.1868e4",
+ "Prefixes": [ "Kilo" ],
+ "Localization": [
+ {
+ "Culture": "en-US",
+ "Abbreviations": [ "cal/s·cm²" ]
+ }
+ ]
+ },
+ {
+ "SingularName": "KilocaloriePerHourSquareMeter",
+ "PluralName": "KilocaloriesPerHourSquareMeter",
+ "FromUnitToBaseFunc": "x*1.163",
+ "FromBaseToUnitFunc": "x/1.163",
+ "Localization": [
+ {
+ "Culture": "en-US",
+ "Abbreviations": [ "kcal/h·m²" ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file