-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add illuminance units * Fix description * Format + adapted code style --------- Co-authored-by: Dennis Geldhof <[email protected]> Co-authored-by: Damiano Ferrari <[email protected]>
- Loading branch information
1 parent
dfffa5f
commit 7ea883b
Showing
7 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ enum PROPERTY { | |
energy, | ||
force, | ||
fuelConsumption, | ||
illuminance, | ||
length, | ||
mass, | ||
molarmass, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import 'package:units_converter/models/conversion_node.dart'; | ||
import 'package:units_converter/models/double_property.dart'; | ||
import 'package:units_converter/models/property.dart'; | ||
import 'package:units_converter/models/unit.dart'; | ||
|
||
enum ILLUMINANCE { | ||
lux, | ||
footCandle, | ||
} | ||
|
||
class Illuminance extends DoubleProperty<ILLUMINANCE> { | ||
///Class for light conversions, e.g. if you want to convert 1 lux in to foot-candle: | ||
///```dart | ||
///var illuminance = Illuminance(removeTrailingZeros: false); | ||
///illuminance.convert(Unit(ILLUMINANCE.lux, value: 1)); | ||
///print(illuminance.footCandle); | ||
/// ``` | ||
Illuminance( | ||
{super.significantFigures, | ||
super.removeTrailingZeros, | ||
super.useScientificNotation, | ||
name}) | ||
: super( | ||
name: name ?? PROPERTY.illuminance, | ||
mapSymbols: { | ||
ILLUMINANCE.lux: 'lx', | ||
ILLUMINANCE.footCandle: 'fc', | ||
}, | ||
conversionTree: ConversionNode(name: ILLUMINANCE.lux, leafNodes: [ | ||
ConversionNode( | ||
coefficientProduct: 10.763910416709722, | ||
name: ILLUMINANCE.footCandle, | ||
), | ||
])); | ||
|
||
Unit get lux => getUnit(ILLUMINANCE.lux); | ||
Unit get footCandle => getUnit(ILLUMINANCE.footCandle); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters