diff --git a/data/users/matt.user b/data/users/matt.user new file mode 100644 index 0000000000000000000000000000000000000000..5e465ac187636e8580da577007239d09fa8d245a --- /dev/null +++ b/data/users/matt.user @@ -0,0 +1 @@ +{"lattice":{"units":"inches","scale":2.78388,"cellSeparation":{"xy":0,"z":0},"cellType":"octa","connectionType":"edgeRot","partType":"vox","shouldPreserveCells":true},"assembler":{"camStrategy":"raster","placementOrder":"-X-YZ","camProcess":"gcode","machineName":"oneBitBot","rapidHeight":6.9,"rapidHeightRelative":true,"safeHeight":0.5,"originPosition":{"x":-1.39194,"y":1.39194,"z":0},"stockPosition":{"x":5.6081,"y":1.3919,"z":2},"stockPositionRelative":true,"multipleStockPositions":false,"stockArraySize":{"x":4,"y":4},"stockSeparation":2.78388,"rapidSpeeds":{"xy":6,"z":4},"feedRate":{"xy":0.1,"z":0.1},"simSpeed":4,"simStockNum":0,"stockHeight":0}} \ No newline at end of file diff --git a/index.html b/index.html index e35761c11f870fd29de8ab4c92553c930e9ca537..ba8a5e6cf4cc24b8b16ec8305388defd1dd75cec 100644 --- a/index.html +++ b/index.html @@ -116,6 +116,7 @@ <ul class="dropdown-menu"> <!--<li><a id="resetDefaultSettings" href="#">Reset Settings</a></li>--> <li><a data-file="ben.user" class="savedUserSettings" href="#">Ben</a></li> + <li><a data-file="matt.user" class="savedUserSettings" href="#">Matt</a></li> <li><a class="importJSON" href="#">From File...</a></li> </ul> </li> diff --git a/js/cam/Assembler.js b/js/cam/Assembler.js index bc0434f2d7fe0257a91ad648987726e9d22e2f91..91029b6762709a4eaf1b340b2f858e5218d1e613 100644 --- a/js/cam/Assembler.js +++ b/js/cam/Assembler.js @@ -75,12 +75,13 @@ Assembler = Backbone.Model.extend({ this.listenTo(options.lattice, "change:partType", this._updatePartType); this.listenTo(options.lattice, "change:cellType change:connectionType", this._updateCellType); this.listenTo(options.appState, "change:cellMode", this._updateCellMode); + this.listenTo(this, "change:machineName", this.selectMachine); this._initOriginAndStock(); }, - selectMachine: function(machineName){//todo put this on event - that way you know it is a change - if (!machineName) machineName = this.get("machineName"); + selectMachine: function(){ + var machineName = this.get("machineName"); if (this.get("machine")) this.get("machine").destroy(); if (machineName == "shopbot"){ this.set("machine", new Shopbot()); @@ -92,7 +93,6 @@ Assembler = Backbone.Model.extend({ this.set("machine", new OneBitBot()); this.set("camProcess", "gcode"); }else console.warn("selected machine not recognized"); - this.set("machineName", machineName); }, makeProgramEdits: function(data){ @@ -111,7 +111,8 @@ Assembler = Backbone.Model.extend({ _updateCellType: function(){ this.get("machine").updateCellType(); - this.selectMachine("handOfGod");//todo this should go away with dynamic allocation of this model + this.set("machineName", "handOfGod");//todo this should go away with dynamic allocation of this model + }, _updatePartType: function(){ diff --git a/js/menus/AssemblerMenuView.js b/js/menus/AssemblerMenuView.js index 12032f259871a98b4c155c3157aaeab624f0dd26..a27e1aaea2ba2d8b4ff25e4c85be0fbf304531e3 100644 --- a/js/menus/AssemblerMenuView.js +++ b/js/menus/AssemblerMenuView.js @@ -48,7 +48,7 @@ AssemblerMenuView = Backbone.View.extend({ _selectMachine: function(e){ e.preventDefault(); - this.assembler.selectMachine($(e.target).data("type")); + this.assembler.set("MachineName", $(e.target).data("type")); }, render: function(){