Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access pumphistory_24h_zoned.json from middleware #182

Merged
merged 1 commit into from
Mar 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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