Skip to content

Commit

Permalink
Merge pull request nightscout#23 from nightscout/dev
Browse files Browse the repository at this point in the history
Refresh dev from nightscout/dev
  • Loading branch information
lixgbg authored Jun 25, 2018
2 parents fafd01a + ab9cb16 commit c0bf3a8
Show file tree
Hide file tree
Showing 10 changed files with 8,656 additions and 5,059 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.9.x
8.11.x
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ sudo: required
dist: trusty
node_js:
- "8"
- "9"
- "10"
before_install: if [[ `npm --version` != "5.8.0" ]]; then npm install -g npm@latest; npm --version; fi
matrix:
fast_finish: true
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Community maintained fork of the

Requirements:

- [Node.js](http://nodejs.org/) 8.11.0 LTS or later or [Node.js](http://nodejs.org/) 9.10.0 or later. Use [Install instructions for Node](https://nodejs.org/en/download/package-manager/) or `setup.sh`)
- [Node.js](http://nodejs.org/) 8.11.3 LTS or later or [Node.js](http://nodejs.org/) 10.5.0 or later. Use [Install instructions for Node](https://nodejs.org/en/download/package-manager/) or `setup.sh`)
- [MongoDB](https://www.mongodb.com/download-center?jmp=nav#community) 3.x. MongoDB 2.4 is only supported for Raspberry Pi.

Clone this repo then install dependencies into the root of the project:
Expand Down
11 changes: 9 additions & 2 deletions lib/data/ddata.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,18 @@ function init( ) {
//convert to mgdl
t.targetTop = t.targetTop * 18;
t.targetBottom = t.targetBottom * 18;
t.units = 'mg/dl';
}
}
//if we have a temp target thats below 20, assume its mmol and convert to mgdl for safety.
if ( t.targetTop < 20 ) { t.targetTop = t.targetTop * 18; }
if ( t.targetBottom < 20 ) { t.targetBottom = t.targetBottom * 18; }
if ( t.targetTop < 20 ) {
t.targetTop = t.targetTop * 18;
t.units = 'mg/dl';
}
if ( t.targetBottom < 20 ) {
t.targetBottom = t.targetBottom * 18;
t.units = 'mg/dl';
}
return t.eventType && t.eventType.indexOf('Temporary Target') > -1;
});
if (preserveOrignalTreatments)
Expand Down
15 changes: 12 additions & 3 deletions lib/language.js
Original file line number Diff line number Diff line change
Expand Up @@ -11176,7 +11176,7 @@ function init() {
'alexaBasalTemp': {
bg: '%1 temp basal of %2 units per hour will end %3'
, cs: '%1 temp basal of %2 units per hour will end %3'
, de: '%1 temporäre Basalrate von %2 Einheiten endet in %3'
, de: '%1 temporäre Basalrate von %2 Einheiten endet %3'
, dk: '%1 temp basal of %2 units per hour will end %3'
, el: '%1 temp basal of %2 units per hour will end %3'
, en: '%1 temp basal of %2 units per hour will end %3'
Expand Down Expand Up @@ -11362,7 +11362,7 @@ function init() {
},
'alexaLastLoop': {
en: 'The last successful loop was %1'
, de: 'Der letzte erfolgreiche Loop war vor %1'
, de: 'Der letzte erfolgreiche Loop war %1'
},
'alexaLoopNotAvailable': {
en: 'Loop plugin does not seem to be enabled'
Expand Down Expand Up @@ -11423,14 +11423,23 @@ function init() {
}
,
'Clock View': {
fi: 'Kellonäkymä'
cs: 'Hodiny'
,fi: 'Kellonäkymä'
,nl: 'Klokweergave'
,es: 'Vista del reloj'
,fr: 'Vue Horloge'
,ro: 'Vedere tip ceas'
,ru: 'цифры крупно'
,it: 'Vista orologio'
}
,
'TDD average': {
cs: 'Průměrná denní dávka'
}
,
'Carbs average': {
cs: 'Průměrné množství sacharidů'
}

};

Expand Down
16 changes: 14 additions & 2 deletions lib/report_plugins/daytoday.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,21 @@ daytoday.report = function report_daytoday(datastorage,sorteddaystoshow,options)
var TOOLTIP_TRANS_MS = 300;

var padding = { top: 15, right: 22, bottom: 30, left: 35 };


var tddSum = 0;
var carbsSum = 0;

daytoday.prepareHtml(sorteddaystoshow) ;
sorteddaystoshow.forEach( function eachDay(day) {
drawChart(day,datastorage[day],options);
});


var tddAverage = tddSum / datastorage.alldays;
var carbsAverage = carbsSum / datastorage.alldays;

if (options.insulindistribution)
$('#daytodaycharts').append('<br><br><b>' + translate('TDD average') + ':</b> ' + tddAverage.toFixed(1) + 'U <b>' + translate('Carbs average') + ':</b> ' + carbsAverage.toFixed(0) + 'g');

function timeTicks(n,i) {
var t12 = [
'12am', '', '2am', '', '4am', '', '6am', '', '8am', '', '10am', '',
Expand Down Expand Up @@ -879,6 +888,9 @@ daytoday.report = function report_daytoday(datastorage,sorteddaystoshow,options)
});
}

tddSum += totalDailyInsulin;
carbsSum += data.dailyCarbs;

appendProfileSwitch(context, {
//eventType: 'Profile Switch'
profile: client.profilefunctions.activeProfileToTime(from)
Expand Down
4 changes: 2 additions & 2 deletions lib/report_plugins/glucosedistribution.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ glucosedistribution.report = function report_glucosedistribution(datastorage, so
var nextEntry = glucose_data[i+1];

var timeDelta = nextEntry.displayTime.getTime() - entry.displayTime.getTime();
var timeDelta2 = entry.displayTime.getTime() - nextEntry.displayTime.getTime();
var timeDelta2 = entry.displayTime.getTime() - prevEntry.displayTime.getTime();

var maxGap = (5 * 60 * 1000) + 10000;

Expand Down Expand Up @@ -468,4 +468,4 @@ glucosedistribution.report = function report_glucosedistribution(datastorage, so
report_glucosedistribution(datastorage, sorteddaystoshow, options);
}

};
};
Loading

0 comments on commit c0bf3a8

Please sign in to comment.