diff --git a/js/cam/Cam.js b/js/cam/Cam.js index a874d08c2094f800b2136ccb90849b7fda77c031..7320fce5685787e48a2ea8899375a51ec2a1ccca 100644 --- a/js/cam/Cam.js +++ b/js/cam/Cam.js @@ -215,7 +215,8 @@ define(['underscore', 'three', 'backbone', 'appState', 'latticeCAM', 'threeModel isVisible: function(){ var currentTab = appState.get("currentTab"); - return (currentTab == "assemblerSetup" || currentTab == "cam" || currentTab == "animate" || currentTab == "send" + var currentNav = appState.get("currentNav"); + return (currentTab == "assemblerSetup" || currentTab == "cam" || currentTab == "animate" || currentNav == "navComm" || currentTab == "editComponent"); }, diff --git a/js/menus/SendMenuView.js b/js/menus/SendMenuView.js index e76b6db23290431ab9aafbcc86f7578dcdc49090..db880c61617778b2630a6d8baa3bbf4e5685634b 100644 --- a/js/menus/SendMenuView.js +++ b/js/menus/SendMenuView.js @@ -9,6 +9,11 @@ define(['jquery', 'underscore', 'commParentMenu', 'serialComm', 'commPlist', 'te events: { + "click #streamCommands": "_startStream", + "click #pauseStream": "_pauseStream", + "click #stopMachine": "_stopMachine", + "click #previousLineButton": "_decrementLineNum", + "click #nextLineButton": "_incrementLineNum" }, @@ -16,6 +21,35 @@ define(['jquery', 'underscore', 'commParentMenu', 'serialComm', 'commPlist', 'te this.isStreaming = false; }, + _startStream: function(e){ + e.preventDefault(); + this.isStreaming = true; + this.render(); + }, + + _pauseStream: function(e){ + e.preventDefault(); + this.isStreaming = false; + this.render(); + }, + + _stopMachine: function(e){ + e.preventDefault(); + this.isStreaming = false; + serialComm.send("!"); + this.render(); + }, + + _decrementLineNum: function(e){ + e.preventDefault(); + console.log("prev"); + }, + + _incrementLineNum: function(e){ + e.preventDefault(); + console.log("next"); + }, + _makeTemplateJSON: function(){ console.log("render"); 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 7ea0bf981992f1f3f035a82280f2b5f589554744..9fde0f5746f4886a37c376233dd9c56dcdcb3476 100644 --- a/js/menus/templates/SendMenuView.html +++ b/js/menus/templates/SendMenuView.html @@ -10,7 +10,9 @@ <a href="#" id="stopMachine" class="btn pull-right btn-halfWidth btn-lg btn-danger">Stop</a><br/><br/> Incoming: <pre id="incomingSerialMessage"></pre><br/><br/> Out: <input id="sendSerialMessage" value="" placeholder="Send Message" class="seventyFiveWidth form-control unresponsiveInput" type="text"><br/><br/> - Next Line: <input id="nextLine" value="" placeholder="##" class="intInput form-control unresponsiveInput" type="text">Up/down<br/><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/> <div id="gcodeEditor"><%= dataOut %></div><br/> <% } %> <% } else { %> diff --git a/js/models/AppState.js b/js/models/AppState.js index 60e6ac3288a79dea3893cfce9b0b89939f163628..42790d0252564ea77b4980ecc4e9ebf46bb0aae2 100644 --- a/js/models/AppState.js +++ b/js/models/AppState.js @@ -117,6 +117,9 @@ define(['underscore', 'backbone', 'threeModel', 'three', 'plist', 'globals'], fu this.set("highlighterIsVisible", false); } else if (navSelection == "navAssemble"){ this.set("highlighterIsVisible", false); + } else if (navSelection == "navComm"){ + this.set("basePlaneIsVisible", false); + this.set("highlighterIsVisible", false); } },