Commit 37ec6011 authored by Amanda Ghassaei's avatar Amanda Ghassaei
Browse files

more serial comm edits

parent a4b77c8e
...@@ -498,4 +498,14 @@ label { ...@@ -498,4 +498,14 @@ label {
.navbar-inverse .navbar-nav > .dropdown > a:hover .caret { .navbar-inverse .navbar-nav > .dropdown > a:hover .caret {
border-top-color: #aaa; border-top-color: #aaa;
border-bottom-color: #aaa; border-bottom-color: #aaa;
}
#incomingSerialMessage{
background-color: white;
white-space: nowrap;
max-width: 250px;
overflow: hidden;
display: inline-block;
text-overflow: ellipsis;
position: absolute;
} }
\ No newline at end of file
...@@ -41,10 +41,10 @@ define(['jquery', 'underscore', 'menuParent', 'plist', 'serialComm', 'commPlist' ...@@ -41,10 +41,10 @@ define(['jquery', 'underscore', 'menuParent', 'plist', 'serialComm', 'commPlist'
_updateIncomingMessage: function(){ _updateIncomingMessage: function(){
var message = serialComm.get("lastMessageReceived"); var message = serialComm.get("lastMessageReceived");
console.log(message);
var $message = $("#incomingSerialMessage"); var $message = $("#incomingSerialMessage");
$message.html(message); $message.html(message);
$message.css("background", "#ffff99"); $message.css("background", "#ffff99");
$message.css('display', 'inline-block');
if (!this.inTimeout) { if (!this.inTimeout) {
this.inTimeout = true; this.inTimeout = true;
var self = this; var self = this;
......
...@@ -54,6 +54,10 @@ define(['jquery', 'underscore', 'commParentMenu', 'serialComm', 'commPlist', 'te ...@@ -54,6 +54,10 @@ define(['jquery', 'underscore', 'commParentMenu', 'serialComm', 'commPlist', 'te
return _.extend(serialComm.toJSON(), commPlist, cam.toJSON(), camPlist, {streaming: this.isStreaming}); return _.extend(serialComm.toJSON(), commPlist, cam.toJSON(), camPlist, {streaming: this.isStreaming});
}, },
_render: function(){
if (serialComm.get("lastMessageReceived") === null) $("#incomingSerialMessage").hide();
},
template: _.template(template) template: _.template(template)
}); });
......
...@@ -56,6 +56,10 @@ define(['jquery', 'underscore', 'commParentMenu', 'serialComm', 'text!setupCommM ...@@ -56,6 +56,10 @@ define(['jquery', 'underscore', 'commParentMenu', 'serialComm', 'text!setupCommM
return _.extend(serialComm.toJSON(), commPlist); return _.extend(serialComm.toJSON(), commPlist);
}, },
_render: function(){
if (serialComm.get("lastMessageReceived") === null) $("#incomingSerialMessage").hide();
},
template: _.template(template), template: _.template(template),
helpFile: "" + helpFile: "" +
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<a href="#" id="streamCommands" class="btn btn-block btn-lg btn-success">Stream</a> <a href="#" id="streamCommands" class="btn btn-block btn-lg btn-success">Stream</a>
<% } %> <% } %>
<br/> <br/>
Incoming: &nbsp;&nbsp;<pre id="incomingSerialMessage"><br/></pre><br/> Incoming: &nbsp;&nbsp;<pre id="incomingSerialMessage"><%= lastMessageReceived %></pre><br/><br/>
Out: &nbsp;&nbsp;<input id="sendSerialMessage" value="" placeholder="Send Message" class="seventyFiveWidth form-control unresponsiveInput" type="text"><br/><br/> Out: &nbsp;&nbsp;<input id="sendSerialMessage" value="" placeholder="Send Message" class="seventyFiveWidth form-control unresponsiveInput" type="text"><br/><br/>
Next Line: &nbsp;&nbsp;<input id="nextLine" value="" placeholder="##" class="intInput form-control unresponsiveInput" type="text"> Next Line: &nbsp;&nbsp;<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="previousLineButton" class="btn btn-lg btn-default">Prev</a>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
</div> </div>
&nbsp;&nbsp;<a href="#" id="refreshPorts" class="btn btn-lg btn-default btn-icon"><img src="assets/imgs/refreshIcon.png"></a><br/><br/> &nbsp;&nbsp;<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/> <a href="#" id="openSerialMonitor" class="btn btn-block btn-lg btn-default">Open Serial Monitor</a><br/>
Incoming: &nbsp;&nbsp;<pre id="incomingSerialMessage"><br/></pre><br/> Incoming: &nbsp;&nbsp;<pre id="incomingSerialMessage"><%= lastMessageReceived %></pre><br/><br/>
Out: &nbsp;&nbsp;<input id="sendSerialMessage" value="" placeholder="Send Message" class="seventyFiveWidth form-control unresponsiveInput" type="text"><br/><br/> Out: &nbsp;&nbsp;<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/> <a href="#" id="serialFlushBuffer" class="btn btn-block btn-lg btn-danger">Flush Buffer</a><br/>
<% }else{ %> <% }else{ %>
......
...@@ -13,7 +13,7 @@ define(['underscore', 'backbone', 'socketio'], function(_, Backbone, io){ ...@@ -13,7 +13,7 @@ define(['underscore', 'backbone', 'socketio'], function(_, Backbone, io){
portName: "Select Port", portName: "Select Port",
baudRate: 200, baudRate: 200,
error: null, error: null,
lastMessageReceived: "", lastMessageReceived: null,
lastMessageSent: "" lastMessageSent: ""
}, },
...@@ -73,6 +73,7 @@ define(['underscore', 'backbone', 'socketio'], function(_, Backbone, io){ ...@@ -73,6 +73,7 @@ define(['underscore', 'backbone', 'socketio'], function(_, Backbone, io){
}); });
socket.on('dataIn', function(data){ socket.on('dataIn', function(data){
if (data == "" || data == '\n' || data == "\r") return;
serialComm.set("lastMessageReceived", data, {silent:true}); serialComm.set("lastMessageReceived", data, {silent:true});
serialComm.trigger("change:lastMessageReceived"); serialComm.trigger("change:lastMessageReceived");
}); });
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment