Skip to content

Instantly share code, notes, and snippets.

package com.nightscout.core.drivers.Medtronic;
import com.nightscout.core.dexcom.Utils;
import com.nightscout.core.drivers.Medtronic.records.BasalProfileStart;
import com.nightscout.core.drivers.Medtronic.records.BatteryActivity;
import com.nightscout.core.drivers.Medtronic.records.Bolus;
import com.nightscout.core.drivers.Medtronic.records.BolusWizard;
import com.nightscout.core.drivers.Medtronic.records.BolusWizardChange;
import com.nightscout.core.drivers.Medtronic.records.CalBgForPh;
import com.nightscout.core.drivers.Medtronic.records.ChangeBasalProfile;
function LinearPredict(CGMValues, MeanSquareDiscrepancy, LinearPredictionCoefficients) {
// Brace that opens LinearPredict function
// Given a complete vector of CGM "interstitial glucose" values, CGMValues[0,...,n-1], this function returns m linear
// prediction coefficients as LinearPredictionCoefficients[0,...,m-1], and returns the mean square discrepancy as
// MeanSquareDiscrepancy
var i, j, k, n = data.size(), m = data.size();
<!DOCTYPE html>
<html>
<body>
<script>
function iobCalc(treatment_time, time2)
{
var peak = 75;
var dia = 3;
1u drops 40mg/dl
1u covers 10g carbs
15 min carb delay
30g carbs/hr
At 1200: BG 400, take 7.5u to drop BG to 100
At 1245: Eat 30g carbs
At 1300: Absorb starts. Expected end time for absorbing 1400. Given a 4 hour dia, BG drop is going to be ~1/4 of total expected drop = 75mg/dl during that hour. 75mg/dl is equivalent to 1.875u. This covers 18.75g carbs. This would normally take 37.5 minutes to absorb.
With a liverSensRatio of 1, this means the end of absorbtion will be pushed out to 1438. With a liverSensRatio of 8, the 18.75g carbs becomes 150g, which then takes 5 hours to be absorbed. This pushes the end of absorbtion up to 1800.
> usb@0.3.11 install E:\Src\Diabetes\comlink2-uart\node_modules\usb
> node shyp-blacklist.js win32-x64 win32-ia32 darwin-x64 || node-gyp rebuild
E:\Src\Diabetes\comlink2-uart\node_modules\usb>if not defined npm_config_node_gyp (node "E:\Program Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Copying C:/Program Files/libusb/MS32/dll/libusb-1.0.dll to E:\Src\Diabetes\comlink2-uart\node_modules\usb\build\Release\\libusb-1.0.dll
1 file(s) copied.
node_usb.cc
E:\Src\Diabetes\comlink2-uart>node examples\history_usb.js redacted
got bunyan
howdy
E:\Src\Diabetes\comlink2-uart\node_modules\usb\usb.js:25
this.__open()
^
Error: LIBUSB_ERROR_NOT_SUPPORTED
at Device.usb.Device.open (E:\Src\Diabetes\comlink2-uart\node_modules\usb\usb.js:25:7)
at UsbSimpleDuplex.open_usb [as open] (E:\Src\Diabetes\comlink2-uart\lib\usb.js:17:15)
E:\Src\Diabetes\comlink2-uart>node examples\usb_stick.js
got bunyan
howdy
{ _readableState:
{ highWaterMark: 0,
buffer: [],
length: 0,
pipes: null,
pipesCount: 0,
flowing: false,
E:\Src\Diabetes\comlink2-uart>node examples\usb_stick.js
got bunyan
howdy
{ _readableState:
{ highWaterMark: 0,
buffer: [],
length: 0,
pipes: null,
pipesCount: 0,
flowing: false,
E:\Src\Diabetes\comlink2-uart>node examples\usb_stick.js
got bunyan
howdy
{ _readableState:
{ highWaterMark: 0,
buffer: [],
length: 0,
pipes: null,
pipesCount: 0,
flowing: false,
E:\Src\Diabetes\comlink2-uart>node examples\usb_stick.js
got bunyan
howdy
{ _readableState:
{ highWaterMark: 0,
buffer: [],
length: 0,
pipes: null,
pipesCount: 0,
flowing: false,