-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding test and cleanup on enum. * ax25 tests * assert var fix. * Broke conversions out into their own class. _nmea_getlatlon function now fully tested. * Adding more tests. * Adding more tests. * Package upgrades Fixing nodejs
- Loading branch information
Showing
29 changed files
with
645 additions
and
240 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
bail: true | ||
spec: 'test/**/*.test.ts' | ||
require: | ||
- ts-node/register | ||
- source-map-support/register | ||
full-trace: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const enum ConversionConstantEnum { | ||
KNOT_TO_KMH = 1.852 // nautical miles per hour to kilometers per hour | ||
, MPH_TO_KMH = 1.609344 // miles per hour to kilometers per hour | ||
, KMH_TO_MS = 10 / 36 // kilometers per hour to meters per second | ||
, MPH_TO_MS = MPH_TO_KMH * KMH_TO_MS // miles per hour to meters per second | ||
, HINCH_TO_MM = 0.254 // hundredths of an inch to millimeters | ||
, FEET_TO_METERS = 0.3048 | ||
} | ||
|
||
export default ConversionConstantEnum; |
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,43 @@ | ||
export default class ConversionUtil { | ||
/** | ||
* Utility method to replace perl's Date-Calc check_date method. | ||
* Given the year, month, and day, this checks to see if it it's a valid date. | ||
* | ||
* @param {Number} year year for the date | ||
* @param {Number} month month for the date | ||
* @param {Number} day day for the date | ||
* @returns {boolean} Whether or not the given date is valid | ||
*/ | ||
static CheckDate = function (year: number, month: number, day: number): boolean { | ||
var d = new Date(year, month, day); | ||
|
||
return d.getFullYear() === year && d.getMonth() === month && d.getDate() === day; | ||
} | ||
|
||
/** | ||
* Converts Degress to Radians | ||
* @param {number} deg | ||
* @returns {number} Degrees converted to Radians | ||
*/ | ||
static DegToRad(deg: number): number { | ||
return deg * (Math.PI / 180); | ||
} | ||
|
||
/** | ||
* Converts Radians to Degress | ||
* @param {number} rad | ||
* @returns {number} Radians converted to Degrees | ||
*/ | ||
static RadToDeg(rad: number): number { | ||
return rad * (180 / Math.PI); | ||
} | ||
|
||
/** | ||
* Converts Degrees Fahrenheit to Celsius | ||
* @param {number} degF Degrees in Fahrenheit | ||
* @returns {number} Degrees in Celsius | ||
*/ | ||
static FahrenheitToCelsius(degF: number): number { | ||
return (degF - 32) / 1.8; | ||
} | ||
} |
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
Oops, something went wrong.