Skip to content

Commit

Permalink
Merge pull request #461 from Maprunner/dev
Browse files Browse the repository at this point in the history
Release 1.5.8
  • Loading branch information
Maprunner authored Jan 11, 2020
2 parents 76c84bc + d811f3a commit 138d114
Show file tree
Hide file tree
Showing 22 changed files with 512 additions and 315 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Routegadget 2

## Latest news
Version 1.5.7 was released on 30th December 2018 and is installed on all routegadget.co.uk sites.
Version 1.5.8 was released on 11th January 2020 and is installed on all routegadget.co.uk sites. This includes several enhancements.

This improves the statistics display by adding tabs to reduce some of the scrolling. Double click on a runner on the results tab to see this.
* The statistics display (accessed by double clicking on a runner on the results tab) has been further updated and now includes "performance" and "consistency" values. Performance represents how well you did against the average of the top 25% of splits for each leg. A higher score is better. Consistency gives an indication of how your performance on each leg varied. A lower score is better.

It also fixes an IOF XML V3 results import bug which meant that missing controls were not being handled correctly.
* Colour-coding of GPS routes for georeferenced maps is now based on minutes per kilometer. You can configure the speed range by setting the fast (green) and slow (red) speeds from the configuration dialog. Points below the slow setting are displayed in blue.

* Various minor changes have been made to improve the handling of incomplete results (e.g. missing punches).

## User Guide and Introductory Videos

Expand Down
6 changes: 4 additions & 2 deletions app/route.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,9 @@ private static function expandCoords($coords)
if (strlen($coords) < 5) {
return array("", "");
}
$xy = explode("N", $coords);

// cope with strange zero-filled routes that start with ;
$xy = explode("N", ltrim($coords, ';'));
$x = array();
$y = array();
foreach ($xy as $point) {
Expand All @@ -374,4 +376,4 @@ private static function expandCoords($coords)
// used to return as integer arrays, but this caused memory problems in json_encode
return array(implode(",", $x), implode(",", $y));
}
}
}
2 changes: 1 addition & 1 deletion css/rg2-1.5.7.min.css → css/rg2-1.5.8.min.css

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion css/rg2.css
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,18 @@ html, body {
padding-right: 5px;
}

#spn-map-intensity, #spn-course-width, #spn-route-width, #spn-name-font-size, #spn-route-intensity, #spn-control-circle, #spn-offset {
.rg2-spinner {
width: 40px;
}

.rg2-run-green {
color: green;
}

.rg2-run-red {
color: red;
}

.options {
float: right;
padding-right: 5px;
Expand Down
89 changes: 50 additions & 39 deletions html/options.html
Original file line number Diff line number Diff line change
@@ -1,39 +1,50 @@
<div id="rg2-option-controls">
<div id="rg2-language-select" class="options">
<label for="rg2-select-language">Language</label>
<select id="rg2-select-language"></select>
</div>
<div id="rg2-dim-spinner" class='options'>
<label for="spn-map-intensity">Map intensity %</label>
<input id="spn-map-intensity" />
</div>
<div id="rg2-dim-route-spinner" class='options'>
<label for="spn-route-intensity">Route intensity %</label>
<input id="spn-route-intensity" />
</div>
<div id="rg2-route-width-spinner" class='options'>
<label for="spn-route-width">Route width</label>
<input id="spn-route-width" />
</div>
<div id="rg2-names-spinner" class='options'>
<label for="spn-name-font-size">Replay label font size</label>
<input id="spn-name-font-size" />
</div>
<div id="rg2-course-width-spinner" class='options'>
<label for="spn-course-width">Course overprint width</label>
<input id="spn-course-width" />
</div>
<div id="rg2-control-circle-spinner" class='options'>
<label for="spn-control-circle">Control circle size</label>
<input id="spn-control-circle" />
</div>
<div id="rg2-snap-toggle" class='options'>
<label for="chk-snap-toggle">Snap to control when drawing</label><input type=checkbox id="chk-snap-toggle">
</div>
<div id="rg2-show-seconds" class='options'>
<label for="chk-show-three-seconds">Show +3 time loss for GPS routes</label><input type=checkbox id="chk-show-three-seconds">
</div>
<div id="rg2-show-GPS-speed" class='options'>
<label for="chk-show-GPS-speed">Show GPS speed colours</label><input type=checkbox id="chk-show-GPS-speed">
</div>
</div>
<div id="rg2-option-controls">
<div id="rg2-language-select" class="options">
<label for="rg2-select-language">Language</label>
<select id="rg2-select-language"></select>
</div>
<div id="rg2-dim-spinner" class='options'>
<label for="spn-map-intensity">Map intensity %</label>
<input class="rg2-spinner" id="spn-map-intensity" />
</div>
<div id="rg2-dim-route-spinner" class='options'>
<label for="spn-route-intensity">Route intensity %</label>
<input class="rg2-spinner" id="spn-route-intensity" />
</div>
<div id="rg2-route-width-spinner" class='options'>
<label for="spn-route-width">Route width</label>
<input class="rg2-spinner" id="spn-route-width" />
</div>
<div id="rg2-names-spinner" class='options'>
<label for="spn-name-font-size">Replay label font size</label>
<input class="rg2-spinner" id="spn-name-font-size" />
</div>
<div id="rg2-course-width-spinner" class='options'>
<label for="spn-course-width">Course overprint width</label>
<input class="rg2-spinner" id="spn-course-width" />
</div>
<div id="rg2-control-circle-spinner" class='options'>
<label for="spn-control-circle">Control circle size</label>
<input class="rg2-spinner" id="spn-control-circle" />
</div>
<div id="rg2-snap-toggle" class='options'>
<label for="chk-snap-toggle">Snap to control when drawing</label><input type=checkbox id="chk-snap-toggle">
</div>
<div id="rg2-show-seconds" class='options'>
<label for="chk-show-three-seconds">Show +3 time loss for GPS routes</label><input type=checkbox
id="chk-show-three-seconds">
</div>
<div id="rg2-show-GPS-speed" class='options'>
<label for="chk-show-GPS-speed">Show GPS speed colours</label><input type=checkbox id="chk-show-GPS-speed">
</div>
<div id="rg2-max-speed-spinner" class='options'>
<i title="Fast" class="fa fa-smile rg2-run-green"></i>
<label for="spn-max-speed">min/km</label>
<input class="rg2-spinner" id="spn-max-speed" />
</div>
<div id="rg2-min-speed-spinner" class="options">
<i title="Fast" class="fa fa-frown rg2-run-red"></i>
<label for="spn-min-speed">min/km</label>
<input class="rg2-spinner" id="spn-min-speed" />
</div>
</div>
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
require(dirname(__FILE__) . '/app/utils.php');

// version replaced by Gruntfile as part of release
define('RG2VERSION', '1.5.7');
define('RG2VERSION', '1.5.8');
define("RG_LOG_FILE", dirname(__FILE__)."/log/rg2log.txt");

if (file_exists(dirname(__FILE__) . '/rg2-config.php')) {
Expand Down
17 changes: 11 additions & 6 deletions js/canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,14 @@
ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height);
// go back to where we started
ctx.restore();
// set transparency of map
ctx.globalAlpha = rg2.options.mapIntensity;
if (map.height > 0) {
// set map background white so that dimmed maps do not have grey showing through
ctx.fillStyle = rg2.config.WHITE;
// this might have been reset by the ctx.restore()
ctx.globalAlpha = rg2.config.FULL_INTENSITY;
ctx.fillRect(0, 0, map.width, map.height);
// set transparency of map
ctx.globalAlpha = rg2.options.mapIntensity;
// using non-zero map height to show we have a map loaded
ctx.drawImage(map, 0, 0);
var active = $("#rg2-info-panel").tabs("option", "active");
Expand Down Expand Up @@ -132,7 +137,7 @@
function showInfoDisplay(show, title, position) {
var chevronRemove, chevronAdd;
rg2.input.infoPanelMaximised = show;
$("#rg2-resize-info").prop("title", rg2.t(title));
$("#rg2-resize-info").prop("title", rg2.t(title));
$("#rg2-hide-info-panel-control").css("left", position);
if (show) {
$("#rg2-info-panel").show();
Expand All @@ -143,7 +148,7 @@
chevronRemove = "fa-chevron-left";
chevronAdd = "fa-chevron-right";
}
$("#rg2-hide-info-panel-icon").removeClass(chevronRemove).addClass(chevronAdd).prop("title", rg2.t(title));
$("#rg2-hide-info-panel-icon").removeClass(chevronRemove).addClass(chevronAdd).prop("title", rg2.t(title));
}

function resizeInfoDisplay() {
Expand Down Expand Up @@ -238,7 +243,7 @@
}

function getMapSize() {
return {height: map.height, width: map.width};
return { height: map.height, width: map.width };
}

function resizeCanvas() {
Expand Down Expand Up @@ -283,7 +288,7 @@
rg2.zoom = zoom;
rg2.rotateMap = rotateMap;
rg2.alignMap = alignMap;
rg2.redraw = redraw;
rg2.redraw = redraw;
rg2.canvas = canvas;
rg2.setUpCanvas = setUpCanvas;
rg2.ctx = ctx;
Expand Down
111 changes: 57 additions & 54 deletions js/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,52 +6,52 @@
var config, options, dictionary;

config = {
DEFAULT_SCALE_FACTOR : 1.1,
TAB_EVENTS : 0,
TAB_COURSES : 1,
TAB_RESULTS : 2,
TAB_DRAW : 3,
TAB_LOGIN : 4,
TAB_CREATE : 5,
TAB_EDIT : 6,
TAB_MAP : 7,
DEFAULT_SCALE_FACTOR: 1.1,
TAB_EVENTS: 0,
TAB_COURSES: 1,
TAB_RESULTS: 2,
TAB_DRAW: 3,
TAB_LOGIN: 4,
TAB_CREATE: 5,
TAB_EDIT: 6,
TAB_MAP: 7,
INVALID_MAP_ID: 9999,
// translated when output so leave as English here
DEFAULT_NEW_COMMENT : "Type your comment",
DEFAULT_EVENT_COMMENT : "Comments (optional)",
DEFAULT_NEW_COMMENT: "Type your comment",
DEFAULT_EVENT_COMMENT: "Comments (optional)",
// added to resultid when saving a GPS track
GPS_RESULT_OFFSET : 50000,
MASS_START_REPLAY : 1,
REAL_TIME_REPLAY : 2,
GPS_RESULT_OFFSET: 50000,
MASS_START_REPLAY: 1,
REAL_TIME_REPLAY: 2,
// dropdown selection value
MASS_START_BY_CONTROL : 99999,
VERY_HIGH_TIME_IN_SECS : 99999,
MASS_START_BY_CONTROL: 99999,
VERY_HIGH_TIME_IN_SECS: 99999,
// screen sizes for different layouts
BIG_SCREEN_BREAK_POINT : 800,
SMALL_SCREEN_BREAK_POINT : 500,
PURPLE : '#b300ff',
RED : '#ff0000',
GREEN : '#00ff00',
GREY : '#e0e0e0',
RED_30 : 'rgba(255,0,0,0.3)',
GREEN_30 : 'rgba(0,255,0,0.3)',
WHITE : '#ffffff',
BLACK : '#000000',
RUNNER_DOT_RADIUS : 6,
HANDLE_DOT_RADIUS : 7,
BIG_SCREEN_BREAK_POINT: 800,
SMALL_SCREEN_BREAK_POINT: 500,
PURPLE: '#b300ff',
RED: '#ff0000',
GREEN: '#00ff00',
GREY: '#e0e0e0',
RED_30: 'rgba(255,0,0,0.3)',
GREEN_30: 'rgba(0,255,0,0.3)',
WHITE: '#ffffff',
BLACK: '#000000',
RUNNER_DOT_RADIUS: 6,
HANDLE_DOT_RADIUS: 7,
HANDLE_COLOUR: '#ff0000',
// parameters for call to draw courses
DIM : 0.75,
FULL_INTENSITY : 1.0,
DIM: 0.75,
FULL_INTENSITY: 1.0,
// values of event format
NORMAL_EVENT : 1,
EVENT_WITHOUT_RESULTS : 2,
SCORE_EVENT : 3,
NORMAL_EVENT: 1,
EVENT_WITHOUT_RESULTS: 2,
SCORE_EVENT: 3,
// version gets set automatically by grunt file during build process
RG2VERSION: '1.5.7',
TIME_NOT_FOUND : 9999,
RG2VERSION: '1.5.8',
TIME_NOT_FOUND: 9999,
// values for evt.which
RIGHT_CLICK : 3,
RIGHT_CLICK: 3,
DO_NOT_SAVE_COURSE: 9999,
FORMAT_NORMAL: 1,
FORMAT_NO_RESULTS: 2,
Expand All @@ -61,32 +61,35 @@
MAX_DRAWN_ROUTES: 10,
// array of available languages: not great to do it like this but it helps for routegadget.co.uk set-up
languages: [
{language: "Deutsch", code: "de"},
{language: "Suomi", code: "fi"},
{language: "Français", code: "fr"},
{language: "Italiano", code: "it"},
{language: "日本語", code: "ja"},
{language: "Norsk", code: "no"},
{language: "Português - Brasil", code: "pt"},
{language: "Русский", code: "ru"}
{ language: "Deutsch", code: "de" },
{ language: "Suomi", code: "fi" },
{ language: "Français", code: "fr" },
{ language: "Italiano", code: "it" },
{ language: "日本語", code: "ja" },
{ language: "Norsk", code: "no" },
{ language: "Português - Brasil", code: "pt" },
{ language: "Русский", code: "ru" }
],
// Size of map upload in MB that triggers the warning dialog
FILE_SIZE_WARNING: 2
};

options = {
// initialised to default values: overwritten from storage later
mapIntensity : 1,
routeIntensity : 1,
replayFontSize : 12,
courseWidth : 3,
routeWidth : 4,
circleSize : 20,
snap : true,
showThreeSeconds : false,
showGPSSpeed : false,
mapIntensity: 1,
routeIntensity: 1,
replayFontSize: 12,
courseWidth: 3,
routeWidth: 4,
circleSize: 20,
snap: true,
showThreeSeconds: false,
showGPSSpeed: false,
// align map with next control at top when drawing route
alignMap: false,
// speeds in min/km
maxSpeed: 4,
minSpeed: 15,
// array of up to MAX_DRAWN_ROUTES entries with details to allow deletion
// stored in order they are added, so first entry is most recent and gets deleted if necessary
drawnRoutes: []
Expand Down Expand Up @@ -292,5 +295,5 @@
rg2.setDictionary = setDictionary;
rg2.getDictionaryCode = getDictionaryCode;
rg2.setLanguageOptions = setLanguageOptions;
rg2.createLanguageDropdown = createLanguageDropdown;
rg2.createLanguageDropdown = createLanguageDropdown;
}());
Loading

0 comments on commit 138d114

Please sign in to comment.