From e104629b525fefa5c3430e0aec4cd4ff8d00c727 Mon Sep 17 00:00:00 2001 From: Amanda Ghassaei <amandaghassaei@gmail.com> Date: Thu, 13 Aug 2015 17:01:19 -0400 Subject: [PATCH] eod --- js/cam/assemblers/Assembler.js | 9 ++++++--- js/menus/AssemblerSetupMenuView.js | 5 +++++ js/menus/templates/AssemblerSetupMenuView.html | 14 +++++++------- js/plists/CamPList.js | 2 +- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/js/cam/assemblers/Assembler.js b/js/cam/assemblers/Assembler.js index 21ec4fca..a7194e66 100644 --- a/js/cam/assemblers/Assembler.js +++ b/js/cam/assemblers/Assembler.js @@ -12,6 +12,9 @@ define(['underscore', 'appState', 'lattice', 'stlLoader', 'threeModel', 'cam', ' this.id = id; this.components = {}; + this.rotation = json.rotation; + this.translation = json.translation; + this.scale = json.scale; this.object3D = new THREE.Object3D(); three.sceneAdd(this.object3D); @@ -300,9 +303,9 @@ define(['underscore', 'appState', 'lattice', 'stlLoader', 'threeModel', 'cam', ' }); return { components: componentsJSON, - translation: this.object3D.position, - scale: this.object3D.scale.x, - rotation: this.object3D.rotation + translation: this.translation, + scale: this.scale, + rotation: this.rotation } }; diff --git a/js/menus/AssemblerSetupMenuView.js b/js/menus/AssemblerSetupMenuView.js index 7aeacfed..f3cad955 100644 --- a/js/menus/AssemblerSetupMenuView.js +++ b/js/menus/AssemblerSetupMenuView.js @@ -17,6 +17,11 @@ define(['jquery', 'underscore', 'menuParent', 'camPlist', 'cam', 'text!assembler }, + getPropertyOwner: function($target){ + if ($target.hasClass("assembler")) return cam.get("assembler"); + return null; + }, + _editMachineComponent: function(e){ e.preventDefault(); cam.set("editingComponent", $(e.target).data("id")); diff --git a/js/menus/templates/AssemblerSetupMenuView.html b/js/menus/templates/AssemblerSetupMenuView.html index 944d3ff2..d4d1668e 100644 --- a/js/menus/templates/AssemblerSetupMenuView.html +++ b/js/menus/templates/AssemblerSetupMenuView.html @@ -4,14 +4,14 @@ Parent/Child Tree:<br/> <% }); %><br/> <a href="#" id="newMachineComponent" class=" btn btn-block btn-lg btn-default">+ New Machine Component</a><br/> Offset (xyz): - <input data-property="translation" data-key="x" value="<%= translation.x %>" placeholder="X" class="form-control floatInput component" type="text"> - <input data-property="translation" data-key="y" value="<%= translation.y %>" placeholder="Y" class="form-control floatInput component" type="text"> - <input data-property="translation" data-key="z" value="<%= translation.z %>" placeholder="Z" class="form-control floatInput component" type="text"><br/><br/> + <input data-property="translation" data-key="x" value="<%= translation.x %>" placeholder="X" class="form-control floatInput assembler" type="text"> + <input data-property="translation" data-key="y" value="<%= translation.y %>" placeholder="Y" class="form-control floatInput assembler" type="text"> + <input data-property="translation" data-key="z" value="<%= translation.z %>" placeholder="Z" class="form-control floatInput assembler" type="text"><br/><br/> Rotation (xyz): - <input data-property="rotation" data-key="x" value="<%= rotation.x %>" placeholder="X" class="form-control floatInput component" type="text"> - <input data-property="rotation" data-key="y" value="<%= rotation.y %>" placeholder="Y" class="form-control floatInput component" type="text"> - <input data-property="rotation" data-key="z" value="<%= rotation.z %>" placeholder="Z" class="form-control floatInput component" type="text"><br/><br/> -Scale: <input data-property="scale" value="<%= scale %>" placeholder="Scale" class="form-control floatInput component" type="text"><br/><br/> + <input data-property="rotation" data-key="x" value="<%= rotation.x %>" placeholder="X" class="form-control floatInput assembler" type="text"> + <input data-property="rotation" data-key="y" value="<%= rotation.y %>" placeholder="Y" class="form-control floatInput assembler" type="text"> + <input data-property="rotation" data-key="z" value="<%= rotation.z %>" placeholder="Z" class="form-control floatInput assembler" type="text"><br/><br/> +Scale: <input data-property="scale" value="<%= scale %>" placeholder="Scale" class="form-control floatInput assembler" type="text"><br/><br/> Edit Code:<br/><br/> Header <a class="editMachineCode" href="#">Edit</a><br/> Go Home <a class="editMachineCode" href="#">Edit</a><br/> diff --git a/js/plists/CamPList.js b/js/plists/CamPList.js index 5da2da88..4ac2fec9 100644 --- a/js/plists/CamPList.js +++ b/js/plists/CamPList.js @@ -100,7 +100,7 @@ define([], function(){ }, substrate: { name: "Substrate", - isLinear: true, + isLinear: false, axisOfMotion: null, //minBound //maxBound -- GitLab