diff --git a/package-lock.json b/package-lock.json index 81ebe28..71ff206 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "JE-Skin", - "version": "0.1.0", + "version": "0.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "JE-Skin", - "version": "0.1.0", + "version": "0.3.0", "license": "MIT", "dependencies": { "@tauri-apps/api": "^2", diff --git a/package.json b/package.json index 086aaaa..c5d429d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "JE-Skin", - "version": "0.1.0", + "version": "0.3.0", "description": "", "type": "module", "scripts": { diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index a4ab21b..5e38141 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -4,7 +4,7 @@ version = 4 [[package]] name = "JE-Skin" -version = "0.1.0" +version = "0.3.0" dependencies = [ "anyhow", "async-trait", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 6458809..4a0ef9b 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "JE-Skin" -version = "0.1.0" +version = "0.3.0" description = "A Tauri App" authors = ["you"] edition = "2021" diff --git a/src-tauri/icons/128x128.png b/src-tauri/icons/128x128.png index 1f6ee4d..0c0642d 100644 Binary files a/src-tauri/icons/128x128.png and b/src-tauri/icons/128x128.png differ diff --git a/src-tauri/icons/128x128@2x.png b/src-tauri/icons/128x128@2x.png index 1f6ee4d..257a22b 100644 Binary files a/src-tauri/icons/128x128@2x.png and b/src-tauri/icons/128x128@2x.png differ diff --git a/src-tauri/icons/16x16.png b/src-tauri/icons/16x16.png new file mode 100644 index 0000000..adb1be5 Binary files /dev/null and b/src-tauri/icons/16x16.png differ diff --git a/src-tauri/icons/192x192.png b/src-tauri/icons/192x192.png new file mode 100644 index 0000000..17aa50a Binary files /dev/null and b/src-tauri/icons/192x192.png differ diff --git a/src-tauri/icons/256x256.png b/src-tauri/icons/256x256.png new file mode 100644 index 0000000..b9a9358 Binary files /dev/null and b/src-tauri/icons/256x256.png differ diff --git a/src-tauri/icons/32x32.png b/src-tauri/icons/32x32.png index 1f6ee4d..3d3b3ea 100644 Binary files a/src-tauri/icons/32x32.png and b/src-tauri/icons/32x32.png differ diff --git a/src-tauri/icons/512x512.png b/src-tauri/icons/512x512.png new file mode 100644 index 0000000..1b6c17e Binary files /dev/null and b/src-tauri/icons/512x512.png differ diff --git a/src-tauri/icons/64x64.png b/src-tauri/icons/64x64.png new file mode 100644 index 0000000..2e2ed75 Binary files /dev/null and b/src-tauri/icons/64x64.png differ diff --git a/src-tauri/icons/Square107x107Logo.png b/src-tauri/icons/Square107x107Logo.png new file mode 100644 index 0000000..fa1a05b Binary files /dev/null and b/src-tauri/icons/Square107x107Logo.png differ diff --git a/src-tauri/icons/Square142x142Logo.png b/src-tauri/icons/Square142x142Logo.png new file mode 100644 index 0000000..1c622c5 Binary files /dev/null and b/src-tauri/icons/Square142x142Logo.png differ diff --git a/src-tauri/icons/Square150x150Logo.png b/src-tauri/icons/Square150x150Logo.png new file mode 100644 index 0000000..fb02782 Binary files /dev/null and b/src-tauri/icons/Square150x150Logo.png differ diff --git a/src-tauri/icons/Square284x284Logo.png b/src-tauri/icons/Square284x284Logo.png new file mode 100644 index 0000000..9b05d96 Binary files /dev/null and b/src-tauri/icons/Square284x284Logo.png differ diff --git a/src-tauri/icons/Square30x30Logo.png b/src-tauri/icons/Square30x30Logo.png new file mode 100644 index 0000000..03c60c8 Binary files /dev/null and b/src-tauri/icons/Square30x30Logo.png differ diff --git a/src-tauri/icons/Square310x310Logo.png b/src-tauri/icons/Square310x310Logo.png new file mode 100644 index 0000000..bb6bc22 Binary files /dev/null and b/src-tauri/icons/Square310x310Logo.png differ diff --git a/src-tauri/icons/Square44x44Logo.png b/src-tauri/icons/Square44x44Logo.png new file mode 100644 index 0000000..67f0854 Binary files /dev/null and b/src-tauri/icons/Square44x44Logo.png differ diff --git a/src-tauri/icons/Square71x71Logo.png b/src-tauri/icons/Square71x71Logo.png new file mode 100644 index 0000000..8177b57 Binary files /dev/null and b/src-tauri/icons/Square71x71Logo.png differ diff --git a/src-tauri/icons/Square89x89Logo.png b/src-tauri/icons/Square89x89Logo.png new file mode 100644 index 0000000..51a9b0f Binary files /dev/null and b/src-tauri/icons/Square89x89Logo.png differ diff --git a/src-tauri/icons/StoreLogo.png b/src-tauri/icons/StoreLogo.png new file mode 100644 index 0000000..1760d7a Binary files /dev/null and b/src-tauri/icons/StoreLogo.png differ diff --git a/src-tauri/icons/android/mipmap-anydpi-v26/ic_launcher.xml b/src-tauri/icons/android/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..2ffbf24 --- /dev/null +++ b/src-tauri/icons/android/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png b/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..afd4549 Binary files /dev/null and b/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png differ diff --git a/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png b/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..578b7e8 Binary files /dev/null and b/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png differ diff --git a/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png b/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 0000000..b93352b Binary files /dev/null and b/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png differ diff --git a/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png b/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..6a88468 Binary files /dev/null and b/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png differ diff --git a/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png b/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..e80c62e Binary files /dev/null and b/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png b/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 0000000..c9bf927 Binary files /dev/null and b/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png differ diff --git a/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png b/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..485bbc7 Binary files /dev/null and b/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png differ diff --git a/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png b/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..782cd0c Binary files /dev/null and b/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png b/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 0000000..5841da0 Binary files /dev/null and b/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png b/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..7393b6b Binary files /dev/null and b/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png differ diff --git a/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png b/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..ef058f6 Binary files /dev/null and b/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png differ diff --git a/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png b/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..d9464af Binary files /dev/null and b/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png b/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..e978cf2 Binary files /dev/null and b/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png b/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..a61c5a5 Binary files /dev/null and b/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png differ diff --git a/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png b/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..ee05cb0 Binary files /dev/null and b/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/src-tauri/icons/android/values/ic_launcher_background.xml b/src-tauri/icons/android/values/ic_launcher_background.xml new file mode 100644 index 0000000..ea9c223 --- /dev/null +++ b/src-tauri/icons/android/values/ic_launcher_background.xml @@ -0,0 +1,4 @@ + + + #fff + \ No newline at end of file diff --git a/src-tauri/icons/favicon.ico b/src-tauri/icons/favicon.ico new file mode 100644 index 0000000..3beec5a Binary files /dev/null and b/src-tauri/icons/favicon.ico differ diff --git a/src-tauri/icons/icon.icns b/src-tauri/icons/icon.icns new file mode 100644 index 0000000..c361168 Binary files /dev/null and b/src-tauri/icons/icon.icns differ diff --git a/src-tauri/icons/icon.ico b/src-tauri/icons/icon.ico index e77e6f5..74ee25d 100644 Binary files a/src-tauri/icons/icon.ico and b/src-tauri/icons/icon.ico differ diff --git a/src-tauri/icons/icon.png b/src-tauri/icons/icon.png index 1f6ee4d..8ddcf80 100644 Binary files a/src-tauri/icons/icon.png and b/src-tauri/icons/icon.png differ diff --git a/src-tauri/icons/ios/AppIcon-20x20@1x.png b/src-tauri/icons/ios/AppIcon-20x20@1x.png new file mode 100644 index 0000000..33475a8 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-20x20@1x.png differ diff --git a/src-tauri/icons/ios/AppIcon-20x20@2x-1.png b/src-tauri/icons/ios/AppIcon-20x20@2x-1.png new file mode 100644 index 0000000..2b9cfa4 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-20x20@2x-1.png differ diff --git a/src-tauri/icons/ios/AppIcon-20x20@2x.png b/src-tauri/icons/ios/AppIcon-20x20@2x.png new file mode 100644 index 0000000..2b9cfa4 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-20x20@2x.png differ diff --git a/src-tauri/icons/ios/AppIcon-20x20@3x.png b/src-tauri/icons/ios/AppIcon-20x20@3x.png new file mode 100644 index 0000000..b4180ef Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-20x20@3x.png differ diff --git a/src-tauri/icons/ios/AppIcon-29x29@1x.png b/src-tauri/icons/ios/AppIcon-29x29@1x.png new file mode 100644 index 0000000..4e4ce03 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-29x29@1x.png differ diff --git a/src-tauri/icons/ios/AppIcon-29x29@2x-1.png b/src-tauri/icons/ios/AppIcon-29x29@2x-1.png new file mode 100644 index 0000000..ba05948 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-29x29@2x-1.png differ diff --git a/src-tauri/icons/ios/AppIcon-29x29@2x.png b/src-tauri/icons/ios/AppIcon-29x29@2x.png new file mode 100644 index 0000000..ba05948 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-29x29@2x.png differ diff --git a/src-tauri/icons/ios/AppIcon-29x29@3x.png b/src-tauri/icons/ios/AppIcon-29x29@3x.png new file mode 100644 index 0000000..5c9681b Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-29x29@3x.png differ diff --git a/src-tauri/icons/ios/AppIcon-40x40@1x.png b/src-tauri/icons/ios/AppIcon-40x40@1x.png new file mode 100644 index 0000000..2b9cfa4 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-40x40@1x.png differ diff --git a/src-tauri/icons/ios/AppIcon-40x40@2x-1.png b/src-tauri/icons/ios/AppIcon-40x40@2x-1.png new file mode 100644 index 0000000..5e32279 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-40x40@2x-1.png differ diff --git a/src-tauri/icons/ios/AppIcon-40x40@2x.png b/src-tauri/icons/ios/AppIcon-40x40@2x.png new file mode 100644 index 0000000..5e32279 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-40x40@2x.png differ diff --git a/src-tauri/icons/ios/AppIcon-40x40@3x.png b/src-tauri/icons/ios/AppIcon-40x40@3x.png new file mode 100644 index 0000000..cc22254 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-40x40@3x.png differ diff --git a/src-tauri/icons/ios/AppIcon-512@2x.png b/src-tauri/icons/ios/AppIcon-512@2x.png new file mode 100644 index 0000000..d49c49e Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-512@2x.png differ diff --git a/src-tauri/icons/ios/AppIcon-60x60@2x.png b/src-tauri/icons/ios/AppIcon-60x60@2x.png new file mode 100644 index 0000000..cc22254 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-60x60@2x.png differ diff --git a/src-tauri/icons/ios/AppIcon-60x60@3x.png b/src-tauri/icons/ios/AppIcon-60x60@3x.png new file mode 100644 index 0000000..36cef14 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-60x60@3x.png differ diff --git a/src-tauri/icons/ios/AppIcon-76x76@1x.png b/src-tauri/icons/ios/AppIcon-76x76@1x.png new file mode 100644 index 0000000..a3f6e22 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-76x76@1x.png differ diff --git a/src-tauri/icons/ios/AppIcon-76x76@2x.png b/src-tauri/icons/ios/AppIcon-76x76@2x.png new file mode 100644 index 0000000..31a96d5 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-76x76@2x.png differ diff --git a/src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png b/src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png new file mode 100644 index 0000000..89e7c16 Binary files /dev/null and b/src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png differ diff --git a/src-tauri/program.log2026-04-08 b/src-tauri/program.log2026-04-08 new file mode 100644 index 0000000..9818a93 --- /dev/null +++ b/src-tauri/program.log2026-04-08 @@ -0,0 +1,306 @@ +[2026-04-08T03:07:37Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T03:07:37Z DEBUG JE_Skin] logging initialized +[2026-04-08T03:09:47Z DEBUG tao::platform_impl::platform::event_loop::runner] NewEvents emitted without explicit RedrawEventsCleared +[2026-04-08T03:09:47Z DEBUG tao::platform_impl::platform::event_loop::runner] RedrawEventsCleared emitted without explicit MainEventsCleared +[2026-04-08T03:12:49Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T03:12:49Z DEBUG JE_Skin] logging initialized +[2026-04-08T03:15:23Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T03:15:23Z DEBUG JE_Skin] logging initialized +[2026-04-08T03:15:36Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T03:15:36Z DEBUG mio_serial] switching COM5 to asynchronous mode +[2026-04-08T03:15:36Z DEBUG mio_serial] reading serial port settings +[2026-04-08T03:15:36Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T03:15:36Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T03:15:55Z INFO tauri_demo_lib::commands::serial] last_record has 1704 frames +[2026-04-08T03:16:08Z DEBUG tao::platform_impl::platform::event_loop::runner] NewEvents emitted without explicit RedrawEventsCleared +[2026-04-08T03:16:08Z DEBUG tao::platform_impl::platform::event_loop::runner] RedrawEventsCleared emitted without explicit MainEventsCleared +[2026-04-08T03:17:59Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T03:17:59Z DEBUG mio_serial] switching COM5 to asynchronous mode +[2026-04-08T03:17:59Z DEBUG mio_serial] reading serial port settings +[2026-04-08T03:17:59Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T03:17:59Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T03:18:04Z INFO tauri_demo_lib::commands::serial] last_record has 485 frames +[2026-04-08T03:18:13Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T03:18:13Z DEBUG mio_serial] switching COM5 to asynchronous mode +[2026-04-08T03:18:13Z DEBUG mio_serial] reading serial port settings +[2026-04-08T03:18:13Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T03:18:13Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T03:24:54Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T03:24:54Z DEBUG JE_Skin] logging initialized +[2026-04-08T03:25:10Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T03:25:10Z DEBUG mio_serial] switching COM5 to asynchronous mode +[2026-04-08T03:25:10Z DEBUG mio_serial] reading serial port settings +[2026-04-08T03:25:10Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T03:25:10Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T03:25:24Z INFO tauri_demo_lib::commands::serial] last_record has 1226 frames +[2026-04-08T03:30:00Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T03:30:00Z DEBUG mio_serial] switching COM5 to asynchronous mode +[2026-04-08T03:30:00Z DEBUG mio_serial] reading serial port settings +[2026-04-08T03:30:00Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T03:30:00Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T03:30:56Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T03:30:56Z DEBUG JE_Skin] logging initialized +[2026-04-08T03:31:17Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T03:31:17Z DEBUG mio_serial] switching COM1 to asynchronous mode +[2026-04-08T03:31:17Z DEBUG mio_serial] reading serial port settings +[2026-04-08T03:31:17Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T03:31:17Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T03:31:20Z INFO tauri_demo_lib::commands::serial] last_record has 0 frames +[2026-04-08T03:31:22Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T03:31:22Z DEBUG mio_serial] switching COM5 to asynchronous mode +[2026-04-08T03:31:22Z DEBUG mio_serial] reading serial port settings +[2026-04-08T03:31:22Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T03:31:22Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T03:34:36Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T03:34:36Z DEBUG JE_Skin] logging initialized +[2026-04-08T03:34:42Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T03:34:42Z DEBUG mio_serial] switching COM5 to asynchronous mode +[2026-04-08T03:34:42Z DEBUG mio_serial] reading serial port settings +[2026-04-08T03:34:42Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T03:34:42Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T03:34:47Z INFO tauri_demo_lib::commands::serial] last_record has 457 frames +[2026-04-08T03:34:55Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T03:34:55Z DEBUG mio_serial] switching COM5 to asynchronous mode +[2026-04-08T03:34:55Z DEBUG mio_serial] reading serial port settings +[2026-04-08T03:34:55Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T03:34:55Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T03:36:11Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T03:36:11Z DEBUG JE_Skin] logging initialized +[2026-04-08T03:36:25Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T03:36:25Z DEBUG mio_serial] switching COM5 to asynchronous mode +[2026-04-08T03:36:25Z DEBUG mio_serial] reading serial port settings +[2026-04-08T03:36:25Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T03:36:25Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T03:38:27Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T03:38:27Z DEBUG JE_Skin] logging initialized +[2026-04-08T03:40:51Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T03:40:51Z DEBUG JE_Skin] logging initialized +[2026-04-08T03:41:05Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T03:41:05Z DEBUG mio_serial] switching COM5 to asynchronous mode +[2026-04-08T03:41:05Z DEBUG mio_serial] reading serial port settings +[2026-04-08T03:41:05Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T03:41:05Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T03:42:25Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T03:42:25Z DEBUG JE_Skin] logging initialized +[2026-04-08T05:39:52Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T05:39:52Z DEBUG JE_Skin] logging initialized +[2026-04-08T05:41:00Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T05:41:00Z DEBUG JE_Skin] logging initialized +[2026-04-08T05:41:05Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T05:41:05Z DEBUG mio_serial] switching COM5 to asynchronous mode +[2026-04-08T05:41:05Z DEBUG mio_serial] reading serial port settings +[2026-04-08T05:41:05Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T05:41:05Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T05:44:17Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T05:44:17Z DEBUG JE_Skin] logging initialized +[2026-04-08T05:44:22Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T05:44:22Z DEBUG mio_serial] switching COM5 to asynchronous mode +[2026-04-08T05:44:22Z DEBUG mio_serial] reading serial port settings +[2026-04-08T05:44:22Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T05:44:22Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T05:48:46Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T05:48:46Z DEBUG JE_Skin] logging initialized +[2026-04-08T05:48:56Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T05:48:56Z DEBUG mio_serial] switching COM5 to asynchronous mode +[2026-04-08T05:48:56Z DEBUG mio_serial] reading serial port settings +[2026-04-08T05:48:56Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T05:48:56Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T05:51:41Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T05:51:41Z DEBUG JE_Skin] logging initialized +[2026-04-08T05:51:45Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T05:51:45Z DEBUG mio_serial] switching COM5 to asynchronous mode +[2026-04-08T05:51:45Z DEBUG mio_serial] reading serial port settings +[2026-04-08T05:51:45Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T05:51:45Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T05:52:07Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T05:52:07Z DEBUG JE_Skin] logging initialized +[2026-04-08T05:53:57Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T05:53:57Z DEBUG JE_Skin] logging initialized +[2026-04-08T05:54:02Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T05:54:02Z DEBUG mio_serial] switching COM5 to asynchronous mode +[2026-04-08T05:54:02Z DEBUG mio_serial] reading serial port settings +[2026-04-08T05:54:02Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T05:54:02Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T05:57:11Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T05:57:11Z DEBUG JE_Skin] logging initialized +[2026-04-08T05:57:23Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T05:57:23Z DEBUG mio_serial] switching COM5 to asynchronous mode +[2026-04-08T05:57:23Z DEBUG mio_serial] reading serial port settings +[2026-04-08T05:57:23Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T05:57:23Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T05:59:05Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T05:59:05Z DEBUG JE_Skin] logging initialized +[2026-04-08T05:59:21Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T05:59:21Z DEBUG mio_serial] switching COM5 to asynchronous mode +[2026-04-08T05:59:21Z DEBUG mio_serial] reading serial port settings +[2026-04-08T05:59:21Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T05:59:21Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T06:03:12Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T06:03:12Z DEBUG JE_Skin] logging initialized +[2026-04-08T06:03:33Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T06:03:33Z DEBUG mio_serial] switching COM5 to asynchronous mode +[2026-04-08T06:03:33Z DEBUG mio_serial] reading serial port settings +[2026-04-08T06:03:33Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T06:03:33Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T06:03:50Z INFO tauri_demo_lib::commands::serial] last_record has 1610 frames +[2026-04-08T06:04:02Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T06:04:02Z DEBUG mio_serial] switching COM5 to asynchronous mode +[2026-04-08T06:04:02Z DEBUG mio_serial] reading serial port settings +[2026-04-08T06:04:02Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T06:04:02Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T06:19:31Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T06:19:31Z DEBUG JE_Skin] logging initialized +[2026-04-08T06:23:22Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T06:23:22Z DEBUG JE_Skin] logging initialized +[2026-04-08T06:25:37Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T06:25:37Z DEBUG JE_Skin] logging initialized +[2026-04-08T06:26:54Z DEBUG tao::platform_impl::platform::event_loop::runner] NewEvents emitted without explicit RedrawEventsCleared +[2026-04-08T06:26:54Z DEBUG tao::platform_impl::platform::event_loop::runner] RedrawEventsCleared emitted without explicit MainEventsCleared +[2026-04-08T06:27:17Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T06:27:17Z DEBUG JE_Skin] logging initialized +[2026-04-08T06:27:26Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T06:27:26Z DEBUG JE_Skin] logging initialized +[2026-04-08T06:27:27Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T06:27:27Z DEBUG JE_Skin] logging initialized +[2026-04-08T06:27:28Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T06:27:28Z DEBUG JE_Skin] logging initialized +[2026-04-08T06:27:29Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T06:27:29Z DEBUG JE_Skin] logging initialized +[2026-04-08T06:27:30Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T06:27:30Z DEBUG JE_Skin] logging initialized +[2026-04-08T06:28:58Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T06:28:58Z DEBUG JE_Skin] logging initialized +[2026-04-08T06:29:37Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T06:29:37Z DEBUG JE_Skin] logging initialized +[2026-04-08T06:41:34Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T06:41:34Z DEBUG JE_Skin] logging initialized +[2026-04-08T06:43:41Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T06:43:41Z DEBUG JE_Skin] logging initialized +[2026-04-08T06:46:02Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T06:46:02Z DEBUG JE_Skin] logging initialized +[2026-04-08T06:47:57Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T06:47:57Z DEBUG JE_Skin] logging initialized +[2026-04-08T06:48:25Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T06:48:25Z DEBUG JE_Skin] logging initialized +[2026-04-08T07:08:08Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T07:08:08Z DEBUG JE_Skin] logging initialized +[2026-04-08T07:08:29Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T07:08:29Z DEBUG mio_serial] switching COM5 to asynchronous mode +[2026-04-08T07:08:29Z DEBUG mio_serial] reading serial port settings +[2026-04-08T07:08:29Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T07:08:29Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T07:08:33Z INFO tauri_demo_lib::commands::serial] last_record has 381 frames +[2026-04-08T07:08:42Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T07:08:42Z DEBUG mio_serial] switching COM5 to asynchronous mode +[2026-04-08T07:08:42Z DEBUG mio_serial] reading serial port settings +[2026-04-08T07:08:42Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T07:08:42Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T07:11:03Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T07:11:03Z DEBUG JE_Skin] logging initialized +[2026-04-08T07:11:12Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T07:11:12Z DEBUG mio_serial] switching COM5 to asynchronous mode +[2026-04-08T07:11:12Z DEBUG mio_serial] reading serial port settings +[2026-04-08T07:11:12Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T07:11:12Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T07:11:16Z INFO tauri_demo_lib::commands::serial] last_record has 276 frames +[2026-04-08T07:14:06Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T07:14:06Z DEBUG mio_serial] switching COM5 to asynchronous mode +[2026-04-08T07:14:06Z DEBUG mio_serial] reading serial port settings +[2026-04-08T07:14:06Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T07:14:06Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T07:14:08Z INFO tauri_demo_lib::commands::serial] last_record has 183 frames +[2026-04-08T07:16:20Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T07:16:20Z DEBUG JE_Skin] logging initialized +[2026-04-08T07:16:52Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T07:16:52Z DEBUG mio_serial] switching COM1 to asynchronous mode +[2026-04-08T07:16:52Z DEBUG mio_serial] reading serial port settings +[2026-04-08T07:16:52Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T07:16:52Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T07:16:52Z INFO tauri_demo_lib::commands::serial] last_record has 0 frames +[2026-04-08T07:16:56Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T07:16:56Z DEBUG mio_serial] switching COM5 to asynchronous mode +[2026-04-08T07:16:56Z DEBUG mio_serial] reading serial port settings +[2026-04-08T07:16:56Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T07:16:56Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T07:17:36Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T07:17:36Z DEBUG JE_Skin] logging initialized +[2026-04-08T07:17:47Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T07:17:47Z DEBUG mio_serial] switching COM1 to asynchronous mode +[2026-04-08T07:17:47Z DEBUG mio_serial] reading serial port settings +[2026-04-08T07:17:47Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T07:17:47Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T07:17:49Z INFO tauri_demo_lib::commands::serial] last_record has 0 frames +[2026-04-08T07:17:53Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T07:17:53Z DEBUG mio_serial] switching COM5 to asynchronous mode +[2026-04-08T07:17:53Z DEBUG mio_serial] reading serial port settings +[2026-04-08T07:17:53Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T07:17:53Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T07:18:08Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T07:18:08Z DEBUG JE_Skin] logging initialized +[2026-04-08T07:18:50Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T07:18:50Z DEBUG JE_Skin] logging initialized +[2026-04-08T07:18:57Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T07:18:57Z DEBUG JE_Skin] logging initialized +[2026-04-08T07:19:10Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T07:19:10Z DEBUG JE_Skin] logging initialized +[2026-04-08T07:19:14Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T07:19:14Z DEBUG mio_serial] switching COM5 to asynchronous mode +[2026-04-08T07:19:14Z DEBUG mio_serial] reading serial port settings +[2026-04-08T07:19:14Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T07:19:14Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T07:19:17Z INFO tauri_demo_lib::commands::serial] last_record has 227 frames +[2026-04-08T07:19:29Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T07:19:29Z DEBUG mio_serial] switching COM5 to asynchronous mode +[2026-04-08T07:19:29Z DEBUG mio_serial] reading serial port settings +[2026-04-08T07:19:29Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T07:19:29Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T07:19:38Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T07:19:38Z DEBUG JE_Skin] logging initialized +[2026-04-08T07:19:56Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T07:19:56Z DEBUG JE_Skin] logging initialized +[2026-04-08T07:20:10Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T07:20:10Z DEBUG mio_serial] switching COM5 to asynchronous mode +[2026-04-08T07:20:10Z DEBUG mio_serial] reading serial port settings +[2026-04-08T07:20:10Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T07:20:10Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T07:20:41Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T07:20:41Z DEBUG JE_Skin] logging initialized +[2026-04-08T07:20:46Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T07:20:46Z DEBUG mio_serial] switching COM5 to asynchronous mode +[2026-04-08T07:20:46Z DEBUG mio_serial] reading serial port settings +[2026-04-08T07:20:46Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T07:20:46Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T07:20:57Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T07:20:57Z DEBUG JE_Skin] logging initialized +[2026-04-08T07:22:12Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T07:22:12Z DEBUG JE_Skin] logging initialized +[2026-04-08T07:22:30Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T07:22:30Z DEBUG mio_serial] switching COM5 to asynchronous mode +[2026-04-08T07:22:30Z DEBUG mio_serial] reading serial port settings +[2026-04-08T07:22:30Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T07:22:30Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T07:22:38Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T07:22:38Z DEBUG JE_Skin] logging initialized +[2026-04-08T07:23:10Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T07:23:10Z DEBUG JE_Skin] logging initialized +[2026-04-08T07:23:18Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T07:23:18Z DEBUG mio_serial] switching COM5 to asynchronous mode +[2026-04-08T07:23:18Z DEBUG mio_serial] reading serial port settings +[2026-04-08T07:23:18Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T07:23:18Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T07:23:24Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T07:23:24Z DEBUG JE_Skin] logging initialized +[2026-04-08T07:33:13Z DEBUG tauri_demo_lib::log] logging initialized +[2026-04-08T07:33:13Z DEBUG JE_Skin] logging initialized +[2026-04-08T07:33:18Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T07:33:18Z DEBUG mio_serial] switching COM5 to asynchronous mode +[2026-04-08T07:33:18Z DEBUG mio_serial] reading serial port settings +[2026-04-08T07:33:18Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T07:33:18Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T07:33:24Z INFO tauri_demo_lib::commands::serial] last_record has 499 frames +[2026-04-08T07:33:31Z DEBUG mio_serial] opening serial port in synchronous blocking mode +[2026-04-08T07:33:31Z DEBUG mio_serial] switching COM5 to asynchronous mode +[2026-04-08T07:33:31Z DEBUG mio_serial] reading serial port settings +[2026-04-08T07:33:31Z DEBUG mio_serial] closing synchronous port to re-open in FILE_FLAG_OVERLAPPED mode +[2026-04-08T07:33:31Z DEBUG mio_serial] re-setting serial port parameters to original values from synchronous port +[2026-04-08T07:34:06Z INFO tauri_demo_lib::commands::serial] last_record has 3160 frames diff --git a/src-tauri/src/commands/serial.rs b/src-tauri/src/commands/serial.rs index 2441060..dc17370 100644 --- a/src-tauri/src/commands/serial.rs +++ b/src-tauri/src/commands/serial.rs @@ -77,6 +77,40 @@ pub struct SerialConnectionState { last_record: Mutex> } +pub async fn shutdown_active_session( + state: &SerialConnectionState, +) -> Result, SerialError> { + let session = { + let mut guard = state.session.lock().map_err(|_| SerialError::StateError)?; + guard.take() + }; + + let Some(SerialSession { + port, + cancel, + task, + current_record, + }) = session else { + return Ok(None); + }; + + cancel.cancel(); + let _ = task.await; + + let frame_count = current_record + .lock() + .map(|record| record.frames.len()) + .unwrap_or(0); + + info!("last_record has {} frames", frame_count); + + if let Ok(mut last_record) = state.last_record.lock() { + *last_record = Some(current_record.clone()); + } + + Ok(Some((port, current_record))) +} + #[tauri::command] pub fn serial_enum() -> Result, SerialError> { let ports = available_ports() @@ -190,17 +224,7 @@ pub async fn serial_connect( pub async fn serial_disconnect( state: State<'_, SerialConnectionState>, ) -> Result { - let session = { - let mut guard = state.session.lock().map_err(|_| SerialError::StateError)?; - guard.take() - }; - - let Some(SerialSession { - port, - cancel, - task, - current_record, - }) = session + let Some((port, _current_record)) = shutdown_active_session(&state).await? else { return Ok(SerialConnectResponse { port: String::new(), @@ -209,19 +233,6 @@ pub async fn serial_disconnect( }); }; - cancel.cancel(); - let _ = task.await; - let frame_count = current_record.lock().map(|record| { - record.frames.len() - }).unwrap_or(0); - - info!("last_record has {} frames", frame_count); - - if let Ok(mut last_record) = state.last_record.lock() { - *last_record = Some(current_record); - } - - Ok(SerialConnectResponse { port, connected: false, diff --git a/src-tauri/src/commands/window.rs b/src-tauri/src/commands/window.rs index 8b40618..e38c959 100644 --- a/src-tauri/src/commands/window.rs +++ b/src-tauri/src/commands/window.rs @@ -1,4 +1,6 @@ -use tauri::{AppHandle, Manager, WebviewWindow}; +use super::serial::SerialConnectionState; +use crate::commands::serial::shutdown_active_session; +use tauri::{AppHandle, Manager, State, WebviewWindow}; fn main_window(app: &AppHandle) -> Result { app.get_webview_window("main") @@ -25,8 +27,14 @@ pub fn win_toggle_maximize(app: AppHandle) -> Result<(), String> { } #[tauri::command] -pub fn win_close(app: AppHandle) -> Result<(), String> { - main_window(&app)? - .close() - .map_err(|error| error.to_string()) +pub async fn win_close( + app: AppHandle, + state: State<'_, SerialConnectionState>, +) -> Result<(), String> { + shutdown_active_session(&state) + .await + .map_err(|error| error.to_string())?; + + app.exit(0); + Ok(()) } diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index b9b3097..2a97fe7 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -1,6 +1,6 @@ // Prevents additional console window on Windows in release, DO NOT REMOVE!! #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] -use log::{debug, error, info, trace, warn}; +use log::debug; use tauri_demo_lib::log::setup_logger; fn main() { diff --git a/src-tauri/src/serial_core/codecs/tactile_a.rs b/src-tauri/src/serial_core/codecs/tactile_a.rs index 298831b..a8bcee0 100644 --- a/src-tauri/src/serial_core/codecs/tactile_a.rs +++ b/src-tauri/src/serial_core/codecs/tactile_a.rs @@ -18,7 +18,6 @@ const FRAME_BUFFER_MIN_LENGTH: usize = 15; pub struct TactileACodec { buffer: Vec, - frame_nb: u64, expected_data_len: usize, } @@ -65,7 +64,6 @@ impl TactileACodec { pub fn new(cols: usize, rows: usize) -> TactileACodec { Self { buffer: Vec::new(), - frame_nb: 0, expected_data_len: cols * rows * 2, } } @@ -77,7 +75,14 @@ impl TactileACodec { let vals: Vec = data .chunks_exact(2) - .map(|chunk| u16::from_le_bytes([chunk[0], chunk[1]]) as i32) + .map(|chunk| { + let raw = u16::from_le_bytes([chunk[0], chunk[1]]) as i32; + if raw < 15 { + 0 + } else { + raw + } + }) .collect::>(); Ok(vals) @@ -236,7 +241,6 @@ impl FrameHandler for TactileAHandler { match frame { TactileAFrame::Rep(rep) => { let vals = TactileACodec::parse_data_frame(&rep.payload)?; - debug!("vals is {:?}", vals); Ok(Some(vals)) } _ => Ok(None), @@ -252,7 +256,7 @@ impl TactileACsvExporter { impl CsvExporter for TactileACsvExporter { type Error = CodecError; - fn csv_header(&self, recording: &Recording) -> Vec { + fn csv_header(&self, _recording: &Recording) -> Vec { let mut header: Vec = Vec::new(); for i in 0..self.channels { header.push(format!("channel{}", i + 1)); diff --git a/src-tauri/src/serial_core/serial.rs b/src-tauri/src/serial_core/serial.rs index 8308d90..7392b30 100644 --- a/src-tauri/src/serial_core/serial.rs +++ b/src-tauri/src/serial_core/serial.rs @@ -12,7 +12,6 @@ use tokio_util::sync::CancellationToken; use std::future::pending; use std::sync::{Arc, Mutex}; use std::time::Instant; -use log::{info, debug}; use crate::serial_core::record::{FrameTiming, RecordedFrame}; pub enum PollMode { @@ -158,9 +157,9 @@ impl PollRequester for TactileAPollRequester { pub async fn run_serial( app: AppHandle, - mut port: SerialStream, - mut codec: C, - mut handler: H, + port: SerialStream, + codec: C, + handler: H, session_started_at: Instant, recording: Arc>>, cancel: CancellationToken, @@ -265,7 +264,8 @@ where let display_values = if let Some(vals) = decode_res.as_ref() { let summary = vals.iter().copied().sum::(); - chart_state.record_summary(summary as f32); + let force = raw_to_g1(summary as u32); + chart_state.record_summary(force as f32); chart_state.record_pressure_matrix(vals.as_slice()); Some(vec![summary]) } else { @@ -281,3 +281,36 @@ where } Ok(()) } + +fn raw_to_g1(raw: u32) -> f64 { + const X: [u32; 11] = [ + 0, 74602, 105503, 131459, 153512, 172041, 193794, 218947, 240580, 295118, 332346, + ]; + + const Y: [f64; 11] = [ + 0.0, 160.0, 260.0, 360.0, 460.0, 560.0, 660.0, 860.0, 1060.0, 1560.0, 2060.0, + ]; + + let n = X.len(); + if raw <= X[0] { + return Y[0] / 100.0; + } + if raw >= X[n - 1] { + return Y[n - 1] / 100.0; + } + + let mut left = 0; + let mut right = n - 1; + + while left + 1 < right { + let mid = (left + right) / 2; + if raw < X[mid] { + right = mid; + } else { + left = mid; + } + } + + let ratio = (raw - X[left]) as f64 / (X[right] - X[left]) as f64; + Y[left] / 100.0 + ratio * (Y[right] - Y[left]) / 100.0 +} diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index e7d107c..d336b05 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "JE-Skin", - "version": "0.1.0", + "version": "0.3.0", "identifier": "com.lenn.tauri-serial", "build": { "beforeDevCommand": "npm run dev", @@ -27,10 +27,10 @@ "targets": "all", "icon": [ "icons/32x32.png", - "icons/128x128.png", - "icons/128x128@2x.png", - "icons/icon.ico", - "icons/icon.png" + "icons/128x128.png", + "icons/128x128@2x.png", + "icons/icon.icns", + "icons/icon.ico" ] } } diff --git a/src/lib/components/CenterStage.svelte b/src/lib/components/CenterStage.svelte index 5a316a1..0981232 100644 --- a/src/lib/components/CenterStage.svelte +++ b/src/lib/components/CenterStage.svelte @@ -14,15 +14,11 @@ HudSignalPanel, HudSummary, LocaleCode, - PressureColorMapPreset, - StageStatusTone + MatrixDisplayMode, + PressureColorMapPreset } from "$lib/types/hud"; - export let title = ""; - export let hint = ""; export let locale: LocaleCode = "zh-CN"; - export let statusText = ""; - export let statusTone: StageStatusTone = "idle"; export let leftPanels: HudSignalPanel[] = []; export let rightPanels: HudSignalPanel[] = []; export let summary: HudSummary; @@ -44,6 +40,7 @@ export let rangeMin = 0; export let rangeMax = 16000; export let colorMapPreset: PressureColorMapPreset = "emerald"; + export let matrixDisplayMode: MatrixDisplayMode = "dots"; export let colorMapOptions: HudColorMapOption[] = []; export let replaySectionLabel = ""; export let replayPlayLabel = ""; @@ -60,7 +57,6 @@ export let showPrecisionTestPanel = false; let stagePlaneEl: HTMLDivElement | undefined; - let topOverlayEl: HTMLDivElement | undefined; let panelZoneEl: HTMLDivElement | undefined; let leftStackEl: HTMLDivElement | undefined; let rightStackEl: HTMLDivElement | undefined; @@ -85,6 +81,7 @@ $: replaySide = summarySide === "left" ? "right" : "left"; $: replayToggleButtonText = replayIsPlaying ? replayPauseLabel : replayPlayLabel; $: replayProgressPercent = Math.round(Math.min(1, Math.max(0, replayProgress)) * 100); + $: summaryCurveVisible = summary.points.length > 0 && summary.points.some((value) => Number.isFinite(value) && Math.abs(value) >= 0.0001); $: splitMatrixTitle = locale === "zh-CN" ? "数字矩阵" : "Matrix"; $: splitMatrixHint = locale === "zh-CN" ? "实时压力数据 / 数字矩阵" : "Live pressure matrix"; @@ -107,15 +104,11 @@ } function recomputePanelLayout(): void { - if (!stagePlaneEl || !topOverlayEl) { + if (!stagePlaneEl) { return; } - const planeRect = stagePlaneEl.getBoundingClientRect(); - const overlayRect = topOverlayEl.getBoundingClientRect(); - const overlayBottom = overlayRect.bottom - planeRect.top; - const upperTopLimit = Math.max(72, Math.round(stagePlaneEl.clientHeight * 0.34)); - panelZoneTopPx = clamp(Math.round(overlayBottom + 8), 56, upperTopLimit); + panelZoneTopPx = showPrecisionTestPanel ? 24 : 16; const panelZoneBottomPx = panelZoneEl ? toPxNumber(getComputedStyle(panelZoneEl).bottom) : 0; const zoneHeight = Math.max(0, stagePlaneEl.clientHeight - panelZoneTopPx - panelZoneBottomPx); @@ -159,10 +152,6 @@ resizeObserver.observe(stagePlaneEl); } - if (topOverlayEl) { - resizeObserver.observe(topOverlayEl); - } - if (leftStackEl) { resizeObserver.observe(leftStackEl); } @@ -187,19 +176,6 @@ bind:this={stagePlaneEl} style="--panel-zone-top-dyn: {panelZoneTopPx}px; --rail-scale-left: {leftRailScale}; --rail-scale-right: {rightRailScale};" > - {#if !showPrecisionTestPanel} -
-
-

WebGL2 Stage

-

{title}

-

{hint}

-
-

- {statusText} -

-
- {/if} - {#if showPrecisionTestPanel}
@@ -210,12 +186,14 @@
{#key `${matrixRows}x${matrixCols}:${colorMapPreset}:split`} {/key} @@ -238,12 +216,14 @@
{#key `${matrixRows}x${matrixCols}:${colorMapPreset}`} {/key} @@ -290,7 +270,7 @@
{/each} - {#if summary.points.length > 0 && summarySide === "left"} + {#if summaryCurveVisible && summarySide === "left"}
{/each} - {#if summary.points.length > 0 && summarySide === "right"} + {#if summaryCurveVisible && summarySide === "right"}
option.id === colorMapPreset) ?? colorMapOptions[0]; $: { @@ -120,7 +124,7 @@ } -
+

Stage Config

@@ -214,7 +218,7 @@

{applyLiveHint}

-
+