Skip to content

Commit 6778b39

Browse files
author
efortin76
committed
Added Luminosity Quantity.
DO NOT CURRENTLY COMPILE!
1 parent 4b9a40e commit 6778b39

File tree

22 files changed

+2553
-65
lines changed

22 files changed

+2553
-65
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"Name": "Luminosity",
3+
"BaseUnit": "Watt",
4+
"BaseType": "double",
5+
"XmlDoc": "Luminosity is an absolute measure of radiated electromagnetic power (light), the radiant power emitted by a light-emitting object.",
6+
"XmlDocRemarks": "https://en.wikipedia.org/wiki/Luminosity",
7+
"BaseDimensions": {
8+
"L": 2,
9+
"M": 1,
10+
"T": -3
11+
},
12+
"Units": [
13+
{
14+
"SingularName": "Watt",
15+
"PluralName": "Watts",
16+
"FromUnitToBaseFunc": "x",
17+
"FromBaseToUnitFunc": "x",
18+
"Prefixes": [ "Femto", "Pico", "Nano", "Micro", "Milli", "Deci", "Deca", "Kilo", "Mega", "Giga", "Tera", "Peta" ],
19+
"Localization": [
20+
{
21+
"Culture": "en-US",
22+
"Abbreviations": [ "W" ]
23+
}
24+
]
25+
},
26+
{
27+
"SingularName": "SolarLuminosity",
28+
"PluralName": "SolarLuminosities",
29+
"FromUnitToBaseFunc": "x * 3.828e26",
30+
"FromBaseToUnitFunc": "x / 3.828e26",
31+
"Localization": [
32+
{
33+
"Culture": "en-US",
34+
"Abbreviations": [ "L⊙" ]
35+
}
36+
]
37+
}
38+
]
39+
}

Common/UnitDefinitions/Power.json

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,6 @@
9494
"Abbreviations": [ "Btu/hr" ]
9595
}
9696
]
97-
},
98-
{
99-
"SingularName": "SolarLuminosity",
100-
"PluralName": "SolarLuminosities",
101-
"FromUnitToBaseFunc": "x * 3.828e26m",
102-
"FromBaseToUnitFunc": "x / 3.828e26m",
103-
"Localization": [
104-
{
105-
"Culture": "en-US",
106-
"Abbreviations": [ "sl" ]
107-
}
108-
]
10997
}
11098
]
11199
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"Name": "Luminosity",
3+
"BaseUnit": "Watt",
4+
"BaseType": "double",
5+
"XmlDoc": "Luminosity is an absolute measure of radiated electromagnetic power (light), the radiant power emitted by a light-emitting object.",
6+
"XmlDocRemarks": "https://en.wikipedia.org/wiki/Luminosity",
7+
"BaseDimensions": {
8+
"L": 2,
9+
"M": 1,
10+
"T": -3
11+
},
12+
"Units": [
13+
{
14+
"SingularName": "Watt",
15+
"PluralName": "Watts",
16+
"FromUnitToBaseFunc": "x",
17+
"FromBaseToUnitFunc": "x",
18+
"Prefixes": [ "Femto", "Pico", "Nano", "Micro", "Milli", "Deci", "Deca", "Kilo", "Mega", "Giga", "Tera", "Peta" ],
19+
"Localization": [
20+
{
21+
"Culture": "en-US",
22+
"Abbreviations": [ "W" ]
23+
}
24+
]
25+
},
26+
{
27+
"SingularName": "SolarLuminosity",
28+
"PluralName": "Watts",
29+
"FromUnitToBaseFunc": "x * 3.828e26",
30+
"FromBaseToUnitFunc": "x / 3.828e26",
31+
"Localization": [
32+
{
33+
"Culture": "en-US",
34+
"Abbreviations": [ "L⊙" ]
35+
}
36+
]
37+
}
38+
]
39+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// This code was generated by \generate-code.bat.
4+
//
5+
// Changes to this file will be lost when the code is regenerated.
6+
// The build server regenerates the code before each build and a pre-build
7+
// step will regenerate the code on each local build.
8+
//
9+
// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
10+
//
11+
// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
12+
// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities.
13+
//
14+
// </auto-generated>
15+
//------------------------------------------------------------------------------
16+
17+
// Licensed under MIT No Attribution, see LICENSE file at the root.
18+
// Copyright 2013 Andreas Gullberg Larsen ([email protected]). Maintained at https://github.com/angularsen/UnitsNet.
19+
20+
using System;
21+
22+
namespace UnitsNet.Tests.CustomCode
23+
{
24+
public class LuminosityTests : LuminosityTestsBase
25+
{
26+
// Override properties in base class here
27+
protected override double FemtowattsInOneWatt => 1e15;
28+
29+
protected override double PicowattsInOneWatt => 1e12;
30+
31+
protected override double NanowattsInOneWatt => 1e9;
32+
33+
protected override double MicrowattsInOneWatt => 1e6;
34+
35+
protected override double MilliwattsInOneWatt => 1e3;
36+
37+
protected override double DeciwattsInOneWatt => 1e1;
38+
39+
protected override double WattsInOneWatt => 1;
40+
41+
protected override double DecawattsInOneWatt => 1e-1;
42+
43+
protected override double KilowattsInOneWatt => 1e-3;
44+
45+
protected override double MegawattsInOneWatt => 1e-6;
46+
47+
protected override double GigawattsInOneWatt => 1e-9;
48+
49+
protected override double TerawattsInOneWatt => 1e-12;
50+
51+
protected override double PetawattsInOneWatt => 1e-15;
52+
}
53+
}

UnitsNet.Tests/CustomCode/PowerTests.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ public class PowerTests : PowerTestsBase
4848

4949
protected override double MetricHorsepowerInOneWatt => 0.00135962161730390432342679032425;
5050

51-
protected override double SolarLuminositiesInOneWatt => 1.0 / 3.828e26;
52-
53-
protected override double SolarLuminositiesTolerance => 0.1;
54-
5551
[Fact]
5652
public void DurationTimesPowerEqualsEnergy()
5753
{

0 commit comments

Comments
 (0)