diff --git a/js/cam/cam.js b/js/cam/cam.js index cee5953ac479f7acc66d1ef4196bc87fb3daec56..304510d9bb2147d95241a41b141a699119b8cf2e 100644 --- a/js/cam/cam.js +++ b/js/cam/cam.js @@ -100,9 +100,9 @@ define(['underscore', 'backbone', 'appState', 'latticeCAM', 'threeModel', 'plist _setMachineDefaults: function(machineName){ var self = this; - if (plist.allMachineDefaults[machineName]){ - _.each(_.keys(plist.allMachineDefaults[machineName]), function(key){ - self.set(key, plist.allMachineDefaults[machineName][key], {silent:true}); + if (plist.allMachines[machineName].defaults){ + _.each(plist.allMachines[machineName].defaults, function(value, key){ + self.set(key, value, {silent:true}); }); } }, @@ -125,7 +125,7 @@ define(['underscore', 'backbone', 'appState', 'latticeCAM', 'threeModel', 'plist _setToDefaults: function(){ //call this each time we switch to assemble tab - var availableMachines = _.keys(plist.allMachineTypes[lattice.get("cellType")][lattice.get("connectionType")]); + var availableMachines = plist.machineTypesForLattice[lattice.get("cellType")][lattice.get("connectionType")]; if (availableMachines.indexOf(this.get("machineName")) < 0){ this.set("machineName", availableMachines[0], {silent:true}); } diff --git a/js/main.js b/js/main.js index 2dd08f1c29ffa219fd97a053bbc9b6c18d99bcb8..d5db5721501d184a6e832f1972b636a2602441c4 100644 --- a/js/main.js +++ b/js/main.js @@ -112,6 +112,7 @@ require.config({ optimizeMenu: 'menus/OptimizationMenuView', assemblerMenu: 'menus/AssemblerMenuView', camMenu: 'menus/CamMenuView', + editCamOutputMenu: 'menus/EditCamOutputMenuView', animateMenu: 'menus/AnimationMenuView', sendMenu: 'menus/SendMenuView', compositeMenu: 'menus/CompositeMenuView', @@ -138,6 +139,7 @@ require.config({ optimizeMenuTemplate: 'menus/templates/OptimizationMenuView.html', assemblerMenuTemplate: 'menus/templates/AssemblerMenuView.html', camMenuTemplate: 'menus/templates/CamMenuView.html', + editCamOutputMenuTemplate: 'menus/templates/EditCamOutputMenuView.html', animationMenuTemplate: 'menus/templates/AnimationMenuView.html', sendMenuTemplate: 'menus/templates/SendMenuView.html', compositeMenuTemplate: 'menus/templates/CompositeMenuView.html', diff --git a/js/menus/EditCamOutputMenuView.js b/js/menus/EditCamOutputMenuView.js new file mode 100644 index 0000000000000000000000000000000000000000..77837d21e7761ab84d1a21eb0253ceb5f4f89d18 --- /dev/null +++ b/js/menus/EditCamOutputMenuView.js @@ -0,0 +1,24 @@ +/** + * Created by aghassaei on 7/12/15. + */ + +define(['jquery', 'underscore', 'menuParent', 'plist', 'text!editCamOutputMenuTemplate'], + function($, _, MenuParentView, plist, template){ + + + return MenuParentView.extend({ + + events: { + }, + + + _initialize: function(){ + }, + + _makeTemplateJSON: function(){ + return _.extend(this.model.toJSON(), plist); + }, + + template: _.template(template) + }); +}); \ No newline at end of file diff --git a/js/menus/templates/AssemblerMenuView.html b/js/menus/templates/AssemblerMenuView.html index cd04559f8ac4f25bdb7e74532ca133e2eed80eef..cc872c16a1e5cfa8835162276fe774cd2900443c 100644 --- a/js/menus/templates/AssemblerMenuView.html +++ b/js/menus/templates/AssemblerMenuView.html @@ -1,9 +1,9 @@ Machine: <div class="btn-group"> - <button data-toggle="dropdown" class="btn dropdown-toggle" type="button"><%= allMachineTypes[cellType][connectionType][machineName] %><span class="caret"></span></button> + <button data-toggle="dropdown" class="btn dropdown-toggle" type="button"><%= allMachines[machineName].name %><span class="caret"></span></button> <ul role="menu" class="dropdown-menu"> - <% _.each(_.keys(allMachineTypes[cellType][connectionType]), function(key){ %> - <li><a class="assembler dropdownSelector" data-property="machineName" data-value="<%= key %>" href="#"><%= allMachineTypes[cellType][connectionType][key] %></a></li> + <% _.each(machineTypesForLattice[cellType][connectionType], function(machine){ %> + <li><a class="assembler dropdownSelector" data-property="machineName" data-value="<%= machine %>" href="#"><%= allMachines[machine].name %></a></li> <% }); %> </ul> </div><br/><br/> @@ -11,8 +11,8 @@ Strategy: <div class="btn-group"> <button data-toggle="dropdown" class="btn dropdown-toggle" type="button"><%= allAssemblyStrategies[camStrategy] %><span class="caret"></span></button> <ul role="menu" class="dropdown-menu"> - <% _.each(_.keys(allAssemblyStrategies), function(key){ %> - <li><a class="assembler dropdownSelector" data-property="camStrategy" data-value="<%= key %>" href="#"><%= allAssemblyStrategies[key] %></a></li> + <% _.each(allAssemblyStrategies, function(strategy, key){ %> + <li><a class="assembler dropdownSelector" data-property="camStrategy" data-value="<%= key %>" href="#"><%= strategy %></a></li> <% }); %> </ul> </div><br/><br/> diff --git a/js/menus/templates/CamMenuView.html b/js/menus/templates/CamMenuView.html index c2df6444c75732601a3ae4bd52ad6fe45017786a..6ac1992ec23f213798fde0e00529a346ea8db8db 100644 --- a/js/menus/templates/CamMenuView.html +++ b/js/menus/templates/CamMenuView.html @@ -1,8 +1,8 @@ CAM output: <div class="btn-group"> - <button data-toggle="dropdown" class="btn dropdown-toggle" type="button"><%= allCamProcesses[machineName][camProcess] %><span class="caret"></span></button> + <button data-toggle="dropdown" class="btn dropdown-toggle" type="button"><%= allCamProcesses[camProcess] %><span class="caret"></span></button> <ul role="menu" class="dropdown-menu"> - <% _.each(_.keys(allCamProcesses[machineName]), function(key){ %> - <li><a class="assembler dropdownSelector" data-property="camProcess" data-value="<%= key %>" href="#"><%= allCamProcesses[machineName][key] %></a></li> + <% _.each(allMachines[machineName].camProcesses, function(process){ %> + <li><a class="assembler dropdownSelector" data-property="camProcess" data-value="<%= process %>" href="#"><%= allCamProcesses[process] %></a></li> <% }); %> </ul> </div><br/><br/> diff --git a/js/menus/templates/EditCamOutputMenuView.html b/js/menus/templates/EditCamOutputMenuView.html new file mode 100644 index 0000000000000000000000000000000000000000..30d74d258442c7c65512eafab474568dd706c430 --- /dev/null +++ b/js/menus/templates/EditCamOutputMenuView.html @@ -0,0 +1 @@ +test \ No newline at end of file diff --git a/js/plists/PList.js b/js/plists/PList.js index ce4a2f22a2165c9f8bade5cf6bdad42a950087c2..94319eb574533ca9f7c2815b1ea6520720860275 100644 --- a/js/plists/PList.js +++ b/js/plists/PList.js @@ -30,6 +30,7 @@ define(['three'], function(THREE){ navAssemble:{ assembler:"Assembler", cam: "Process", + editCamOutput: "Edit", animate:"Preview" }, navComm:{ @@ -113,8 +114,7 @@ define(['three'], function(THREE){ allMaterialClasses:{ mechanical: "Structural", - electronic: "Electronic", -// space: "Space Structures" + electronic: "Electronic" }, allMaterials:{ @@ -181,122 +181,83 @@ define(['three'], function(THREE){ altColor: "#8391AC", properties:{} } + } + }, + + + allMachines:{ + handOfGod: { + name: "Hand of God", + shouldPickUpStock: false, + relative: false, + camProcesses: ["gcode"] }, - space:{ - fiberGlass: { - name: "Glass Filled Nylon", - color: "#fef1b5", -// opacity: "0.9", - altColor: "#ecf0f1", - properties:{} - }, - carbon: { - name: "Carbon Composite", - color: "#222", - altColor: "#000", - properties:{} - }, - nType: { - name: "Aluminum", - color: "#bcc6cc", - altColor: "#8391AC", - properties:{} - }, - brass:{ - name: "Brass", - color: "#b5a642", - altColor: "#857B64", - properties:{ - conductive: true - } - }, - nTypePlus: { - name: "Power Storage", - color: "#c6ccbc", - altColor: "#9CC9CB", - properties:{} - }, - pType: { - name: "Logic", - color: "#ccbcc6", - altColor: "#F5447B", - properties:{} - }, - pTypePlus: { - name: "Solar Panel", - color: "#ccc2bc", - altColor: "#F99987", - properties:{} + crab: { + name: "Crab", + shouldPickUpStock: true, + relative: true, + camProcesses: ["gcode"] + }, + shopbot: { + name: "Shopbot", + shouldPickUpStock: true, + relative: false, + camProcesses: ["shopbot", "gcode"] + }, + oneBitBot: { + name: "One Bit Bot", + shouldPickUpStock: true, + relative: true, + camProcesses: ["gcode", "tinyG"] + }, + stapler: { + name: "Dual Head Stapler", + shouldPickUpStock: false, + relative: false, + camProcesses: ["gcode"], + defaults: { + camStrategy: "raster", + placementOrder: "XYZ",//used for raster strategy entry + camProcess: "gcode", + rapidHeight:3, + rapidHeightRelative: true, + safeHeight: 0.05, + originPosition: new THREE.Vector3(0,0,0), + rapidSpeeds:{xy: 3, z: 2}, + feedRate:{xy: 0.1, z: 0.1} } - //857B64 - //FDE2D9 - //D77948 } }, - allMachineTypes:{ + machineTypesForLattice:{ octa:{ - face: {handOfGod: "Hand of God"}, - edgeRot: { - crab: "Crab", - shopbot: "Shopbot", - oneBitBot: "One Bit Bot", - oneBitBotLegs: "One Bit Bot with Legs", - handOfGod: "Hand of God" - }, - vertex: {handOfGod: "Hand of God"} + face: ["handOfGod"], + edgeRot: ["crab", "shopbot", "oneBitBot", "handOfGod"], + vertex: ["handOfGod"] }, tetra: { - vertex:{handOfGod: "Hand of God"} + vertex: ["handOfGod"] }, cube:{ - face:{handOfGod: "Hand of God"}, - gik: { - stapler: "Dual Head Stapler" -// handOfGod: "Hand of God" - } + face: ["handOfGod"], + gik: ["stapler", "handOfGod"] }, truncatedCube:{ - face:{handOfGod: "Hand of God"} + face:["handOfGod"] }, kelvin:{ - face:{handOfGod: "Hand of God"} + face:["handOfGod"] } }, + allAssemblyStrategies: { raster: "Raster" }, - allCamProcesses: { - shopbot:{ - shopbot: "Shopbot (sbp)", - gcode: "G-Code" - }, - handOfGod:{gcode: "G-Code"}, - oneBitBot:{ - gcode: "G-Code", - tinyG: "TinyG" - }, - stapler: {gcode: "G-Code"}, - staplerDual: {gcode: "G-Code"}, - crab: {gcode: "G-Code"} - }, - allMachineDefaults: { - shopbot:null, - handOfGod:null, - oneBitBot:null, - stapler: { - camStrategy: "raster", - placementOrder: "XYZ",//used for raster strategy entry - camProcess: "gcode", - rapidHeight:3, - rapidHeightRelative: true, - safeHeight: 0.05, - originPosition: new THREE.Vector3(0,0,0), - rapidSpeeds:{xy: 3, z: 2}, - feedRate:{xy: 0.1, z: 0.1} - }, - crab: null + allCamProcesses: { + shopbot: "Shopbot (sbp)", + gcode: "G-Code", + tinyG: "TinyG" }, allScripts: { @@ -305,8 +266,8 @@ define(['three'], function(THREE){ allUnitTypes: { inches: "Inches", - mm: "mm" - //um: "micron" + mm: "mm", + um: "Micron" } }