git.ucc.asn.au
/
matches
/
MCTX3420.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e0f849d
)
Added LED control button to test GUI
author
Debian User
<debian@snoopy.(none)>
Sat, 1 Jan 2000 00:05:48 +0000
(
00:05
+0000)
committer
Debian User
<debian@snoopy.(none)>
Sat, 1 Jan 2000 00:05:48 +0000
(
00:05
+0000)
web/gui.js
patch
|
blob
|
history
diff --git
a/web/gui.js
b/web/gui.js
index
7d7a8fe
..
e49cf4d
100644
(file)
--- a/
web/gui.js
+++ b/
web/gui.js
@@
-11,6
+11,24
@@
$(document).ready(function()
g_numSensors = 1
g_storeTime = []
g_key = null
g_numSensors = 1
g_storeTime = []
g_key = null
+ g_led = 1
+
+ $.fn.ledFlash = function()
+ {
+ //alert("Flash LED");
+ if (g_led == 0)
+ {
+ $.ajax({url : "api/actuators", data : {id : 0, set : 1}})
+ g_led = 1
+ $("#led").html("LED On");
+ }
+ else
+ {
+ $.ajax({url : "api/actuators", data : {id : 0, set : 0}})
+ g_led = 0
+ $("#led").html("LED Off");
+ }
+ }
$.fn.pruneSensorData = function(id)
{
$.fn.pruneSensorData = function(id)
{
@@
-112,8
+130,7
@@
$(document).ready(function()
$("#plots").html(plotsHTML)
controlHTML = "<h2 id=control0>Controls</h2>\n"
$("#plots").html(plotsHTML)
controlHTML = "<h2 id=control0>Controls</h2>\n"
- controlHTML += "<p> Pressure: <input type=text id=control0_value value=\"100\"/>"
- controlHTML += "<button id=actuator0 onclick=\"$(document).setPressure()\">SET</button> </p>"
+ controlHTML += "<button id=led onclick=\"$(document).ledFlash()\">LED On</button>"
$("#controls").html(controlHTML)
$("#controls").html(controlHTML)
UCC
git Repository :: git.ucc.asn.au