Here is the latest set with my SOB and some typo fixes for the commit messages.
Event value of 0 for the events that don't really have any value looks a bit weird. would be a better choice, I suppose. miika On Mon, Jul 21, 2014 at 8:32 AM, Miika Turkia <[email protected]> wrote: > On Mon, Jul 21, 2014 at 8:16 AM, Gehad Elrobey <[email protected]> > wrote: > >> >> Hi miika, >> >> On Sun, Jul 20, 2014 at 8:02 AM, Miika Turkia <[email protected]> >> 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 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 <[email protected]> >>> 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 <[email protected]> >>>> wrote: >>>> >>>>> On Tue, Jul 15, 2014 at 4:31 PM, Anton Lundin <[email protected]> >>>>> 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 >>>>> [email protected] >>>>> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface >>>>> >>>> >>>> >>> >> >
From e5705c023345026cb4da7250367774fe2b19a572 Mon Sep 17 00:00:00 2001 From: Gehad elrobey <[email protected]> Date: Mon, 21 Jul 2014 07:02:31 +0200 Subject: [PATCH 10/10] HTML: Fix the viewed search results when change the number of viewed dives. When a search results are shown and the number of showed dives is changed, all the dives are shown. We Just need to preview the first number to show dives from the search results instead of all the dives. Signed-off-by: Gehad elrobey <[email protected]> Signed-off-by: Miika Turkia <[email protected]> --- 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 0789714..c11c349 100644 --- a/theme/list_lib.js +++ b/theme/list_lib.js @@ -160,7 +160,7 @@ function setNumberOfDives(e) var value = e.options[e.selectedIndex].value; sizeofpage = parseInt(value, 10); var end = start + sizeofpage - 1; - view_in_range(start, end); + viewInPage(); } function toggleExpantion(ul) -- 1.9.1
From d33c6c7b59ee7efce67756d0397eccbf0a278800 Mon Sep 17 00:00:00 2001 From: Gehad elrobey <[email protected]> Date: Sun, 20 Jul 2014 22:42:18 +0200 Subject: [PATCH 09/10] HTML: rescale dive profile with page zoom in/out Rescale the dive profile view with page zooming in and out. Signed-off-by: Gehad elrobey <[email protected]> Signed-off-by: Miika Turkia <[email protected]> --- theme/list_lib.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/theme/list_lib.js b/theme/list_lib.js index 7204746..0789714 100644 --- a/theme/list_lib.js +++ b/theme/list_lib.js @@ -1081,3 +1081,7 @@ function switchDives(e) } } } + +window.onresize = function(event) { + plot1.replot( { resetAxes: true } ); +}; -- 1.9.1
From 28b401f4a2e9affb2b00046bfdfefddd81ee3be1 Mon Sep 17 00:00:00 2001 From: Gehad elrobey <[email protected]> Date: Sun, 20 Jul 2014 16:48:10 +0200 Subject: [PATCH 08/10] HTML: fix moving to previous dive by keyboard arrows. 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. Fix the number of dives to prevent throwing exceptions and fix moving between dives smoothly. Signed-off-by: Gehad elrobey <[email protected]> Signed-off-by: Miika Turkia <[email protected]> --- 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 2b5931d..7204746 100644 --- a/theme/list_lib.js +++ b/theme/list_lib.js @@ -1054,7 +1054,7 @@ function unshowDiveDetails(dive) function nextDetailedDive() { - if (dive_id < items.length) { + if (dive_id < items.length - 1) { showDiveDetails(++dive_id); } } -- 1.9.1
From 7c85e66fe3010812f91ddcabd7813e4fd26d9224 Mon Sep 17 00:00:00 2001 From: Gehad elrobey <[email protected]> Date: Sat, 19 Jul 2014 05:26:07 +0200 Subject: [PATCH 07/10] HTML: fix SAC units Sac units is in l/min and not mm/min. Signed-off-by: Gehad elrobey <[email protected]> Signed-off-by: Miika Turkia <[email protected]> --- theme/list_lib.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/theme/list_lib.js b/theme/list_lib.js index 0da1108..2b5931d 100644 --- a/theme/list_lib.js +++ b/theme/list_lib.js @@ -792,8 +792,8 @@ function get_dive_HTML(dive) */ function get_status_HTML(dive) { - return '<h2 class="det_hed">Dive Status</h2><table><tr><td class="words">Sac: </td><td>' + dive.sac + - '</td><td class="words"> Otu: </td><td>' + dive.otu + + return '<h2 class="det_hed">Dive Status</h2><table><tr><td class="words">Sac: </td><td>' + ml_to_litre(dive.sac) + + ' l/min' + '</td><td class="words"> Otu: </td><td>' + dive.otu + '</td><td class="words"> Cns: </td><td>' + dive.cns + '</td></tr></table>'; }; @@ -850,6 +850,11 @@ function mm_to_meter(mm) return mm / (1000); } +function ml_to_litre(ml) +{ + return ml / (1000); +} + function format_two_digit(n) { return n > 9 ? "" + n : "0" + n; -- 1.9.1
From fd84e68e56f18d9c21d415befc312db7e626572e Mon Sep 17 00:00:00 2001 From: Gehad elrobey <[email protected]> Date: Sat, 19 Jul 2014 05:09:48 +0200 Subject: [PATCH 06/10] HTML: add event value to the detailed view. Event value is important in case of gas change and heading events. The value information show: mix and direction. Signed-off-by: Gehad elrobey <[email protected]> Signed-off-by: Miika Turkia <[email protected]> --- save-html.c | 1 + theme/list_lib.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/save-html.c b/save-html.c index 710569d..75f7542 100644 --- a/save-html.c +++ b/save-html.c @@ -36,6 +36,7 @@ void put_HTML_bookmarks(struct membuffer *b, struct dive *dive) put_string(b, "\"events\":["); while (ev) { put_format(b, "{\"name\":\"%s\",", ev->name); + put_format(b, "\"value\":\"%d\",", ev->value); put_format(b, "\"time\":\"%d\",},", ev->time.seconds); ev = ev->next; } diff --git a/theme/list_lib.js b/theme/list_lib.js index 1d0cd90..0da1108 100644 --- a/theme/list_lib.js +++ b/theme/list_lib.js @@ -747,7 +747,7 @@ 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></tr>'; + return '<tr><td class="Cyl">' + event.name + '</td><td class="Cyl">' + int_to_time(event.time) + '</td><td class="Cyl">' + event.value + '</td></tr>'; } /** @@ -758,7 +758,7 @@ function get_bookmarks_HTML(dive) if (dive.events <= 0) return ""; var result = ""; - result += '<h2 class="det_hed">Events</h2><table><tr><td class="words">Name</td><td class="words">Time</td></tr>'; + result += '<h2 class="det_hed">Events</h2><table><tr><td class="words">Name</td><td class="words">Time</td><td class="words">Value</td></tr>'; for (var i in dive.events) { result += get_bookmark_HTML(dive.events[i]); } -- 1.9.1
From 08c5aa4f300d1a2101ab2d9a2314120111ad4c27 Mon Sep 17 00:00:00 2001 From: Gehad elrobey <[email protected]> Date: Sat, 19 Jul 2014 01:49:30 +0200 Subject: [PATCH 05/10] HTML: Add notes variable to the JSON file even if notes don't exist if dive notes don't exist, notes variable must be added to the javascript containing empty value "--", this is more friendly than just showing 'undefined' Signed-off-by: Gehad elrobey <[email protected]> Signed-off-by: Miika Turkia <[email protected]> --- save-html.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/save-html.c b/save-html.c index f6b9a50..710569d 100644 --- a/save-html.c +++ b/save-html.c @@ -114,11 +114,13 @@ void put_HTML_quoted(struct membuffer *b, const char *text) void put_HTML_notes(struct membuffer *b, struct dive *dive, const char *pre, const char *post) { + put_string(b, pre); if (dive->notes) { - put_string(b, pre); put_HTML_quoted(b, dive->notes); - put_string(b, post); + } else { + put_string(b, "--"); } + put_string(b, post); } void put_HTML_time(struct membuffer *b, struct dive *dive, const char *pre, const char *post) -- 1.9.1
From d0e6fabb963bbff33c963ab09cf5c2c7e80a0457 Mon Sep 17 00:00:00 2001 From: Gehad elrobey <[email protected]> Date: Fri, 18 Jul 2014 23:04:14 +0200 Subject: [PATCH 04/10] HTML: Fix the pressure axis if no pressure samples When no pressure samples are available the y-axis on right side gets a bogus legend, this must be fixed and the minimum value is set to zero, as there is no negative pressure value. Signed-off-by: Gehad elrobey <[email protected]> Signed-off-by: Miika Turkia <[email protected]> --- theme/list_lib.js | 1 + 1 file changed, 1 insertion(+) diff --git a/theme/list_lib.js b/theme/list_lib.js index f401518..1d0cd90 100644 --- a/theme/list_lib.js +++ b/theme/list_lib.js @@ -979,6 +979,7 @@ function canvas_draw() pad : 2.05 }, y2axis : { + min : 0, tickRenderer : $.jqplot.CanvasAxisTickRenderer, tickOptions : { formatString : '%ibar' -- 1.9.1
From 76468d7158d0ab8741b96bf9a74a4eda2c6f6956 Mon Sep 17 00:00:00 2001 From: Gehad elrobey <[email protected]> Date: Fri, 18 Jul 2014 16:55:16 +0200 Subject: [PATCH 03/10] HTML: fix searching tags from the detailed view. When clicking a tag in the detailed view a search must take place on the following tag, the search settings must be specified to search for tags only and ignore the advanced search settings chosen by the user. Signed-off-by: Gehad elrobey <[email protected]> Signed-off-by: Miika Turkia <[email protected]> --- theme/dive_export.html | 4 ++-- theme/list_lib.js | 33 +++++++++++++++++++++------------ 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/theme/dive_export.html b/theme/dive_export.html index d9417e2..ebddf40 100644 --- a/theme/dive_export.html +++ b/theme/dive_export.html @@ -123,7 +123,7 @@ window.onload=function(){ function changeAdvSearch(e){ searchingModules[e.value].enabled=e.checked; - SearchModules(document.getElementById("search_input").value); + SearchModules(document.getElementById("search_input").value, null); } </script> @@ -137,7 +137,7 @@ function changeAdvSearch(e){ </center> <div id="diveListPanel"> <div id="controlbox"> - <input id="search_input" oninput="SearchModules(this.value)" placeholder="search"/><a id="adv_srch_sp" onClick="showdiv()" >Advanced Search</a> + <input id="search_input" oninput="SearchModules(this.value, null)" placeholder="search"/><a id="adv_srch_sp" onClick="showdiv()" >Advanced Search</a> <div id="advanced_search"> <input type="checkbox" onchange="changeAdvSearch(this)" value="location" checked>Location<br> <input type="checkbox" onchange="changeAdvSearch(this)" value="divemaster" checked>Divemaster<br> diff --git a/theme/list_lib.js b/theme/list_lib.js index dd7be94..f401518 100644 --- a/theme/list_lib.js +++ b/theme/list_lib.js @@ -206,8 +206,7 @@ function getExpanded(dive) { var res = '<table><tr><td class="words">Date: </td><td>' + dive.date + '</td><td class="words"> Time: </td><td>' + dive.time + - '</td><td class="words"> Location: </td><td>' + '<a onclick=\"Search_list_Modules(\'' + dive.location + '\')\">' + - dive.location + '</a>' + + '</td><td class="words"> Location: </td><td>' + '<a onclick=\"Search_list_Modules(\'' + dive.location + '\', {location:true, divemaster:false, buddy:false, notes:false, tags:false,})\">' + dive.location + '</a>' + '</td></tr></table><table><tr><td class="words">Rating:</td><td>' + putRating(dive.rating) + '</td><td class="words"> Visibilty:</td><td>' + putRating(dive.visibility) + '</td></tr></table>' + @@ -228,7 +227,7 @@ function putTags(tags) { var result = ""; for (var i in tags) { - result += '<a onclick=\"Search_list_Modules(\'' + tags[i] + '\')\">' + tags[i] + '</a>'; + result += '<a onclick=\"Search_list_Modules(\'' + tags[i] + '\', {location:false, divemaster:false, buddy:false, notes:false, tags:true,})\">' + tags[i] + '</a>'; if (i < tags.length - 1) result += ', '; } @@ -481,14 +480,15 @@ function Node(value) this.key = new Set(); } -function Search_list_Modules(searchfor) +function Search_list_Modules(searchfor, searchOptions) { document.getElementById("search_input").value = searchfor; - SearchModules(searchfor); + SearchModules(searchfor, searchOptions); } -function SearchModules(searchfor) +function SearchModules(searchfor, searchOptions) { + unshowDiveDetails(dive_id); var resultKeys = new Set(); //set if (searchfor.length <= 0) { @@ -502,22 +502,31 @@ function SearchModules(searchfor) var keywords = searchfor.split(" "); + if (searchOptions === null) { + searchOptions = {}; + searchOptions.location = searchingModules["location"].enabled; + searchOptions.divemaster = searchingModules["divemaster"].enabled; + searchOptions.buddy = searchingModules["buddy"].enabled; + searchOptions.notes = searchingModules["notes"].enabled; + searchOptions.tags = searchingModules["tags"].enabled; + } + for (var i = 0; i < keywords.length; i++) { var keywordResult = new Set(); - if (searchingModules["location"].enabled === true) + if (searchOptions.location === true) keywordResult.Union(searchingModules["location"].search(keywords[i])); - if (searchingModules["divemaster"].enabled === true) + if (searchOptions.divemaster === true) keywordResult.Union(searchingModules["divemaster"].search(keywords[i])); - if (searchingModules["buddy"].enabled === true) + if (searchOptions.buddy === true) keywordResult.Union(searchingModules["buddy"].search(keywords[i])); - if (searchingModules["notes"].enabled === true) + if (searchOptions.notes === true) keywordResult.Union(searchingModules["notes"].search(keywords[i])); - if (searchingModules["tags"].enabled === true) + if (searchOptions.tags === true) keywordResult.Union(searchingModules["tags"].search(keywords[i])); if (resultKeys.isEmpty()) { @@ -764,7 +773,7 @@ function get_dive_HTML(dive) { return '<h2 class="det_hed">Dive Information</h2><table><tr><td class="words">Date: </td><td>' + dive.date + '</td><td class="words"> Time: </td><td>' + dive.time + - '</td><td class="words"> Location: </td><td>' + '<a onclick=\"Search_list_Modules(\'' + dive.location + '\')\">' + + '</td><td class="words"> Location: </td><td>' + '<a onclick=\"Search_list_Modules(\'' + dive.location + '\', {location:true, divemaster:false, buddy:false, notes:false, tags:false,})\">' + dive.location + '</a>' + '</td></tr></table><table><tr><td class="words">Rating:</td><td>' + putRating(dive.rating) + '</td><td class="words"> Visibilty:</td><td>' + putRating(dive.visibility) + -- 1.9.1
From ed376ca6cdc90fcf0b506a2ce06608d4e4c1813b Mon Sep 17 00:00:00 2001 From: Gehad elrobey <[email protected]> Date: Thu, 17 Jul 2014 05:15:28 +0200 Subject: [PATCH 02/10] HTML: list-lib Search must support spaces in the search string The search result of a string consisting of separate words must be the intersection of the search results of each word. This way searching strings with spaces will be supported. Signed-off-by: Gehad elrobey <[email protected]> Signed-off-by: Miika Turkia <[email protected]> --- theme/list_lib.js | 48 +++++++++++++++++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/theme/list_lib.js b/theme/list_lib.js index 6ba3660..dd7be94 100644 --- a/theme/list_lib.js +++ b/theme/list_lib.js @@ -460,6 +460,20 @@ Set.prototype.Union = function(another_set) }; }; +Set.prototype.intersect = function(another_set) +{ + if (another_set === null) { + return; + } + var result = new Array(); + for (var i = 0; i < another_set.keys.length; i++) { + if(this.contains(another_set.keys[i])) { + result.push(another_set.keys[i]); + } + }; + this.keys = result; +}; + function Node(value) { this.children = new Array(); @@ -486,24 +500,32 @@ function SearchModules(searchfor) return; } - searchingModules.forEach (function(x) { - resultKeys.Union(x.search(searchfor)); - }); + var keywords = searchfor.split(" "); + + for (var i = 0; i < keywords.length; i++) { + var keywordResult = new Set(); + + if (searchingModules["location"].enabled === true) + keywordResult.Union(searchingModules["location"].search(keywords[i])); - if (searchingModules["location"].enabled === true) - resultKeys.Union(searchingModules["location"].search(searchfor)); + if (searchingModules["divemaster"].enabled === true) + keywordResult.Union(searchingModules["divemaster"].search(keywords[i])); - if (searchingModules["divemaster"].enabled === true) - resultKeys.Union(searchingModules["divemaster"].search(searchfor)); + if (searchingModules["buddy"].enabled === true) + keywordResult.Union(searchingModules["buddy"].search(keywords[i])); - if (searchingModules["buddy"].enabled === true) - resultKeys.Union(searchingModules["buddy"].search(searchfor)); + if (searchingModules["notes"].enabled === true) + keywordResult.Union(searchingModules["notes"].search(keywords[i])); - if (searchingModules["notes"].enabled === true) - resultKeys.Union(searchingModules["notes"].search(searchfor)); + if (searchingModules["tags"].enabled === true) + keywordResult.Union(searchingModules["tags"].search(keywords[i])); - if (searchingModules["tags"].enabled === true) - resultKeys.Union(searchingModules["tags"].search(searchfor)); + if (resultKeys.isEmpty()) { + resultKeys.Union(keywordResult); + } else { + resultKeys.intersect(keywordResult); + } + } if (resultKeys.isEmpty()) { //didn't find keys -- 1.9.1
From 49151fbd68aa72f1056389c992004bb2bd27e91f Mon Sep 17 00:00:00 2001 From: Gehad elrobey <[email protected]> Date: Wed, 16 Jul 2014 14:38:20 +0200 Subject: [PATCH 01/10] HTML: don't add photos or dive status if exporting list only If export list only option is chosen, photos and dive status must not be added to the export. Signed-off-by: Gehad elrobey <[email protected]> Signed-off-by: Miika Turkia <[email protected]> --- save-html.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/save-html.c b/save-html.c index 324d543..f6b9a50 100644 --- a/save-html.c +++ b/save-html.c @@ -191,14 +191,14 @@ void write_one_dive(struct membuffer *b, struct dive *dive, const char *photos_d write_attribute(b, "buddy", dive->buddy); write_attribute(b, "divemaster", dive->divemaster); write_attribute(b, "suit", dive->suit); - write_dive_status(b, dive); - save_photos(b, photos_dir, dive); put_HTML_tags(b, dive, "\"tags\":", ","); put_HTML_notes(b, dive, "\"notes\":\"", "\","); if (!list_only) { put_cylinder_HTML(b, dive); put_HTML_samples(b, dive); put_HTML_bookmarks(b, dive); + write_dive_status(b, dive); + save_photos(b, photos_dir, dive); } put_string(b, "},\n"); (*dive_no)++; -- 1.9.1
_______________________________________________ subsurface mailing list [email protected] http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
