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

more serial comm edits

parent a4b77c8e
......@@ -498,4 +498,14 @@ label {
.navbar-inverse .navbar-nav > .dropdown > a:hover .caret {
border-top-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'
_updateIncomingMessage: function(){
var message = serialComm.get("lastMessageReceived");
console.log(message);
var $message = $("#incomingSerialMessage");
$message.html(message);
$message.css("background", "#ffff99");
$message.css('display', 'inline-block');
if (!this.inTimeout) {
this.inTimeout = true;
var self = this;
......
......@@ -54,6 +54,10 @@ define(['jquery', 'underscore', 'commParentMenu', 'serialComm', 'commPlist', 'te
return _.extend(serialComm.toJSON(), commPlist, cam.toJSON(), camPlist, {streaming: this.isStreaming});
},
_render: function(){
if (serialComm.get("lastMessageReceived") === null) $("#incomingSerialMessage").hide();
},
template: _.template(template)
});
......
......@@ -56,6 +56,10 @@ define(['jquery', 'underscore', 'commParentMenu', 'serialComm', 'text!setupCommM
return _.extend(serialComm.toJSON(), commPlist);
},
_render: function(){
if (serialComm.get("lastMessageReceived") === null) $("#incomingSerialMessage").hide();
},
template: _.template(template),
helpFile: "" +
......
......@@ -9,7 +9,7 @@
<a href="#" id="streamCommands" class="btn btn-block btn-lg btn-success">Stream</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/>
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>
......
......@@ -23,7 +23,7 @@
</div>
&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/>
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/>
<a href="#" id="serialFlushBuffer" class="btn btn-block btn-lg btn-danger">Flush Buffer</a><br/>
<% }else{ %>
......
......@@ -13,7 +13,7 @@ define(['underscore', 'backbone', 'socketio'], function(_, Backbone, io){
portName: "Select Port",
baudRate: 200,
error: null,
lastMessageReceived: "",
lastMessageReceived: null,
lastMessageSent: ""
},
......@@ -73,6 +73,7 @@ define(['underscore', 'backbone', 'socketio'], function(_, Backbone, io){
});
socket.on('dataIn', function(data){
if (data == "" || data == '\n' || data == "\r") return;
serialComm.set("lastMessageReceived", data, {silent:true});
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