From f5c427d61b9ba5ab4e21cc690816171a3ecbe35a Mon Sep 17 00:00:00 2001 From: Joeri Exelmans Date: Thu, 6 Nov 2025 21:26:17 +0100 Subject: [PATCH] fix: plant steps were wrongly showing statechart output events --- src/App/App.css | 3 ++ src/App/App.tsx | 54 ++++++++++++--------- src/App/BottomPanel.tsx | 6 +-- src/App/PersistentDetails.tsx | 10 +++- src/App/Plant/DigitalWatch/DigitalWatch.tsx | 17 +++++++ src/App/Plant/Dummy/Dummy.tsx | 1 + src/App/Plant/Microwave/Microwave.tsx | 10 ++++ src/App/Plant/Plant.ts | 6 ++- src/App/Plant/TrafficLight/TrafficLight.tsx | 7 +++ src/App/RTHistory.tsx | 5 +- src/App/useUrlHashState.ts | 18 ++++++- 11 files changed, 104 insertions(+), 33 deletions(-) diff --git a/src/App/App.css b/src/App/App.css index 76f1272..51defe8 100644 --- a/src/App/App.css +++ b/src/App/App.css @@ -33,6 +33,9 @@ details:has(+ details) { background-color: rgba(0,0,255,0.2); border: solid blue 1px; } +.runtimeState.plantStep:not(.active) { + background-color: #f7f7f7; +} .runtimeState.plantStep * { color: grey; } diff --git a/src/App/App.tsx b/src/App/App.tsx index 4e9ff1c..b18d96a 100644 --- a/src/App/App.tsx +++ b/src/App/App.tsx @@ -5,10 +5,10 @@ import { Dispatch, ReactElement, SetStateAction, useCallback, useEffect, useMemo import AddIcon from '@mui/icons-material/Add'; import AutoAwesomeIcon from '@mui/icons-material/AutoAwesome'; -import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline'; -import VisibilityIcon from '@mui/icons-material/Visibility'; -import SaveOutlinedIcon from '@mui/icons-material/SaveOutlined'; import CachedOutlinedIcon from '@mui/icons-material/CachedOutlined'; +import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline'; +import SaveOutlinedIcon from '@mui/icons-material/SaveOutlined'; +import VisibilityIcon from '@mui/icons-material/Visibility'; import { Statechart } from "@/statecharts/abstract_syntax"; import { detectConnections } from "@/statecharts/detect_connections"; @@ -18,7 +18,7 @@ import { parseStatechart } from "../statecharts/parser"; import { BigStep, RaisedEvent } from "../statecharts/runtime_types"; import { getSimTime, getWallClkDelay, TimeMode } from "../statecharts/time"; import { BottomPanel } from "./BottomPanel"; -import { PersistentDetails } from "./PersistentDetails"; +import { PersistentDetails, PersistentDetailsLocalStorage } from "./PersistentDetails"; import { digitalWatchPlant } from "./Plant/DigitalWatch/DigitalWatch"; import { dummyPlant } from "./Plant/Dummy/Dummy"; import { microwavePlant } from "./Plant/Microwave/Microwave"; @@ -26,14 +26,11 @@ import { Plant } from "./Plant/Plant"; import { trafficLightPlant } from "./Plant/TrafficLight/TrafficLight"; import { RTHistory } from "./RTHistory"; import { ShowAST, ShowInputEvents, ShowInternalEvents, ShowOutputEvents } from "./ShowAST"; -import { InsertMode } from "./TopPanel/InsertModes"; import { TopPanel } from "./TopPanel/TopPanel"; import { VisualEditor, VisualEditorState } from "./VisualEditor/VisualEditor"; import { checkProperty, PropertyCheckResult } from "./check_property"; -import { usePersistentState } from "./persistent_state"; import { useEditor } from "./useEditor"; import { useUrlHashState } from "./useUrlHashState"; -import { formatTime } from "@/util/util"; export type EditHistory = { current: VisualEditorState, @@ -112,6 +109,10 @@ export function App() { setInsertMode, plantName, setPlantName, + showConnections, + setShowConnections, + showProperties, + setShowProperties, showExecutionTrace, setShowExecutionTrace, showPlantTrace, @@ -417,33 +418,33 @@ export function App() { style={{flex: '0 0 content', backgroundColor: ''}} > {/* State tree */} - + state tree
    {ast && }
-
+ {/* Input events */} - + input events {ast && onRaise("debug."+e,p)} disabled={trace===null || trace.trace[trace.idx].kind === "error"} showKeys={showKeys}/>} - + {/* Internal events */} - + internal events {ast && } - + {/* Output events */} - + output events {ast && } - + {/* Plant */} - + plant setShowPlantTrace(e.target.checked)}/> - + setAutoScroll(e.target.checked)}/> - +