From a98232ec3875a4da3ab015885ae0eca93d0a0f51 Mon Sep 17 00:00:00 2001 From: Amanda Ghassaei <amandaghassaei@gmail.com> Date: Fri, 21 Aug 2015 00:08:16 -0400 Subject: [PATCH] slider bug --- js/cam/Cam.js | 2 +- js/cam/assemblers/Assembler.js | 4 +++- js/menus/AnimationMenuView.js | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/js/cam/Cam.js b/js/cam/Cam.js index 76650eac..a874d08c 100644 --- a/js/cam/Cam.js +++ b/js/cam/Cam.js @@ -40,7 +40,7 @@ define(['underscore', 'three', 'backbone', 'appState', 'latticeCAM', 'threeModel feedRate:{xy: 0.1, z: 0.1},//speed when heading towards assembly simLineNumber: 0,//used for stock simulation, reading through gcode - simSpeed: 4,//#X times real speed + simSpeed: 16,//#X times real speed allCAMMaterialTypes: []//all types of stock needed }, diff --git a/js/cam/assemblers/Assembler.js b/js/cam/assemblers/Assembler.js index d65fc62a..4bc3e4d1 100644 --- a/js/cam/assemblers/Assembler.js +++ b/js/cam/assemblers/Assembler.js @@ -237,7 +237,6 @@ define(['underscore', 'appState', 'lattice', 'stlLoader', 'threeModel', 'cam', ' callback(); } - console.log(position); var startingPos = this.components.xAxis.getPosition().add(this.components.yAxis.getPosition().add(this.components.zAxis.getPosition()));//this.components.zAxis.getAbsolutePosition();//get position of end effector speed = this._normalizeSpeed(startingPos, position, new THREE.Vector3(speed, speed, speed));//todo fix this @@ -329,6 +328,9 @@ define(['underscore', 'appState', 'lattice', 'stlLoader', 'threeModel', 'cam', ' stock: stockJSON, tree: this.tree || this.buildComponentTree() }); + json.customPost = { + + }; return json; }; diff --git a/js/menus/AnimationMenuView.js b/js/menus/AnimationMenuView.js index ff3f9589..aeba19e6 100644 --- a/js/menus/AnimationMenuView.js +++ b/js/menus/AnimationMenuView.js @@ -68,7 +68,9 @@ define(['jquery', 'underscore', 'menuParent', 'cam', 'text!animationMenuTemplate _changeSpeedSlider: function(e){ e.preventDefault(); - cam.set("simSpeed", Math.pow(2,$(e.target)[0].value)); + var val = $(e.target)[0].value; + if (val === undefined || val === null) return; + cam.set("simSpeed", Math.pow(2,val)); }, _drawGcodeHighlighter: function(){ -- GitLab