Auto-select simple fermentation schedule
This commit is contained in:
+31
@@ -610,6 +610,8 @@ const DEFAULT = {
|
||||
let S = Object.assign({}, DEFAULT);
|
||||
const BALL_MIN = 150;
|
||||
const BALL_MAX = 400;
|
||||
const SIMPLE_PREP_H = 0.75; // Kneten + Formen im Zeitplan
|
||||
const SIMPLE_SAME_DAY_MAX_H = 12; // Same-Day im Einfach-Modus immer warm führen
|
||||
|
||||
/* ============================================================
|
||||
RECHENKERN
|
||||
@@ -849,6 +851,34 @@ function applyPlan(){
|
||||
if (S.seq==="coldwarm") S.roomH=Math.min(S.roomH,3);
|
||||
}
|
||||
|
||||
/* Einfach-Modus: Der Nutzer gibt nur Zielzeit, Stil und Teigmenge vor.
|
||||
Die Führung wird daraus automatisch gewählt:
|
||||
- Same-Day: immer warm, ohne Kühlschrank.
|
||||
- Länger als Same-Day: Lehmann-Methode (Kalt → Warm) als Standard. */
|
||||
function applySimpleFermentation(){
|
||||
if (S.uxMode!=="simple" || !S.bake) return;
|
||||
const available = (S.bake - Date.now())/3600e3;
|
||||
const doughH = clamp(Math.round((available - SIMPLE_PREP_H)*2)/2, 2, 72);
|
||||
S.yeast = "fresh";
|
||||
S.pf = "none";
|
||||
|
||||
if (doughH <= SIMPLE_SAME_DAY_MAX_H){
|
||||
S.plan = "same";
|
||||
S.seq = "room";
|
||||
S.staglio = "before";
|
||||
S.fridgeH = 0;
|
||||
S.roomH = doughH;
|
||||
return;
|
||||
}
|
||||
|
||||
S.seq = "coldwarm";
|
||||
S.staglio = "after";
|
||||
S.roomH = doughH <= 18 ? 2 : 3;
|
||||
S.fridgeH = Math.max(4, Math.round(doughH - S.roomH));
|
||||
const total = S.roomH + S.fridgeH;
|
||||
S.plan = total <= 18 ? "night" : total <= 30 ? "d24" : total <= 54 ? "d48" : "d72";
|
||||
}
|
||||
|
||||
function initUI(){
|
||||
buildFlourSelect();
|
||||
chips($("uxModes"), UX_MODES, "uxMode", k=>{
|
||||
@@ -907,6 +937,7 @@ function syncInputs(){
|
||||
document.body.dataset.ux = S.uxMode;
|
||||
S.ball = clampBall(S.ball);
|
||||
if (S.uxMode==="simple" && S.mode!=="w") S.mode="w";
|
||||
applySimpleFermentation();
|
||||
RANGES.forEach(id=>{ $(id).value=S[id]; });
|
||||
$("ballsOut").textContent=S.balls;
|
||||
$("flour").value=S.flour;
|
||||
|
||||
Reference in New Issue
Block a user