Skip to content

Commit

Permalink
Increase rendering granularity to support AAPS TBRs nightscout#8281
Browse files Browse the repository at this point in the history
From Milos
  • Loading branch information
psonnera committed Aug 7, 2024
1 parent 21e0591 commit 731c638
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/client/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,7 @@ function init (client, d3) {
}
}
lastbasal = basalvalue;
date += times.mins(1).msecs;
date += times.secs(1).msecs;
}

var toTempBasal = profile.getTempBasal(to);
Expand Down
6 changes: 3 additions & 3 deletions lib/report_plugins/daytoday.js
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ daytoday.report = function report_daytoday (datastorage, sorteddaystoshow, optio
console.log("Device COB status available: ", cobStatusAvailable);
console.log("Device IOB status available: ", iobStatusAvailable);

for (var dt = moment(from); dt < to; dt.add(5, 'minutes')) {
for (var dt = moment(from); dt < to; dt.add(5, 'seconds')) {
if (options.iob && !iobStatusAvailable) {
var iob = client.plugins('iob').calcTotal(datastorage.treatments, datastorage.devicestatus, profile, dt.toDate()).iob;
// make the graph discontinuous when data is missing
Expand Down Expand Up @@ -503,8 +503,8 @@ daytoday.report = function report_daytoday (datastorage, sorteddaystoshow, optio
var hournow = dt.hour();
var basalvalue = profile.getTempBasal(date);
// Calculate basal stats
baseBasalInsulin += basalvalue.basal * 5 / 60; // 5 minutes part
var tempPart = (basalvalue.tempbasal - basalvalue.basal) * 5 / 60;
baseBasalInsulin += basalvalue.basal * 1 / 3600; // 1 secs part
var tempPart = (basalvalue.tempbasal - basalvalue.basal) * 1 / 3600;
if (tempPart > 0) {
positiveTemps += tempPart;
data.netBasalPositive[hournow] += tempPart;
Expand Down

0 comments on commit 731c638

Please sign in to comment.