X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=testing%2FMCTXWeb%2Fpublic_html%2Fstatic%2Fmctx.graph.js;h=fd475ad876d540ddec3eac497e0618361dabd548;hb=7e9d726ccd53626251e56b92c8eec47772bfe0f9;hp=687db8413744dc05699a3b4d8d2f5c4de28c223b;hpb=efd9baef20d693f70259634c565cffb3da7cc940;p=matches%2FMCTX3420.git diff --git a/testing/MCTXWeb/public_html/static/mctx.graph.js b/testing/MCTXWeb/public_html/static/mctx.graph.js index 687db84..fd475ad 100644 --- a/testing/MCTXWeb/public_html/static/mctx.graph.js +++ b/testing/MCTXWeb/public_html/static/mctx.graph.js @@ -11,10 +11,13 @@ mctx.graph.api.sensors = mctx.api + "sensors"; mctx.graph.api.actuators = mctx.api + "actuators"; mctx.sensors = {}; mctx.actuators = {}; + +mctx.graph.devices = {}; mctx.graph.dependent = null; mctx.graph.independent = null; mctx.graph.timer = null; mctx.graph.running = false; +mctx.graph.chart = null; /** * Helper - Calculate pairs of (dependent, independent) values @@ -22,6 +25,15 @@ mctx.graph.running = false; * Appends each value pair to the result * @returns result */ +/** + * Helper - Calculate pairs of (dependent, independent) values + * Given input as (time, value) pairs for dependent and independent + * Appends each value pair to the result + * @param {array[][]} dependent Dependent data to be correlated with independent + * @param {array[][]} independent Independent data + * @param {array[][]} result Storage location + * @returns {dataMerge.result} + */ function dataMerge(dependent, independent, result) { var j = 0; for (var i = 0; i < dependent.length-1; ++i) { @@ -55,12 +67,13 @@ $.fn.deployDevices = function(input_type, check_first, group) { var apply = function(dict, prefix) { $.each(dict, function(key, val) { var attributes = { - 'type' : input_type, 'value' : key, 'alt' : val, + 'type' : input_type, 'value' : key, 'alt' : val.name, 'class' : prefix, 'name' : group, - 'id' : prefix + '_' + val //Unique id (name mangling) + 'id' : prefix + '_' + val.name //Unique id (name mangling) }; + var entry = $("", attributes); - var label = $("