UNPKG

@scalenc/nc-format

Version:

Library for handling TRUMPF NC file format.

27 lines 1.11 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.State = void 0; const Constants_1 = require("./Constants"); const MotionMode_1 = require("./MotionMode"); const Transformation_1 = require("./Transformation"); const Variables_1 = require("./Variables"); class State { machine; variables = new Variables_1.Variables(); absolute = true; metric = true; motionMode; transformation; constructor(machine) { this.machine = machine; this.motionMode = machine.initialMotionMode; this.transformation = new Transformation_1.Transformation(machine); } getVelocityInMetersPerSecond() { const variableName = this.motionMode === MotionMode_1.MotionMode.QUICK ? Constants_1.Constants.VELOCITY_QUICK : Constants_1.Constants.VELOCITY; const velocity = this.variables.getNumberOrDefault(variableName); // [mm/min] or [in/min] return (this.metric ? velocity : velocity * Constants_1.Constants.INCH_TO_MM) * Constants_1.Constants.MM_PER_MIN_TO_M_PER_S; } } exports.State = State; //# sourceMappingURL=State.js.map