4 Commits
0.1.0 ... 0.2.0

Author SHA1 Message Date
lenn
1c5ac13da8 feat:themes, tactilea codec 2026-04-03 16:40:48 +08:00
lennlouisgeek
7688986ad7 exchange tast to tactilea 2026-04-03 00:47:36 +08:00
lenn
a686d19e61 feat:add slave 2026-04-02 17:54:10 +08:00
lenn
380394b93a add tactile_a codec 2026-04-01 18:35:22 +08:00
55 changed files with 3713 additions and 493 deletions

View File

@@ -0,0 +1,62 @@
# Details
Date : 2026-04-01 16:39:17
Directory e:\\Workspace\\JE-Skin
Total : 47 files, 8908 codes, 94 comments, 1250 blanks, all 10252 lines
[Summary](results.md) / Details / [Diff Summary](diff.md) / [Diff Details](diff-details.md)
## Files
| filename | language | code | comment | blank | total |
| :--- | :--- | ---: | ---: | ---: | ---: |
| [.idea/modules.xml](/.idea/modules.xml) | XML | 8 | 0 | 0 | 8 |
| [.idea/tauri-demo.iml](/.idea/tauri-demo.iml) | XML | 11 | 0 | 0 | 11 |
| [README.md](/README.md) | Markdown | 34 | 0 | 20 | 54 |
| [flowus\_tools.json](/flowus_tools.json) | JSON | 1 | 0 | 1 | 2 |
| [frontend\_prompt.md](/frontend_prompt.md) | Markdown | 189 | 0 | 66 | 255 |
| [package-lock.json](/package-lock.json) | JSON | 1,957 | 0 | 1 | 1,958 |
| [package.json](/package.json) | JSON | 31 | 0 | 1 | 32 |
| [src-tauri/build.rs](/src-tauri/build.rs) | Rust | 3 | 0 | 1 | 4 |
| [src-tauri/capabilities/default.json](/src-tauri/capabilities/default.json) | JSON | 15 | 0 | 1 | 16 |
| [src-tauri/src/commands/mod.rs](/src-tauri/src/commands/mod.rs) | Rust | 2 | 0 | 1 | 3 |
| [src-tauri/src/commands/serial.rs](/src-tauri/src/commands/serial.rs) | Rust | 246 | 0 | 44 | 290 |
| [src-tauri/src/commands/window.rs](/src-tauri/src/commands/window.rs) | Rust | 27 | 0 | 6 | 33 |
| [src-tauri/src/lib.rs](/src-tauri/src/lib.rs) | Rust | 22 | 0 | 2 | 24 |
| [src-tauri/src/log.rs](/src-tauri/src/log.rs) | Rust | 34 | 0 | 2 | 36 |
| [src-tauri/src/main.rs](/src-tauri/src/main.rs) | Rust | 8 | 1 | 2 | 11 |
| [src-tauri/src/serial\_core/codec.rs](/src-tauri/src/serial_core/codec.rs) | Rust | 6 | 0 | 1 | 7 |
| [src-tauri/src/serial\_core/codecs/mod.rs](/src-tauri/src/serial_core/codecs/mod.rs) | Rust | 4 | 0 | 1 | 5 |
| [src-tauri/src/serial\_core/codecs/tactile\_a.rs](/src-tauri/src/serial_core/codecs/tactile_a.rs) | Rust | 67 | 0 | 17 | 84 |
| [src-tauri/src/serial\_core/codecs/test.rs](/src-tauri/src/serial_core/codecs/test.rs) | Rust | 213 | 7 | 40 | 260 |
| [src-tauri/src/serial\_core/error.rs](/src-tauri/src/serial_core/error.rs) | Rust | 47 | 0 | 6 | 53 |
| [src-tauri/src/serial\_core/frame.rs](/src-tauri/src/serial_core/frame.rs) | Rust | 46 | 3 | 9 | 58 |
| [src-tauri/src/serial\_core/mod.rs](/src-tauri/src/serial_core/mod.rs) | Rust | 22 | 0 | 7 | 29 |
| [src-tauri/src/serial\_core/model.rs](/src-tauri/src/serial_core/model.rs) | Rust | 377 | 57 | 67 | 501 |
| [src-tauri/src/serial\_core/record.rs](/src-tauri/src/serial_core/record.rs) | Rust | 50 | 4 | 11 | 65 |
| [src-tauri/src/serial\_core/serial.rs](/src-tauri/src/serial_core/serial.rs) | Rust | 73 | 0 | 8 | 81 |
| [src-tauri/src/serial\_core/utils.rs](/src-tauri/src/serial_core/utils.rs) | Rust | 26 | 0 | 6 | 32 |
| [src-tauri/tauri.conf.json](/src-tauri/tauri.conf.json) | JSON | 36 | 0 | 1 | 37 |
| [src/app.html](/src/app.html) | HTML | 13 | 0 | 1 | 14 |
| [src/lib/components/CenterStage.svelte](/src/lib/components/CenterStage.svelte) | Svelte | 691 | 0 | 96 | 787 |
| [src/lib/components/ConfigPanel.svelte](/src/lib/components/ConfigPanel.svelte) | Svelte | 398 | 0 | 63 | 461 |
| [src/lib/components/HudPanel.svelte](/src/lib/components/HudPanel.svelte) | Svelte | 861 | 0 | 110 | 971 |
| [src/lib/components/PressureMatrixViewer.svelte](/src/lib/components/PressureMatrixViewer.svelte) | Svelte | 558 | 0 | 97 | 655 |
| [src/lib/components/SignalChart.svelte](/src/lib/components/SignalChart.svelte) | Svelte | 382 | 0 | 71 | 453 |
| [src/lib/components/SummaryCurve.svelte](/src/lib/components/SummaryCurve.svelte) | Svelte | 497 | 0 | 88 | 585 |
| [src/lib/config/color-map.ts](/src/lib/config/color-map.ts) | TypeScript | 55 | 0 | 3 | 58 |
| [src/lib/styles/theme.css](/src/lib/styles/theme.css) | PostCSS | 43 | 1 | 7 | 51 |
| [src/lib/types/hud.ts](/src/lib/types/hud.ts) | TypeScript | 126 | 0 | 20 | 146 |
| [src/routes/+layout.svelte](/src/routes/+layout.svelte) | Svelte | 13 | 0 | 5 | 18 |
| [src/routes/+layout.ts](/src/routes/+layout.ts) | TypeScript | 1 | 4 | 1 | 6 |
| [src/routes/+page.svelte](/src/routes/+page.svelte) | Svelte | 1,286 | 0 | 176 | 1,462 |
| [static/svelte.svg](/static/svelte.svg) | XML | 1 | 0 | 0 | 1 |
| [static/tauri.svg](/static/tauri.svg) | XML | 6 | 0 | 1 | 7 |
| [static/vite.svg](/static/vite.svg) | XML | 1 | 0 | 0 | 1 |
| [svelte.config.js](/svelte.config.js) | JavaScript | 11 | 5 | 3 | 19 |
| [tauri-event.md](/tauri-event.md) | Markdown | 374 | 0 | 181 | 555 |
| [tsconfig.json](/tsconfig.json) | JSON with Comments | 14 | 5 | 1 | 20 |
| [vite.config.js](/vite.config.js) | JavaScript | 22 | 7 | 4 | 33 |
[Summary](results.md) / Details / [Diff Summary](diff.md) / [Diff Details](diff-details.md)

View File

@@ -0,0 +1,15 @@
# Diff Details
Date : 2026-04-01 16:39:17
Directory e:\\Workspace\\JE-Skin
Total : 0 files, 0 codes, 0 comments, 0 blanks, all 0 lines
[Summary](results.md) / [Details](details.md) / [Diff Summary](diff.md) / Diff Details
## Files
| filename | language | code | comment | blank | total |
| :--- | :--- | ---: | ---: | ---: | ---: |
[Summary](results.md) / [Details](details.md) / [Diff Summary](diff.md) / Diff Details

View File

@@ -0,0 +1,2 @@
"filename", "language", "", "comment", "blank", "total"
"Total", "-", , 0, 0, 0
1 filename language comment blank total
2 Total - 0 0 0

View File

@@ -0,0 +1,19 @@
# Diff Summary
Date : 2026-04-01 16:39:17
Directory e:\\Workspace\\JE-Skin
Total : 0 files, 0 codes, 0 comments, 0 blanks, all 0 lines
[Summary](results.md) / [Details](details.md) / Diff Summary / [Diff Details](diff-details.md)
## Languages
| language | files | code | comment | blank | total |
| :--- | ---: | ---: | ---: | ---: | ---: |
## Directories
| path | files | code | comment | blank | total |
| :--- | ---: | ---: | ---: | ---: | ---: |
[Summary](results.md) / [Details](details.md) / Diff Summary / [Diff Details](diff-details.md)

View File

@@ -0,0 +1,22 @@
Date : 2026-04-01 16:39:17
Directory : e:\Workspace\JE-Skin
Total : 0 files, 0 codes, 0 comments, 0 blanks, all 0 lines
Languages
+----------+------------+------------+------------+------------+------------+
| language | files | code | comment | blank | total |
+----------+------------+------------+------------+------------+------------+
+----------+------------+------------+------------+------------+------------+
Directories
+------+------------+------------+------------+------------+------------+
| path | files | code | comment | blank | total |
+------+------------+------------+------------+------------+------------+
+------+------------+------------+------------+------------+------------+
Files
+----------+----------+------------+------------+------------+------------+
| filename | language | code | comment | blank | total |
+----------+----------+------------+------------+------------+------------+
| Total | | 0 | 0 | 0 | 0 |
+----------+----------+------------+------------+------------+------------+

View File

@@ -0,0 +1,49 @@
"filename", "language", "JavaScript", "JSON", "Markdown", "JSON with Comments", "XML", "TypeScript", "Svelte", "Rust", "PostCSS", "HTML", "comment", "blank", "total"
"e:\Workspace\JE-Skin\.idea\modules.xml", "XML", 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 8
"e:\Workspace\JE-Skin\.idea\tauri-demo.iml", "XML", 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 11
"e:\Workspace\JE-Skin\README.md", "Markdown", 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 20, 54
"e:\Workspace\JE-Skin\flowus_tools.json", "JSON", 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2
"e:\Workspace\JE-Skin\frontend_prompt.md", "Markdown", 0, 0, 189, 0, 0, 0, 0, 0, 0, 0, 0, 66, 255
"e:\Workspace\JE-Skin\package-lock.json", "JSON", 0, 1957, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1958
"e:\Workspace\JE-Skin\package.json", "JSON", 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 32
"e:\Workspace\JE-Skin\src-tauri\build.rs", "Rust", 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 4
"e:\Workspace\JE-Skin\src-tauri\capabilities\default.json", "JSON", 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 16
"e:\Workspace\JE-Skin\src-tauri\src\commands\mod.rs", "Rust", 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 3
"e:\Workspace\JE-Skin\src-tauri\src\commands\serial.rs", "Rust", 0, 0, 0, 0, 0, 0, 0, 246, 0, 0, 0, 44, 290
"e:\Workspace\JE-Skin\src-tauri\src\commands\window.rs", "Rust", 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 6, 33
"e:\Workspace\JE-Skin\src-tauri\src\lib.rs", "Rust", 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 2, 24
"e:\Workspace\JE-Skin\src-tauri\src\log.rs", "Rust", 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 2, 36
"e:\Workspace\JE-Skin\src-tauri\src\main.rs", "Rust", 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 1, 2, 11
"e:\Workspace\JE-Skin\src-tauri\src\serial_core\codec.rs", "Rust", 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 1, 7
"e:\Workspace\JE-Skin\src-tauri\src\serial_core\codecs\mod.rs", "Rust", 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 1, 5
"e:\Workspace\JE-Skin\src-tauri\src\serial_core\codecs\tactile_a.rs", "Rust", 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, 17, 84
"e:\Workspace\JE-Skin\src-tauri\src\serial_core\codecs\test.rs", "Rust", 0, 0, 0, 0, 0, 0, 0, 213, 0, 0, 7, 40, 260
"e:\Workspace\JE-Skin\src-tauri\src\serial_core\error.rs", "Rust", 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 6, 53
"e:\Workspace\JE-Skin\src-tauri\src\serial_core\frame.rs", "Rust", 0, 0, 0, 0, 0, 0, 0, 46, 0, 0, 3, 9, 58
"e:\Workspace\JE-Skin\src-tauri\src\serial_core\mod.rs", "Rust", 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 7, 29
"e:\Workspace\JE-Skin\src-tauri\src\serial_core\model.rs", "Rust", 0, 0, 0, 0, 0, 0, 0, 377, 0, 0, 57, 67, 501
"e:\Workspace\JE-Skin\src-tauri\src\serial_core\record.rs", "Rust", 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 4, 11, 65
"e:\Workspace\JE-Skin\src-tauri\src\serial_core\serial.rs", "Rust", 0, 0, 0, 0, 0, 0, 0, 73, 0, 0, 0, 8, 81
"e:\Workspace\JE-Skin\src-tauri\src\serial_core\utils.rs", "Rust", 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 6, 32
"e:\Workspace\JE-Skin\src-tauri\tauri.conf.json", "JSON", 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 37
"e:\Workspace\JE-Skin\src\app.html", "HTML", 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 1, 14
"e:\Workspace\JE-Skin\src\lib\components\CenterStage.svelte", "Svelte", 0, 0, 0, 0, 0, 0, 691, 0, 0, 0, 0, 96, 787
"e:\Workspace\JE-Skin\src\lib\components\ConfigPanel.svelte", "Svelte", 0, 0, 0, 0, 0, 0, 398, 0, 0, 0, 0, 63, 461
"e:\Workspace\JE-Skin\src\lib\components\HudPanel.svelte", "Svelte", 0, 0, 0, 0, 0, 0, 861, 0, 0, 0, 0, 110, 971
"e:\Workspace\JE-Skin\src\lib\components\PressureMatrixViewer.svelte", "Svelte", 0, 0, 0, 0, 0, 0, 558, 0, 0, 0, 0, 97, 655
"e:\Workspace\JE-Skin\src\lib\components\SignalChart.svelte", "Svelte", 0, 0, 0, 0, 0, 0, 382, 0, 0, 0, 0, 71, 453
"e:\Workspace\JE-Skin\src\lib\components\SummaryCurve.svelte", "Svelte", 0, 0, 0, 0, 0, 0, 497, 0, 0, 0, 0, 88, 585
"e:\Workspace\JE-Skin\src\lib\config\color-map.ts", "TypeScript", 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 3, 58
"e:\Workspace\JE-Skin\src\lib\styles\theme.css", "PostCSS", 0, 0, 0, 0, 0, 0, 0, 0, 43, 0, 1, 7, 51
"e:\Workspace\JE-Skin\src\lib\types\hud.ts", "TypeScript", 0, 0, 0, 0, 0, 126, 0, 0, 0, 0, 0, 20, 146
"e:\Workspace\JE-Skin\src\routes\+layout.svelte", "Svelte", 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 5, 18
"e:\Workspace\JE-Skin\src\routes\+layout.ts", "TypeScript", 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 4, 1, 6
"e:\Workspace\JE-Skin\src\routes\+page.svelte", "Svelte", 0, 0, 0, 0, 0, 0, 1286, 0, 0, 0, 0, 176, 1462
"e:\Workspace\JE-Skin\static\svelte.svg", "XML", 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1
"e:\Workspace\JE-Skin\static\tauri.svg", "XML", 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 1, 7
"e:\Workspace\JE-Skin\static\vite.svg", "XML", 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1
"e:\Workspace\JE-Skin\svelte.config.js", "JavaScript", 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 3, 19
"e:\Workspace\JE-Skin\tauri-event.md", "Markdown", 0, 0, 374, 0, 0, 0, 0, 0, 0, 0, 0, 181, 555
"e:\Workspace\JE-Skin\tsconfig.json", "JSON with Comments", 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 5, 1, 20
"e:\Workspace\JE-Skin\vite.config.js", "JavaScript", 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 4, 33
"Total", "-", 33, 2040, 597, 14, 27, 182, 4686, 1273, 43, 13, 94, 1250, 10252
1 filename language JavaScript JSON Markdown JSON with Comments XML TypeScript Svelte Rust PostCSS HTML comment blank total
2 e:\Workspace\JE-Skin\.idea\modules.xml XML 0 0 0 0 8 0 0 0 0 0 0 0 8
3 e:\Workspace\JE-Skin\.idea\tauri-demo.iml XML 0 0 0 0 11 0 0 0 0 0 0 0 11
4 e:\Workspace\JE-Skin\README.md Markdown 0 0 34 0 0 0 0 0 0 0 0 20 54
5 e:\Workspace\JE-Skin\flowus_tools.json JSON 0 1 0 0 0 0 0 0 0 0 0 1 2
6 e:\Workspace\JE-Skin\frontend_prompt.md Markdown 0 0 189 0 0 0 0 0 0 0 0 66 255
7 e:\Workspace\JE-Skin\package-lock.json JSON 0 1957 0 0 0 0 0 0 0 0 0 1 1958
8 e:\Workspace\JE-Skin\package.json JSON 0 31 0 0 0 0 0 0 0 0 0 1 32
9 e:\Workspace\JE-Skin\src-tauri\build.rs Rust 0 0 0 0 0 0 0 3 0 0 0 1 4
10 e:\Workspace\JE-Skin\src-tauri\capabilities\default.json JSON 0 15 0 0 0 0 0 0 0 0 0 1 16
11 e:\Workspace\JE-Skin\src-tauri\src\commands\mod.rs Rust 0 0 0 0 0 0 0 2 0 0 0 1 3
12 e:\Workspace\JE-Skin\src-tauri\src\commands\serial.rs Rust 0 0 0 0 0 0 0 246 0 0 0 44 290
13 e:\Workspace\JE-Skin\src-tauri\src\commands\window.rs Rust 0 0 0 0 0 0 0 27 0 0 0 6 33
14 e:\Workspace\JE-Skin\src-tauri\src\lib.rs Rust 0 0 0 0 0 0 0 22 0 0 0 2 24
15 e:\Workspace\JE-Skin\src-tauri\src\log.rs Rust 0 0 0 0 0 0 0 34 0 0 0 2 36
16 e:\Workspace\JE-Skin\src-tauri\src\main.rs Rust 0 0 0 0 0 0 0 8 0 0 1 2 11
17 e:\Workspace\JE-Skin\src-tauri\src\serial_core\codec.rs Rust 0 0 0 0 0 0 0 6 0 0 0 1 7
18 e:\Workspace\JE-Skin\src-tauri\src\serial_core\codecs\mod.rs Rust 0 0 0 0 0 0 0 4 0 0 0 1 5
19 e:\Workspace\JE-Skin\src-tauri\src\serial_core\codecs\tactile_a.rs Rust 0 0 0 0 0 0 0 67 0 0 0 17 84
20 e:\Workspace\JE-Skin\src-tauri\src\serial_core\codecs\test.rs Rust 0 0 0 0 0 0 0 213 0 0 7 40 260
21 e:\Workspace\JE-Skin\src-tauri\src\serial_core\error.rs Rust 0 0 0 0 0 0 0 47 0 0 0 6 53
22 e:\Workspace\JE-Skin\src-tauri\src\serial_core\frame.rs Rust 0 0 0 0 0 0 0 46 0 0 3 9 58
23 e:\Workspace\JE-Skin\src-tauri\src\serial_core\mod.rs Rust 0 0 0 0 0 0 0 22 0 0 0 7 29
24 e:\Workspace\JE-Skin\src-tauri\src\serial_core\model.rs Rust 0 0 0 0 0 0 0 377 0 0 57 67 501
25 e:\Workspace\JE-Skin\src-tauri\src\serial_core\record.rs Rust 0 0 0 0 0 0 0 50 0 0 4 11 65
26 e:\Workspace\JE-Skin\src-tauri\src\serial_core\serial.rs Rust 0 0 0 0 0 0 0 73 0 0 0 8 81
27 e:\Workspace\JE-Skin\src-tauri\src\serial_core\utils.rs Rust 0 0 0 0 0 0 0 26 0 0 0 6 32
28 e:\Workspace\JE-Skin\src-tauri\tauri.conf.json JSON 0 36 0 0 0 0 0 0 0 0 0 1 37
29 e:\Workspace\JE-Skin\src\app.html HTML 0 0 0 0 0 0 0 0 0 13 0 1 14
30 e:\Workspace\JE-Skin\src\lib\components\CenterStage.svelte Svelte 0 0 0 0 0 0 691 0 0 0 0 96 787
31 e:\Workspace\JE-Skin\src\lib\components\ConfigPanel.svelte Svelte 0 0 0 0 0 0 398 0 0 0 0 63 461
32 e:\Workspace\JE-Skin\src\lib\components\HudPanel.svelte Svelte 0 0 0 0 0 0 861 0 0 0 0 110 971
33 e:\Workspace\JE-Skin\src\lib\components\PressureMatrixViewer.svelte Svelte 0 0 0 0 0 0 558 0 0 0 0 97 655
34 e:\Workspace\JE-Skin\src\lib\components\SignalChart.svelte Svelte 0 0 0 0 0 0 382 0 0 0 0 71 453
35 e:\Workspace\JE-Skin\src\lib\components\SummaryCurve.svelte Svelte 0 0 0 0 0 0 497 0 0 0 0 88 585
36 e:\Workspace\JE-Skin\src\lib\config\color-map.ts TypeScript 0 0 0 0 0 55 0 0 0 0 0 3 58
37 e:\Workspace\JE-Skin\src\lib\styles\theme.css PostCSS 0 0 0 0 0 0 0 0 43 0 1 7 51
38 e:\Workspace\JE-Skin\src\lib\types\hud.ts TypeScript 0 0 0 0 0 126 0 0 0 0 0 20 146
39 e:\Workspace\JE-Skin\src\routes\+layout.svelte Svelte 0 0 0 0 0 0 13 0 0 0 0 5 18
40 e:\Workspace\JE-Skin\src\routes\+layout.ts TypeScript 0 0 0 0 0 1 0 0 0 0 4 1 6
41 e:\Workspace\JE-Skin\src\routes\+page.svelte Svelte 0 0 0 0 0 0 1286 0 0 0 0 176 1462
42 e:\Workspace\JE-Skin\static\svelte.svg XML 0 0 0 0 1 0 0 0 0 0 0 0 1
43 e:\Workspace\JE-Skin\static\tauri.svg XML 0 0 0 0 6 0 0 0 0 0 0 1 7
44 e:\Workspace\JE-Skin\static\vite.svg XML 0 0 0 0 1 0 0 0 0 0 0 0 1
45 e:\Workspace\JE-Skin\svelte.config.js JavaScript 11 0 0 0 0 0 0 0 0 0 5 3 19
46 e:\Workspace\JE-Skin\tauri-event.md Markdown 0 0 374 0 0 0 0 0 0 0 0 181 555
47 e:\Workspace\JE-Skin\tsconfig.json JSON with Comments 0 0 0 14 0 0 0 0 0 0 5 1 20
48 e:\Workspace\JE-Skin\vite.config.js JavaScript 22 0 0 0 0 0 0 0 0 0 7 4 33
49 Total - 33 2040 597 14 27 182 4686 1273 43 13 94 1250 10252

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,50 @@
# Summary
Date : 2026-04-01 16:39:17
Directory e:\\Workspace\\JE-Skin
Total : 47 files, 8908 codes, 94 comments, 1250 blanks, all 10252 lines
Summary / [Details](details.md) / [Diff Summary](diff.md) / [Diff Details](diff-details.md)
## Languages
| language | files | code | comment | blank | total |
| :--- | ---: | ---: | ---: | ---: | ---: |
| Svelte | 8 | 4,686 | 0 | 706 | 5,392 |
| JSON | 5 | 2,040 | 0 | 5 | 2,045 |
| Rust | 18 | 1,273 | 72 | 231 | 1,576 |
| Markdown | 3 | 597 | 0 | 267 | 864 |
| TypeScript | 3 | 182 | 4 | 24 | 210 |
| PostCSS | 1 | 43 | 1 | 7 | 51 |
| JavaScript | 2 | 33 | 12 | 7 | 52 |
| XML | 5 | 27 | 0 | 1 | 28 |
| JSON with Comments | 1 | 14 | 5 | 1 | 20 |
| HTML | 1 | 13 | 0 | 1 | 14 |
## Directories
| path | files | code | comment | blank | total |
| :--- | ---: | ---: | ---: | ---: | ---: |
| . | 47 | 8,908 | 94 | 1,250 | 10,252 |
| . (Files) | 9 | 2,633 | 17 | 278 | 2,928 |
| .idea | 2 | 19 | 0 | 0 | 19 |
| src | 13 | 4,924 | 5 | 738 | 5,667 |
| src (Files) | 1 | 13 | 0 | 1 | 14 |
| src-tauri | 20 | 1,324 | 72 | 233 | 1,629 |
| src-tauri (Files) | 2 | 39 | 0 | 2 | 41 |
| src-tauri\\capabilities | 1 | 15 | 0 | 1 | 16 |
| src-tauri\\src | 17 | 1,270 | 72 | 230 | 1,572 |
| src-tauri\\src (Files) | 3 | 64 | 1 | 6 | 71 |
| src-tauri\\src\\commands | 3 | 275 | 0 | 51 | 326 |
| src-tauri\\src\\serial_core | 11 | 931 | 71 | 173 | 1,175 |
| src-tauri\\src\\serial_core (Files) | 8 | 647 | 64 | 115 | 826 |
| src-tauri\\src\\serial_core\\codecs | 3 | 284 | 7 | 58 | 349 |
| src\\lib | 9 | 3,611 | 1 | 555 | 4,167 |
| src\\lib\\components | 6 | 3,387 | 0 | 525 | 3,912 |
| src\\lib\\config | 1 | 55 | 0 | 3 | 58 |
| src\\lib\\styles | 1 | 43 | 1 | 7 | 51 |
| src\\lib\\types | 1 | 126 | 0 | 20 | 146 |
| src\\routes | 3 | 1,300 | 4 | 182 | 1,486 |
| static | 3 | 8 | 0 | 1 | 9 |
Summary / [Details](details.md) / [Diff Summary](diff.md) / [Diff Details](diff-details.md)

View File

@@ -0,0 +1,100 @@
Date : 2026-04-01 16:39:17
Directory : e:\Workspace\JE-Skin
Total : 47 files, 8908 codes, 94 comments, 1250 blanks, all 10252 lines
Languages
+--------------------+------------+------------+------------+------------+------------+
| language | files | code | comment | blank | total |
+--------------------+------------+------------+------------+------------+------------+
| Svelte | 8 | 4,686 | 0 | 706 | 5,392 |
| JSON | 5 | 2,040 | 0 | 5 | 2,045 |
| Rust | 18 | 1,273 | 72 | 231 | 1,576 |
| Markdown | 3 | 597 | 0 | 267 | 864 |
| TypeScript | 3 | 182 | 4 | 24 | 210 |
| PostCSS | 1 | 43 | 1 | 7 | 51 |
| JavaScript | 2 | 33 | 12 | 7 | 52 |
| XML | 5 | 27 | 0 | 1 | 28 |
| JSON with Comments | 1 | 14 | 5 | 1 | 20 |
| HTML | 1 | 13 | 0 | 1 | 14 |
+--------------------+------------+------------+------------+------------+------------+
Directories
+---------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| path | files | code | comment | blank | total |
+---------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| . | 47 | 8,908 | 94 | 1,250 | 10,252 |
| . (Files) | 9 | 2,633 | 17 | 278 | 2,928 |
| .idea | 2 | 19 | 0 | 0 | 19 |
| src | 13 | 4,924 | 5 | 738 | 5,667 |
| src (Files) | 1 | 13 | 0 | 1 | 14 |
| src-tauri | 20 | 1,324 | 72 | 233 | 1,629 |
| src-tauri (Files) | 2 | 39 | 0 | 2 | 41 |
| src-tauri\capabilities | 1 | 15 | 0 | 1 | 16 |
| src-tauri\src | 17 | 1,270 | 72 | 230 | 1,572 |
| src-tauri\src (Files) | 3 | 64 | 1 | 6 | 71 |
| src-tauri\src\commands | 3 | 275 | 0 | 51 | 326 |
| src-tauri\src\serial_core | 11 | 931 | 71 | 173 | 1,175 |
| src-tauri\src\serial_core (Files) | 8 | 647 | 64 | 115 | 826 |
| src-tauri\src\serial_core\codecs | 3 | 284 | 7 | 58 | 349 |
| src\lib | 9 | 3,611 | 1 | 555 | 4,167 |
| src\lib\components | 6 | 3,387 | 0 | 525 | 3,912 |
| src\lib\config | 1 | 55 | 0 | 3 | 58 |
| src\lib\styles | 1 | 43 | 1 | 7 | 51 |
| src\lib\types | 1 | 126 | 0 | 20 | 146 |
| src\routes | 3 | 1,300 | 4 | 182 | 1,486 |
| static | 3 | 8 | 0 | 1 | 9 |
+---------------------------------------------------------------------------+------------+------------+------------+------------+------------+
Files
+---------------------------------------------------------------------------+--------------------+------------+------------+------------+------------+
| filename | language | code | comment | blank | total |
+---------------------------------------------------------------------------+--------------------+------------+------------+------------+------------+
| e:\Workspace\JE-Skin\.idea\modules.xml | XML | 8 | 0 | 0 | 8 |
| e:\Workspace\JE-Skin\.idea\tauri-demo.iml | XML | 11 | 0 | 0 | 11 |
| e:\Workspace\JE-Skin\README.md | Markdown | 34 | 0 | 20 | 54 |
| e:\Workspace\JE-Skin\flowus_tools.json | JSON | 1 | 0 | 1 | 2 |
| e:\Workspace\JE-Skin\frontend_prompt.md | Markdown | 189 | 0 | 66 | 255 |
| e:\Workspace\JE-Skin\package-lock.json | JSON | 1,957 | 0 | 1 | 1,958 |
| e:\Workspace\JE-Skin\package.json | JSON | 31 | 0 | 1 | 32 |
| e:\Workspace\JE-Skin\src-tauri\build.rs | Rust | 3 | 0 | 1 | 4 |
| e:\Workspace\JE-Skin\src-tauri\capabilities\default.json | JSON | 15 | 0 | 1 | 16 |
| e:\Workspace\JE-Skin\src-tauri\src\commands\mod.rs | Rust | 2 | 0 | 1 | 3 |
| e:\Workspace\JE-Skin\src-tauri\src\commands\serial.rs | Rust | 246 | 0 | 44 | 290 |
| e:\Workspace\JE-Skin\src-tauri\src\commands\window.rs | Rust | 27 | 0 | 6 | 33 |
| e:\Workspace\JE-Skin\src-tauri\src\lib.rs | Rust | 22 | 0 | 2 | 24 |
| e:\Workspace\JE-Skin\src-tauri\src\log.rs | Rust | 34 | 0 | 2 | 36 |
| e:\Workspace\JE-Skin\src-tauri\src\main.rs | Rust | 8 | 1 | 2 | 11 |
| e:\Workspace\JE-Skin\src-tauri\src\serial_core\codec.rs | Rust | 6 | 0 | 1 | 7 |
| e:\Workspace\JE-Skin\src-tauri\src\serial_core\codecs\mod.rs | Rust | 4 | 0 | 1 | 5 |
| e:\Workspace\JE-Skin\src-tauri\src\serial_core\codecs\tactile_a.rs | Rust | 67 | 0 | 17 | 84 |
| e:\Workspace\JE-Skin\src-tauri\src\serial_core\codecs\test.rs | Rust | 213 | 7 | 40 | 260 |
| e:\Workspace\JE-Skin\src-tauri\src\serial_core\error.rs | Rust | 47 | 0 | 6 | 53 |
| e:\Workspace\JE-Skin\src-tauri\src\serial_core\frame.rs | Rust | 46 | 3 | 9 | 58 |
| e:\Workspace\JE-Skin\src-tauri\src\serial_core\mod.rs | Rust | 22 | 0 | 7 | 29 |
| e:\Workspace\JE-Skin\src-tauri\src\serial_core\model.rs | Rust | 377 | 57 | 67 | 501 |
| e:\Workspace\JE-Skin\src-tauri\src\serial_core\record.rs | Rust | 50 | 4 | 11 | 65 |
| e:\Workspace\JE-Skin\src-tauri\src\serial_core\serial.rs | Rust | 73 | 0 | 8 | 81 |
| e:\Workspace\JE-Skin\src-tauri\src\serial_core\utils.rs | Rust | 26 | 0 | 6 | 32 |
| e:\Workspace\JE-Skin\src-tauri\tauri.conf.json | JSON | 36 | 0 | 1 | 37 |
| e:\Workspace\JE-Skin\src\app.html | HTML | 13 | 0 | 1 | 14 |
| e:\Workspace\JE-Skin\src\lib\components\CenterStage.svelte | Svelte | 691 | 0 | 96 | 787 |
| e:\Workspace\JE-Skin\src\lib\components\ConfigPanel.svelte | Svelte | 398 | 0 | 63 | 461 |
| e:\Workspace\JE-Skin\src\lib\components\HudPanel.svelte | Svelte | 861 | 0 | 110 | 971 |
| e:\Workspace\JE-Skin\src\lib\components\PressureMatrixViewer.svelte | Svelte | 558 | 0 | 97 | 655 |
| e:\Workspace\JE-Skin\src\lib\components\SignalChart.svelte | Svelte | 382 | 0 | 71 | 453 |
| e:\Workspace\JE-Skin\src\lib\components\SummaryCurve.svelte | Svelte | 497 | 0 | 88 | 585 |
| e:\Workspace\JE-Skin\src\lib\config\color-map.ts | TypeScript | 55 | 0 | 3 | 58 |
| e:\Workspace\JE-Skin\src\lib\styles\theme.css | PostCSS | 43 | 1 | 7 | 51 |
| e:\Workspace\JE-Skin\src\lib\types\hud.ts | TypeScript | 126 | 0 | 20 | 146 |
| e:\Workspace\JE-Skin\src\routes\+layout.svelte | Svelte | 13 | 0 | 5 | 18 |
| e:\Workspace\JE-Skin\src\routes\+layout.ts | TypeScript | 1 | 4 | 1 | 6 |
| e:\Workspace\JE-Skin\src\routes\+page.svelte | Svelte | 1,286 | 0 | 176 | 1,462 |
| e:\Workspace\JE-Skin\static\svelte.svg | XML | 1 | 0 | 0 | 1 |
| e:\Workspace\JE-Skin\static\tauri.svg | XML | 6 | 0 | 1 | 7 |
| e:\Workspace\JE-Skin\static\vite.svg | XML | 1 | 0 | 0 | 1 |
| e:\Workspace\JE-Skin\svelte.config.js | JavaScript | 11 | 5 | 3 | 19 |
| e:\Workspace\JE-Skin\tauri-event.md | Markdown | 374 | 0 | 181 | 555 |
| e:\Workspace\JE-Skin\tsconfig.json | JSON with Comments | 14 | 5 | 1 | 20 |
| e:\Workspace\JE-Skin\vite.config.js | JavaScript | 22 | 7 | 4 | 33 |
| Total | | 8,908 | 94 | 1,250 | 10,252 |
+---------------------------------------------------------------------------+--------------------+------------+------------+------------+------------+

View File

@@ -0,0 +1,62 @@
# Details
Date : 2026-04-02 14:42:07
Directory e:\\Workspace\\JE-Skin
Total : 47 files, 9155 codes, 95 comments, 1279 blanks, all 10529 lines
[Summary](results.md) / Details / [Diff Summary](diff.md) / [Diff Details](diff-details.md)
## Files
| filename | language | code | comment | blank | total |
| :--- | :--- | ---: | ---: | ---: | ---: |
| [.idea/modules.xml](/.idea/modules.xml) | XML | 8 | 0 | 0 | 8 |
| [.idea/tauri-demo.iml](/.idea/tauri-demo.iml) | XML | 11 | 0 | 0 | 11 |
| [README.md](/README.md) | Markdown | 34 | 0 | 20 | 54 |
| [flowus\_tools.json](/flowus_tools.json) | JSON | 1 | 0 | 1 | 2 |
| [frontend\_prompt.md](/frontend_prompt.md) | Markdown | 189 | 0 | 66 | 255 |
| [package-lock.json](/package-lock.json) | JSON | 1,957 | 0 | 1 | 1,958 |
| [package.json](/package.json) | JSON | 31 | 0 | 1 | 32 |
| [src-tauri/build.rs](/src-tauri/build.rs) | Rust | 3 | 0 | 1 | 4 |
| [src-tauri/capabilities/default.json](/src-tauri/capabilities/default.json) | JSON | 15 | 0 | 1 | 16 |
| [src-tauri/src/commands/mod.rs](/src-tauri/src/commands/mod.rs) | Rust | 2 | 0 | 1 | 3 |
| [src-tauri/src/commands/serial.rs](/src-tauri/src/commands/serial.rs) | Rust | 246 | 0 | 44 | 290 |
| [src-tauri/src/commands/window.rs](/src-tauri/src/commands/window.rs) | Rust | 27 | 0 | 6 | 33 |
| [src-tauri/src/lib.rs](/src-tauri/src/lib.rs) | Rust | 22 | 0 | 2 | 24 |
| [src-tauri/src/log.rs](/src-tauri/src/log.rs) | Rust | 34 | 0 | 2 | 36 |
| [src-tauri/src/main.rs](/src-tauri/src/main.rs) | Rust | 8 | 1 | 2 | 11 |
| [src-tauri/src/serial\_core/codec.rs](/src-tauri/src/serial_core/codec.rs) | Rust | 6 | 0 | 1 | 7 |
| [src-tauri/src/serial\_core/codecs/mod.rs](/src-tauri/src/serial_core/codecs/mod.rs) | Rust | 4 | 0 | 1 | 5 |
| [src-tauri/src/serial\_core/codecs/tactile\_a.rs](/src-tauri/src/serial_core/codecs/tactile_a.rs) | Rust | 220 | 0 | 28 | 248 |
| [src-tauri/src/serial\_core/codecs/test.rs](/src-tauri/src/serial_core/codecs/test.rs) | Rust | 215 | 8 | 38 | 261 |
| [src-tauri/src/serial\_core/error.rs](/src-tauri/src/serial_core/error.rs) | Rust | 49 | 0 | 6 | 55 |
| [src-tauri/src/serial\_core/frame.rs](/src-tauri/src/serial_core/frame.rs) | Rust | 47 | 3 | 8 | 58 |
| [src-tauri/src/serial\_core/mod.rs](/src-tauri/src/serial_core/mod.rs) | Rust | 22 | 0 | 7 | 29 |
| [src-tauri/src/serial\_core/model.rs](/src-tauri/src/serial_core/model.rs) | Rust | 377 | 57 | 67 | 501 |
| [src-tauri/src/serial\_core/record.rs](/src-tauri/src/serial_core/record.rs) | Rust | 50 | 4 | 11 | 65 |
| [src-tauri/src/serial\_core/serial.rs](/src-tauri/src/serial_core/serial.rs) | Rust | 141 | 0 | 22 | 163 |
| [src-tauri/src/serial\_core/utils.rs](/src-tauri/src/serial_core/utils.rs) | Rust | 47 | 0 | 13 | 60 |
| [src-tauri/tauri.conf.json](/src-tauri/tauri.conf.json) | JSON | 36 | 0 | 1 | 37 |
| [src/app.html](/src/app.html) | HTML | 13 | 0 | 1 | 14 |
| [src/lib/components/CenterStage.svelte](/src/lib/components/CenterStage.svelte) | Svelte | 691 | 0 | 96 | 787 |
| [src/lib/components/ConfigPanel.svelte](/src/lib/components/ConfigPanel.svelte) | Svelte | 398 | 0 | 63 | 461 |
| [src/lib/components/HudPanel.svelte](/src/lib/components/HudPanel.svelte) | Svelte | 861 | 0 | 110 | 971 |
| [src/lib/components/PressureMatrixViewer.svelte](/src/lib/components/PressureMatrixViewer.svelte) | Svelte | 558 | 0 | 97 | 655 |
| [src/lib/components/SignalChart.svelte](/src/lib/components/SignalChart.svelte) | Svelte | 382 | 0 | 71 | 453 |
| [src/lib/components/SummaryCurve.svelte](/src/lib/components/SummaryCurve.svelte) | Svelte | 497 | 0 | 88 | 585 |
| [src/lib/config/color-map.ts](/src/lib/config/color-map.ts) | TypeScript | 55 | 0 | 3 | 58 |
| [src/lib/styles/theme.css](/src/lib/styles/theme.css) | PostCSS | 43 | 1 | 7 | 51 |
| [src/lib/types/hud.ts](/src/lib/types/hud.ts) | TypeScript | 126 | 0 | 20 | 146 |
| [src/routes/+layout.svelte](/src/routes/+layout.svelte) | Svelte | 13 | 0 | 5 | 18 |
| [src/routes/+layout.ts](/src/routes/+layout.ts) | TypeScript | 1 | 4 | 1 | 6 |
| [src/routes/+page.svelte](/src/routes/+page.svelte) | Svelte | 1,286 | 0 | 176 | 1,462 |
| [static/svelte.svg](/static/svelte.svg) | XML | 1 | 0 | 0 | 1 |
| [static/tauri.svg](/static/tauri.svg) | XML | 6 | 0 | 1 | 7 |
| [static/vite.svg](/static/vite.svg) | XML | 1 | 0 | 0 | 1 |
| [svelte.config.js](/svelte.config.js) | JavaScript | 11 | 5 | 3 | 19 |
| [tauri-event.md](/tauri-event.md) | Markdown | 374 | 0 | 181 | 555 |
| [tsconfig.json](/tsconfig.json) | JSON with Comments | 14 | 5 | 1 | 20 |
| [vite.config.js](/vite.config.js) | JavaScript | 22 | 7 | 4 | 33 |
[Summary](results.md) / Details / [Diff Summary](diff.md) / [Diff Details](diff-details.md)

View File

@@ -0,0 +1,21 @@
# Diff Details
Date : 2026-04-02 14:42:07
Directory e:\\Workspace\\JE-Skin
Total : 6 files, 247 codes, 1 comments, 29 blanks, all 277 lines
[Summary](results.md) / [Details](details.md) / [Diff Summary](diff.md) / Diff Details
## Files
| filename | language | code | comment | blank | total |
| :--- | :--- | ---: | ---: | ---: | ---: |
| [src-tauri/src/serial\_core/codecs/tactile\_a.rs](/src-tauri/src/serial_core/codecs/tactile_a.rs) | Rust | 153 | 0 | 11 | 164 |
| [src-tauri/src/serial\_core/codecs/test.rs](/src-tauri/src/serial_core/codecs/test.rs) | Rust | 2 | 1 | -2 | 1 |
| [src-tauri/src/serial\_core/error.rs](/src-tauri/src/serial_core/error.rs) | Rust | 2 | 0 | 0 | 2 |
| [src-tauri/src/serial\_core/frame.rs](/src-tauri/src/serial_core/frame.rs) | Rust | 1 | 0 | -1 | 0 |
| [src-tauri/src/serial\_core/serial.rs](/src-tauri/src/serial_core/serial.rs) | Rust | 68 | 0 | 14 | 82 |
| [src-tauri/src/serial\_core/utils.rs](/src-tauri/src/serial_core/utils.rs) | Rust | 21 | 0 | 7 | 28 |
[Summary](results.md) / [Details](details.md) / [Diff Summary](diff.md) / Diff Details

View File

@@ -0,0 +1,8 @@
"filename", "language", "Rust", "comment", "blank", "total"
"e:\Workspace\JE-Skin\src-tauri\src\serial_core\codecs\tactile_a.rs", "Rust", 153, 0, 11, 164
"e:\Workspace\JE-Skin\src-tauri\src\serial_core\codecs\test.rs", "Rust", 2, 1, -2, 1
"e:\Workspace\JE-Skin\src-tauri\src\serial_core\error.rs", "Rust", 2, 0, 0, 2
"e:\Workspace\JE-Skin\src-tauri\src\serial_core\frame.rs", "Rust", 1, 0, -1, 0
"e:\Workspace\JE-Skin\src-tauri\src\serial_core\serial.rs", "Rust", 68, 0, 14, 82
"e:\Workspace\JE-Skin\src-tauri\src\serial_core\utils.rs", "Rust", 21, 0, 7, 28
"Total", "-", 247, 1, 29, 277
1 filename language Rust comment blank total
2 e:\Workspace\JE-Skin\src-tauri\src\serial_core\codecs\tactile_a.rs Rust 153 0 11 164
3 e:\Workspace\JE-Skin\src-tauri\src\serial_core\codecs\test.rs Rust 2 1 -2 1
4 e:\Workspace\JE-Skin\src-tauri\src\serial_core\error.rs Rust 2 0 0 2
5 e:\Workspace\JE-Skin\src-tauri\src\serial_core\frame.rs Rust 1 0 -1 0
6 e:\Workspace\JE-Skin\src-tauri\src\serial_core\serial.rs Rust 68 0 14 82
7 e:\Workspace\JE-Skin\src-tauri\src\serial_core\utils.rs Rust 21 0 7 28
8 Total - 247 1 29 277

View File

@@ -0,0 +1,26 @@
# Diff Summary
Date : 2026-04-02 14:42:07
Directory e:\\Workspace\\JE-Skin
Total : 6 files, 247 codes, 1 comments, 29 blanks, all 277 lines
[Summary](results.md) / [Details](details.md) / Diff Summary / [Diff Details](diff-details.md)
## Languages
| language | files | code | comment | blank | total |
| :--- | ---: | ---: | ---: | ---: | ---: |
| Rust | 6 | 247 | 1 | 29 | 277 |
## Directories
| path | files | code | comment | blank | total |
| :--- | ---: | ---: | ---: | ---: | ---: |
| . | 6 | 247 | 1 | 29 | 277 |
| src-tauri | 6 | 247 | 1 | 29 | 277 |
| src-tauri\\src | 6 | 247 | 1 | 29 | 277 |
| src-tauri\\src\\serial_core | 6 | 247 | 1 | 29 | 277 |
| src-tauri\\src\\serial_core (Files) | 4 | 92 | 0 | 20 | 112 |
| src-tauri\\src\\serial_core\\codecs | 2 | 155 | 1 | 9 | 165 |
[Summary](results.md) / [Details](details.md) / Diff Summary / [Diff Details](diff-details.md)

View File

@@ -0,0 +1,35 @@
Date : 2026-04-02 14:42:07
Directory : e:\Workspace\JE-Skin
Total : 6 files, 247 codes, 1 comments, 29 blanks, all 277 lines
Languages
+----------+------------+------------+------------+------------+------------+
| language | files | code | comment | blank | total |
+----------+------------+------------+------------+------------+------------+
| Rust | 6 | 247 | 1 | 29 | 277 |
+----------+------------+------------+------------+------------+------------+
Directories
+--------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| path | files | code | comment | blank | total |
+--------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| . | 6 | 247 | 1 | 29 | 277 |
| src-tauri | 6 | 247 | 1 | 29 | 277 |
| src-tauri\src | 6 | 247 | 1 | 29 | 277 |
| src-tauri\src\serial_core | 6 | 247 | 1 | 29 | 277 |
| src-tauri\src\serial_core (Files) | 4 | 92 | 0 | 20 | 112 |
| src-tauri\src\serial_core\codecs | 2 | 155 | 1 | 9 | 165 |
+--------------------------------------------------------------------------+------------+------------+------------+------------+------------+
Files
+--------------------------------------------------------------------------+----------+------------+------------+------------+------------+
| filename | language | code | comment | blank | total |
+--------------------------------------------------------------------------+----------+------------+------------+------------+------------+
| e:\Workspace\JE-Skin\src-tauri\src\serial_core\codecs\tactile_a.rs | Rust | 153 | 0 | 11 | 164 |
| e:\Workspace\JE-Skin\src-tauri\src\serial_core\codecs\test.rs | Rust | 2 | 1 | -2 | 1 |
| e:\Workspace\JE-Skin\src-tauri\src\serial_core\error.rs | Rust | 2 | 0 | 0 | 2 |
| e:\Workspace\JE-Skin\src-tauri\src\serial_core\frame.rs | Rust | 1 | 0 | -1 | 0 |
| e:\Workspace\JE-Skin\src-tauri\src\serial_core\serial.rs | Rust | 68 | 0 | 14 | 82 |
| e:\Workspace\JE-Skin\src-tauri\src\serial_core\utils.rs | Rust | 21 | 0 | 7 | 28 |
| Total | | 247 | 1 | 29 | 277 |
+--------------------------------------------------------------------------+----------+------------+------------+------------+------------+

View File

@@ -0,0 +1,49 @@
"filename", "language", "Markdown", "JSON with Comments", "JSON", "XML", "JavaScript", "HTML", "Rust", "TypeScript", "Svelte", "PostCSS", "comment", "blank", "total"
"e:\Workspace\JE-Skin\.idea\modules.xml", "XML", 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 8
"e:\Workspace\JE-Skin\.idea\tauri-demo.iml", "XML", 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 11
"e:\Workspace\JE-Skin\README.md", "Markdown", 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 54
"e:\Workspace\JE-Skin\flowus_tools.json", "JSON", 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2
"e:\Workspace\JE-Skin\frontend_prompt.md", "Markdown", 189, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 255
"e:\Workspace\JE-Skin\package-lock.json", "JSON", 0, 0, 1957, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1958
"e:\Workspace\JE-Skin\package.json", "JSON", 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 1, 32
"e:\Workspace\JE-Skin\src-tauri\build.rs", "Rust", 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 1, 4
"e:\Workspace\JE-Skin\src-tauri\capabilities\default.json", "JSON", 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 1, 16
"e:\Workspace\JE-Skin\src-tauri\src\commands\mod.rs", "Rust", 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 3
"e:\Workspace\JE-Skin\src-tauri\src\commands\serial.rs", "Rust", 0, 0, 0, 0, 0, 0, 246, 0, 0, 0, 0, 44, 290
"e:\Workspace\JE-Skin\src-tauri\src\commands\window.rs", "Rust", 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 6, 33
"e:\Workspace\JE-Skin\src-tauri\src\lib.rs", "Rust", 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 2, 24
"e:\Workspace\JE-Skin\src-tauri\src\log.rs", "Rust", 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 2, 36
"e:\Workspace\JE-Skin\src-tauri\src\main.rs", "Rust", 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 1, 2, 11
"e:\Workspace\JE-Skin\src-tauri\src\serial_core\codec.rs", "Rust", 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 1, 7
"e:\Workspace\JE-Skin\src-tauri\src\serial_core\codecs\mod.rs", "Rust", 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 1, 5
"e:\Workspace\JE-Skin\src-tauri\src\serial_core\codecs\tactile_a.rs", "Rust", 0, 0, 0, 0, 0, 0, 220, 0, 0, 0, 0, 28, 248
"e:\Workspace\JE-Skin\src-tauri\src\serial_core\codecs\test.rs", "Rust", 0, 0, 0, 0, 0, 0, 215, 0, 0, 0, 8, 38, 261
"e:\Workspace\JE-Skin\src-tauri\src\serial_core\error.rs", "Rust", 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 6, 55
"e:\Workspace\JE-Skin\src-tauri\src\serial_core\frame.rs", "Rust", 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 3, 8, 58
"e:\Workspace\JE-Skin\src-tauri\src\serial_core\mod.rs", "Rust", 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 7, 29
"e:\Workspace\JE-Skin\src-tauri\src\serial_core\model.rs", "Rust", 0, 0, 0, 0, 0, 0, 377, 0, 0, 0, 57, 67, 501
"e:\Workspace\JE-Skin\src-tauri\src\serial_core\record.rs", "Rust", 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 4, 11, 65
"e:\Workspace\JE-Skin\src-tauri\src\serial_core\serial.rs", "Rust", 0, 0, 0, 0, 0, 0, 141, 0, 0, 0, 0, 22, 163
"e:\Workspace\JE-Skin\src-tauri\src\serial_core\utils.rs", "Rust", 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 13, 60
"e:\Workspace\JE-Skin\src-tauri\tauri.conf.json", "JSON", 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 1, 37
"e:\Workspace\JE-Skin\src\app.html", "HTML", 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 1, 14
"e:\Workspace\JE-Skin\src\lib\components\CenterStage.svelte", "Svelte", 0, 0, 0, 0, 0, 0, 0, 0, 691, 0, 0, 96, 787
"e:\Workspace\JE-Skin\src\lib\components\ConfigPanel.svelte", "Svelte", 0, 0, 0, 0, 0, 0, 0, 0, 398, 0, 0, 63, 461
"e:\Workspace\JE-Skin\src\lib\components\HudPanel.svelte", "Svelte", 0, 0, 0, 0, 0, 0, 0, 0, 861, 0, 0, 110, 971
"e:\Workspace\JE-Skin\src\lib\components\PressureMatrixViewer.svelte", "Svelte", 0, 0, 0, 0, 0, 0, 0, 0, 558, 0, 0, 97, 655
"e:\Workspace\JE-Skin\src\lib\components\SignalChart.svelte", "Svelte", 0, 0, 0, 0, 0, 0, 0, 0, 382, 0, 0, 71, 453
"e:\Workspace\JE-Skin\src\lib\components\SummaryCurve.svelte", "Svelte", 0, 0, 0, 0, 0, 0, 0, 0, 497, 0, 0, 88, 585
"e:\Workspace\JE-Skin\src\lib\config\color-map.ts", "TypeScript", 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 3, 58
"e:\Workspace\JE-Skin\src\lib\styles\theme.css", "PostCSS", 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 1, 7, 51
"e:\Workspace\JE-Skin\src\lib\types\hud.ts", "TypeScript", 0, 0, 0, 0, 0, 0, 0, 126, 0, 0, 0, 20, 146
"e:\Workspace\JE-Skin\src\routes\+layout.svelte", "Svelte", 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 5, 18
"e:\Workspace\JE-Skin\src\routes\+layout.ts", "TypeScript", 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 4, 1, 6
"e:\Workspace\JE-Skin\src\routes\+page.svelte", "Svelte", 0, 0, 0, 0, 0, 0, 0, 0, 1286, 0, 0, 176, 1462
"e:\Workspace\JE-Skin\static\svelte.svg", "XML", 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1
"e:\Workspace\JE-Skin\static\tauri.svg", "XML", 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 1, 7
"e:\Workspace\JE-Skin\static\vite.svg", "XML", 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1
"e:\Workspace\JE-Skin\svelte.config.js", "JavaScript", 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 5, 3, 19
"e:\Workspace\JE-Skin\tauri-event.md", "Markdown", 374, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 181, 555
"e:\Workspace\JE-Skin\tsconfig.json", "JSON with Comments", 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 5, 1, 20
"e:\Workspace\JE-Skin\vite.config.js", "JavaScript", 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 7, 4, 33
"Total", "-", 597, 14, 2040, 27, 33, 13, 1520, 182, 4686, 43, 95, 1279, 10529
1 filename language Markdown JSON with Comments JSON XML JavaScript HTML Rust TypeScript Svelte PostCSS comment blank total
2 e:\Workspace\JE-Skin\.idea\modules.xml XML 0 0 0 8 0 0 0 0 0 0 0 0 8
3 e:\Workspace\JE-Skin\.idea\tauri-demo.iml XML 0 0 0 11 0 0 0 0 0 0 0 0 11
4 e:\Workspace\JE-Skin\README.md Markdown 34 0 0 0 0 0 0 0 0 0 0 20 54
5 e:\Workspace\JE-Skin\flowus_tools.json JSON 0 0 1 0 0 0 0 0 0 0 0 1 2
6 e:\Workspace\JE-Skin\frontend_prompt.md Markdown 189 0 0 0 0 0 0 0 0 0 0 66 255
7 e:\Workspace\JE-Skin\package-lock.json JSON 0 0 1957 0 0 0 0 0 0 0 0 1 1958
8 e:\Workspace\JE-Skin\package.json JSON 0 0 31 0 0 0 0 0 0 0 0 1 32
9 e:\Workspace\JE-Skin\src-tauri\build.rs Rust 0 0 0 0 0 0 3 0 0 0 0 1 4
10 e:\Workspace\JE-Skin\src-tauri\capabilities\default.json JSON 0 0 15 0 0 0 0 0 0 0 0 1 16
11 e:\Workspace\JE-Skin\src-tauri\src\commands\mod.rs Rust 0 0 0 0 0 0 2 0 0 0 0 1 3
12 e:\Workspace\JE-Skin\src-tauri\src\commands\serial.rs Rust 0 0 0 0 0 0 246 0 0 0 0 44 290
13 e:\Workspace\JE-Skin\src-tauri\src\commands\window.rs Rust 0 0 0 0 0 0 27 0 0 0 0 6 33
14 e:\Workspace\JE-Skin\src-tauri\src\lib.rs Rust 0 0 0 0 0 0 22 0 0 0 0 2 24
15 e:\Workspace\JE-Skin\src-tauri\src\log.rs Rust 0 0 0 0 0 0 34 0 0 0 0 2 36
16 e:\Workspace\JE-Skin\src-tauri\src\main.rs Rust 0 0 0 0 0 0 8 0 0 0 1 2 11
17 e:\Workspace\JE-Skin\src-tauri\src\serial_core\codec.rs Rust 0 0 0 0 0 0 6 0 0 0 0 1 7
18 e:\Workspace\JE-Skin\src-tauri\src\serial_core\codecs\mod.rs Rust 0 0 0 0 0 0 4 0 0 0 0 1 5
19 e:\Workspace\JE-Skin\src-tauri\src\serial_core\codecs\tactile_a.rs Rust 0 0 0 0 0 0 220 0 0 0 0 28 248
20 e:\Workspace\JE-Skin\src-tauri\src\serial_core\codecs\test.rs Rust 0 0 0 0 0 0 215 0 0 0 8 38 261
21 e:\Workspace\JE-Skin\src-tauri\src\serial_core\error.rs Rust 0 0 0 0 0 0 49 0 0 0 0 6 55
22 e:\Workspace\JE-Skin\src-tauri\src\serial_core\frame.rs Rust 0 0 0 0 0 0 47 0 0 0 3 8 58
23 e:\Workspace\JE-Skin\src-tauri\src\serial_core\mod.rs Rust 0 0 0 0 0 0 22 0 0 0 0 7 29
24 e:\Workspace\JE-Skin\src-tauri\src\serial_core\model.rs Rust 0 0 0 0 0 0 377 0 0 0 57 67 501
25 e:\Workspace\JE-Skin\src-tauri\src\serial_core\record.rs Rust 0 0 0 0 0 0 50 0 0 0 4 11 65
26 e:\Workspace\JE-Skin\src-tauri\src\serial_core\serial.rs Rust 0 0 0 0 0 0 141 0 0 0 0 22 163
27 e:\Workspace\JE-Skin\src-tauri\src\serial_core\utils.rs Rust 0 0 0 0 0 0 47 0 0 0 0 13 60
28 e:\Workspace\JE-Skin\src-tauri\tauri.conf.json JSON 0 0 36 0 0 0 0 0 0 0 0 1 37
29 e:\Workspace\JE-Skin\src\app.html HTML 0 0 0 0 0 13 0 0 0 0 0 1 14
30 e:\Workspace\JE-Skin\src\lib\components\CenterStage.svelte Svelte 0 0 0 0 0 0 0 0 691 0 0 96 787
31 e:\Workspace\JE-Skin\src\lib\components\ConfigPanel.svelte Svelte 0 0 0 0 0 0 0 0 398 0 0 63 461
32 e:\Workspace\JE-Skin\src\lib\components\HudPanel.svelte Svelte 0 0 0 0 0 0 0 0 861 0 0 110 971
33 e:\Workspace\JE-Skin\src\lib\components\PressureMatrixViewer.svelte Svelte 0 0 0 0 0 0 0 0 558 0 0 97 655
34 e:\Workspace\JE-Skin\src\lib\components\SignalChart.svelte Svelte 0 0 0 0 0 0 0 0 382 0 0 71 453
35 e:\Workspace\JE-Skin\src\lib\components\SummaryCurve.svelte Svelte 0 0 0 0 0 0 0 0 497 0 0 88 585
36 e:\Workspace\JE-Skin\src\lib\config\color-map.ts TypeScript 0 0 0 0 0 0 0 55 0 0 0 3 58
37 e:\Workspace\JE-Skin\src\lib\styles\theme.css PostCSS 0 0 0 0 0 0 0 0 0 43 1 7 51
38 e:\Workspace\JE-Skin\src\lib\types\hud.ts TypeScript 0 0 0 0 0 0 0 126 0 0 0 20 146
39 e:\Workspace\JE-Skin\src\routes\+layout.svelte Svelte 0 0 0 0 0 0 0 0 13 0 0 5 18
40 e:\Workspace\JE-Skin\src\routes\+layout.ts TypeScript 0 0 0 0 0 0 0 1 0 0 4 1 6
41 e:\Workspace\JE-Skin\src\routes\+page.svelte Svelte 0 0 0 0 0 0 0 0 1286 0 0 176 1462
42 e:\Workspace\JE-Skin\static\svelte.svg XML 0 0 0 1 0 0 0 0 0 0 0 0 1
43 e:\Workspace\JE-Skin\static\tauri.svg XML 0 0 0 6 0 0 0 0 0 0 0 1 7
44 e:\Workspace\JE-Skin\static\vite.svg XML 0 0 0 1 0 0 0 0 0 0 0 0 1
45 e:\Workspace\JE-Skin\svelte.config.js JavaScript 0 0 0 0 11 0 0 0 0 0 5 3 19
46 e:\Workspace\JE-Skin\tauri-event.md Markdown 374 0 0 0 0 0 0 0 0 0 0 181 555
47 e:\Workspace\JE-Skin\tsconfig.json JSON with Comments 0 14 0 0 0 0 0 0 0 0 5 1 20
48 e:\Workspace\JE-Skin\vite.config.js JavaScript 0 0 0 0 22 0 0 0 0 0 7 4 33
49 Total - 597 14 2040 27 33 13 1520 182 4686 43 95 1279 10529

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,50 @@
# Summary
Date : 2026-04-02 14:42:07
Directory e:\\Workspace\\JE-Skin
Total : 47 files, 9155 codes, 95 comments, 1279 blanks, all 10529 lines
Summary / [Details](details.md) / [Diff Summary](diff.md) / [Diff Details](diff-details.md)
## Languages
| language | files | code | comment | blank | total |
| :--- | ---: | ---: | ---: | ---: | ---: |
| Svelte | 8 | 4,686 | 0 | 706 | 5,392 |
| JSON | 5 | 2,040 | 0 | 5 | 2,045 |
| Rust | 18 | 1,520 | 73 | 260 | 1,853 |
| Markdown | 3 | 597 | 0 | 267 | 864 |
| TypeScript | 3 | 182 | 4 | 24 | 210 |
| PostCSS | 1 | 43 | 1 | 7 | 51 |
| JavaScript | 2 | 33 | 12 | 7 | 52 |
| XML | 5 | 27 | 0 | 1 | 28 |
| JSON with Comments | 1 | 14 | 5 | 1 | 20 |
| HTML | 1 | 13 | 0 | 1 | 14 |
## Directories
| path | files | code | comment | blank | total |
| :--- | ---: | ---: | ---: | ---: | ---: |
| . | 47 | 9,155 | 95 | 1,279 | 10,529 |
| . (Files) | 9 | 2,633 | 17 | 278 | 2,928 |
| .idea | 2 | 19 | 0 | 0 | 19 |
| src | 13 | 4,924 | 5 | 738 | 5,667 |
| src (Files) | 1 | 13 | 0 | 1 | 14 |
| src-tauri | 20 | 1,571 | 73 | 262 | 1,906 |
| src-tauri (Files) | 2 | 39 | 0 | 2 | 41 |
| src-tauri\\capabilities | 1 | 15 | 0 | 1 | 16 |
| src-tauri\\src | 17 | 1,517 | 73 | 259 | 1,849 |
| src-tauri\\src (Files) | 3 | 64 | 1 | 6 | 71 |
| src-tauri\\src\\commands | 3 | 275 | 0 | 51 | 326 |
| src-tauri\\src\\serial_core | 11 | 1,178 | 72 | 202 | 1,452 |
| src-tauri\\src\\serial_core (Files) | 8 | 739 | 64 | 135 | 938 |
| src-tauri\\src\\serial_core\\codecs | 3 | 439 | 8 | 67 | 514 |
| src\\lib | 9 | 3,611 | 1 | 555 | 4,167 |
| src\\lib\\components | 6 | 3,387 | 0 | 525 | 3,912 |
| src\\lib\\config | 1 | 55 | 0 | 3 | 58 |
| src\\lib\\styles | 1 | 43 | 1 | 7 | 51 |
| src\\lib\\types | 1 | 126 | 0 | 20 | 146 |
| src\\routes | 3 | 1,300 | 4 | 182 | 1,486 |
| static | 3 | 8 | 0 | 1 | 9 |
Summary / [Details](details.md) / [Diff Summary](diff.md) / [Diff Details](diff-details.md)

View File

@@ -0,0 +1,100 @@
Date : 2026-04-02 14:42:07
Directory : e:\Workspace\JE-Skin
Total : 47 files, 9155 codes, 95 comments, 1279 blanks, all 10529 lines
Languages
+--------------------+------------+------------+------------+------------+------------+
| language | files | code | comment | blank | total |
+--------------------+------------+------------+------------+------------+------------+
| Svelte | 8 | 4,686 | 0 | 706 | 5,392 |
| JSON | 5 | 2,040 | 0 | 5 | 2,045 |
| Rust | 18 | 1,520 | 73 | 260 | 1,853 |
| Markdown | 3 | 597 | 0 | 267 | 864 |
| TypeScript | 3 | 182 | 4 | 24 | 210 |
| PostCSS | 1 | 43 | 1 | 7 | 51 |
| JavaScript | 2 | 33 | 12 | 7 | 52 |
| XML | 5 | 27 | 0 | 1 | 28 |
| JSON with Comments | 1 | 14 | 5 | 1 | 20 |
| HTML | 1 | 13 | 0 | 1 | 14 |
+--------------------+------------+------------+------------+------------+------------+
Directories
+---------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| path | files | code | comment | blank | total |
+---------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| . | 47 | 9,155 | 95 | 1,279 | 10,529 |
| . (Files) | 9 | 2,633 | 17 | 278 | 2,928 |
| .idea | 2 | 19 | 0 | 0 | 19 |
| src | 13 | 4,924 | 5 | 738 | 5,667 |
| src (Files) | 1 | 13 | 0 | 1 | 14 |
| src-tauri | 20 | 1,571 | 73 | 262 | 1,906 |
| src-tauri (Files) | 2 | 39 | 0 | 2 | 41 |
| src-tauri\capabilities | 1 | 15 | 0 | 1 | 16 |
| src-tauri\src | 17 | 1,517 | 73 | 259 | 1,849 |
| src-tauri\src (Files) | 3 | 64 | 1 | 6 | 71 |
| src-tauri\src\commands | 3 | 275 | 0 | 51 | 326 |
| src-tauri\src\serial_core | 11 | 1,178 | 72 | 202 | 1,452 |
| src-tauri\src\serial_core (Files) | 8 | 739 | 64 | 135 | 938 |
| src-tauri\src\serial_core\codecs | 3 | 439 | 8 | 67 | 514 |
| src\lib | 9 | 3,611 | 1 | 555 | 4,167 |
| src\lib\components | 6 | 3,387 | 0 | 525 | 3,912 |
| src\lib\config | 1 | 55 | 0 | 3 | 58 |
| src\lib\styles | 1 | 43 | 1 | 7 | 51 |
| src\lib\types | 1 | 126 | 0 | 20 | 146 |
| src\routes | 3 | 1,300 | 4 | 182 | 1,486 |
| static | 3 | 8 | 0 | 1 | 9 |
+---------------------------------------------------------------------------+------------+------------+------------+------------+------------+
Files
+---------------------------------------------------------------------------+--------------------+------------+------------+------------+------------+
| filename | language | code | comment | blank | total |
+---------------------------------------------------------------------------+--------------------+------------+------------+------------+------------+
| e:\Workspace\JE-Skin\.idea\modules.xml | XML | 8 | 0 | 0 | 8 |
| e:\Workspace\JE-Skin\.idea\tauri-demo.iml | XML | 11 | 0 | 0 | 11 |
| e:\Workspace\JE-Skin\README.md | Markdown | 34 | 0 | 20 | 54 |
| e:\Workspace\JE-Skin\flowus_tools.json | JSON | 1 | 0 | 1 | 2 |
| e:\Workspace\JE-Skin\frontend_prompt.md | Markdown | 189 | 0 | 66 | 255 |
| e:\Workspace\JE-Skin\package-lock.json | JSON | 1,957 | 0 | 1 | 1,958 |
| e:\Workspace\JE-Skin\package.json | JSON | 31 | 0 | 1 | 32 |
| e:\Workspace\JE-Skin\src-tauri\build.rs | Rust | 3 | 0 | 1 | 4 |
| e:\Workspace\JE-Skin\src-tauri\capabilities\default.json | JSON | 15 | 0 | 1 | 16 |
| e:\Workspace\JE-Skin\src-tauri\src\commands\mod.rs | Rust | 2 | 0 | 1 | 3 |
| e:\Workspace\JE-Skin\src-tauri\src\commands\serial.rs | Rust | 246 | 0 | 44 | 290 |
| e:\Workspace\JE-Skin\src-tauri\src\commands\window.rs | Rust | 27 | 0 | 6 | 33 |
| e:\Workspace\JE-Skin\src-tauri\src\lib.rs | Rust | 22 | 0 | 2 | 24 |
| e:\Workspace\JE-Skin\src-tauri\src\log.rs | Rust | 34 | 0 | 2 | 36 |
| e:\Workspace\JE-Skin\src-tauri\src\main.rs | Rust | 8 | 1 | 2 | 11 |
| e:\Workspace\JE-Skin\src-tauri\src\serial_core\codec.rs | Rust | 6 | 0 | 1 | 7 |
| e:\Workspace\JE-Skin\src-tauri\src\serial_core\codecs\mod.rs | Rust | 4 | 0 | 1 | 5 |
| e:\Workspace\JE-Skin\src-tauri\src\serial_core\codecs\tactile_a.rs | Rust | 220 | 0 | 28 | 248 |
| e:\Workspace\JE-Skin\src-tauri\src\serial_core\codecs\test.rs | Rust | 215 | 8 | 38 | 261 |
| e:\Workspace\JE-Skin\src-tauri\src\serial_core\error.rs | Rust | 49 | 0 | 6 | 55 |
| e:\Workspace\JE-Skin\src-tauri\src\serial_core\frame.rs | Rust | 47 | 3 | 8 | 58 |
| e:\Workspace\JE-Skin\src-tauri\src\serial_core\mod.rs | Rust | 22 | 0 | 7 | 29 |
| e:\Workspace\JE-Skin\src-tauri\src\serial_core\model.rs | Rust | 377 | 57 | 67 | 501 |
| e:\Workspace\JE-Skin\src-tauri\src\serial_core\record.rs | Rust | 50 | 4 | 11 | 65 |
| e:\Workspace\JE-Skin\src-tauri\src\serial_core\serial.rs | Rust | 141 | 0 | 22 | 163 |
| e:\Workspace\JE-Skin\src-tauri\src\serial_core\utils.rs | Rust | 47 | 0 | 13 | 60 |
| e:\Workspace\JE-Skin\src-tauri\tauri.conf.json | JSON | 36 | 0 | 1 | 37 |
| e:\Workspace\JE-Skin\src\app.html | HTML | 13 | 0 | 1 | 14 |
| e:\Workspace\JE-Skin\src\lib\components\CenterStage.svelte | Svelte | 691 | 0 | 96 | 787 |
| e:\Workspace\JE-Skin\src\lib\components\ConfigPanel.svelte | Svelte | 398 | 0 | 63 | 461 |
| e:\Workspace\JE-Skin\src\lib\components\HudPanel.svelte | Svelte | 861 | 0 | 110 | 971 |
| e:\Workspace\JE-Skin\src\lib\components\PressureMatrixViewer.svelte | Svelte | 558 | 0 | 97 | 655 |
| e:\Workspace\JE-Skin\src\lib\components\SignalChart.svelte | Svelte | 382 | 0 | 71 | 453 |
| e:\Workspace\JE-Skin\src\lib\components\SummaryCurve.svelte | Svelte | 497 | 0 | 88 | 585 |
| e:\Workspace\JE-Skin\src\lib\config\color-map.ts | TypeScript | 55 | 0 | 3 | 58 |
| e:\Workspace\JE-Skin\src\lib\styles\theme.css | PostCSS | 43 | 1 | 7 | 51 |
| e:\Workspace\JE-Skin\src\lib\types\hud.ts | TypeScript | 126 | 0 | 20 | 146 |
| e:\Workspace\JE-Skin\src\routes\+layout.svelte | Svelte | 13 | 0 | 5 | 18 |
| e:\Workspace\JE-Skin\src\routes\+layout.ts | TypeScript | 1 | 4 | 1 | 6 |
| e:\Workspace\JE-Skin\src\routes\+page.svelte | Svelte | 1,286 | 0 | 176 | 1,462 |
| e:\Workspace\JE-Skin\static\svelte.svg | XML | 1 | 0 | 0 | 1 |
| e:\Workspace\JE-Skin\static\tauri.svg | XML | 6 | 0 | 1 | 7 |
| e:\Workspace\JE-Skin\static\vite.svg | XML | 1 | 0 | 0 | 1 |
| e:\Workspace\JE-Skin\svelte.config.js | JavaScript | 11 | 5 | 3 | 19 |
| e:\Workspace\JE-Skin\tauri-event.md | Markdown | 374 | 0 | 181 | 555 |
| e:\Workspace\JE-Skin\tsconfig.json | JSON with Comments | 14 | 5 | 1 | 20 |
| e:\Workspace\JE-Skin\vite.config.js | JavaScript | 22 | 7 | 4 | 33 |
| Total | | 9,155 | 95 | 1,279 | 10,529 |
+---------------------------------------------------------------------------+--------------------+------------+------------+------------+------------+

4
package-lock.json generated
View File

@@ -1,11 +1,11 @@
{ {
"name": "tauri-demo", "name": "JE-Skin",
"version": "0.1.0", "version": "0.1.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "tauri-demo", "name": "JE-Skin",
"version": "0.1.0", "version": "0.1.0",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {

View File

@@ -1,5 +1,5 @@
{ {
"name": "tauri-demo", "name": "JE-Skin",
"version": "0.1.0", "version": "0.1.0",
"description": "", "description": "",
"type": "module", "type": "module",

58
src-tauri/Cargo.lock generated
View File

@@ -2,6 +2,28 @@
# It is not intended for manual editing. # It is not intended for manual editing.
version = 4 version = 4
[[package]]
name = "JE-Skin"
version = "0.1.0"
dependencies = [
"anyhow",
"async-trait",
"chrono",
"crc",
"csv",
"fern",
"humantime",
"log",
"serde",
"serde_json",
"tauri",
"tauri-build",
"tauri-plugin-opener",
"tokio",
"tokio-serial",
"tokio-util",
]
[[package]] [[package]]
name = "adler2" name = "adler2"
version = "2.0.1" version = "2.0.1"
@@ -558,6 +580,21 @@ dependencies = [
"libc", "libc",
] ]
[[package]]
name = "crc"
version = "3.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5eb8a2a1cd12ab0d987a5d5e825195d372001a4094a0376319d5a0ad71c1ba0d"
dependencies = [
"crc-catalog",
]
[[package]]
name = "crc-catalog"
version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5"
[[package]] [[package]]
name = "crc32fast" name = "crc32fast"
version = "1.5.0" version = "1.5.0"
@@ -3847,27 +3884,6 @@ dependencies = [
"walkdir", "walkdir",
] ]
[[package]]
name = "tauri-demo"
version = "0.1.0"
dependencies = [
"anyhow",
"async-trait",
"chrono",
"csv",
"fern",
"humantime",
"log",
"serde",
"serde_json",
"tauri",
"tauri-build",
"tauri-plugin-opener",
"tokio",
"tokio-serial",
"tokio-util",
]
[[package]] [[package]]
name = "tauri-macros" name = "tauri-macros"
version = "2.5.5" version = "2.5.5"

View File

@@ -1,5 +1,5 @@
[package] [package]
name = "tauri-demo" name = "JE-Skin"
version = "0.1.0" version = "0.1.0"
description = "A Tauri App" description = "A Tauri App"
authors = ["you"] authors = ["you"]
@@ -32,3 +32,4 @@ log = "0.4.29"
humantime = "2.3.0" humantime = "2.3.0"
csv = "1.4.0" csv = "1.4.0"
chrono = "0.4.44" chrono = "0.4.44"
crc = "3.4.0"

View File

@@ -0,0 +1,208 @@
use serde::Serialize;
use std::collections::HashSet;
use std::fs;
use std::path::{Path, PathBuf};
use std::time::UNIX_EPOCH;
use tauri::{AppHandle, Manager};
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub struct FileExplorerRoot {
pub label: String,
pub path: String,
}
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub struct FileExplorerEntry {
pub name: String,
pub path: String,
pub is_dir: bool,
pub size_bytes: Option<u64>,
pub modified_ms: Option<u128>,
}
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub struct FileExplorerListResponse {
pub current_path: String,
pub parent_path: Option<String>,
pub roots: Vec<FileExplorerRoot>,
pub entries: Vec<FileExplorerEntry>,
}
#[tauri::command]
pub fn file_explorer_list(
app: AppHandle,
path: Option<String>,
extensions: Option<Vec<String>>,
) -> Result<FileExplorerListResponse, String> {
let current_path = resolve_start_path(&app, path)?;
let extension_filter = normalize_extensions(extensions);
let mut entries = fs::read_dir(&current_path)
.map_err(|err| format!("Failed to read '{}': {err}", current_path.display()))?
.filter_map(Result::ok)
.filter_map(|entry| {
let file_type = entry.file_type().ok()?;
let metadata = entry.metadata().ok();
let is_dir = file_type.is_dir();
let path = entry.path();
if !is_dir && !extension_filter.is_empty() {
let extension = path
.extension()
.and_then(|ext| ext.to_str())
.map(|ext| ext.to_ascii_lowercase())
.unwrap_or_default();
if !extension_filter.contains(&extension) {
return None;
}
}
let name = entry.file_name().to_string_lossy().to_string();
let size_bytes = if is_dir {
None
} else {
metadata.as_ref().map(|value| value.len())
};
let modified_ms = metadata
.as_ref()
.and_then(|value| value.modified().ok())
.and_then(|value| value.duration_since(UNIX_EPOCH).ok())
.map(|value| value.as_millis());
Some(FileExplorerEntry {
name,
path: path.display().to_string(),
is_dir,
size_bytes,
modified_ms,
})
})
.collect::<Vec<_>>();
entries.sort_by(|left, right| {
if left.is_dir != right.is_dir {
return right.is_dir.cmp(&left.is_dir);
}
left.name
.to_ascii_lowercase()
.cmp(&right.name.to_ascii_lowercase())
});
Ok(FileExplorerListResponse {
current_path: current_path.display().to_string(),
parent_path: current_path.parent().map(|parent| parent.display().to_string()),
roots: collect_roots(&app),
entries,
})
}
fn normalize_extensions(extensions: Option<Vec<String>>) -> HashSet<String> {
extensions
.unwrap_or_default()
.into_iter()
.map(|value| value.trim().trim_start_matches('.').to_ascii_lowercase())
.filter(|value| !value.is_empty())
.collect()
}
fn resolve_start_path(app: &AppHandle, raw_path: Option<String>) -> Result<PathBuf, String> {
if let Some(value) = raw_path {
let trimmed = value.trim();
if trimmed.is_empty() {
return resolve_default_path(app);
}
let mut candidate = PathBuf::from(trimmed);
if candidate.is_relative() {
candidate = std::env::current_dir()
.map_err(|err| format!("Failed to read current dir: {err}"))?
.join(candidate);
}
if !candidate.exists() {
return Err(format!("Path does not exist: {}", candidate.display()));
}
if candidate.is_file() {
return candidate
.parent()
.map(|parent| parent.to_path_buf())
.ok_or_else(|| format!("No parent directory for {}", candidate.display()));
}
return Ok(candidate);
}
resolve_default_path(app)
}
fn resolve_default_path(app: &AppHandle) -> Result<PathBuf, String> {
if let Ok(path) = app.path().desktop_dir() {
return Ok(path);
}
if let Ok(path) = app.path().document_dir() {
return Ok(path);
}
if let Ok(path) = app.path().download_dir() {
return Ok(path);
}
if let Ok(path) = app.path().home_dir() {
return Ok(path);
}
std::env::current_dir().map_err(|err| format!("Failed to resolve default path: {err}"))
}
fn collect_roots(app: &AppHandle) -> Vec<FileExplorerRoot> {
let mut roots = Vec::new();
let mut seen = HashSet::new();
let mut push_root = |label: &str, path: PathBuf| {
let normalized = path.display().to_string();
if normalized.is_empty() || !Path::new(&normalized).exists() {
return;
}
if seen.insert(normalized.clone()) {
roots.push(FileExplorerRoot {
label: label.to_string(),
path: normalized,
});
}
};
if let Ok(path) = app.path().desktop_dir() {
push_root("Desktop", path);
}
if let Ok(path) = app.path().document_dir() {
push_root("Documents", path);
}
if let Ok(path) = app.path().download_dir() {
push_root("Downloads", path);
}
if let Ok(path) = app.path().home_dir() {
push_root("Home", path);
}
#[cfg(target_os = "windows")]
{
for letter in b'A'..=b'Z' {
let drive = format!("{}:\\", letter as char);
let drive_path = PathBuf::from(&drive);
if drive_path.exists() {
push_root(&format!("{}:", letter as char), drive_path);
}
}
}
#[cfg(not(target_os = "windows"))]
{
push_root("Root", PathBuf::from("/"));
}
roots
}

View File

@@ -1,2 +1,3 @@
pub mod file_explorer;
pub mod serial; pub mod serial;
pub mod window; pub mod window;

View File

@@ -1,18 +1,27 @@
use crate::serial_core::codecs::test::{export_recording_csv, TestCodec, TestCsvImporter, TestHandler}; use crate::serial_core::codecs::tactile_a::{
export_recording_csv, TactileACodec, TactileACsvImporter, TactileAHandler,
};
use crate::serial_core::error::SerialError; use crate::serial_core::error::SerialError;
use crate::serial_core::record::CsvImporter; use crate::serial_core::record::CsvImporter;
use crate::serial_core::{TestRecording, serial}; use crate::serial_core::serial::{PollMode, TactileAPollRequester};
use crate::serial_core::{serial, TactileARecording};
use log::info; use log::info;
use serde::Serialize; use serde::Serialize;
use std::fs::File; use std::fs::File;
use std::io::Cursor; use std::io::Cursor;
use std::path::{Path, PathBuf};
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
use std::time::{Instant, SystemTime, UNIX_EPOCH}; use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH};
use tauri::{async_runtime::JoinHandle, AppHandle, Manager, State}; use tauri::{async_runtime::JoinHandle, AppHandle, Manager, State};
use tokio_serial::{available_ports, SerialPortBuilderExt}; use tokio_serial::{available_ports, SerialPortBuilderExt};
use tokio_util::sync::CancellationToken; use tokio_util::sync::CancellationToken;
type SharedTestRecording = Arc<Mutex<TestRecording>>; const DEFAULT_TACTILE_COLS: usize = 7;
const DEFAULT_TACTILE_ROWS: usize = 12;
const DEFAULT_TACTILE_POLL_INTERVAL_MS: u64 = 10;
const DEFAULT_TACTILE_REPLY_TIMEOUT_MS: u64 = 140;
type SharedTactileRecording = Arc<Mutex<TactileARecording>>;
#[derive(Serialize)] #[derive(Serialize)]
@@ -48,17 +57,24 @@ pub struct SerialImportResponse {
pub message: String, pub message: String,
} }
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SerialRecordStateResponse {
pub has_data: bool,
pub frame_count: usize,
}
struct SerialSession { struct SerialSession {
port: String, port: String,
cancel: CancellationToken, cancel: CancellationToken,
task: JoinHandle<()>, task: JoinHandle<()>,
current_record: SharedTestRecording, current_record: SharedTactileRecording,
} }
#[derive(Default)] #[derive(Default)]
pub struct SerialConnectionState { pub struct SerialConnectionState {
session: Mutex<Option<SerialSession>>, session: Mutex<Option<SerialSession>>,
last_record: Mutex<Option<SharedTestRecording>> last_record: Mutex<Option<SharedTactileRecording>>
} }
#[tauri::command] #[tauri::command]
@@ -91,22 +107,28 @@ pub async fn serial_connect(
} }
let cancel = CancellationToken::new(); let cancel = CancellationToken::new();
let current_record = Arc::new(Mutex::new(TestRecording::new())); let current_record = Arc::new(Mutex::new(TactileARecording::new()));
let task_record = current_record.clone(); let task_record = current_record.clone();
let task_cancel = cancel.clone(); let task_cancel = cancel.clone();
let task_app = app.clone(); let task_app = app.clone();
let task_port_name = port_name.clone(); let task_port_name = port_name.clone();
let port = tokio_serial::new(&port_name, 115200) let port = tokio_serial::new(&port_name, 921600)
.open_native_async() .open_native_async()
.map_err(|_| SerialError::OpenError)?; .map_err(|_| SerialError::OpenError)?;
let session_started_at = Instant::now(); let session_started_at = Instant::now();
let task = tauri::async_runtime::spawn(async move { let task = tauri::async_runtime::spawn(async move {
let codec = TestCodec::new(); let codec = TactileACodec::new(DEFAULT_TACTILE_COLS, DEFAULT_TACTILE_ROWS);
let handler = TestHandler; let handler = TactileAHandler;
let poll_mode = PollMode::Enabled(Box::new(TactileAPollRequester::new(
Duration::from_millis(DEFAULT_TACTILE_POLL_INTERVAL_MS),
DEFAULT_TACTILE_COLS,
DEFAULT_TACTILE_ROWS,
Duration::from_millis(DEFAULT_TACTILE_REPLY_TIMEOUT_MS),
)));
if let Err(error) = serial::run_serial( if let Err(error) = serial::run_serial_with_poll(
task_app.clone(), task_app.clone(),
port, port,
codec, codec,
@@ -114,6 +136,7 @@ pub async fn serial_connect(
session_started_at, session_started_at,
task_record.clone(), task_record.clone(),
task_cancel, task_cancel,
poll_mode,
) )
.await .await
{ {
@@ -211,20 +234,6 @@ pub fn serial_export_csv(
app: AppHandle, app: AppHandle,
state: State<'_, SerialConnectionState>, state: State<'_, SerialConnectionState>,
) -> Result<SerialExportResponse, SerialError> { ) -> Result<SerialExportResponse, SerialError> {
let current_record = {
let session = state.session.lock().map_err(|_| SerialError::StateError)?;
session
.as_ref()
.map(|current_session| current_session.current_record.clone())
};
let record = if let Some(recording) = current_record {
recording
} else {
let last_record = state.last_record.lock().map_err(|_| SerialError::StateError)?;
last_record.clone().ok_or(SerialError::NoRecordedData)?
};
let mut output_dir = match app.path().desktop_dir() { let mut output_dir = match app.path().desktop_dir() {
Ok(path) => path, Ok(path) => path,
Err(_) => std::env::current_dir().map_err(|_| SerialError::ExportError)?, Err(_) => std::env::current_dir().map_err(|_| SerialError::ExportError)?,
@@ -236,17 +245,8 @@ pub fn serial_export_csv(
.unwrap_or_default(); .unwrap_or_default();
output_dir.push(format!("joyson_export_{timestamp}.csv")); output_dir.push(format!("joyson_export_{timestamp}.csv"));
let mut file = File::create(&output_dir).map_err(|_| SerialError::ExportError)?; let record = resolve_record_for_export(&state)?;
let frame_count = write_record_to_csv(record, &output_dir)?;
let frame_count = {
let recording = record.lock().map_err(|_| SerialError::StateError)?;
if recording.frames.is_empty() {
return Err(SerialError::NoRecordedData);
}
export_recording_csv(&recording, &mut file).map_err(|_| SerialError::ExportError)?;
recording.frames.len()
};
let path = output_dir.display().to_string(); let path = output_dir.display().to_string();
info!("csv exported to {path}, frame_count={frame_count}"); info!("csv exported to {path}, frame_count={frame_count}");
@@ -258,9 +258,40 @@ pub fn serial_export_csv(
}) })
} }
#[tauri::command]
pub fn serial_has_record_data(
state: State<'_, SerialConnectionState>,
) -> Result<SerialRecordStateResponse, SerialError> {
let frame_count = snapshot_record_frame_count(&state)?;
Ok(SerialRecordStateResponse {
has_data: frame_count > 0,
frame_count,
})
}
#[tauri::command]
pub fn serial_export_csv_to_path(
file_path: String,
state: State<'_, SerialConnectionState>,
) -> Result<SerialExportResponse, SerialError> {
let output_path = resolve_export_path(file_path)?;
let record = resolve_record_for_export(&state)?;
let frame_count = write_record_to_csv(record, &output_path)?;
let path = output_path.display().to_string();
info!("csv exported to {path}, frame_count={frame_count}");
Ok(SerialExportResponse {
path,
frame_count,
message: "exported".to_string(),
})
}
#[tauri::command] #[tauri::command]
pub fn serial_import_csv(file_name: String, csv_content: String) -> Result<SerialImportResponse, SerialError> { pub fn serial_import_csv(file_name: String, csv_content: String) -> Result<SerialImportResponse, SerialError> {
let mut importer = TestCsvImporter::new(file_name.as_str()); let mut importer = TactileACsvImporter::new(file_name.as_str());
let packets = importer let packets = importer
.load(Cursor::new(csv_content.into_bytes())) .load(Cursor::new(csv_content.into_bytes()))
.map_err(|_| SerialError::ImportError)?; .map_err(|_| SerialError::ImportError)?;
@@ -287,3 +318,128 @@ pub fn serial_import_csv(file_name: String, csv_content: String) -> Result<Seria
message: "imported".to_string(), message: "imported".to_string(),
}) })
} }
#[tauri::command]
pub fn serial_import_csv_from_path(file_path: String) -> Result<SerialImportResponse, SerialError> {
let path = resolve_import_path(file_path)?;
let file_name = path
.file_name()
.and_then(|value| value.to_str())
.map(ToOwned::to_owned)
.unwrap_or_else(|| "import.csv".to_string());
let bytes = std::fs::read(&path).map_err(|_| SerialError::ImportError)?;
let csv_content = String::from_utf8_lossy(&bytes).to_string();
serial_import_csv(file_name, csv_content)
}
fn resolve_record_for_export(
state: &State<'_, SerialConnectionState>,
) -> Result<SharedTactileRecording, SerialError> {
let current_record = {
let session = state.session.lock().map_err(|_| SerialError::StateError)?;
session
.as_ref()
.map(|current_session| current_session.current_record.clone())
};
if let Some(recording) = current_record {
return Ok(recording);
}
let last_record = state.last_record.lock().map_err(|_| SerialError::StateError)?;
last_record.clone().ok_or(SerialError::NoRecordedData)
}
fn snapshot_record_frame_count(
state: &State<'_, SerialConnectionState>,
) -> Result<usize, SerialError> {
let current_record = {
let session = state.session.lock().map_err(|_| SerialError::StateError)?;
session
.as_ref()
.map(|current_session| current_session.current_record.clone())
};
if let Some(record) = current_record {
return record
.lock()
.map(|recording| recording.frames.len())
.map_err(|_| SerialError::StateError);
}
let last_record = state.last_record.lock().map_err(|_| SerialError::StateError)?;
let Some(record) = last_record.as_ref() else {
return Ok(0);
};
record
.lock()
.map(|recording| recording.frames.len())
.map_err(|_| SerialError::StateError)
}
fn write_record_to_csv(
record: SharedTactileRecording,
output_path: &Path,
) -> Result<usize, SerialError> {
if let Some(parent) = output_path.parent() {
if !parent.exists() {
return Err(SerialError::ExportError);
}
}
let mut file = File::create(output_path).map_err(|_| SerialError::ExportError)?;
let frame_count = {
let recording = record.lock().map_err(|_| SerialError::StateError)?;
if recording.frames.is_empty() {
return Err(SerialError::NoRecordedData);
}
export_recording_csv(&recording, &mut file).map_err(|_| SerialError::ExportError)?;
recording.frames.len()
};
Ok(frame_count)
}
fn resolve_export_path(raw_path: String) -> Result<PathBuf, SerialError> {
let trimmed = raw_path.trim();
if trimmed.is_empty() {
return Err(SerialError::ExportError);
}
let mut path = resolve_absolute_path(trimmed).map_err(|_| SerialError::ExportError)?;
if path.extension().is_none() {
path.set_extension("csv");
}
if path.file_name().is_none() {
return Err(SerialError::ExportError);
}
Ok(path)
}
fn resolve_import_path(raw_path: String) -> Result<PathBuf, SerialError> {
let trimmed = raw_path.trim();
if trimmed.is_empty() {
return Err(SerialError::ImportError);
}
let path = resolve_absolute_path(trimmed).map_err(|_| SerialError::ImportError)?;
if !path.exists() || !path.is_file() {
return Err(SerialError::ImportError);
}
Ok(path)
}
fn resolve_absolute_path(raw_path: &str) -> std::io::Result<PathBuf> {
let path = PathBuf::from(raw_path);
if path.is_absolute() {
Ok(path)
} else {
Ok(std::env::current_dir()?.join(path))
}
}

View File

@@ -9,11 +9,15 @@ pub fn run() {
.manage(SerialConnectionState::default()) .manage(SerialConnectionState::default())
.plugin(tauri_plugin_opener::init()) .plugin(tauri_plugin_opener::init())
.invoke_handler(tauri::generate_handler![ .invoke_handler(tauri::generate_handler![
commands::file_explorer::file_explorer_list,
commands::serial::serial_enum, commands::serial::serial_enum,
commands::serial::serial_connect, commands::serial::serial_connect,
commands::serial::serial_disconnect, commands::serial::serial_disconnect,
commands::serial::serial_export_csv, commands::serial::serial_export_csv,
commands::serial::serial_has_record_data,
commands::serial::serial_export_csv_to_path,
commands::serial::serial_import_csv, commands::serial::serial_import_csv,
commands::serial::serial_import_csv_from_path,
commands::window::win_minimize, commands::window::win_minimize,
commands::window::win_toggle_maximize, commands::window::win_toggle_maximize,
commands::window::win_close commands::window::win_close

View File

@@ -1,5 +1,5 @@
use fern::colors::{Color, ColoredLevelConfig}; use fern::{Dispatch, colors::{Color, ColoredLevelConfig}};
use log::{debug, error, info, trace, warn}; use log::{debug};
use std::time::SystemTime; use std::time::SystemTime;
pub fn setup_logger() { pub fn setup_logger() {
let colors_line = ColoredLevelConfig::new() let colors_line = ColoredLevelConfig::new()
@@ -10,7 +10,13 @@ pub fn setup_logger() {
.trace(Color::BrightBlack); .trace(Color::BrightBlack);
let colors_level = colors_line.info(Color::Green); let colors_level = colors_line.info(Color::Green);
fern::Dispatch::new() let level = if cfg!(debug_assertions) {
log::LevelFilter::Debug
} else {
log::LevelFilter::Info
};
let console_config = fern::Dispatch::new()
.format(move |out, message, record| { .format(move |out, message, record| {
out.finish( out.finish(
format_args!( format_args!(
@@ -26,9 +32,31 @@ pub fn setup_logger() {
) )
); );
}) })
.level(log::LevelFilter::Info) .level(level)
.chain(std::io::stdout()) .chain(std::io::stdout());
.chain(fern::DateBased::new("program.log", "%Y-%m-%d")) // .chain(fern::DateBased::new("program.log", "%Y-%m-%d"))
// .apply()
// .unwrap();
let file_config = fern::Dispatch::new()
.format(move |out, message, record| {
out.finish(
format_args!(
"[{data} {level} {target}] {message}",
data = humantime::format_rfc3339_seconds(SystemTime::now()),
target = record.target(),
level = colors_level.color(record.level()),
message = message,
)
);
})
.level(level)
.chain(fern::DateBased::new("program.log", "%Y-%m-%d"));
Dispatch::new()
.level(log::LevelFilter::Debug)
.chain(console_config)
.chain(file_config)
.apply() .apply()
.unwrap(); .unwrap();

View File

@@ -1,4 +1,5 @@
use crate::serial_core::{frame::TestFrame, record::Recording}; use crate::serial_core::{frame::TestFrame, record::Recording};
pub mod test; pub mod test;
pub mod tactile_a;
pub type TestRecording = Recording<TestFrame>; pub type TestRecording = Recording<TestFrame>;

View File

@@ -0,0 +1,375 @@
use crate::serial_core::error::CodecError;
use crate::serial_core::frame::{
FrameHandler, TactileAFrameMetaData, TactileARepFrame, TactileAReqFrame,
};
use crate::serial_core::record::{write_csv, CsvExporter, CsvImporter, RecordedFrame, Recording};
use crate::serial_core::utils::{calc_crc8_itu, elapsed_millis};
use crate::serial_core::{
codec::Codec,
frame::{TactileAFrame, TactileAFrameStatusCode},
};
use async_trait::async_trait;
use csv::StringRecord;
use anyhow::anyhow;
use std::io::Read;
use log::debug;
const FRAME_BUFFER_MIN_LENGTH: usize = 15;
pub struct TactileACodec {
buffer: Vec<u8>,
frame_nb: u64,
expected_data_len: usize,
}
pub struct TactileACsvExporter {
channels: usize,
}
pub struct TactileACsvImporter {
channels: usize,
data_row: usize,
packets: Vec<TactileADataPacket>,
}
pub struct TactileAHandler;
#[derive(Clone)]
pub struct TactileADataPacket {
pub data: Vec<i32>,
pub dts_ms: u64,
}
impl From<u8> for TactileAFrameStatusCode {
fn from(value: u8) -> Self {
match value {
0 => TactileAFrameStatusCode::Success,
_ => TactileAFrameStatusCode::Failure,
}
}
}
impl TryFrom<&TactileARepFrame> for TactileADataPacket {
type Error = CodecError;
fn try_from(value: &TactileARepFrame) -> Result<TactileADataPacket, Self::Error> {
let data = TactileACodec::parse_data_frame(&value.payload)?;
let dts_ms = value.dts_ms;
Ok(TactileADataPacket {
data: data,
dts_ms: dts_ms,
})
}
}
impl TactileACodec {
pub fn new(cols: usize, rows: usize) -> TactileACodec {
Self {
buffer: Vec::new(),
frame_nb: 0,
expected_data_len: cols * rows * 2,
}
}
pub fn parse_data_frame(data: &[u8]) -> Result<Vec<i32>, CodecError> {
if data.len() % 2 != 0 {
return Err(CodecError::InvalidLength);
}
let vals: Vec<i32> = data
.chunks_exact(2)
.map(|chunk| u16::from_le_bytes([chunk[0], chunk[1]]) as i32)
.collect::<Vec<i32>>();
Ok(vals)
}
pub fn build_req_frame(cols: usize, rows: usize) -> anyhow::Result<TactileAFrame> {
let header = [0x55, 0xAA];
let payload_len: usize = 9;
let device_addr: u8 = 0x34;
let extend_code: u8 = 0x00;
let func_code: u8 = 0xFB;
let start_addr: u32 = 7168;
let except_data_len: usize = cols * rows * 2;
let checksum: u8 = 0;
Ok(TactileAFrame::Req(TactileAReqFrame {
meta: TactileAFrameMetaData {
header,
payload_len,
device_addr,
extend_code,
func_code,
start_addr,
except_data_len,
checksum,
},
}))
}
}
impl Codec<TactileAFrame> for TactileACodec {
fn decode(
&mut self,
input: &[u8],
session_started_at: std::time::Instant,
) -> Result<Vec<TactileAFrame>, CodecError> {
self.buffer.extend_from_slice(input);
let mut frames: Vec<TactileAFrame> = Vec::new();
loop {
if self.buffer.len() < FRAME_BUFFER_MIN_LENGTH {
break;
}
let header_pos = self.buffer.windows(2).position(|w| w == [0xAA, 0x55]);
let Some(pos) = header_pos else {
self.buffer.clear();
break;
};
if pos > 0 {
self.buffer.drain(0..pos);
}
if self.buffer.len() < FRAME_BUFFER_MIN_LENGTH {
break;
}
let header = [self.buffer[0], self.buffer[1]];
let payload_len = u16::from_le_bytes([self.buffer[2], self.buffer[3]]) as usize;
let device_addr = self.buffer[4];
let extend_code = self.buffer[5];
let func_code = self.buffer[6];
let start_addr = u32::from_le_bytes([
self.buffer[7],
self.buffer[8],
self.buffer[9],
self.buffer[10],
]);
let except_data_len = u16::from_le_bytes([self.buffer[11], self.buffer[12]]) as usize;
let status = TactileAFrameStatusCode::from(self.buffer[13]);
if except_data_len != self.expected_data_len {
debug!(
"unexpected payload length: expected {}, got {}, buffer_len={}",
self.expected_data_len,
except_data_len,
self.buffer.len()
);
self.buffer.drain(0..1);
continue;
}
let frame_length = except_data_len + FRAME_BUFFER_MIN_LENGTH;
if self.buffer.len() < frame_length {
break;
}
let need_check_data = self.buffer[0..14 + except_data_len].to_vec();
let payload = self.buffer[14..14 + except_data_len].to_vec();
let crc8_itu_alg = crc::Crc::<u8>::new(&crc::CRC_8_I_432_1);
let checksum = crc8_itu_alg.checksum(&need_check_data.as_slice());
if self.buffer[frame_length - 1] != checksum {
debug!(
"checksum mismatch: expected {:02X}, got {:02X}, frame_len={}",
checksum,
self.buffer[frame_length - 1],
frame_length
);
self.buffer.drain(0..1);
continue;
}
let dts_ms = elapsed_millis(session_started_at);
let meta: TactileAFrameMetaData = TactileAFrameMetaData {
header,
payload_len,
device_addr,
extend_code,
func_code,
start_addr,
except_data_len,
checksum,
};
frames.push(TactileAFrame::Rep({
TactileARepFrame {
meta,
status,
payload,
dts_ms,
}
}));
self.buffer.drain(0..frame_length);
}
Ok(frames)
}
fn encode(
&self,
frame: &TactileAFrame,
) -> Result<Vec<u8>, crate::serial_core::error::CodecError> {
match frame {
TactileAFrame::Req(f) => {
let mut req_bytes: Vec<u8> = Vec::new();
req_bytes.extend_from_slice(f.meta.header.as_slice());
req_bytes.extend_from_slice((f.meta.payload_len as u16).to_le_bytes().as_slice());
req_bytes.push(f.meta.device_addr);
req_bytes.push(f.meta.extend_code);
req_bytes.push(f.meta.func_code);
req_bytes.extend_from_slice(f.meta.start_addr.to_le_bytes().as_slice());
req_bytes.extend_from_slice((f.meta.except_data_len as u16).to_le_bytes().as_slice());
let checksum = calc_crc8_itu(req_bytes.as_slice());
req_bytes.push(checksum);
Ok(req_bytes)
}
_ => {
Err(CodecError::InvalidFrameType)
}
}
}
}
#[async_trait]
impl FrameHandler<TactileAFrame, i32> for TactileAHandler {
async fn on_frame(&mut self, frame: &TactileAFrame) -> anyhow::Result<Option<Vec<i32>>> {
match frame {
TactileAFrame::Rep(rep) => {
let vals = TactileACodec::parse_data_frame(&rep.payload)?;
debug!("vals is {:?}", vals);
Ok(Some(vals))
}
_ => Ok(None),
}
}
}
impl TactileACsvExporter {
fn new(channels: usize) -> Self {
TactileACsvExporter { channels }
}
}
impl CsvExporter<TactileARepFrame> for TactileACsvExporter {
type Error = CodecError;
fn csv_header(&self, recording: &Recording<TactileARepFrame>) -> Vec<String> {
let mut header: Vec<String> = Vec::new();
for i in 0..self.channels {
header.push(format!("channel{}", i + 1));
}
header.push("dts".to_string());
header
}
fn csv_row(
&self,
item: &RecordedFrame<TactileARepFrame>,
) -> anyhow::Result<Vec<String>> {
let packet = TactileADataPacket::try_from(&item.frame)?;
let mut row: Vec<String> = packet.data.iter().map(|x| x.to_string()).collect();
row.push(packet.dts_ms.to_string());
Ok(row)
}
}
impl CsvExporter<TactileAFrame> for TactileACsvExporter {
type Error = CodecError;
fn csv_header(&self, _recording: &Recording<TactileAFrame>) -> Vec<String> {
let mut header: Vec<String> = Vec::new();
for i in 0..self.channels {
header.push(format!("channel{}", i + 1));
}
header.push("dts".to_string());
header
}
fn csv_row(
&self,
item: &RecordedFrame<TactileAFrame>,
) -> anyhow::Result<Vec<String>> {
let rep = match &item.frame {
TactileAFrame::Rep(rep) => rep,
TactileAFrame::Req(_) => return Err(anyhow!("request frame cannot be exported to csv row")),
};
let packet = TactileADataPacket::try_from(rep)?;
let mut row: Vec<String> = packet.data.iter().map(|x| x.to_string()).collect();
row.push(packet.dts_ms.to_string());
Ok(row)
}
}
impl TactileACsvImporter {
pub fn new(_path: &str) -> TactileACsvImporter {
Self {
channels: 0,
data_row: 0,
packets: Vec::new(),
}
}
fn parse_record(&mut self, record: StringRecord) -> anyhow::Result<TactileADataPacket> {
if self.channels == 0 {
return Err(anyhow!("csv header is missing channel columns"));
}
if record.len() < self.channels + 1 {
return Err(anyhow!("csv row has insufficient columns"));
}
let mut data = Vec::with_capacity(self.channels);
for index in 0..self.channels {
let cell = record.get(index).ok_or_else(|| anyhow!("missing channel cell"))?;
data.push(cell.parse::<i32>()?);
}
let dts_cell = record
.get(self.channels)
.ok_or_else(|| anyhow!("missing dts cell"))?;
let dts_ms = dts_cell.parse::<u64>()?;
Ok(TactileADataPacket {
data: data,
dts_ms: dts_ms,
})
}
}
impl CsvImporter<TactileADataPacket> for TactileACsvImporter {
fn load<R: Read>(&mut self, reader: R) -> anyhow::Result<Vec<TactileADataPacket>> {
let mut rdr = csv::Reader::from_reader(reader);
let headers = rdr.headers()?.clone();
self.channels = headers.len().saturating_sub(1);
self.data_row = 0;
self.packets.clear();
for record in rdr.records() {
let record = record?;
let packet = self.parse_record(record)?;
self.packets.push(packet);
self.data_row += 1;
}
Ok(self.packets.clone())
}
}
pub fn export_recording_csv<W>(recording: &Recording<TactileAFrame>, writer: W) -> anyhow::Result<()>
where
W: std::io::Write,
{
let channel_nb = recording
.frames
.iter()
.find_map(|frame| match &frame.frame {
TactileAFrame::Rep(rep) => Some(rep.payload.len() / 2),
TactileAFrame::Req(_) => None,
})
.unwrap_or(0);
let exporter = TactileACsvExporter::new(channel_nb);
write_csv(recording, &exporter, writer)
}

View File

@@ -1,13 +1,15 @@
use std::io::Read; use std::io::Read;
use std::time::Instant; use std::time::Instant;
use crate::serial_core::frame::{crc8, usize_to_u16_be_bytes, FrameHandler}; use crate::serial_core::frame::{FrameHandler};
use crate::serial_core::{codec::Codec, error::CodecError, frame::TestFrame}; use crate::serial_core::{codec::Codec, error::CodecError, frame::TestFrame};
use anyhow::anyhow; use anyhow::anyhow;
use async_trait::async_trait; use async_trait::async_trait;
use chrono::Local;
use csv::StringRecord; use csv::StringRecord;
use crate::serial_core::record::{write_csv, CsvExporter, CsvImporter, RecordedFrame, Recording}; use crate::serial_core::record::{write_csv, CsvExporter, CsvImporter, RecordedFrame, Recording};
use crate::serial_core::utils::{
elapsed_millis,
usize_to_u16_be_bytes
};
pub struct TestCodec { pub struct TestCodec {
buffer: Vec<u8>, buffer: Vec<u8>,
} }
@@ -52,7 +54,9 @@ impl Codec<TestFrame> for TestCodec {
break; break;
} }
let payload = self.buffer[5..5 + length].to_vec(); let payload = self.buffer[5..5 + length].to_vec();
let checksum = crc8(payload.as_slice()); // let checksum = crc8(payload.as_slice());
let crc8_alg = crc::Crc::<u8>::new(&crc::CRC_8_SMBUS);
let checksum = crc8_alg.checksum(payload.as_slice());
if self.buffer[frame_length - 1] != checksum { if self.buffer[frame_length - 1] != checksum {
self.buffer.drain(0..1); self.buffer.drain(0..1);
continue; continue;
@@ -112,10 +116,6 @@ fn parse_data_frame(data: &[u8]) -> Result<Vec<i32>, CodecError> {
Ok(vals) Ok(vals)
} }
fn elapsed_millis(start_at: Instant) -> u64 {
start_at.elapsed().as_millis() as u64
}
pub struct TestCsvExporter; pub struct TestCsvExporter;
pub struct TestCsvImporter { pub struct TestCsvImporter {
channels: usize, channels: usize,
@@ -231,9 +231,7 @@ pub fn export_recording_csv<W>(recording: &Recording<TestFrame>, writer: W) -> a
where where
W: std::io::Write, W: std::io::Write,
{ {
let now = Local::now(); write_csv(recording, &TestCsvExporter, writer)
let filename = format!("joyson_{}", now.format("%Y%m%d_%H%M%S"));
write_csv(recording, &TestCsvExporter, &filename)
} }
#[cfg(test)] #[cfg(test)]

View File

@@ -35,6 +35,7 @@ pub enum CodecError {
InvalidHeader, InvalidHeader,
InvalidTail, InvalidTail,
InvalidLength, InvalidLength,
InvalidFrameType,
PayloadTooLarge, PayloadTooLarge,
} }
@@ -44,6 +45,7 @@ impl fmt::Display for CodecError {
CodecError::InvalidHeader => write!(f, "Invalid Header"), CodecError::InvalidHeader => write!(f, "Invalid Header"),
CodecError::InvalidTail => write!(f, "Invalid Tail"), CodecError::InvalidTail => write!(f, "Invalid Tail"),
CodecError::InvalidLength => write!(f, "Invalid Length"), CodecError::InvalidLength => write!(f, "Invalid Length"),
CodecError::InvalidFrameType => write!(f, "Invalid Frame Type"),
CodecError::PayloadTooLarge => write!(f, "Payload too large"), CodecError::PayloadTooLarge => write!(f, "Payload too large"),
} }
} }

View File

@@ -10,34 +10,48 @@ pub struct TestFrame {
pub dts_ms: u64 pub dts_ms: u64
} }
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct TactileAFrameMetaData {
pub header: [u8; 2],
pub payload_len: usize,
pub device_addr: u8,
pub extend_code: u8,
pub func_code: u8,
pub start_addr: u32,
pub except_data_len: usize,
// pub status: u8,
// pub payload_data: Vec<u8>,
pub checksum: u8,
// pub dts_ms: u64,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct TactileAReqFrame {
pub meta: TactileAFrameMetaData,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct TactileARepFrame {
pub meta: TactileAFrameMetaData,
pub status: TactileAFrameStatusCode,
pub payload: Vec<u8>,
pub dts_ms: u64
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum TactileAFrameStatusCode {
Success,
Failure
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum TactileAFrame {
Req(TactileAReqFrame),
Rep(TactileARepFrame)
}
#[async_trait] #[async_trait]
pub trait FrameHandler<F, T>: Send { pub trait FrameHandler<F, T>: Send {
async fn on_frame(&mut self, frame: &F) -> Result<Option<Vec<T>>>; async fn on_frame(&mut self, frame: &F) -> Result<Option<Vec<T>>>;
} }
pub fn usize_to_u16_be_bytes(n: usize) -> [u8; 2] {
(n as u16).to_be_bytes()
}
pub fn usize_to_u16_le_bytes(n: usize) -> [u8; 2] {
(n as u16).to_be_bytes()
}
pub fn crc8(data: &[u8]) -> u8 {
let mut crc: u8 = 0x00;
for &byte in data {
crc ^= byte;
for _ in 0..8 {
if (crc & 0x80) != 0 {
crc = (crc << 1) ^ 0x07;
} else {
crc <<= 1;
}
}
}
crc
}

View File

@@ -1,4 +1,7 @@
use crate::serial_core::{frame::TestFrame, record::Recording}; use crate::serial_core::{
frame::{TactileAFrame, TestFrame},
record::Recording,
};
pub mod codec; pub mod codec;
pub mod codecs; pub mod codecs;
@@ -7,8 +10,10 @@ pub mod frame;
pub mod model; pub mod model;
pub mod serial; pub mod serial;
pub mod record; pub mod record;
pub mod utils;
pub type TestRecording = Recording<TestFrame>; pub type TestRecording = Recording<TestFrame>;
pub type TactileARecording = Recording<TactileAFrame>;
pub struct SerialConnection { pub struct SerialConnection {
pub port: String, pub port: String,

View File

@@ -1,8 +1,3 @@
use std::fs::{write, File};
use std::io;
use anyhow::{Result, anyhow};
use csv::Reader;
#[derive(Clone)] #[derive(Clone)]
pub struct FrameTiming { pub struct FrameTiming {
pub pts_ms: Option<u64>, pub pts_ms: Option<u64>,
@@ -38,20 +33,17 @@ pub trait CsvImporter<P> {
fn load<R: std::io::Read>(&mut self, reader: R) -> anyhow::Result<Vec<P>>; fn load<R: std::io::Read>(&mut self, reader: R) -> anyhow::Result<Vec<P>>;
} }
pub fn write_csv<F, E>( pub fn write_csv<F, E, W>(
recording: &Recording<F>, recording: &Recording<F>,
exporter: &E, exporter: &E,
path: &str writer: W,
// mut writer: W,
) -> anyhow::Result<()> ) -> anyhow::Result<()>
where where
E: CsvExporter<F>, E: CsvExporter<F>,
// W: std::io::Write W: std::io::Write,
{ {
let header = exporter.csv_header(&recording); let header = exporter.csv_header(&recording);
// let mut wrt = csv::Writer::from_writer(io::stdout()); let mut wrt = csv::Writer::from_writer(writer);
let mut wrt = csv::Writer::from_path(format!("{}.csv", path))?;
wrt.write_record(header)?; wrt.write_record(header)?;
for f in &recording.frames { for f in &recording.frames {
let row = exporter.csv_row(f)?; let row = exporter.csv_row(f)?;

View File

@@ -1,40 +1,237 @@
use crate::serial_core::codec::Codec; use crate::serial_core::codec::Codec;
use crate::serial_core::frame::{FrameHandler, TestFrame}; use crate::serial_core::codecs::tactile_a::TactileACodec;
use crate::serial_core::model::HudChartState; use crate::serial_core::frame::{FrameHandler, TactileAFrame, TestFrame};
use crate::serial_core::model::{HudChartState, HudPacket};
use crate::serial_core::record::Recording;
use anyhow::Result; use anyhow::Result;
use tauri::{AppHandle, Emitter}; use tauri::{AppHandle, Emitter};
use tokio::io::AsyncReadExt; use tokio::io::{AsyncReadExt, AsyncWriteExt};
use tokio::time::{self, Duration, MissedTickBehavior}; use tokio::time::{self, Duration, MissedTickBehavior};
use tokio_serial::SerialStream; use tokio_serial::SerialStream;
use tokio_util::sync::CancellationToken; use tokio_util::sync::CancellationToken;
use std::future::pending;
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
use std::time::Instant; use std::time::Instant;
use log::info; use log::{info, debug};
use crate::serial_core::record::{FrameTiming, RecordedFrame}; use crate::serial_core::record::{FrameTiming, RecordedFrame};
use crate::serial_core::TestRecording;
pub async fn run_serial<C, H, T>( pub enum PollMode<F> {
Disable,
Enabled(Box<dyn PollRequester<F>>)
}
pub trait SerialFrame: Clone + Send + 'static {
fn dts_ms(&self) -> u64;
fn to_hud_packet(
&self,
chart_state: &mut HudChartState,
display_values: Option<&[i32]>,
) -> Option<HudPacket>;
}
impl SerialFrame for TestFrame {
fn dts_ms(&self) -> u64 {
self.dts_ms
}
fn to_hud_packet(
&self,
chart_state: &mut HudChartState,
display_values: Option<&[i32]>,
) -> Option<HudPacket> {
Some(chart_state.apply_frame(self, display_values))
}
}
impl SerialFrame for TactileAFrame {
fn dts_ms(&self) -> u64 {
match self {
TactileAFrame::Req(_) => 0,
TactileAFrame::Rep(rep) => rep.dts_ms,
}
}
fn to_hud_packet(
&self,
chart_state: &mut HudChartState,
display_values: Option<&[i32]>,
) -> Option<HudPacket> {
match self {
TactileAFrame::Req(_) => None,
TactileAFrame::Rep(rep) => {
let proxy = TestFrame {
header: rep.meta.header,
cmd: rep.meta.func_code,
length: rep.meta.except_data_len,
payload: rep.payload.clone(),
checksum: rep.meta.checksum,
dts_ms: rep.dts_ms,
};
Some(chart_state.apply_frame(&proxy, display_values))
}
}
}
}
pub trait PollRequester<F>: Send {
fn poll_interval(&self) -> Option<Duration> {
None
}
fn should_request(&mut self) -> bool {
true
}
fn next_request(&mut self) -> Result<Option<F>> {
Ok(None)
}
fn on_rx_frame(&mut self, _frame: &F) {}
}
#[derive(Default)]
pub struct NoopPollRequester;
impl<F> PollRequester<F> for NoopPollRequester {}
pub struct TactileAPollRequester {
period: Duration,
cols: usize,
rows: usize,
awaiting_reply: bool,
last_request_at: Option<Instant>,
reply_timeout: Duration,
}
impl TactileAPollRequester {
pub fn new(period: Duration, cols: usize, rows: usize, reply_timeout: Duration) -> Self {
Self {
period,
cols,
rows,
awaiting_reply: false,
last_request_at: None,
reply_timeout,
}
}
}
impl PollRequester<TactileAFrame> for TactileAPollRequester {
fn poll_interval(&self) -> Option<Duration> {
Some(self.period)
}
fn should_request(&mut self) -> bool {
if !self.awaiting_reply {
return true;
}
let timed_out = self
.last_request_at
.map(|t| t.elapsed() >= self.reply_timeout)
.unwrap_or(false);
if timed_out {
self.awaiting_reply = false;
self.last_request_at = None;
return true;
}
false
}
fn next_request(&mut self) -> Result<Option<TactileAFrame>> {
let req = TactileACodec::build_req_frame(self.cols, self.rows)?;
self.awaiting_reply = true;
self.last_request_at = Some(Instant::now());
Ok(Some(req))
}
fn on_rx_frame(&mut self, frame: &TactileAFrame) {
if matches!(frame, TactileAFrame::Rep(_)) {
self.awaiting_reply = false;
self.last_request_at = None
}
}
}
pub async fn run_serial<C, H, T, F>(
app: AppHandle, app: AppHandle,
mut port: SerialStream, mut port: SerialStream,
mut codec: C, mut codec: C,
mut handler: H, mut handler: H,
session_started_at: Instant, session_started_at: Instant,
recording: Arc<Mutex<TestRecording>>, recording: Arc<Mutex<Recording<F>>>,
cancel: CancellationToken, cancel: CancellationToken,
) -> Result<()> ) -> Result<()>
where where
C: Codec<TestFrame> + Send + 'static, F: SerialFrame,
H: FrameHandler<TestFrame, T> + Send + 'static, C: Codec<F> + Send + 'static,
H: FrameHandler<F, T> + Send + 'static,
T: Into<i32>
{
run_serial_with_poll(
app, port, codec, handler, session_started_at, recording, cancel, PollMode::Disable
).await
}
pub async fn run_serial_with_poll<C, H, T, F>(
app: AppHandle,
mut port: SerialStream,
mut codec: C,
mut handler: H,
session_started_at: Instant,
recording: Arc<Mutex<Recording<F>>>,
cancel: CancellationToken,
poll_mode: PollMode<F>
) -> Result<()>
where
F: SerialFrame,
C: Codec<F> + Send + 'static,
H: FrameHandler<F, T> + Send + 'static,
T: Into<i32>, T: Into<i32>,
{ {
let mut requester = match poll_mode {
PollMode::Disable => None,
PollMode::Enabled(r) => Some(r),
};
let mut poll_interval = requester
.as_ref()
.and_then(|r| r.poll_interval())
.map(|d| {
let mut it = time::interval(d);
it.set_missed_tick_behavior(MissedTickBehavior::Skip);
it
});
let mut chart_state = HudChartState::new(); let mut chart_state = HudChartState::new();
let mut buffer = [0u8; 1024]; let mut buffer = [0u8; 1024];
let mut prune_interval = time::interval(Duration::from_millis(450)); let mut prune_interval = time::interval(Duration::from_millis(450));
prune_interval.set_missed_tick_behavior(MissedTickBehavior::Delay); prune_interval.set_missed_tick_behavior(MissedTickBehavior::Delay);
loop { loop {
tokio::select! { tokio::select! {
_ = cancel.cancelled() => break, _ = cancel.cancelled() => break,
_ = async {
match poll_interval.as_mut() {
Some(it) => {
it.tick().await;
}
None => pending::<()>().await,
}
} => {
if let Some(r) = requester.as_mut() {
if r.should_request() {
if let Some(req) = r.next_request()? {
let bytes = codec.encode(&req)?;
port.write_all(&bytes).await?;
}
}
}
}
_ = prune_interval.tick() => { _ = prune_interval.tick() => {
if let Some(packet) = chart_state.prune_stale() { if let Some(packet) = chart_state.prune_stale() {
app.emit("hud_stream", packet)?; app.emit("hud_stream", packet)?;
@@ -43,11 +240,18 @@ where
read_result = port.read(&mut buffer) => { read_result = port.read(&mut buffer) => {
let n = read_result?; let n = read_result?;
if n == 0 { if n == 0 {
// Some serial drivers can resolve reads with 0 bytes repeatedly.
// Yield here so timer-driven poll requests are not starved by a busy loop.
tokio::task::yield_now().await;
continue; continue;
} }
let frames = codec.decode(&buffer[..n], session_started_at)?; let frames = codec.decode(&buffer[..n], session_started_at)?;
for frame in frames { for frame in frames {
if let Some(r) = requester.as_mut() {
r.on_rx_frame(&frame);
}
let decode_res = handler let decode_res = handler
.on_frame(&frame) .on_frame(&frame)
.await? .await?
@@ -55,13 +259,12 @@ where
let mut record = recording.lock().map_err(|_| anyhow::anyhow!("recording state poisoned"))?; let mut record = recording.lock().map_err(|_| anyhow::anyhow!("recording state poisoned"))?;
record.push(RecordedFrame{ record.push(RecordedFrame{
timing: FrameTiming { pts_ms: None, dts_ms: frame.dts_ms }, timing: FrameTiming { pts_ms: None, dts_ms: frame.dts_ms() },
frame: frame.clone(), frame: frame.clone(),
}); });
let display_values = if let Some(vals) = decode_res.as_ref() { let display_values = if let Some(vals) = decode_res.as_ref() {
let summary = vals.iter().copied().sum::<i32>(); let summary = vals.iter().copied().sum::<i32>();
info!("dot value summary: {}", summary);
chart_state.record_summary(summary as f32); chart_state.record_summary(summary as f32);
chart_state.record_pressure_matrix(vals.as_slice()); chart_state.record_pressure_matrix(vals.as_slice());
Some(vec![summary]) Some(vec![summary])
@@ -69,12 +272,12 @@ where
None None
}; };
let packet = chart_state.apply_frame(&frame, display_values.as_deref()); if let Some(packet) = frame.to_hud_packet(&mut chart_state, display_values.as_deref()) {
app.emit("hud_stream", packet)?; app.emit("hud_stream", packet)?;
} }
} }
} }
} }
}
Ok(()) Ok(())
} }

View File

@@ -0,0 +1,59 @@
use std::time::Instant;
pub fn usize_to_u16_be_bytes(n: usize) -> [u8; 2] {
(n as u16).to_be_bytes()
}
pub fn usize_to_u16_le_bytes(n: usize) -> [u8; 2] {
(n as u16).to_be_bytes()
}
pub fn u16_to_hex_be_bytes(n: u16) -> [u8; 2] {
(n as u16).to_be_bytes()
}
pub fn u16_to_hex_le_bytes(n: u16) -> [u8; 2] {
(n as u16).to_le_bytes()
}
pub fn calc_crc8_smbus(c: &[u8]) -> u8 {
let crc8_smbus = crc::Crc::<u8>::new(&crc::CRC_8_SMBUS);
let checksum = crc8_smbus.checksum(c);
return checksum;
}
pub fn calc_crc8_itu(c: &[u8]) -> u8 {
let crc8_itu_alg = crc::Crc::<u8>::new(&crc::CRC_8_I_432_1);
let checksum = crc8_itu_alg.checksum(c);
return checksum;
}
pub fn elapsed_millis(start_at: Instant) -> u64 {
start_at.elapsed().as_millis() as u64
}
#[cfg(test)]
mod test {
use anyhow::Ok;
use crate::serial_core::utils::{calc_crc8_itu, calc_crc8_smbus};
#[test]
fn test_crc8_itu() -> anyhow::Result<()> {
let req_vec = vec![0x55, 0xAA, 0x09, 0x00, 0x34, 0x00, 0xFB, 0x00, 0x1C, 0x00, 0x00, 0x18, 0x00];
let checksum = calc_crc8_itu(req_vec.as_slice());
assert_eq!(checksum, 0x7A);
Ok(())
}
#[test]
fn test_crc8_smbus() -> anyhow::Result<()> {
let req_vec = vec![0x55, 0xAA, 0x09, 0x00, 0x34, 0x00, 0xFB, 0x00, 0x1C, 0x00, 0x00, 0x18, 0x00];
let checksum = calc_crc8_smbus(req_vec.as_slice());
assert_eq!(checksum, 0x2F);
Ok(())
}
}

View File

@@ -0,0 +1,3 @@
Signature: 8a477f597d28d172789f06886806bc55
# This file is a cache directory tag created by cargo.
# For information about cache directory tags see https://bford.info/cachedir/

View File

@@ -1,6 +1,6 @@
{ {
"$schema": "https://schema.tauri.app/config/2", "$schema": "https://schema.tauri.app/config/2",
"productName": "tauri-demo", "productName": "JE-Skin",
"version": "0.1.0", "version": "0.1.0",
"identifier": "com.lenn.tauri-serial", "identifier": "com.lenn.tauri-serial",
"build": { "build": {
@@ -12,7 +12,7 @@
"app": { "app": {
"windows": [ "windows": [
{ {
"title": "joyson-serial", "title": "JE-Skin",
"width": 1366, "width": 1366,
"height": 860, "height": 860,
"decorations": false "decorations": false

View File

@@ -39,7 +39,7 @@
export let matrixRows = 12; export let matrixRows = 12;
export let matrixCols = 7; export let matrixCols = 7;
export let rangeMin = 0; export let rangeMin = 0;
export let rangeMax = 5000; export let rangeMax = 16000;
export let colorMapPreset: PressureColorMapPreset = "emerald"; export let colorMapPreset: PressureColorMapPreset = "emerald";
export let colorMapOptions: HudColorMapOption[] = []; export let colorMapOptions: HudColorMapOption[] = [];
export let replaySectionLabel = ""; export let replaySectionLabel = "";
@@ -193,7 +193,7 @@
</div> </div>
<div class="canvas-wrap"> <div class="canvas-wrap">
{#key `${matrixRows}x${matrixCols}`} {#key `${matrixRows}x${matrixCols}:${colorMapPreset}`}
<PressureMatrixViewer <PressureMatrixViewer
{pressureMatrix} {pressureMatrix}
{matrixRows} {matrixRows}
@@ -351,12 +351,17 @@
min-height: 0; min-height: 0;
overflow: hidden; overflow: hidden;
border-radius: 0.72rem; border-radius: 0.72rem;
border: 1px solid rgb(101 133 152 / 0.2); border: 1px solid rgb(var(--hud-border-rgb) / 0.2);
background: background:
linear-gradient(170deg, rgb(8 12 16 / 0.86) 0%, rgb(0 0 0 / 0.96) 58%, rgb(6 10 14 / 0.9) 100%), linear-gradient(
radial-gradient(circle at 50% 0, rgb(62 232 255 / 0.04), transparent 48%); 170deg,
rgb(var(--hud-surface-rgb) / 0.86) 0%,
rgb(var(--hud-surface-deep-rgb) / 0.96) 58%,
rgb(var(--hud-surface-alt-rgb) / 0.9) 100%
),
radial-gradient(circle at 50% 0, rgb(var(--hud-glow-rgb) / 0.04), transparent 48%);
box-shadow: box-shadow:
inset 0 1px 0 rgb(175 216 240 / 0.08), inset 0 1px 0 rgb(var(--hud-border-strong-rgb) / 0.08),
inset 0 -36px 72px rgb(0 0 0 / 0.4); inset 0 -36px 72px rgb(0 0 0 / 0.4);
} }
@@ -390,16 +395,16 @@
min-width: 0; min-width: 0;
max-inline-size: min(22rem, 62%); max-inline-size: min(22rem, 62%);
padding: 0.3rem 0.5rem 0.35rem; padding: 0.3rem 0.5rem 0.35rem;
border: 1px solid rgb(112 146 166 / 0.2); border: 1px solid rgb(var(--hud-border-rgb) / 0.2);
border-radius: 0.45rem; border-radius: 0.45rem;
background: rgb(2 8 12 / 0.45); background: rgb(var(--hud-surface-deep-rgb) / 0.45);
backdrop-filter: blur(2px); backdrop-filter: blur(2px);
} }
.meta-label { .meta-label {
margin: 0; margin: 0;
font-size: 0.56rem; font-size: 0.56rem;
color: rgb(148 171 189 / 0.8); color: rgb(var(--hud-text-dim-rgb) / 0.8);
text-transform: uppercase; text-transform: uppercase;
letter-spacing: 0.1em; letter-spacing: 0.1em;
} }
@@ -407,7 +412,7 @@
h2 { h2 {
margin: 0.08rem 0 0; margin: 0.08rem 0 0;
font-size: clamp(0.75rem, 1.1vw, 0.92rem); font-size: clamp(0.75rem, 1.1vw, 0.92rem);
color: rgb(222 241 255 / 0.96); color: rgb(var(--hud-text-main-rgb) / 0.96);
letter-spacing: 0.03em; letter-spacing: 0.03em;
font-weight: 500; font-weight: 500;
line-height: 1.2; line-height: 1.2;
@@ -416,30 +421,30 @@
.meta-hint { .meta-hint {
margin: 0.09rem 0 0; margin: 0.09rem 0 0;
font-size: 0.62rem; font-size: 0.62rem;
color: rgb(142 165 183 / 0.76); color: rgb(var(--hud-text-dim-rgb) / 0.76);
line-height: 1.15; line-height: 1.15;
} }
.runtime-status { .runtime-status {
margin: 0; margin: 0;
align-self: center; align-self: center;
border: 1px solid rgb(95 128 149 / 0.35); border: 1px solid rgb(var(--hud-border-rgb) / 0.35);
border-radius: 999px; border-radius: 999px;
padding: 0.3rem 0.66rem; padding: 0.3rem 0.66rem;
font-size: 0.66rem; font-size: 0.66rem;
letter-spacing: 0.08em; letter-spacing: 0.08em;
color: rgb(150 174 194 / 0.9); color: rgb(var(--hud-text-dim-rgb) / 0.9);
text-transform: uppercase; text-transform: uppercase;
white-space: nowrap; white-space: nowrap;
background: rgb(3 10 15 / 0.62); background: rgb(var(--hud-surface-deep-rgb) / 0.62);
} }
.runtime-status.is-ok { .runtime-status.is-ok {
color: rgb(204 248 184 / 0.94); color: rgb(var(--hud-lime-rgb) / 0.94);
} }
.runtime-status.is-warn { .runtime-status.is-warn {
color: rgb(255 205 188 / 0.92); color: rgb(var(--hud-orange-rgb) / 0.92);
} }
.canvas-wrap { .canvas-wrap {
@@ -533,15 +538,15 @@
pointer-events: auto; pointer-events: auto;
display: grid; display: grid;
gap: 0.52rem; gap: 0.52rem;
border: 1px solid rgb(95 136 159 / 0.34); border: 1px solid rgb(var(--hud-border-rgb) / 0.34);
border-radius: 0.66rem; border-radius: 0.66rem;
padding: 0.66rem 0.72rem; padding: 0.66rem 0.72rem;
background: background:
linear-gradient(180deg, rgb(8 14 19 / 0.86), rgb(4 8 12 / 0.8)), linear-gradient(180deg, rgb(var(--hud-surface-rgb) / 0.86), rgb(var(--hud-surface-deep-rgb) / 0.8)),
radial-gradient(circle at 50% 0, rgb(62 232 255 / 0.07), transparent 56%); radial-gradient(circle at 50% 0, rgb(var(--hud-glow-rgb) / 0.07), transparent 56%);
box-shadow: box-shadow:
inset 0 1px 0 rgb(183 218 239 / 0.08), inset 0 1px 0 rgb(var(--hud-border-strong-rgb) / 0.08),
0 0 18px rgb(62 232 255 / 0.1); 0 0 18px rgb(var(--hud-glow-rgb) / 0.1);
} }
.replay-floating-panel.is-right { .replay-floating-panel.is-right {
@@ -582,24 +587,24 @@
font-size: 0.58rem; font-size: 0.58rem;
letter-spacing: 0.11em; letter-spacing: 0.11em;
text-transform: uppercase; text-transform: uppercase;
color: rgb(152 185 206 / 0.86); color: rgb(var(--hud-text-dim-rgb) / 0.86);
} }
.replay-panel-file { .replay-panel-file {
font-size: 0.73rem; font-size: 0.73rem;
letter-spacing: 0.03em; letter-spacing: 0.03em;
color: rgb(221 241 255 / 0.94); color: rgb(var(--hud-text-main-rgb) / 0.94);
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.replay-panel-frame { .replay-panel-frame {
border: 1px solid rgb(133 255 68 / 0.36); border: 1px solid rgb(var(--hud-lime-rgb) / 0.36);
border-radius: 999px; border-radius: 999px;
padding: 0.16rem 0.52rem; padding: 0.16rem 0.52rem;
background: rgb(17 28 15 / 0.64); background: rgb(var(--hud-surface-alt-rgb) / 0.64);
color: rgb(204 255 178 / 0.94); color: rgb(var(--hud-lime-rgb) / 0.94);
font-size: 0.67rem; font-size: 0.67rem;
letter-spacing: 0.07em; letter-spacing: 0.07em;
white-space: nowrap; white-space: nowrap;
@@ -608,10 +613,10 @@
.replay-close-btn { .replay-close-btn {
inline-size: 1.82rem; inline-size: 1.82rem;
block-size: 1.82rem; block-size: 1.82rem;
border: 1px solid rgb(255 98 76 / 0.44); border: 1px solid rgb(var(--hud-orange-rgb) / 0.44);
border-radius: 0.32rem; border-radius: 0.32rem;
background: rgb(24 10 12 / 0.88); background: rgb(var(--hud-surface-deep-rgb) / 0.88);
color: rgb(255 210 203 / 0.96); color: rgb(var(--hud-orange-rgb) / 0.96);
font-size: 1rem; font-size: 1rem;
line-height: 1; line-height: 1;
display: grid; display: grid;
@@ -624,9 +629,9 @@
} }
.replay-close-btn:hover { .replay-close-btn:hover {
border-color: rgb(255 132 115 / 0.66); border-color: rgb(var(--hud-orange-rgb) / 0.66);
color: rgb(255 234 228 / 0.98); color: rgb(var(--hud-text-main-rgb) / 0.98);
box-shadow: 0 0 12px rgb(255 91 63 / 0.2); box-shadow: 0 0 12px rgb(var(--hud-orange-rgb) / 0.2);
} }
.replay-panel-controls { .replay-panel-controls {
@@ -643,11 +648,11 @@
.replay-action-btn { .replay-action-btn {
min-block-size: 1.82rem; min-block-size: 1.82rem;
border: 1px solid rgb(62 232 255 / 0.36); border: 1px solid rgb(var(--hud-cyan-rgb) / 0.36);
border-radius: 999px; border-radius: 999px;
padding: 0.2rem 0.66rem; padding: 0.2rem 0.66rem;
background: rgb(8 19 25 / 0.9); background: rgb(var(--hud-surface-alt-rgb) / 0.9);
color: rgb(225 246 255 / 0.96); color: rgb(var(--hud-text-main-rgb) / 0.96);
font-size: 0.7rem; font-size: 0.7rem;
letter-spacing: 0.05em; letter-spacing: 0.05em;
cursor: pointer; cursor: pointer;
@@ -657,19 +662,19 @@
} }
.replay-action-btn:hover { .replay-action-btn:hover {
border-color: rgb(116 245 255 / 0.58); border-color: rgb(var(--hud-cyan-rgb) / 0.58);
box-shadow: 0 0 10px rgb(62 232 255 / 0.14); box-shadow: 0 0 10px rgb(var(--hud-cyan-rgb) / 0.14);
} }
.replay-action-btn.is-stop { .replay-action-btn.is-stop {
border-color: rgb(255 91 63 / 0.44); border-color: rgb(var(--hud-orange-rgb) / 0.44);
color: rgb(255 223 214 / 0.94); color: rgb(var(--hud-orange-rgb) / 0.94);
background: rgb(27 12 10 / 0.86); background: rgb(var(--hud-surface-deep-rgb) / 0.86);
} }
.replay-action-btn.is-stop:hover { .replay-action-btn.is-stop:hover {
border-color: rgb(255 124 101 / 0.64); border-color: rgb(var(--hud-orange-rgb) / 0.64);
box-shadow: 0 0 10px rgb(255 91 63 / 0.18); box-shadow: 0 0 10px rgb(var(--hud-orange-rgb) / 0.18);
} }
.replay-speed-select, .replay-speed-select,
@@ -678,15 +683,15 @@
align-items: center; align-items: center;
gap: 0.36rem; gap: 0.36rem;
min-block-size: 1.92rem; min-block-size: 1.92rem;
border: 1px solid rgb(95 132 158 / 0.32); border: 1px solid rgb(var(--hud-border-rgb) / 0.32);
border-radius: 999px; border-radius: 999px;
padding: 0.16rem 0.2rem 0.16rem 0.48rem; padding: 0.16rem 0.2rem 0.16rem 0.48rem;
background: rgb(8 15 21 / 0.78); background: rgb(var(--hud-surface-rgb) / 0.78);
} }
.replay-speed-select span, .replay-speed-select span,
.replay-progress-slider span { .replay-progress-slider span {
color: rgb(154 176 194 / 0.84); color: rgb(var(--hud-text-dim-rgb) / 0.84);
font-size: 0.62rem; font-size: 0.62rem;
letter-spacing: 0.08em; letter-spacing: 0.08em;
text-transform: uppercase; text-transform: uppercase;
@@ -694,11 +699,11 @@
} }
.replay-speed-select select { .replay-speed-select select {
border: 1px solid rgb(95 132 158 / 0.34); border: 1px solid rgb(var(--hud-border-rgb) / 0.34);
border-radius: 999px; border-radius: 999px;
padding: 0.22rem 0.48rem; padding: 0.22rem 0.48rem;
background: rgb(4 11 16 / 0.88); background: rgb(var(--hud-surface-deep-rgb) / 0.88);
color: rgb(216 235 248 / 0.96); color: rgb(var(--hud-text-main-rgb) / 0.96);
font-size: 0.72rem; font-size: 0.72rem;
letter-spacing: 0.05em; letter-spacing: 0.05em;
outline: none; outline: none;
@@ -710,7 +715,7 @@
.replay-progress-slider input { .replay-progress-slider input {
inline-size: 100%; inline-size: 100%;
accent-color: rgb(133 255 68 / 0.92); accent-color: rgb(var(--hud-lime-rgb) / 0.92);
} }
.stage-bottom-overlay { .stage-bottom-overlay {

View File

@@ -16,7 +16,7 @@
export let matrixRows = 12; export let matrixRows = 12;
export let matrixCols = 7; export let matrixCols = 7;
export let rangeMin = 0; export let rangeMin = 0;
export let rangeMax = 5000; export let rangeMax = 16000;
export let colorMapPreset: PressureColorMapPreset = "emerald"; export let colorMapPreset: PressureColorMapPreset = "emerald";
export let colorMapOptions: HudColorMapOption[] = []; export let colorMapOptions: HudColorMapOption[] = [];
@@ -85,7 +85,7 @@
matrixRows = 12; matrixRows = 12;
matrixCols = 7; matrixCols = 7;
rangeMin = 0; rangeMin = 0;
rangeMax = 5000; rangeMax = 16000;
colorMapPreset = "emerald"; colorMapPreset = "emerald";
} }
@@ -222,13 +222,13 @@
gap: 0.9rem; gap: 0.9rem;
inline-size: min(23rem, 100%); inline-size: min(23rem, 100%);
padding: 0.92rem 0.96rem 1rem; padding: 0.92rem 0.96rem 1rem;
border: 1px solid rgb(88 132 116 / 0.3); border: 1px solid rgb(var(--hud-border-rgb) / 0.3);
border-radius: 0.82rem; border-radius: 0.82rem;
background: background:
linear-gradient(180deg, rgb(6 18 14 / 0.92), rgb(4 10 9 / 0.88)), linear-gradient(180deg, rgb(var(--hud-surface-alt-rgb) / 0.92), rgb(var(--hud-surface-deep-rgb) / 0.88)),
radial-gradient(circle at 100% 0, rgb(97 146 255 / 0.07), transparent 38%); radial-gradient(circle at 100% 0, rgb(var(--hud-info-rgb) / 0.07), transparent 38%);
box-shadow: box-shadow:
inset 0 1px 0 rgb(184 236 206 / 0.08), inset 0 1px 0 rgb(var(--hud-border-strong-rgb) / 0.08),
0 18px 46px rgb(0 0 0 / 0.28); 0 18px 46px rgb(0 0 0 / 0.28);
backdrop-filter: blur(10px); backdrop-filter: blur(10px);
} }
@@ -249,7 +249,7 @@
.field-label, .field-label,
.live-note { .live-note {
margin: 0; margin: 0;
color: rgb(157 206 181 / 0.8); color: rgb(var(--hud-text-dim-rgb) / 0.8);
font-size: 0.58rem; font-size: 0.58rem;
letter-spacing: 0.12em; letter-spacing: 0.12em;
text-transform: uppercase; text-transform: uppercase;
@@ -257,7 +257,7 @@
h3 { h3 {
margin: 0.12rem 0 0; margin: 0.12rem 0 0;
color: rgb(237 248 241 / 0.98); color: rgb(var(--hud-text-main-rgb) / 0.98);
font-size: 1rem; font-size: 1rem;
line-height: 1.2; line-height: 1.2;
font-weight: 600; font-weight: 600;
@@ -266,7 +266,7 @@
.config-hint, .config-hint,
.section-note { .section-note {
margin: 0.14rem 0 0; margin: 0.14rem 0 0;
color: rgb(142 182 164 / 0.78); color: rgb(var(--hud-text-dim-rgb) / 0.78);
font-size: 0.7rem; font-size: 0.7rem;
line-height: 1.25; line-height: 1.25;
} }
@@ -275,9 +275,9 @@
position: relative; position: relative;
inline-size: 2rem; inline-size: 2rem;
block-size: 2rem; block-size: 2rem;
border: 1px solid rgb(82 122 106 / 0.32); border: 1px solid rgb(var(--hud-border-rgb) / 0.32);
border-radius: 999px; border-radius: 999px;
background: rgb(4 12 9 / 0.72); background: rgb(var(--hud-surface-deep-rgb) / 0.72);
cursor: pointer; cursor: pointer;
flex: 0 0 auto; flex: 0 0 auto;
} }
@@ -288,7 +288,7 @@
left: 50%; left: 50%;
inline-size: 0.8rem; inline-size: 0.8rem;
block-size: 1px; block-size: 1px;
background: rgb(182 210 195 / 0.9); background: rgb(var(--hud-text-main-rgb) / 0.9);
transform-origin: center; transform-origin: center;
} }
@@ -304,9 +304,9 @@
display: grid; display: grid;
gap: 0.62rem; gap: 0.62rem;
padding: 0.76rem 0.8rem; padding: 0.76rem 0.8rem;
border: 1px solid rgb(72 116 96 / 0.22); border: 1px solid rgb(var(--hud-border-rgb) / 0.22);
border-radius: 0.72rem; border-radius: 0.72rem;
background: linear-gradient(180deg, rgb(7 15 12 / 0.76), rgb(5 10 8 / 0.64)); background: linear-gradient(180deg, rgb(var(--hud-surface-rgb) / 0.76), rgb(var(--hud-surface-deep-rgb) / 0.64));
} }
.section-head { .section-head {
@@ -331,11 +331,11 @@
.preset-btn, .preset-btn,
.reset-btn, .reset-btn,
.palette-btn { .palette-btn {
border: 1px solid rgb(80 126 105 / 0.28); border: 1px solid rgb(var(--hud-border-rgb) / 0.28);
border-radius: 999px; border-radius: 999px;
padding: 0.38rem 0.72rem; padding: 0.38rem 0.72rem;
background: rgb(8 19 15 / 0.76); background: rgb(var(--hud-surface-rgb) / 0.76);
color: rgb(191 219 206 / 0.92); color: rgb(var(--hud-text-main-rgb) / 0.92);
font: inherit; font: inherit;
font-size: 0.72rem; font-size: 0.72rem;
cursor: pointer; cursor: pointer;
@@ -347,10 +347,10 @@
} }
.preset-btn.is-active { .preset-btn.is-active {
border-color: rgb(98 201 149 / 0.48); border-color: rgb(var(--hud-lime-rgb) / 0.48);
background: linear-gradient(180deg, rgb(18 54 37 / 0.96), rgb(10 32 23 / 0.92)); background: linear-gradient(180deg, rgb(var(--hud-surface-alt-rgb) / 0.96), rgb(var(--hud-surface-rgb) / 0.92));
color: rgb(233 247 240 / 0.98); color: rgb(var(--hud-text-main-rgb) / 0.98);
box-shadow: inset 0 1px 0 rgb(198 246 222 / 0.14), 0 0 16px rgb(63 184 120 / 0.14); box-shadow: inset 0 1px 0 rgb(var(--hud-border-strong-rgb) / 0.14), 0 0 16px rgb(var(--hud-glow-alt-rgb) / 0.14);
} }
.palette-btn { .palette-btn {
@@ -363,10 +363,10 @@
} }
.palette-btn.is-active { .palette-btn.is-active {
border-color: rgb(98 201 149 / 0.48); border-color: rgb(var(--hud-lime-rgb) / 0.48);
background: linear-gradient(180deg, rgb(18 54 37 / 0.96), rgb(10 32 23 / 0.92)); background: linear-gradient(180deg, rgb(var(--hud-surface-alt-rgb) / 0.96), rgb(var(--hud-surface-rgb) / 0.92));
color: rgb(233 247 240 / 0.98); color: rgb(var(--hud-text-main-rgb) / 0.98);
box-shadow: inset 0 1px 0 rgb(198 246 222 / 0.14), 0 0 16px rgb(63 184 120 / 0.14); box-shadow: inset 0 1px 0 rgb(var(--hud-border-strong-rgb) / 0.14), 0 0 16px rgb(var(--hud-glow-alt-rgb) / 0.14);
} }
.palette-preview { .palette-preview {
@@ -405,26 +405,26 @@
display: grid; display: grid;
gap: 0.38rem; gap: 0.38rem;
padding: 0.58rem 0.64rem 0.66rem; padding: 0.58rem 0.64rem 0.66rem;
border: 1px solid rgb(68 106 89 / 0.26); border: 1px solid rgb(var(--hud-border-rgb) / 0.26);
border-radius: 0.58rem; border-radius: 0.58rem;
background: linear-gradient(180deg, rgb(6 14 11 / 0.86), rgb(3 8 6 / 0.82)); background: linear-gradient(180deg, rgb(var(--hud-surface-rgb) / 0.86), rgb(var(--hud-surface-deep-rgb) / 0.82));
} }
.field-card input { .field-card input {
inline-size: 100%; inline-size: 100%;
border: 1px solid rgb(82 131 109 / 0.28); border: 1px solid rgb(var(--hud-border-rgb) / 0.28);
border-radius: 0.46rem; border-radius: 0.46rem;
padding: 0.55rem 0.62rem; padding: 0.55rem 0.62rem;
background: rgb(7 16 12 / 0.92); background: rgb(var(--hud-surface-rgb) / 0.92);
color: rgb(238 246 241 / 0.98); color: rgb(var(--hud-text-main-rgb) / 0.98);
font: inherit; font: inherit;
font-size: 0.86rem; font-size: 0.86rem;
outline: none; outline: none;
} }
.field-card input:focus { .field-card input:focus {
border-color: rgb(97 201 147 / 0.54); border-color: rgb(var(--hud-lime-rgb) / 0.54);
box-shadow: 0 0 0 1px rgb(97 201 147 / 0.24); box-shadow: 0 0 0 1px rgb(var(--hud-lime-rgb) / 0.24);
} }
.config-foot { .config-foot {
@@ -435,11 +435,11 @@
} }
.live-note { .live-note {
color: rgb(142 182 164 / 0.8); color: rgb(var(--hud-text-dim-rgb) / 0.8);
} }
.reset-btn { .reset-btn {
background: linear-gradient(180deg, rgb(10 21 17 / 0.88), rgb(6 12 10 / 0.84)); background: linear-gradient(180deg, rgb(var(--hud-surface-alt-rgb) / 0.88), rgb(var(--hud-surface-deep-rgb) / 0.84));
white-space: nowrap; white-space: nowrap;
} }

View File

@@ -0,0 +1,838 @@
<script lang="ts">
import { createEventDispatcher, onDestroy, onMount, tick } from "svelte";
import type { FileExplorerEntry, FileExplorerRoot } from "$lib/types/hud";
export let open = false;
export let mode: "open" | "save" = "open";
export let title = "";
export let currentPath = "";
export let parentPath: string | null = null;
export let roots: FileExplorerRoot[] = [];
export let entries: FileExplorerEntry[] = [];
export let selectedPath = "";
export let fileName = "";
export let pathLabel = "Path";
export let fileNameLabel = "File name";
export let cancelLabel = "Cancel";
export let confirmLabel = "Open";
export let emptyHint = "No file entries";
export let csvHint = "*.csv";
export let busyLabel = "Processing...";
export let upLabel = "↑ Up";
export let nameColumnLabel = "Name";
export let sizeColumnLabel = "Size";
export let modifiedColumnLabel = "Modified";
export let isBusy = false;
const dragViewportPadding = 14;
let overlayEl: HTMLDivElement | null = null;
let modalEl: HTMLDivElement | null = null;
let activePointerId: number | null = null;
let dragStartX = 0;
let dragStartY = 0;
let dragOriginX = 0;
let dragOriginY = 0;
let dragModalWidth = 0;
let dragModalHeight = 0;
let modalOffsetX = 0;
let modalOffsetY = 0;
let isDragging = false;
let wasOpen = false;
const dispatch = createEventDispatcher<{
close: void;
navigate: string;
confirm: void;
}>();
$: selectedEntry = entries.find((entry) => entry.path === selectedPath) ?? null;
$: canConfirm =
mode === "open"
? Boolean(selectedEntry && !selectedEntry.isDir && !isBusy)
: Boolean(fileName.trim().length > 0 && !isBusy);
$: if (open && !wasOpen) {
wasOpen = true;
modalOffsetX = 0;
modalOffsetY = 0;
stopDrag();
void tick().then(() => clampModalOffset());
}
$: if (!open && wasOpen) {
wasOpen = false;
stopDrag();
}
function formatFileSize(value: number | null | undefined): string {
if (!Number.isFinite(value ?? Number.NaN) || value == null) {
return "--";
}
if (value < 1024) {
return `${value} B`;
}
if (value < 1024 * 1024) {
return `${(value / 1024).toFixed(1)} KB`;
}
return `${(value / (1024 * 1024)).toFixed(1)} MB`;
}
function formatModifiedTime(value: number | null | undefined): string {
if (!Number.isFinite(value ?? Number.NaN) || value == null) {
return "--";
}
try {
return new Date(Number(value)).toLocaleString();
} catch {
return "--";
}
}
function navigate(path: string): void {
if (!path || isBusy) {
return;
}
dispatch("navigate", path);
}
function selectEntry(entry: FileExplorerEntry): void {
selectedPath = entry.path;
if (mode === "save" && !entry.isDir) {
fileName = entry.name;
}
}
function activateEntry(entry: FileExplorerEntry): void {
if (entry.isDir) {
navigate(entry.path);
return;
}
selectedPath = entry.path;
if (mode === "save") {
fileName = entry.name;
return;
}
if (canConfirm) {
dispatch("confirm");
}
}
function closeModal(): void {
if (isBusy) {
return;
}
dispatch("close");
}
function confirmSelection(): void {
if (!canConfirm) {
return;
}
dispatch("confirm");
}
function clamp(value: number, min: number, max: number): number {
return Math.min(max, Math.max(min, value));
}
function resolveDragRange(modalSize: number, viewportSize: number): { min: number; max: number } {
const centeredGap = (viewportSize - modalSize) / 2;
const min = dragViewportPadding - centeredGap;
const max = centeredGap - dragViewportPadding;
if (!Number.isFinite(min) || !Number.isFinite(max) || min > max) {
return { min: 0, max: 0 };
}
return { min, max };
}
function clampModalOffset(): void {
if (!open || !modalEl) {
return;
}
const viewportWidth = overlayEl?.clientWidth ?? window.innerWidth;
const viewportHeight = overlayEl?.clientHeight ?? window.innerHeight;
const rect = modalEl.getBoundingClientRect();
const xRange = resolveDragRange(rect.width, viewportWidth);
const yRange = resolveDragRange(rect.height, viewportHeight);
modalOffsetX = clamp(modalOffsetX, xRange.min, xRange.max);
modalOffsetY = clamp(modalOffsetY, yRange.min, yRange.max);
}
function stopDrag(): void {
activePointerId = null;
isDragging = false;
window.removeEventListener("pointermove", handlePointerMove);
window.removeEventListener("pointerup", handlePointerUp);
window.removeEventListener("pointercancel", handlePointerUp);
}
function handlePointerMove(event: PointerEvent): void {
if (activePointerId == null || event.pointerId !== activePointerId) {
return;
}
event.preventDefault();
const viewportWidth = overlayEl?.clientWidth ?? window.innerWidth;
const viewportHeight = overlayEl?.clientHeight ?? window.innerHeight;
const xRange = resolveDragRange(dragModalWidth, viewportWidth);
const yRange = resolveDragRange(dragModalHeight, viewportHeight);
const rawX = dragOriginX + (event.clientX - dragStartX);
const rawY = dragOriginY + (event.clientY - dragStartY);
modalOffsetX = clamp(rawX, xRange.min, xRange.max);
modalOffsetY = clamp(rawY, yRange.min, yRange.max);
isDragging = true;
}
function handlePointerUp(event: PointerEvent): void {
if (activePointerId == null || event.pointerId !== activePointerId) {
return;
}
stopDrag();
}
function startDrag(event: PointerEvent): void {
if (event.button !== 0 || !event.isPrimary || !modalEl) {
return;
}
if (event.target instanceof HTMLElement && event.target.closest("button, input, select, textarea, a")) {
return;
}
const rect = modalEl.getBoundingClientRect();
dragModalWidth = rect.width;
dragModalHeight = rect.height;
dragStartX = event.clientX;
dragStartY = event.clientY;
dragOriginX = modalOffsetX;
dragOriginY = modalOffsetY;
activePointerId = event.pointerId;
isDragging = true;
window.addEventListener("pointermove", handlePointerMove, { passive: false });
window.addEventListener("pointerup", handlePointerUp);
window.addEventListener("pointercancel", handlePointerUp);
}
function handleViewportResize(): void {
clampModalOffset();
}
onMount(() => {
window.addEventListener("resize", handleViewportResize);
return () => {
window.removeEventListener("resize", handleViewportResize);
stopDrag();
};
});
onDestroy(() => {
stopDrag();
});
</script>
{#if open}
<div
bind:this={overlayEl}
class="explorer-overlay"
role="presentation"
on:click={(event) => {
if (event.target === event.currentTarget) {
closeModal();
}
}}
>
<div
bind:this={modalEl}
class="explorer-modal"
class:is-dragging={isDragging}
role="dialog"
aria-modal="true"
aria-label={title}
tabindex="-1"
style={`--explorer-drag-x: ${modalOffsetX}px; --explorer-drag-y: ${modalOffsetY}px;`}
on:keydown={(event) => {
if (event.key === "Escape") {
event.preventDefault();
closeModal();
}
}}
>
<header
class="explorer-header"
role="toolbar"
tabindex="-1"
aria-label="Dialog drag bar"
on:pointerdown={startDrag}
>
<div class="explorer-title-wrap">
<span class="title-pulse" aria-hidden="true"></span>
<h3 class="explorer-title">{title}</h3>
</div>
<button type="button" class="header-close-btn" aria-label="Close" on:click={closeModal}>×</button>
</header>
<div class="explorer-toolbar">
<button
type="button"
class="tool-btn"
disabled={!parentPath || isBusy}
on:click={() => parentPath && navigate(parentPath)}
>
{upLabel}
</button>
<div class="path-field" title={currentPath}>
<span class="path-label">{pathLabel}</span>
<span class="path-value">{currentPath}</span>
</div>
</div>
<div class="explorer-content">
<aside class="roots-list" aria-label="Roots">
{#each roots as root (root.path)}
<button
type="button"
class="root-btn"
class:is-active={currentPath === root.path}
on:click={() => navigate(root.path)}
>
{root.label}
</button>
{/each}
</aside>
<section class="entries-wrap" aria-label="Entries">
<div class="entries-head">
<span>{nameColumnLabel}</span>
<span>{sizeColumnLabel}</span>
<span>{modifiedColumnLabel}</span>
</div>
{#if entries.length === 0}
<p class="entries-empty">{emptyHint}</p>
{:else}
<div class="entries-body">
{#each entries as entry (entry.path)}
<button
type="button"
class="entry-row"
class:is-selected={entry.path === selectedPath}
on:click={() => selectEntry(entry)}
on:dblclick={() => activateEntry(entry)}
>
<span class="entry-name">
<span class="entry-icon" aria-hidden="true">{entry.isDir ? "DIR" : "CSV"}</span>
<span class="entry-text">{entry.name}</span>
</span>
<span class="entry-size">{entry.isDir ? "--" : formatFileSize(entry.sizeBytes)}</span>
<span class="entry-time">{formatModifiedTime(entry.modifiedMs)}</span>
</button>
{/each}
</div>
{/if}
</section>
</div>
<footer class="explorer-footer">
{#if mode === "save"}
<label class="name-input-wrap">
<span class="name-label">{fileNameLabel}</span>
<input
class="name-input"
type="text"
bind:value={fileName}
placeholder="joyson_export.csv"
autocomplete="off"
/>
</label>
{:else}
<p class="csv-hint">{csvHint}</p>
{/if}
<div class="footer-actions">
<button type="button" class="action-btn cancel" disabled={isBusy} on:click={closeModal}>{cancelLabel}</button>
<button type="button" class="action-btn confirm" disabled={!canConfirm} on:click={confirmSelection}>
{isBusy ? busyLabel : confirmLabel}
</button>
</div>
</footer>
</div>
</div>
{/if}
<style>
.explorer-overlay {
position: absolute;
inset: 0;
z-index: 20;
display: grid;
place-items: center;
background:
radial-gradient(circle at 30% 12%, rgb(var(--hud-glow-rgb) / 0.08), transparent 42%),
radial-gradient(circle at 84% 10%, rgb(var(--hud-glow-alt-rgb) / 0.07), transparent 40%),
rgb(0 0 0 / 0.6);
backdrop-filter: blur(3px);
padding: clamp(0.65rem, 2.4vw, 1.25rem);
}
.explorer-modal {
position: relative;
display: grid;
grid-template-rows: auto auto minmax(0, 1fr) auto;
inline-size: min(1020px, 100%);
block-size: min(720px, 100%);
max-inline-size: calc(100% - 2 * clamp(0.65rem, 2.4vw, 1.25rem));
max-block-size: calc(100% - 2 * clamp(0.65rem, 2.4vw, 1.25rem));
border: 1px solid rgb(var(--hud-border-rgb) / 0.34);
border-radius: 0.72rem;
background:
linear-gradient(
172deg,
rgb(var(--hud-surface-rgb) / 0.96) 0%,
rgb(var(--hud-surface-deep-rgb) / 0.96) 52%,
rgb(var(--hud-surface-deep-rgb) / 0.98) 100%
),
radial-gradient(circle at 18% 0, rgb(var(--hud-glow-rgb) / 0.06), transparent 42%),
radial-gradient(circle at 90% 0, rgb(var(--hud-glow-alt-rgb) / 0.05), transparent 38%);
box-shadow:
inset 0 1px 0 rgb(var(--hud-border-strong-rgb) / 0.08),
0 22px 50px rgb(0 0 0 / 0.52);
overflow: hidden;
transform: translate3d(var(--explorer-drag-x, 0), var(--explorer-drag-y, 0), 0);
}
.explorer-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.65rem;
padding: 0.72rem 0.85rem 0.65rem;
border-bottom: 1px solid rgb(var(--hud-border-rgb) / 0.28);
background: linear-gradient(180deg, rgb(var(--hud-surface-alt-rgb) / 0.6), transparent);
cursor: grab;
user-select: none;
touch-action: none;
}
.explorer-modal.is-dragging .explorer-header {
cursor: grabbing;
}
.explorer-title-wrap {
display: inline-flex;
align-items: center;
gap: 0.5rem;
min-width: 0;
}
.title-pulse {
inline-size: 0.5rem;
block-size: 0.5rem;
border-radius: 999px;
background: var(--hud-lime);
box-shadow: 0 0 0 2px rgb(var(--hud-lime-rgb) / 0.14);
}
.explorer-title {
margin: 0;
color: rgb(var(--hud-text-main-rgb) / 0.98);
font-size: 0.92rem;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.header-close-btn {
inline-size: 2rem;
block-size: 1.64rem;
border: 1px solid rgb(var(--hud-border-rgb) / 0.36);
border-radius: 0.36rem;
background: rgb(var(--hud-surface-rgb) / 0.9);
color: rgb(var(--hud-text-main-rgb) / 0.9);
font-size: 1rem;
line-height: 1;
cursor: pointer;
transition:
border-color 180ms ease,
color 180ms ease;
}
.header-close-btn:hover {
border-color: rgb(var(--hud-orange-rgb) / 0.6);
color: rgb(var(--hud-orange-rgb) / 0.96);
}
.explorer-toolbar {
display: grid;
grid-template-columns: auto minmax(0, 1fr);
gap: 0.58rem;
padding: 0.62rem 0.85rem;
border-bottom: 1px solid rgb(var(--hud-border-rgb) / 0.22);
background: linear-gradient(90deg, rgb(var(--hud-glow-rgb) / 0.03), transparent 44%, rgb(var(--hud-glow-alt-rgb) / 0.02));
}
.tool-btn {
min-block-size: 1.95rem;
border: 1px solid rgb(var(--hud-border-rgb) / 0.36);
border-radius: 0.42rem;
padding: 0.25rem 0.65rem;
background: rgb(var(--hud-surface-alt-rgb) / 0.86);
color: rgb(var(--hud-text-main-rgb) / 0.94);
font-size: 0.72rem;
letter-spacing: 0.05em;
cursor: pointer;
transition:
border-color 180ms ease,
box-shadow 180ms ease,
opacity 180ms ease;
}
.tool-btn:hover:not(:disabled) {
border-color: rgb(var(--hud-cyan-rgb) / 0.46);
box-shadow: inset 0 0 0 1px rgb(var(--hud-border-strong-rgb) / 0.08);
}
.tool-btn:disabled {
opacity: 0.58;
cursor: default;
}
.path-field {
min-width: 0;
display: grid;
grid-template-columns: auto 1fr;
align-items: center;
gap: 0.45rem;
border: 1px solid rgb(var(--hud-border-rgb) / 0.32);
border-radius: 0.42rem;
padding: 0.25rem 0.55rem;
background: rgb(var(--hud-surface-rgb) / 0.76);
}
.path-label {
color: rgb(var(--hud-text-dim-rgb) / 0.84);
font-size: 0.63rem;
letter-spacing: 0.08em;
text-transform: uppercase;
white-space: nowrap;
}
.path-value {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: rgb(var(--hud-text-main-rgb) / 0.97);
font-size: 0.76rem;
letter-spacing: 0.03em;
}
.explorer-content {
min-height: 0;
display: grid;
grid-template-columns: 200px minmax(0, 1fr);
gap: 0.62rem;
padding: 0.72rem 0.85rem;
}
.roots-list {
min-height: 0;
display: grid;
grid-auto-rows: min-content;
gap: 0.35rem;
border: 1px solid rgb(95 132 158 / 0.28);
border-radius: 0.5rem;
padding: 0.42rem;
background: rgb(7 13 18 / 0.78);
overflow: auto;
}
.root-btn {
border: 1px solid transparent;
border-radius: 0.34rem;
padding: 0.35rem 0.45rem;
text-align: left;
background: transparent;
color: rgb(167 189 208 / 0.94);
font-size: 0.74rem;
letter-spacing: 0.04em;
cursor: pointer;
transition:
border-color 180ms ease,
background-color 180ms ease,
color 180ms ease;
}
.root-btn:hover {
border-color: rgb(62 232 255 / 0.3);
color: #e5f5ff;
}
.root-btn.is-active {
border-color: rgb(133 255 68 / 0.46);
background: rgb(24 33 22 / 0.7);
color: rgb(237 255 228 / 0.98);
}
.entries-wrap {
min-height: 0;
display: grid;
grid-template-rows: auto minmax(0, 1fr);
border: 1px solid rgb(95 132 158 / 0.28);
border-radius: 0.5rem;
overflow: hidden;
background: rgb(6 11 16 / 0.78);
}
.entries-head {
display: grid;
grid-template-columns: minmax(0, 1fr) 110px 180px;
gap: 0.45rem;
padding: 0.44rem 0.55rem;
border-bottom: 1px solid rgb(95 132 158 / 0.24);
color: rgb(141 164 183 / 0.88);
font-size: 0.62rem;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.entries-empty {
margin: 0;
display: grid;
place-items: center;
color: rgb(148 171 187 / 0.86);
font-size: 0.75rem;
letter-spacing: 0.03em;
}
.entries-body {
min-height: 0;
overflow: auto;
padding: 0.18rem;
display: grid;
grid-auto-rows: min-content;
gap: 0.18rem;
}
.entry-row {
display: grid;
grid-template-columns: minmax(0, 1fr) 110px 180px;
gap: 0.45rem;
align-items: center;
border: 1px solid transparent;
border-radius: 0.32rem;
padding: 0.32rem 0.4rem;
background: transparent;
color: rgb(204 227 243 / 0.94);
cursor: pointer;
text-align: left;
transition:
border-color 160ms ease,
background-color 160ms ease;
}
.entry-row:hover {
border-color: rgb(62 232 255 / 0.26);
background: rgb(11 18 24 / 0.56);
}
.entry-row.is-selected {
border-color: rgb(133 255 68 / 0.46);
background:
linear-gradient(180deg, rgb(24 33 22 / 0.86), rgb(14 21 14 / 0.78)),
radial-gradient(circle at 6% 50%, rgb(133 255 68 / 0.15), transparent 58%);
box-shadow: inset 0 0 0 1px rgb(230 255 220 / 0.06);
}
.entry-name {
min-width: 0;
display: inline-flex;
align-items: center;
gap: 0.45rem;
}
.entry-icon {
inline-size: 2.15rem;
block-size: 1.2rem;
border: 1px solid rgb(95 132 158 / 0.36);
border-radius: 0.22rem;
display: grid;
place-items: center;
color: rgb(150 177 198 / 0.9);
font-size: 0.54rem;
letter-spacing: 0.08em;
background: rgb(9 16 22 / 0.72);
flex-shrink: 0;
}
.entry-row.is-selected .entry-icon {
border-color: rgb(133 255 68 / 0.44);
color: rgb(214 252 190 / 0.95);
}
.entry-text {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 0.76rem;
letter-spacing: 0.03em;
}
.entry-size,
.entry-time {
color: rgb(152 176 194 / 0.88);
font-size: 0.68rem;
letter-spacing: 0.03em;
white-space: nowrap;
text-align: right;
}
.explorer-footer {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.7rem;
border-top: 1px solid rgb(95 132 158 / 0.24);
padding: 0.68rem 0.85rem 0.76rem;
background: linear-gradient(0deg, rgb(5 10 14 / 0.72), transparent);
}
.name-input-wrap {
min-width: 0;
display: grid;
grid-template-columns: auto minmax(0, 1fr);
align-items: center;
gap: 0.45rem;
flex: 1;
}
.name-label {
color: rgb(140 163 181 / 0.86);
font-size: 0.66rem;
letter-spacing: 0.08em;
text-transform: uppercase;
white-space: nowrap;
}
.name-input {
min-inline-size: 0;
border: 1px solid rgb(95 132 158 / 0.36);
border-radius: 0.36rem;
padding: 0.4rem 0.55rem;
background: rgb(8 14 19 / 0.8);
color: rgb(223 242 255 / 0.97);
font-size: 0.76rem;
letter-spacing: 0.03em;
outline: none;
transition:
border-color 170ms ease,
box-shadow 170ms ease;
}
.name-input:focus-visible {
border-color: rgb(62 232 255 / 0.52);
box-shadow: 0 0 0 2px rgb(62 232 255 / 0.14);
}
.csv-hint {
margin: 0;
color: rgb(150 173 189 / 0.9);
font-size: 0.7rem;
letter-spacing: 0.04em;
}
.footer-actions {
display: inline-flex;
align-items: center;
gap: 0.42rem;
}
.action-btn {
min-block-size: 2rem;
border-radius: 999px;
padding: 0.28rem 0.78rem;
font-size: 0.74rem;
letter-spacing: 0.05em;
cursor: pointer;
transition:
border-color 180ms ease,
opacity 160ms ease,
box-shadow 180ms ease;
}
.action-btn.cancel {
border: 1px solid rgb(95 132 158 / 0.36);
background: rgb(9 16 21 / 0.86);
color: rgb(206 228 244 / 0.94);
}
.action-btn.cancel:hover:not(:disabled) {
border-color: rgb(122 198 255 / 0.48);
}
.action-btn.confirm {
border: 1px solid rgb(133 255 68 / 0.48);
background:
linear-gradient(180deg, rgb(25 35 23 / 0.96), rgb(13 20 13 / 0.92)),
radial-gradient(circle at 50% 0, rgb(133 255 68 / 0.14), transparent 58%);
color: rgb(240 255 233 / 0.98);
}
.action-btn.confirm:hover:not(:disabled) {
border-color: rgb(176 255 132 / 0.62);
box-shadow: 0 0 10px rgb(133 255 68 / 0.14);
}
.action-btn:disabled {
opacity: 0.55;
cursor: default;
}
@media (max-width: 900px) {
.explorer-content {
grid-template-columns: 1fr;
grid-template-rows: 140px minmax(0, 1fr);
}
.roots-list {
grid-auto-flow: column;
grid-auto-columns: minmax(120px, 1fr);
overflow-x: auto;
overflow-y: hidden;
}
}
@media (max-width: 640px) {
.explorer-modal {
block-size: min(760px, 100%);
}
.entries-head,
.entry-row {
grid-template-columns: minmax(0, 1fr) 90px;
}
.entries-head span:last-child,
.entry-time {
display: none;
}
.explorer-footer {
flex-direction: column;
align-items: stretch;
}
.footer-actions {
justify-content: flex-end;
}
}
</style>

View File

@@ -41,7 +41,6 @@
export let isExporting = false; export let isExporting = false;
export let isExportDisabled = false; export let isExportDisabled = false;
export let isWindowMaximized = false; export let isWindowMaximized = false;
let csvInputEl: HTMLInputElement | undefined;
const dispatch = createEventDispatcher<{ const dispatch = createEventDispatcher<{
windowcontrol: WindowControlAction; windowcontrol: WindowControlAction;
@@ -51,7 +50,8 @@
serialrefresh: void; serialrefresh: void;
serialconnect: string; serialconnect: string;
serialexport: void; serialexport: void;
csvimport: File; csvimport: void;
noticeclear: void;
}>(); }>();
const connectionToneByState: Record<ConnectionState, "ok" | "warn" | "idle"> = { const connectionToneByState: Record<ConnectionState, "ok" | "warn" | "idle"> = {
@@ -106,17 +106,12 @@
dispatch("serialexport"); dispatch("serialexport");
} }
function openCsvPicker(): void { function emitCsvImport(): void {
csvInputEl?.click(); dispatch("csvimport");
} }
function emitCsvImport(event: Event): void { function emitNoticeClear(): void {
const target = event.currentTarget as HTMLInputElement; dispatch("noticeclear");
const file = target.files?.[0];
if (file) {
dispatch("csvimport", file);
}
target.value = "";
} }
</script> </script>
@@ -246,7 +241,7 @@
<span>{exportButtonText}</span> <span>{exportButtonText}</span>
</button> </button>
<button type="button" class="import-btn" on:click={openCsvPicker}> <button type="button" class="import-btn" on:click={emitCsvImport}>
<svg viewBox="0 0 16 16" aria-hidden="true"> <svg viewBox="0 0 16 16" aria-hidden="true">
<path d="M8 10.8V3.6"></path> <path d="M8 10.8V3.6"></path>
<path d="M5.4 6.3L8 3.6l2.6 2.7"></path> <path d="M5.4 6.3L8 3.6l2.6 2.7"></path>
@@ -254,13 +249,6 @@
</svg> </svg>
<span>{importActionLabel}</span> <span>{importActionLabel}</span>
</button> </button>
<input
bind:this={csvInputEl}
class="hidden-input"
type="file"
accept=".csv,text/csv"
on:change={emitCsvImport}
/>
<section class="locale-switch" aria-label="Language"> <section class="locale-switch" aria-label="Language">
<button <button
@@ -283,9 +271,17 @@
</div> </div>
{#if connectionNotice} {#if connectionNotice}
<p class="connection-notice tone-{connectionNoticeTone}" role={connectionNoticeTone === "warn" ? "alert" : "status"}> <div class="connection-notice tone-{connectionNoticeTone}" role={connectionNoticeTone === "warn" ? "alert" : "status"}>
{connectionNotice} <p class="connection-notice-text">{connectionNotice}</p>
</p> <button
type="button"
class="notice-close-btn"
aria-label={locale === "zh-CN" ? "关闭提示" : "Dismiss notice"}
on:click={emitNoticeClear}
>
×
</button>
</div>
{/if} {/if}
<section class="info-grid"> <section class="info-grid">
@@ -310,15 +306,25 @@
display: grid; display: grid;
grid-template-rows: auto auto; grid-template-rows: auto auto;
gap: clamp(0.5rem, 1.2vw, 0.85rem); gap: clamp(0.5rem, 1.2vw, 0.85rem);
--panel-line: rgb(var(--hud-border-rgb) / 0.34);
--panel-line-soft: rgb(var(--hud-border-rgb) / 0.22);
--panel-line-strong: rgb(var(--hud-border-strong-rgb) / 0.42);
--panel-surface: rgb(var(--hud-surface-rgb) / 0.7);
--panel-surface-strong: rgb(var(--hud-surface-alt-rgb) / 0.84);
--panel-surface-deep: rgb(var(--hud-surface-deep-rgb) / 0.9);
--panel-text: rgb(var(--hud-text-main-rgb) / 0.96);
--panel-text-dim: rgb(var(--hud-text-dim-rgb) / 0.84);
--panel-glow: rgb(var(--hud-glow-rgb) / 0.12);
--panel-glow-alt: rgb(var(--hud-glow-alt-rgb) / 0.12);
} }
.title-bar { .title-bar {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
border-bottom: 1px solid rgb(108 143 166 / 0.22); border-bottom: 1px solid var(--panel-line-soft);
padding: 0.05rem 0.1rem 0.55rem 0.1rem; padding: 0.05rem 0.1rem 0.55rem 0.1rem;
background: linear-gradient(180deg, rgb(15 22 28 / 0.32), transparent); background: linear-gradient(180deg, rgb(var(--hud-surface-alt-rgb) / 0.32), transparent);
} }
.title-cluster { .title-cluster {
@@ -332,15 +338,15 @@
inline-size: 0.52rem; inline-size: 0.52rem;
block-size: 0.52rem; block-size: 0.52rem;
border-radius: 50%; border-radius: 50%;
background: rgb(133 255 68 / 0.95); background: rgb(var(--hud-lime-rgb) / 0.95);
box-shadow: 0 0 0 2px rgb(133 255 68 / 0.14); box-shadow: 0 0 0 2px rgb(var(--hud-lime-rgb) / 0.14);
} }
.app-name { .app-name {
font-size: 1rem; font-size: 1rem;
font-weight: 700; font-weight: 700;
letter-spacing: 0.07em; letter-spacing: 0.07em;
color: #f0fbff; color: rgb(var(--hud-text-main-rgb) / 0.98);
text-transform: uppercase; text-transform: uppercase;
} }
@@ -363,10 +369,10 @@
justify-content: center; justify-content: center;
inline-size: 1.8rem; inline-size: 1.8rem;
block-size: 1.52rem; block-size: 1.52rem;
border: 1px solid rgb(82 120 146 / 0.36); border: 1px solid var(--panel-line);
border-radius: 0.34rem; border-radius: 0.34rem;
color: rgb(179 245 255 / 0.92); color: rgb(var(--hud-cyan-rgb) / 0.92);
background: rgb(8 12 16 / 0.82); background: rgb(var(--hud-surface-rgb) / 0.82);
cursor: pointer; cursor: pointer;
transition: transition:
background-color 200ms ease, background-color 200ms ease,
@@ -385,27 +391,27 @@
} }
.window-btn:hover { .window-btn:hover {
border-color: rgb(62 232 255 / 0.42); border-color: rgb(var(--hud-cyan-rgb) / 0.42);
background: rgb(14 20 26 / 0.9); background: rgb(var(--hud-surface-alt-rgb) / 0.9);
color: #f3fdff; color: rgb(var(--hud-text-main-rgb) / 1);
} }
.window-btn.is-maximized { .window-btn.is-maximized {
border-color: rgb(133 255 68 / 0.5); border-color: rgb(var(--hud-lime-rgb) / 0.5);
color: rgb(211 255 190 / 0.92); color: rgb(var(--hud-lime-rgb) / 0.92);
} }
.window-btn.is-close:hover { .window-btn.is-close:hover {
border-color: rgb(255 91 63 / 0.62); border-color: rgb(var(--hud-orange-rgb) / 0.62);
background: rgb(27 11 10 / 0.9); background: rgb(var(--hud-surface-deep-rgb) / 0.92);
color: rgb(255 200 188 / 0.96); color: rgb(var(--hud-orange-rgb) / 0.96);
} }
.control-bar { .control-bar {
display: grid; display: grid;
gap: 0.45rem; gap: 0.45rem;
padding: 0 0.1rem; padding: 0 0.1rem;
background: linear-gradient(90deg, rgb(62 232 255 / 0.02), transparent 45%, rgb(133 255 68 / 0.015)); background: linear-gradient(90deg, rgb(var(--hud-glow-rgb) / 0.02), transparent 45%, rgb(var(--hud-glow-alt-rgb) / 0.015));
} }
.control-main-row { .control-main-row {
@@ -420,32 +426,32 @@
align-items: center; align-items: center;
gap: 0.42rem; gap: 0.42rem;
min-block-size: 2rem; min-block-size: 2rem;
border: 1px solid rgb(95 132 158 / 0.3); border: 1px solid var(--panel-line);
border-radius: 999px; border-radius: 999px;
padding: 0.2rem 0.62rem 0.2rem 0.36rem; padding: 0.2rem 0.62rem 0.2rem 0.36rem;
background: rgb(10 16 20 / 0.68); background: var(--panel-surface);
} }
.state-dot { .state-dot {
inline-size: 0.55rem; inline-size: 0.55rem;
block-size: 0.55rem; block-size: 0.55rem;
border-radius: 50%; border-radius: 50%;
background: rgb(143 165 186 / 0.92); background: rgb(var(--hud-text-dim-rgb) / 0.92);
box-shadow: 0 0 0 2px rgb(143 165 186 / 0.14); box-shadow: 0 0 0 2px rgb(var(--hud-text-dim-rgb) / 0.14);
} }
.state-dot.ok { .state-dot.ok {
background: var(--hud-lime); background: var(--hud-lime);
box-shadow: 0 0 0 2px rgb(133 255 68 / 0.16); box-shadow: 0 0 0 2px rgb(var(--hud-lime-rgb) / 0.16);
} }
.state-dot.warn { .state-dot.warn {
background: var(--hud-orange); background: var(--hud-orange);
box-shadow: 0 0 0 2px rgb(255 91 63 / 0.16); box-shadow: 0 0 0 2px rgb(var(--hud-orange-rgb) / 0.16);
} }
.state-label { .state-label {
color: rgb(154 176 194 / 0.84); color: var(--panel-text-dim);
font-size: 0.66rem; font-size: 0.66rem;
letter-spacing: 0.08em; letter-spacing: 0.08em;
text-transform: uppercase; text-transform: uppercase;
@@ -453,7 +459,7 @@
} }
.state-value { .state-value {
color: #ecf8ff; color: var(--panel-text);
font-size: 0.92rem; font-size: 0.92rem;
letter-spacing: 0.02em; letter-spacing: 0.02em;
font-weight: 600; font-weight: 600;
@@ -465,10 +471,10 @@
align-items: center; align-items: center;
gap: 0.38rem; gap: 0.38rem;
min-block-size: 2rem; min-block-size: 2rem;
border: 1px solid rgb(95 132 158 / 0.3); border: 1px solid var(--panel-line);
border-radius: 999px; border-radius: 999px;
padding: 0.18rem 0.2rem 0.18rem 0.56rem; padding: 0.18rem 0.2rem 0.18rem 0.56rem;
background: rgb(10 16 20 / 0.7); background: var(--panel-surface);
min-inline-size: 0; min-inline-size: 0;
} }
@@ -479,7 +485,7 @@
} }
.serial-tag { .serial-tag {
color: rgb(154 176 194 / 0.84); color: var(--panel-text-dim);
font-size: 0.66rem; font-size: 0.66rem;
letter-spacing: 0.08em; letter-spacing: 0.08em;
text-transform: uppercase; text-transform: uppercase;
@@ -491,11 +497,11 @@
appearance: none; appearance: none;
inline-size: 100%; inline-size: 100%;
min-inline-size: 7rem; min-inline-size: 7rem;
border: 1px solid rgb(95 132 158 / 0.32); border: 1px solid var(--panel-line);
border-radius: 999px; border-radius: 999px;
padding: 0.3rem 1.5rem 0.3rem 0.6rem; padding: 0.3rem 1.5rem 0.3rem 0.6rem;
background: rgb(4 11 16 / 0.84); background: rgb(var(--hud-surface-deep-rgb) / 0.84);
color: #d5ebfb; color: rgb(var(--hud-text-main-rgb) / 0.92);
font-size: 0.84rem; font-size: 0.84rem;
letter-spacing: 0.06em; letter-spacing: 0.06em;
text-transform: uppercase; text-transform: uppercase;
@@ -506,12 +512,12 @@
} }
.serial-select-input:hover { .serial-select-input:hover {
border-color: rgb(62 232 255 / 0.36); border-color: rgb(var(--hud-cyan-rgb) / 0.36);
} }
.serial-select-input:focus-visible { .serial-select-input:focus-visible {
border-color: rgb(62 232 255 / 0.5); border-color: rgb(var(--hud-cyan-rgb) / 0.5);
box-shadow: 0 0 0 2px rgb(62 232 255 / 0.14); box-shadow: 0 0 0 2px rgb(var(--hud-cyan-rgb) / 0.14);
} }
.serial-select-caret { .serial-select-caret {
@@ -520,8 +526,8 @@
inset-block-start: 50%; inset-block-start: 50%;
inline-size: 0.42rem; inline-size: 0.42rem;
block-size: 0.42rem; block-size: 0.42rem;
border-right: 1px solid rgb(153 189 214 / 0.82); border-right: 1px solid rgb(var(--hud-text-main-rgb) / 0.82);
border-bottom: 1px solid rgb(153 189 214 / 0.82); border-bottom: 1px solid rgb(var(--hud-text-main-rgb) / 0.82);
transform: translateY(-64%) rotate(45deg); transform: translateY(-64%) rotate(45deg);
pointer-events: none; pointer-events: none;
} }
@@ -531,13 +537,13 @@
align-items: center; align-items: center;
gap: 0.36rem; gap: 0.36rem;
min-block-size: 2rem; min-block-size: 2rem;
border: 1px solid rgb(95 132 158 / 0.34); border: 1px solid var(--panel-line);
border-radius: 999px; border-radius: 999px;
padding: 0.24rem 0.64rem; padding: 0.24rem 0.64rem;
background: background:
linear-gradient(180deg, rgb(11 18 24 / 0.92), rgb(7 12 17 / 0.88)), linear-gradient(180deg, rgb(var(--hud-surface-alt-rgb) / 0.92), rgb(var(--hud-surface-rgb) / 0.88)),
radial-gradient(circle at 50% 0, rgb(62 232 255 / 0.1), transparent 58%); radial-gradient(circle at 50% 0, rgb(var(--hud-glow-rgb) / 0.1), transparent 58%);
color: rgb(214 236 248 / 0.96); color: rgb(var(--hud-text-main-rgb) / 0.96);
font-size: 0.74rem; font-size: 0.74rem;
letter-spacing: 0.05em; letter-spacing: 0.05em;
cursor: pointer; cursor: pointer;
@@ -560,10 +566,10 @@
} }
.refresh-btn:hover:not(:disabled) { .refresh-btn:hover:not(:disabled) {
border-color: rgb(62 232 255 / 0.44); border-color: rgb(var(--hud-cyan-rgb) / 0.44);
box-shadow: box-shadow:
inset 0 0 0 1px rgb(167 218 252 / 0.07), inset 0 0 0 1px rgb(var(--hud-border-strong-rgb) / 0.07),
0 0 10px rgb(62 232 255 / 0.1); 0 0 10px rgb(var(--hud-glow-rgb) / 0.1);
} }
.refresh-btn:disabled { .refresh-btn:disabled {
@@ -576,13 +582,13 @@
align-items: center; align-items: center;
gap: 0.42rem; gap: 0.42rem;
min-block-size: 2rem; min-block-size: 2rem;
border: 1px solid rgb(133 255 68 / 0.4); border: 1px solid rgb(var(--hud-lime-rgb) / 0.4);
border-radius: 999px; border-radius: 999px;
padding: 0.24rem 0.76rem; padding: 0.24rem 0.76rem;
background: background:
linear-gradient(180deg, rgb(24 33 22 / 0.96), rgb(12 19 12 / 0.92)), linear-gradient(180deg, rgb(var(--hud-surface-alt-rgb) / 0.96), rgb(var(--hud-surface-rgb) / 0.92)),
radial-gradient(circle at 50% 0, rgb(133 255 68 / 0.12), transparent 58%); radial-gradient(circle at 50% 0, rgb(var(--hud-glow-alt-rgb) / 0.12), transparent 58%);
color: #f2ffe8; color: rgb(var(--hud-text-main-rgb) / 0.98);
font-size: 0.78rem; font-size: 0.78rem;
letter-spacing: 0.05em; letter-spacing: 0.05em;
cursor: pointer; cursor: pointer;
@@ -595,10 +601,10 @@
} }
.connect-btn:hover:not(:disabled) { .connect-btn:hover:not(:disabled) {
border-color: rgb(170 255 121 / 0.62); border-color: rgb(var(--hud-lime-rgb) / 0.62);
box-shadow: box-shadow:
inset 0 0 0 1px rgb(231 255 214 / 0.08), inset 0 0 0 1px rgb(var(--hud-text-main-rgb) / 0.08),
0 0 12px rgb(133 255 68 / 0.14); 0 0 12px rgb(var(--hud-glow-alt-rgb) / 0.14);
} }
.connect-btn:disabled { .connect-btn:disabled {
@@ -607,19 +613,19 @@
} }
.connect-btn.is-busy { .connect-btn.is-busy {
border-color: rgb(255 91 63 / 0.48); border-color: rgb(var(--hud-orange-rgb) / 0.48);
background: background:
linear-gradient(180deg, rgb(38 18 15 / 0.96), rgb(23 10 10 / 0.92)), linear-gradient(180deg, rgb(var(--hud-surface-alt-rgb) / 0.96), rgb(var(--hud-surface-deep-rgb) / 0.92)),
radial-gradient(circle at 50% 0, rgb(255 91 63 / 0.12), transparent 58%); radial-gradient(circle at 50% 0, rgb(var(--hud-orange-rgb) / 0.12), transparent 58%);
color: rgb(255 223 217 / 0.96); color: rgb(var(--hud-orange-rgb) / 0.96);
} }
.connect-btn.is-connected { .connect-btn.is-connected {
border-color: rgb(62 232 255 / 0.46); border-color: rgb(var(--hud-cyan-rgb) / 0.46);
background: background:
linear-gradient(180deg, rgb(10 28 32 / 0.96), rgb(6 15 18 / 0.92)), linear-gradient(180deg, rgb(var(--hud-surface-alt-rgb) / 0.96), rgb(var(--hud-surface-rgb) / 0.92)),
radial-gradient(circle at 50% 0, rgb(62 232 255 / 0.14), transparent 58%); radial-gradient(circle at 50% 0, rgb(var(--hud-cyan-rgb) / 0.14), transparent 58%);
color: rgb(227 251 255 / 0.98); color: rgb(var(--hud-text-main-rgb) / 0.98);
} }
.connect-btn-indicator { .connect-btn-indicator {
@@ -724,20 +730,22 @@
0 0 12px rgb(122 198 255 / 0.14); 0 0 12px rgb(122 198 255 / 0.14);
} }
.hidden-input {
position: absolute;
inline-size: 0;
block-size: 0;
opacity: 0;
pointer-events: none;
}
.connection-notice { .connection-notice {
margin: 0; margin: 0;
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.6rem;
border: 1px solid rgb(95 132 158 / 0.32); border: 1px solid rgb(95 132 158 / 0.32);
border-radius: 0.5rem; border-radius: 0.5rem;
padding: 0.45rem 0.7rem; padding: 0.38rem 0.45rem 0.38rem 0.7rem;
background: rgb(8 14 19 / 0.72); background: rgb(8 14 19 / 0.72);
}
.connection-notice-text {
margin: 0;
flex: 1;
min-width: 0;
color: rgb(214 236 248 / 0.96); color: rgb(214 236 248 / 0.96);
font-size: 0.72rem; font-size: 0.72rem;
letter-spacing: 0.03em; letter-spacing: 0.03em;
@@ -758,7 +766,41 @@
.connection-notice.tone-info { .connection-notice.tone-info {
border-color: rgb(62 232 255 / 0.34); border-color: rgb(62 232 255 / 0.34);
background: rgb(8 17 22 / 0.76); background: rgb(8 17 22 / 0.76);
color: rgb(214 236 248 / 0.96); }
.notice-close-btn {
inline-size: 1.36rem;
block-size: 1.36rem;
border: 1px solid rgb(116 151 176 / 0.4);
border-radius: 0.28rem;
background: rgb(7 12 16 / 0.82);
color: rgb(194 225 245 / 0.92);
font-size: 0.92rem;
line-height: 1;
cursor: pointer;
flex-shrink: 0;
transition:
border-color 180ms ease,
color 180ms ease,
background-color 180ms ease;
}
.notice-close-btn:hover {
border-color: rgb(62 232 255 / 0.5);
color: rgb(237 250 255 / 0.98);
background: rgb(9 16 22 / 0.92);
}
.connection-notice.tone-warn .notice-close-btn:hover {
border-color: rgb(255 91 63 / 0.6);
color: rgb(255 227 220 / 0.98);
background: rgb(34 13 12 / 0.9);
}
.connection-notice.tone-ok .notice-close-btn:hover {
border-color: rgb(133 255 68 / 0.56);
color: rgb(236 255 227 / 0.98);
background: rgb(17 28 14 / 0.9);
} }
.info-grid { .info-grid {

View File

@@ -26,7 +26,7 @@
export let matrixRows = 12; export let matrixRows = 12;
export let matrixCols = 7; export let matrixCols = 7;
export let rangeMin = 0; export let rangeMin = 0;
export let rangeMax = 5000; export let rangeMax = 16000;
export let colorMapPreset: PressureColorMapPreset = "emerald"; export let colorMapPreset: PressureColorMapPreset = "emerald";
let viewerEl: HTMLDivElement | undefined; let viewerEl: HTMLDivElement | undefined;
@@ -34,7 +34,7 @@
let overlayEl: HTMLCanvasElement | undefined; let overlayEl: HTMLCanvasElement | undefined;
let stats: ViewerStats = { total: 0, max: 0, avg: 0 }; let stats: ViewerStats = { total: 0, max: 0, avg: 0 };
const RAW_DATA_MAX = 5000; const DEFAULT_RANGE_MAX = 16000;
const BASE_MATRIX_SPAN = 24; const BASE_MATRIX_SPAN = 24;
const MATRIX_SPAN_GROWTH = 0.6; const MATRIX_SPAN_GROWTH = 0.6;
const MIN_MATRIX_SPAN = 24; const MIN_MATRIX_SPAN = 24;
@@ -49,8 +49,8 @@
const MAX_LABEL_SCALE = 2.45; const MAX_LABEL_SCALE = 2.45;
const MATRIX_OFFSET_Y = -2.4; const MATRIX_OFFSET_Y = -2.4;
const MATRIX_OFFSET_Z = 12; const MATRIX_OFFSET_Z = 12;
const HEIGHT_SCALE = 18.5; const HEIGHT_SCALE = 10.6;
const BASE_HEIGHT = 0.18; const BASE_HEIGHT = 0.12;
const GLOW_START = 0.3; const GLOW_START = 0.3;
const SMOOTHING_SPEED = 8.2; const SMOOTHING_SPEED = 8.2;
const CAMERA_FOV = 36; const CAMERA_FOV = 36;
@@ -64,7 +64,6 @@
const MATRIX_ROTATION_Y = 0; const MATRIX_ROTATION_Y = 0;
const labelVector = new THREE.Vector3(); const labelVector = new THREE.Vector3();
const whiteColor = new THREE.Color("#ffffff");
$: resolvedColorPalette = pressureColorPalettes[colorMapPreset] ?? pressureColorPalettes.emerald; $: resolvedColorPalette = pressureColorPalettes[colorMapPreset] ?? pressureColorPalettes.emerald;
$: surfaceBaseColor = new THREE.Color(resolvedColorPalette.surfaceBase); $: surfaceBaseColor = new THREE.Color(resolvedColorPalette.surfaceBase);
$: surfaceLowColor = new THREE.Color(resolvedColorPalette.surfaceLow); $: surfaceLowColor = new THREE.Color(resolvedColorPalette.surfaceLow);
@@ -75,6 +74,38 @@
$: labelLowColor = new THREE.Color(resolvedColorPalette.labelLow); $: labelLowColor = new THREE.Color(resolvedColorPalette.labelLow);
$: labelMidColor = new THREE.Color(resolvedColorPalette.labelMid); $: labelMidColor = new THREE.Color(resolvedColorPalette.labelMid);
$: labelHighColor = new THREE.Color(resolvedColorPalette.labelHigh); $: labelHighColor = new THREE.Color(resolvedColorPalette.labelHigh);
$: sceneClearColor = new THREE.Color(resolvedColorPalette.uiTheme.bg30);
$: sceneBoardColor = new THREE.Color(resolvedColorPalette.uiTheme.bg20);
$: sceneGridCenterColor = new THREE.Color(resolvedColorPalette.surfaceMid);
$: sceneGridLineColor = new THREE.Color(resolvedColorPalette.uiTheme.bg20);
$: sceneAmbientLightColor = rgbTripletToThreeColor(resolvedColorPalette.uiTheme.textMainRgb);
$: sceneKeyLightColor = rgbTripletToThreeColor(resolvedColorPalette.uiTheme.glowAltRgb);
$: sceneAccentLightColor = rgbTripletToThreeColor(resolvedColorPalette.uiTheme.glowRgb);
$: surfaceThemeAccentColor = rgbTripletToThreeColor(resolvedColorPalette.uiTheme.glowRgb);
$: labelThemeAccentColor = rgbTripletToThreeColor(resolvedColorPalette.uiTheme.glowRgb);
$: labelHighlightCss = colorToCss(surfaceHotColor);
$: viewerThemeStyle = [
`--matrix-bg-10: ${resolvedColorPalette.uiTheme.bg10}`,
`--matrix-bg-20: ${resolvedColorPalette.uiTheme.bg20}`,
`--matrix-bg-30: ${resolvedColorPalette.uiTheme.bg30}`,
`--matrix-text-main-rgb: ${resolvedColorPalette.uiTheme.textMainRgb}`,
`--matrix-text-dim-rgb: ${resolvedColorPalette.uiTheme.textDimRgb}`,
`--matrix-border-rgb: ${resolvedColorPalette.uiTheme.borderRgb}`,
`--matrix-border-strong-rgb: ${resolvedColorPalette.uiTheme.borderStrongRgb}`,
`--matrix-surface-rgb: ${resolvedColorPalette.uiTheme.surfaceRgb}`,
`--matrix-surface-alt-rgb: ${resolvedColorPalette.uiTheme.surfaceAltRgb}`,
`--matrix-surface-deep-rgb: ${resolvedColorPalette.uiTheme.surfaceDeepRgb}`,
`--matrix-glow-rgb: ${resolvedColorPalette.uiTheme.glowRgb}`,
`--matrix-glow-alt-rgb: ${resolvedColorPalette.uiTheme.glowAltRgb}`
].join("; ");
let rendererRef: THREE.WebGLRenderer | null = null;
let boardMaterialRef: THREE.MeshBasicMaterial | null = null;
let gridRef: THREE.GridHelper | null = null;
let gridMaterialRef: THREE.Material | THREE.Material[] | null = null;
let ambientLightRef: THREE.AmbientLight | null = null;
let dirLightRef: THREE.DirectionalLight | null = null;
let sideLightRef: THREE.DirectionalLight | null = null;
function sanitizeGridValue(value: number): number { function sanitizeGridValue(value: number): number {
return clamp(Math.round(Number.isFinite(value) ? value : 12), 1, 128); return clamp(Math.round(Number.isFinite(value) ? value : 12), 1, 128);
@@ -82,7 +113,7 @@
function sanitizeRangePair(minValue: number, maxValue: number): { min: number; max: number } { function sanitizeRangePair(minValue: number, maxValue: number): { min: number; max: number } {
const resolvedMin = Math.round(Number.isFinite(minValue) ? minValue : 0); const resolvedMin = Math.round(Number.isFinite(minValue) ? minValue : 0);
const resolvedMax = Math.max(Math.round(Number.isFinite(maxValue) ? maxValue : RAW_DATA_MAX), resolvedMin + 1); const resolvedMax = Math.max(Math.round(Number.isFinite(maxValue) ? maxValue : DEFAULT_RANGE_MAX), resolvedMin + 1);
return { min: resolvedMin, max: resolvedMax }; return { min: resolvedMin, max: resolvedMax };
} }
@@ -107,6 +138,10 @@
return clamp((value - minValue) / Math.max(1, maxValue - minValue), 0, 1); return clamp((value - minValue) / Math.max(1, maxValue - minValue), 0, 1);
} }
function rgbTripletToThreeColor(rgbTriplet: string): THREE.Color {
return new THREE.Color(`rgb(${rgbTriplet.replace(/\s+/g, ", ")})`);
}
function surfaceColorMap(valueNormalized: number, target: THREE.Color = new THREE.Color()): THREE.Color { function surfaceColorMap(valueNormalized: number, target: THREE.Color = new THREE.Color()): THREE.Color {
const value = clamp(valueNormalized, 0, 1); const value = clamp(valueNormalized, 0, 1);
let mapped: THREE.Color; let mapped: THREE.Color;
@@ -122,14 +157,15 @@
mapped = target.copy(surfaceMidColor).lerp(surfaceHighColor, t); mapped = target.copy(surfaceMidColor).lerp(surfaceHighColor, t);
} }
const baseAccentStrength = (1 - smoothstep(0.12, 0.52, value)) * 0.34;
const highlightStrength = smoothstep(0.82, 1, value) * 0.3; const highlightStrength = smoothstep(0.82, 1, value) * 0.3;
return mapped.lerp(surfaceHotColor, highlightStrength); return mapped.lerp(surfaceThemeAccentColor, baseAccentStrength).lerp(surfaceHotColor, highlightStrength);
} }
function glowColorMap(valueNormalized: number, target: THREE.Color = new THREE.Color()): THREE.Color { function glowColorMap(valueNormalized: number, target: THREE.Color = new THREE.Color()): THREE.Color {
const value = clamp(valueNormalized, 0, 1); const value = clamp(valueNormalized, 0, 1);
const glowStrength = smoothstep(0.55, 1, value); const glowStrength = smoothstep(0.55, 1, value);
return surfaceColorMap(value, target).lerp(whiteColor, glowStrength * 0.42); return surfaceColorMap(value, target).lerp(surfaceHotColor, glowStrength * 0.42);
} }
function labelColorMap(valueNormalized: number, target: THREE.Color = new THREE.Color()): THREE.Color { function labelColorMap(valueNormalized: number, target: THREE.Color = new THREE.Color()): THREE.Color {
@@ -147,12 +183,13 @@
mapped = target.copy(labelMidColor).lerp(labelHighColor, t); mapped = target.copy(labelMidColor).lerp(labelHighColor, t);
} }
const baseAccentStrength = (1 - smoothstep(0.16, 0.58, value)) * 0.46;
const highlightStrength = smoothstep(0.8, 1, value) * 0.36; const highlightStrength = smoothstep(0.8, 1, value) * 0.36;
return mapped.lerp(whiteColor, highlightStrength); return mapped.lerp(labelThemeAccentColor, baseAccentStrength).lerp(surfaceHotColor, highlightStrength);
} }
function shapeHeightValue(valueNormalized: number): number { function shapeHeightValue(valueNormalized: number): number {
return Math.pow(clamp(valueNormalized, 0, 1), 0.74); return Math.pow(clamp(valueNormalized, 0, 1), 0.9);
} }
function shapeGlowStrength(valueNormalized: number): number { function shapeGlowStrength(valueNormalized: number): number {
@@ -170,7 +207,7 @@
const gridSpan = Math.max(boardWidth, boardDepth) + boardPadding * 2; const gridSpan = Math.max(boardWidth, boardDepth) + boardPadding * 2;
const gridDivisions = Math.round(clamp(longestEdge * 1.6, MIN_GRID_DIVISIONS, MAX_GRID_DIVISIONS)); const gridDivisions = Math.round(clamp(longestEdge * 1.6, MIN_GRID_DIVISIONS, MAX_GRID_DIVISIONS));
const labelScale = clamp(24 / (longestEdge + 2), MIN_LABEL_SCALE, MAX_LABEL_SCALE); const labelScale = clamp(24 / (longestEdge + 2), MIN_LABEL_SCALE, MAX_LABEL_SCALE);
const labelFloatOffset = clamp(cellSpacing * 0.74, 0.64, 2.2); const labelFloatOffset = clamp(cellSpacing * 0.42, 0.36, 1.12);
return { return {
cellSpacing, cellSpacing,
@@ -208,7 +245,8 @@
function copyExternalField(target: Float32Array, values: number[]): void { function copyExternalField(target: Float32Array, values: number[]): void {
for (let index = 0; index < target.length; index += 1) { for (let index = 0; index < target.length; index += 1) {
target[index] = clamp(values[index] ?? 0, 0, RAW_DATA_MAX); const value = Number(values[index] ?? 0);
target[index] = Number.isFinite(value) ? value : 0;
} }
} }
@@ -217,7 +255,7 @@
return 0; return 0;
} }
return Math.round(clamp(rawValue, 0, Math.max(maxValue, RAW_DATA_MAX))); return Math.round(rawValue);
} }
function colorToCss(color: THREE.Color): string { function colorToCss(color: THREE.Color): string {
@@ -228,6 +266,57 @@
const t = index / 32; const t = index / 32;
return colorToCss(labelColorMap(t, new THREE.Color())); return colorToCss(labelColorMap(t, new THREE.Color()));
}); });
$: labelGlowPalette = Array.from({ length: 33 }, (_, index) => {
const t = index / 32;
return colorToCss(glowColorMap(t, new THREE.Color()));
});
function applyGridTheme(grid: THREE.GridHelper, divisions: number): void {
const colorAttribute = grid.geometry.getAttribute("color");
if (!(colorAttribute instanceof THREE.BufferAttribute)) {
return;
}
for (let division = 0; division <= divisions; division += 1) {
const lineColor = division === divisions / 2 ? sceneGridCenterColor : sceneGridLineColor;
const vertexBase = division * 4;
for (let vertexOffset = 0; vertexOffset < 4; vertexOffset += 1) {
colorAttribute.setXYZ(vertexBase + vertexOffset, lineColor.r, lineColor.g, lineColor.b);
}
}
colorAttribute.needsUpdate = true;
}
function applySceneTheme(): void {
if (!rendererRef || !boardMaterialRef || !gridRef || !gridMaterialRef) {
return;
}
rendererRef.setClearColor(sceneClearColor, 1);
boardMaterialRef.color.copy(sceneBoardColor);
boardMaterialRef.needsUpdate = true;
applyGridTheme(gridRef, matrixLayout.gridDivisions);
if (Array.isArray(gridMaterialRef)) {
for (const material of gridMaterialRef) {
material.transparent = true;
material.opacity = 0.034;
material.needsUpdate = true;
}
} else {
gridMaterialRef.transparent = true;
gridMaterialRef.opacity = 0.034;
gridMaterialRef.needsUpdate = true;
}
ambientLightRef?.color.copy(sceneAmbientLightColor);
dirLightRef?.color.copy(sceneKeyLightColor);
sideLightRef?.color.copy(sceneAccentLightColor);
}
$: applySceneTheme();
onMount(() => { onMount(() => {
if (!viewerEl || !canvasEl || !overlayEl) { if (!viewerEl || !canvasEl || !overlayEl) {
@@ -251,8 +340,9 @@
alpha: true, alpha: true,
powerPreference: "high-performance" powerPreference: "high-performance"
}); });
rendererRef = renderer;
renderer.setPixelRatio(Math.min(window.devicePixelRatio || 1, 2)); renderer.setPixelRatio(Math.min(window.devicePixelRatio || 1, 2));
renderer.setClearColor(0x06080a, 1); renderer.setClearColor(sceneClearColor, 1);
renderer.outputColorSpace = THREE.SRGBColorSpace; renderer.outputColorSpace = THREE.SRGBColorSpace;
const scene = new THREE.Scene(); const scene = new THREE.Scene();
@@ -277,11 +367,14 @@
controls.target.set(CAMERA_TARGET_X, CAMERA_TARGET_Y, CAMERA_TARGET_Z); controls.target.set(CAMERA_TARGET_X, CAMERA_TARGET_Y, CAMERA_TARGET_Z);
controls.enabled = false; controls.enabled = false;
const ambientLight = new THREE.AmbientLight(0xffffff, 0.26); const ambientLight = new THREE.AmbientLight(sceneAmbientLightColor, 0.26);
const dirLight = new THREE.DirectionalLight(0xffffff, 0.34); const dirLight = new THREE.DirectionalLight(sceneKeyLightColor, 0.34);
dirLight.position.set(50, 100, 50); dirLight.position.set(50, 100, 50);
const sideLight = new THREE.DirectionalLight(0x7cffba, 0.16); const sideLight = new THREE.DirectionalLight(sceneAccentLightColor, 0.16);
sideLight.position.set(-50, 50, -50); sideLight.position.set(-50, 50, -50);
ambientLightRef = ambientLight;
dirLightRef = dirLight;
sideLightRef = sideLight;
scene.add(ambientLight, dirLight, sideLight); scene.add(ambientLight, dirLight, sideLight);
const matrixGroup = new THREE.Group(); const matrixGroup = new THREE.Group();
@@ -292,29 +385,33 @@
const board = new THREE.Mesh( const board = new THREE.Mesh(
new THREE.PlaneGeometry(boardWidth + boardPadding * 2, boardDepth + boardPadding * 2), new THREE.PlaneGeometry(boardWidth + boardPadding * 2, boardDepth + boardPadding * 2),
new THREE.MeshBasicMaterial({ new THREE.MeshBasicMaterial({
color: 0x05070a, color: sceneBoardColor,
transparent: true, transparent: true,
opacity: 0.12, opacity: 0.12,
toneMapped: false toneMapped: false
}) })
); );
boardMaterialRef = board.material;
board.rotation.x = -Math.PI / 2; board.rotation.x = -Math.PI / 2;
board.position.y = -0.04; board.position.y = -0.04;
matrixGroup.add(board); matrixGroup.add(board);
const grid = new THREE.GridHelper(gridSpan, gridDivisions, 0x1a2630, 0x0a1015); const grid = new THREE.GridHelper(gridSpan, gridDivisions, sceneGridCenterColor, sceneGridLineColor);
gridRef = grid;
grid.position.y = 0; grid.position.y = 0;
const gridMaterial = grid.material; const gridMaterial = grid.material;
gridMaterialRef = gridMaterial;
if (Array.isArray(gridMaterial)) { if (Array.isArray(gridMaterial)) {
for (const material of gridMaterial) { for (const material of gridMaterial) {
material.transparent = true; material.transparent = true;
material.opacity = 0.028; material.opacity = 0.034;
} }
} else { } else {
gridMaterial.transparent = true; gridMaterial.transparent = true;
gridMaterial.opacity = 0.028; gridMaterial.opacity = 0.034;
} }
matrixGroup.add(grid); matrixGroup.add(grid);
applySceneTheme();
const cellX = new Float32Array(instanceCount); const cellX = new Float32Array(instanceCount);
const cellZ = new Float32Array(instanceCount); const cellZ = new Float32Array(instanceCount);
@@ -377,14 +474,14 @@
overlayContext.font = `600 ${glyphSize.toFixed(1)}px "JetBrains Mono", "IBM Plex Mono", "Consolas", monospace`; overlayContext.font = `600 ${glyphSize.toFixed(1)}px "JetBrains Mono", "IBM Plex Mono", "Consolas", monospace`;
overlayContext.shadowBlur = glowBlur; overlayContext.shadowBlur = glowBlur;
overlayContext.shadowColor = labelPalette[bucket]; overlayContext.shadowColor = labelGlowPalette[bucket];
overlayContext.fillStyle = labelPalette[bucket]; overlayContext.fillStyle = labelPalette[bucket];
overlayContext.globalAlpha = displayValue === 0 ? 0.86 : 1; overlayContext.globalAlpha = displayValue === 0 ? 0.86 : 1;
overlayContext.fillText(displayText, screenX, screenY); overlayContext.fillText(displayText, screenX, screenY);
if (normalized >= 0.8) { if (normalized >= 0.8) {
overlayContext.fillStyle = "rgb(255 245 220)"; overlayContext.fillStyle = labelHighlightCss;
overlayContext.globalAlpha = smoothstep(0.8, 1, normalized) * 0.34; overlayContext.globalAlpha = smoothstep(0.8, 1, normalized) * 0.34;
overlayContext.fillText(displayText, screenX, screenY); overlayContext.fillText(displayText, screenX, screenY);
} }
@@ -493,11 +590,18 @@
gridMaterial.dispose(); gridMaterial.dispose();
} }
renderer.dispose(); renderer.dispose();
rendererRef = null;
boardMaterialRef = null;
gridRef = null;
gridMaterialRef = null;
ambientLightRef = null;
dirLightRef = null;
sideLightRef = null;
}; };
}); });
</script> </script>
<div class="viewer-root" bind:this={viewerEl}> <div class="viewer-root" bind:this={viewerEl} style={viewerThemeStyle}>
<canvas class="viewer-canvas" bind:this={canvasEl} aria-label="Pressure Matrix Viewer"></canvas> <canvas class="viewer-canvas" bind:this={canvasEl} aria-label="Pressure Matrix Viewer"></canvas>
<canvas class="viewer-overlay" bind:this={overlayEl} aria-hidden="true"></canvas> <canvas class="viewer-overlay" bind:this={overlayEl} aria-hidden="true"></canvas>
@@ -532,9 +636,9 @@
inset: 0; inset: 0;
overflow: hidden; overflow: hidden;
background: background:
radial-gradient(circle at 50% 58%, rgb(72 127 255 / 0.065), transparent 32%), radial-gradient(circle at 50% 58%, rgb(var(--matrix-glow-rgb) / 0.11), transparent 32%),
radial-gradient(circle at 50% 12%, rgb(151 231 255 / 0.05), transparent 26%), radial-gradient(circle at 50% 12%, rgb(var(--matrix-glow-alt-rgb) / 0.09), transparent 26%),
linear-gradient(180deg, rgb(10 13 17 / 0.82), rgb(5 7 10 / 0.96)); linear-gradient(180deg, color-mix(in srgb, var(--matrix-bg-10) 84%, transparent), color-mix(in srgb, var(--matrix-bg-30) 96%, black 4%));
} }
.viewer-canvas, .viewer-canvas,
@@ -563,7 +667,14 @@
} }
.viewer-noise { .viewer-noise {
background: repeating-linear-gradient(180deg, rgb(124 165 216 / 0.02) 0, rgb(124 165 216 / 0.02) 1px, transparent 1px, transparent 3px); background:
repeating-linear-gradient(
180deg,
rgb(var(--matrix-glow-alt-rgb) / 0.025) 0,
rgb(var(--matrix-glow-alt-rgb) / 0.025) 1px,
transparent 1px,
transparent 3px
);
} }
.viewer-controls { .viewer-controls {
@@ -580,17 +691,19 @@
display: grid; display: grid;
gap: 0.58rem; gap: 0.58rem;
padding: 0.74rem 0.84rem 0.82rem; padding: 0.74rem 0.84rem 0.82rem;
border: 1px solid rgb(86 151 118 / 0.32); border: 1px solid rgb(var(--matrix-border-rgb) / 0.32);
border-radius: 0.76rem; border-radius: 0.76rem;
background: linear-gradient(180deg, rgb(7 17 14 / 0.9), rgb(5 10 9 / 0.84)); background: linear-gradient(180deg, rgb(var(--matrix-surface-alt-rgb) / 0.92), rgb(var(--matrix-surface-deep-rgb) / 0.86));
box-shadow: inset 0 1px 0 rgb(171 224 197 / 0.08), 0 0 24px rgb(42 138 88 / 0.08); box-shadow:
inset 0 1px 0 rgb(var(--matrix-border-strong-rgb) / 0.08),
0 0 24px rgb(var(--matrix-glow-rgb) / 0.08);
} }
.stats-label, .stats-label,
.stats-key, .stats-key,
.stats-note { .stats-note {
margin: 0; margin: 0;
color: rgb(165 212 187 / 0.84); color: rgb(var(--matrix-text-dim-rgb) / 0.84);
font-size: 0.58rem; font-size: 0.58rem;
letter-spacing: 0.12em; letter-spacing: 0.12em;
text-transform: uppercase; text-transform: uppercase;
@@ -607,9 +720,9 @@
gap: 0.24rem; gap: 0.24rem;
min-height: 4.2rem; min-height: 4.2rem;
padding: 0.58rem 0.64rem; padding: 0.58rem 0.64rem;
border: 1px solid rgb(71 122 96 / 0.24); border: 1px solid rgb(var(--matrix-border-rgb) / 0.24);
border-radius: 0.56rem; border-radius: 0.56rem;
background: linear-gradient(180deg, rgb(8 16 14 / 0.88), rgb(5 9 8 / 0.84)); background: linear-gradient(180deg, rgb(var(--matrix-surface-rgb) / 0.9), rgb(var(--matrix-surface-deep-rgb) / 0.86));
} }
.stats-card-wide { .stats-card-wide {
@@ -617,7 +730,7 @@
} }
.stats-value { .stats-value {
color: rgb(240 246 255 / 0.98); color: rgb(var(--matrix-text-main-rgb) / 0.98);
font-size: clamp(1.16rem, 1vw + 0.82rem, 1.56rem); font-size: clamp(1.16rem, 1vw + 0.82rem, 1.56rem);
line-height: 1; line-height: 1;
font-weight: 600; font-weight: 600;

View File

@@ -162,16 +162,16 @@
aspect-ratio: 1.44 / 1; aspect-ratio: 1.44 / 1;
min-block-size: 11.8rem; min-block-size: 11.8rem;
justify-self: start; justify-self: start;
border: 1px solid rgb(130 174 202 / 0.42); border: 1px solid rgb(var(--hud-border-strong-rgb) / 0.42);
border-radius: 0.92rem; border-radius: 0.92rem;
padding: 0.56rem 0.62rem 0.58rem; padding: 0.56rem 0.62rem 0.58rem;
background: background:
linear-gradient(160deg, rgb(10 18 26 / 0.76) 0%, rgb(3 8 12 / 0.62) 48%, rgb(1 2 4 / 0.76) 100%), linear-gradient(160deg, rgb(var(--hud-surface-alt-rgb) / 0.76) 0%, rgb(var(--hud-surface-rgb) / 0.62) 48%, rgb(var(--hud-surface-deep-rgb) / 0.76) 100%),
radial-gradient(circle at 12% 0, rgb(62 232 255 / 0.1), transparent 40%); radial-gradient(circle at 12% 0, rgb(var(--hud-glow-rgb) / 0.1), transparent 40%);
box-shadow: box-shadow:
inset 0 0 0 1px rgb(165 224 255 / 0.08), inset 0 0 0 1px rgb(var(--hud-border-strong-rgb) / 0.08),
inset 0 -24px 32px rgb(0 0 0 / 0.48), inset 0 -24px 32px rgb(0 0 0 / 0.48),
0 0 14px rgb(62 232 255 / 0.14); 0 0 14px rgb(var(--hud-glow-rgb) / 0.14);
opacity: 1; opacity: 1;
transform: translateX(0) scale(1) rotate(0); transform: translateX(0) scale(1) rotate(0);
transition: transition:
@@ -215,7 +215,7 @@
.panel-code { .panel-code {
margin: 0; margin: 0;
font-size: 0.63rem; font-size: 0.63rem;
color: rgb(153 188 211 / 0.88); color: rgb(var(--hud-text-dim-rgb) / 0.88);
letter-spacing: 0.12em; letter-spacing: 0.12em;
text-transform: uppercase; text-transform: uppercase;
} }
@@ -223,7 +223,7 @@
.panel-title { .panel-title {
margin: 0.12rem 0 0; margin: 0.12rem 0 0;
font-size: 0.75rem; font-size: 0.75rem;
color: rgb(225 243 255 / 0.96); color: rgb(var(--hud-text-main-rgb) / 0.96);
letter-spacing: 0.05em; letter-spacing: 0.05em;
} }
@@ -236,25 +236,25 @@
} }
.icon-chip { .icon-chip {
border: 1px solid rgb(138 178 204 / 0.44); border: 1px solid rgb(var(--hud-border-strong-rgb) / 0.44);
border-radius: 999px; border-radius: 999px;
padding: 0.08rem 0.36rem; padding: 0.08rem 0.36rem;
font-size: 0.58rem; font-size: 0.58rem;
letter-spacing: 0.08em; letter-spacing: 0.08em;
color: rgb(209 237 255 / 0.94); color: rgb(var(--hud-text-main-rgb) / 0.94);
background: rgb(5 13 20 / 0.66); background: rgb(var(--hud-surface-rgb) / 0.66);
} }
.icon-chip.tone-cyan { .icon-chip.tone-cyan {
border-color: rgb(62 232 255 / 0.54); border-color: rgb(var(--hud-cyan-rgb) / 0.54);
} }
.icon-chip.tone-lime { .icon-chip.tone-lime {
border-color: rgb(133 255 68 / 0.56); border-color: rgb(var(--hud-lime-rgb) / 0.56);
} }
.icon-chip.tone-orange { .icon-chip.tone-orange {
border-color: rgb(255 91 63 / 0.58); border-color: rgb(var(--hud-orange-rgb) / 0.58);
} }
.icon-chip.tone-violet { .icon-chip.tone-violet {
@@ -272,12 +272,12 @@
.chart-stage { .chart-stage {
position: relative; position: relative;
block-size: clamp(6.4rem, 9vw, 8.2rem); block-size: clamp(6.4rem, 9vw, 8.2rem);
border: 1px solid rgb(132 174 200 / 0.32); border: 1px solid rgb(var(--hud-border-strong-rgb) / 0.32);
border-radius: 0.62rem; border-radius: 0.62rem;
overflow: hidden; overflow: hidden;
background: background:
linear-gradient(180deg, rgb(8 17 26 / 0.68), rgb(1 6 10 / 0.78)), linear-gradient(180deg, rgb(var(--hud-surface-alt-rgb) / 0.68), rgb(var(--hud-surface-deep-rgb) / 0.78)),
radial-gradient(circle at 50% 0, rgb(62 232 255 / 0.09), transparent 45%); radial-gradient(circle at 50% 0, rgb(var(--hud-glow-rgb) / 0.09), transparent 45%);
} }
svg { svg {
@@ -287,7 +287,7 @@
} }
.grid-line-group line { .grid-line-group line {
stroke: rgb(138 184 210 / 0.16); stroke: rgb(var(--hud-border-strong-rgb) / 0.16);
stroke-width: 0.45; stroke-width: 0.45;
} }
@@ -300,15 +300,15 @@
} }
.series-line.tone-cyan { .series-line.tone-cyan {
stroke: rgb(62 232 255 / 0.95); stroke: rgb(var(--hud-cyan-rgb) / 0.95);
} }
.series-line.tone-lime { .series-line.tone-lime {
stroke: rgb(133 255 68 / 0.94); stroke: rgb(var(--hud-lime-rgb) / 0.94);
} }
.series-line.tone-orange { .series-line.tone-orange {
stroke: rgb(255 91 63 / 0.94); stroke: rgb(var(--hud-orange-rgb) / 0.94);
} }
.series-line.tone-violet { .series-line.tone-violet {
@@ -329,12 +329,12 @@
background: background:
repeating-linear-gradient( repeating-linear-gradient(
180deg, 180deg,
rgb(146 191 214 / 0.04) 0, rgb(var(--hud-border-strong-rgb) / 0.04) 0,
rgb(146 191 214 / 0.04) 1px, rgb(var(--hud-border-strong-rgb) / 0.04) 1px,
transparent 1px, transparent 1px,
transparent 3px transparent 3px
), ),
linear-gradient(180deg, transparent 0%, rgb(62 232 255 / 0.06) 50%, transparent 100%); linear-gradient(180deg, transparent 0%, rgb(var(--hud-glow-rgb) / 0.06) 50%, transparent 100%);
background-size: 100% 100%, 100% 100%; background-size: 100% 100%, 100% 100%;
mix-blend-mode: screen; mix-blend-mode: screen;
pointer-events: none; pointer-events: none;
@@ -353,7 +353,7 @@
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
gap: 0.3rem; gap: 0.3rem;
color: rgb(173 206 227 / 0.9); color: rgb(var(--hud-text-main-rgb) / 0.9);
font-size: 0.62rem; font-size: 0.62rem;
letter-spacing: 0.04em; letter-spacing: 0.04em;
} }
@@ -365,19 +365,19 @@
} }
.dot.tone-cyan { .dot.tone-cyan {
background: rgb(62 232 255); background: rgb(var(--hud-cyan-rgb));
} }
.dot.tone-lime { .dot.tone-lime {
background: rgb(133 255 68); background: rgb(var(--hud-lime-rgb));
} }
.dot.tone-orange { .dot.tone-orange {
background: rgb(255 91 63); background: rgb(var(--hud-orange-rgb));
} }
.metric-label { .metric-label {
color: rgb(144 172 191 / 0.82); color: rgb(var(--hud-text-dim-rgb) / 0.82);
text-transform: uppercase; text-transform: uppercase;
letter-spacing: 0.08em; letter-spacing: 0.08em;
} }

View File

@@ -313,15 +313,15 @@
grid-template-rows: auto auto auto; grid-template-rows: auto auto auto;
gap: 0.4rem; gap: 0.4rem;
padding: 0.56rem 0.62rem 0.58rem; padding: 0.56rem 0.62rem 0.58rem;
border: 1px solid rgb(130 174 202 / 0.42); border: 1px solid rgb(var(--hud-border-strong-rgb) / 0.42);
border-radius: 0.92rem; border-radius: 0.92rem;
background: background:
linear-gradient(160deg, rgb(10 18 26 / 0.76) 0%, rgb(3 8 12 / 0.62) 48%, rgb(1 2 4 / 0.76) 100%), linear-gradient(160deg, rgb(var(--hud-surface-alt-rgb) / 0.76) 0%, rgb(var(--hud-surface-rgb) / 0.62) 48%, rgb(var(--hud-surface-deep-rgb) / 0.76) 100%),
radial-gradient(circle at 12% 0, rgb(62 232 255 / 0.1), transparent 40%); radial-gradient(circle at 12% 0, rgb(var(--hud-glow-rgb) / 0.1), transparent 40%);
box-shadow: box-shadow:
inset 0 0 0 1px rgb(165 224 255 / 0.08), inset 0 0 0 1px rgb(var(--hud-border-strong-rgb) / 0.08),
inset 0 -24px 32px rgb(0 0 0 / 0.48), inset 0 -24px 32px rgb(0 0 0 / 0.48),
0 0 14px rgb(62 232 255 / 0.14); 0 0 14px rgb(var(--hud-glow-rgb) / 0.14);
opacity: 1; opacity: 1;
transform: translateX(0) scale(1) rotate(0); transform: translateX(0) scale(1) rotate(0);
transition: transition:
@@ -360,7 +360,7 @@
.panel-code { .panel-code {
margin: 0; margin: 0;
font-size: 0.63rem; font-size: 0.63rem;
color: rgb(153 188 211 / 0.88); color: rgb(var(--hud-text-dim-rgb) / 0.88);
letter-spacing: 0.12em; letter-spacing: 0.12em;
text-transform: uppercase; text-transform: uppercase;
} }
@@ -368,7 +368,7 @@
.panel-title { .panel-title {
margin: 0.12rem 0 0; margin: 0.12rem 0 0;
font-size: 0.75rem; font-size: 0.75rem;
color: rgb(225 243 255 / 0.96); color: rgb(var(--hud-text-main-rgb) / 0.96);
letter-spacing: 0.05em; letter-spacing: 0.05em;
} }
@@ -381,36 +381,36 @@
} }
.icon-chip { .icon-chip {
border: 1px solid rgb(138 178 204 / 0.44); border: 1px solid rgb(var(--hud-border-strong-rgb) / 0.44);
border-radius: 999px; border-radius: 999px;
padding: 0.08rem 0.36rem; padding: 0.08rem 0.36rem;
font-size: 0.58rem; font-size: 0.58rem;
letter-spacing: 0.08em; letter-spacing: 0.08em;
color: rgb(209 237 255 / 0.94); color: rgb(var(--hud-text-main-rgb) / 0.94);
background: rgb(5 13 20 / 0.66); background: rgb(var(--hud-surface-rgb) / 0.66);
} }
.icon-chip.tone-cyan { .icon-chip.tone-cyan {
border-color: rgb(62 232 255 / 0.54); border-color: rgb(var(--hud-cyan-rgb) / 0.54);
} }
.icon-chip.tone-lime { .icon-chip.tone-lime {
border-color: rgb(133 255 68 / 0.56); border-color: rgb(var(--hud-lime-rgb) / 0.56);
} }
.icon-chip.tone-orange { .icon-chip.tone-orange {
border-color: rgb(255 91 63 / 0.58); border-color: rgb(var(--hud-orange-rgb) / 0.58);
} }
.chart-stage { .chart-stage {
position: relative; position: relative;
block-size: clamp(6.4rem, 9vw, 8.2rem); block-size: clamp(6.4rem, 9vw, 8.2rem);
overflow: hidden; overflow: hidden;
border: 1px solid rgb(132 174 200 / 0.32); border: 1px solid rgb(var(--hud-border-strong-rgb) / 0.32);
border-radius: 0.62rem; border-radius: 0.62rem;
background: background:
linear-gradient(180deg, rgb(8 17 26 / 0.68), rgb(1 6 10 / 0.78)), linear-gradient(180deg, rgb(var(--hud-surface-alt-rgb) / 0.68), rgb(var(--hud-surface-deep-rgb) / 0.78)),
radial-gradient(circle at 50% 0, rgb(62 232 255 / 0.09), transparent 45%); radial-gradient(circle at 50% 0, rgb(var(--hud-glow-rgb) / 0.09), transparent 45%);
} }
svg { svg {
@@ -420,7 +420,7 @@
} }
.grid-lines line { .grid-lines line {
stroke: rgb(138 184 210 / 0.16); stroke: rgb(var(--hud-border-strong-rgb) / 0.16);
stroke-width: 0.45; stroke-width: 0.45;
} }
@@ -430,20 +430,20 @@
.summary-line { .summary-line {
fill: none; fill: none;
stroke: rgb(62 232 255 / 0.96); stroke: rgb(var(--hud-cyan-rgb) / 0.96);
stroke-width: 1.35; stroke-width: 1.35;
stroke-linecap: round; stroke-linecap: round;
stroke-linejoin: round; stroke-linejoin: round;
filter: drop-shadow(0 0 4px rgb(62 232 255 / 0.22)); filter: drop-shadow(0 0 4px rgb(var(--hud-cyan-rgb) / 0.22));
} }
.summary-dot { .summary-dot {
fill: rgb(133 255 68 / 0.98); fill: rgb(var(--hud-lime-rgb) / 0.98);
filter: drop-shadow(0 0 6px rgb(133 255 68 / 0.3)); filter: drop-shadow(0 0 6px rgb(var(--hud-lime-rgb) / 0.3));
} }
.axis-label { .axis-label {
fill: rgb(176 204 222 / 0.88); fill: rgb(var(--hud-text-main-rgb) / 0.88);
font-size: 2.8px; font-size: 2.8px;
font-weight: 500; font-weight: 500;
letter-spacing: 0.02em; letter-spacing: 0.02em;
@@ -453,11 +453,11 @@
} }
.y-axis-label { .y-axis-label {
fill: rgb(162 198 220 / 0.84); fill: rgb(var(--hud-text-dim-rgb) / 0.84);
} }
.x-axis-label { .x-axis-label {
fill: rgb(162 198 220 / 0.9); fill: rgb(var(--hud-text-dim-rgb) / 0.9);
} }
.empty-state { .empty-state {
@@ -466,11 +466,11 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
color: rgb(155 186 204 / 0.76); color: rgb(var(--hud-text-dim-rgb) / 0.76);
font-size: 0.66rem; font-size: 0.66rem;
letter-spacing: 0.08em; letter-spacing: 0.08em;
text-transform: uppercase; text-transform: uppercase;
background: linear-gradient(180deg, rgb(2 7 11 / 0.06), rgb(2 7 11 / 0.18)); background: linear-gradient(180deg, rgb(var(--hud-surface-deep-rgb) / 0.06), rgb(var(--hud-surface-deep-rgb) / 0.18));
} }
.panel-foot { .panel-foot {
@@ -486,13 +486,13 @@
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
gap: 0.28rem; gap: 0.28rem;
color: rgb(173 206 227 / 0.9); color: rgb(var(--hud-text-main-rgb) / 0.9);
font-size: 0.62rem; font-size: 0.62rem;
letter-spacing: 0.04em; letter-spacing: 0.04em;
} }
.metric-text { .metric-text {
color: rgb(146 173 191 / 0.82); color: rgb(var(--hud-text-dim-rgb) / 0.82);
text-transform: uppercase; text-transform: uppercase;
} }
@@ -503,15 +503,15 @@
} }
.dot.tone-cyan { .dot.tone-cyan {
background: rgb(62 232 255); background: rgb(var(--hud-cyan-rgb));
} }
.dot.tone-lime { .dot.tone-lime {
background: rgb(133 255 68); background: rgb(var(--hud-lime-rgb));
} }
.dot.tone-orange { .dot.tone-orange {
background: rgb(255 91 63); background: rgb(var(--hud-orange-rgb));
} }
.value { .value {

View File

@@ -12,6 +12,25 @@ export interface PressureColorPalette {
labelHigh: string; labelHigh: string;
rangeStops: [string, string, string, string, string, string]; rangeStops: [string, string, string, string, string, string];
rangeGlow: [string, string, string]; rangeGlow: [string, string, string];
uiTheme: {
bg00: string;
bg10: string;
bg20: string;
bg30: string;
textMainRgb: string;
textDimRgb: string;
borderRgb: string;
borderStrongRgb: string;
surfaceRgb: string;
surfaceAltRgb: string;
surfaceDeepRgb: string;
glowRgb: string;
glowAltRgb: string;
cyanRgb: string;
limeRgb: string;
orangeRgb: string;
infoRgb: string;
};
} }
export const pressureColorPalettes: Record<PressureColorMapPreset, PressureColorPalette> = { export const pressureColorPalettes: Record<PressureColorMapPreset, PressureColorPalette> = {
@@ -26,7 +45,26 @@ export const pressureColorPalettes: Record<PressureColorMapPreset, PressureColor
labelMid: "#98e6ff", labelMid: "#98e6ff",
labelHigh: "#ffab78", labelHigh: "#ffab78",
rangeStops: ["#13201a", "#285338", "#3f8a66", "#6dd3ad", "#98e6ff", "#ffab78"], rangeStops: ["#13201a", "#285338", "#3f8a66", "#6dd3ad", "#98e6ff", "#ffab78"],
rangeGlow: ["#54df8e", "#98e6ff", "#ffab78"] rangeGlow: ["#54df8e", "#98e6ff", "#ffab78"],
uiTheme: {
bg00: "#020403",
bg10: "#07100d",
bg20: "#0c1712",
bg30: "#040806",
textMainRgb: "240 251 255",
textDimRgb: "157 206 181",
borderRgb: "88 132 116",
borderStrongRgb: "120 190 156",
surfaceRgb: "8 18 14",
surfaceAltRgb: "12 26 20",
surfaceDeepRgb: "4 10 8",
glowRgb: "84 223 142",
glowAltRgb: "152 230 255",
cyanRgb: "152 230 255",
limeRgb: "84 223 142",
orangeRgb: "255 171 120",
infoRgb: "122 198 255"
}
}, },
arctic: { arctic: {
surfaceBase: "#08141d", surfaceBase: "#08141d",
@@ -39,7 +77,26 @@ export const pressureColorPalettes: Record<PressureColorMapPreset, PressureColor
labelMid: "#aef3ff", labelMid: "#aef3ff",
labelHigh: "#ffffff", labelHigh: "#ffffff",
rangeStops: ["#08141d", "#14354d", "#1f6690", "#58bee8", "#aef3ff", "#ffffff"], rangeStops: ["#08141d", "#14354d", "#1f6690", "#58bee8", "#aef3ff", "#ffffff"],
rangeGlow: ["#5ea9ff", "#7fe5ff", "#ffffff"] rangeGlow: ["#5ea9ff", "#7fe5ff", "#ffffff"],
uiTheme: {
bg00: "#02070c",
bg10: "#07131b",
bg20: "#0d1f2b",
bg30: "#040b12",
textMainRgb: "236 248 255",
textDimRgb: "147 187 212",
borderRgb: "86 129 160",
borderStrongRgb: "129 193 228",
surfaceRgb: "7 16 24",
surfaceAltRgb: "10 23 34",
surfaceDeepRgb: "4 9 15",
glowRgb: "109 200 255",
glowAltRgb: "174 243 255",
cyanRgb: "109 200 255",
limeRgb: "174 243 255",
orangeRgb: "255 194 138",
infoRgb: "94 169 255"
}
}, },
ember: { ember: {
surfaceBase: "#1b0c08", surfaceBase: "#1b0c08",
@@ -52,6 +109,25 @@ export const pressureColorPalettes: Record<PressureColorMapPreset, PressureColor
labelMid: "#ffd06a", labelMid: "#ffd06a",
labelHigh: "#fff4df", labelHigh: "#fff4df",
rangeStops: ["#1b0c08", "#4a1f15", "#8f4124", "#d9772f", "#ffd06a", "#fff4df"], rangeStops: ["#1b0c08", "#4a1f15", "#8f4124", "#d9772f", "#ffd06a", "#fff4df"],
rangeGlow: ["#ff7247", "#ffb14d", "#fff4df"] rangeGlow: ["#ff7247", "#ffb14d", "#fff4df"],
uiTheme: {
bg00: "#0a0503",
bg10: "#140906",
bg20: "#22120c",
bg30: "#0c0504",
textMainRgb: "255 241 231",
textDimRgb: "202 156 128",
borderRgb: "144 101 77",
borderStrongRgb: "214 145 92",
surfaceRgb: "20 10 8",
surfaceAltRgb: "32 15 11",
surfaceDeepRgb: "13 7 6",
glowRgb: "255 138 78",
glowAltRgb: "255 208 106",
cyanRgb: "255 180 109",
limeRgb: "255 208 106",
orangeRgb: "255 108 84",
infoRgb: "255 160 96"
}
} }
}; };

View File

@@ -8,6 +8,19 @@
--hud-cyan: #3ee8ff; --hud-cyan: #3ee8ff;
--hud-lime: #85ff44; --hud-lime: #85ff44;
--hud-orange: #ff5b3f; --hud-orange: #ff5b3f;
--hud-cyan-rgb: 62 232 255;
--hud-lime-rgb: 133 255 68;
--hud-orange-rgb: 255 91 63;
--hud-info-rgb: 122 198 255;
--hud-border-rgb: 95 132 158;
--hud-border-strong-rgb: 140 184 210;
--hud-surface-rgb: 8 14 19;
--hud-surface-alt-rgb: 12 20 26;
--hud-surface-deep-rgb: 4 10 14;
--hud-glow-rgb: 62 232 255;
--hud-glow-alt-rgb: 133 255 68;
--hud-text-main-rgb: 207 231 255;
--hud-text-dim-rgb: 134 162 184;
--hud-range-0: #13201a; --hud-range-0: #13201a;
--hud-range-1: #285338; --hud-range-1: #285338;
--hud-range-2: #3f8a66; --hud-range-2: #3f8a66;
@@ -20,8 +33,8 @@
/* Keep root surface close to the main board style to avoid visible drag-edge seams. */ /* Keep root surface close to the main board style to avoid visible drag-edge seams. */
background: background:
radial-gradient(circle at 18% 8%, rgb(62 232 255 / 0.05), transparent 38%), radial-gradient(circle at 18% 8%, rgb(var(--hud-glow-rgb) / 0.05), transparent 38%),
radial-gradient(circle at 84% 14%, rgb(133 255 68 / 0.04), transparent 36%), radial-gradient(circle at 84% 14%, rgb(var(--hud-glow-alt-rgb) / 0.04), transparent 36%),
linear-gradient(165deg, var(--hud-bg-20) 0%, var(--hud-bg-10) 48%, var(--hud-bg-30) 100%); linear-gradient(165deg, var(--hud-bg-20) 0%, var(--hud-bg-10) 48%, var(--hud-bg-30) 100%);
background-color: var(--hud-bg-00); background-color: var(--hud-bg-00);
} }

View File

@@ -99,6 +99,20 @@ export interface HudCopy {
exportActionLabel: string; exportActionLabel: string;
exportingActionLabel: string; exportingActionLabel: string;
importActionLabel: string; importActionLabel: string;
fileExplorerImportTitle: string;
fileExplorerExportTitle: string;
fileExplorerPathLabel: string;
fileExplorerNameLabel: string;
fileExplorerCancelLabel: string;
fileExplorerOpenLabel: string;
fileExplorerSaveLabel: string;
fileExplorerEmptyHint: string;
fileExplorerCsvHint: string;
fileExplorerLoadingLabel: string;
fileExplorerUpLabel: string;
fileExplorerNameColumnLabel: string;
fileExplorerSizeColumnLabel: string;
fileExplorerModifiedColumnLabel: string;
replaySectionLabel: string; replaySectionLabel: string;
replayPlayLabel: string; replayPlayLabel: string;
replayPauseLabel: string; replayPauseLabel: string;
@@ -131,6 +145,11 @@ export interface SerialExportResult {
message: string; message: string;
} }
export interface SerialRecordStateResult {
hasData: boolean;
frameCount: number;
}
export interface SerialImportFrameResult { export interface SerialImportFrameResult {
data: number[]; data: number[];
dtsMs: number; dtsMs: number;
@@ -143,3 +162,23 @@ export interface SerialImportResult {
frames: SerialImportFrameResult[]; frames: SerialImportFrameResult[];
message: string; message: string;
} }
export interface FileExplorerRoot {
label: string;
path: string;
}
export interface FileExplorerEntry {
name: string;
path: string;
isDir: boolean;
sizeBytes: number | null;
modifiedMs: number | null;
}
export interface FileExplorerListResult {
currentPath: string;
parentPath: string | null;
roots: FileExplorerRoot[];
entries: FileExplorerEntry[];
}

View File

@@ -5,10 +5,14 @@
import { LogicalSize, currentMonitor, getCurrentWindow } from "@tauri-apps/api/window"; import { LogicalSize, currentMonitor, getCurrentWindow } from "@tauri-apps/api/window";
import HudPanel from "$lib/components/HudPanel.svelte"; import HudPanel from "$lib/components/HudPanel.svelte";
import CenterStage from "$lib/components/CenterStage.svelte"; import CenterStage from "$lib/components/CenterStage.svelte";
import FileExplorerModal from "$lib/components/FileExplorerModal.svelte";
import { pressureColorPalettes } from "$lib/config/color-map"; import { pressureColorPalettes } from "$lib/config/color-map";
import "$lib/styles/theme.css"; import "$lib/styles/theme.css";
import type { import type {
ConnectionState, ConnectionState,
FileExplorerEntry,
FileExplorerListResult,
FileExplorerRoot,
HudColorMapOption, HudColorMapOption,
HudCopy, HudCopy,
HudConfigLink, HudConfigLink,
@@ -21,6 +25,7 @@
LocaleCode, LocaleCode,
SerialConnectResult, SerialConnectResult,
SerialExportResult, SerialExportResult,
SerialRecordStateResult,
SerialImportResult, SerialImportResult,
SignalTone, SignalTone,
StageStatusTone, StageStatusTone,
@@ -28,6 +33,8 @@
} from "$lib/types/hud"; } from "$lib/types/hud";
type SignalPanelTemplate = Pick<HudSignalPanel, "id" | "code" | "title" | "side">; type SignalPanelTemplate = Pick<HudSignalPanel, "id" | "code" | "title" | "side">;
type FileExplorerMode = "open" | "save";
interface ReplayFrame { interface ReplayFrame {
values: number[]; values: number[];
dtsMs: number; dtsMs: number;
@@ -35,8 +42,8 @@
const copyByLocale: Record<LocaleCode, HudCopy> = { const copyByLocale: Record<LocaleCode, HudCopy> = {
"zh-CN": { "zh-CN": {
appName: "PAXINI HUD", appName: "JE-Skin",
suiteName: "PX-6AX GEN3", suiteName: "v0.1.0",
stageTitle: "WebGL2 主渲染区", stageTitle: "WebGL2 主渲染区",
stageHint: "底图与三维操作将在此区域加载", stageHint: "底图与三维操作将在此区域加载",
configPanelTitle: "参数配置", configPanelTitle: "参数配置",
@@ -65,6 +72,20 @@
exportActionLabel: "导出 CSV", exportActionLabel: "导出 CSV",
exportingActionLabel: "导出中", exportingActionLabel: "导出中",
importActionLabel: "导入 CSV", importActionLabel: "导入 CSV",
fileExplorerImportTitle: "导入 CSV 文件",
fileExplorerExportTitle: "导出 CSV 文件",
fileExplorerPathLabel: "路径",
fileExplorerNameLabel: "文件名",
fileExplorerCancelLabel: "取消",
fileExplorerOpenLabel: "打开",
fileExplorerSaveLabel: "保存",
fileExplorerEmptyHint: "当前目录下没有可用条目",
fileExplorerCsvHint: "仅显示 *.csv 文件",
fileExplorerLoadingLabel: "处理中...",
fileExplorerUpLabel: "↑ 上一级",
fileExplorerNameColumnLabel: "名称",
fileExplorerSizeColumnLabel: "大小",
fileExplorerModifiedColumnLabel: "修改时间",
replaySectionLabel: "回放", replaySectionLabel: "回放",
replayPlayLabel: "播放", replayPlayLabel: "播放",
replayPauseLabel: "暂停", replayPauseLabel: "暂停",
@@ -77,8 +98,8 @@
disconnectedLabel: "未连接" disconnectedLabel: "未连接"
}, },
"en-US": { "en-US": {
appName: "PAXINI HUD", appName: "JE-Skin",
suiteName: "PX-6AX GEN3", suiteName: "v0.1.0",
stageTitle: "WebGL2 Main Surface", stageTitle: "WebGL2 Main Surface",
stageHint: "Map texture and 3D interactions will render here", stageHint: "Map texture and 3D interactions will render here",
configPanelTitle: "Config Panel", configPanelTitle: "Config Panel",
@@ -107,6 +128,20 @@
exportActionLabel: "Export CSV", exportActionLabel: "Export CSV",
exportingActionLabel: "Exporting", exportingActionLabel: "Exporting",
importActionLabel: "Import CSV", importActionLabel: "Import CSV",
fileExplorerImportTitle: "Import CSV File",
fileExplorerExportTitle: "Export CSV File",
fileExplorerPathLabel: "Path",
fileExplorerNameLabel: "File Name",
fileExplorerCancelLabel: "Cancel",
fileExplorerOpenLabel: "Open",
fileExplorerSaveLabel: "Save",
fileExplorerEmptyHint: "No entries in this directory",
fileExplorerCsvHint: "Only *.csv files are listed",
fileExplorerLoadingLabel: "Processing...",
fileExplorerUpLabel: "↑ Up",
fileExplorerNameColumnLabel: "Name",
fileExplorerSizeColumnLabel: "Size",
fileExplorerModifiedColumnLabel: "Modified",
replaySectionLabel: "Replay", replaySectionLabel: "Replay",
replayPlayLabel: "Play", replayPlayLabel: "Play",
replayPauseLabel: "Pause", replayPauseLabel: "Pause",
@@ -162,9 +197,9 @@
let connectionNotice = ""; let connectionNotice = "";
let connectionNoticeTone: HudNoticeTone = "info"; let connectionNoticeTone: HudNoticeTone = "info";
let isExporting = false; let isExporting = false;
let deviceValue = "PX-Sense Unit"; let deviceValue = "JE-Skin-F";
let sampleRateValue = "120Hz"; let sampleRateValue = "100Hz";
let channelsValue = "8"; let channelsValue = "84";
let webglStatusTone: StageStatusTone = "warn"; let webglStatusTone: StageStatusTone = "warn";
let isWindowMaximized = false; let isWindowMaximized = false;
let activeConfigLinkId = "stream-on"; let activeConfigLinkId = "stream-on";
@@ -176,7 +211,7 @@
let matrixRows = 12; let matrixRows = 12;
let matrixCols = 7; let matrixCols = 7;
let rangeMin = 0; let rangeMin = 0;
let rangeMax = 5000; let rangeMax = 16000;
let colorMapPreset: PressureColorMapPreset = "emerald"; let colorMapPreset: PressureColorMapPreset = "emerald";
let replayFrames: ReplayFrame[] = []; let replayFrames: ReplayFrame[] = [];
let replayCurrentIndex = 0; let replayCurrentIndex = 0;
@@ -186,6 +221,15 @@
let replayProgress = 0; let replayProgress = 0;
let replayFileName = ""; let replayFileName = "";
let replayTimerId: number | null = null; let replayTimerId: number | null = null;
let fileExplorerOpen = false;
let fileExplorerMode: FileExplorerMode = "open";
let fileExplorerBusy = false;
let fileExplorerCurrentPath = "";
let fileExplorerParentPath: string | null = null;
let fileExplorerEntries: FileExplorerEntry[] = [];
let fileExplorerRoots: FileExplorerRoot[] = [];
let fileExplorerSelectedPath = "";
let fileExplorerFileName = "";
$: uiCopy = copyByLocale[locale]; $: uiCopy = copyByLocale[locale];
$: configLinks = buildConfigLinks(locale, activeConfigLinkId, isConfigPanelOpen); $: configLinks = buildConfigLinks(locale, activeConfigLinkId, isConfigPanelOpen);
@@ -197,6 +241,10 @@
$: rangeScaleStyle = buildRangeScaleStyle(colorMapPreset); $: rangeScaleStyle = buildRangeScaleStyle(colorMapPreset);
$: replayHasData = replayFrames.length > 0; $: replayHasData = replayFrames.length > 0;
$: replayFrameInfo = replayHasData ? `${replayHasDisplayedFrame ? replayCurrentIndex + 1 : 0}/${replayFrames.length}` : ""; $: replayFrameInfo = replayHasData ? `${replayHasDisplayedFrame ? replayCurrentIndex + 1 : 0}/${replayFrames.length}` : "";
$: fileExplorerTitle =
fileExplorerMode === "open" ? uiCopy.fileExplorerImportTitle : uiCopy.fileExplorerExportTitle;
$: fileExplorerConfirmLabel =
fileExplorerMode === "open" ? uiCopy.fileExplorerOpenLabel : uiCopy.fileExplorerSaveLabel;
function isTauriRuntime(): boolean { function isTauriRuntime(): boolean {
return typeof window !== "undefined" && "__TAURI_INTERNALS__" in window; return typeof window !== "undefined" && "__TAURI_INTERNALS__" in window;
@@ -260,8 +308,49 @@
const palette = pressureColorPalettes[preset] ?? pressureColorPalettes.emerald; const palette = pressureColorPalettes[preset] ?? pressureColorPalettes.emerald;
const [range0, range1, range2, range3, range4, range5] = palette.rangeStops; const [range0, range1, range2, range3, range4, range5] = palette.rangeStops;
const [glow0, glow1, glow2] = palette.rangeGlow; const [glow0, glow1, glow2] = palette.rangeGlow;
const {
bg00,
bg10,
bg20,
bg30,
textMainRgb,
textDimRgb,
borderRgb,
borderStrongRgb,
surfaceRgb,
surfaceAltRgb,
surfaceDeepRgb,
glowRgb,
glowAltRgb,
cyanRgb,
limeRgb,
orangeRgb,
infoRgb
} = palette.uiTheme;
return [ return [
`--hud-bg-00: ${bg00}`,
`--hud-bg-10: ${bg10}`,
`--hud-bg-20: ${bg20}`,
`--hud-bg-30: ${bg30}`,
`--hud-text-main-rgb: ${textMainRgb}`,
`--hud-text-dim-rgb: ${textDimRgb}`,
`--hud-text-main: rgb(${textMainRgb})`,
`--hud-text-dim: rgb(${textDimRgb})`,
`--hud-border-rgb: ${borderRgb}`,
`--hud-border-strong-rgb: ${borderStrongRgb}`,
`--hud-surface-rgb: ${surfaceRgb}`,
`--hud-surface-alt-rgb: ${surfaceAltRgb}`,
`--hud-surface-deep-rgb: ${surfaceDeepRgb}`,
`--hud-glow-rgb: ${glowRgb}`,
`--hud-glow-alt-rgb: ${glowAltRgb}`,
`--hud-cyan-rgb: ${cyanRgb}`,
`--hud-lime-rgb: ${limeRgb}`,
`--hud-orange-rgb: ${orangeRgb}`,
`--hud-info-rgb: ${infoRgb}`,
`--hud-cyan: rgb(${cyanRgb})`,
`--hud-lime: rgb(${limeRgb})`,
`--hud-orange: rgb(${orangeRgb})`,
`--hud-range-0: ${range0}`, `--hud-range-0: ${range0}`,
`--hud-range-1: ${range1}`, `--hud-range-1: ${range1}`,
`--hud-range-2: ${range2}`, `--hud-range-2: ${range2}`,
@@ -353,6 +442,209 @@
return frames; return frames;
} }
function buildDefaultExportName(): string {
const now = new Date();
const pad = (value: number) => String(value).padStart(2, "0");
return `joyson_export_${now.getFullYear()}${pad(now.getMonth() + 1)}${pad(now.getDate())}_${pad(now.getHours())}${pad(now.getMinutes())}${pad(now.getSeconds())}.csv`;
}
function ensureCsvSuffix(fileName: string): string {
const trimmed = fileName.trim();
if (!trimmed) {
return "";
}
return trimmed.toLowerCase().endsWith(".csv") ? trimmed : `${trimmed}.csv`;
}
function inferPathSeparator(path: string): string {
return path.includes("\\") ? "\\" : "/";
}
function joinPath(parent: string, fileName: string): string {
const safeParent = parent.trim();
if (!safeParent) {
return fileName;
}
const separator = inferPathSeparator(safeParent);
if (safeParent.endsWith(separator)) {
return `${safeParent}${fileName}`;
}
return `${safeParent}${separator}${fileName}`;
}
function isCsvPath(path: string): boolean {
return path.toLowerCase().endsWith(".csv");
}
function applyImportedFrames(fileName: string, frames: ReplayFrame[], frameCount: number, channelCount: number): void {
if (!frames.length) {
throw new Error("EmptyReplayData");
}
replayFrames = frames;
replayFileName = fileName;
replayCurrentIndex = 0;
replayHasDisplayedFrame = false;
replayProgress = 0;
resetReplayVisualState();
connectionNotice =
locale === "zh-CN"
? `已导入 ${fileName},共 ${frameCount} 帧 / ${channelCount} 通道,可开始回放。`
: `${fileName} loaded (${frameCount} frames / ${channelCount} channels). Ready to replay.`;
connectionNoticeTone = "ok";
}
async function loadFileExplorerDirectory(path?: string): Promise<void> {
if (!isTauriRuntime()) {
return;
}
fileExplorerBusy = true;
try {
const result = await invoke<FileExplorerListResult>("file_explorer_list", {
path,
extensions: fileExplorerMode === "open" ? ["csv"] : undefined
});
fileExplorerCurrentPath = result.currentPath;
fileExplorerParentPath = result.parentPath;
fileExplorerRoots = result.roots;
fileExplorerEntries = result.entries;
const selectedExists = fileExplorerEntries.some((entry) => entry.path === fileExplorerSelectedPath);
if (!selectedExists) {
fileExplorerSelectedPath = "";
}
} catch (error) {
connectionNotice =
locale === "zh-CN" ? "文件浏览器加载失败,请检查目录权限。" : "File explorer failed to load. Check directory permissions.";
connectionNoticeTone = "warn";
console.error("File explorer load failed:", error);
} finally {
fileExplorerBusy = false;
}
}
async function openFileExplorer(mode: FileExplorerMode): Promise<void> {
if (!isTauriRuntime()) {
if (mode === "open") {
await importViaBrowserInput();
return;
}
await runSerialExport();
return;
}
fileExplorerMode = mode;
fileExplorerOpen = true;
fileExplorerBusy = false;
fileExplorerSelectedPath = "";
if (mode === "save") {
fileExplorerFileName = buildDefaultExportName();
} else {
fileExplorerFileName = "";
}
await loadFileExplorerDirectory(fileExplorerCurrentPath || undefined);
}
function closeFileExplorer(): void {
if (fileExplorerBusy) {
return;
}
fileExplorerOpen = false;
}
async function importViaBrowserInput(): Promise<void> {
if (typeof document === "undefined") {
return;
}
const input = document.createElement("input");
input.type = "file";
input.accept = ".csv,text/csv";
const selectedFile = await new Promise<File | null>((resolve) => {
input.onchange = () => resolve(input.files?.[0] ?? null);
input.click();
});
if (!selectedFile) {
return;
}
await importReplayFromFile(selectedFile);
}
async function importReplayFromFile(file: File): Promise<boolean> {
if (!file) {
return false;
}
pauseReplayPlayback();
try {
const text = await file.text();
let frames: ReplayFrame[] = [];
let importedFrameCount = 0;
let importedChannelCount = 0;
if (isTauriRuntime()) {
const result = await invoke<SerialImportResult>("serial_import_csv", {
fileName: file.name,
csvContent: text
});
frames = result.frames.map((frame) => ({
values: frame.data,
dtsMs: frame.dtsMs
}));
importedFrameCount = result.frameCount;
importedChannelCount = result.channelCount;
} else {
frames = parseReplayCsv(text);
importedFrameCount = frames.length;
importedChannelCount = frames[0]?.values.length ?? 0;
}
applyImportedFrames(file.name, frames, importedFrameCount, importedChannelCount);
return true;
} catch (error) {
connectionNotice = resolveImportNotice(error);
connectionNoticeTone = "warn";
console.error("Replay import failed:", error);
return false;
}
}
async function importReplayFromPath(path: string): Promise<boolean> {
pauseReplayPlayback();
try {
const result = await invoke<SerialImportResult>("serial_import_csv_from_path", {
filePath: path
});
const frames = result.frames.map((frame) => ({
values: frame.data,
dtsMs: frame.dtsMs
}));
applyImportedFrames(result.fileName, frames, result.frameCount, result.channelCount);
return true;
} catch (error) {
connectionNotice = resolveImportNotice(error);
connectionNoticeTone = "warn";
console.error("Replay import failed:", error);
return false;
}
}
function stopReplayTimer(): void { function stopReplayTimer(): void {
if (replayTimerId == null || typeof window === "undefined") { if (replayTimerId == null || typeof window === "undefined") {
return; return;
@@ -364,11 +656,10 @@
function frameValuesToMatrix(values: number[]): number[] { function frameValuesToMatrix(values: number[]): number[] {
const totalCells = Math.max(matrixRows * matrixCols, 1); const totalCells = Math.max(matrixRows * matrixCols, 1);
const matrix = new Array<number>(totalCells).fill(0); const matrix = new Array<number>(totalCells).fill(0);
const maxRawValue = Math.max(rangeMax, 5000);
for (let index = 0; index < totalCells; index += 1) { for (let index = 0; index < totalCells; index += 1) {
const value = Number(values[index] ?? 0); const value = Number(values[index] ?? 0);
matrix[index] = clamp(Number.isFinite(value) ? value : 0, 0, maxRawValue); matrix[index] = Number.isFinite(value) ? value : 0;
} }
return matrix; return matrix;
@@ -980,81 +1271,118 @@
} }
} }
async function handleSerialExport(): Promise<void> { async function runSerialExport(filePath?: string): Promise<boolean> {
if (!isTauriRuntime()) { if (!isTauriRuntime()) {
console.warn("[serial] Export is only available inside Tauri."); connectionNotice =
return; locale === "zh-CN" ? "当前环境不支持导出到本地路径。" : "Current runtime cannot export to local paths.";
connectionNoticeTone = "warn";
return false;
} }
isExporting = true; isExporting = true;
fileExplorerBusy = true;
try { try {
const result = await invoke<SerialExportResult>("serial_export_csv"); const result = filePath
? await invoke<SerialExportResult>("serial_export_csv_to_path", { filePath })
: await invoke<SerialExportResult>("serial_export_csv");
connectionNotice = connectionNotice =
locale === "zh-CN" locale === "zh-CN"
? `CSV 导出成功(${result.frameCount} 帧):${result.path}` ? `CSV 导出成功(${result.frameCount} 帧):${result.path}`
: `CSV exported (${result.frameCount} frames): ${result.path}`; : `CSV exported (${result.frameCount} frames): ${result.path}`;
connectionNoticeTone = "ok"; connectionNoticeTone = "ok";
return true;
} catch (error) { } catch (error) {
connectionNotice = resolveExportNotice(error); connectionNotice = resolveExportNotice(error);
connectionNoticeTone = "warn"; connectionNoticeTone = "warn";
console.error("Serial export failed:", error); console.error("Serial export failed:", error);
return false;
} finally { } finally {
isExporting = false; isExporting = false;
fileExplorerBusy = false;
} }
} }
async function handleReplayImport(event: CustomEvent<File>): Promise<void> { async function precheckExportRecordData(): Promise<boolean> {
const file = event.detail; if (!isTauriRuntime()) {
if (!file) { return true;
}
try {
const result = await invoke<SerialRecordStateResult>("serial_has_record_data");
if (result.hasData) {
return true;
}
connectionNotice = resolveExportNotice("NoRecordedData");
connectionNoticeTone = "warn";
return false;
} catch (error) {
connectionNotice = resolveExportNotice(error);
connectionNoticeTone = "warn";
console.error("Export precheck failed:", error);
return false;
}
}
async function handleSerialExportRequest(): Promise<void> {
const hasData = await precheckExportRecordData();
if (!hasData) {
return; return;
} }
pauseReplayPlayback(); await openFileExplorer("save");
try {
const text = await file.text();
let frames: ReplayFrame[];
let importedFrameCount = 0;
let importedChannelCount = 0;
if (isTauriRuntime()) {
const result = await invoke<SerialImportResult>("serial_import_csv", {
fileName: file.name,
csvContent: text
});
frames = result.frames.map((frame) => ({
values: frame.data,
dtsMs: frame.dtsMs
}));
importedFrameCount = result.frameCount;
importedChannelCount = result.channelCount;
} else {
frames = parseReplayCsv(text);
importedFrameCount = frames.length;
importedChannelCount = frames[0]?.values.length ?? 0;
} }
if (!frames.length) { async function handleReplayImportRequest(): Promise<void> {
throw new Error("EmptyReplayData"); await openFileExplorer("open");
} }
replayFrames = frames; async function handleFileExplorerNavigate(event: CustomEvent<string>): Promise<void> {
replayFileName = file.name; await loadFileExplorerDirectory(event.detail);
replayCurrentIndex = 0; }
replayHasDisplayedFrame = false;
replayProgress = 0;
resetReplayVisualState();
connectionNotice = async function handleFileExplorerConfirm(): Promise<void> {
locale === "zh-CN" if (fileExplorerBusy) {
? `已导入 ${file.name},共 ${importedFrameCount} 帧 / ${importedChannelCount} 通道,可开始回放。` return;
: `${file.name} loaded (${importedFrameCount} frames / ${importedChannelCount} channels). Ready to replay.`; }
connectionNoticeTone = "ok";
} catch (error) { if (fileExplorerMode === "open") {
connectionNotice = resolveImportNotice(error); const selected = fileExplorerEntries.find((entry) => entry.path === fileExplorerSelectedPath);
if (!selected) {
return;
}
if (selected.isDir) {
await loadFileExplorerDirectory(selected.path);
return;
}
if (!isCsvPath(selected.path)) {
connectionNotice = locale === "zh-CN" ? "请先选择 CSV 文件。" : "Please choose a CSV file.";
connectionNoticeTone = "warn"; connectionNoticeTone = "warn";
console.error("Replay import failed:", error); return;
}
fileExplorerBusy = true;
const ok = await importReplayFromPath(selected.path);
fileExplorerBusy = false;
if (ok) {
fileExplorerOpen = false;
}
return;
}
const selected = fileExplorerEntries.find((entry) => entry.path === fileExplorerSelectedPath);
const targetDir = selected?.isDir ? selected.path : fileExplorerCurrentPath;
const csvName = ensureCsvSuffix(fileExplorerFileName || buildDefaultExportName());
if (!csvName) {
return;
}
const targetPath = joinPath(targetDir, csvName);
const ok = await runSerialExport(targetPath);
if (ok) {
fileExplorerOpen = false;
} }
} }
@@ -1180,7 +1508,7 @@
}); });
</script> </script>
<main class="hud-screen"> <main class="hud-screen" style={rangeScaleStyle}>
<div class="hud-background" aria-hidden="true"> <div class="hud-background" aria-hidden="true">
<div class="hud-gradient"></div> <div class="hud-gradient"></div>
<div class="hud-vignette"></div> <div class="hud-vignette"></div>
@@ -1228,8 +1556,9 @@
on:configlink={handleConfigLink} on:configlink={handleConfigLink}
on:serialrefresh={handleSerialRefresh} on:serialrefresh={handleSerialRefresh}
on:serialconnect={handleSerialConnect} on:serialconnect={handleSerialConnect}
on:serialexport={handleSerialExport} on:serialexport={handleSerialExportRequest}
on:csvimport={handleReplayImport} on:csvimport={handleReplayImportRequest}
on:noticeclear={() => (connectionNotice = "")}
/> />
<CenterStage <CenterStage
@@ -1278,7 +1607,7 @@
on:replayclose={handleReplayClose} on:replayclose={handleReplayClose}
on:configclose={() => (isConfigPanelOpen = false)} on:configclose={() => (isConfigPanelOpen = false)}
> >
<section class="range-scale" aria-label="Signal Range" style={rangeScaleStyle}> <section class="range-scale" aria-label="Signal Range">
<p class="range-label">Range</p> <p class="range-label">Range</p>
<div class="range-track"> <div class="range-track">
{#each rangeTicks as tick} {#each rangeTicks as tick}
@@ -1288,6 +1617,33 @@
</section> </section>
</CenterStage> </CenterStage>
</div> </div>
<FileExplorerModal
open={fileExplorerOpen}
mode={fileExplorerMode}
title={fileExplorerTitle}
currentPath={fileExplorerCurrentPath}
parentPath={fileExplorerParentPath}
roots={fileExplorerRoots}
entries={fileExplorerEntries}
bind:selectedPath={fileExplorerSelectedPath}
bind:fileName={fileExplorerFileName}
pathLabel={uiCopy.fileExplorerPathLabel}
fileNameLabel={uiCopy.fileExplorerNameLabel}
cancelLabel={uiCopy.fileExplorerCancelLabel}
confirmLabel={fileExplorerConfirmLabel}
emptyHint={uiCopy.fileExplorerEmptyHint}
csvHint={uiCopy.fileExplorerCsvHint}
busyLabel={uiCopy.fileExplorerLoadingLabel}
upLabel={uiCopy.fileExplorerUpLabel}
nameColumnLabel={uiCopy.fileExplorerNameColumnLabel}
sizeColumnLabel={uiCopy.fileExplorerSizeColumnLabel}
modifiedColumnLabel={uiCopy.fileExplorerModifiedColumnLabel}
isBusy={fileExplorerBusy}
on:close={closeFileExplorer}
on:navigate={handleFileExplorerNavigate}
on:confirm={handleFileExplorerConfirm}
/>
</main> </main>
<style> <style>
@@ -1311,8 +1667,8 @@
position: absolute; position: absolute;
inset: 0; inset: 0;
background: background:
radial-gradient(circle at 14% 6%, rgb(62 232 255 / 0.07), transparent 36%), radial-gradient(circle at 14% 6%, rgb(var(--hud-glow-rgb) / 0.07), transparent 36%),
radial-gradient(circle at 86% 14%, rgb(133 255 68 / 0.05), transparent 32%), radial-gradient(circle at 86% 14%, rgb(var(--hud-glow-alt-rgb) / 0.05), transparent 32%),
linear-gradient(170deg, var(--hud-bg-20) 0%, var(--hud-bg-10) 56%, var(--hud-bg-30) 100%); linear-gradient(170deg, var(--hud-bg-20) 0%, var(--hud-bg-10) 56%, var(--hud-bg-30) 100%);
} }
@@ -1339,14 +1695,19 @@
grid-template-rows: auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
gap: clamp(0.5rem, 1.2vw, 0.95rem); gap: clamp(0.5rem, 1.2vw, 0.95rem);
padding: clamp(0.65rem, 1.75vw, 1.3rem); padding: clamp(0.65rem, 1.75vw, 1.3rem);
border: 1px solid rgb(111 150 173 / 0.2); border: 1px solid rgb(var(--hud-border-rgb) / 0.2);
border-radius: 0.9rem; border-radius: 0.9rem;
background: background:
linear-gradient(176deg, rgb(8 10 12 / 0.9) 0%, rgb(0 0 0 / 0.94) 56%, rgb(6 8 10 / 0.9) 100%), linear-gradient(
radial-gradient(circle at 18% 0%, rgb(62 232 255 / 0.05), transparent 40%), 176deg,
radial-gradient(circle at 84% 8%, rgb(133 255 68 / 0.04), transparent 36%); rgb(var(--hud-surface-alt-rgb) / 0.9) 0%,
rgb(var(--hud-surface-deep-rgb) / 0.94) 56%,
rgb(var(--hud-surface-rgb) / 0.9) 100%
),
radial-gradient(circle at 18% 0%, rgb(var(--hud-glow-rgb) / 0.05), transparent 40%),
radial-gradient(circle at 84% 8%, rgb(var(--hud-glow-alt-rgb) / 0.04), transparent 36%);
box-shadow: box-shadow:
inset 0 1px 0 rgb(197 228 245 / 0.08), inset 0 1px 0 rgb(var(--hud-border-strong-rgb) / 0.08),
inset 0 -28px 60px rgb(0 0 0 / 0.34); inset 0 -28px 60px rgb(0 0 0 / 0.34);
overflow: hidden; overflow: hidden;
} }
@@ -1356,21 +1717,21 @@
grid-template-columns: auto 1fr; grid-template-columns: auto 1fr;
align-items: center; align-items: center;
gap: 0.75rem; gap: 0.75rem;
border: 1px solid rgb(103 135 154 / 0.24); border: 1px solid rgb(var(--hud-border-rgb) / 0.24);
border-radius: 0.48rem; border-radius: 0.48rem;
padding: 0.34rem 0.52rem; padding: 0.34rem 0.52rem;
background: background:
linear-gradient(180deg, rgb(4 10 14 / 0.72), rgb(2 6 10 / 0.56)), linear-gradient(180deg, rgb(var(--hud-surface-rgb) / 0.72), rgb(var(--hud-surface-deep-rgb) / 0.56)),
radial-gradient(circle at 50% 0, rgb(62 232 255 / 0.06), transparent 52%); radial-gradient(circle at 50% 0, rgb(var(--hud-glow-rgb) / 0.06), transparent 52%);
box-shadow: box-shadow:
inset 0 1px 0 rgb(176 218 240 / 0.06), inset 0 1px 0 rgb(var(--hud-border-strong-rgb) / 0.06),
0 0 12px rgb(62 232 255 / 0.08); 0 0 12px rgb(var(--hud-glow-rgb) / 0.08);
pointer-events: none; pointer-events: none;
} }
.range-label { .range-label {
margin: 0; margin: 0;
color: rgb(146 170 187 / 0.82); color: rgb(var(--hud-text-dim-rgb) / 0.82);
font-size: 0.56rem; font-size: 0.56rem;
letter-spacing: 0.1em; letter-spacing: 0.1em;
text-transform: uppercase; text-transform: uppercase;
@@ -1383,9 +1744,9 @@
grid-template-columns: repeat(11, minmax(0, 1fr)); grid-template-columns: repeat(11, minmax(0, 1fr));
gap: 0.26rem; gap: 0.26rem;
padding: 0.28rem 0.36rem 0.16rem; padding: 0.28rem 0.36rem 0.16rem;
border: 1px solid rgb(131 181 200 / 0.14); border: 1px solid rgb(var(--hud-border-strong-rgb) / 0.14);
border-radius: 999px; border-radius: 999px;
background: rgb(6 13 16 / 0.34); background: rgb(var(--hud-surface-rgb) / 0.34);
overflow: hidden; overflow: hidden;
} }
@@ -1405,9 +1766,9 @@
color-mix(in srgb, var(--hud-range-4) 96%, black) 84%, color-mix(in srgb, var(--hud-range-4) 96%, black) 84%,
color-mix(in srgb, var(--hud-range-5) 94%, black) 100% color-mix(in srgb, var(--hud-range-5) 94%, black) 100%
), ),
linear-gradient(180deg, rgb(255 255 255 / 0.06), transparent 42%); linear-gradient(180deg, rgb(var(--hud-text-main-rgb) / 0.06), transparent 42%);
box-shadow: box-shadow:
inset 0 1px 0 rgb(255 255 255 / 0.1), inset 0 1px 0 rgb(var(--hud-text-main-rgb) / 0.1),
inset 0 -10px 18px rgb(0 0 0 / 0.18); inset 0 -10px 18px rgb(0 0 0 / 0.18);
opacity: 0.94; opacity: 0.94;
} }
@@ -1433,12 +1794,12 @@
position: relative; position: relative;
z-index: 1; z-index: 1;
padding-block-start: 0.36rem; padding-block-start: 0.36rem;
color: rgb(230 243 252 / 0.96); color: rgb(var(--hud-text-main-rgb) / 0.96);
font-size: 0.56rem; font-size: 0.56rem;
text-align: center; text-align: center;
text-shadow: text-shadow:
0 1px 0 rgb(0 0 0 / 0.46), 0 1px 0 rgb(0 0 0 / 0.46),
0 0 12px rgb(10 18 24 / 0.4); 0 0 12px rgb(var(--hud-surface-alt-rgb) / 0.4);
} }
.range-tick::before { .range-tick::before {
@@ -1449,8 +1810,8 @@
inline-size: 1px; inline-size: 1px;
block-size: 0.24rem; block-size: 0.24rem;
transform: translateX(-50%); transform: translateX(-50%);
background: rgb(234 247 255 / 0.74); background: rgb(var(--hud-text-main-rgb) / 0.74);
box-shadow: 0 0 8px rgb(62 232 255 / 0.22); box-shadow: 0 0 8px rgb(var(--hud-glow-rgb) / 0.22);
} }
@media (max-width: 760px) { @media (max-width: 760px) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="26.6" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 308"><path fill="#FF3E00" d="M239.682 40.707C211.113-.182 154.69-12.301 113.895 13.69L42.247 59.356a82.198 82.198 0 0 0-37.135 55.056a86.566 86.566 0 0 0 8.536 55.576a82.425 82.425 0 0 0-12.296 30.719a87.596 87.596 0 0 0 14.964 66.244c28.574 40.893 84.997 53.007 125.787 27.016l71.648-45.664a82.182 82.182 0 0 0 37.135-55.057a86.601 86.601 0 0 0-8.53-55.577a82.409 82.409 0 0 0 12.29-30.718a87.573 87.573 0 0 0-14.963-66.244"></path><path fill="#FFF" d="M106.889 270.841c-23.102 6.007-47.497-3.036-61.103-22.648a52.685 52.685 0 0 1-9.003-39.85a49.978 49.978 0 0 1 1.713-6.693l1.35-4.115l3.671 2.697a92.447 92.447 0 0 0 28.036 14.007l2.663.808l-.245 2.659a16.067 16.067 0 0 0 2.89 10.656a17.143 17.143 0 0 0 18.397 6.828a15.786 15.786 0 0 0 4.403-1.935l71.67-45.672a14.922 14.922 0 0 0 6.734-9.977a15.923 15.923 0 0 0-2.713-12.011a17.156 17.156 0 0 0-18.404-6.832a15.78 15.78 0 0 0-4.396 1.933l-27.35 17.434a52.298 52.298 0 0 1-14.553 6.391c-23.101 6.007-47.497-3.036-61.101-22.649a52.681 52.681 0 0 1-9.004-39.849a49.428 49.428 0 0 1 22.34-33.114l71.664-45.677a52.218 52.218 0 0 1 14.563-6.398c23.101-6.007 47.497 3.036 61.101 22.648a52.685 52.685 0 0 1 9.004 39.85a50.559 50.559 0 0 1-1.713 6.692l-1.35 4.116l-3.67-2.693a92.373 92.373 0 0 0-28.037-14.013l-2.664-.809l.246-2.658a16.099 16.099 0 0 0-2.89-10.656a17.143 17.143 0 0 0-18.398-6.828a15.786 15.786 0 0 0-4.402 1.935l-71.67 45.674a14.898 14.898 0 0 0-6.73 9.975a15.9 15.9 0 0 0 2.709 12.012a17.156 17.156 0 0 0 18.404 6.832a15.841 15.841 0 0 0 4.402-1.935l27.345-17.427a52.147 52.147 0 0 1 14.552-6.397c23.101-6.006 47.497 3.037 61.102 22.65a52.681 52.681 0 0 1 9.003 39.848a49.453 49.453 0 0 1-22.34 33.12l-71.664 45.673a52.218 52.218 0 0 1-14.563 6.398"></path></svg>

Before

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -1,6 +0,0 @@
<svg width="206" height="231" viewBox="0 0 206 231" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M143.143 84C143.143 96.1503 133.293 106 121.143 106C108.992 106 99.1426 96.1503 99.1426 84C99.1426 71.8497 108.992 62 121.143 62C133.293 62 143.143 71.8497 143.143 84Z" fill="#FFC131"/>
<ellipse cx="84.1426" cy="147" rx="22" ry="22" transform="rotate(180 84.1426 147)" fill="#24C8DB"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M166.738 154.548C157.86 160.286 148.023 164.269 137.757 166.341C139.858 160.282 141 153.774 141 147C141 144.543 140.85 142.121 140.558 139.743C144.975 138.204 149.215 136.139 153.183 133.575C162.73 127.404 170.292 118.608 174.961 108.244C179.63 97.8797 181.207 86.3876 179.502 75.1487C177.798 63.9098 172.884 53.4021 165.352 44.8883C157.82 36.3744 147.99 30.2165 137.042 27.1546C126.095 24.0926 114.496 24.2568 103.64 27.6274C92.7839 30.998 83.1319 37.4317 75.8437 46.1553C74.9102 47.2727 74.0206 48.4216 73.176 49.5993C61.9292 50.8488 51.0363 54.0318 40.9629 58.9556C44.2417 48.4586 49.5653 38.6591 56.679 30.1442C67.0505 17.7298 80.7861 8.57426 96.2354 3.77762C111.685 -1.01901 128.19 -1.25267 143.769 3.10474C159.348 7.46215 173.337 16.2252 184.056 28.3411C194.775 40.457 201.767 55.4101 204.193 71.404C206.619 87.3978 204.374 103.752 197.73 118.501C191.086 133.25 180.324 145.767 166.738 154.548ZM41.9631 74.275L62.5557 76.8042C63.0459 72.813 63.9401 68.9018 65.2138 65.1274C57.0465 67.0016 49.2088 70.087 41.9631 74.275Z" fill="#FFC131"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M38.4045 76.4519C47.3493 70.6709 57.2677 66.6712 67.6171 64.6132C65.2774 70.9669 64 77.8343 64 85.0001C64 87.1434 64.1143 89.26 64.3371 91.3442C60.0093 92.8732 55.8533 94.9092 51.9599 97.4256C42.4128 103.596 34.8505 112.392 30.1816 122.756C25.5126 133.12 23.9357 144.612 25.6403 155.851C27.3449 167.09 32.2584 177.598 39.7906 186.112C47.3227 194.626 57.153 200.784 68.1003 203.846C79.0476 206.907 90.6462 206.743 101.502 203.373C112.359 200.002 122.011 193.568 129.299 184.845C130.237 183.722 131.131 182.567 131.979 181.383C143.235 180.114 154.132 176.91 164.205 171.962C160.929 182.49 155.596 192.319 148.464 200.856C138.092 213.27 124.357 222.426 108.907 227.222C93.458 232.019 76.9524 232.253 61.3736 227.895C45.7948 223.538 31.8055 214.775 21.0867 202.659C10.3679 190.543 3.37557 175.59 0.949823 159.596C-1.47592 143.602 0.768139 127.248 7.41237 112.499C14.0566 97.7497 24.8183 85.2327 38.4045 76.4519ZM163.062 156.711L163.062 156.711C162.954 156.773 162.846 156.835 162.738 156.897C162.846 156.835 162.954 156.773 163.062 156.711Z" fill="#24C8DB"/>
</svg>

Before

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -0,0 +1,3 @@
Signature: 8a477f597d28d172789f06886806bc55
# This file is a cache directory tag created by cargo.
# For information about cache directory tags see https://bford.info/cachedir/