Migrate to new Gitea instance (gitea.wbd-rd.nl)
- Update all submodule URLs from gitea.centraal.wbd-rd.nl to gitea.wbd-rd.nl - Add settler as proper submodule in .gitmodules - Add agent skills, function anchors, decisions, and improvements - Add Docker configuration and scripts - Add manuals and third_party docs - Update .gitignore with secrets and build artifacts - Remove stale .tgz build artifact Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
25
scripts/fix-kla.js
Normal file
25
scripts/fix-kla.js
Normal file
@@ -0,0 +1,25 @@
|
||||
const fs = require("fs");
|
||||
const flowPath = "docker/demo-flow.json";
|
||||
const flow = JSON.parse(fs.readFileSync(flowPath, "utf8"));
|
||||
|
||||
let newFlow = flow.filter(n => n.id !== "demo_dbg_reactor_inspect");
|
||||
const reactor = newFlow.find(n => n.id === "demo_reactor");
|
||||
reactor.wires[0] = reactor.wires[0].filter(id => id !== "demo_dbg_reactor_inspect");
|
||||
|
||||
reactor.kla = 70;
|
||||
|
||||
newFlow.push({
|
||||
id: "demo_dbg_reactor_inspect",
|
||||
type: "function",
|
||||
z: "demo_tab_treatment",
|
||||
name: "Reactor State Inspector",
|
||||
func: 'if (msg.topic !== "GridProfile") return null;\nconst p = msg.payload;\nif (!p || !p.grid) return null;\nconst now = Date.now();\nif (global.get("lastInspect") && now - global.get("lastInspect") < 5000) return null;\nglobal.set("lastInspect", now);\nconst profile = p.grid.map((row, i) => "cell" + i + "(" + (i*p.d_x).toFixed(0) + "m): NH4=" + row[3].toFixed(2) + " DO=" + row[0].toFixed(2));\nnode.warn("GRID: " + profile.join(" | "));\nreturn null;',
|
||||
outputs: 1,
|
||||
x: 840,
|
||||
y: 320,
|
||||
wires: [[]]
|
||||
});
|
||||
reactor.wires[0].push("demo_dbg_reactor_inspect");
|
||||
|
||||
fs.writeFileSync(flowPath, JSON.stringify(newFlow, null, 2) + "\n");
|
||||
console.log("kla:", reactor.kla, "X_A_init:", reactor.X_A_init);
|
||||
Reference in New Issue
Block a user