Commit d85de2e5 authored by Amanda Ghassaei's avatar Amanda Ghassaei

machine status

parent ef1e6396
...@@ -97,3 +97,7 @@ span.outgoing { ...@@ -97,3 +97,7 @@ span.outgoing {
font-size: 30px; font-size: 30px;
padding-left: 5px; padding-left: 5px;
} }
#machineStatus {
font-size: 18px;
}
<div id="positionData"> <div id="positionData">
</div><br/> </div>
<a href="#" id="askForPosition" class="btn btn-block btn-lg btn-default">Refresh Position</a><br/> <a href="#" id="askForPosition" class="btn btn-block btn-lg btn-default">Refresh Position</a><br/>
<a href="#" id="pauseOutput" class="btn btn-block btn-lg btn-warning">Pause</a> <a href="#" id="pauseOutput" class="btn btn-block btn-lg btn-warning">Pause</a>
<a href="#" id="stopMachine" class="btn pull-right btn-block btn-lg btn-danger">Stop</a> <a href="#" id="stopMachine" class="btn pull-right btn-block btn-lg btn-danger">Stop</a>
\ No newline at end of file
...@@ -3,4 +3,12 @@ Y: &nbsp;&nbsp;<span class="positionVal"><%= y %></span><br/> ...@@ -3,4 +3,12 @@ Y: &nbsp;&nbsp;<span class="positionVal"><%= y %></span><br/>
Z: &nbsp;&nbsp;<span class="positionVal"><%= z %></span><br/><br/> Z: &nbsp;&nbsp;<span class="positionVal"><%= z %></span><br/><br/>
A: &nbsp;&nbsp;<span class="positionVal"><%= a %></span><br/> A: &nbsp;&nbsp;<span class="positionVal"><%= a %></span><br/>
B: &nbsp;&nbsp;<span class="positionVal"><%= b %></span><br/> B: &nbsp;&nbsp;<span class="positionVal"><%= b %></span><br/>
C: &nbsp;&nbsp;<span class="positionVal"><%= c %></span><br/> C: &nbsp;&nbsp;<span class="positionVal"><%= c %></span><br/><br/>
\ No newline at end of file <span id="machineStatus">status: &nbsp;&nbsp;
<% if (status == 0) { %>initializing
<% } else if (status == 1 || status == 3 || status == 4){ %>ready
<% } else if (status == 2){ %>alarm
<% } else if (status == 5) { %>moving
<% } else if (status == 6) { %>holding
<% } else if (status == 9) { %>homing
<% } else { %>status = <%= status %><% } %></span>
\ No newline at end of file
...@@ -13,7 +13,8 @@ define(['underscore', 'backbone'], function(_, Backbone){ ...@@ -13,7 +13,8 @@ define(['underscore', 'backbone'], function(_, Backbone){
z: null, z: null,
a: null, a: null,
b: null, b: null,
c: null c: null,
status: 0
}, },
setPosition: function(data){ setPosition: function(data){
...@@ -22,6 +23,7 @@ define(['underscore', 'backbone'], function(_, Backbone){ ...@@ -22,6 +23,7 @@ define(['underscore', 'backbone'], function(_, Backbone){
var val = data["pos" + key]; var val = data["pos" + key];
if (val !== null && val !== undefined) self.set(key, val); if (val !== null && val !== undefined) self.set(key, val);
}); });
if (data.stat !== null && data.stat !== undefined) this.set("status", data.stat);
}, },
refresh: function(){ refresh: function(){
......
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