diff --git a/js/cam/Cam.js b/js/cam/Cam.js index 7320fce5685787e48a2ea8899375a51ec2a1ccca..7fd68bb62787fc14352f20d24593903c240a80b7 100644 --- a/js/cam/Cam.js +++ b/js/cam/Cam.js @@ -297,10 +297,10 @@ define(['underscore', 'three', 'backbone', 'appState', 'latticeCAM', 'threeModel this.get("exporter").simulate(allLines[currentLine], this.get("assembler"), scaledSettings, function(){ - currentLine++; - self.set("simLineNumber", currentLine); - self._stockSimulation(); - }); + currentLine++; + self.set("simLineNumber", currentLine); + self._stockSimulation(); + }); } else { //finished simulation this.resetSimulation(); diff --git a/js/menus/SendMenuView.js b/js/menus/SendMenuView.js index 85eefd678c5d35bd494ccae7e9184774efc97f51..34566d913b356b44b487992ec5363bba9dee6334 100644 --- a/js/menus/SendMenuView.js +++ b/js/menus/SendMenuView.js @@ -13,7 +13,8 @@ define(['jquery', 'underscore', 'menuParent', 'serialComm', 'commPlist', 'text!s "click #pauseStream": "_pauseStream", "click #stopMachine": "_stopMachine", "click #previousLineButton": "_decrementLineNum", - "click #nextLineButton": "_incrementLineNum" + "click #nextLineButton": "_incrementLineNum", + "click #openSerialMonitor": "_openSerialMonitor" }, @@ -23,18 +24,21 @@ define(['jquery', 'underscore', 'menuParent', 'serialComm', 'commPlist', 'text!s _startStream: function(e){ e.preventDefault(); + this.model.set("stockSimulationPlaying", true); this.isStreaming = true; this.render(); }, _pauseStream: function(e){ e.preventDefault(); + this.model.set("stockSimulationPlaying", false); this.isStreaming = false; this.render(); }, _stopMachine: function(e){ e.preventDefault(); + this.model.set("stockSimulationPlaying", false); this.isStreaming = false; serialComm.send("!"); this.render(); @@ -50,6 +54,11 @@ define(['jquery', 'underscore', 'menuParent', 'serialComm', 'commPlist', 'text!s console.log("next"); }, + _openSerialMonitor: function(e){ + e.preventDefault(); + serialComm.openSerialMonitor(); + }, + _makeTemplateJSON: function(){ return _.extend(serialComm.toJSON(), commPlist, cam.toJSON(), camPlist, {streaming: this.isStreaming}); }, diff --git a/js/menus/templates/SendMenuView.html b/js/menus/templates/SendMenuView.html index f71756ed1d6153aea4d2de0e8f8ca60adc6649bb..010546f9c576c123527a8ae9b94d8d4f9b782f4d 100644 --- a/js/menus/templates/SendMenuView.html +++ b/js/menus/templates/SendMenuView.html @@ -9,9 +9,10 @@ <a href="#" id="streamCommands" class="btn btn-block btn-lg btn-success">Stream</a> <% } %> <br/> + <a href="#" id="openSerialMonitor" class="btn btn-block btn-lg btn-default">Open Serial Monitor</a><br/> Next Line: <input id="nextLine" value="" placeholder="##" class="intInput form-control unresponsiveInput" type="text"> - <a href="#" id="previousLineButton" class="btn btn-lg btn-default">Prev</a> - <a href="#" id="nextLineButton" class="btn btn-lg btn-default">Next</a><br/><br/> + <a href="#" id="previousLineButton" class="btn btn-lg btn-default">Prev</a> + <a href="#" id="nextLineButton" class="btn btn-lg btn-default">Next</a><br/><br/> <div id="gcodeEditor"><%= dataOut %></div><br/> <% } %> <% } else { %>