From: Jeremy Tan Date: Thu, 31 Oct 2013 22:56:45 +0000 (+0800) Subject: Attempt to get image streaming page back from the dead (untested). X-Git-Url: https://git.ucc.asn.au/?p=matches%2FMCTX3420.git;a=commitdiff_plain;h=47b751c9d92535888a121aeee5a08f5c065d48df Attempt to get image streaming page back from the dead (untested). --- diff --git a/testing/MCTXWeb/public_html/image.html b/testing/MCTXWeb/public_html/image.html new file mode 100644 index 0000000..3148602 --- /dev/null +++ b/testing/MCTXWeb/public_html/image.html @@ -0,0 +1,91 @@ + + + + MCTX3420 Web Interface + + + + + + + + + + + + + +
+ +
+ + +
+ + +
+ + + + +
+
+
Image
+ camera +
+
+ +
+
+ + diff --git a/testing/MCTXWeb/public_html/static/mctx.gui.js b/testing/MCTXWeb/public_html/static/mctx.gui.js index 13ca08e..1c3eb1f 100644 --- a/testing/MCTXWeb/public_html/static/mctx.gui.js +++ b/testing/MCTXWeb/public_html/static/mctx.gui.js @@ -227,6 +227,40 @@ $.fn.logout = function () { }); }; +/** +* Sets the camera autoupdater +* Obsolete? +* @returns {$.fn} +*/ +$.fn.setCamera = function () { + var url = mctx.api + "image"; //http://beaglebone/api/image + var update = true; + + //Stop updating if we can't retrieve an image! + this.error(function() { + update = false; + }); + + var parent = this; + + var updater = function() { + if (!update) { + parent.parent().text("Cam fail"); + parent.attr("src", ""); + return; + } + + parent.attr("src", url + "#" + (new Date()).getTime()); + + setTimeout(updater, 2000); + }; + + updater(); + return this; +}; + + + /** * Sets the error log to continuously update. * @returns itself */