From 62eb54ce49842c7debcd6de6bb4e89cdd7235830 Mon Sep 17 00:00:00 2001 From: mmcwilliams Date: Thu, 1 Feb 2018 14:53:46 -0500 Subject: [PATCH] Add the beginnings of the move_to feature --- app/lib/ui/cmd.js | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/app/lib/ui/cmd.js b/app/lib/ui/cmd.js index 9996bbf..6c854b9 100644 --- a/app/lib/ui/cmd.js +++ b/app/lib/ui/cmd.js @@ -1,4 +1,4 @@ -var cmd = {}; +const cmd = {}; cmd.proj_forward = function (callback) { 'use strict'; @@ -159,4 +159,30 @@ cmd.black_backward = function (callback) { } }; +cmd.cam_to = function (t) { + const val = parseInt(t.value) + let proceed = false + let total + if (val !== mcopy.state.camera.pos) { + if (val < mcopy.state.camera.pos) { + total = mcopy.state.camera.pos - val + } else if (val > mcopy.state.camera.pos) { + total = val - mcopy.state.camera.pos + } + } + +}; +cmd.proj_to = function (t) { + const val = parseInt(t.value) + let proceed = false + let total + if (val !== mcopy.state.projector.pos) { + if (val < mcopy.state.projector.pos) { + total = mcopy.state.projector.pos - val + } else if (val > mcopy.state.projector.pos) { + total = val - mcopy.state.projector.pos + } + } +} + module.exports = cmd; \ No newline at end of file