From 3734e0cd9992348a320c4f11e37ce26711cc8571 Mon Sep 17 00:00:00 2001
From: Amanda Ghassaei <amandaghassaei@gmail.com>
Date: Wed, 12 Aug 2015 18:36:57 -0400
Subject: [PATCH] button switch

---
 js/menus/EditComponentMenuView.js             |  6 --
 js/menus/templates/CompositeMenuView.html     |  4 +-
 js/menus/templates/EditComponentMenuView.html |  5 +-
 .../templates/MaterialEditorMenuView.html     |  4 +-
 js/plists/CamPList.js                         | 81 ++++++++++++++++++-
 5 files changed, 85 insertions(+), 15 deletions(-)

diff --git a/js/menus/EditComponentMenuView.js b/js/menus/EditComponentMenuView.js
index c1211846..ddd2153b 100644
--- a/js/menus/EditComponentMenuView.js
+++ b/js/menus/EditComponentMenuView.js
@@ -12,7 +12,6 @@ define(['jquery', 'underscore', 'menuParent', 'plist', 'cam', 'text!editComponen
             "click #finishComponent":                                 "_save",
             "click #cancelComponent":                                 "_cancel",
             "click #deleteComponent":                                 "_delete",
-            "click #saveComponent":                                   "_saveToFile",
             "click .removeChild":                                     "_removeChild"
         },
 
@@ -36,11 +35,6 @@ define(['jquery', 'underscore', 'menuParent', 'plist', 'cam', 'text!editComponen
             this._stopEditing();
         },
 
-        _saveToFile: function(e){
-            e.preventDefault();
-            console.log("save component to file");
-        },
-
         _stopEditing: function(){
             cam.set("editingComponent", null);
             this.model.set("currentNav", "navAssemble");
diff --git a/js/menus/templates/CompositeMenuView.html b/js/menus/templates/CompositeMenuView.html
index b0acb80f..11219b1d 100644
--- a/js/menus/templates/CompositeMenuView.html
+++ b/js/menus/templates/CompositeMenuView.html
@@ -35,6 +35,6 @@ Available Materials:<br/>
     </label>
 <% }); %><br/>
 <a id="finishComposite" href="#" class="btn btn-block btn-lg btn-success">Save Composite</a><br/>
-<a id="cancelComposite" href="#" class="btn btn-halfWidth btn-lg btn-default">Cancel / Exit</a>
-<a id="deleteComposite" href="#" class="btn btn-halfWidth pull-right btn-lg btn-default"><span class="fui-trash"></span> Delete</a><br/><br/>
+<a id="deleteComposite" href="#" class="btn btn-halfWidth btn-lg btn-default"><span class="fui-trash"></span> Delete</a>
+<a id="cancelComposite" href="#" class="btn btn-halfWidth pull-right btn-lg btn-default">Cancel / Exit</a><br/><br/>
 <a id="saveComposite" href="#" class="btn btn-block btn-lg btn-default">Save Composite To File</a><br/><br/>
diff --git a/js/menus/templates/EditComponentMenuView.html b/js/menus/templates/EditComponentMenuView.html
index eac946ee..8d6abe63 100644
--- a/js/menus/templates/EditComponentMenuView.html
+++ b/js/menus/templates/EditComponentMenuView.html
@@ -34,6 +34,5 @@ Rotation (xyz):&nbsp;&nbsp;
     <input data-property="rotation" data-key="z" value="<%= rotation.z %>" placeholder="Z" class="form-control floatInput component" type="text"><br/><br/>
 Scale: &nbsp;&nbsp;<input data-property="scale" value="<%= scale %>" placeholder="Scale" class="form-control floatInput component" type="text"><br/><br/>
 <a id="finishComponent" href="#" class="btn btn-block btn-lg btn-success">Save Component</a><br/>
-<a id="cancelComponent" href="#" class="btn btn-halfWidth btn-lg btn-default">Cancel / Exit</a>
-<a id="deleteComponent" href="#" class="btn btn-halfWidth pull-right btn-lg btn-default"><span class="fui-trash"></span> Delete</a><br/><br/>
-<a id="saveComponent" href="#" class="btn btn-block btn-lg pull-right btn-default">Save Component To File</a><br/><br/>
\ No newline at end of file
+<a id="deleteComponent" href="#" class="btn btn-halfWidth btn-lg btn-default"><span class="fui-trash"></span> Delete</a>
+<a id="cancelComponent" href="#" class="btn btn-halfWidth pull-right btn-lg btn-default">Cancel / Exit</a><br/><br/>
diff --git a/js/menus/templates/MaterialEditorMenuView.html b/js/menus/templates/MaterialEditorMenuView.html
index 0d79a871..df017fdb 100644
--- a/js/menus/templates/MaterialEditorMenuView.html
+++ b/js/menus/templates/MaterialEditorMenuView.html
@@ -15,7 +15,7 @@ Material Properties:<br/>
     <a id="cancelMaterial" href="#" class="btn btn-halfWidth btn-lg btn-default">Cancel / Exit</a>
     <a id="saveMaterial" href="#" class="btn btn-halfWidth btn-lg pull-right btn-default">Save To File</a><br/><br/>
 <% } else { %>
-    <a id="cancelMaterial" href="#" class="btn btn-halfWidth btn-lg btn-default">Cancel / Exit</a>
-    <a id="deleteMaterial" href="#" class="btn btn-halfWidth pull-right btn-lg btn-default"><span class="fui-trash"></span> Delete</a><br/><br/>
+    <a id="deleteMaterial" href="#" class="btn btn-halfWidth btn-lg btn-default"><span class="fui-trash"></span> Delete</a>
+    <a id="cancelMaterial" href="#" class="btn btn-halfWidth pull-right btn-lg btn-default">Cancel / Exit</a><br/><br/>
     <a id="saveMaterial" href="#" class="btn btn-block btn-lg pull-right btn-default">Save Material To File</a><br/><br/>
 <% } %>
diff --git a/js/plists/CamPList.js b/js/plists/CamPList.js
index 2e8b9b27..da298b4c 100644
--- a/js/plists/CamPList.js
+++ b/js/plists/CamPList.js
@@ -3,7 +3,7 @@
  */
 
 
-define(['three'], function(THREE){
+define([], function(){
 
     return {
 
@@ -34,6 +34,83 @@ define(['three'], function(THREE){
                 relative: false,
                 camProcesses: ["gcode"],
                 numMaterials: 2,
+                components: {
+                    xAxis: {
+                        name: "X Axis",
+                        isLinear: true,
+                        axisOfMotion: null,
+                        //minBound
+                        //maxBound
+                        parent: null,
+                        children: [],
+                        stl: {
+                            filename: "jflsdkjfsd.stl",
+                            offset: {x:0,y:0,z:0},
+                            scale: 1.0,
+                            rotation: {x:0,y:0,z:0}
+                        }
+                    },
+                    yAxis: {
+                        name: "Y Axis",
+                        isLinear: true,
+                        axisOfMotion: null,
+                        //minBound
+                        //maxBound
+                        parent: null,
+                        children: ["zAxis"],
+                        stl: {
+                            filename: "jflsdkjfsd.stl",
+                            offset: {x:0,y:0,z:0},
+                            scale: 1.0,
+                            rotation: {x:0,y:0,z:0}
+                        }
+                    },
+                    zAxis: {
+                        name: "Z Axis",
+                        isLinear: true,
+                        axisOfMotion: null,
+                        //minBound
+                        //maxBound
+                        parent: null,
+                        children: [],
+                        stl: {
+                            filename: "jflsdkjfsd.stl",
+                            offset: {x:0,y:0,z:0},
+                            scale: 1.0,
+                            rotation: {x:0,y:0,z:0}
+                        }
+                    },
+                    frame: {
+                        name: "Frame",
+                        isLinear: true,
+                        axisOfMotion: null,
+                        //minBound
+                        //maxBound
+                        parent: null,
+                        children: [],
+                        stl: {
+                            filename: "jflsdkjfsd.stl",
+                            offset: {x:0,y:0,z:0},
+                            scale: 1.0,
+                            rotation: {x:0,y:0,z:0}
+                        }
+                    },
+                    substrate: {
+                        name: "Substrate",
+                        isLinear: true,
+                        axisOfMotion: null,
+                        //minBound
+                        //maxBound
+                        parent: null,
+                        children: [],
+                        stl: {
+                            filename: "jflsdkjfsd.stl",
+                            offset: {x:0,y:0,z:0},
+                            scale: 1.0,
+                            rotation: {x:0,y:0,z:0}
+                        }
+                    }
+                },
                 defaults: {
                     camStrategy: "raster",
                     placementOrder: "XYZ",//used for raster strategy entry
@@ -41,7 +118,7 @@ define(['three'], function(THREE){
                     rapidHeight:3,
                     rapidHeightRelative: true,
                     safeHeight: 0.05,
-                    originPosition: new THREE.Vector3(0,0,0),
+                    originPosition: {x:0,y:0,z:0},
                     rapidSpeeds:{xy: 3, z: 2},
                     feedRate:{xy: 0.1, z: 0.1}
                 }
-- 
GitLab