mirror of
https://git.undefined-dev.fr/Blendman974/faceclaw.git
synced 2026-11-29 13:03:11 +00:00
Add a prototype nightscout "missed bolus" detector
This commit is contained in:
1 parent
f6201d8e41
commit
00c36602d6
13 files changed
+997
-61
No files matched your search
@@ -13,6 +13,8 @@ import {
|
||||
nightscoutBatteryLowSetting,
|
||||
nightscoutMaxLoopAgeSetting,
|
||||
nightscoutAlwaysShowInTopBarSetting,
|
||||
nightscoutMissedBolusAlertsSetting,
|
||||
nightscoutMissedBolusCooldownSetting,
|
||||
toggleSettingMenuItem,
|
||||
nightscoutApiTokenSetting,
|
||||
nightscoutSiteUrlSetting,
|
||||
@@ -28,6 +30,7 @@ export const NIGHTSCOUT_STALE_MS = 15 * 60 * 1000;
|
||||
const NIGHTSCOUT_GRAPH_WINDOW_MS = 2 * 60 * 60 * 1000;
|
||||
const NIGHTSCOUT_GRAPH_TIME_QUANTUM_MS = 60 * 1000;
|
||||
|
||||
/** Draws the trend indicator; returns its width. */
|
||||
export function drawDirectionIndicator(
|
||||
image: GrayImage,
|
||||
font: UiFont,
|
||||
@@ -35,16 +38,10 @@ export function drawDirectionIndicator(
|
||||
y: number,
|
||||
direction: string,
|
||||
shade: number,
|
||||
): void {
|
||||
const label = directionGlyphLabel(font, direction);
|
||||
if (label) {
|
||||
image.drawText(font, x, y, label, shade);
|
||||
return;
|
||||
}
|
||||
|
||||
if (direction) {
|
||||
image.drawText(font, x, y, truncateLine(direction, 10), shade);
|
||||
}
|
||||
): number {
|
||||
const label = directionGlyphLabel(font, direction) || (direction ? truncateLine(direction, 10) : "");
|
||||
if (label) image.drawText(font, x, y, label, shade);
|
||||
return font.measureText(label);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -425,6 +422,8 @@ export function nightscoutMenuItems(): MenuItem[] {
|
||||
textSettingMenuItem(nightscoutCartridgeLowSetting),
|
||||
textSettingMenuItem(nightscoutBatteryLowSetting),
|
||||
textSettingMenuItem(nightscoutMaxLoopAgeSetting),
|
||||
toggleSettingMenuItem(nightscoutMissedBolusAlertsSetting),
|
||||
textSettingMenuItem(nightscoutMissedBolusCooldownSetting),
|
||||
]);
|
||||
},
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user