InitialForce/UnitsNet — pull request #45 by bretthysuik (2014-11-04 21:35:17+00:00)
Title: Feature: Added support for generating logarithmic units

- "Logarithmic" and "LogarithmicScalingFactor" objects are used in the json file to indicate the unit is logarithmic. These objects are optional and assumed to be false if not specified.
- Added a separate PowerShell script to generate the logarithmic arithmetic operator source code and logarithmic arithmetic operator unit test source code.
- This lays the groundwork for being able to auto-generate logarithmic units like any other unit. For example, it should be possible to auto-generate a decibel unit as well as any sub-unit specified [here](http://en.wikipedia.org/wiki/Decibel#Suffixes_and_reference_values) using this code. I've tested it on voltage ratio--as seen below with units of dBV, dBmV, dBuV-- and power ratio and it works nicely.
- I'm adding this feature so that I can next implement `Level` (with units of decibels), `ElectricPotentialRatio`, and `PowerRatio`. I'm not sure if you want these units in your library however, since they're specialty units related to RF, electronics, and audio engineering (this is the area I work in which is why I'd like to add them).

----------

Example:
```json
{
"Name": "ElectricPotentialRatio",
"BaseUnit": "DecibelVolt",
"Logarithmic" : "True",
"LogarithmicScalingFactor" : "2",
"XmlDoc": "The strength of a signal expressed in decibels (dB) relative to one volt RMS.",
"Units": [
{
"SingularName": "DecibelVolt",
"PluralName": "DecibelVolts",
"FromUnitToBaseFunc": "x",
"FromBaseToUnitFunc": "x",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": ["dBV"]
}
]
},
{
"SingularName": "DecibelMicrovolt",
"PluralName": "DecibelMicrovolts",
"FromUnitToBaseFunc": "x - 120",
"FromBaseToUnitFunc": "x + 120",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": ["dBµV"]
}
]
},
{
"SingularName": "DecibelMillivolt",
"PluralName": "DecibelMillivolts",
"FromUnitToBaseFunc": "x - 60",
"FromBaseToUnitFunc": "x + 60",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": ["dBmV"]
}
]
}
]
}
```