Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
164 commits
Select commit Hold shift + click to select a range
2801f07
intial IOB experiments
Sep 25, 2014
36cac06
Initial port of DIYPS IOB and insulin activity formulas
scottleibrand Sep 25, 2014
b85690d
the most basic copy and paste profile api possible
Sep 25, 2014
00c20da
Merge branch 'wip/iob-cob' of github.com:nightscout/cgm-remote-monito…
Sep 25, 2014
35a21f8
removing @jasoncalabrese's copy
scottleibrand Sep 25, 2014
cdfe0e0
Merge branch 'wip/iob-cob' of github.com:nightscout/cgm-remote-monito…
scottleibrand Sep 25, 2014
b040815
forgot to git add some profile api files
Sep 25, 2014
1762d57
Merge branch 'wip/iob-cob' of github.com:nightscout/cgm-remote-monito…
Sep 25, 2014
98285a9
no POSTs yet
Sep 25, 2014
c78aa0b
pull sensitivity and DIA from profiles collection via API
scottleibrand Sep 25, 2014
4f3b702
Merge branch 'wip/iob-cob' of github.com:nightscout/cgm-remote-monito…
scottleibrand Sep 25, 2014
d194aa6
Merge branch 'master' into wip/iob-cob
Sep 25, 2014
0378ebe
@danamlewis came up with some more intuitive labels
scottleibrand Sep 26, 2014
e96b563
Added cob calculation
scottleibrand Sep 26, 2014
a96cd30
include rawIsig and friends
scottleibrand Sep 27, 2014
9afd036
this writes rawBg to console, but doesn't display it
scottleibrand Sep 27, 2014
97e8e79
initial rawBg plot as white dot overlay
scottleibrand Sep 27, 2014
c937c5a
fix updateBrushToNon typo, add error-checking in function rawIsigToRa…
scottleibrand Sep 27, 2014
27510ac
don't run rawIsigToRawBg calcs on null values
scottleibrand Sep 29, 2014
8bdfe67
added BG predictions based on insulin and carb activity
scottleibrand Sep 30, 2014
3116b78
fix isDecaying logic so carb impact works, and display total impact
scottleibrand Sep 30, 2014
76729db
working IOB and COB based BG predictions
scottleibrand Sep 30, 2014
c693c00
Merge branch 'wip/iob-cob' of github.com:nightscout/cgm-remote-monito…
Oct 1, 2014
c017405
nest profiles.list so loadData is only call once
Oct 1, 2014
f812cd0
pass time to retrospectively predict BGs
scottleibrand Oct 1, 2014
b7b4861
Merge branch 'wip/iob-cob' of github.com:nightscout/cgm-remote-monito…
scottleibrand Oct 1, 2014
2fb0e93
add separate line for Current Carb Impact
scottleibrand Oct 1, 2014
a493a14
insulin impact should be negative
scottleibrand Oct 1, 2014
519758e
Merge branch 'dev' into wip/iob-cob
Oct 1, 2014
e601d24
bgPrediction bugfixes, and switch to 1m ticks
scottleibrand Oct 1, 2014
16b0471
Merge branch 'wip/iob-cob' of github.com:nightscout/cgm-remote-monito…
scottleibrand Oct 1, 2014
8fb61b4
predict 1h into the future, with 1m resolution
scottleibrand Oct 1, 2014
1673c30
Merge branch 'dev' into wip/iob-cob
Oct 1, 2014
5197e45
added DIYPS S-curve predictions
scottleibrand Oct 2, 2014
b0dd5cd
predict 2 hours ahead, and display 6h total
scottleibrand Oct 4, 2014
a61805f
stop using rawbgs for predictions, and merge some stuff from predictA…
scottleibrand Oct 4, 2014
c8f3a5f
display predict_hr of retrospective predictions instead of just 30m
scottleibrand Oct 4, 2014
fd4ca62
replace sCurve with 30m of predictAR predictions
scottleibrand Oct 4, 2014
5ad13ce
predict 4h and display 3h of predictions
scottleibrand Oct 4, 2014
4aa5b80
average impact of predBg and predAR, don't sum them
scottleibrand Oct 4, 2014
66402c5
workaround to AR to support 1-minute resolution
scottleibrand Oct 4, 2014
69a9dca
Revert "workaround to AR to support 1-minute resolution"
scottleibrand Oct 4, 2014
dd3e57e
retrospective prediction: show with blue line where the 1h-prior pred…
scottleibrand Oct 6, 2014
c34079b
display carb ratios
scottleibrand Oct 8, 2014
d553285
fix predictDIYPS to actually use predictAR
scottleibrand Oct 8, 2014
1840fa6
show 4 days' data instead of 2
scottleibrand Oct 8, 2014
e799e0d
use last 200 treatments for retroPrediction
scottleibrand Oct 8, 2014
475b190
start predictAR from most recent datapoint, not lookback-ago
scottleibrand Oct 8, 2014
08ea19e
use treatment.created_at not treatment.date to calculate COB
scottleibrand Oct 9, 2014
27dd234
display IOB/COB, and make blue/white dots smaller
scottleibrand Oct 16, 2014
de3f751
show IOB/COB properly for retrospective brushing too
scottleibrand Oct 16, 2014
12ef6de
calculate Total Carbs Absorbed in last 8h
scottleibrand Oct 22, 2014
8fc5a36
Display BG Impact, and better blend predBG and predAR results
scottleibrand Oct 22, 2014
3788ce5
attempt to prevent pebble to only read SGV values
bewest Oct 16, 2014
fda9316
fix mmol panning to show mmol
bewest Oct 16, 2014
636b5ea
cherry-pick of give mbg's an outline to make them more distinct
Oct 17, 2014
0fe504a
Added option to choose preferred date format (12 or 24 hours)
asidorovichgodel Sep 1, 2014
5207217
Merge branch 'dev' into wip/iob-cob
scottleibrand Oct 22, 2014
551c07c
make carb absorption a function of hepatic insulin activity
scottleibrand Oct 30, 2014
23123c7
s/tCOB/cCalc/g
scottleibrand Oct 31, 2014
3c9225f
make retroLookback UI-configurable
scottleibrand Oct 31, 2014
28f6eb9
merged dev into iob-cob, fixed minor conflicts in server.js
Oct 31, 2014
635bf65
Merge branch 'dev' into wip/iob-cob
Oct 31, 2014
05c7412
fix new insulin-dependent carb decay algorithm to use avgActivity ins…
scottleibrand Nov 1, 2014
d5af5bb
Merge branch 'wip/iob-cob' of github.com:nightscout/cgm-remote-monito…
scottleibrand Nov 1, 2014
b1698d3
Rough outline of DIYPS functions with refactored carb algorithms
scottleibrand Nov 2, 2014
7fd93e8
Rough outline of DIYPS functions with refactored carb algorithms
scottleibrand Nov 2, 2014
e91e0bc
merged dev into wip/iob-cob; adds true websocket support and fixes fo…
Nov 2, 2014
f0f2161
Merge latest nightscout:dev into wip/iob-cob
scottleibrand Nov 3, 2014
8e61145
Merge branch 'wip/iob-cob' of https://github.com/nightscout/cgm-remot…
scottleibrand Nov 3, 2014
9239a58
Merge branch 'nightscout-wip/iob-cob' into wip/iob-cob
scottleibrand Nov 3, 2014
cb410e9
process calData, and filtered/unfiltered/rssi fields in cgmData
scottleibrand Nov 3, 2014
0a62682
define and actually use calData
scottleibrand Nov 3, 2014
959cdd1
put cal records at the end of the patientData array, and don't check …
scottleibrand Nov 3, 2014
f29e178
typofix
scottleibrand Nov 3, 2014
5d361bb
use Cookie cal records for rawBg
scottleibrand Nov 3, 2014
93e8b31
Merge pull request #217 from scottleibrand/wip/iob-cob
jasoncalabrese Nov 4, 2014
d3905a1
fix cal/rawBg bug
scottleibrand Nov 7, 2014
08bf696
fix cal/rawBg bugs, and scale by sgv/filtered ratio when available
scottleibrand Nov 7, 2014
7a77dcc
Merge pull request #230 from scottleibrand/wip/iob-cob
scottleibrand Nov 7, 2014
268acf2
display 5m SGV delta between SGV and arrow
scottleibrand Nov 12, 2014
a65298a
Merge pull request #249 from scottleibrand/wip/iob-cob
jasoncalabrese Nov 13, 2014
7bd2247
make paths relative
scottleibrand Nov 14, 2014
f643459
Merge wip/add-ssl (and everything it inherited from dev) into wip/iob…
scottleibrand Nov 14, 2014
305ce99
Revert "make paths relative"
scottleibrand Nov 14, 2014
638103c
Merge branch 'wip/add-ssl' of https://github.com/nightscout/cgm-remot…
scottleibrand Nov 14, 2014
f035952
Merge branch 'nightscout-wip/add-ssl' into wip/iob-cob
scottleibrand Nov 14, 2014
0b0b487
disable websockets for now, causing more trouble then it's worth
scottleibrand Nov 14, 2014
968c910
Merge branch 'master' into wip/iob-cob
scottleibrand Nov 14, 2014
efdc979
Merge pull request #257 from nightscout/master
scottleibrand Nov 14, 2014
8f36829
disable retroPredictions while brushing
scottleibrand Nov 16, 2014
83d2c9d
Merge branch 'wip/iob-cob' into nightscout/wip/iob-cob
scottleibrand Nov 16, 2014
3f865aa
don't error if no calibration data
bewest Nov 17, 2014
52f50f6
place customTitle before Nightscout for visibility on narrow tabs
scottleibrand Nov 17, 2014
eb58fe3
Update iob-cob.html title to put Nightscout at the end
scottleibrand Nov 28, 2014
bf8cab1
just display unadjusted white rawBg dots when sgv < 30 (error), and c…
scottleibrand Nov 28, 2014
e299ea6
first attempt to merge nightscout dev (including bgDelta stuff)
scottleibrand Nov 28, 2014
1f560ed
fix duplicate currentDelta merge error
scottleibrand Nov 29, 2014
f75d95a
add wip/iob-cob setup notes to README
scottleibrand Nov 29, 2014
149e085
math fix for averaging predBgDelta and predARDelta
scottleibrand Nov 29, 2014
03d979f
Merge branch 'dev' into wip/iob-cob
Nov 30, 2014
51cdd94
Merge branch 'dev' into wip/iob-cob
Nov 30, 2014
a687a67
moved BG impact to delta line
Nov 30, 2014
9bba76b
return IOB to the pebble endpoint
Nov 30, 2014
c3e7b47
Merge branch 'dev' into wip/iob-cob
Nov 30, 2014
70d9528
Merge branch 'dev' of github.com:nightscout/cgm-remote-monitor into w…
Nov 30, 2014
90f3343
Merge branch 'dev' of github.com:nightscout/cgm-remote-monitor into w…
Nov 30, 2014
b9a0599
Merge branch 'wip/iob-cob' of github.com:nightscout/cgm-remote-monito…
Nov 30, 2014
de9a611
added units back for the delta; removed the delta symbol
Dec 1, 2014
3fb60c4
Merge branch 'wip/iob-cob' into wip/iob-pebble
Dec 1, 2014
db5b9b9
Merge pull request #285 from jasoncalabrese/wip/iob-cob
jasoncalabrese Dec 1, 2014
2a0446d
a little clean up
Dec 1, 2014
ba775fa
Merge branch 'dev' into wip/iob-cob
Dec 2, 2014
59d5ac3
get rid all the treatment slicing since we only return current data now
Dec 2, 2014
bb7c171
Merge branch 'wip/iob-cob' of github.com:nightscout/cgm-remote-monito…
Dec 2, 2014
edb6a0c
Merge pull request #288 from jasoncalabrese/wip/iob-pebble
scottleibrand Dec 2, 2014
79550f2
treatments.find now want an opts to set the number date range
Dec 2, 2014
ab42e4f
quick fix for profile reader to ignore non-DIA documents (such as for…
scottleibrand Dec 14, 2014
a065303
fix for mmol delta string
Dec 14, 2014
6de2726
Merge pull request #298 from jasoncalabrese/wip/iob-cob-mmolfix
jasoncalabrese Dec 14, 2014
19bc40e
only return the most recent treatment data via websockets; added opts…
Nov 30, 2014
6e4b5cf
don't try to add strings
scottleibrand Dec 14, 2014
8de8fba
Merge branch 'nightscout-dev' into wip/iob-cob
scottleibrand Dec 14, 2014
dcd8505
Merge branch 'dev' into wip/iob-cob
Dec 16, 2014
a1ae249
Merge branch 'dev' into wip/iob-cob
Dec 20, 2014
26d13e3
css adjustments so IOB/COB displays whenin short-landscape mode
Dec 20, 2014
4f031fd
fixed filter so that we still get raw durring ???, fixes #295
Dec 27, 2014
43b4fe4
drop liverCarbImpactMax from 1 to .7
scottleibrand Dec 27, 2014
6c475c9
Merge branch 'nightscout-dev' into wip/iob-cob
scottleibrand Dec 27, 2014
d9d6da8
Merge branch 'nightscout-wip/iob-cob' into wip/iob-cob
scottleibrand Dec 27, 2014
9079b1f
error checking for missing sgv data. use rawbg data if nothing else …
scottleibrand Dec 28, 2014
f1f999a
merged dev into wip/iob-cob and corrected tons of conflicts
Jan 7, 2015
ce0ce9b
merged dev into iob-cob and fixed minor conflict
Jan 8, 2015
280caeb
Merge branch 'dev' into wip/iob-cob
Jan 11, 2015
be9bb37
Merge branch 'nightscout-wip/iob-cob' into wip/iob-cob
scottleibrand Jan 12, 2015
f75c15b
Merge branch 'master' into wip/iob-cob
Jan 14, 2015
66db6be
merged dev into wip/iob-cob and fix some minor conflicts
Jan 22, 2015
f0f793d
Merge branch 'dev' into wip/iob-cob
Jan 24, 2015
61007f2
merge dev into iob-cob, fixed conflict with focusCircles
Jan 24, 2015
23c808e
Merge pull request #314 from scottleibrand/wip/iob-cob
jasoncalabrese Jan 24, 2015
cde5da0
Merge branch 'master' into wip/iob-cob
Jan 28, 2015
fdffde3
Merge branch 'dev' into wip/iob-cob
Jan 28, 2015
1cd0c5d
merged dev into iob-cob and fixed tons of conflicts
jasoncalabrese Feb 8, 2015
0f3120c
merged raw-checks into iob-cob and adjusted defaults so rawbg is auto…
jasoncalabrese Feb 8, 2015
f809142
merged phablet-limits into iob-cob, fixed conflicts and improved iob-…
jasoncalabrese Feb 8, 2015
f83fc2f
fixed bugs with the pebble endpoint after the merge, also removed non…
jasoncalabrese Feb 8, 2015
b9a22df
fixed call to rawIsigToRawBg from bgPredictions when sgv is below dex…
jasoncalabrese Feb 9, 2015
19fd818
fixed IOB-COB display on the short/narrow screen of the iOS app on a …
jasoncalabrese Feb 9, 2015
e7f2f2a
merged dev into iob-cob; fixed conflict and some mmol rounding bugs
jasoncalabrese Feb 10, 2015
e874912
merged dev into iob-cob-raw-update and fixed more conflict
jasoncalabrese Feb 12, 2015
1139ba1
Merge branch 'master' of https://github.com/nightscout/cgm-remote-mon…
jasoncalabrese Feb 14, 2015
57c8e99
Merge branch 'release/0.6.4' into dev
jasoncalabrese Feb 14, 2015
813cb63
merge in master and fixed conflicts
jasoncalabrese Feb 14, 2015
a3c9682
fix coveralls badge branch
dduugg Feb 15, 2015
ecdabe8
overhaul Makefile and .travis.yml
dduugg Feb 14, 2015
37d74a9
Merge pull request #399 from jasoncalabrese/wip/iob-cob-raw-update
jasoncalabrese Feb 18, 2015
64ad3f7
fix environmental variable example
dduugg Feb 25, 2015
7f75ac6
allow arbitrary DIAs in profile
mgranberry Feb 25, 2015
e25c6ab
align IOB calculations
mgranberry Feb 25, 2015
c205057
Merge pull request #435 from dduugg/wip/fix-readme
jasoncalabrese Feb 25, 2015
cc812e4
Merge pull request #417 from dduugg/wip/travis
jasoncalabrese Feb 25, 2015
d616b6c
Merge pull request #416 from dduugg/wip/contributing
jasoncalabrese Feb 25, 2015
ddfef10
Merge branch 'dev' into wip/iob-cob
jasoncalabrese Feb 26, 2015
141f00a
Merge pull request #436 from mgranberry/wip/iob-cob
jasoncalabrese Feb 26, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
put cal records at the end of the patientData array, and don't check …
…them in is_different
  • Loading branch information
scottleibrand committed Nov 3, 2014
commit 959cdd1316632d68a3ea176294e60ba0f3ffe9fe
12 changes: 5 additions & 7 deletions lib/websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ function loadData() {
//TODO: need to consider when data being sent has less than the 2 day minimum

// consolidate and send the data to the client
var shouldEmit = is_different(actual, predicted, mbg, cal, treatment, errorCode, profile);
patientData = [actual, predicted, mbg, cal, treatment, errorCode, profile];
var shouldEmit = is_different(actual, predicted, mbg, treatment, errorCode, profile, cal);
patientData = [actual, predicted, mbg, treatment, errorCode, profile, cal];
console.log('patientData', patientData.length);
if (shouldEmit) {
emitData( );
Expand All @@ -283,23 +283,21 @@ function loadData() {
}
}
}
function is_different (actual, predicted, mbg, cal, treatment, errorCode) {
function is_different (actual, predicted, mbg, treatment, errorCode) {
if (patientData && patientData.length < 3) {
return true;
}
var old = {
actual: patientData[0].slice(-1).pop( )
, predicted: patientData[1].slice(-1).pop( )
, mbg: patientData[2].slice(-1).pop( )
, cal: patientData[3].slice(-1).pop( )
, treatment: patientData[4].slice(-1).pop( )
, errorCode: patientData.length >= 6 ? patientData[5] : 0
, treatment: patientData[3].slice(-1).pop( )
, errorCode: patientData.length >= 5 ? patientData[4] : 0
};
var last = {
actual: actual.slice(-1).pop( )
, predicted: predicted.slice(-1).pop( )
, mbg: mbg.slice(-1).pop( )
, cal: cal.slice(-1).pop( )
, treatment: treatment.slice(-1).pop( )
, errorCode: errorCode
};
Expand Down