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

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

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

一篇 Hacker News 帖子链接到一个使用状态图建模 Casio F-91W 的项目。评论讨论了 F91W 的 FOSS 替代方案 Sensor Watch Pro,经校准后精度可达每年误差不足 15 秒,并包含加速度计和温度计;用户计划开发天文/导航应用。它兼容 A158WA-1,并提供 LED 背光选项。Ollee Watch 被推荐用于 F-105W/A168 型号。高精度需要设置/固件更改和定期校准;用户推测这不会显著影响电池,而 SWP 还提供低功耗模式和可调背光。一位评论者询问为什么省略了闹钟响铃和 A 按钮持续递增;另一位报告 Firefox iOS 上有渲染问题。
相关文章

原文

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