Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Commit

Permalink
Test calculation for TDD for the last 24 hours (#182)
Browse files Browse the repository at this point in the history
Update TDD middleware. Now running without middleware errors.

Mind smaller possible pump dose and from comments

Adding Chris' formula

Format

Updates

Revert mw


Remove console log


Typo


Typo
  • Loading branch information
Jon-b-m committed Mar 14, 2022
1 parent c3f8ba4 commit b6e8735
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions FreeAPS/Resources/javascript/prepare/determine-basal.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//для enact/smb-suggested.json параметры: monitor/iob.json monitor/temp_basal.json monitor/glucose.json settings/profile.json settings/autosens.json --meal monitor/meal.json --microbolus --reservoir monitor/reservoir.json

function generate(iob, currenttemp, glucose, profile, autosens = null, meal = null, microbolusAllowed = false, reservoir = null, clock = new Date()) {
function generate(iob, currenttemp, glucose, profile, autosens = null, meal = null, microbolusAllowed = false, reservoir = null, clock = new Date(), pump_history) {

try {
var middlewareReason = middleware(iob, currenttemp, glucose, profile, autosens, meal, reservoir, clock);
var middlewareReason = middleware(iob, currenttemp, glucose, profile, autosens, meal, reservoir, clock, pump_history);
console.log("Middleware reason: " + (middlewareReason || "Nothing changed"));
} catch (error) {
console.log("Invalid middleware: " + error);
Expand Down
10 changes: 7 additions & 3 deletions FreeAPS/Sources/APS/OpenAPS/OpenAPS.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ final class OpenAPS {
autosens: autosens.isEmpty ? .null : autosens,
meal: meal,
microBolusAllowed: true,
reservoir: reservoir
reservoir: reservoir,
pumpHistory: pumpHistory
)
debug(.openAPS, "SUGGESTED: \(suggested)")

Expand Down Expand Up @@ -290,7 +291,8 @@ final class OpenAPS {
autosens: JSON,
meal: JSON,
microBolusAllowed: Bool,
reservoir: JSON
reservoir: JSON,
pumpHistory: JSON
) -> RawJSON {
dispatchPrecondition(condition: .onQueue(processQueue))
return jsWorker.inCommonContext { worker in
Expand All @@ -314,7 +316,9 @@ final class OpenAPS {
autosens,
meal,
microBolusAllowed,
reservoir
reservoir,
false, // clock
pumpHistory
]
)
}
Expand Down

0 comments on commit b6e8735

Please sign in to comment.