From 5544e6f99303a34fa531145db946312adb410fb3 Mon Sep 17 00:00:00 2001 From: chrono Date: Mon, 9 Dec 2013 23:52:17 +0100 Subject: [PATCH] Broken edit timeshifting --- public/assets/js/jquery.flot.draggable.js | 14 ++++++++++++++ public/assets/js/jquery.flot.js | 4 ---- public/assets/js/picoreflow.js | 19 +++++++++++++++---- storage/profiles/leadfree.json | 2 +- 4 files changed, 30 insertions(+), 9 deletions(-) diff --git a/public/assets/js/jquery.flot.draggable.js b/public/assets/js/jquery.flot.draggable.js index 7e1dfbf..9a50734 100644 --- a/public/assets/js/jquery.flot.draggable.js +++ b/public/assets/js/jquery.flot.draggable.js @@ -77,6 +77,20 @@ points[didx*ps+1] = newy; } + + + // funny hack to make drag resizing usable + if (newx > ax.max) + { + graph.plot = $.plot("#graph_container", [ graph.profile, graph.live ] , getOptions()); + } + else if (newx < (ax.max*0.8)) + { + console.log('baba'); + ax.max = ax.max*0.9; + //ax2.max = ax2.max*0.9; + } + plot.draw(); // hack to update the profile points after dragging graph in edit mode diff --git a/public/assets/js/jquery.flot.js b/public/assets/js/jquery.flot.js index a09d563..f4bdb21 100644 --- a/public/assets/js/jquery.flot.js +++ b/public/assets/js/jquery.flot.js @@ -2802,10 +2802,6 @@ Licensed under the MIT license. smallestDistance = maxDistance * maxDistance + 1, item = null, foundPoint = false, i, j, ps; - console.log('max dist:' + maxDistance); - - - for (i = series.length - 1; i >= 0; --i) { if (!seriesFilter(series[i])) continue; diff --git a/public/assets/js/picoreflow.js b/public/assets/js/picoreflow.js index e77963f..eecfbc1 100644 --- a/public/assets/js/picoreflow.js +++ b/public/assets/js/picoreflow.js @@ -6,7 +6,6 @@ var profiles = []; var selected_profile = 0; var selected_profile_name = "leadfree"; - var host = "ws://" + window.location.hostname + ":8080"; var ws_status = new WebSocket(host+"/status"); var ws_control = new WebSocket(host+"/control"); @@ -284,13 +283,25 @@ function getOptions() series: { - lines: { show: true }, - points: { show: true } + lines: + { + show: true + }, + + points: + { + show: true, + radius: 5, + symbol: "circle" + }, + + shadowSize: 3 + }, xaxis: { - tickSize: 30, + //tickSize: 30, min: 0, tickColor: 'rgba(216, 211, 197, 0.2)', font: diff --git a/storage/profiles/leadfree.json b/storage/profiles/leadfree.json index e1531ba..57ea758 100644 --- a/storage/profiles/leadfree.json +++ b/storage/profiles/leadfree.json @@ -1 +1 @@ -{"type": "profile", "data": [[0, 25], [90, 150], [180, 183], [211, 237], [234, 184], [280, 25]], "name": "leadfree"} \ No newline at end of file +{"type": "profile", "data": [[0, 25], [90, 150], [180, 183], [211, 237], [234, 184], [2297420, 137]], "name": "leadfree"} \ No newline at end of file