mirror of
https://github.com/bckelley/cgm-remote-monitor.git
synced 2026-08-24 03:14:12 -05:00
D3 Upgrade Residual Cleanup (#5140)
* fix forecast limit logic (cherry picked from commit e88ce7e5d1f5fb12c71ae67da4131ff1a50940c9) * fix minimum focus forecast time * make min forecast 30 min
This commit is contained in:
@@ -82,12 +82,17 @@ function init (client, d3) {
|
||||
var shownForecastPoints = _.filter(client.sbx.pluginBase.forecastPoints, function isShown (point) {
|
||||
return client.settings.showForecast.indexOf(point.info.type) > -1;
|
||||
});
|
||||
var maxForecastMills = _.max(_.map(shownForecastPoints, function(point) { return point.mills }));
|
||||
// limit lookahead to the same as lookback
|
||||
var selectedRange = chart().createAdjustedRange();
|
||||
var selectedRange = chart().createBrushedRange();
|
||||
var to = selectedRange[1].getTime();
|
||||
|
||||
var focusHoursAheadMills = to + client.focusRangeMS;
|
||||
var focusHoursAheadMills = to + times.mins(30).msecs;
|
||||
var maxForecastMills = focusHoursAheadMills;
|
||||
|
||||
if (shownForecastPoints.length > 0) {
|
||||
maxForecastMills = _.max(_.map(shownForecastPoints, function(point) { return point.mills }));
|
||||
}
|
||||
|
||||
maxForecastMills = Math.min(focusHoursAheadMills, maxForecastMills);
|
||||
client.forecastTime = maxForecastMills > 0 ? maxForecastMills - client.sbx.lastSGVMills() : 0;
|
||||
focusData = focusData.concat(shownForecastPoints);
|
||||
@@ -1028,7 +1033,7 @@ function init (client, d3) {
|
||||
var comboareadata = [];
|
||||
var selectedRange = chart().createAdjustedRange();
|
||||
var from = selectedRange[0].getTime();
|
||||
var to = Math.max(selectedRange[1].getTime(), client.sbx.time) + client.forecastTime;
|
||||
var to = selectedRange[1].getTime();
|
||||
|
||||
var date = from;
|
||||
var lastbasal = 0;
|
||||
|
||||
Reference in New Issue
Block a user