state tree
@@ -447,36 +448,34 @@ export function App() {
plant.render(trace.trace[trace.idx].plantState, event => onRaise(event.name, event.param))}
setShowExecutionTrace(e.newState === "open")}>execution trace
-
+
+ {/* We cheat a bit, and render the execution trace depending on whether the above is 'open' or not, rather than putting it as a child of the . We do this because only then can we get the execution trace to scroll without the rest scrolling as well. */}
{showExecutionTrace &&
-
- {/* */}
- {/* execution trace */}
-
- {ast && }
-
- {/* */}
- }
+
+ {ast && }
+
+
}
-
-
-
-
+
+
+
+
-
+
{/* Bottom panel */}
-
+
{syntaxErrors && }
-
-
+
+
>;
}
diff --git a/src/App/BottomPanel.tsx b/src/App/BottomPanel.tsx
index 3bd47f2..4533f24 100644
--- a/src/App/BottomPanel.tsx
+++ b/src/App/BottomPanel.tsx
@@ -3,11 +3,16 @@ import { TraceableError } from "../statecharts/parser";
import "./BottomPanel.css";
-import head from "../head.svg" ;
+import logo from "../../artwork/logo-playful.svg";
import { PersistentDetails } from "./PersistentDetails";
export function BottomPanel(props: {errors: TraceableError[]}) {
- const [greeting, setGreeting] = useState(<> "Welcome to StateBuddy, buddy!" >);
+ const [greeting, setGreeting] = useState(
+
+
+ Welcome to
+
+
);
useEffect(() => {
setTimeout(() => {
diff --git a/src/statecharts/detect_connections.ts b/src/statecharts/detect_connections.ts
index 37a9167..9465eca 100644
--- a/src/statecharts/detect_connections.ts
+++ b/src/statecharts/detect_connections.ts
@@ -13,6 +13,7 @@ export type Connections = {
}
export function detectConnections(state: VisualEditorState): Connections {
+ const startTime = performance.now();
// detect what is 'connected'
const arrow2SideMap = new Map();
const side2ArrowMap = new Map>();
@@ -72,6 +73,11 @@ export function detectConnections(state: VisualEditorState): Connections {
}
}
+ const endTime = performance.now();
+
+ // rather slow, about 10ms for a large model:
+ // console.debug("connection detection took", endTime-startTime);
+
return {
arrow2SideMap,
side2ArrowMap,
diff --git a/src/statecharts/parser.ts b/src/statecharts/parser.ts
index 099272d..d53388a 100644
--- a/src/statecharts/parser.ts
+++ b/src/statecharts/parser.ts
@@ -78,6 +78,8 @@ export function parseStatechart(state: VisualEditorState, conns: Connections): [
// step 1: figure out state hierarchy
+ const startTime = performance.now();
+
// IMPORTANT ASSUMPTION: state.rountangles is sorted from big to small surface area:
for (const rt of state.rountangles) {
const parent = findParent(rt);
@@ -132,6 +134,11 @@ export function parseStatechart(state: VisualEditorState, conns: Connections): [
historyStates.push(historyState);
}
+ const endTime = performance.now();
+
+ // currently seems to be quite fast:
+ // console.log('built state tree', endTime-startTime);
+
// step 2: figure out transitions
const transitions = new Map();
diff --git a/todo.txt b/todo.txt
index b18377b..73444e0 100644
--- a/todo.txt
+++ b/todo.txt
@@ -27,8 +27,9 @@
TODO
-- digital watch:
- highlight when watch button pressed/released
+- testing
+ use STL for testing
+ https://github.com/mvcisback/py-metric-temporal-logic
- maybe support:
- explicit order of:
@@ -51,17 +52,21 @@ TODO
don't crash and show the error
- buttons to rotate selection 90 degrees
+- performance:
+ maybe try this for rendering the execution trace:
+ https://legacy.reactjs.org/docs/optimizing-performance.html#virtualize-long-lists
+
- experimental features:
- multiverse execution history
stable tree layout?
https://pub.dev/packages/ploeg_tree_layout
- local scopes
-
-
for the assignment:
*ALL* features
add history (look at original Harel paper)
+ add microwave oven
+ add traffic light
Publish StateBuddy paper(s):
compare CS approach to other tools, not only YAKINDU