feat:增加点和数字切换,减小点最大尺寸,增加range配色方案

This commit is contained in:
lenn
2026-04-09 09:17:07 +08:00
parent 1c3a811154
commit a3cefc3c79
78 changed files with 786 additions and 296 deletions

2
src-tauri/Cargo.lock generated
View File

@@ -4,7 +4,7 @@ version = 4
[[package]]
name = "JE-Skin"
version = "0.1.0"
version = "0.3.0"
dependencies = [
"anyhow",
"async-trait",

View File

@@ -1,6 +1,6 @@
[package]
name = "JE-Skin"
version = "0.1.0"
version = "0.3.0"
description = "A Tauri App"
authors = ["you"]
edition = "2021"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 906 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 906 KiB

After

Width:  |  Height:  |  Size: 28 KiB

BIN
src-tauri/icons/16x16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 715 B

BIN
src-tauri/icons/192x192.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
src-tauri/icons/256x256.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 906 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
src-tauri/icons/512x512.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

BIN
src-tauri/icons/64x64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
<background android:drawable="@color/ic_launcher_background"/>
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#fff</color>
</resources>

BIN
src-tauri/icons/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
src-tauri/icons/icon.icns Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 906 KiB

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 806 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -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

View File

@@ -77,6 +77,40 @@ pub struct SerialConnectionState {
last_record: Mutex<Option<SharedTactileRecording>>
}
pub async fn shutdown_active_session(
state: &SerialConnectionState,
) -> Result<Option<(String, SharedTactileRecording)>, 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<Vec<String>, SerialError> {
let ports = available_ports()
@@ -190,17 +224,7 @@ pub async fn serial_connect(
pub async fn serial_disconnect(
state: State<'_, SerialConnectionState>,
) -> Result<SerialConnectResponse, SerialError> {
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,

View File

@@ -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<WebviewWindow, String> {
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(())
}

View File

@@ -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() {

View File

@@ -18,7 +18,6 @@ const FRAME_BUFFER_MIN_LENGTH: usize = 15;
pub struct TactileACodec {
buffer: Vec<u8>,
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<i32> = 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::<Vec<i32>>();
Ok(vals)
@@ -236,7 +241,6 @@ impl FrameHandler<TactileAFrame, i32> 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<TactileARepFrame> for TactileACsvExporter {
type Error = CodecError;
fn csv_header(&self, recording: &Recording<TactileARepFrame>) -> Vec<String> {
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));

View File

@@ -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<F> {
@@ -158,9 +157,9 @@ impl PollRequester<TactileAFrame> for TactileAPollRequester {
pub async fn run_serial<C, H, T, F>(
app: AppHandle,
mut port: SerialStream,
mut codec: C,
mut handler: H,
port: SerialStream,
codec: C,
handler: H,
session_started_at: Instant,
recording: Arc<Mutex<Recording<F>>>,
cancel: CancellationToken,
@@ -265,7 +264,8 @@ where
let display_values = if let Some(vals) = decode_res.as_ref() {
let summary = vals.iter().copied().sum::<i32>();
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
}

View File

@@ -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"
]
}
}