卡西欧 F-91W 使用 状态图
Casio F-91W using Statecharts

原始链接: https://github.com/dundalek/casio-f91w-fsm

一个使用状态图的交互式网页演示,该扩展由大卫·哈勒于1987年引入。该演示基于亚历克西斯·菲利普的图形工作,用 XState 库替代了手表的逻辑,并使用 Stately 可视化器并排显示状态和转换,用于教育目的。它展示了状态图的运行过程,同时忠实于手表的经典设计。显著的局限包括通过 JavaScript 的 Date 对象简化的日期/时间设置(不包括星期几)、非功能性的闹钟触发,以及省略了按钮持续增量行为。项目在 `src/casio` 中包含一个基于状态图的实现,并提供通过 Babashka 在 `localhost:8888/` 运行的说明以及基于浏览器的测试。总体而言,它既是一个功能性的手表复刻,也是一个状态图机制的教学工具。

黑客新闻 新 | 旧 | 评论 | 提问 | 展示 | 工作 | 提交 登录 使用 Statecharts 的 Casio F-91W (gitHub.com/dundalek) 14 点 由 austinallegro 发布 1 小时前 隐藏 | 旧 | 收藏 | 1 条评论 帮助 helterskelter2 10 分钟前 [–] 这很有趣,我刚刚为 F91W 订购了一个开源替代机芯,通过几个月间隔的几次校准,即可实现 <15s/yr 的精度(内置加速计和温度计)。我原本计划为它编写一些天文和导航应用。感兴趣的请看:https://www.crowdsupply.com/oddly-specific-objects/sensor-wa... 回复 考虑申请 YC 的 Winter 2027 批次!申请截止至 11 月 2 日。 准则 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系方式 搜索:
相关文章

原文

Online demo here: casio-f91w.pages.dev

Interactive model of the Casio F-91W watch using statecharts.

Statecharts are an extension of state machines, introduced by David Harel in 1987. In the paper, Harel used a digital wristwatch as an example model.

I always thought it would be great to have an interactive demo that allows to see statecharts in action. Unfortunately, that particular wristwatch (Citizen Quartz Multi-Alarm III) is now a rarity.

However, there is the iconic Casio F-91W, which despite being introduced only two years after the paper was published, remains widely popular and is still manufactured and sold today. Alexis Philip created an online version digitizing the graphical elements.

This demo builds on Alexis' work, demonstrates using statecharts by replacing the logic using the XState library, and uses the Stately visualizer to show states and transitions side by side for educational purposes. You can also check out the official manual for the watch.

Casio F-91W Statecharts Demo

Differences & limitations

  • Setting date and time is slightly different since it is represented using the builtin JavaScript Date object. Setting the day of week is therefore not used in the demo.
  • Holding A button to continue incrementing time in alarm or date time setting is not implemented.
  • You can set daily alarm time, but actual triggering the alarm is not implemented.

File structure:

  • demo/script - the original implementation, only the code for rendering is used
  • src/casio - contains statecharts-based implementation

Run bb dev to start the dev process (requires Babashka)

Open the app: http://localhost:8888/
Run tests in browser: http://localhost:8888/test

联系我们 contact @ memedata.com