UNPKG

@hpcc-js/comms

Version:
76 lines 2.79 kB
import { __assign, __extends } from "tslib"; import { espTime2Seconds, StateObject } from "@hpcc-js/util"; import { WorkunitsService } from "../services/wsWorkunits"; var Timer = /** @class */ (function (_super) { __extends(Timer, _super); function Timer(optsConnection, wuid, eclTimer) { var _this = _super.call(this) || this; if (optsConnection instanceof WorkunitsService) { _this.connection = optsConnection; } else { _this.connection = new WorkunitsService(optsConnection); } var secs = espTime2Seconds(eclTimer.Value); _this.set(__assign({ Wuid: wuid, Seconds: Math.round(secs * 1000) / 1000, HasSubGraphId: eclTimer.SubGraphId !== undefined }, eclTimer)); return _this; } Object.defineProperty(Timer.prototype, "properties", { get: function () { return this.get(); }, enumerable: false, configurable: true }); Object.defineProperty(Timer.prototype, "Wuid", { get: function () { return this.get("Wuid"); }, enumerable: false, configurable: true }); Object.defineProperty(Timer.prototype, "Name", { get: function () { return this.get("Name"); }, enumerable: false, configurable: true }); Object.defineProperty(Timer.prototype, "Value", { get: function () { return this.get("Value"); }, enumerable: false, configurable: true }); Object.defineProperty(Timer.prototype, "Seconds", { get: function () { return this.get("Seconds"); }, enumerable: false, configurable: true }); Object.defineProperty(Timer.prototype, "GraphName", { get: function () { return this.get("GraphName"); }, enumerable: false, configurable: true }); Object.defineProperty(Timer.prototype, "SubGraphId", { get: function () { return this.get("SubGraphId"); }, enumerable: false, configurable: true }); Object.defineProperty(Timer.prototype, "HasSubGraphId", { get: function () { return this.get("HasSubGraphId"); }, enumerable: false, configurable: true }); Object.defineProperty(Timer.prototype, "count", { get: function () { return this.get("count"); }, enumerable: false, configurable: true }); Object.defineProperty(Timer.prototype, "Timestamp", { get: function () { return this.get("Timestamp"); }, enumerable: false, configurable: true }); Object.defineProperty(Timer.prototype, "When", { get: function () { return this.get("When"); }, enumerable: false, configurable: true }); return Timer; }(StateObject)); export { Timer }; //# sourceMappingURL=timer.js.map