UNPKG

@iotile/iotile-device

Version:

A typescript library for interfacing with IOTile BLE devices

28 lines 749 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); class ShockInfo { constructor(peakVal, peakAxis, duration, dVx, dVy, dVz) { this.peakAxis = peakAxis; this.peakVal = peakVal * 0.049; this.duration = duration; this.dVx = dVx / 65536.0; this.dVy = dVy / 65536.0; this.dVz = dVz / 65536.0; } get axis() { let axisMap = { 0: 'X', 1: 'Y', 2: 'Z' }; return axisMap[this.peakAxis]; } get largestDeltaV() { let max = Math.max(Math.abs(this.dVx), Math.abs(this.dVy), Math.abs(this.dVz)); return max * 39.3701; } } exports.ShockInfo = ShockInfo; ; ; //# sourceMappingURL=types.js.map