The routers order reads its model from the build standard (bstd().g, 'keep' is the old next-model-up rule) and the optical upgrade order its line system (bstd().sys). The Ops sheet shows "From the build standard: X" with a button to the sheet. Old saves move a model or line system from an order that was running into the standard when it has none of its own; a paused order's or an unhired intern's setting is dropped. opsParam refuses model/sys and points at bstdSet. The build standard's order is a generator now: every first job that takes a fiber dark goes through the optical order's routing test (opsDark, in the route worker in play), under one shared budget of dark swaps a night (two for Kevin) and the week-long memory for a failed fiber. A fiber one order worked on is the other's no more that shift, and decom keeps waves the standard just upgraded. The plan is checked at every job, since the shift rests between them: a POP gone or changed by hand meanwhile is skipped. The button still runs the whole plan at once on the page.
14 lines
1.2 KiB
JavaScript
14 lines
1.2 KiB
JavaScript
// The build standard sheet (93-ui/59-build-standard.js): pick a target, or bring everything up to the standard in one go.
|
|
Object.assign(ACT,{
|
|
bstdOpen:()=>{if(S&&!pzOn())bstdModal();},
|
|
// v: a position in the list the sheet shows; without v, the next value (the MCP tools step through a list).
|
|
bstdSet:({k,v})=>{if(!S||pzOn()||!own(BSTDK,k))return;const D=bstd(),x=opsPick(bstdOpts(k),D[k],v);if(x===undefined||!bstdOk(BSTDK[k],x))return;
|
|
D[k]=x;S.popStd=bstdPut(D);sfx('click');after();opsRedraw('bstdSet',{k},bstdModal);},
|
|
// The same jobs, in the same order and through the same gates as the intern's order, while the cash lasts. One
|
|
// recompute at the end, and one toast: what got done, and what still waits.
|
|
bstdApply:()=>{if(!S||pzOn()||!S.popStd)return;const J=bstdPlan(false);if(!J.length)return;const c0=S.cash;let n=0;
|
|
opsQuiet(()=>{n=bstdDo(J,j=>{const c=bstdPrice(j);return c<=0||S.cash>=c;},j=>!!j.go()).length;});
|
|
after();const q=bstdQuote(false),left=q.pops+q.ports+q.links;
|
|
toast((n?trn('bstd.applied',n,{cost:fmt$(c0-S.cash)}):tr('bstd.applied_none'))+(left?' '+trn('bstd.left',left):''),n?'good':'bad');sfx(n?'build':'err');
|
|
if(bstdShown())bstdModal();},
|
|
});
|