Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ History before 0.1.0 is not reconstructed here; see the change log in

## [Unreleased]

### Added

- Restored the **Reload** button next to the port dropdown in Settings to refresh the port list.

### Fixed

- Unplugging a serial device keeps its port selected. When it returns on the same port,
**Connect** resumes receiving without having to select the port again.
- On Windows, the app allows time for the port list to reflect an unplug before showing an
error dialog. When the OS confirms the port is gone, the disconnect is logged without a dialog.
- Disconnecting, a failed connection attempt, and manual reconnects preserve the capture.
**Clear** starts a new capture and prevents pending display updates from restoring old data.
- The ASCII view keeps short captures aligned at the top and avoids jumping while new lines arrive.

## [0.1.0-beta.2] - 2026-11-04 (pre-release)

Fixes for the first beta reports (issues #3 to #7) and a few problems found while fixing them,
Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,12 @@ did all of that, so I built this one. It is a Tauri/Rust rewrite of an earlier C
(none / CR / LF / CRLF) and input history (↑ / ↓)
- Any baud rate the driver accepts (including non-standard ones), DTR / RTS control, hardware
or software flow control
- **Reload** refreshes the port list in Settings. The selected port stays selected when its
device is unplugged
- Received data stays available after a disconnect. While the app is open, reconnecting appends
to the same capture until you choose **Clear** in Receive
- **Auto Connect**: connects to the selected port whenever it is available — at startup, when
the board is plugged in, and when it comes back after a reset or unplug. The capture
continues, so the output from before the reset is not lost. Disconnect turns it off
the board is plugged in, and when it comes back after a reset or unplug. Disconnect turns it off
- Save the capture as a binary file or as text with timestamps, or copy it as hex or ASCII

DTR and RTS are off by default, so connecting does not reset the board (an Arduino Uno resets
Expand Down Expand Up @@ -123,6 +126,11 @@ published.
4. Click **Plotter** to open the plotter. Channels are created automatically from the incoming
lines.

With **Auto Connect** off, unplugging a device leaves its port selected and marks it as
**(not present)**. When the device comes back on the same port, click **Connect** to resume
receiving. Use **Reload** to refresh the list immediately, for example when looking for a
device that appears under a different port number.

## Using it with an AI agent (MCP)

![MCP Server row in the settings panel](docs/images/mcp-server.png)
Expand Down
2 changes: 1 addition & 1 deletion docs/01_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Rustの `serialport` クレートによるクロスプラットフォーム対

* **高速通信:** 12Mbps などの非標準・高速ボーレートに対応(OSおよびドライバ許容最大値まで)。
* **データ完全性:** 受信データは内部で1バイトも取りこぼさず保持・ログ保存する。UI描画遅延によるバッファ溢れを防ぐ。
* **ホットプラグ:** USBケーブルの抜き差しを検知し、適切に切断・再接続待機状態へ遷移する。(実装: 切断は受信スレッドの read エラー検知、挿入はポート一覧の 2 秒ポーリング。クロスプラットフォームで同一機構。詳細は SYS-F-107 / docs/21)
* **ホットプラグ:** USB 抜去は受信スレッドの read エラーで検知する。選択中のポートは切断後も保持し、同じポートに戻れば **Connect** で再接続できる。ポート一覧は 2 秒間隔と **Reload** 操作時に更新する([システム要求仕様](21_system_requirements.md) の SYS-F-107)。
* **複数起動:** アプリの複数起動を許可し、それぞれで別のCOMポートを監視可能にする。
* **受信エラー処理:** フレーミングエラー、パリティエラー等の受信エラーは無視してデータ受信を継続する。

Expand Down
5 changes: 3 additions & 2 deletions docs/03_data_structures.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,12 @@ struct PageMetadata {

**UiNotifier Thread:**
* `DataStore::total_bytes()` を監視し、最大60fpsに間引いてイベントを発火。
* イベントには `total_bytes` のみを含む(データ本体は `get_display_rows` で取得)。
* イベントには `capture_id` と `total_bytes` を含む(データ本体は `get_display_rows` で取得)。

```rust
// data-update イベントのペイロード
struct DataUpdatePayload {
capture_id: u64, // Clear 前後の受信通知を識別する ID
total_bytes: u64, // 受信済み総バイト数
}
```
Expand All @@ -99,7 +100,7 @@ struct DataUpdatePayload {
| |
|-- open_port -------------------------->|
| |
|<-- data-update { total_bytes } --------| (60fps間引き)
|<-- data-update { capture_id, total_bytes } (60fps間引き)
| |
|-- get_display_rows(start_row, count) ->| (スクロール時)
| |
Expand Down
13 changes: 7 additions & 6 deletions docs/04_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

| コマンド名 | 引数 | 説明 |
| --- | --- | --- |
| `open_port` | `port_name`, `config: SerialConfig` | 指定設定でポートを開く |
| `close_port` | なし | ポートを閉じる |
| `reopen_port` | `port_name`, `config: SerialConfig` | 自動再接続(SYS-F-807)。ポートを開き、**既存のデータストアに追記を再開**する(ストアが無ければ新規)。切断済みのハンドルが残っていても動くが、生きている接続があれば `Err` |
| `open_port` | `port_name`, `config: SerialConfig` | 指定設定でポートを開き、既存のデータストアに追記を再開する(ストアが無ければ新規)。成功時は接続 ID (`u64`) を返す |
| `close_port` | `connection_id: Option<u64>` | ポートを閉じる。ID を指定して現在の接続と一致しない場合は `false` を返す。処理を実行した場合は `true` を返す |
| `confirm_port_removed` | `port_name: String` | ポートを閉じた後で短時間、ポート一覧を再取得する。取得に成功し、指定ポートが一覧に含まれない場合に `true` を返す |
| `reopen_port` | `port_name`, `config: SerialConfig` | 自動再接続(SYS-F-807)。`open_port` と同じ処理で接続 ID (`u64`) を返す |
| `set_reconnecting` | `waiting: bool` | 自動再接続の待機に入った / 出たことを記録する。ブリッジの `status.reconnecting` に反映 |
| `write_data` | `data: Vec<u8>` | データを送信する |
| `write_dtr` | `level: bool` | DTR信号を設定する |
Expand All @@ -16,7 +17,7 @@
| `get_ascii_lines` | `start_line`, `line_count`, `show_ctrl`, `show_timestamp` | ASCII表示用行データを取得 |
| `list_ports` | なし | 利用可能なシリアルポート一覧を取得 |
| `export_log` | `path: String` | 受信データをファイルにエクスポート |
| `clear_data` | なし | 受信データをクリア |
| `clear_data` | なし | 受信データをクリアし、新しいキャプチャ ID (`u64`) を返す |
| `get_clipboard_text` | `mode: String` | クリップボード用テキストを取得(hex/ascii) |
| `bridge_status` | なし | ブリッジ(設定画面の MCP Server)の状態を取得(`{ enabled, port, connections, last_activity }`)。失敗しない |
| `bridge_set` | `enabled: bool`, `port: Option<u16>` | ブリッジの起動 / 停止。`enabled=true` で同じポートが稼働中なら no-op、ポートが変われば再起動。戻り値は `bridge_status` と同じ形 |
Expand All @@ -27,8 +28,8 @@

| イベント名 | ペイロード | 説明 |
| --- | --- | --- |
| `serial-status` | `{ connected: bool, error: string \| null }` | 接続状態の変化。受信スレッドが致命的 I/O エラーを検知したときに `connected=false` で発火する。フロントエンドはこれを受けて `close_port` を呼び、バックエンド状態を再同期する(SYS-F-107) |
| `data-update` | `{ total_bytes: u64 }` | 新規データ受信通知。フロントエンドは `get_display_rows` で表示データを取得。 |
| `serial-status` | `{ connected: bool, error: string \| null, connection_id: u64 }` | 受信スレッドが致命的 I/O エラーを検知したときに `connected=false` で発火する。フロントエンドは通知の接続 ID を指定して `close_port` を呼ぶ(SYS-F-107) |
| `data-update` | `{ capture_id: u64, total_bytes: u64 }` | 新規データ受信通知。フロントエンドはキャプチャ ID で Clear 前の通知を識別し、現在の表示データを `get_display_rows` などで取得する |
| `log-error` | `{ message: string }` | ディスクフルなどのエラー通知。Logger スレッドの `on_error` コールバック経由で発火し、**同種のエラーは 5 秒に 1 回まで**に抑制される(SYS-F-205) |
| `bridge-activity` | `{ kind: string, bytes: usize, preview: string }` | ブリッジ経由の活動通知(現状 `kind: "send"` のみ)。`preview` は送信内容の先頭 64 文字。**AI の送信を人間が画面で確認できるようにするための必須経路**(SYS-F-1103) |

Expand Down
6 changes: 3 additions & 3 deletions docs/20_user_needs.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ SH-1 は「今すぐ結果が欲しい」、SH-2 は「半年後の自分が読
### US-02: ファーム再書き込みを挟んで再接続する

書き込みツールが COM ポートを使うため、いったん切断する。書き込み後に再接続する。
このとき前セッションの表示が残っていると、新しいファームの出力と混ざって判断を誤る。
「切断→再接続でセッションが切り替わる」ことが自明に見えてほしい。
再接続後も切断直前のログを参照できる。新しいファームの出力だけを見たい場合は、
再接続前に `Clear` で新しいセッションに切り替えたい。

### US-03: 異常スパイクを調査する

Expand Down Expand Up @@ -166,7 +166,7 @@ Y 軸が毎フレーム微調整される、X 軸の原点が動く)と、そ
|----|--------|------|------|--------|
| **UN-10** | 利用者は、受信データが**1 バイトも失われない**ことを必要とする。UI の描画遅延が受信に影響してはならない | 取りこぼしがあると、そのログで何かを結論づけることができなくなる(ツールとしての存在意義) | US-06 | 必須 |
| **UN-11** | 利用者は、`Clear` を押したとき、**メインビューもプロッタも同時に空になる**ことを必要とする | 片方だけ残ると、どのセッションのデータを見ているのか分からなくなる。2026-09-03 の修正で挙動を統一済み([07 変更履歴](07_plotter_spec.md#挙動変更)) | US-02 | 必須 |
| **UN-12** | 利用者は、**切断→再接続でセッションが切り替わる**ことを必要とする。新セッションの表示に旧セッションのチャンネルや波形が混ざってはならない | US-02。ファーム更新の前後を混同すると、直っていないものを直ったと誤認する | US-02 | 必須 |
| **UN-12** | 利用者は、**再接続でログを保持し、`Clear` で新しいセッションに切り替えられる**ことを必要とする。新セッションの表示に旧セッションのチャンネルや波形が混ざってはならない | US-02。切断直前のログを確認でき、ファーム更新後の出力を独立して確認したいときには切り替えられる | US-02 | 必須 |
| **UN-13** | 利用者は、受信データをファイルに**バイナリのままエクスポート**できることを必要とする | 本ツールで完結しない解析(FFT、統計)は外部ツールに渡す。加工されたテキストでは渡せない | US-06 | 必須 |
| **UN-14** | 利用者は、ツールが**ユーザーのディスクを汚さない**ことを必要とする。一時ファイルは自動で片付くこと | 数十分のログは GB 級になる。放置された一時ファイルは後で必ず問題になる | US-06 | 重要 |

Expand Down
Loading
Loading