From e1974de8d81cd8eefd1929c42b39165bc1adc5c1 Mon Sep 17 00:00:00 2001
From: Amanda Ghassaei <amandaghassaei@gmail.com>
Date: Thu, 26 Mar 2015 02:42:37 -0400
Subject: [PATCH] eod

---
 js/cam/Assembler.js        | 4 +++-
 js/menus/CamMenuView.js    | 4 ++++
 js/threeViews/ThreeView.js | 2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/js/cam/Assembler.js b/js/cam/Assembler.js
index adf2320b..f98c8589 100644
--- a/js/cam/Assembler.js
+++ b/js/cam/Assembler.js
@@ -25,6 +25,7 @@ Assembler = Backbone.Model.extend({
         stock: null,
         stockPosition: new THREE.Vector3(20,0,0),//in abs coordinates
         stockPositionRelative: true,
+        stockFixed: false,//stock is fixed position from origin
         multipleStockPositions: false,
         stockArraySize: {x:4, y:4},
         stockSeparation: 2.78388,
@@ -93,6 +94,7 @@ Assembler = Backbone.Model.extend({
         } else if (machineName == "oneBitBot"){
             this.set("machine", new OneBitBot());
             this.set("camProcess", "gcode");
+            this.set("stockFixed", true);
         } else console.warn("selected machine not recognized");
     },
 
@@ -164,7 +166,7 @@ Assembler = Backbone.Model.extend({
     _moveOrigin: function(){
         var position = this.get("originPosition");
         this.get("origin").position.set(position.x, position.y, position.z);
-        if (this.get("stockPositionRelative")) this._updateStockPosToOrigin(position);
+        if (this.get("stockFixed")) this._updateStockPosToOrigin(position);
         dmaGlobals.three.render();
         if (this.get("machine").setMachinePosition) this.get("machine").setMachinePosition();
     },
diff --git a/js/menus/CamMenuView.js b/js/menus/CamMenuView.js
index d52545b0..01933cf3 100644
--- a/js/menus/CamMenuView.js
+++ b/js/menus/CamMenuView.js
@@ -176,6 +176,10 @@ CamMenuView = Backbone.View.extend({
             <input id="stockPosRel" data-property="stockPositionRelative" type="checkbox" <% if (stockPositionRelative){ %> checked="checked"<% } %> value="" data-toggle="checkbox" class="custom-checkbox">\
             <span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span>\
             Stock position relative to Origin</label>\
+            <label class="checkbox" for="stockFixed">\
+            <input id="stockFixed" data-property="stockFixed" type="checkbox" <% if (stockFixed){ %> checked="checked"<% } %> value="" data-toggle="checkbox" class="custom-checkbox">\
+            <span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span>\
+            Fix stock to to Origin</label>\
             <label class="checkbox" for="multipleStockPositions">\
             <input id="multipleStockPositions" data-property="multipleStockPositions" type="checkbox" <% if (multipleStockPositions){ %> checked="checked"<% } %> value="" data-toggle="checkbox" class="custom-checkbox">\
             <span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span>\
diff --git a/js/threeViews/ThreeView.js b/js/threeViews/ThreeView.js
index 82f58e1e..fd0b4a6f 100644
--- a/js/threeViews/ThreeView.js
+++ b/js/threeViews/ThreeView.js
@@ -86,7 +86,7 @@ ThreeView = Backbone.View.extend({
 
     _mouseMoved: function(e){
 
-        if (!dmaGlobals.appState.get("highlightMode")) return;
+        if (!dmaGlobals.appState.get("highlightMode") && !(dmaGlobals.appState.get("manualSelectOrigin"))) return;
 
         if (this.mouseIsDown && !this.controls.noRotate) {//in the middle of a camera move
             this.highlighter.setNothingHighlighted();
-- 
GitLab