diff --git a/SerialMonitor.html b/SerialMonitor.html new file mode 100644 index 0000000000000000000000000000000000000000..15b32814b318cbd45134a41be46b45204aefd68f --- /dev/null +++ b/SerialMonitor.html @@ -0,0 +1,13 @@ +<head> + <title>Serial Monitor</title> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <link href="dependencies/flatUI/css/vendor/bootstrap.min.css" rel="stylesheet"><!-- Loading Bootstrap --> + <link href="dependencies/flatUI/css/flat-ui.css" rel="stylesheet"><!-- Loading Flat UI --> + <link href="css/serialMonitor.css" rel="stylesheet"><!-- Loading custom stylingI --> +</head> +<html><div id="serialMonitorView"> + serial monitor + <input id="serialMonitorSend" value="" placeholder="Send Message" class="form-control" type="text"> +</div> +</html> \ No newline at end of file diff --git a/css/serialMonitor.css b/css/serialMonitor.css new file mode 100644 index 0000000000000000000000000000000000000000..19fd7ce33e6a4336c7954d38fb997852ca66d352 --- /dev/null +++ b/css/serialMonitor.css @@ -0,0 +1,7 @@ + #serialMonitorSend { + position: absolute; + bottom: 0px; + border-radius: 0px; + border: none; + border-top: 2px solid #bdc3c7; + } \ No newline at end of file diff --git a/index.html b/index.html index 6bb561db88fd108fdd8829452092fbf83fd07c10..8eff9b313aad84eeb65b5f6748d877a6f4d0e632 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ <html> <head> - <title></title> + <title>DMDesign</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script src="dependencies/analytics.js"></script> diff --git a/js/main.js b/js/main.js index 206e08f28f35799f27488b855af08a57eab0d232..aee356d65a6ff95abcd9b2dbbb4d9fc7f2c0f36a 100644 --- a/js/main.js +++ b/js/main.js @@ -142,6 +142,7 @@ require.config({ assemblerSetupMenu: 'menus/AssemblerSetupMenuView', editComponentMenu: 'menus/EditComponentMenuView', commParentMenu: 'menus/CommParentMenu', + serialMonitor: 'menus/SerialMonitorView', //templates navViewMenuTemplate: 'menus/templates/NavViewMenu.html', diff --git a/js/menus/SerialMonitorView.js b/js/menus/SerialMonitorView.js new file mode 100644 index 0000000000000000000000000000000000000000..78683ff366c06e339a4ca028afa8f2c884f17a6c --- /dev/null +++ b/js/menus/SerialMonitorView.js @@ -0,0 +1,35 @@ +/** + * Created by aghassaei on 9/8/15. + */ + + +define(['jquery', 'underscore', 'backbone'], function($, _, Backbone){ + + var SerialMonitorView = Backbone.View.extend({ + + el: "#serialMonitorView", + + events: { + }, + + initialize: function(){ + this.open(); + }, + + open: function(){ + window.open('SerialMonitor.html', '', 'height=400, width=400, titlebar=no, toolbar=no, menubar=yes, scrollbars=no, resizable=yes, location=no, directories=no, status=no'); + }, + + onClose: function(){ + + }, + + _destroy: function(){ + + } + + }); + + return SerialMonitorView; + +}); \ No newline at end of file diff --git a/js/menus/SetupCommMenuView.js b/js/menus/SetupCommMenuView.js index e70164bcdcef486d19b83467ffe5b2415ec657ee..c126a1c5f792c4d31abd066e4e26414f52fc7307 100644 --- a/js/menus/SetupCommMenuView.js +++ b/js/menus/SetupCommMenuView.js @@ -13,7 +13,8 @@ define(['jquery', 'underscore', 'commParentMenu', 'serialComm', 'text!setupCommM "click #serialFlushBuffer": "_flushBuffer", "click #nodeSetupInstructions": "_setupInstructions", "click #refreshPorts": "_refreshPorts", - "click #reconnectToNode": "_reconnectToNode" + "click #reconnectToNode": "_reconnectToNode", + "click #openSerialMonitor": "_openSerialMonitor" }, @@ -41,10 +42,18 @@ define(['jquery', 'underscore', 'commParentMenu', 'serialComm', 'text!setupCommM }) }, - _reconnectToNode: function(){ + _reconnectToNode: function(e){ + e.preventDefault(); serialComm.attemptToConnectToNode(); }, + _openSerialMonitor: function(e){ + e.preventDefault(); + require(['serialMonitor'], function(SerialMonitor){ + var serialMonitor = new SerialMonitor(); + }); + }, + _makeTemplateJSON: function(){ console.log("render"); return _.extend(serialComm.toJSON(), commPlist); diff --git a/js/menus/templates/SetupCommMenuView.html b/js/menus/templates/SetupCommMenuView.html index 5a6cd7f73ccc83d651758055230025c2d50a9c2d..e5cee310aff0a28537560a86a9bfbc16cd8fc566 100644 --- a/js/menus/templates/SetupCommMenuView.html +++ b/js/menus/templates/SetupCommMenuView.html @@ -22,6 +22,7 @@ </ul> </div> <a href="#" id="refreshPorts" class="btn btn-lg btn-default btn-icon"><img src="assets/imgs/refreshIcon.png"></a><br/><br/> + <a href="#" id="openSerialMonitor" class="btn btn-block btn-lg btn-default">Open Serial Monitor</a><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/> <a href="#" id="serialFlushBuffer" class="btn btn-block btn-lg btn-danger">Flush Buffer</a><br/>