Thanks, you had one 'return' missing, which I added and did some rewording on the commit messages.
The lines on the horizontal axis are a bit weird currently. Shown on the attached screenshot. The depth and pressure units get misaligned due to the static temperature fix (I guess). miika On Sun, Jul 27, 2014 at 11:01 PM, Gehad Elrobey <gehadelro...@gmail.com> wrote: > I Attached four patches that fix the mentioned bugs. I ll still work on > more improvements for the current javascript code. > > Regards, > Gehad > > > On Fri, Jul 25, 2014 at 8:02 AM, Miika Turkia <miika.tur...@gmail.com> > wrote: > >> On Thu, Jul 24, 2014 at 10:29 PM, Gehad Elrobey <gehadelro...@gmail.com> >> wrote: >> >>> >>> I attached a patch with two more fixes. >>> Now most of the bugs list seems to be resolved. >>> >> >> It seems that the temperature graph is not drawn, if the temperature is >> constant the whole dive. >> >> The layout seems to change for me when I open a dive on the divelist. >> This is due to scrollbar appears on the browser window. If you could come >> up with something that keeps the layout the same in this case. This >> requires on my screen that I export just a few dives, having 10 dives on >> the page causes the scroll bar to be there to begin with. >> >> Could give a - as value for such events that don't have any sensible >> values. I suppose that heading is the only event where value 0 makes sense. >> >> Dive equipments seems to only include the cylinder information. It could >> have also weight and suite... or the title should be changed to cylinder. >> >> >> >>> what do you recommend to be added for now? and what things are missing >>> or need to be fixed as a priority? >>> >> >> A statistics page could be next one to implement. Yearly and trip based >> stats of the key values. You could also implement something that is >> currently missing from Subsurface GUI - statistics of how many specific >> tags are there, how many dives with certain buddies etc. One could come up >> with quite a few ideas about how to graph different statistics out of the >> date that is kept... But take small steps implementing this stuff. Better >> to have basic stuff properly implemented first than a whole lot of >> incomplete mess... >> >> >>> On Mon, Jul 21, 2014 at 7:32 AM, Miika Turkia <miika.tur...@gmail.com> >>> wrote: >>> >>>> On Mon, Jul 21, 2014 at 8:16 AM, Gehad Elrobey <gehadelro...@gmail.com> >>>> wrote: >>>> >>>>> >>>>> Hi miika, >>>>> >>>>> On Sun, Jul 20, 2014 at 8:02 AM, Miika Turkia <miika.tur...@gmail.com> >>>>> wrote: >>>>> >>>>>> New bugs I spotted: >>>>>> >>>>>> - The tooltip on temperature graphs shows actually the time >>>>>> (concatenated with temperature unit). >>>>>> >>>>> >>>>> what is it supposed to show? I think this is consistent will all the >>>>> other curves in the profile. >>>>> >>>> >>>> It should show the temperature value. The temperature graph is drawn >>>> based on the temperature correctly, but the tooltip shows time since start >>>> of the time, not the temperature. >>>> >>> >>> I Can't reproduce this at all, this is working correctly with me in all >>> the dives I have (Please see the attachments). >>> >> >> Seems that I mis-read the value - thought the time is part of the >> temperature. Maybe you could use colon instead of comma to separate the >> time from the actual value. It would be a bit clearer that it is not 8,6 C >> :D >> >> miika >> >>> >>> >>>> >>>> >>>>> I Also fixed the previous patches, and attached some new patches with >>>>> them. >>>>> There are still three bugs that I am working on them now. >>>>> >>>> >>>> Thanks, I'll have a look later. >>>> >>>> >>>>> - I am not sure about the search of location - e.g. if I write >>>>>> "Mexico somethingthatdoesnotexist", I get all the locations in Mexico. >>>>>> - Zooming in (ctrl++) and out (ctrl+-) and restoring zoom level >>>>>> (ctrl+0) on firefox does not rescale the graph properly >>>>>> - The heading and gaschange switches should use the value field from >>>>>> the event, not the type field (type is still internal to subsurface, and >>>>>> does not provide any useful information to the users, on the other hand >>>>>> value would e.g. tell what gas we changed to) >>>>>> >>>>> >>>>> Regarding the event value, is exporting the event value as a number is >>>>> useful? or there is some enum strings that must be shown instead? >>>>> >>>> >>>> The heading is degrees, as in compass. >>>> >>>> The gas change event's value contains the o2 per centage, of the gas >>>> mix, or it can also contain the o2 and he content. Low order bits being o2 >>>> and high order bits the he: >>>> he = cur_event.value >> 16 >>>> o2 = cur_event.value & 0xffff >>>> >>>> miika >>>> >>>> >>>>> - If I go to next dive on detailed view, and hit one extra right >>>>>> arrows after reaching the last dive, first click on left does not change >>>>>> the selection, only re-clicking on left does >>>>>> >>>>>> I'll still do a bit of poking around once I have more time... >>>>>> >>>>>> miika >>>>>> >>>>>> >>>>>> On Sat, Jul 19, 2014 at 6:30 AM, Gehad Elrobey < >>>>>> gehadelro...@gmail.com> wrote: >>>>>> >>>>>>> I Attached some bug fixes, Still working on the remaining bugs. >>>>>>> >>>>>>> Regards, >>>>>>> Gehad. >>>>>>> >>>>>>> >>>>>>> On Tue, Jul 15, 2014 at 11:22 PM, Tomaz Canabrava < >>>>>>> tcanabr...@kde.org> wrote: >>>>>>> >>>>>>>> On Tue, Jul 15, 2014 at 4:31 PM, Anton Lundin <gla...@acc.umu.se> >>>>>>>> wrote: >>>>>>>> > On 15 July, 2014 - Anton Lundin wrote: >>>>>>>> > >>>>>>>> >> On 15 July, 2014 - Miika Turkia wrote: >>>>>>>> >> >>>>>>>> >> > A few more bugs: >>>>>>>> >> > - Trimix dives are missing He content (use e.g. test20.xml for >>>>>>>> testing >>>>>>>> >> > purposes) - Reported by Roberto, but mailing list was not >>>>>>>> included >>>>>>>> >> >>>>>>>> >> Gaah. This is code that uses the event data straight off. In the >>>>>>>> case of >>>>>>>> >> SAMPLE_EVENT_GASCHANGE especially we need to map the event to the >>>>>>>> >> available cylinders and that way figure out which gas we are >>>>>>>> using. >>>>>>>> >> >>>>>>>> >> Almost every place where we use get_gasmix_from_event we should >>>>>>>> be using >>>>>>>> >> get_cylinder_index instead and grab the "real" gasmix from the >>>>>>>> cylinder, >>>>>>>> >> except the case where get_gasmix_from_event is called from >>>>>>>> >> get_cylinder_index =) >>>>>>>> >> >>>>>>>> >> >>>>>>>> >> This was more work than anticipated when i first gave it a stab. >>>>>>>> If no >>>>>>>> >> one else untangles this I'll give it another stab later. >>>>>>>> >> >>>>>>>> >> >>>>>>>> > >>>>>>>> > Gaah 2. >>>>>>>> > >>>>>>>> > I of course miss-read the report and i was talking about what we >>>>>>>> write >>>>>>>> > in the regular-non-html-ui. >>>>>>>> > >>>>>>>> > I found another bug. >>>>>>>> >>>>>>>> :P >>>>>>>> >>>>>>>> > //Anton >>>>>>>> _______________________________________________ >>>>>>>> subsurface mailing list >>>>>>>> subsurface@hohndel.org >>>>>>>> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface >>>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> >
From 41dedc3cfaf21515ed5cb7395f9a0712908a6000 Mon Sep 17 00:00:00 2001 From: Gehad elrobey <gehadelro...@gmail.com> Date: Sun, 27 Jul 2014 21:38:50 +0200 Subject: [PATCH 5/5] HTML: add weight systems to the dive equipments section. Add weights systems to the dive equipment list. Signed-off-by: Gehad elrobey <gehadelro...@gmail.com> Signed-off-by: Miika Turkia <miika.tur...@gmail.com> --- save-html.c | 22 ++++++++++++++++++++++ theme/list_lib.js | 28 ++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/save-html.c b/save-html.c index f777de0..652ffb4 100644 --- a/save-html.c +++ b/save-html.c @@ -44,6 +44,27 @@ void put_HTML_bookmarks(struct membuffer *b, struct dive *dive) put_string(b, "],"); } +static void put_weightsystem_HTML(struct membuffer *b, struct dive *dive) +{ + int i, nr; + + nr = nr_weightsystems(dive); + + put_string(b, "\"Weights\":["); + + for (i = 0; i < nr; i++) { + weightsystem_t *ws = dive->weightsystem + i; + int grams = ws->weight.grams; + const char *description = ws->description; + + put_string(b, "{"); + put_format(b, "\"weight\":\"%d\",", grams); + write_attribute(b, "description", description); + put_string(b, "},"); + } + put_string(b, "],"); +} + static void put_cylinder_HTML(struct membuffer *b, struct dive *dive) { int i, nr; @@ -199,6 +220,7 @@ void write_one_dive(struct membuffer *b, struct dive *dive, const char *photos_d put_HTML_notes(b, dive, "\"notes\":\"", "\","); if (!list_only) { put_cylinder_HTML(b, dive); + put_weightsystem_HTML(b, dive); put_HTML_samples(b, dive); put_HTML_bookmarks(b, dive); write_dive_status(b, dive); diff --git a/theme/list_lib.js b/theme/list_lib.js index 094cc26..88a6210 100644 --- a/theme/list_lib.js +++ b/theme/list_lib.js @@ -736,6 +736,28 @@ function lastNonZero() } /** +*Return the HTML string for a dive weight entry in the table. +*/ +function get_weight_HTML(weight) +{ + return '<tr><td class="Cyl">' + gram_to_km(weight.weight) + ' kg ' + '</td><td class="Cyl">' + weight.description + '</td></tr>'; +} + +/** +*Return HTML table of weights of a dive. +*/ +function get_weights_HTML(dive) +{ + var result = ""; + result += '<table><tr><td class="words">Weight</td><td class="words">Type</td></tr>'; + for (var i in dive.Weights) { + result += get_weight_HTML(dive.Weights[i]); + } + result += '</table>'; + return result; +} + +/** *Return the HTML string for a dive cylinder entry in the table. */ function get_cylinder_HTML(cylinder) @@ -890,6 +912,11 @@ function mm_to_meter(mm) return mm / (1000); } +function gram_to_km(gram) +{ + return gram / 1000; +} + function ml_to_litre(ml) { return ml / (1000); @@ -1067,6 +1094,7 @@ function showDiveDetails(dive) //draw the canvas and initialize the view document.getElementById("diveinfo").innerHTML = get_dive_HTML(items[dive_id]); document.getElementById("dive_equipments").innerHTML = get_cylinders_HTML(items[dive_id]); + document.getElementById("dive_equipments").innerHTML += get_weights_HTML(items[dive_id]); document.getElementById("bookmarks").innerHTML = get_bookmarks_HTML(items[dive_id]); document.getElementById("divestats").innerHTML = get_status_HTML(items[dive_id]); document.getElementById("slider").innerHTML = get_dive_photos(items[dive_id]); -- 1.9.1
From 1e44ba395584d6f966b0083012482f8165dbf137 Mon Sep 17 00:00:00 2001 From: Gehad elrobey <gehadelro...@gmail.com> Date: Sat, 26 Jul 2014 16:59:49 +0200 Subject: [PATCH 4/5] HTML: Fix constant value temperature curve. When temperature is constant the temperature curve is stuck at the top of the profile view. Maximum temperature value is set to 50 degrees C. This will always put the curve in the right place. Signed-off-by: Gehad elrobey <gehadelro...@gmail.com> Signed-off-by: Miika Turkia <miika.tur...@gmail.com> --- theme/list_lib.js | 1 + 1 file changed, 1 insertion(+) diff --git a/theme/list_lib.js b/theme/list_lib.js index 135a0f9..094cc26 100644 --- a/theme/list_lib.js +++ b/theme/list_lib.js @@ -1038,6 +1038,7 @@ function canvas_draw() }, y3axis : { padMax : 3.05, + max : 50, tickOptions: { showGridline: false, showMark: false, -- 1.9.1
From fc4b74dcd45541d40e8653cf1ee20453a8ccdde3 Mon Sep 17 00:00:00 2001 From: Gehad elrobey <gehadelro...@gmail.com> Date: Sat, 26 Jul 2014 16:58:27 +0200 Subject: [PATCH 3/5] HTML: fix jqplot memory leaks when replot the profile. When replot the profile, old plots must be deleted to avoid memory leaks. Signed-off-by: Gehad elrobey <gehadelro...@gmail.com> Signed-off-by: Miika Turkia <miika.tur...@gmail.com> --- theme/list_lib.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/theme/list_lib.js b/theme/list_lib.js index 124cd78..135a0f9 100644 --- a/theme/list_lib.js +++ b/theme/list_lib.js @@ -949,6 +949,11 @@ function canvas_draw() 0 ]); } + if (plot1) + { + $('chart1').unbind(); + plot1.destroy(); + } plot1 = $.jqplot('chart1', [ depthData, pressureData, -- 1.9.1
From 99ad17c742863309149efd3832330c9ffcf923ad Mon Sep 17 00:00:00 2001 From: Miika Turkia <miika.tur...@gmail.com> Date: Mon, 28 Jul 2014 16:55:37 +0300 Subject: [PATCH 2/5] Return the heading value on HTML export HTML export was erroneously not returning the heading value. Signed-off-by: Miika Turkia <miika.tur...@gmail.com> --- theme/list_lib.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/theme/list_lib.js b/theme/list_lib.js index e4b9837..124cd78 100644 --- a/theme/list_lib.js +++ b/theme/list_lib.js @@ -777,7 +777,7 @@ function get_event_value(event) return 'He: ' + he + ' - O2: ' + o2; } if (event.type == 23) { // heading - event.value; + return event.value; } return '-'; } -- 1.9.1
From 4c7d6dba2f21cb9f6971b4a2eecefb77ef8953d5 Mon Sep 17 00:00:00 2001 From: Gehad elrobey <gehadelro...@gmail.com> Date: Sat, 26 Jul 2014 16:29:16 +0200 Subject: [PATCH 1/5] HTML: Fix event value fields. - The gas event values can contain o2 and he mix in gas change events. - Give a '-' value for events that don't have any sensible values. - Show event value if event type is heading or gaschange. Signed-off-by: Gehad elrobey <gehadelro...@gmail.com> Signed-off-by: Miika Turkia <miika.tur...@gmail.com> --- save-html.c | 1 + theme/list_lib.js | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/save-html.c b/save-html.c index 75f7542..f777de0 100644 --- a/save-html.c +++ b/save-html.c @@ -37,6 +37,7 @@ void put_HTML_bookmarks(struct membuffer *b, struct dive *dive) while (ev) { put_format(b, "{\"name\":\"%s\",", ev->name); put_format(b, "\"value\":\"%d\",", ev->value); + put_format(b, "\"type\":\"%d\",", ev->type); put_format(b, "\"time\":\"%d\",},", ev->time.seconds); ev = ev->next; } diff --git a/theme/list_lib.js b/theme/list_lib.js index 904bde5..e4b9837 100644 --- a/theme/list_lib.js +++ b/theme/list_lib.js @@ -769,12 +769,25 @@ function get_cylinders_HTML(dive) return result; } +function get_event_value(event) +{ + if (event.type == 11 || event.type == 25) { // gas change + var he = event.value >> 16; + var o2 = event.value & 0xffff; + return 'He: ' + he + ' - O2: ' + o2; + } + if (event.type == 23) { // heading + event.value; + } + return '-'; +} + /** Return the HTML string for a bookmark entry in the table. */ function get_bookmark_HTML(event) { - return '<tr><td class="Cyl">' + event.name + '</td><td class="Cyl">' + int_to_time(event.time) + '</td><td class="Cyl">' + event.value + '</td></tr>'; + return '<tr><td class="Cyl">' + event.name + '</td><td class="Cyl">' + int_to_time(event.time) + '</td><td class="Cyl">' + get_event_value(event) + '</td></tr>'; } /** -- 1.9.1
_______________________________________________ subsurface mailing list subsurface@hohndel.org http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface