digital watch works

This commit is contained in:
Joeri Exelmans 2025-10-21 22:59:17 +02:00
parent 639a296075
commit 6202934ac4
9 changed files with 87 additions and 55 deletions

View file

@ -169,6 +169,7 @@ export function enterStates(simtime: number, state: ConcreteState, toEnter: Set<
// exit the given state and all its active descendants
export function exitCurrent(simtime: number, state: ConcreteState, rt: EnteredScope): ActionScope {
console.log('exitCurrent', state);
let {enteredStates, history, ...actionScope} = rt;
if (enteredStates.has(state.uid)) {
@ -297,6 +298,8 @@ export function fireTransition(simtime: number, t: Transition, ts: Map<string, T
const srcPath = computePath({ancestor: arena, descendant: t.src as ConcreteState}).reverse() as ConcreteState[];
console.log('arena:', arena, 'srcPath:', srcPath);
// exit src and other states up to arena
({environment, history, ...rest} = exitCurrent(simtime, srcPath[0], {environment, enteredStates: mode, history, ...rest}))
const toExit = getDescendants(arena);