From: Jeremy Tan Date: Sun, 29 Sep 2013 07:40:34 +0000 (+0800) Subject: update gui X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=9bdafbf8ef5a813c08161cb0a8b386f7c0e778e0;hp=2ca5f448220a19baed8d3b6e1fa8b385c19c8871;p=matches%2FMCTX3420.git update gui --- diff --git a/testing/MCTXWeb/public_html/pintest.html b/testing/MCTXWeb/public_html/pintest.html new file mode 100644 index 0000000..5d0527b --- /dev/null +++ b/testing/MCTXWeb/public_html/pintest.html @@ -0,0 +1,156 @@ + + + + BeagleBone Black Pin Test + + + + + + + + + + + + + + + + + +
+ + + +
+
+
Dashboard
+ + + + + +
+ GPIO + + + PWM + +
+ +
Error log
+ +
+ +
+
Analogue input (ADC)
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
AIN01234567
Value
Export
+
+
+ +
+
GPIO controls
+
+ +
+
PWM controls
+
+
+ +
+ + diff --git a/testing/MCTXWeb/public_html/static/mctx.gui.js b/testing/MCTXWeb/public_html/static/mctx.gui.js index a9e8ae7..180c395 100644 --- a/testing/MCTXWeb/public_html/static/mctx.gui.js +++ b/testing/MCTXWeb/public_html/static/mctx.gui.js @@ -81,8 +81,8 @@ $.fn.populateNavbar = function () { return {text : items[item].name, href : href}; }; - menu.populateSubmenu("Sensor data", mctx.sensors, sensorTranslator); - menu.populateSubmenu("Actuator data", mctx.actuators, actuatorTranslator); + menu.populateSubmenu("Sensor data dump", mctx.sensors, sensorTranslator); + menu.populateSubmenu("Actuator data dump", mctx.actuators, actuatorTranslator); menu.appendTo(this); return this; } diff --git a/testing/MCTXWeb/public_html/static/mctx.pintest.js b/testing/MCTXWeb/public_html/static/mctx.pintest.js new file mode 100644 index 0000000..7a792e8 --- /dev/null +++ b/testing/MCTXWeb/public_html/static/mctx.pintest.js @@ -0,0 +1,246 @@ +/** + * mctx.pintest: Pin test stuff. + * Must be included after mctx.gui.js + */ + + +mctx.pintest = {}; +mctx.pintest.gpios = [ + 4, 5, 8, 9, 10, 11, 14, 15, 26, 27, 30, 31, 44, 45, + 46, 47, 48, 49, 60, 61, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 112, 115 + ]; +mctx.pintest.pwms = [0, 1, 2, 3, 4, 5, 6, 7]; +mctx.pintest.refreshRate = 750; + + +function unexport (type, number, container, menu) { + var url = mctx.api + "pin"; + + $.ajax({url : url, data : {type : type, num : number, export : -1}}) + .fail(function () { + switch(type) { + case "adc" : + var text = container.find("input[type='text'][name='" + number + "']"); + var check = container.find("input[type='checkbox'][name='unexport']"); + text.empty(); + check.attr("checked", true); + break; + case "gpi": case "gpo" : + container.remove(); + menu.append($("