UNPKG

zowe-cli-cics-deploy-plugin

Version:

IBM CICS Bundle generation and deployment for Zowe CLI

48 lines 1.75 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SubtaskWithStatus = void 0; /* * This program and the accompanying materials are made available under the terms of the * Eclipse Public License v2.0 which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-v20.html * * SPDX-License-Identifier: EPL-2.0 * * Copyright IBM Corp, 2019 * */ const imperative_1 = require("@zowe/imperative"); class SubtaskWithStatus { constructor(parent, ticks) { this.parent = parent; this.ticks = ticks; this.percentCompleteInternal = 0; if (this.ticks < 0 || this.ticks > imperative_1.TaskProgress.ONE_HUNDRED_PERCENT) { throw new imperative_1.ImperativeError({ msg: "Ticks must be between 0 and 100" }); } } set statusMessage(statusMessage) { this.parent.statusMessage = statusMessage; } get statusMessage() { return this.parent.statusMessage; } set stageName(stageName) { if (stageName !== imperative_1.TaskStage.COMPLETE && stageName !== imperative_1.TaskStage.NOT_STARTED) { this.parent.stageName = stageName; } } get stageName() { return this.parent.stageName; } set percentComplete(percentComplete) { const delta = percentComplete - this.percentCompleteInternal; this.percentCompleteInternal = percentComplete; this.parent.percentComplete = this.parent.percentComplete + delta * (this.ticks / imperative_1.TaskProgress.ONE_HUNDRED_PERCENT); } get percentComplete() { return this.percentCompleteInternal; } } exports.SubtaskWithStatus = SubtaskWithStatus; //# sourceMappingURL=SubtaskWithStatus.js.map