Commit 196f34dd authored by Amanda Ghassaei's avatar Amanda Ghassaei

trigger event when ready for next line

parent 0dd890b9
......@@ -27,7 +27,6 @@ define(['jquery', 'underscore', 'backbone', 'text!PositionControlPanelView.html'
_renderPositionData: function(){
var machineState = this.model.getMachineState();
console.log(machineState.toJSON());
$("#positionData").html(_.template(positionTemplate)(machineState.toJSON()));
},
......
......@@ -23,7 +23,6 @@ define(['jquery', 'underscore', 'backbone', 'serialComm', 'text!SerialMonitorVie
this.listenTo(serialComm, "change:lastMessageReceived", this._updateIncomingMessage);
this.listenTo(serialComm, "change:lastMessageSent", this._updateOutgoingMessage);
this.listenTo(serialComm, "change:baudRate change:portName", this.render);
this.listenTo(serialComm, "change:baudRate", function(){console.log("got it")});
this.listenTo(serialComm, "change:connected", function(){
if (!serialComm.get("connected")) this._close();
});
......@@ -115,7 +114,6 @@ define(['jquery', 'underscore', 'backbone', 'serialComm', 'text!SerialMonitorVie
},
render: function(){
console.log("render");
if ($("input[type=text]").is(":focus")) return;
this.$el.html(this.template(this._makeTemplateJSON()));
},
......
......@@ -23,15 +23,23 @@ define(['underscore', 'backbone'], function(_, Backbone){
var val = data["pos" + key];
if (val !== null && val !== undefined) self.set(key, val);
});
if (data.stat !== null && data.stat !== undefined) this.set("status", data.stat);
if (data.stat !== null && data.stat !== undefined) {
this.set("status", data.stat);
if (data.stat == 1 || data.stat == 3 || data.stat == 4) this._triggerNextCommand();
}
},
setFooterStatus: function(data){
if (data[1] == 0){//ok status
this.set("status", 3);
this._triggerNextCommand();
} else this.set("status", 10);
},
_triggerNextCommand: function(){
this.trigger("readyForNextCommand");
},
refresh: function(){
this.set(this.defaults);
}
......
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