X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=testing%2FMCTXWeb%2Fpublic_html%2Fstatic%2Fmctx.gui.js;h=c64f3c43a0bcff8e030f0f308efbc051e9c0a9fc;hb=c0f2a81316e9135c85e0d9aaf46aeea4e851e156;hp=319805560906450b472252462fff3c9f41dd7fe0;hpb=fc0dc3b827eeff91373db42a78a098200cbf8fa6;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 3198055..c64f3c4 100644 --- a/testing/MCTXWeb/public_html/static/mctx.gui.js +++ b/testing/MCTXWeb/public_html/static/mctx.gui.js @@ -25,8 +25,12 @@ mctx.menu = [ {'text' : 'Help', href : mctx.location + 'help.html'} ]; -mctx.statusCodes = { - STATUS_OK : 1 +mctx.status = { + OK : 1, + ERROR : -1, + UNAUTHORIZED : -2, + NOTRUNNING : -3, + ALREADYEXISTS : -4 }; mctx.statusCodesDescription = { @@ -54,6 +58,9 @@ mctx.actuators = { 3 : {name : "Pressure regulator"} }; +mctx.actuator = {}; +mctx.actuator.pressure_regulator = 0; + mctx.strain_gauges = {}; mctx.strain_gauges.ids = [0, 1, 2, 3]; mctx.strain_gauges.time_limit = 20; @@ -116,7 +123,7 @@ function runBeforeLoad(isLoginPage) { window.location = mctx.location + "login.html"; } } else { - mctx.friendlyName = data.friendly_name; + mctx.friendlyName = data.user_name; } }).fail(function (jqHXR) { if (mctx.debug) { @@ -296,6 +303,14 @@ $.fn.setErrorLog = function () { return this; }; +$.fn.checkStatus = function(data) { + if (data.status !== mctx.status.OK) { + $(this).text(data.description).removeClass("pass").addClass("fail"); + return false; + } + return true; +}; + $(document).ready(function () { //Show the content! $("#content").css("display", "block");