Add the beginnings of the move_to feature

This commit is contained in:
mmcwilliams 2018-02-01 14:53:46 -05:00
parent 89cf41b02c
commit 62eb54ce49
1 changed files with 27 additions and 1 deletions

View File

@ -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;