diff --git a/public/assets/js/picoreflow.js b/public/assets/js/picoreflow.js index 48bb342..20226cb 100644 --- a/public/assets/js/picoreflow.js +++ b/public/assets/js/picoreflow.js @@ -81,8 +81,8 @@ function updateProfileTable() if (dps == 0) { slope = "right"; color[0]="white"; color[1]="grey"; } html += '

' + i + '

'; - html += ''; - html += ''; + html += ''; + html += ''; html += '
'; html += ' '; @@ -91,6 +91,20 @@ function updateProfileTable() html += ''; $('#profile_table').html(html); + + //Link table to graph + $(".form-control").change(function(e) + { + var id = $(this)[0].id//e.currentTarget.attributes.id; + var value = parseInt($(this)[0].value); + var fields = id.split("-"); + var col = parseInt(fields[1]); + var row = parseInt(fields[2]); + + graph.profile.data[row][col] = value; + graph.plot = $.plot("#graph_container", [ graph.profile, graph.live ], getOptions()); + updateProfileTable(); + }); } function runTask() @@ -538,5 +552,6 @@ $(document).ready(function() { update_profile(e.val); }); + } });