@vehicle-sil/gui-client 0.2.0-rc.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.ja.md CHANGED
@@ -92,11 +92,11 @@ editor.setVisible(true);
92
92
 
93
93
  ### 正面の口
94
94
 
95
- | 種類 | 名前 |
96
- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
97
- | 関数 | `connect(options?)`、`createFront(options)`、`watch(source, fn)`、`until(source, test, options?)` |
98
- | クラス | `ActionError`(`code`、`message`、`outcome`、`findings`) |
99
- | 型 | `ConnectOptions`(`base_url`、`token`、`origin`、`http`、`socket`、`answer_timeout_ms`、`on_error`)、`Front`(`low`、`status`、`clock`、`controls`、`scenario`、`outside`、`run`、`time`、`variable()`、`scenarios()`、`connections()`、`check()`、`readConfig()`、`describeAgain()`、`saveConfig()`、`close()`)、`FrontStatus`、`FrontResult`、`FrontClock`、`FrontControls`、`Control`、`Reason`、`FrontScenario`、`FrontRun`、`FrontTime`、`FrontVariable`、`VariableView`、`Intent`、`Outside`、`ConnectEntry`、`ConnectTarget`、`ConnectListError`、`Link`、`RunState`、`EndKind`、`Pacing`、`OperationName` |
95
+ | 種類 | 名前 |
96
+ | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
97
+ | 関数 | `connect(options?)`、`createFront(options)`、`watch(source, fn)`、`until(source, test, options?)` |
98
+ | クラス | `ActionError`(`code`、`message`、`outcome`、`findings`) |
99
+ | 型 | `ConnectOptions`(`base_url`、`token`、`origin`、`http`、`socket`、`answer_timeout_ms`、`on_error`)、`Front`(`low`、`status`、`clock`、`controls`、`scenario`、`runtime`、`outside`、`prepare()`、`configs()`、`recording()`、`run`、`time`、`variable()`、`scenarios()`、`connections()`、`check()`、`readConfig()`、`describeAgain()`、`saveConfig()`、`close()`)、`FrontStatus`、`FrontResult`、`FrontClock`、`FrontControls`、`Control`、`Reason`、`FrontScenario`、`FrontRun`、`FrontTime`、`FrontVariable`、`VariableView`、`Intent`、`Outside`、`ConnectEntry`、`ConnectTarget`、`ConnectListError`、`Link`、`RunState`、`EndKind`、`Pacing`、`OperationName`、`RuntimeStatus` |
100
100
 
101
101
  ### トークン
102
102
 
@@ -147,6 +147,10 @@ editor.setVisible(true);
147
147
  | 型 | `TimeState`、`TimeFailure`、`Lateness`、`SendResult`、`NotSentReason` |
148
148
  | 定数 | `ANSWER_TIMEOUT_MS` |
149
149
 
150
+ `front.time` と `client.time` は、把握している実行 ID とサーバーの識別子をコマンドに付けます。実行が切り替わった場合、サーバーはランチャーに送る前にコマンドを拒否します。この指定に対応していないサーバーはリクエストを拒否します。
151
+
152
+ 画面は、操作ボタンなどを描画した時点の `RunTarget` を `front.time` に渡せます。その対象が現在の実行と一致しなければ、クライアントが操作を拒否します。
153
+
150
154
  ### ECU の変数
151
155
 
152
156
  | 種類 | 名前 |
@@ -322,13 +326,17 @@ try {
322
326
  | `clock` | `sim_ms`(仮想時間の ms。実行の前は `null`)、`speed`、`actual_speed`(直近のおよそ 1 秒に出た速さ。止まっている間と、始まった直後は `null`)、`pacing`(`not-paced`、`on-time`、`late`)。よく変わるので `status` と分けています |
323
327
  | `controls` | 操作ごとの、いま使えるか: `start`、`stop`、`force_stop`、`pause`、`resume`、`step`(`min_ms` と `max_ms` つき)、`run_until`、`speed`(`min`、`max`、`fastest`(数のほかに `'max'` を受けるか)つき)、`save` |
324
328
  | `scenario` | いまの(か最後の)実行のシナリオ: `file`、`name`、`status`、`steps`、`timeline_url`。シナリオのない実行では `null` |
329
+ | `runtime` | 常駐 hot / cold 実行の状態: `mode`、`state`、`config`、`reason`、`message` |
330
+ | `prepare(options?)` | 対応していれば `file` 用の常駐ランチャーを事前準備(`POST api/prepare`)し、非対応なら理由つきで `cold` を返す |
331
+ | `configs()` | サーバーの root 配下の構成ファイル一覧を取得する(`GET api/configs`) |
332
+ | `recording()` | いまの(か最後の)実行で反映された書き込みのシナリオ YAML(`GET api/recording`)、なければ `null` を返す |
325
333
  | `outside` | 実行の `connect` が実機のバスにつないだネットワーク(下の「ネットワークを外につなぐ」) |
326
334
  | `connections({ network }, { file }?)`、`check(intent?, { file }?)` | ネットワークをつなげる先と、始めずに意図を確かめた結果(下の「ネットワークを外につなぐ」) |
327
335
  | `readConfig({ file }?)` | 構成ファイルの、保存されているとおりの文と `stamp`(下の「構成ファイルの文を編集する」) |
328
336
  | `check(intent?, { file, text }?)` | `text` つきなら、そのファイルの、まだ保存していない文の check(同じ節) |
329
337
  | `describeAgain({ file, variant }?)` | 保存したファイルの参加者の説明を保存し直し、その check を返す(同じ節) |
330
338
  | `saveConfig({ file, text, stamp })` | 文をそのファイルとして、読んだときの `stamp`(`null` は新しいファイル)つきで保存し、新しい `stamp` を返す(同じ節) |
331
- | `run` | `start(intent?, { file }?)`、`stop()`、`forceStop()` |
339
+ | `run` | `start(intent?, { file, onStarted }?)`、`stop()`、`forceStop()` |
332
340
  | `time` | `pause()`、`resume()`、`step(ms)`、`setSpeed(value)`、`runUntil(ms)` |
333
341
  | `variable(ref)` | 変数 1 つ。`"ECU.変数"`(最初の点で切る)か `{ peer, name }`(名前に点を含む ECU)で指します |
334
342
  | `low`、`close()` | 同じ接続の `GuiClient`。`close()` は切ります(共有している接続は、次の `connect()` がつなぎ直します) |
package/README.md CHANGED
@@ -92,11 +92,11 @@ The names that `src/index.ts` exports, by group. Parentheses list the members of
92
92
 
93
93
  ### Front door
94
94
 
95
- | Kind | Name |
96
- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
97
- | Function | `connect(options?)`, `createFront(options)`, `watch(source, fn)`, `until(source, test, options?)` |
98
- | Class | `ActionError` (`code`, `message`, `outcome`, `findings`) |
99
- | Type | `ConnectOptions` (`base_url`, `token`, `origin`, `http`, `socket`, `answer_timeout_ms`, `on_error`), `Front` (`low`, `status`, `clock`, `controls`, `scenario`, `outside`, `run`, `time`, `variable()`, `scenarios()`, `connections()`, `check()`, `readConfig()`, `describeAgain()`, `saveConfig()`, `close()`), `FrontStatus`, `FrontResult`, `FrontClock`, `FrontControls`, `Control`, `Reason`, `FrontScenario`, `FrontRun`, `FrontTime`, `FrontVariable`, `VariableView`, `Intent`, `Outside`, `ConnectEntry`, `ConnectTarget`, `ConnectListError`, `Link`, `RunState`, `EndKind`, `Pacing`, `OperationName` |
95
+ | Kind | Name |
96
+ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
97
+ | Function | `connect(options?)`, `createFront(options)`, `watch(source, fn)`, `until(source, test, options?)` |
98
+ | Class | `ActionError` (`code`, `message`, `outcome`, `findings`) |
99
+ | Type | `ConnectOptions` (`base_url`, `token`, `origin`, `http`, `socket`, `answer_timeout_ms`, `on_error`), `Front` (`low`, `status`, `clock`, `controls`, `scenario`, `runtime`, `outside`, `prepare()`, `configs()`, `recording()`, `run`, `time`, `variable()`, `scenarios()`, `connections()`, `check()`, `readConfig()`, `describeAgain()`, `saveConfig()`, `close()`), `FrontStatus`, `FrontResult`, `FrontClock`, `FrontControls`, `Control`, `Reason`, `FrontScenario`, `FrontRun`, `FrontTime`, `FrontVariable`, `VariableView`, `Intent`, `Outside`, `ConnectEntry`, `ConnectTarget`, `ConnectListError`, `Link`, `RunState`, `EndKind`, `Pacing`, `OperationName`, `RuntimeStatus` |
100
100
 
101
101
  ### Token
102
102
 
@@ -147,6 +147,10 @@ The `currentTarget()` method returns the current `{session, instance}` pair, or
147
147
  | Type | `TimeState`, `TimeFailure`, `Lateness`, `SendResult`, `NotSentReason` |
148
148
  | Constant | `ANSWER_TIMEOUT_MS` |
149
149
 
150
+ Both `front.time` and `client.time` send commands with the known run ID and server instance. If the run is replaced, the server rejects the command before sending it to a launcher. Older servers that do not accept these fields reject the request.
151
+
152
+ A screen can pass the `RunTarget` it captured when rendering a control to `front.time`. The client rejects the action if that target no longer matches the current run.
153
+
150
154
  ### ECU variable API
151
155
 
152
156
  | Kind | Name |
@@ -322,13 +326,17 @@ try {
322
326
  | `clock` | `sim_ms` (the virtual time in ms; `null` before a run), `speed`, `actual_speed` (the speed over about the last second; `null` while paused and right after the start) and `pacing` (`not-paced`, `on-time` or `late`). It changes often, so it is apart from `status` |
323
327
  | `controls` | Whether each operation can be used now: `start`, `stop`, `force_stop`, `pause`, `resume`, `step` (with `min_ms` and `max_ms`), `run_until`, `speed` (with `min`, `max` and `fastest`: whether `'max'` is accepted besides the numbers), and `save` |
324
328
  | `scenario` | The scenario of the current (or last) run: `file`, `name`, `status`, `steps`, `timeline_url`; `null` for a run without one |
329
+ | `runtime` | Persistent hot / cold runtime status: `mode`, `state`, `config`, `reason`, `message` |
330
+ | `prepare(options?)` | Pre-warms a persistent launcher for `file` (`POST api/prepare`) when eligible, or returns `cold` with `reason` |
331
+ | `configs()` | Lists configuration files under the server root (`GET api/configs`) |
332
+ | `recording()` | Returns applied writes of the current or last run as scenario YAML (`GET api/recording`), or `null` if none |
325
333
  | `outside` | The networks that the run's `connect` connected to a real bus ("Connecting a network outside" below) |
326
334
  | `connections({ network }, { file }?)`, `check(intent?, { file }?)` | Where a network can be connected, and the check of an intent without starting it ("Connecting a network outside" below) |
327
335
  | `readConfig({ file }?)` | The text of a configuration file as it is saved, with its `stamp` ("Editing the text of a configuration file" below) |
328
336
  | `check(intent?, { file, text }?)` | With `text`, the check of an unsaved text of the file (the same section) |
329
337
  | `describeAgain({ file, variant }?)` | Describes the participants of the saved file again, and returns that check (the same section) |
330
338
  | `saveConfig({ file, text, stamp })` | Saves a text as the file, with the `stamp` it was read with (`null`: a new file), and returns the new `stamp` (the same section) |
331
- | `run` | `start(intent?, { file }?)`, `stop()` and `forceStop()` |
339
+ | `run` | `start(intent?, { file, onStarted }?)`, `stop()` and `forceStop()` |
332
340
  | `time` | `pause()`, `resume()`, `step(ms)`, `setSpeed(value)` and `runUntil(ms)` |
333
341
  | `variable(ref)` | One variable, by `"ECU.variable"` (cut at the first dot) or `{ peer, name }` (for an ECU whose name has a dot) |
334
342
  | `low`, `close()` | The `GuiClient` of the same connection; `close()` disconnects (a shared connection is made again by the next `connect()`) |