X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=testing%2FMCTXWeb%2Fpublic_html%2Fstatic%2Fmctx.gui.js;h=606c0be942230a8b2bb9473032e681f1bd4fdc43;hb=989a1d2ff5f5afc20f78738f57cc829ae9d11e99;hp=478e9ad30c8789f6a936c4fffd4a94b1b2737221;hpb=ed189a5dd5b5ca6c052d75704dec3f58fe410387;p=matches%2FMCTX3420.git diff --git a/testing/MCTXWeb/public_html/static/mctx.gui.js b/testing/MCTXWeb/public_html/static/mctx.gui.js index 478e9ad..606c0be 100644 --- a/testing/MCTXWeb/public_html/static/mctx.gui.js +++ b/testing/MCTXWeb/public_html/static/mctx.gui.js @@ -3,16 +3,27 @@ */ mctx = {}; -//mctx.api = location.protocol + "/" + location.host + "/api/"; -mctx.api = "http://mctx.us.to:8080/api/"; +mctx.api = location.protocol + "//" + location.host + "/api/"; mctx.expected_api_version = 0; +mctx.key = undefined; +mctx.has_control = false; + +mctx.return_codes = { + "1" : "Ok", + "-1" : "General error", + "-2" : "Unauthorized", + "-3" : "Not running", + "-4" : "Already exists" +}; + mctx.sensors = { 0 : {name : "Strain gauge 1"}, 1 : {name : "Strain gauge 2"}, 2 : {name : "Strain gauge 3"}, 3 : {name : "Strain gauge 4"}, 4 : {name : "Pressure sensor 1"}, - 5 : {name : "Pressure sensor 2"} + 5 : {name : "Pressure sensor 2"}, + 6 : {name : "Pressure sensor 3"} }; mctx.actuators = { @@ -22,39 +33,59 @@ mctx.actuators = { 3 : {name : "Pressure regulator"} }; +mctx.strain_gauges = {}; +mctx.strain_gauges.ids = [0, 1, 2, 3]; +mctx.strain_gauges.time_limit = 20; + +/** + * Writes the current date to wherever it's called. + */ function getDate(){ document.write((new Date()).toDateString()); } -/** - * Populates the navigation bar +/** + * Populates a submenu of the navigation bar + * @param {string} header The header + * @param {object} items An object representing the submenu items + * @param {function} translator A function that translates an object item + * into a text and href. + * @returns {$.fn} Itself */ -$.fn.populateNavbar = function () { - var menu = $("