From e4ac063322127ccbf4c0a9e1ce3bc7d8d868cdc4 Mon Sep 17 00:00:00 2001
From: Pim Hutting
Date: Tue, 20 Jan 2026 12:41:27 +0100
Subject: [PATCH] chore: now it works
---
src/pages/VisProgPage/VisProg.tsx | 35 -------------------------------
1 file changed, 35 deletions(-)
diff --git a/src/pages/VisProgPage/VisProg.tsx b/src/pages/VisProgPage/VisProg.tsx
index 933c4ee..00410bd 100644
--- a/src/pages/VisProgPage/VisProg.tsx
+++ b/src/pages/VisProgPage/VisProg.tsx
@@ -172,41 +172,6 @@ function VisualProgrammingUI() {
);
}
-// currently outputs the prepared program to the console
-function runProgram() {
- const phases = graphReducer();
- const program = {phases}
- console.log(JSON.stringify(program, null, 2));
- fetch(
- "http://localhost:8000/program",
- {
- method: "POST",
- headers: {"Content-Type": "application/json"},
- body: JSON.stringify(program),
- }
- ).then((res) => {
- if (!res.ok) throw new Error("Failed communicating with the backend.")
- console.log("Successfully sent the program to the backend.");
-
- // store reduced program in global program store for further use in the UI
- // when the program was sent to the backend successfully:
- useProgramStore.getState().setProgramState(structuredClone(program));
- }).catch(() => console.log("Failed to send program to the backend."));
- console.log(program);
-}
-
-/**
- * Reduces the graph into its phases' information and recursively calls their reducing function
- */
-function graphReducer() {
- const { nodes } = useFlowStore.getState();
- return orderPhaseNodeArray(nodes.filter((n) => n.type == 'phase') as PhaseNode [])
- .map((n) => {
- const reducer = NodeReduces['phase'];
- return reducer(n, nodes)
- });
-}
-
const checkPhaseChain = (): boolean => {
const {nodes, edges} = useFlowStore.getState();