Compare commits
1 Commits
pre-module
...
sdk-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
50b3741b1a |
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -1,363 +0,0 @@
|
||||
('D:\\JE-Skin\\devkit\\dist\\je-skin-devkit-server.exe',
|
||||
True,
|
||||
False,
|
||||
False,
|
||||
'C:\\Python314\\Lib\\site-packages\\PyInstaller\\bootloader\\images\\icon-console.ico',
|
||||
None,
|
||||
False,
|
||||
False,
|
||||
b'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<assembly xmlns='
|
||||
b'"urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">\n <trustInfo x'
|
||||
b'mlns="urn:schemas-microsoft-com:asm.v3">\n <security>\n <requested'
|
||||
b'Privileges>\n <requestedExecutionLevel level="asInvoker" uiAccess='
|
||||
b'"false"/>\n </requestedPrivileges>\n </security>\n </trustInfo>\n '
|
||||
b'<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">\n <'
|
||||
b'application>\n <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f'
|
||||
b'0}"/>\n <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>\n '
|
||||
b' <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>\n <s'
|
||||
b'upportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>\n <supporte'
|
||||
b'dOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>\n </application>\n <'
|
||||
b'/compatibility>\n <application xmlns="urn:schemas-microsoft-com:asm.v3">'
|
||||
b'\n <windowsSettings>\n <longPathAware xmlns="http://schemas.micros'
|
||||
b'oft.com/SMI/2016/WindowsSettings">true</longPathAware>\n </windowsSett'
|
||||
b'ings>\n </application>\n <dependency>\n <dependentAssembly>\n <ass'
|
||||
b'emblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version='
|
||||
b'"6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" langua'
|
||||
b'ge="*"/>\n </dependentAssembly>\n </dependency>\n</assembly>',
|
||||
True,
|
||||
False,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
'D:\\JE-Skin\\devkit\\build\\je-skin-devkit-server\\je-skin-devkit-server.pkg',
|
||||
[('pyi-contents-directory _internal', '', 'OPTION'),
|
||||
('PYZ-00.pyz',
|
||||
'D:\\JE-Skin\\devkit\\build\\je-skin-devkit-server\\PYZ-00.pyz',
|
||||
'PYZ'),
|
||||
('struct',
|
||||
'D:\\JE-Skin\\devkit\\build\\je-skin-devkit-server\\localpycs\\struct.pyc',
|
||||
'PYMODULE'),
|
||||
('pyimod01_archive',
|
||||
'D:\\JE-Skin\\devkit\\build\\je-skin-devkit-server\\localpycs\\pyimod01_archive.pyc',
|
||||
'PYMODULE'),
|
||||
('pyimod02_importers',
|
||||
'D:\\JE-Skin\\devkit\\build\\je-skin-devkit-server\\localpycs\\pyimod02_importers.pyc',
|
||||
'PYMODULE'),
|
||||
('pyimod03_ctypes',
|
||||
'D:\\JE-Skin\\devkit\\build\\je-skin-devkit-server\\localpycs\\pyimod03_ctypes.pyc',
|
||||
'PYMODULE'),
|
||||
('pyimod04_pywin32',
|
||||
'D:\\JE-Skin\\devkit\\build\\je-skin-devkit-server\\localpycs\\pyimod04_pywin32.pyc',
|
||||
'PYMODULE'),
|
||||
('pyiboot01_bootstrap',
|
||||
'C:\\Python314\\Lib\\site-packages\\PyInstaller\\loader\\pyiboot01_bootstrap.py',
|
||||
'PYSOURCE'),
|
||||
('pyi_rth_inspect',
|
||||
'C:\\Python314\\Lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_inspect.py',
|
||||
'PYSOURCE'),
|
||||
('pyi_rth_pkgutil',
|
||||
'C:\\Python314\\Lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_pkgutil.py',
|
||||
'PYSOURCE'),
|
||||
('pyi_rth_multiprocessing',
|
||||
'C:\\Python314\\Lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_multiprocessing.py',
|
||||
'PYSOURCE'),
|
||||
('sensor_server', 'D:\\JE-Skin\\devkit\\sensor_server.py', 'PYSOURCE'),
|
||||
('python314.dll', 'C:\\Python314\\python314.dll', 'BINARY'),
|
||||
('numpy.libs\\libscipy_openblas64_-63c857e738469261263c764a36be9436.dll',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy.libs\\libscipy_openblas64_-63c857e738469261263c764a36be9436.dll',
|
||||
'BINARY'),
|
||||
('numpy.libs\\msvcp140-a4c2229bdc2a2a630acdc095b4d86008.dll',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy.libs\\msvcp140-a4c2229bdc2a2a630acdc095b4d86008.dll',
|
||||
'BINARY'),
|
||||
('select.pyd', 'C:\\Python314\\DLLs\\select.pyd', 'EXTENSION'),
|
||||
('_multiprocessing.pyd',
|
||||
'C:\\Python314\\DLLs\\_multiprocessing.pyd',
|
||||
'EXTENSION'),
|
||||
('_zstd.pyd', 'C:\\Python314\\DLLs\\_zstd.pyd', 'EXTENSION'),
|
||||
('pyexpat.pyd', 'C:\\Python314\\DLLs\\pyexpat.pyd', 'EXTENSION'),
|
||||
('_lzma.pyd', 'C:\\Python314\\DLLs\\_lzma.pyd', 'EXTENSION'),
|
||||
('_bz2.pyd', 'C:\\Python314\\DLLs\\_bz2.pyd', 'EXTENSION'),
|
||||
('_ssl.pyd', 'C:\\Python314\\DLLs\\_ssl.pyd', 'EXTENSION'),
|
||||
('_hashlib.pyd', 'C:\\Python314\\DLLs\\_hashlib.pyd', 'EXTENSION'),
|
||||
('unicodedata.pyd', 'C:\\Python314\\DLLs\\unicodedata.pyd', 'EXTENSION'),
|
||||
('_decimal.pyd', 'C:\\Python314\\DLLs\\_decimal.pyd', 'EXTENSION'),
|
||||
('_socket.pyd', 'C:\\Python314\\DLLs\\_socket.pyd', 'EXTENSION'),
|
||||
('_ctypes.pyd', 'C:\\Python314\\DLLs\\_ctypes.pyd', 'EXTENSION'),
|
||||
('_queue.pyd', 'C:\\Python314\\DLLs\\_queue.pyd', 'EXTENSION'),
|
||||
('numpy\\_core\\_multiarray_tests.cp314-win_amd64.pyd',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy\\_core\\_multiarray_tests.cp314-win_amd64.pyd',
|
||||
'EXTENSION'),
|
||||
('numpy\\_core\\_multiarray_umath.cp314-win_amd64.pyd',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy\\_core\\_multiarray_umath.cp314-win_amd64.pyd',
|
||||
'EXTENSION'),
|
||||
('_wmi.pyd', 'C:\\Python314\\DLLs\\_wmi.pyd', 'EXTENSION'),
|
||||
('_overlapped.pyd', 'C:\\Python314\\DLLs\\_overlapped.pyd', 'EXTENSION'),
|
||||
('_asyncio.pyd', 'C:\\Python314\\DLLs\\_asyncio.pyd', 'EXTENSION'),
|
||||
('numpy\\linalg\\_umath_linalg.cp314-win_amd64.pyd',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy\\linalg\\_umath_linalg.cp314-win_amd64.pyd',
|
||||
'EXTENSION'),
|
||||
('numpy\\random\\mtrand.cp314-win_amd64.pyd',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy\\random\\mtrand.cp314-win_amd64.pyd',
|
||||
'EXTENSION'),
|
||||
('numpy\\random\\bit_generator.cp314-win_amd64.pyd',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy\\random\\bit_generator.cp314-win_amd64.pyd',
|
||||
'EXTENSION'),
|
||||
('numpy\\random\\_sfc64.cp314-win_amd64.pyd',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy\\random\\_sfc64.cp314-win_amd64.pyd',
|
||||
'EXTENSION'),
|
||||
('numpy\\random\\_philox.cp314-win_amd64.pyd',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy\\random\\_philox.cp314-win_amd64.pyd',
|
||||
'EXTENSION'),
|
||||
('numpy\\random\\_pcg64.cp314-win_amd64.pyd',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy\\random\\_pcg64.cp314-win_amd64.pyd',
|
||||
'EXTENSION'),
|
||||
('numpy\\random\\_mt19937.cp314-win_amd64.pyd',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy\\random\\_mt19937.cp314-win_amd64.pyd',
|
||||
'EXTENSION'),
|
||||
('numpy\\random\\_generator.cp314-win_amd64.pyd',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy\\random\\_generator.cp314-win_amd64.pyd',
|
||||
'EXTENSION'),
|
||||
('numpy\\random\\_common.cp314-win_amd64.pyd',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy\\random\\_common.cp314-win_amd64.pyd',
|
||||
'EXTENSION'),
|
||||
('numpy\\random\\_bounded_integers.cp314-win_amd64.pyd',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy\\random\\_bounded_integers.cp314-win_amd64.pyd',
|
||||
'EXTENSION'),
|
||||
('numpy\\fft\\_pocketfft_umath.cp314-win_amd64.pyd',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy\\fft\\_pocketfft_umath.cp314-win_amd64.pyd',
|
||||
'EXTENSION'),
|
||||
('_elementtree.pyd', 'C:\\Python314\\DLLs\\_elementtree.pyd', 'EXTENSION'),
|
||||
('grpc\\_cython\\cygrpc.cp314-win_amd64.pyd',
|
||||
'C:\\Python314\\Lib\\site-packages\\grpc\\_cython\\cygrpc.cp314-win_amd64.pyd',
|
||||
'EXTENSION'),
|
||||
('google\\_upb\\_message.pyd',
|
||||
'C:\\Python314\\Lib\\site-packages\\google\\_upb\\_message.pyd',
|
||||
'EXTENSION'),
|
||||
('grpc_tools\\_protoc_compiler.cp314-win_amd64.pyd',
|
||||
'C:\\Python314\\Lib\\site-packages\\grpc_tools\\_protoc_compiler.cp314-win_amd64.pyd',
|
||||
'EXTENSION'),
|
||||
('api-ms-win-crt-locale-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-crt-locale-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-crt-convert-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-crt-convert-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-crt-filesystem-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-crt-filesystem-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-crt-heap-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-crt-heap-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('VCRUNTIME140.dll', 'C:\\Python314\\VCRUNTIME140.dll', 'BINARY'),
|
||||
('api-ms-win-crt-conio-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-crt-conio-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-crt-runtime-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-crt-runtime-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-crt-stdio-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-crt-stdio-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-crt-process-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-crt-process-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-crt-environment-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-crt-environment-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-crt-math-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-crt-math-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-crt-time-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-crt-time-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-crt-string-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-crt-string-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-crt-private-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-crt-private-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-crt-utility-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-crt-utility-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('VCRUNTIME140_1.dll', 'C:\\Python314\\VCRUNTIME140_1.dll', 'BINARY'),
|
||||
('libssl-3.dll', 'C:\\Python314\\DLLs\\libssl-3.dll', 'BINARY'),
|
||||
('libcrypto-3.dll', 'C:\\Python314\\DLLs\\libcrypto-3.dll', 'BINARY'),
|
||||
('libffi-8.dll', 'C:\\Python314\\DLLs\\libffi-8.dll', 'BINARY'),
|
||||
('python3.dll', 'C:\\Python314\\python3.dll', 'BINARY'),
|
||||
('ucrtbase.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\ucrtbase.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-processenvironment-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-processenvironment-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-file-l1-2-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-file-l1-2-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-timezone-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-timezone-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-libraryloader-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-libraryloader-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-util-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-util-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-file-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-file-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-debug-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-debug-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-file-l2-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-file-l2-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-namedpipe-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-namedpipe-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-sysinfo-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-sysinfo-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-interlocked-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-interlocked-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-localization-l1-2-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-localization-l1-2-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-synch-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-synch-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-profile-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-profile-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-fibers-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-fibers-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-handle-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-handle-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-synch-l1-2-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-synch-l1-2-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-string-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-string-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-memory-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-memory-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-heap-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-heap-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-console-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-console-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-rtlsupport-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-rtlsupport-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-datetime-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-datetime-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-errorhandling-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-errorhandling-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-processthreads-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-processthreads-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-processthreads-l1-1-1.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-processthreads-l1-1-1.dll',
|
||||
'BINARY'),
|
||||
('sensor_stream_pb2.py', 'D:\\JE-Skin\\devkit\\sensor_stream_pb2.py', 'DATA'),
|
||||
('sensor_stream_pb2_grpc.py',
|
||||
'D:\\JE-Skin\\devkit\\sensor_stream_pb2_grpc.py',
|
||||
'DATA'),
|
||||
('grpc\\_cython\\_credentials\\roots.pem',
|
||||
'C:\\Python314\\Lib\\site-packages\\grpc\\_cython\\_credentials\\roots.pem',
|
||||
'DATA'),
|
||||
('grpc\\_cython\\_cygrpc\\private_key_signing\\private_key_signer_py_wrapper.h',
|
||||
'C:\\Python314\\Lib\\site-packages\\grpc\\_cython\\_cygrpc\\private_key_signing\\private_key_signer_py_wrapper.h',
|
||||
'DATA'),
|
||||
('grpc\\_cython\\_cygrpc\\private_key_signing\\private_key_signer_py_wrapper.cc',
|
||||
'C:\\Python314\\Lib\\site-packages\\grpc\\_cython\\_cygrpc\\private_key_signing\\private_key_signer_py_wrapper.cc',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\WHEEL',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\WHEEL',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\LICENSE.txt',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\LICENSE.txt',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\numpy\\random\\src\\sfc64\\LICENSE.md',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\numpy\\random\\src\\sfc64\\LICENSE.md',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\entry_points.txt',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\entry_points.txt',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\numpy\\ma\\LICENSE',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\numpy\\ma\\LICENSE',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\INSTALLER',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\INSTALLER',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\DELVEWHEEL',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\DELVEWHEEL',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\numpy\\random\\src\\pcg64\\LICENSE.md',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\numpy\\random\\src\\pcg64\\LICENSE.md',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\numpy\\_core\\include\\numpy\\libdivide\\LICENSE.txt',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\numpy\\_core\\include\\numpy\\libdivide\\LICENSE.txt',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\numpy\\_core\\src\\npysort\\x86-simd-sort\\LICENSE.md',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\numpy\\_core\\src\\npysort\\x86-simd-sort\\LICENSE.md',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\REQUESTED',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\REQUESTED',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\numpy\\_core\\src\\multiarray\\dragon4_LICENSE.txt',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\numpy\\_core\\src\\multiarray\\dragon4_LICENSE.txt',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\numpy\\_core\\src\\common\\pythoncapi-compat\\COPYING',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\numpy\\_core\\src\\common\\pythoncapi-compat\\COPYING',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\numpy\\random\\src\\splitmix64\\LICENSE.md',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\numpy\\random\\src\\splitmix64\\LICENSE.md',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\numpy\\random\\src\\distributions\\LICENSE.md',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\numpy\\random\\src\\distributions\\LICENSE.md',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\numpy\\_core\\src\\umath\\svml\\LICENSE',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\numpy\\_core\\src\\umath\\svml\\LICENSE',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\numpy\\random\\LICENSE.md',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\numpy\\random\\LICENSE.md',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\METADATA',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\METADATA',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\numpy\\random\\src\\mt19937\\LICENSE.md',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\numpy\\random\\src\\mt19937\\LICENSE.md',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\numpy\\_core\\src\\highway\\LICENSE',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\numpy\\_core\\src\\highway\\LICENSE',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\numpy\\random\\src\\philox\\LICENSE.md',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\numpy\\random\\src\\philox\\LICENSE.md',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\numpy\\fft\\pocketfft\\LICENSE.md',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\numpy\\fft\\pocketfft\\LICENSE.md',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\numpy\\linalg\\lapack_lite\\LICENSE.txt',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\numpy\\linalg\\lapack_lite\\LICENSE.txt',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\RECORD',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\RECORD',
|
||||
'DATA'),
|
||||
('base_library.zip',
|
||||
'D:\\JE-Skin\\devkit\\build\\je-skin-devkit-server\\base_library.zip',
|
||||
'DATA')],
|
||||
[],
|
||||
False,
|
||||
False,
|
||||
1777347409,
|
||||
[('run.exe',
|
||||
'C:\\Python314\\Lib\\site-packages\\PyInstaller\\bootloader\\Windows-64bit-intel\\run.exe',
|
||||
'EXECUTABLE')],
|
||||
'C:\\Python314\\python314.dll')
|
||||
@@ -1,341 +0,0 @@
|
||||
('D:\\JE-Skin\\devkit\\build\\je-skin-devkit-server\\je-skin-devkit-server.pkg',
|
||||
{'BINARY': True,
|
||||
'DATA': True,
|
||||
'EXECUTABLE': True,
|
||||
'EXTENSION': True,
|
||||
'PYMODULE': True,
|
||||
'PYSOURCE': True,
|
||||
'PYZ': False,
|
||||
'SPLASH': True,
|
||||
'SYMLINK': False},
|
||||
[('pyi-contents-directory _internal', '', 'OPTION'),
|
||||
('PYZ-00.pyz',
|
||||
'D:\\JE-Skin\\devkit\\build\\je-skin-devkit-server\\PYZ-00.pyz',
|
||||
'PYZ'),
|
||||
('struct',
|
||||
'D:\\JE-Skin\\devkit\\build\\je-skin-devkit-server\\localpycs\\struct.pyc',
|
||||
'PYMODULE'),
|
||||
('pyimod01_archive',
|
||||
'D:\\JE-Skin\\devkit\\build\\je-skin-devkit-server\\localpycs\\pyimod01_archive.pyc',
|
||||
'PYMODULE'),
|
||||
('pyimod02_importers',
|
||||
'D:\\JE-Skin\\devkit\\build\\je-skin-devkit-server\\localpycs\\pyimod02_importers.pyc',
|
||||
'PYMODULE'),
|
||||
('pyimod03_ctypes',
|
||||
'D:\\JE-Skin\\devkit\\build\\je-skin-devkit-server\\localpycs\\pyimod03_ctypes.pyc',
|
||||
'PYMODULE'),
|
||||
('pyimod04_pywin32',
|
||||
'D:\\JE-Skin\\devkit\\build\\je-skin-devkit-server\\localpycs\\pyimod04_pywin32.pyc',
|
||||
'PYMODULE'),
|
||||
('pyiboot01_bootstrap',
|
||||
'C:\\Python314\\Lib\\site-packages\\PyInstaller\\loader\\pyiboot01_bootstrap.py',
|
||||
'PYSOURCE'),
|
||||
('pyi_rth_inspect',
|
||||
'C:\\Python314\\Lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_inspect.py',
|
||||
'PYSOURCE'),
|
||||
('pyi_rth_pkgutil',
|
||||
'C:\\Python314\\Lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_pkgutil.py',
|
||||
'PYSOURCE'),
|
||||
('pyi_rth_multiprocessing',
|
||||
'C:\\Python314\\Lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_multiprocessing.py',
|
||||
'PYSOURCE'),
|
||||
('sensor_server', 'D:\\JE-Skin\\devkit\\sensor_server.py', 'PYSOURCE'),
|
||||
('python314.dll', 'C:\\Python314\\python314.dll', 'BINARY'),
|
||||
('numpy.libs\\libscipy_openblas64_-63c857e738469261263c764a36be9436.dll',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy.libs\\libscipy_openblas64_-63c857e738469261263c764a36be9436.dll',
|
||||
'BINARY'),
|
||||
('numpy.libs\\msvcp140-a4c2229bdc2a2a630acdc095b4d86008.dll',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy.libs\\msvcp140-a4c2229bdc2a2a630acdc095b4d86008.dll',
|
||||
'BINARY'),
|
||||
('select.pyd', 'C:\\Python314\\DLLs\\select.pyd', 'EXTENSION'),
|
||||
('_multiprocessing.pyd',
|
||||
'C:\\Python314\\DLLs\\_multiprocessing.pyd',
|
||||
'EXTENSION'),
|
||||
('_zstd.pyd', 'C:\\Python314\\DLLs\\_zstd.pyd', 'EXTENSION'),
|
||||
('pyexpat.pyd', 'C:\\Python314\\DLLs\\pyexpat.pyd', 'EXTENSION'),
|
||||
('_lzma.pyd', 'C:\\Python314\\DLLs\\_lzma.pyd', 'EXTENSION'),
|
||||
('_bz2.pyd', 'C:\\Python314\\DLLs\\_bz2.pyd', 'EXTENSION'),
|
||||
('_ssl.pyd', 'C:\\Python314\\DLLs\\_ssl.pyd', 'EXTENSION'),
|
||||
('_hashlib.pyd', 'C:\\Python314\\DLLs\\_hashlib.pyd', 'EXTENSION'),
|
||||
('unicodedata.pyd', 'C:\\Python314\\DLLs\\unicodedata.pyd', 'EXTENSION'),
|
||||
('_decimal.pyd', 'C:\\Python314\\DLLs\\_decimal.pyd', 'EXTENSION'),
|
||||
('_socket.pyd', 'C:\\Python314\\DLLs\\_socket.pyd', 'EXTENSION'),
|
||||
('_ctypes.pyd', 'C:\\Python314\\DLLs\\_ctypes.pyd', 'EXTENSION'),
|
||||
('_queue.pyd', 'C:\\Python314\\DLLs\\_queue.pyd', 'EXTENSION'),
|
||||
('numpy\\_core\\_multiarray_tests.cp314-win_amd64.pyd',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy\\_core\\_multiarray_tests.cp314-win_amd64.pyd',
|
||||
'EXTENSION'),
|
||||
('numpy\\_core\\_multiarray_umath.cp314-win_amd64.pyd',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy\\_core\\_multiarray_umath.cp314-win_amd64.pyd',
|
||||
'EXTENSION'),
|
||||
('_wmi.pyd', 'C:\\Python314\\DLLs\\_wmi.pyd', 'EXTENSION'),
|
||||
('_overlapped.pyd', 'C:\\Python314\\DLLs\\_overlapped.pyd', 'EXTENSION'),
|
||||
('_asyncio.pyd', 'C:\\Python314\\DLLs\\_asyncio.pyd', 'EXTENSION'),
|
||||
('numpy\\linalg\\_umath_linalg.cp314-win_amd64.pyd',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy\\linalg\\_umath_linalg.cp314-win_amd64.pyd',
|
||||
'EXTENSION'),
|
||||
('numpy\\random\\mtrand.cp314-win_amd64.pyd',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy\\random\\mtrand.cp314-win_amd64.pyd',
|
||||
'EXTENSION'),
|
||||
('numpy\\random\\bit_generator.cp314-win_amd64.pyd',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy\\random\\bit_generator.cp314-win_amd64.pyd',
|
||||
'EXTENSION'),
|
||||
('numpy\\random\\_sfc64.cp314-win_amd64.pyd',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy\\random\\_sfc64.cp314-win_amd64.pyd',
|
||||
'EXTENSION'),
|
||||
('numpy\\random\\_philox.cp314-win_amd64.pyd',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy\\random\\_philox.cp314-win_amd64.pyd',
|
||||
'EXTENSION'),
|
||||
('numpy\\random\\_pcg64.cp314-win_amd64.pyd',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy\\random\\_pcg64.cp314-win_amd64.pyd',
|
||||
'EXTENSION'),
|
||||
('numpy\\random\\_mt19937.cp314-win_amd64.pyd',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy\\random\\_mt19937.cp314-win_amd64.pyd',
|
||||
'EXTENSION'),
|
||||
('numpy\\random\\_generator.cp314-win_amd64.pyd',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy\\random\\_generator.cp314-win_amd64.pyd',
|
||||
'EXTENSION'),
|
||||
('numpy\\random\\_common.cp314-win_amd64.pyd',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy\\random\\_common.cp314-win_amd64.pyd',
|
||||
'EXTENSION'),
|
||||
('numpy\\random\\_bounded_integers.cp314-win_amd64.pyd',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy\\random\\_bounded_integers.cp314-win_amd64.pyd',
|
||||
'EXTENSION'),
|
||||
('numpy\\fft\\_pocketfft_umath.cp314-win_amd64.pyd',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy\\fft\\_pocketfft_umath.cp314-win_amd64.pyd',
|
||||
'EXTENSION'),
|
||||
('_elementtree.pyd', 'C:\\Python314\\DLLs\\_elementtree.pyd', 'EXTENSION'),
|
||||
('grpc\\_cython\\cygrpc.cp314-win_amd64.pyd',
|
||||
'C:\\Python314\\Lib\\site-packages\\grpc\\_cython\\cygrpc.cp314-win_amd64.pyd',
|
||||
'EXTENSION'),
|
||||
('google\\_upb\\_message.pyd',
|
||||
'C:\\Python314\\Lib\\site-packages\\google\\_upb\\_message.pyd',
|
||||
'EXTENSION'),
|
||||
('grpc_tools\\_protoc_compiler.cp314-win_amd64.pyd',
|
||||
'C:\\Python314\\Lib\\site-packages\\grpc_tools\\_protoc_compiler.cp314-win_amd64.pyd',
|
||||
'EXTENSION'),
|
||||
('api-ms-win-crt-locale-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-crt-locale-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-crt-convert-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-crt-convert-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-crt-filesystem-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-crt-filesystem-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-crt-heap-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-crt-heap-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('VCRUNTIME140.dll', 'C:\\Python314\\VCRUNTIME140.dll', 'BINARY'),
|
||||
('api-ms-win-crt-conio-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-crt-conio-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-crt-runtime-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-crt-runtime-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-crt-stdio-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-crt-stdio-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-crt-process-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-crt-process-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-crt-environment-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-crt-environment-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-crt-math-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-crt-math-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-crt-time-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-crt-time-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-crt-string-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-crt-string-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-crt-private-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-crt-private-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-crt-utility-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-crt-utility-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('VCRUNTIME140_1.dll', 'C:\\Python314\\VCRUNTIME140_1.dll', 'BINARY'),
|
||||
('libssl-3.dll', 'C:\\Python314\\DLLs\\libssl-3.dll', 'BINARY'),
|
||||
('libcrypto-3.dll', 'C:\\Python314\\DLLs\\libcrypto-3.dll', 'BINARY'),
|
||||
('libffi-8.dll', 'C:\\Python314\\DLLs\\libffi-8.dll', 'BINARY'),
|
||||
('python3.dll', 'C:\\Python314\\python3.dll', 'BINARY'),
|
||||
('ucrtbase.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\ucrtbase.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-processenvironment-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-processenvironment-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-file-l1-2-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-file-l1-2-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-timezone-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-timezone-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-libraryloader-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-libraryloader-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-util-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-util-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-file-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-file-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-debug-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-debug-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-file-l2-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-file-l2-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-namedpipe-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-namedpipe-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-sysinfo-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-sysinfo-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-interlocked-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-interlocked-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-localization-l1-2-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-localization-l1-2-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-synch-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-synch-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-profile-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-profile-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-fibers-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-fibers-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-handle-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-handle-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-synch-l1-2-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-synch-l1-2-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-string-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-string-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-memory-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-memory-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-heap-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-heap-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-console-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-console-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-rtlsupport-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-rtlsupport-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-datetime-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-datetime-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-errorhandling-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-errorhandling-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-processthreads-l1-1-0.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-processthreads-l1-1-0.dll',
|
||||
'BINARY'),
|
||||
('api-ms-win-core-processthreads-l1-1-1.dll',
|
||||
'C:\\Users\\Administrator\\miniconda3\\api-ms-win-core-processthreads-l1-1-1.dll',
|
||||
'BINARY'),
|
||||
('sensor_stream_pb2.py', 'D:\\JE-Skin\\devkit\\sensor_stream_pb2.py', 'DATA'),
|
||||
('sensor_stream_pb2_grpc.py',
|
||||
'D:\\JE-Skin\\devkit\\sensor_stream_pb2_grpc.py',
|
||||
'DATA'),
|
||||
('grpc\\_cython\\_credentials\\roots.pem',
|
||||
'C:\\Python314\\Lib\\site-packages\\grpc\\_cython\\_credentials\\roots.pem',
|
||||
'DATA'),
|
||||
('grpc\\_cython\\_cygrpc\\private_key_signing\\private_key_signer_py_wrapper.h',
|
||||
'C:\\Python314\\Lib\\site-packages\\grpc\\_cython\\_cygrpc\\private_key_signing\\private_key_signer_py_wrapper.h',
|
||||
'DATA'),
|
||||
('grpc\\_cython\\_cygrpc\\private_key_signing\\private_key_signer_py_wrapper.cc',
|
||||
'C:\\Python314\\Lib\\site-packages\\grpc\\_cython\\_cygrpc\\private_key_signing\\private_key_signer_py_wrapper.cc',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\WHEEL',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\WHEEL',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\LICENSE.txt',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\LICENSE.txt',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\numpy\\random\\src\\sfc64\\LICENSE.md',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\numpy\\random\\src\\sfc64\\LICENSE.md',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\entry_points.txt',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\entry_points.txt',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\numpy\\ma\\LICENSE',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\numpy\\ma\\LICENSE',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\INSTALLER',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\INSTALLER',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\DELVEWHEEL',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\DELVEWHEEL',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\numpy\\random\\src\\pcg64\\LICENSE.md',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\numpy\\random\\src\\pcg64\\LICENSE.md',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\numpy\\_core\\include\\numpy\\libdivide\\LICENSE.txt',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\numpy\\_core\\include\\numpy\\libdivide\\LICENSE.txt',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\numpy\\_core\\src\\npysort\\x86-simd-sort\\LICENSE.md',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\numpy\\_core\\src\\npysort\\x86-simd-sort\\LICENSE.md',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\REQUESTED',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\REQUESTED',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\numpy\\_core\\src\\multiarray\\dragon4_LICENSE.txt',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\numpy\\_core\\src\\multiarray\\dragon4_LICENSE.txt',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\numpy\\_core\\src\\common\\pythoncapi-compat\\COPYING',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\numpy\\_core\\src\\common\\pythoncapi-compat\\COPYING',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\numpy\\random\\src\\splitmix64\\LICENSE.md',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\numpy\\random\\src\\splitmix64\\LICENSE.md',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\numpy\\random\\src\\distributions\\LICENSE.md',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\numpy\\random\\src\\distributions\\LICENSE.md',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\numpy\\_core\\src\\umath\\svml\\LICENSE',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\numpy\\_core\\src\\umath\\svml\\LICENSE',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\numpy\\random\\LICENSE.md',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\numpy\\random\\LICENSE.md',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\METADATA',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\METADATA',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\numpy\\random\\src\\mt19937\\LICENSE.md',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\numpy\\random\\src\\mt19937\\LICENSE.md',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\numpy\\_core\\src\\highway\\LICENSE',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\numpy\\_core\\src\\highway\\LICENSE',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\numpy\\random\\src\\philox\\LICENSE.md',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\numpy\\random\\src\\philox\\LICENSE.md',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\numpy\\fft\\pocketfft\\LICENSE.md',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\numpy\\fft\\pocketfft\\LICENSE.md',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\licenses\\numpy\\linalg\\lapack_lite\\LICENSE.txt',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\licenses\\numpy\\linalg\\lapack_lite\\LICENSE.txt',
|
||||
'DATA'),
|
||||
('numpy-2.4.4.dist-info\\RECORD',
|
||||
'C:\\Python314\\Lib\\site-packages\\numpy-2.4.4.dist-info\\RECORD',
|
||||
'DATA'),
|
||||
('base_library.zip',
|
||||
'D:\\JE-Skin\\devkit\\build\\je-skin-devkit-server\\base_library.zip',
|
||||
'DATA')],
|
||||
'python314.dll',
|
||||
False,
|
||||
False,
|
||||
False,
|
||||
[],
|
||||
None,
|
||||
None,
|
||||
None)
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,245 +0,0 @@
|
||||
|
||||
This file lists modules PyInstaller was not able to find. This does not
|
||||
necessarily mean these modules are required for running your program. Both
|
||||
Python's standard library and 3rd-party Python packages often conditionally
|
||||
import optional modules, some of which may be available only on certain
|
||||
platforms.
|
||||
|
||||
Types of import:
|
||||
* top-level: imported at the top-level - look at these first
|
||||
* conditional: imported within an if-statement
|
||||
* delayed: imported within a function
|
||||
* optional: imported within a try-except-statement
|
||||
|
||||
IMPORTANT: Do NOT post this list to the issue-tracker. Use it as a basis for
|
||||
tracking down the missing module yourself. Thanks!
|
||||
|
||||
missing module named pwd - imported by posixpath (delayed, conditional, optional), subprocess (delayed, conditional, optional), shutil (delayed, optional), tarfile (optional), pathlib (optional), netrc (delayed, optional), http.server (delayed, optional)
|
||||
missing module named grp - imported by subprocess (delayed, conditional, optional), shutil (delayed, optional), tarfile (optional), pathlib (optional)
|
||||
missing module named 'collections.abc' - imported by typing (top-level), tracemalloc (top-level), traceback (top-level), _colorize (top-level), selectors (top-level), logging (top-level), http.client (top-level), importlib.resources.readers (top-level), inspect (top-level), multiprocessing.managers (top-level), typing_extensions (top-level), asyncio.base_events (top-level), asyncio.coroutines (top-level), grpc.aio._metadata (top-level), google.protobuf.internal.containers (top-level), google.protobuf.internal.well_known_types (top-level), numpy._typing._array_like (top-level), numpy._typing._nested_sequence (conditional), numpy._typing._shape (top-level), numpy._typing._dtype_like (top-level), numpy.lib._function_base_impl (top-level), _pyrepl.types (top-level), numpy.lib._npyio_impl (top-level), numpy.random._common (top-level), numpy.random._generator (top-level), numpy.random.bit_generator (top-level), numpy.random.mtrand (top-level), numpy.polynomial._polybase (top-level), xml.etree.ElementTree (top-level)
|
||||
missing module named _posixsubprocess - imported by subprocess (conditional), multiprocessing.util (delayed)
|
||||
missing module named fcntl - imported by subprocess (optional), pathlib._os (optional)
|
||||
missing module named _posixshmem - imported by multiprocessing.resource_tracker (conditional), multiprocessing.shared_memory (conditional)
|
||||
missing module named _scproxy - imported by urllib.request (conditional)
|
||||
missing module named posix - imported by os (conditional, optional), posixpath (optional), shutil (conditional), importlib._bootstrap_external (conditional), pathlib._os (optional), _pyrepl.trace (conditional)
|
||||
missing module named resource - imported by posix (top-level)
|
||||
missing module named _frozen_importlib_external - imported by importlib._bootstrap (delayed), importlib (optional), importlib.abc (optional), zipimport (top-level)
|
||||
excluded module named _frozen_importlib - imported by importlib (optional), importlib.abc (optional), zipimport (top-level)
|
||||
missing module named multiprocessing.BufferTooShort - imported by multiprocessing (top-level), multiprocessing.connection (top-level)
|
||||
missing module named multiprocessing.AuthenticationError - imported by multiprocessing (top-level), multiprocessing.forkserver (top-level), multiprocessing.connection (top-level)
|
||||
missing module named multiprocessing.get_context - imported by multiprocessing (top-level), multiprocessing.pool (top-level), multiprocessing.managers (top-level), multiprocessing.sharedctypes (top-level)
|
||||
missing module named multiprocessing.TimeoutError - imported by multiprocessing (top-level), multiprocessing.pool (top-level)
|
||||
missing module named multiprocessing.set_start_method - imported by multiprocessing (top-level), multiprocessing.spawn (top-level)
|
||||
missing module named multiprocessing.get_start_method - imported by multiprocessing (top-level), multiprocessing.spawn (top-level)
|
||||
missing module named pyimod02_importers - imported by C:\Python314\Lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_pkgutil.py (delayed)
|
||||
missing module named _dummy_thread - imported by numpy._core.arrayprint (optional)
|
||||
missing module named 'numpy_distutils.cpuinfo' - imported by numpy.f2py.diagnose (delayed, conditional, optional)
|
||||
missing module named 'numpy_distutils.fcompiler' - imported by numpy.f2py.diagnose (delayed, conditional, optional)
|
||||
missing module named 'numpy_distutils.command' - imported by numpy.f2py.diagnose (delayed, conditional, optional)
|
||||
missing module named numpy_distutils - imported by numpy.f2py.diagnose (delayed, optional)
|
||||
missing module named charset_normalizer - imported by numpy.f2py.crackfortran (optional)
|
||||
missing module named vms_lib - imported by platform (delayed, optional)
|
||||
missing module named 'java.lang' - imported by platform (delayed, optional)
|
||||
missing module named java - imported by platform (delayed)
|
||||
missing module named psutil - imported by numpy.testing._private.utils (delayed, optional)
|
||||
missing module named termios - imported by tty (top-level), _pyrepl.pager (delayed, optional)
|
||||
missing module named readline - imported by cmd (delayed, conditional, optional), code (delayed, conditional, optional), pdb (delayed, conditional, optional), rlcompleter (optional)
|
||||
missing module named win32pdh - imported by numpy.testing._private.utils (delayed, conditional)
|
||||
missing module named _typeshed - imported by numpy.random.bit_generator (top-level)
|
||||
missing module named numpy.random.RandomState - imported by numpy.random (top-level), numpy.random._generator (top-level)
|
||||
missing module named threadpoolctl - imported by numpy.lib._utils_impl (delayed, optional)
|
||||
missing module named numpy._core.zeros - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
|
||||
missing module named numpy._core.vstack - imported by numpy._core (top-level), numpy.lib._shape_base_impl (top-level), numpy (conditional)
|
||||
missing module named numpy._core.void - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.vecmat - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.vecdot - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
|
||||
missing module named numpy._core.ushort - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.unsignedinteger - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.ulonglong - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.ulong - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.uintp - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.uintc - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.uint64 - imported by numpy._core (conditional), numpy (conditional), numpy._array_api_info (top-level)
|
||||
missing module named numpy._core.uint32 - imported by numpy._core (conditional), numpy (conditional), numpy._array_api_info (top-level)
|
||||
missing module named numpy._core.uint16 - imported by numpy._core (conditional), numpy (conditional), numpy._array_api_info (top-level)
|
||||
missing module named numpy._core.uint - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.ubyte - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.trunc - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.true_divide - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.transpose - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy.lib._function_base_impl (top-level), numpy (conditional)
|
||||
missing module named numpy._core.trace - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
|
||||
missing module named numpy._core.timedelta64 - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.tensordot - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
|
||||
missing module named numpy._core.tanh - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.tan - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.swapaxes - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
|
||||
missing module named numpy._core.sum - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
|
||||
missing module named numpy._core.subtract - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.str_ - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.square - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.sqrt - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional), numpy.fft._pocketfft (top-level)
|
||||
missing module named numpy._core.spacing - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.sort - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
|
||||
missing module named numpy._core.sinh - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.single - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
|
||||
missing module named numpy._core.signedinteger - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.signbit - imported by numpy._core (delayed), numpy.testing._private.utils (delayed), numpy (conditional)
|
||||
missing module named numpy._core.sign - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
|
||||
missing module named numpy._core.short - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.rint - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.right_shift - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.result_type - imported by numpy._core (delayed), numpy.testing._private.utils (delayed), numpy (conditional), numpy.fft._pocketfft (top-level)
|
||||
missing module named numpy._core.remainder - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.reciprocal - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional), numpy.fft._pocketfft (top-level)
|
||||
missing module named numpy._core.radians - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.rad2deg - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.prod - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
|
||||
missing module named numpy._core.power - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.positive - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.pi - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.outer - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
|
||||
missing module named numpy._core.ones - imported by numpy._core (top-level), numpy.lib._polynomial_impl (top-level), numpy (conditional)
|
||||
missing module named numpy._core.object_ - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy.testing._private.utils (delayed), numpy (conditional)
|
||||
missing module named numpy._core.number - imported by numpy._core (delayed), numpy.testing._private.utils (delayed), numpy (conditional)
|
||||
missing module named numpy._core.not_equal - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.nextafter - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.newaxis - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
|
||||
missing module named numpy._core.negative - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.ndarray - imported by numpy._core (top-level), numpy.testing._private.utils (top-level), numpy.lib._utils_impl (top-level), numpy (conditional)
|
||||
missing module named numpy._core.multiply - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
|
||||
missing module named numpy._core.moveaxis - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
|
||||
missing module named numpy._core.modf - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.mod - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.minimum - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.maximum - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.max - imported by numpy._core (delayed), numpy.testing._private.utils (delayed), numpy (conditional)
|
||||
missing module named numpy._core.matvec - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.matrix_transpose - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
|
||||
missing module named numpy._core.matmul - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
|
||||
missing module named numpy._core.longlong - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.longdouble - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.long - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.logical_xor - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.logical_or - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.logical_not - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.logical_and - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.logaddexp2 - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.logaddexp - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.log10 - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.log2 - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.log1p - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.log - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.linspace - imported by numpy._core (top-level), numpy.lib._index_tricks_impl (top-level), numpy (conditional)
|
||||
missing module named numpy._core.less_equal - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.less - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.left_shift - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.ldexp - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.lcm - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.isscalar - imported by numpy._core (delayed), numpy.testing._private.utils (delayed), numpy.lib._polynomial_impl (top-level), numpy (conditional)
|
||||
missing module named numpy._core.isnat - imported by numpy._core (top-level), numpy.testing._private.utils (top-level), numpy (conditional)
|
||||
missing module named numpy._core.isnan - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy.testing._private.utils (delayed), numpy (conditional)
|
||||
missing module named numpy._core.isfinite - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
|
||||
missing module named numpy._core.intp - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy.testing._private.utils (top-level), numpy (conditional), numpy._array_api_info (top-level)
|
||||
missing module named numpy._core.integer - imported by numpy._core (conditional), numpy (conditional), numpy.fft._helper (top-level)
|
||||
missing module named numpy._core.intc - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
|
||||
missing module named numpy._core.int64 - imported by numpy._core (conditional), numpy (conditional), numpy._array_api_info (top-level)
|
||||
missing module named numpy._core.int32 - imported by numpy._core (conditional), numpy (conditional), numpy._array_api_info (top-level)
|
||||
missing module named numpy._core.int16 - imported by numpy._core (conditional), numpy (conditional), numpy._array_api_info (top-level)
|
||||
missing module named numpy._core.int8 - imported by numpy._core (conditional), numpy (conditional), numpy._array_api_info (top-level)
|
||||
missing module named numpy._core.inf - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy.testing._private.utils (delayed), numpy (conditional)
|
||||
missing module named numpy._core.inexact - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
|
||||
missing module named numpy._core.iinfo - imported by numpy._core (top-level), numpy.lib._twodim_base_impl (top-level), numpy (conditional)
|
||||
missing module named numpy._core.hypot - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.hstack - imported by numpy._core (top-level), numpy.lib._polynomial_impl (top-level), numpy (conditional)
|
||||
missing module named numpy._core.heaviside - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.half - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.greater_equal - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.greater - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.gcd - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.frompyfunc - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.frexp - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.fmod - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.fmin - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.fmax - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.floor_divide - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.floor - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.floating - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.float_power - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.float32 - imported by numpy._core (top-level), numpy.testing._private.utils (top-level), numpy (conditional), numpy._array_api_info (top-level)
|
||||
missing module named numpy._core.float16 - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.finfo - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy.lib._polynomial_impl (top-level), numpy (conditional)
|
||||
missing module named numpy._core.fabs - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.expm1 - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.exp2 - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.exp - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.euler_gamma - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.errstate - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy.testing._private.utils (delayed), numpy (conditional)
|
||||
missing module named numpy._core.equal - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.empty_like - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional), numpy.fft._pocketfft (top-level)
|
||||
missing module named numpy._core.empty - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy.testing._private.utils (top-level), numpy (conditional), numpy.fft._helper (top-level)
|
||||
missing module named numpy._core.e - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.double - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
|
||||
missing module named numpy._core.dot - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy.lib._polynomial_impl (top-level), numpy (conditional)
|
||||
missing module named numpy._core.divmod - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.divide - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
|
||||
missing module named numpy._core.diagonal - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
|
||||
missing module named numpy._core.degrees - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.deg2rad - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.datetime64 - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.csingle - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
|
||||
missing module named numpy._core.cross - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
|
||||
missing module named numpy._core.count_nonzero - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
|
||||
missing module named numpy._core.cosh - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.cos - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.copysign - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.conjugate - imported by numpy._core (conditional), numpy (conditional), numpy.fft._pocketfft (top-level)
|
||||
missing module named numpy._core.conj - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.complexfloating - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
|
||||
missing module named numpy._core.complex64 - imported by numpy._core (conditional), numpy (conditional), numpy._array_api_info (top-level)
|
||||
missing module named numpy._core.clongdouble - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.character - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.ceil - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.cdouble - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
|
||||
missing module named numpy._core.cbrt - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.bytes_ - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.byte - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.bool_ - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.bitwise_xor - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.bitwise_or - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.bitwise_count - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.bitwise_and - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.atleast_3d - imported by numpy._core (top-level), numpy.lib._shape_base_impl (top-level), numpy (conditional)
|
||||
missing module named numpy._core.atleast_2d - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
|
||||
missing module named numpy._core.atleast_1d - imported by numpy._core (top-level), numpy.lib._polynomial_impl (top-level), numpy (conditional)
|
||||
missing module named numpy._core.asarray - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy.lib._array_utils_impl (top-level), numpy (conditional), numpy.fft._helper (top-level), numpy.fft._pocketfft (top-level)
|
||||
missing module named numpy._core.asanyarray - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
|
||||
missing module named numpy._core.array_repr - imported by numpy._core (top-level), numpy.testing._private.utils (top-level), numpy (conditional)
|
||||
missing module named numpy._core.array2string - imported by numpy._core (delayed), numpy.testing._private.utils (delayed), numpy (conditional)
|
||||
missing module named numpy._core.array - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy.testing._private.utils (top-level), numpy.lib._polynomial_impl (top-level), numpy (conditional)
|
||||
missing module named numpy._core.argsort - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
|
||||
missing module named numpy._core.arctanh - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.arctan2 - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.arctan - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.arcsinh - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.arcsin - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.arccosh - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.arccos - imported by numpy._core (conditional), numpy (conditional)
|
||||
missing module named numpy._core.arange - imported by numpy._core (top-level), numpy.testing._private.utils (top-level), numpy (conditional), numpy.fft._helper (top-level)
|
||||
missing module named numpy._core.amin - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
|
||||
missing module named numpy._core.amax - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
|
||||
missing module named numpy._core.all - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy.testing._private.utils (delayed), numpy (conditional)
|
||||
missing module named numpy._core.add - imported by numpy._core (top-level), numpy.linalg._linalg (top-level), numpy (conditional)
|
||||
missing module named yaml - imported by numpy.__config__ (delayed)
|
||||
missing module named numpy._distributor_init_local - imported by numpy (optional), numpy._distributor_init (optional)
|
||||
missing module named defusedxml - imported by openpyxl.xml (delayed, optional)
|
||||
missing module named lxml - imported by openpyxl.xml (delayed, optional)
|
||||
missing module named 'defusedxml.ElementTree' - imported by openpyxl.xml.functions (conditional)
|
||||
missing module named 'lxml.etree' - imported by openpyxl.xml.functions (conditional)
|
||||
missing module named PIL - imported by openpyxl.drawing.image (optional)
|
||||
missing module named openpyxl.tests - imported by openpyxl.reader.excel (optional)
|
||||
missing module named google.protobuf.pyext._message - imported by google.protobuf.pyext (conditional, optional), google.protobuf.internal.api_implementation (conditional, optional), google.protobuf.descriptor (conditional), google.protobuf.pyext.cpp_message (conditional)
|
||||
missing module named google.protobuf.enable_deterministic_proto_serialization - imported by google.protobuf (optional), google.protobuf.internal.api_implementation (optional)
|
||||
missing module named google.protobuf.internal._api_implementation - imported by google.protobuf.internal (optional), google.protobuf.internal.api_implementation (optional)
|
||||
missing module named grpc_reflection - imported by grpc (optional)
|
||||
missing module named grpc_health - imported by grpc (optional)
|
||||
missing module named pkg_resources - imported by grpc_tools.protoc (conditional)
|
||||
File diff suppressed because it is too large
Load Diff
BIN
devkit/dist/je-skin-devkit-server.exe
vendored
BIN
devkit/dist/je-skin-devkit-server.exe
vendored
Binary file not shown.
1
eskin-finger-sdk
Submodule
1
eskin-finger-sdk
Submodule
Submodule eskin-finger-sdk added at 705375085f
2
package-lock.json
generated
2
package-lock.json
generated
@@ -6,7 +6,7 @@
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "JE-Skin",
|
||||
"version": "0.3.0",
|
||||
"version": "0.4.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "^2",
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
[registries.kellnr]
|
||||
index = "sparse+http://crates.huangyanjie.com/api/v1/crates/"
|
||||
53
src-tauri/Cargo.lock
generated
53
src-tauri/Cargo.lock
generated
@@ -8,10 +8,7 @@ version = "0.4.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-stream",
|
||||
"async-trait",
|
||||
"axum 0.8.9",
|
||||
"chrono",
|
||||
"crc",
|
||||
"csv",
|
||||
"dirs",
|
||||
"eskin-finger-sdk",
|
||||
@@ -19,7 +16,6 @@ dependencies = [
|
||||
"futures-util",
|
||||
"humantime",
|
||||
"log",
|
||||
"ndarray",
|
||||
"prost",
|
||||
"prost-types",
|
||||
"protoc-bin-vendored",
|
||||
@@ -1156,8 +1152,6 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "eskin-finger-sdk"
|
||||
version = "0.1.0"
|
||||
source = "sparse+http://crates.huangyanjie.com/api/v1/crates/"
|
||||
checksum = "341d54dbc70a0fb7cdd04162cdda6ab5735f9a4f717b1921b42c00e8afc37bb9"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"crc",
|
||||
@@ -2482,16 +2476,6 @@ version = "0.8.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3"
|
||||
|
||||
[[package]]
|
||||
name = "matrixmultiply"
|
||||
version = "0.3.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a06de3016e9fae57a36fd14dba131fccf49f74b40b7fbdb472f96e361ec71a08"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"rawpointer",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "memchr"
|
||||
version = "2.8.0"
|
||||
@@ -2581,19 +2565,6 @@ version = "0.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1d87ecb2933e8aeadb3e3a02b828fed80a7528047e68b4f424523a0981a3a084"
|
||||
|
||||
[[package]]
|
||||
name = "ndarray"
|
||||
version = "0.15.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "adb12d4e967ec485a5f71c6311fe28158e9d6f4bc4a447b474184d0f91a8fa32"
|
||||
dependencies = [
|
||||
"matrixmultiply",
|
||||
"num-complex",
|
||||
"num-integer",
|
||||
"num-traits",
|
||||
"rawpointer",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ndk"
|
||||
version = "0.9.0"
|
||||
@@ -2659,30 +2630,12 @@ version = "0.1.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb"
|
||||
|
||||
[[package]]
|
||||
name = "num-complex"
|
||||
version = "0.4.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495"
|
||||
dependencies = [
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-conv"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cf97ec579c3c42f953ef76dbf8d55ac91fb219dde70e49aa4a6b7d74e9919050"
|
||||
|
||||
[[package]]
|
||||
name = "num-integer"
|
||||
version = "0.1.46"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f"
|
||||
dependencies = [
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-traits"
|
||||
version = "0.2.19"
|
||||
@@ -3687,12 +3640,6 @@ version = "0.6.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539"
|
||||
|
||||
[[package]]
|
||||
name = "rawpointer"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3"
|
||||
|
||||
[[package]]
|
||||
name = "redox_syscall"
|
||||
version = "0.5.18"
|
||||
|
||||
@@ -17,7 +17,6 @@ crate-type = ["staticlib", "cdylib", "rlib"]
|
||||
[features]
|
||||
default = []
|
||||
devkit = ["dep:tonic", "dep:prost", "dep:prost-types", "dep:async-stream", "dep:dirs"]
|
||||
multi-dim = ["dep:ndarray"]
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { version = "2", features = [] }
|
||||
@@ -37,23 +36,19 @@ async-stream = { version = "0.3", optional = true }
|
||||
dirs = { version = "6", optional = true }
|
||||
tokio-serial = { version = "5.4.5" }
|
||||
tokio = { version = "1.50.0", features = ["full"] }
|
||||
async-trait = "0.1.89"
|
||||
tokio-util = "0.7.18"
|
||||
serde_json = "1"
|
||||
fern = { version = "0.7.1", features = ["colored", "date-based"] }
|
||||
log = "0.4.29"
|
||||
humantime = "2.3.0"
|
||||
csv = "1.4.0"
|
||||
chrono = "0.4.44"
|
||||
crc = "3.4.0"
|
||||
axum = { version = "0.8", features = ["ws"] }
|
||||
tower-http = { version = "0.6", features = ["cors"] }
|
||||
futures-util = "0.3"
|
||||
uuid = { version = "1.23", features = ["v4", "serde"] }
|
||||
uuid = { version = "1", features = ["v4", "serde"] }
|
||||
rand = "0.8"
|
||||
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
|
||||
ndarray = { version = "0.15", optional = true }
|
||||
eskin-finger-sdk = { version = "0.1.0", registry = "kellnr" }
|
||||
eskin-finger-sdk = { path = "../eskin-finger-sdk" }
|
||||
|
||||
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
|
||||
tauri-plugin-updater = "2"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,217 +0,0 @@
|
||||
{
|
||||
"scaler_mean": [
|
||||
1748.7541486595198,
|
||||
1292.5704664084863,
|
||||
669.8700117864961,
|
||||
1617.8798712839798,
|
||||
2104.589811228976,
|
||||
3267.658809002638,
|
||||
3366.4000112252343,
|
||||
2660.981740285495,
|
||||
2656.615909898786,
|
||||
1747.1196048717518,
|
||||
3093.4178032216423,
|
||||
3107.599371386878,
|
||||
4138.929019101607,
|
||||
3778.3928270752654,
|
||||
3495.851920450506,
|
||||
3110.5580063983834,
|
||||
2310.8518456156107,
|
||||
2899.8918261585377,
|
||||
3286.6881442816784,
|
||||
3601.237076948981,
|
||||
2590.9553048586554,
|
||||
2555.2781425978933,
|
||||
2004.8764850049579,
|
||||
1333.8961665824775,
|
||||
2090.217507623805,
|
||||
0.363302046990876,
|
||||
0.2506597877765041,
|
||||
0.12741811820991292,
|
||||
0.32195020821212794,
|
||||
0.43317540002685884,
|
||||
0.7725988160553472,
|
||||
0.791227193907261,
|
||||
0.5957799875116326,
|
||||
0.5873844015441929,
|
||||
0.35855586659016336,
|
||||
0.7267512979672636,
|
||||
0.7214172326166498,
|
||||
1.0,
|
||||
0.9089476753706724,
|
||||
0.8226695360434777,
|
||||
0.7208819781157673,
|
||||
0.5152795489332506,
|
||||
0.6711736481838434,
|
||||
0.7782925265622518,
|
||||
0.8648282061576593,
|
||||
0.5787625095682526,
|
||||
0.5752349727514727,
|
||||
0.43456864805018935,
|
||||
0.27668525082454587,
|
||||
0.47414670304783574,
|
||||
4138.929019101607,
|
||||
64531.08183195824,
|
||||
175620.92531477427,
|
||||
22.847729696357412,
|
||||
14.671691561018095,
|
||||
0.07533558084489102,
|
||||
12446.865764906175,
|
||||
47945.287047950456,
|
||||
2.8973185436828195,
|
||||
10.774373017335268,
|
||||
3.472192991899253,
|
||||
-0.013941562889309035,
|
||||
0.09672681097411825,
|
||||
0.5067195499928454,
|
||||
0.755407246398865,
|
||||
0.03711810817384146,
|
||||
11.154421806888552,
|
||||
64500.8986854629
|
||||
],
|
||||
"scaler_scale": [
|
||||
1458.5456651154973,
|
||||
1319.8585484401115,
|
||||
798.8535944732339,
|
||||
1467.8233720347457,
|
||||
1637.8964913406842,
|
||||
1330.3349975112737,
|
||||
1391.430499849884,
|
||||
1444.166940848846,
|
||||
1630.948040054198,
|
||||
1406.2203759964518,
|
||||
1289.9699402243327,
|
||||
1442.0533616965101,
|
||||
1437.7214049715994,
|
||||
1393.522474091575,
|
||||
1468.6421185157626,
|
||||
1449.3479990930084,
|
||||
1293.2464048717598,
|
||||
1331.2560392843097,
|
||||
1326.1289536453178,
|
||||
1357.3405110533047,
|
||||
1452.4854193036483,
|
||||
1348.4425883366337,
|
||||
1318.1429721243371,
|
||||
1059.93845215709,
|
||||
1114.1647557935548,
|
||||
0.2395898634701691,
|
||||
0.21706962815914935,
|
||||
0.13523106483202163,
|
||||
0.23880331588910964,
|
||||
0.24830003478347082,
|
||||
0.1464527498295455,
|
||||
0.15391677914992113,
|
||||
0.18125664726966026,
|
||||
0.2326879002599809,
|
||||
0.23502163992653513,
|
||||
0.13026800431597335,
|
||||
0.15563022147466685,
|
||||
1.0,
|
||||
0.09922737602626737,
|
||||
0.18291931318098986,
|
||||
0.15401181704844932,
|
||||
0.2143892844194339,
|
||||
0.16856049162074294,
|
||||
0.15902500893917185,
|
||||
0.18285009098439925,
|
||||
0.17264751056304276,
|
||||
0.21090366624550771,
|
||||
0.16802111677577075,
|
||||
0.19264329284433157,
|
||||
0.19589977001187556,
|
||||
1437.7214049715994,
|
||||
32602.413979370118,
|
||||
95845.11969895993,
|
||||
3.426376344472427,
|
||||
3.408382770733738,
|
||||
0.033353666248921464,
|
||||
5505.629576226806,
|
||||
25703.01200969283,
|
||||
0.4599551450527747,
|
||||
2.978321440052941,
|
||||
0.3916581766443181,
|
||||
0.06096090153067211,
|
||||
0.07864618660494935,
|
||||
0.0344984508436715,
|
||||
0.17668176728315207,
|
||||
0.18905119470509504,
|
||||
5352.30503788098,
|
||||
32297.31796957845
|
||||
],
|
||||
"ridge_coef": [
|
||||
7.4424310127566695,
|
||||
13.345966730219576,
|
||||
2.351840055857306,
|
||||
6.088230738742203,
|
||||
-10.030964629299273,
|
||||
3.876136979406362,
|
||||
-11.251608537526174,
|
||||
16.84502390958064,
|
||||
-2.093552796584439,
|
||||
-5.784923711493545,
|
||||
-6.67830546424787,
|
||||
-4.654052249161928,
|
||||
6.038218458133514,
|
||||
9.82412450487401,
|
||||
-6.200667839175651,
|
||||
-0.3133364534713342,
|
||||
-8.75036029102127,
|
||||
12.785901861589027,
|
||||
-3.7296377182327123,
|
||||
6.546167384121816,
|
||||
-4.984129287282208,
|
||||
8.311396481777527,
|
||||
-0.6248790895663127,
|
||||
2.69008779623183,
|
||||
12.996047839696784,
|
||||
-2.2609944767610504,
|
||||
-5.131537716982507,
|
||||
0.3988922195665723,
|
||||
-5.197736884253156,
|
||||
4.556854888903703,
|
||||
-0.8642438099006351,
|
||||
6.327731485629085,
|
||||
-5.157281763422745,
|
||||
0.10691827520622764,
|
||||
4.656962972053113,
|
||||
3.2628870750114887,
|
||||
4.033159141354671,
|
||||
0.0,
|
||||
-2.9206404009765268,
|
||||
1.8683691849941264,
|
||||
2.408006875407745,
|
||||
7.250310827671452,
|
||||
-3.97015207422554,
|
||||
0.7316093212194048,
|
||||
-3.459346094204882,
|
||||
2.4407660203169255,
|
||||
-2.872982666400644,
|
||||
1.8797071977799857,
|
||||
-1.3374700235689694,
|
||||
-7.9533345474852295,
|
||||
6.038063637368508,
|
||||
1.615806581558555,
|
||||
95785.62883805836,
|
||||
0.12233606167692031,
|
||||
-0.1515900264871255,
|
||||
2.2023033069961873,
|
||||
8.776787743985668,
|
||||
-0.16714060634667535,
|
||||
-2.751671223554021,
|
||||
0.2511944267079865,
|
||||
6.13561607395193,
|
||||
2.85703108671782,
|
||||
-0.11255626089468472,
|
||||
-0.9017242341101542,
|
||||
-0.627291200283328,
|
||||
3.4664885582435883,
|
||||
0.02591345630626686,
|
||||
0.5530407299425606
|
||||
],
|
||||
"ridge_intercept": 175620.9253147744,
|
||||
"n_features": 68,
|
||||
"noise_threshold": 15.0,
|
||||
"contact_threshold": 20.0,
|
||||
"ema_alpha": 0.9
|
||||
}
|
||||
@@ -1,27 +1,18 @@
|
||||
use crate::serial_core::codecs::tactile_a::{
|
||||
export_recording_csv, TactileACodec, TactileACsvImporter, TactileAHandler,
|
||||
};
|
||||
use crate::serial_core::error::SerialError;
|
||||
use crate::serial_core::record::CsvImporter;
|
||||
use crate::serial_core::serial::{PollMode, TactileAPollRequester};
|
||||
use crate::serial_core::{serial, TactileARecording};
|
||||
use crate::serial_core::record::{self, FingerRecording};
|
||||
use crate::serial_core::serial;
|
||||
use eskin_finger_sdk::device::EskinDevice;
|
||||
use log::info;
|
||||
use serde::Serialize;
|
||||
use std::fs::File;
|
||||
use std::io::Cursor;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH};
|
||||
use std::time::{SystemTime, UNIX_EPOCH};
|
||||
use tauri::{async_runtime::JoinHandle, AppHandle, Manager, State};
|
||||
use tokio_serial::{available_ports, SerialPortBuilderExt};
|
||||
use tokio_serial::available_ports;
|
||||
use tokio_util::sync::CancellationToken;
|
||||
|
||||
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>>;
|
||||
type SharedRecording = Arc<Mutex<FingerRecording>>;
|
||||
|
||||
#[derive(Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
@@ -67,18 +58,18 @@ struct SerialSession {
|
||||
port: String,
|
||||
cancel: CancellationToken,
|
||||
task: JoinHandle<()>,
|
||||
current_record: SharedTactileRecording,
|
||||
current_record: SharedRecording,
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct SerialConnectionState {
|
||||
session: Mutex<Option<SerialSession>>,
|
||||
last_record: Mutex<Option<SharedTactileRecording>>,
|
||||
last_record: Mutex<Option<SharedRecording>>,
|
||||
}
|
||||
|
||||
pub async fn shutdown_active_session(
|
||||
state: &SerialConnectionState,
|
||||
) -> Result<Option<(String, SharedTactileRecording)>, SerialError> {
|
||||
) -> Result<Option<(String, SharedRecording)>, SerialError> {
|
||||
let session = {
|
||||
let mut guard = state.session.lock().map_err(|_| SerialError::StateError)?;
|
||||
guard.take()
|
||||
@@ -148,62 +139,41 @@ pub async fn serial_connect(
|
||||
}
|
||||
|
||||
let cancel = CancellationToken::new();
|
||||
let current_record = Arc::new(Mutex::new(TactileARecording::new()));
|
||||
let current_record = Arc::new(Mutex::new(FingerRecording::new()));
|
||||
let task_record = current_record.clone();
|
||||
let task_cancel = cancel.clone();
|
||||
let task_app = app.clone();
|
||||
let task_port_name = port_name.clone();
|
||||
|
||||
let port = tokio_serial::new(&port_name, 921600)
|
||||
.open_native_async()
|
||||
.map_err(|_| SerialError::OpenError)?;
|
||||
let session_started_at = Instant::now();
|
||||
|
||||
let task = tauri::async_runtime::spawn(async move {
|
||||
let codec = TactileACodec::new(DEFAULT_TACTILE_COLS, DEFAULT_TACTILE_ROWS);
|
||||
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),
|
||||
)));
|
||||
// Open device using SDK
|
||||
let session = match serial::open_device(&task_port_name) {
|
||||
Ok(s) => s,
|
||||
Err(e) => {
|
||||
eprintln!("Failed to open device: {e}");
|
||||
cleanup_session(&task_app, &task_port_name, task_record).await;
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
if let Err(error) = serial::run_serial_with_poll(
|
||||
let mut device = session.device;
|
||||
|
||||
// Run stream with recording
|
||||
if let Err(error) = serial::run_stream_with_record(
|
||||
task_app.clone(),
|
||||
port,
|
||||
codec,
|
||||
handler,
|
||||
session_started_at,
|
||||
task_record.clone(),
|
||||
&mut device,
|
||||
task_cancel,
|
||||
poll_mode,
|
||||
task_record.clone(),
|
||||
)
|
||||
.await
|
||||
{
|
||||
eprintln!("serial task exited with error: {error}");
|
||||
}
|
||||
|
||||
let manager = task_app.state::<SerialConnectionState>();
|
||||
if let Ok(mut last_record) = manager.last_record.lock() {
|
||||
*last_record = Some(task_record);
|
||||
}
|
||||
// Close device
|
||||
let _ = device.close();
|
||||
|
||||
let mut session = match manager.session.lock() {
|
||||
Ok(session) => session,
|
||||
Err(_) => return,
|
||||
};
|
||||
|
||||
{
|
||||
let should_clear = session
|
||||
.as_ref()
|
||||
.map(|current| current.port.as_str() == task_port_name.as_str())
|
||||
.unwrap_or(false);
|
||||
|
||||
if should_clear {
|
||||
session.take();
|
||||
}
|
||||
}
|
||||
cleanup_session(&task_app, &task_port_name, task_record).await;
|
||||
});
|
||||
|
||||
let mut session = state.session.lock().map_err(|_| SerialError::StateError)?;
|
||||
@@ -227,6 +197,31 @@ pub async fn serial_connect(
|
||||
})
|
||||
}
|
||||
|
||||
async fn cleanup_session(
|
||||
app: &AppHandle,
|
||||
port_name: &str,
|
||||
record: SharedRecording,
|
||||
) {
|
||||
let manager = app.state::<SerialConnectionState>();
|
||||
if let Ok(mut last_record) = manager.last_record.lock() {
|
||||
*last_record = Some(record);
|
||||
}
|
||||
|
||||
let mut session = match manager.session.lock() {
|
||||
Ok(session) => session,
|
||||
Err(_) => return,
|
||||
};
|
||||
|
||||
let should_clear = session
|
||||
.as_ref()
|
||||
.map(|current| current.port.as_str() == port_name)
|
||||
.unwrap_or(false);
|
||||
|
||||
if should_clear {
|
||||
session.take();
|
||||
}
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn serial_disconnect(
|
||||
state: State<'_, SerialConnectionState>,
|
||||
@@ -293,8 +288,8 @@ pub fn serial_export_csv_to_path(
|
||||
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 rec = resolve_record_for_export(&state)?;
|
||||
let frame_count = write_record_to_csv(rec, &output_path)?;
|
||||
let path = output_path.display().to_string();
|
||||
|
||||
info!("csv exported to {path}, frame_count={frame_count}");
|
||||
@@ -311,22 +306,20 @@ pub fn serial_import_csv(
|
||||
file_name: String,
|
||||
csv_content: String,
|
||||
) -> Result<SerialImportResponse, SerialError> {
|
||||
let mut importer = TactileACsvImporter::new(file_name.as_str());
|
||||
let packets = importer
|
||||
.load(Cursor::new(csv_content.into_bytes()))
|
||||
let packets = record::import_csv(Cursor::new(csv_content.into_bytes()))
|
||||
.map_err(|_| SerialError::ImportError)?;
|
||||
|
||||
if packets.is_empty() {
|
||||
return Err(SerialError::NoRecordedData);
|
||||
}
|
||||
|
||||
let channel_count = packets.first().map(|item| item.data.len()).unwrap_or(0);
|
||||
let channel_count = 1; // fz is a single value per sample
|
||||
let frame_count = packets.len();
|
||||
let frames = packets
|
||||
.into_iter()
|
||||
.map(|packet| SerialImportFrame {
|
||||
data: packet.data,
|
||||
dts_ms: packet.dts_ms,
|
||||
data: vec![packet.fz as i32],
|
||||
dts_ms: packet.timestamp_us / 1000,
|
||||
})
|
||||
.collect();
|
||||
|
||||
@@ -355,7 +348,7 @@ pub fn serial_import_csv_from_path(file_path: String) -> Result<SerialImportResp
|
||||
|
||||
fn resolve_record_for_export(
|
||||
state: &State<'_, SerialConnectionState>,
|
||||
) -> Result<SharedTactileRecording, SerialError> {
|
||||
) -> Result<SharedRecording, SerialError> {
|
||||
let current_record = {
|
||||
let session = state.session.lock().map_err(|_| SerialError::StateError)?;
|
||||
session
|
||||
@@ -406,7 +399,7 @@ fn snapshot_record_frame_count(
|
||||
}
|
||||
|
||||
fn write_record_to_csv(
|
||||
record: SharedTactileRecording,
|
||||
record: SharedRecording,
|
||||
output_path: &Path,
|
||||
) -> Result<usize, SerialError> {
|
||||
if let Some(parent) = output_path.parent() {
|
||||
@@ -415,14 +408,14 @@ fn write_record_to_csv(
|
||||
}
|
||||
}
|
||||
|
||||
let mut file = File::create(output_path).map_err(|_| SerialError::ExportError)?;
|
||||
let file = std::fs::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)?;
|
||||
record::export_recording_csv(&recording, file).map_err(|_| SerialError::ExportError)?;
|
||||
recording.frames.len()
|
||||
};
|
||||
|
||||
|
||||
@@ -1,397 +0,0 @@
|
||||
//! 7×12 柔性压力点阵力估计 - Rust 实现
|
||||
//!
|
||||
//! 与 Python `basin_feature_extractor.py` 完全对齐。
|
||||
//! 内嵌 `model_params.json`,对每帧 7×12 传感器数据提取 68 维特征并用
|
||||
//! StandardScaler + Ridge 回归估计法向力 Fz。
|
||||
|
||||
use serde::Deserialize;
|
||||
|
||||
// ───────────────── 常量 ─────────────────
|
||||
|
||||
const ROWS: usize = 7;
|
||||
const COLS: usize = 12;
|
||||
const ROI_RADIUS: usize = 2;
|
||||
const ROI_SIZE: usize = 2 * ROI_RADIUS + 1; // 5
|
||||
const N_FEATURES: usize = 68; // 25 + 25 + 18
|
||||
|
||||
// ───────────────── 模型参数 JSON(编译时嵌入)─────────────────
|
||||
|
||||
const MODEL_PARAMS_JSON: &str = include_str!("../../resources/model_params.json");
|
||||
|
||||
// ───────────────── 模型参数反序列化 ─────────────────
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
struct ModelParams {
|
||||
scaler_mean: Vec<f64>,
|
||||
scaler_scale: Vec<f64>,
|
||||
ridge_coef: Vec<f64>,
|
||||
ridge_intercept: f64,
|
||||
n_features: usize,
|
||||
noise_threshold: f64,
|
||||
contact_threshold: f64,
|
||||
ema_alpha: f64,
|
||||
}
|
||||
|
||||
// ───────────────── 估算器 ─────────────────
|
||||
|
||||
pub struct BasinForceEstimator {
|
||||
// 模型参数
|
||||
scaler_mean: [f64; N_FEATURES],
|
||||
scaler_scale: [f64; N_FEATURES],
|
||||
ridge_coef: [f64; N_FEATURES],
|
||||
ridge_intercept: f64,
|
||||
// 超参数
|
||||
noise_threshold: f64,
|
||||
contact_threshold: f64,
|
||||
ema_alpha: f64,
|
||||
// 时序状态(需要可变)
|
||||
prev_roi_sum: f64,
|
||||
ema_sum: f64,
|
||||
first_frame: bool,
|
||||
}
|
||||
|
||||
impl BasinForceEstimator {
|
||||
/// 使用编译时内嵌的 model_params.json 创建估算器
|
||||
pub fn new() -> Self {
|
||||
Self::from_json_str(MODEL_PARAMS_JSON)
|
||||
.expect("内嵌 model_params.json 加载失败")
|
||||
}
|
||||
|
||||
pub fn from_json_str(json: &str) -> Result<Self, Box<dyn std::error::Error>> {
|
||||
let p: ModelParams = serde_json::from_str(json)?;
|
||||
if p.n_features != N_FEATURES {
|
||||
return Err(format!(
|
||||
"模型特征维度不匹配: 期望 {}, 实际 {}",
|
||||
N_FEATURES, p.n_features
|
||||
)
|
||||
.into());
|
||||
}
|
||||
let mut scaler_mean = [0.0; N_FEATURES];
|
||||
let mut scaler_scale = [0.0; N_FEATURES];
|
||||
let mut ridge_coef = [0.0; N_FEATURES];
|
||||
scaler_mean.copy_from_slice(&p.scaler_mean);
|
||||
scaler_scale.copy_from_slice(&p.scaler_scale);
|
||||
ridge_coef.copy_from_slice(&p.ridge_coef);
|
||||
|
||||
Ok(Self {
|
||||
scaler_mean,
|
||||
scaler_scale,
|
||||
ridge_coef,
|
||||
ridge_intercept: p.ridge_intercept,
|
||||
noise_threshold: p.noise_threshold,
|
||||
contact_threshold: p.contact_threshold,
|
||||
ema_alpha: p.ema_alpha,
|
||||
prev_roi_sum: 0.0,
|
||||
ema_sum: 0.0,
|
||||
first_frame: true,
|
||||
})
|
||||
}
|
||||
|
||||
pub fn reset(&mut self) {
|
||||
self.prev_roi_sum = 0.0;
|
||||
self.ema_sum = 0.0;
|
||||
self.first_frame = true;
|
||||
}
|
||||
|
||||
pub fn predict_frame(&mut self, frame: &[f64; 84]) -> f64 {
|
||||
let features = self.extract_features(frame);
|
||||
self.ridge_predict(&features)
|
||||
}
|
||||
|
||||
// ───────────── 特征提取 ─────────────
|
||||
|
||||
fn extract_features(&mut self, raw: &[f64; 84]) -> [f64; N_FEATURES] {
|
||||
let mut x = [[0.0f64; COLS]; ROWS];
|
||||
let mut max_value = 0.0f64;
|
||||
for r in 0..ROWS {
|
||||
for c in 0..COLS {
|
||||
let v = raw[r * COLS + c].max(0.0);
|
||||
x[r][c] = v;
|
||||
if v > max_value {
|
||||
max_value = v;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if max_value < self.contact_threshold {
|
||||
self.update_temporal(0.0);
|
||||
return [0.0; N_FEATURES];
|
||||
}
|
||||
|
||||
let mut peak_row = 0usize;
|
||||
let mut peak_col = 0usize;
|
||||
for r in 0..ROWS {
|
||||
for c in 0..COLS {
|
||||
if x[r][c] >= x[peak_row][peak_col] {
|
||||
peak_row = r;
|
||||
peak_col = c;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let roi = self.extract_roi(&x, peak_row, peak_col);
|
||||
self.compute_features(&x, &roi, max_value, peak_row, peak_col)
|
||||
}
|
||||
|
||||
fn extract_roi(
|
||||
&self,
|
||||
x: &[[f64; COLS]; ROWS],
|
||||
pr: usize,
|
||||
pc: usize,
|
||||
) -> [[f64; ROI_SIZE]; ROI_SIZE] {
|
||||
let r = ROI_RADIUS as isize;
|
||||
let mut roi = [[0.0f64; ROI_SIZE]; ROI_SIZE];
|
||||
|
||||
let r_start = (pr as isize - r).max(0) as usize;
|
||||
let r_end = (pr + ROI_RADIUS + 1).min(ROWS);
|
||||
let c_start = (pc as isize - r).max(0) as usize;
|
||||
let c_end = (pc + ROI_RADIUS + 1).min(COLS);
|
||||
|
||||
let roi_r_start = (r_start as isize - (pr as isize - r)).max(0) as usize;
|
||||
let roi_c_start = (c_start as isize - (pc as isize - r)).max(0) as usize;
|
||||
|
||||
for (i, ri) in (r_start..r_end).enumerate() {
|
||||
for (j, ci) in (c_start..c_end).enumerate() {
|
||||
roi[roi_r_start + i][roi_c_start + j] = x[ri][ci];
|
||||
}
|
||||
}
|
||||
roi
|
||||
}
|
||||
|
||||
fn compute_features(
|
||||
&mut self,
|
||||
x: &[[f64; COLS]; ROWS],
|
||||
roi: &[[f64; ROI_SIZE]; ROI_SIZE],
|
||||
max_value: f64,
|
||||
peak_row: usize,
|
||||
peak_col: usize,
|
||||
) -> [f64; N_FEATURES] {
|
||||
let center = ROI_RADIUS;
|
||||
let mut feat = [0.0f64; N_FEATURES];
|
||||
let mut idx = 0;
|
||||
|
||||
// ROI 原始值 (25维)
|
||||
for r in 0..ROI_SIZE {
|
||||
for c in 0..ROI_SIZE {
|
||||
feat[idx] = roi[r][c];
|
||||
idx += 1;
|
||||
}
|
||||
}
|
||||
|
||||
// ROI 归一化形状 (25维)
|
||||
for r in 0..ROI_SIZE {
|
||||
for c in 0..ROI_SIZE {
|
||||
feat[idx] = if max_value > 0.0 {
|
||||
roi[r][c] / max_value
|
||||
} else {
|
||||
0.0
|
||||
};
|
||||
idx += 1;
|
||||
}
|
||||
}
|
||||
|
||||
// roi_sum, global_sum
|
||||
let mut roi_sum = 0.0f64;
|
||||
for r in 0..ROI_SIZE {
|
||||
for c in 0..ROI_SIZE {
|
||||
roi_sum += roi[r][c];
|
||||
}
|
||||
}
|
||||
let mut global_sum = 0.0f64;
|
||||
for r in 0..ROWS {
|
||||
for c in 0..COLS {
|
||||
global_sum += x[r][c];
|
||||
}
|
||||
}
|
||||
|
||||
// active_area
|
||||
let thr = self.noise_threshold.max(0.05 * max_value);
|
||||
let mut active_area = 0.0f64;
|
||||
for r in 0..ROI_SIZE {
|
||||
for c in 0..ROI_SIZE {
|
||||
if roi[r][c] > thr {
|
||||
active_area += 1.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let participation = if max_value > 0.0 {
|
||||
roi_sum / max_value
|
||||
} else {
|
||||
0.0
|
||||
};
|
||||
let concentration = if roi_sum > 0.0 {
|
||||
max_value / roi_sum
|
||||
} else {
|
||||
0.0
|
||||
};
|
||||
|
||||
// ring1_sum (上下左右4点)
|
||||
let ring1_positions = [
|
||||
(center - 1, center),
|
||||
(center + 1, center),
|
||||
(center, center - 1),
|
||||
(center, center + 1),
|
||||
];
|
||||
let ring1_sum: f64 = ring1_positions.iter().map(|&(r, c)| roi[r][c]).sum();
|
||||
|
||||
// ring2_sum (除中心和ring1外)
|
||||
let mut ring2_sum = 0.0f64;
|
||||
for r in 0..ROI_SIZE {
|
||||
for c in 0..ROI_SIZE {
|
||||
if (r, c) == (center, center) {
|
||||
continue;
|
||||
}
|
||||
if ring1_positions.contains(&(r, c)) {
|
||||
continue;
|
||||
}
|
||||
ring2_sum += roi[r][c];
|
||||
}
|
||||
}
|
||||
|
||||
let ring1_ratio = if max_value > 0.0 {
|
||||
ring1_sum / max_value
|
||||
} else {
|
||||
0.0
|
||||
};
|
||||
let ring2_ratio = if max_value > 0.0 {
|
||||
ring2_sum / max_value
|
||||
} else {
|
||||
0.0
|
||||
};
|
||||
|
||||
// spread
|
||||
let spread = if roi_sum > 0.0 {
|
||||
let mut s = 0.0f64;
|
||||
for r in 0..ROI_SIZE {
|
||||
for c in 0..ROI_SIZE {
|
||||
let dr = r as f64 - center as f64;
|
||||
let dc = c as f64 - center as f64;
|
||||
s += (dr * dr + dc * dc) * roi[r][c];
|
||||
}
|
||||
}
|
||||
s / roi_sum
|
||||
} else {
|
||||
0.0
|
||||
};
|
||||
|
||||
// asym_x
|
||||
let mut left_sum = 0.0f64;
|
||||
let mut right_sum = 0.0f64;
|
||||
for r in 0..ROI_SIZE {
|
||||
for c in 0..center {
|
||||
left_sum += roi[r][c];
|
||||
}
|
||||
for c in (center + 1)..ROI_SIZE {
|
||||
right_sum += roi[r][c];
|
||||
}
|
||||
}
|
||||
let asym_x = if roi_sum > 0.0 {
|
||||
(right_sum - left_sum) / roi_sum
|
||||
} else {
|
||||
0.0
|
||||
};
|
||||
|
||||
// asym_y
|
||||
let mut up_sum = 0.0f64;
|
||||
let mut down_sum = 0.0f64;
|
||||
for r in 0..center {
|
||||
for c in 0..ROI_SIZE {
|
||||
up_sum += roi[r][c];
|
||||
}
|
||||
}
|
||||
for r in (center + 1)..ROI_SIZE {
|
||||
for c in 0..ROI_SIZE {
|
||||
down_sum += roi[r][c];
|
||||
}
|
||||
}
|
||||
let asym_y = if roi_sum > 0.0 {
|
||||
(down_sum - up_sum) / roi_sum
|
||||
} else {
|
||||
0.0
|
||||
};
|
||||
|
||||
// 位置
|
||||
let peak_row_norm = peak_row as f64 / (ROWS - 1) as f64;
|
||||
let peak_col_norm = peak_col as f64 / (COLS - 1) as f64;
|
||||
|
||||
// near_edge
|
||||
let r = ROI_RADIUS as isize;
|
||||
let near_edge = if (peak_row as isize) < r
|
||||
|| peak_row >= ROWS - ROI_RADIUS
|
||||
|| (peak_col as isize) < r
|
||||
|| peak_col >= COLS - ROI_RADIUS
|
||||
{
|
||||
1.0
|
||||
} else {
|
||||
0.0
|
||||
};
|
||||
|
||||
// 时序特征
|
||||
let delta_sum = roi_sum - self.prev_roi_sum;
|
||||
if self.first_frame {
|
||||
self.ema_sum = roi_sum;
|
||||
self.first_frame = false;
|
||||
} else {
|
||||
self.ema_sum = self.ema_alpha * self.ema_sum + (1.0 - self.ema_alpha) * roi_sum;
|
||||
}
|
||||
self.prev_roi_sum = roi_sum;
|
||||
|
||||
let scalars = [
|
||||
max_value,
|
||||
roi_sum,
|
||||
global_sum,
|
||||
active_area,
|
||||
participation,
|
||||
concentration,
|
||||
ring1_sum,
|
||||
ring2_sum,
|
||||
ring1_ratio,
|
||||
ring2_ratio,
|
||||
spread,
|
||||
asym_x,
|
||||
asym_y,
|
||||
peak_row_norm,
|
||||
peak_col_norm,
|
||||
near_edge,
|
||||
delta_sum,
|
||||
self.ema_sum,
|
||||
];
|
||||
for &v in &scalars {
|
||||
feat[idx] = v;
|
||||
idx += 1;
|
||||
}
|
||||
|
||||
debug_assert_eq!(idx, N_FEATURES);
|
||||
feat
|
||||
}
|
||||
|
||||
fn update_temporal(&mut self, roi_sum: f64) {
|
||||
self.prev_roi_sum = roi_sum;
|
||||
if self.first_frame {
|
||||
self.ema_sum = roi_sum;
|
||||
self.first_frame = false;
|
||||
} else {
|
||||
self.ema_sum = self.ema_alpha * self.ema_sum + (1.0 - self.ema_alpha) * roi_sum;
|
||||
}
|
||||
}
|
||||
|
||||
// ───────────── 推理 ─────────────
|
||||
|
||||
fn ridge_predict(&self, features: &[f64; N_FEATURES]) -> f64 {
|
||||
let mut scaled = [0.0f64; N_FEATURES];
|
||||
for i in 0..N_FEATURES {
|
||||
let s = self.scaler_scale[i];
|
||||
scaled[i] = if s.abs() > 1e-12 {
|
||||
(features[i] - self.scaler_mean[i]) / s
|
||||
} else {
|
||||
0.0
|
||||
};
|
||||
}
|
||||
let mut y = self.ridge_intercept;
|
||||
for i in 0..N_FEATURES {
|
||||
y += self.ridge_coef[i] * scaled[i];
|
||||
}
|
||||
y
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
use crate::serial_core::error::CodecError;
|
||||
use std::time::Instant;
|
||||
pub trait Codec<F> {
|
||||
fn decode(&mut self, input: &[u8], session_started_at: Instant) -> Result<Vec<F>, CodecError>;
|
||||
fn encode(&self, frame: &F) -> Result<Vec<u8>, CodecError>;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
use crate::serial_core::{frame::TestFrame, record::Recording};
|
||||
|
||||
pub mod test;
|
||||
pub mod tactile_a;
|
||||
pub type TestRecording = Recording<TestFrame>;
|
||||
@@ -1,383 +0,0 @@
|
||||
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, info};
|
||||
|
||||
const FRAME_BUFFER_MIN_LENGTH: usize = 15;
|
||||
|
||||
pub struct TactileACodec {
|
||||
buffer: Vec<u8>,
|
||||
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(),
|
||||
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| {
|
||||
let raw = u16::from_le_bytes([chunk[0], chunk[1]]) as i32;
|
||||
if raw < 15 {
|
||||
0
|
||||
} else {
|
||||
raw
|
||||
}
|
||||
})
|
||||
.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);
|
||||
info!("send: {:02X?}", req_bytes);
|
||||
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)?;
|
||||
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.push("summary".to_string());
|
||||
header
|
||||
}
|
||||
|
||||
fn csv_row(
|
||||
&self,
|
||||
item: &RecordedFrame<TactileARepFrame>,
|
||||
) -> anyhow::Result<Vec<String>> {
|
||||
let packet = TactileADataPacket::try_from(&item.frame)?;
|
||||
let summary: i32 = packet.data.iter().sum();
|
||||
let mut row: Vec<String> = packet.data.iter().map(|x| x.to_string()).collect();
|
||||
row.push(packet.dts_ms.to_string());
|
||||
row.push(summary.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)
|
||||
}
|
||||
@@ -1,256 +0,0 @@
|
||||
use std::io::Read;
|
||||
use std::time::Instant;
|
||||
use crate::serial_core::frame::{FrameHandler};
|
||||
use crate::serial_core::{codec::Codec, error::CodecError, frame::TestFrame};
|
||||
use anyhow::anyhow;
|
||||
use async_trait::async_trait;
|
||||
use csv::StringRecord;
|
||||
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 {
|
||||
buffer: Vec<u8>,
|
||||
}
|
||||
|
||||
pub struct TestHandler;
|
||||
|
||||
impl TestCodec {
|
||||
pub fn new() -> TestCodec {
|
||||
Self { buffer: Vec::new() }
|
||||
}
|
||||
}
|
||||
|
||||
impl Codec<TestFrame> for TestCodec {
|
||||
fn decode(&mut self, input: &[u8], session_started_at: Instant) -> Result<Vec<TestFrame>, CodecError> {
|
||||
self.buffer.extend_from_slice(input);
|
||||
let mut frames = Vec::new();
|
||||
|
||||
loop {
|
||||
if self.buffer.len() < 6 {
|
||||
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() < 6 {
|
||||
break;
|
||||
}
|
||||
|
||||
let cmd = self.buffer[2];
|
||||
let length_bytes = [self.buffer[3], self.buffer[4]];
|
||||
let length = u16::from_be_bytes(length_bytes) as usize;
|
||||
let frame_length = (length + 6) as usize;
|
||||
if self.buffer.len() < frame_length {
|
||||
break;
|
||||
}
|
||||
let payload = self.buffer[5..5 + length].to_vec();
|
||||
// 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 {
|
||||
self.buffer.drain(0..1);
|
||||
continue;
|
||||
}
|
||||
let dts = elapsed_millis(session_started_at);
|
||||
println!("dts_ms: {dts}");
|
||||
frames.push(TestFrame {
|
||||
header: [0xAA, 0x55],
|
||||
cmd: cmd,
|
||||
length: length,
|
||||
payload: payload,
|
||||
checksum: checksum,
|
||||
dts_ms: dts,
|
||||
});
|
||||
|
||||
self.buffer.drain(0..frame_length);
|
||||
}
|
||||
|
||||
Ok(frames)
|
||||
}
|
||||
fn encode(&self, frame: &TestFrame) -> Result<Vec<u8>, CodecError> {
|
||||
let _ = u16::try_from(frame.payload.len()).map_err(|_| CodecError::PayloadTooLarge)?;
|
||||
let mut out = Vec::with_capacity(6 + frame.length);
|
||||
out.extend_from_slice(&frame.header);
|
||||
out.push(frame.cmd);
|
||||
out.extend_from_slice(&usize_to_u16_be_bytes(frame.length));
|
||||
out.extend_from_slice(&frame.payload);
|
||||
out.push(frame.checksum);
|
||||
|
||||
Ok(out)
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl FrameHandler<TestFrame, i32> for TestHandler {
|
||||
async fn on_frame(&mut self, frame: &TestFrame) -> anyhow::Result<Option<Vec<i32>>> {
|
||||
match frame.cmd {
|
||||
0x01 => {
|
||||
let vals = parse_data_frame(&frame.payload)?;
|
||||
Ok(Some(vals))
|
||||
}
|
||||
_ => Ok(None),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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_be_bytes([chunk[0], chunk[1]]) as i32)
|
||||
.collect::<Vec<i32>>();
|
||||
|
||||
Ok(vals)
|
||||
}
|
||||
|
||||
pub struct TestCsvExporter;
|
||||
pub struct TestCsvImporter {
|
||||
channels: usize,
|
||||
data_row: usize,
|
||||
packets: Vec<TestDataPacket>,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct TestDataPacket {
|
||||
pub data: Vec<i32>,
|
||||
pub dts_ms: u64
|
||||
}
|
||||
|
||||
impl TryFrom<&TestFrame> for TestDataPacket {
|
||||
type Error = CodecError;
|
||||
fn try_from(frame: &TestFrame) -> Result<TestDataPacket, Self::Error> {
|
||||
let data = parse_data_frame(&frame.payload)?;
|
||||
let dts = frame.dts_ms;
|
||||
Ok(TestDataPacket { data: data, dts_ms: dts })
|
||||
}
|
||||
}
|
||||
// impl From<TestFrame> for TestDataPacket {
|
||||
// fn from(frame: TestFrame) -> Self {
|
||||
// let data = parse_data_frame(&frame.payload)?;
|
||||
// let dts = frame.dts_ms;
|
||||
// TestDataPacket { data: data, dts_ms: dts }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
impl CsvExporter<TestFrame> for TestCsvExporter {
|
||||
type Error = CodecError;
|
||||
fn csv_header(&self, recording: &Recording<TestFrame>) -> Vec<String> {
|
||||
let channel_nb = recording
|
||||
.frames
|
||||
.iter()
|
||||
.find_map(|frame| parse_data_frame(&frame.frame.payload).ok().map(|vals| vals.len()))
|
||||
.unwrap_or(0);
|
||||
let mut header: Vec<String> = Vec::new();
|
||||
for i in 0..channel_nb {
|
||||
header.push(format!("channel{}", i + 1));
|
||||
}
|
||||
header.push("dts".to_string());
|
||||
|
||||
header
|
||||
}
|
||||
|
||||
fn csv_row(&self, item: &RecordedFrame<TestFrame>) -> anyhow::Result<Vec<String>> {
|
||||
let packet: TestDataPacket = TestDataPacket::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 TestCsvImporter {
|
||||
pub fn new(_path: &str) -> TestCsvImporter {
|
||||
Self {
|
||||
channels: 0,
|
||||
data_row: 0,
|
||||
packets: Vec::new(),
|
||||
}
|
||||
}
|
||||
|
||||
fn parse_record(&mut self, record: StringRecord) -> anyhow::Result<TestDataPacket>{
|
||||
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(TestDataPacket {
|
||||
data: data,
|
||||
dts_ms: dts_ms,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl CsvImporter<TestDataPacket> for TestCsvImporter {
|
||||
fn load<R: Read>(&mut self, reader: R) -> anyhow::Result<Vec<TestDataPacket>> {
|
||||
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<TestFrame>, writer: W) -> anyhow::Result<()>
|
||||
where
|
||||
W: std::io::Write,
|
||||
{
|
||||
write_csv(recording, &TestCsvExporter, writer)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use csv::Reader;
|
||||
use std::io::Cursor;
|
||||
|
||||
#[test]
|
||||
fn test_read_csv_basic() -> anyhow::Result<()> {
|
||||
let mut rdr = Reader::from_path("recording_20260329_125238.csv")?;
|
||||
let headers = rdr.headers()?;
|
||||
println!("headers: {:?}", headers);
|
||||
|
||||
for result in rdr.records() {
|
||||
let record = result?;
|
||||
println!("record: {:?}", record);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
use anyhow::Result;
|
||||
use async_trait::async_trait;
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct TestFrame {
|
||||
pub header: [u8; 2],
|
||||
pub cmd: u8,
|
||||
pub length: usize,
|
||||
pub payload: Vec<u8>,
|
||||
pub checksum: u8,
|
||||
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]
|
||||
pub trait FrameHandler<F, T>: Send {
|
||||
async fn on_frame(&mut self, frame: &F) -> Result<Option<Vec<T>>>;
|
||||
}
|
||||
|
||||
@@ -1,35 +1,4 @@
|
||||
use crate::serial_core::{
|
||||
frame::{TactileAFrame, TestFrame},
|
||||
record::Recording,
|
||||
};
|
||||
|
||||
pub mod codec;
|
||||
pub mod codecs;
|
||||
pub mod error;
|
||||
pub mod frame;
|
||||
pub mod model;
|
||||
pub mod serial;
|
||||
pub mod record;
|
||||
pub mod utils;
|
||||
#[cfg(feature = "multi-dim")]
|
||||
pub mod multi_dim_force;
|
||||
pub mod basin_force_estimator;
|
||||
|
||||
pub type TestRecording = Recording<TestFrame>;
|
||||
pub type TactileARecording = Recording<TactileAFrame>;
|
||||
|
||||
pub struct SerialConnection {
|
||||
pub port: String,
|
||||
}
|
||||
|
||||
pub fn connect(port: &str) -> Result<SerialConnection, String> {
|
||||
let port = port.trim();
|
||||
|
||||
if port.is_empty() {
|
||||
return Err("Serial port is required".to_string());
|
||||
}
|
||||
|
||||
Ok(SerialConnection {
|
||||
port: port.to_string(),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
use crate::serial_core::frame::TestFrame;
|
||||
use std::collections::HashMap;
|
||||
use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH};
|
||||
|
||||
const MAX_POINTS: usize = 28;
|
||||
const MAX_SUMMARY_POINTS: usize = 42;
|
||||
const PANEL_STALE_AFTER: Duration = Duration::from_millis(2400);
|
||||
|
||||
@@ -74,16 +72,6 @@ pub struct HudSignalIcon {
|
||||
pub tone: HudTone,
|
||||
}
|
||||
|
||||
struct HudPanelUpdate {
|
||||
source_id: String,
|
||||
values: Vec<f32>,
|
||||
}
|
||||
|
||||
struct PanelEntry {
|
||||
panel: HudSignalPanel,
|
||||
last_seen: Instant,
|
||||
}
|
||||
|
||||
pub struct HudChartState {
|
||||
panels: HashMap<String, PanelEntry>,
|
||||
order: Vec<String>,
|
||||
@@ -92,6 +80,11 @@ pub struct HudChartState {
|
||||
last_frame_seen: Option<Instant>,
|
||||
}
|
||||
|
||||
struct PanelEntry {
|
||||
panel: HudSignalPanel,
|
||||
last_seen: Instant,
|
||||
}
|
||||
|
||||
impl HudChartState {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
@@ -105,76 +98,21 @@ impl HudChartState {
|
||||
|
||||
pub fn record_summary(&mut self, value: f32) {
|
||||
push_summary_point(&mut self.summary_points, value);
|
||||
self.last_frame_seen = Some(Instant::now());
|
||||
}
|
||||
|
||||
pub fn record_pressure_matrix(&mut self, values: &[i32]) {
|
||||
pub fn record_pressure_matrix(&mut self, values: &[f32]) {
|
||||
if values.is_empty() {
|
||||
return;
|
||||
}
|
||||
|
||||
self.pressure_matrix = Some(values.iter().map(|value| *value as f32).collect());
|
||||
}
|
||||
|
||||
pub fn apply_frame(&mut self, frame: &TestFrame, decoded_values: Option<&[i32]>) -> HudPacket {
|
||||
let now = Instant::now();
|
||||
self.last_frame_seen = Some(now);
|
||||
|
||||
for update in expand_frame_updates(frame, decoded_values) {
|
||||
self.apply_update(update, now);
|
||||
}
|
||||
|
||||
self.prune_stale_at(now);
|
||||
self.snapshot()
|
||||
self.pressure_matrix = Some(values.to_vec());
|
||||
}
|
||||
|
||||
pub fn prune_stale(&mut self) -> Option<HudPacket> {
|
||||
let now = Instant::now();
|
||||
let before = self.panels.len();
|
||||
let summary_points_before = self.summary_points.len();
|
||||
self.prune_stale_at(Instant::now());
|
||||
let summary_before = self.summary_points.len();
|
||||
|
||||
if before == self.panels.len() && summary_points_before == self.summary_points.len() {
|
||||
return None;
|
||||
}
|
||||
|
||||
Some(self.snapshot())
|
||||
}
|
||||
|
||||
fn apply_update(&mut self, update: HudPanelUpdate, now: Instant) {
|
||||
if update.values.is_empty() {
|
||||
return;
|
||||
}
|
||||
|
||||
if !self.panels.contains_key(&update.source_id) {
|
||||
let next_side = side_for_index(self.order.len());
|
||||
self.order.push(update.source_id.clone());
|
||||
self.panels.insert(
|
||||
update.source_id.clone(),
|
||||
PanelEntry {
|
||||
panel: build_panel(&update.source_id, next_side, update.values.len()),
|
||||
last_seen: now,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
let entry = self
|
||||
.panels
|
||||
.get_mut(&update.source_id)
|
||||
.expect("panel entry should exist after insertion");
|
||||
|
||||
entry.last_seen = now;
|
||||
entry.panel.active = true;
|
||||
ensure_panel_channels(&mut entry.panel, update.values.len());
|
||||
|
||||
for (index, value) in update.values.into_iter().enumerate() {
|
||||
if let Some(series) = entry.panel.series.get_mut(index) {
|
||||
push_point(&mut series.points, value);
|
||||
}
|
||||
}
|
||||
|
||||
refresh_panel_stats(&mut entry.panel);
|
||||
}
|
||||
|
||||
fn prune_stale_at(&mut self, now: Instant) {
|
||||
self.panels
|
||||
.retain(|_, entry| now.duration_since(entry.last_seen) <= PANEL_STALE_AFTER);
|
||||
self.order.retain(|id| self.panels.contains_key(id));
|
||||
@@ -189,6 +127,16 @@ impl HudChartState {
|
||||
self.pressure_matrix = None;
|
||||
self.last_frame_seen = None;
|
||||
}
|
||||
|
||||
if before == self.panels.len() && summary_before == self.summary_points.len() {
|
||||
return None;
|
||||
}
|
||||
|
||||
Some(self.snapshot())
|
||||
}
|
||||
|
||||
pub fn build_snapshot(&mut self) -> HudPacket {
|
||||
self.snapshot()
|
||||
}
|
||||
|
||||
fn snapshot(&mut self) -> HudPacket {
|
||||
@@ -223,106 +171,6 @@ impl Default for HudChartState {
|
||||
}
|
||||
}
|
||||
|
||||
fn build_panel(source_id: &str, side: HudPanelSide, channel_count: usize) -> HudSignalPanel {
|
||||
HudSignalPanel {
|
||||
id: format!("panel-{source_id}"),
|
||||
code: source_id.to_string(),
|
||||
title: format!("Source {source_id}"),
|
||||
side,
|
||||
active: true,
|
||||
series: build_panel_series(source_id, channel_count, &[]),
|
||||
icons: build_panel_icons(source_id, channel_count),
|
||||
latest: None,
|
||||
min: None,
|
||||
max: None,
|
||||
}
|
||||
}
|
||||
|
||||
fn expand_frame_updates(frame: &TestFrame, decoded_values: Option<&[i32]>) -> Vec<HudPanelUpdate> {
|
||||
if let Some(values) = decoded_values {
|
||||
if values.is_empty() {
|
||||
return Vec::new();
|
||||
}
|
||||
|
||||
return vec![HudPanelUpdate {
|
||||
source_id: format_source_id(frame.cmd),
|
||||
values: values.iter().map(|value| *value as f32).collect(),
|
||||
}];
|
||||
}
|
||||
|
||||
let chunks = frame.payload.chunks_exact(4);
|
||||
|
||||
if !frame.payload.is_empty() && chunks.remainder().is_empty() {
|
||||
return chunks.map(build_update_from_chunk).collect();
|
||||
}
|
||||
|
||||
vec![HudPanelUpdate {
|
||||
source_id: format_source_id(frame.cmd),
|
||||
values: fallback_values(frame),
|
||||
}]
|
||||
}
|
||||
|
||||
fn build_update_from_chunk(chunk: &[u8]) -> HudPanelUpdate {
|
||||
HudPanelUpdate {
|
||||
source_id: format_source_id(chunk[0]),
|
||||
values: chunk[1..]
|
||||
.iter()
|
||||
.enumerate()
|
||||
.map(|(index, byte)| normalize_value(*byte, tone_for_index(index)))
|
||||
.collect(),
|
||||
}
|
||||
}
|
||||
|
||||
fn fallback_values(frame: &TestFrame) -> Vec<f32> {
|
||||
let mut bytes = frame.payload.clone();
|
||||
|
||||
if bytes.is_empty() {
|
||||
bytes.extend([
|
||||
frame.cmd,
|
||||
frame.length as u8,
|
||||
frame.checksum,
|
||||
frame.cmd.wrapping_add(frame.checksum),
|
||||
]);
|
||||
}
|
||||
|
||||
while bytes.len() < 3 {
|
||||
let previous = *bytes.last().unwrap_or(&frame.cmd);
|
||||
bytes.push(
|
||||
previous
|
||||
.wrapping_add(frame.cmd)
|
||||
.wrapping_add(bytes.len() as u8),
|
||||
);
|
||||
}
|
||||
|
||||
bytes
|
||||
.into_iter()
|
||||
.enumerate()
|
||||
.map(|(index, byte)| normalize_value(byte, tone_for_index(index)))
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn normalize_value(byte: u8, tone: HudTone) -> f32 {
|
||||
let base = (byte as f32 / 255.0) * 100.0;
|
||||
let offset = match tone {
|
||||
HudTone::Cyan => 6.0,
|
||||
HudTone::Lime => 0.0,
|
||||
HudTone::Orange => -6.0,
|
||||
HudTone::Violet => 10.0,
|
||||
HudTone::Gold => -10.0,
|
||||
HudTone::Rose => 3.0,
|
||||
};
|
||||
|
||||
(base + offset).clamp(0.0, 100.0)
|
||||
}
|
||||
|
||||
fn format_source_id(byte: u8) -> String {
|
||||
if byte.is_ascii_alphanumeric() {
|
||||
(byte as char).to_ascii_uppercase().to_string()
|
||||
} else {
|
||||
format!("CH{:02X}", byte)
|
||||
}
|
||||
}
|
||||
|
||||
fn side_for_index(index: usize) -> HudPanelSide {
|
||||
if index % 2 == 0 {
|
||||
HudPanelSide::Left
|
||||
@@ -331,91 +179,6 @@ fn side_for_index(index: usize) -> HudPanelSide {
|
||||
}
|
||||
}
|
||||
|
||||
fn push_point(points: &mut Vec<f32>, value: f32) {
|
||||
if points.len() >= MAX_POINTS {
|
||||
points.remove(0);
|
||||
}
|
||||
|
||||
points.push((value * 10.0).round() / 10.0);
|
||||
}
|
||||
|
||||
fn build_panel_series(
|
||||
source_id: &str,
|
||||
channel_count: usize,
|
||||
previous: &[HudSignalSeries],
|
||||
) -> Vec<HudSignalSeries> {
|
||||
(0..channel_count)
|
||||
.map(|index| HudSignalSeries {
|
||||
id: format!("{source_id}-series-{}", index + 1),
|
||||
tone: tone_for_index(index),
|
||||
points: previous
|
||||
.get(index)
|
||||
.map(|series| series.points.clone())
|
||||
.unwrap_or_default(),
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn build_panel_icons(source_id: &str, channel_count: usize) -> Vec<HudSignalIcon> {
|
||||
(0..channel_count)
|
||||
.map(|index| HudSignalIcon {
|
||||
id: format!("{source_id}-icon-{}", index + 1),
|
||||
label: if channel_count == 1 {
|
||||
"TOTAL".to_string()
|
||||
} else {
|
||||
format!("{source_id}-{}", index + 1)
|
||||
},
|
||||
tone: tone_for_index(index),
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn ensure_panel_channels(panel: &mut HudSignalPanel, channel_count: usize) {
|
||||
if panel.series.len() == channel_count && panel.icons.len() == channel_count {
|
||||
return;
|
||||
}
|
||||
|
||||
panel.series = build_panel_series(&panel.code, channel_count, &panel.series);
|
||||
panel.icons = build_panel_icons(&panel.code, channel_count);
|
||||
}
|
||||
|
||||
fn refresh_panel_stats(panel: &mut HudSignalPanel) {
|
||||
let latest_values: Vec<f32> = panel
|
||||
.series
|
||||
.iter()
|
||||
.filter_map(|series| series.points.last().copied())
|
||||
.collect();
|
||||
|
||||
panel.latest = if latest_values.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(latest_values.iter().sum::<f32>() / latest_values.len() as f32)
|
||||
};
|
||||
|
||||
panel.min = panel
|
||||
.series
|
||||
.iter()
|
||||
.flat_map(|series| series.points.iter().copied())
|
||||
.reduce(f32::min);
|
||||
|
||||
panel.max = panel
|
||||
.series
|
||||
.iter()
|
||||
.flat_map(|series| series.points.iter().copied())
|
||||
.reduce(f32::max);
|
||||
}
|
||||
|
||||
fn tone_for_index(index: usize) -> HudTone {
|
||||
match index % 6 {
|
||||
0 => HudTone::Cyan,
|
||||
1 => HudTone::Lime,
|
||||
2 => HudTone::Orange,
|
||||
3 => HudTone::Violet,
|
||||
4 => HudTone::Gold,
|
||||
_ => HudTone::Rose,
|
||||
}
|
||||
}
|
||||
|
||||
fn push_summary_point(points: &mut Vec<f32>, value: f32) {
|
||||
if points.len() >= MAX_SUMMARY_POINTS {
|
||||
points.remove(0);
|
||||
@@ -440,61 +203,3 @@ fn now_millis() -> u64 {
|
||||
.map(|duration| duration.as_millis() as u64)
|
||||
.unwrap_or_default()
|
||||
}
|
||||
|
||||
// #[cfg(test)]
|
||||
// mod tests {
|
||||
// use super::*;
|
||||
//
|
||||
// fn sample_frame() -> TestFrame {
|
||||
// TestFrame {
|
||||
// header: [0xAA, 0x55],
|
||||
// cmd: 0x01,
|
||||
// length: 4,
|
||||
// payload: vec![0x00, 0x0A, 0x00, 0x14],
|
||||
// checksum: 0,
|
||||
//
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// #[test]
|
||||
// fn prune_stale_clears_panels_and_summary_after_timeout() {
|
||||
// let mut state = HudChartState::new();
|
||||
// let frame = sample_frame();
|
||||
//
|
||||
// state.record_summary(30.0);
|
||||
// let _ = state.apply_frame(&frame, Some(&[10, 20]));
|
||||
//
|
||||
// let stale_now = Instant::now();
|
||||
// let stale_seen = stale_now - PANEL_STALE_AFTER - Duration::from_millis(1);
|
||||
//
|
||||
// state.last_frame_seen = Some(stale_seen);
|
||||
//
|
||||
// for entry in state.panels.values_mut() {
|
||||
// entry.last_seen = stale_seen;
|
||||
// }
|
||||
//
|
||||
// let packet = state
|
||||
// .prune_stale()
|
||||
// .expect("stale data should emit an update");
|
||||
//
|
||||
// assert!(packet.panels.is_empty());
|
||||
// assert!(packet.summary.points.is_empty());
|
||||
// assert!(state.panels.is_empty());
|
||||
// assert!(state.summary_points.is_empty());
|
||||
// }
|
||||
//
|
||||
// #[test]
|
||||
// fn prune_stale_keeps_recent_summary_points() {
|
||||
// let mut state = HudChartState::new();
|
||||
// let frame = sample_frame();
|
||||
//
|
||||
// state.record_summary(30.0);
|
||||
// let _ = state.apply_frame(&frame, Some(&[10, 20]));
|
||||
//
|
||||
// state.last_frame_seen = Some(Instant::now());
|
||||
//
|
||||
// assert!(state.prune_stale().is_none());
|
||||
// assert_eq!(state.summary_points, vec![30.0]);
|
||||
// assert_eq!(state.panels.len(), 1);
|
||||
// }
|
||||
// }
|
||||
|
||||
@@ -1,122 +0,0 @@
|
||||
use ndarray::Array2;
|
||||
|
||||
const TOTAL_PRESSURE_LOW_THRESHOLD: usize = 500;
|
||||
const COP_STABILITY_FRAMES_REQUIRED: usize = 5;
|
||||
const SENSOR_ROWS: usize = 12;
|
||||
const SENSOR_COLS: usize = 7;
|
||||
|
||||
pub struct PztProcessor {
|
||||
first_frame: Option<Vec<f32>>,
|
||||
first_contact_cop_x: Option<f32>,
|
||||
first_contact_cop_y: Option<f32>,
|
||||
contact_initialized: bool,
|
||||
total_pressure_low_counter: usize,
|
||||
}
|
||||
|
||||
impl PztProcessor {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
first_frame: None,
|
||||
first_contact_cop_x: None,
|
||||
first_contact_cop_y: None,
|
||||
contact_initialized: false,
|
||||
total_pressure_low_counter: 0,
|
||||
}
|
||||
}
|
||||
|
||||
fn subtract_baseline(&mut self, current_frame: &[f32]) -> Vec<f32> {
|
||||
if self.first_frame.is_none() {
|
||||
self.first_frame = Some(current_frame.to_vec());
|
||||
}
|
||||
|
||||
let baseline = self.first_frame.as_ref().unwrap();
|
||||
current_frame
|
||||
.iter()
|
||||
.zip(baseline.iter())
|
||||
.map(|(c, b)| (c - b).max(0.0))
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn reset_cop_state(&mut self) {
|
||||
self.first_contact_cop_x = None;
|
||||
self.first_contact_cop_y = None;
|
||||
self.contact_initialized = false;
|
||||
self.total_pressure_low_counter = 0;
|
||||
}
|
||||
|
||||
fn compute_pressure_direction(&mut self, frame: &[f32]) -> (f32, f32) {
|
||||
let frame2d = Array2::from_shape_vec((SENSOR_ROWS, SENSOR_COLS), frame.to_vec()).unwrap();
|
||||
let total_pressure: f32 = frame2d.sum();
|
||||
if total_pressure < TOTAL_PRESSURE_LOW_THRESHOLD as f32 {
|
||||
self.total_pressure_low_counter += 1;
|
||||
} else {
|
||||
self.total_pressure_low_counter = 0;
|
||||
}
|
||||
|
||||
if self.total_pressure_low_counter >= COP_STABILITY_FRAMES_REQUIRED {
|
||||
self.reset_cop_state();
|
||||
return (0.0, 0.0);
|
||||
}
|
||||
|
||||
if total_pressure == 0.0 {
|
||||
return (0.0, 0.0);
|
||||
}
|
||||
|
||||
let mut sum_x = 0.0;
|
||||
let mut sum_y = 0.0;
|
||||
|
||||
for r in 0..SENSOR_ROWS {
|
||||
for c in 0..SENSOR_COLS {
|
||||
let val = frame2d[(r, c)];
|
||||
sum_x += val * c as f32;
|
||||
sum_y += val * r as f32;
|
||||
}
|
||||
}
|
||||
|
||||
let cop_x = sum_x / total_pressure;
|
||||
let cop_y = sum_y / total_pressure;
|
||||
|
||||
if !self.contact_initialized {
|
||||
self.first_contact_cop_x = Some(cop_x);
|
||||
self.first_contact_cop_y = Some(cop_y);
|
||||
self.contact_initialized = true;
|
||||
return (0.0, 0.0);
|
||||
}
|
||||
|
||||
let dx = cop_x - self.first_contact_cop_x.unwrap();
|
||||
let dy = cop_y - self.first_contact_cop_y.unwrap();
|
||||
|
||||
(dx, dy)
|
||||
}
|
||||
|
||||
fn compute_vector_angle(x: f32, y: f32) -> (f32, f32) {
|
||||
let epsilon = 1e-8;
|
||||
let mag = (x * x + y * y).sqrt();
|
||||
let mut angle = (y).atan2(x + epsilon).to_degrees();
|
||||
if angle < 0.0 {
|
||||
angle += 360.0;
|
||||
}
|
||||
(angle, mag)
|
||||
}
|
||||
|
||||
fn compute_pzt_angle(px: f32, py: f32) -> (f32, f32) {
|
||||
Self::compute_vector_angle(px, -py)
|
||||
}
|
||||
|
||||
pub fn get_pzt_angle(&mut self, adc_data: &[f32]) -> Result<f32, &'static str> {
|
||||
if adc_data.len() != 84 {
|
||||
return Err("ADC data length must be 84");
|
||||
}
|
||||
|
||||
let baseline = self.subtract_baseline(adc_data);
|
||||
let (dx, dy) = self.compute_pressure_direction(&baseline);
|
||||
let (angle, _) = Self::compute_pzt_angle(dx, dy);
|
||||
|
||||
Ok(angle)
|
||||
}
|
||||
|
||||
pub fn reset_baseline(&mut self) {
|
||||
self.first_frame = None;
|
||||
self.reset_cop_state();
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
use eskin_finger_sdk::types::FingerSample;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct FrameTiming {
|
||||
pub pts_ms: Option<u64>,
|
||||
@@ -7,50 +9,82 @@ pub struct FrameTiming {
|
||||
#[derive(Clone)]
|
||||
pub struct RecordedFrame<F> {
|
||||
pub timing: FrameTiming,
|
||||
pub frame: F
|
||||
pub frame: F,
|
||||
}
|
||||
|
||||
#[derive(Clone, Default)]
|
||||
pub struct Recording<F> {
|
||||
pub frames: Vec<RecordedFrame<F>>
|
||||
pub frames: Vec<RecordedFrame<F>>,
|
||||
}
|
||||
|
||||
impl<F> Recording<F> {
|
||||
pub fn new() -> Recording<F> { Self { frames: Vec::new() } }
|
||||
pub fn push(&mut self, ite: RecordedFrame<F>) {
|
||||
self.frames.push(ite);
|
||||
pub fn new() -> Recording<F> {
|
||||
Self {
|
||||
frames: Vec::new(),
|
||||
}
|
||||
}
|
||||
pub fn push(&mut self, item: RecordedFrame<F>) {
|
||||
self.frames.push(item);
|
||||
}
|
||||
}
|
||||
|
||||
pub trait CsvExporter<F> {
|
||||
type Error: std::error::Error + Send + Sync + 'static;
|
||||
fn csv_header(&self, recording: &Recording<F>) -> Vec<String>;
|
||||
fn csv_row(&self, item: &RecordedFrame<F>) -> anyhow::Result<Vec<String>>;
|
||||
}
|
||||
pub type FingerRecording = Recording<FingerSample>;
|
||||
|
||||
// TODO: CsvImporter
|
||||
pub trait CsvImporter<P> {
|
||||
fn load<R: std::io::Read>(&mut self, reader: R) -> anyhow::Result<Vec<P>>;
|
||||
}
|
||||
|
||||
pub fn write_csv<F, E, W>(
|
||||
recording: &Recording<F>,
|
||||
exporter: &E,
|
||||
writer: W,
|
||||
pub fn export_recording_csv<W>(
|
||||
recording: &Recording<FingerSample>,
|
||||
mut writer: W,
|
||||
) -> anyhow::Result<()>
|
||||
where
|
||||
E: CsvExporter<F>,
|
||||
W: std::io::Write,
|
||||
{
|
||||
let header = exporter.csv_header(&recording);
|
||||
let mut wrt = csv::Writer::from_writer(writer);
|
||||
wrt.write_record(header)?;
|
||||
for f in &recording.frames {
|
||||
let row = exporter.csv_row(f)?;
|
||||
wrt.write_record(&row)?;
|
||||
// Infer channel count from the first sample's combined_forces (just fz)
|
||||
// We write: timestamp_us, sequence, module, fx, fy, fz
|
||||
let mut wrt = csv::Writer::from_writer(&mut writer);
|
||||
wrt.write_record(["timestamp_us", "sequence", "module", "fx", "fy", "fz"])?;
|
||||
|
||||
for frame in &recording.frames {
|
||||
let s = &frame.frame;
|
||||
wrt.write_record(&[
|
||||
s.timestamp_us.to_string(),
|
||||
s.sequence.to_string(),
|
||||
format!("{:?}", s.combined_forces.module),
|
||||
s.combined_forces.force.fx.to_string(),
|
||||
s.combined_forces.force.fy.to_string(),
|
||||
s.combined_forces.force.fz.to_string(),
|
||||
])?;
|
||||
}
|
||||
|
||||
wrt.flush()?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub struct FingerSampleCsvPacket {
|
||||
pub timestamp_us: u64,
|
||||
pub sequence: u32,
|
||||
pub fz: u32,
|
||||
}
|
||||
|
||||
pub fn import_csv<R: std::io::Read>(
|
||||
reader: R,
|
||||
) -> anyhow::Result<Vec<FingerSampleCsvPacket>> {
|
||||
let mut rdr = csv::Reader::from_reader(reader);
|
||||
let mut packets = Vec::new();
|
||||
|
||||
for result in rdr.records() {
|
||||
let record = result?;
|
||||
if record.len() < 6 {
|
||||
continue;
|
||||
}
|
||||
let timestamp_us = record.get(0).unwrap_or("0").parse::<u64>().unwrap_or(0);
|
||||
let sequence = record.get(1).unwrap_or("0").parse::<u32>().unwrap_or(0);
|
||||
let fz = record.get(5).unwrap_or("0").parse::<u32>().unwrap_or(0);
|
||||
|
||||
packets.push(FingerSampleCsvPacket {
|
||||
timestamp_us,
|
||||
sequence,
|
||||
fz,
|
||||
});
|
||||
}
|
||||
|
||||
Ok(packets)
|
||||
}
|
||||
@@ -1,443 +1,160 @@
|
||||
use crate::serial_core::basin_force_estimator::BasinForceEstimator;
|
||||
use crate::serial_core::codec::Codec;
|
||||
use crate::serial_core::codecs::tactile_a::TactileACodec;
|
||||
use crate::serial_core::frame::{FrameHandler, TactileAFrame, TestFrame};
|
||||
use crate::serial_core::model::{HudChartState, HudPacket};
|
||||
#[cfg(feature = "multi-dim")]
|
||||
use crate::serial_core::multi_dim_force::PztProcessor;
|
||||
use crate::serial_core::model::HudChartState;
|
||||
use crate::serial_core::record::Recording;
|
||||
use crate::serial_core::record::{FrameTiming, RecordedFrame};
|
||||
#[cfg(feature = "devkit")]
|
||||
use crate::devkit::{proto::SensorFrame, DevKitState};
|
||||
use anyhow::Result;
|
||||
use log::debug;
|
||||
use std::future::pending;
|
||||
#[cfg(feature = "devkit")]
|
||||
use std::sync::atomic::Ordering;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::time::Instant;
|
||||
use eskin_finger_sdk::channel::DeviceEvent;
|
||||
use eskin_finger_sdk::config::DeviceConfig;
|
||||
use eskin_finger_sdk::device::{EskinDevice, EskinDeviceInner};
|
||||
use eskin_finger_sdk::transport::SerialPortTransport;
|
||||
use eskin_finger_sdk::types::FingerSample;
|
||||
use tauri::{AppHandle, Emitter};
|
||||
#[cfg(feature = "devkit")]
|
||||
use tauri::Manager;
|
||||
use tokio::io::{AsyncReadExt, AsyncWriteExt};
|
||||
use tokio::time::{self, Duration, MissedTickBehavior};
|
||||
use tokio_serial::SerialStream;
|
||||
use tokio_util::sync::CancellationToken;
|
||||
|
||||
const AUTO_SUB_INTERVAL: Duration = Duration::from_nanos(16_666_667);
|
||||
use super::model::HudPacket;
|
||||
|
||||
pub enum PollMode<F> {
|
||||
Disable,
|
||||
Enabled(Box<dyn PollRequester<F>>),
|
||||
pub struct SdkSession {
|
||||
pub device: EskinDeviceInner,
|
||||
}
|
||||
|
||||
struct PendingSubFrame<F> {
|
||||
frame: F,
|
||||
values: Vec<i32>,
|
||||
pub fn open_device(port: &str) -> Result<SdkSession, String> {
|
||||
let port = port.trim();
|
||||
if port.is_empty() {
|
||||
return Err("Serial port is required".to_string());
|
||||
}
|
||||
|
||||
let transport = SerialPortTransport::new(port, 921600);
|
||||
let config = DeviceConfig::default();
|
||||
let mut device = EskinDeviceInner::new(config, Box::new(transport));
|
||||
device.open().map_err(|e| e.to_string())?;
|
||||
|
||||
Ok(SdkSession { device })
|
||||
}
|
||||
|
||||
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>(
|
||||
pub async fn run_stream(
|
||||
app: AppHandle,
|
||||
port: SerialStream,
|
||||
codec: C,
|
||||
handler: H,
|
||||
session_started_at: Instant,
|
||||
recording: Arc<Mutex<Recording<F>>>,
|
||||
device: &mut EskinDeviceInner,
|
||||
cancel: CancellationToken,
|
||||
) -> Result<()>
|
||||
where
|
||||
F: SerialFrame,
|
||||
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>,
|
||||
{
|
||||
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 poll_sub_interval = time::interval(AUTO_SUB_INTERVAL);
|
||||
poll_sub_interval.set_missed_tick_behavior(MissedTickBehavior::Skip);
|
||||
) -> Result<(), String> {
|
||||
device
|
||||
.start_stream()
|
||||
.map_err(|e| format!("start_stream failed: {e}"))?;
|
||||
|
||||
let channels = device.channels();
|
||||
let mut chart_state = HudChartState::new();
|
||||
let mut buffer = [0u8; 1024];
|
||||
let mut prune_interval = time::interval(Duration::from_millis(450));
|
||||
#[cfg(feature = "multi-dim")]
|
||||
let mut pzt_processor = PztProcessor::new();
|
||||
let mut force_estimator = BasinForceEstimator::new();
|
||||
let mut pending_sub_frame: Option<PendingSubFrame<F>> = None;
|
||||
prune_interval.set_missed_tick_behavior(MissedTickBehavior::Delay);
|
||||
|
||||
loop {
|
||||
let result = loop {
|
||||
tokio::select! {
|
||||
_ = cancel.cancelled() => break,
|
||||
_ = async {
|
||||
match poll_interval.as_mut() {
|
||||
Some(it) => {
|
||||
it.tick().await;
|
||||
_ = cancel.cancelled() => {
|
||||
break Ok(());
|
||||
}
|
||||
None => pending::<()>().await,
|
||||
_ = tokio::time::sleep(tokio::time::Duration::from_millis(1)) => {}
|
||||
}
|
||||
} => {
|
||||
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() => {
|
||||
if let Some(packet) = chart_state.prune_stale() {
|
||||
app.emit("hud_stream", packet)?;
|
||||
}
|
||||
}
|
||||
_ = poll_sub_interval.tick() => {
|
||||
if let Some(pending) = pending_sub_frame.take() {
|
||||
let display_values = build_display_values(
|
||||
&mut chart_state,
|
||||
pending.values.as_slice(),
|
||||
);
|
||||
|
||||
if let Some(packet) = pending
|
||||
.frame
|
||||
.to_hud_packet(&mut chart_state, display_values.as_deref())
|
||||
// Try to receive a sample (non-blocking-ish via small timeout)
|
||||
match channels.recv_sample(5) {
|
||||
Ok(sample) => {
|
||||
if let Some(packet) = build_hud_packet_from_sample(&sample, &mut chart_state) {
|
||||
let _ = app.emit("hud_stream", packet);
|
||||
}
|
||||
}
|
||||
Err(eskin_finger_sdk::error::SdkError::Timeout) => {
|
||||
// No sample yet, check for events
|
||||
}
|
||||
Err(e) => {
|
||||
break Err(format!("sample recv error: {e}"));
|
||||
}
|
||||
}
|
||||
|
||||
// Drain any events
|
||||
if let Err(e) = drain_events(&channels) {
|
||||
break Err(e);
|
||||
}
|
||||
};
|
||||
|
||||
let _ = device.stop_stream();
|
||||
result
|
||||
}
|
||||
|
||||
pub async fn run_stream_with_record(
|
||||
app: AppHandle,
|
||||
device: &mut EskinDeviceInner,
|
||||
cancel: CancellationToken,
|
||||
recording: std::sync::Arc<std::sync::Mutex<Recording<FingerSample>>>,
|
||||
) -> Result<(), String> {
|
||||
device
|
||||
.start_stream()
|
||||
.map_err(|e| format!("start_stream failed: {e}"))?;
|
||||
|
||||
let channels = device.channels();
|
||||
let mut chart_state = HudChartState::new();
|
||||
|
||||
let result = loop {
|
||||
tokio::select! {
|
||||
_ = cancel.cancelled() => {
|
||||
break Ok(());
|
||||
}
|
||||
_ = tokio::time::sleep(tokio::time::Duration::from_millis(1)) => {}
|
||||
}
|
||||
|
||||
match channels.recv_sample(5) {
|
||||
Ok(sample) => {
|
||||
// Record
|
||||
{
|
||||
app.emit("hud_stream", packet)?;
|
||||
}
|
||||
}
|
||||
}
|
||||
read_result = port.read(&mut buffer) => {
|
||||
let n = read_result?;
|
||||
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;
|
||||
}
|
||||
|
||||
let frames = codec.decode(&buffer[..n], session_started_at)?;
|
||||
for frame in frames {
|
||||
if let Some(r) = requester.as_mut() {
|
||||
r.on_rx_frame(&frame);
|
||||
}
|
||||
|
||||
let decode_res = handler
|
||||
.on_frame(&frame)
|
||||
.await?
|
||||
.map(|vals| vals.into_iter().map(Into::into).collect::<Vec<i32>>());
|
||||
|
||||
let mut record = recording
|
||||
.lock()
|
||||
.map_err(|_| anyhow::anyhow!("recording state poisoned"))?;
|
||||
record.push(RecordedFrame {
|
||||
timing: FrameTiming {
|
||||
.map_err(|_| "recording state poisoned".to_string())?;
|
||||
record.push(crate::serial_core::record::RecordedFrame {
|
||||
timing: crate::serial_core::record::FrameTiming {
|
||||
pts_ms: None,
|
||||
dts_ms: frame.dts_ms(),
|
||||
dts_ms: sample.timestamp_us / 1000,
|
||||
},
|
||||
frame: frame.clone(),
|
||||
frame: sample.clone(),
|
||||
});
|
||||
drop(record);
|
||||
|
||||
if let Some(vals) = decode_res {
|
||||
// Basin force estimation (pre-force)
|
||||
if vals.len() == 84 {
|
||||
let mut frame_f64 = [0.0f64; 84];
|
||||
for (i, v) in vals.iter().enumerate() {
|
||||
frame_f64[i] = *v as f64;
|
||||
}
|
||||
let pre_force = force_estimator.predict_frame(&frame_f64);
|
||||
debug!("pre-force: {:.2}", pre_force);
|
||||
}
|
||||
|
||||
#[cfg(feature = "multi-dim")]
|
||||
{
|
||||
let pzt_values = vals.iter().map(|value| *value as f32).collect::<Vec<f32>>();
|
||||
if let Ok(angle) = pzt_processor.get_pzt_angle(&pzt_values) {
|
||||
// debug!("pzt angle: {:.2}", angle);
|
||||
if let Some(packet) = build_hud_packet_from_sample(&sample, &mut chart_state) {
|
||||
let _ = app.emit("hud_stream", packet);
|
||||
}
|
||||
}
|
||||
#[cfg(feature = "devkit")]
|
||||
{
|
||||
let summary = vals.iter().copied().sum::<i32>();
|
||||
let force = raw_to_g1(summary as u32);
|
||||
push_devkit_frame(&app, vals.as_slice(), frame.dts_ms(), force);
|
||||
Err(eskin_finger_sdk::error::SdkError::Timeout) => {}
|
||||
Err(e) => {
|
||||
break Err(format!("sample recv error: {e}"));
|
||||
}
|
||||
}
|
||||
|
||||
pending_sub_frame = Some(PendingSubFrame {
|
||||
frame: frame.clone(),
|
||||
values: vals,
|
||||
});
|
||||
} else if let Some(packet) = frame.to_hud_packet(&mut chart_state, None) {
|
||||
app.emit("hud_stream", packet)?;
|
||||
if let Err(e) = drain_events(&channels) {
|
||||
break Err(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
};
|
||||
|
||||
let _ = device.stop_stream();
|
||||
result
|
||||
}
|
||||
|
||||
fn build_display_values(chart_state: &mut HudChartState, values: &[i32]) -> Option<Vec<i32>> {
|
||||
let summary = values.iter().copied().sum::<i32>();
|
||||
let force = raw_to_g1(summary as u32);
|
||||
chart_state.record_summary(force as f32);
|
||||
chart_state.record_pressure_matrix(values);
|
||||
Some(vec![summary])
|
||||
fn drain_events(channels: &std::sync::Arc<eskin_finger_sdk::channel::ChannelManager>) -> Result<(), String> {
|
||||
loop {
|
||||
match channels.recv_event(0) {
|
||||
Ok(DeviceEvent::IoError(msg)) => {
|
||||
eprintln!("SDK stream io error: {msg}");
|
||||
return Err(format!("stream io error: {msg}"));
|
||||
}
|
||||
Ok(_) => {}
|
||||
Err(eskin_finger_sdk::error::SdkError::Timeout) => return Ok(()),
|
||||
Err(eskin_finger_sdk::error::SdkError::ChannelClosed) => {
|
||||
return Err("event channel closed".into());
|
||||
}
|
||||
Err(_) => return Ok(()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "devkit")]
|
||||
fn push_devkit_frame(app: &AppHandle, values: &[i32], dts_ms: u64, resultant_force: f64) {
|
||||
let devkit_state = app.state::<DevKitState>();
|
||||
if !devkit_state.running.load(Ordering::Relaxed) {
|
||||
return;
|
||||
fn build_hud_packet_from_sample(
|
||||
sample: &FingerSample,
|
||||
chart_state: &mut HudChartState,
|
||||
) -> Option<HudPacket> {
|
||||
let fz = sample.combined_forces.force.fz as f32;
|
||||
chart_state.record_summary(fz);
|
||||
if !sample.raw_adcs.is_empty() {
|
||||
let pressure: Vec<f32> = sample.raw_adcs.iter().map(|&v| v as f32).collect();
|
||||
chart_state.record_pressure_matrix(&pressure);
|
||||
}
|
||||
|
||||
let (rows, cols) = infer_matrix_shape(values.len());
|
||||
let timestamp_ms = std::time::SystemTime::now()
|
||||
.duration_since(std::time::UNIX_EPOCH)
|
||||
.unwrap_or_default()
|
||||
.as_millis() as u64;
|
||||
|
||||
let seq = timestamp_ms;
|
||||
let matrix = values
|
||||
.iter()
|
||||
.map(|value| (*value).max(0) as u32)
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
devkit_state.push_frame(SensorFrame {
|
||||
seq,
|
||||
timestamp_ms,
|
||||
rows,
|
||||
cols,
|
||||
matrix,
|
||||
resultant_force,
|
||||
dts_ms: dts_ms as u32,
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "devkit")]
|
||||
fn infer_matrix_shape(len: usize) -> (u32, u32) {
|
||||
if len == 84 {
|
||||
return (12, 7);
|
||||
}
|
||||
|
||||
if len == 0 {
|
||||
return (0, 0);
|
||||
}
|
||||
|
||||
let mut best = (len, 1);
|
||||
let mut factor = 1usize;
|
||||
while factor * factor <= len {
|
||||
if len % factor == 0 {
|
||||
best = (len / factor, factor);
|
||||
}
|
||||
factor += 1;
|
||||
}
|
||||
|
||||
(best.0 as u32, best.1 as u32)
|
||||
}
|
||||
|
||||
fn raw_to_g1(raw: u32) -> f64 {
|
||||
const X: [u32; 12] = [
|
||||
0, 84402, 117218, 140176, 159126, 175812, 191484, 208758, 224703, 252448, 302361, 352703,
|
||||
];
|
||||
|
||||
const Y: [f64; 12] = [
|
||||
0.0, 160.0, 260.0, 360.0, 460.0, 560.0, 660.0, 760.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
|
||||
Some(chart_state.build_snapshot())
|
||||
}
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
|
||||
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(())
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@
|
||||
}
|
||||
},
|
||||
"bundle": {
|
||||
"createUpdaterArtifacts": false,
|
||||
"createUpdaterArtifacts": true,
|
||||
"active": true,
|
||||
"targets": "all",
|
||||
"icon": [
|
||||
|
||||
@@ -1,747 +0,0 @@
|
||||
from typing import Dict, List, Tuple
|
||||
import numpy as np
|
||||
from indicator.base import Indicator
|
||||
import math
|
||||
|
||||
|
||||
class EMA:
|
||||
"""指数移动平均"""
|
||||
|
||||
@staticmethod
|
||||
def calc(data: np.ndarray, period: int) -> np.ndarray:
|
||||
alpha = 2.0 / (period + 1)
|
||||
out = np.empty_like(data)
|
||||
out[0] = data[0]
|
||||
for i in range(1, len(data)):
|
||||
out[i] = alpha * data[i] + (1 - alpha) * out[i - 1]
|
||||
return out
|
||||
|
||||
|
||||
class SMA:
|
||||
"""简单移动平均"""
|
||||
|
||||
@staticmethod
|
||||
def calc(data: np.ndarray, period: int) -> np.ndarray:
|
||||
out = np.full_like(data, np.nan)
|
||||
if len(data) < period:
|
||||
return out
|
||||
cumsum = np.cumsum(data)
|
||||
out[period - 1:] = (cumsum[period - 1:] - np.concatenate([[0], cumsum[:-period]])) / period
|
||||
return out
|
||||
|
||||
|
||||
def true_range(high: np.ndarray, low: np.ndarray, close: np.ndarray) -> np.ndarray:
|
||||
"""True Range"""
|
||||
tr = np.empty(len(high))
|
||||
tr[0] = high[0] - low[0]
|
||||
for i in range(1, len(high)):
|
||||
tr[i] = max(high[i] - low[i], abs(high[i] - close[i - 1]), abs(low[i] - close[i - 1]))
|
||||
return tr
|
||||
|
||||
|
||||
class SignalTracker:
|
||||
"""逐帧更新的信号追踪器(无回看依赖,纯实时)"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
ob_threshold: float = 80,
|
||||
os_threshold: float = 20,
|
||||
dist_extreme: float = 5,
|
||||
dist_far: float = 15,
|
||||
dist_mid: float = 30,
|
||||
macd_th: float = 0.3,
|
||||
rsi_ob: float = 70,
|
||||
rsi_os: float = 30,
|
||||
di_gap_bull: float = 15,
|
||||
di_gap_bear: float = -15,
|
||||
aroon_ob: float = 80,
|
||||
aroon_os: float = 20,
|
||||
williams_ob: float = -20,
|
||||
williams_os: float = -80,
|
||||
bias_ob: float = 5,
|
||||
bias_os: float = -5,
|
||||
):
|
||||
self.ob_threshold = ob_threshold
|
||||
self.os_threshold = os_threshold
|
||||
self.dist_extreme = dist_extreme
|
||||
self.dist_far = dist_far
|
||||
self.dist_mid = dist_mid
|
||||
self.macd_th = macd_th
|
||||
self.rsi_ob = rsi_ob
|
||||
self.rsi_os = rsi_os
|
||||
self.di_gap_bull = di_gap_bull
|
||||
self.di_gap_bear = di_gap_bear
|
||||
self.aroon_ob = aroon_ob
|
||||
self.aroon_os = aroon_os
|
||||
self.williams_ob = williams_ob
|
||||
self.williams_os = williams_os
|
||||
self.bias_ob = bias_ob
|
||||
self.bias_os = bias_os
|
||||
|
||||
# 状态缓存
|
||||
self._intp_buy_sma: float = 0.0
|
||||
self._intp_sell_sma: float = 0.0
|
||||
self._intp_sma_count: int = 0
|
||||
self._max_qtb_score: float = 0.0
|
||||
self._bull_count: int = 0
|
||||
self._bear_count: int = 0
|
||||
self._last_bull_idx: int = -100
|
||||
self._last_bear_idx: int = -100
|
||||
self._frame_idx: int = 0
|
||||
|
||||
# 历史缓冲区(保留最近200帧用于EMA/SMA/DI计算)
|
||||
self._buf_size: int = 200
|
||||
self._bbi_buf: List[float] = []
|
||||
self._amplitude_buf: List[float] = []
|
||||
self._close_buf: List[float] = []
|
||||
self._high_buf: List[float] = []
|
||||
self._low_buf: List[float] = []
|
||||
self._wr_buf: List[float] = []
|
||||
|
||||
def reset(self):
|
||||
"""重置所有状态"""
|
||||
self._intp_buy_sma = 0.0
|
||||
self._intp_sell_sma = 0.0
|
||||
self._intp_sma_count = 0
|
||||
self._max_qtb_score = 0.0
|
||||
self._bull_count = 0
|
||||
self._bear_count = 0
|
||||
self._last_bull_idx = -100
|
||||
self._last_bear_idx = -100
|
||||
self._frame_idx = 0
|
||||
self._bbi_buf.clear()
|
||||
self._amplitude_buf.clear()
|
||||
self._close_buf.clear()
|
||||
self._high_buf.clear()
|
||||
self._low_buf.clear()
|
||||
self._wr_buf.clear()
|
||||
|
||||
def _append_buf(self, buf: List[float], val: float):
|
||||
buf.append(val)
|
||||
if len(buf) > self._buf_size:
|
||||
buf.pop(0)
|
||||
|
||||
def _ema_val(self, buf: List[float], period: int) -> float:
|
||||
"""返回缓冲区中最后一个EMA值"""
|
||||
if len(buf) < period:
|
||||
return buf[-1] if buf else 0.0
|
||||
arr = np.array(buf, dtype=float)
|
||||
ema = EMA.calc(arr, period)
|
||||
return float(ema[-1])
|
||||
|
||||
def _sma_val(self, buf: List[float], period: int) -> float:
|
||||
if len(buf) < period:
|
||||
return np.nan
|
||||
arr = np.array(buf, dtype=float)
|
||||
sma = SMA.calc(arr, period)
|
||||
return float(sma[-1])
|
||||
|
||||
def get_signals(
|
||||
self,
|
||||
amplitude: float,
|
||||
bbi: float,
|
||||
cci: float,
|
||||
close: float,
|
||||
dmk: float,
|
||||
high: float,
|
||||
k: float,
|
||||
low: float,
|
||||
qtb_score: float,
|
||||
result: float,
|
||||
wr: float,
|
||||
percent: float,
|
||||
v0: float,
|
||||
boll_upper: float,
|
||||
boll_lower: float,
|
||||
macd_val: float,
|
||||
pmacd: float,
|
||||
bias: float,
|
||||
) -> Tuple[str, str, str, str]:
|
||||
"""
|
||||
逐帧更新,返回 (market_status, signal_type, intensity, detail)
|
||||
|
||||
不依赖历史数组,所有指标值由外部实时计算后传入。
|
||||
"""
|
||||
|
||||
# ─── 更新缓冲区 ───
|
||||
self._append_buf(self._bbi_buf, bbi)
|
||||
self._append_buf(self._amplitude_buf, amplitude)
|
||||
self._append_buf(self._close_buf, close)
|
||||
self._append_buf(self._high_buf, high)
|
||||
self._append_buf(self._low_buf, low)
|
||||
self._append_buf(self._wr_buf, wr)
|
||||
|
||||
# ─── 指标因子计算(使用传入值 + 缓冲区衍生值)───
|
||||
k_macd = self._k_macd_factor(k, macd_val, pmacd)
|
||||
k_di = self._k_di_factor(dmk, amplitude, close)
|
||||
k_aroon = self._k_aroon_factor(high, low, close)
|
||||
k_williams = self._k_williams_factor(wr)
|
||||
k_result = self._k_result_factor(result)
|
||||
k_bias = self._k_bias_factor(bias)
|
||||
k_trix = self._k_trix_factor(close)
|
||||
k_ema = self._k_ema_factor(close)
|
||||
k_amplitude = self._k_amplitude_factor(amplitude)
|
||||
|
||||
# ─── 累计 ───
|
||||
k_bull = k_macd + k_di + k_aroon + k_williams + k_result + k_bias + k_trix + k_ema + k_amplitude
|
||||
k_bear = k_macd + k_di + k_aroon + k_williams + k_result + k_bias + k_trix + k_ema + k_amplitude
|
||||
|
||||
if result > self.ob_threshold and k_bull > 0 and result >= 90:
|
||||
k_bull *= 1.5
|
||||
|
||||
# ─── 指数平滑 ───
|
||||
if self._intp_sma_count == 0:
|
||||
self._intp_buy_sma = k_bull
|
||||
self._intp_sell_sma = k_bear
|
||||
self._intp_sma_count = 1
|
||||
else:
|
||||
self._intp_sma_count += 1
|
||||
period = max(3, min(5, self._intp_sma_count))
|
||||
alpha = 2.0 / (period + 1)
|
||||
self._intp_buy_sma = alpha * k_bull + (1 - alpha) * self._intp_buy_sma
|
||||
self._intp_sell_sma = alpha * k_bear + (1 - alpha) * self._intp_sell_sma
|
||||
|
||||
# ─── 趋势确认与背离检测 ───
|
||||
is_bull_div, is_bear_div = self._detect_divergence(close, result)
|
||||
if is_bull_div:
|
||||
self._intp_buy_sma *= 1.3
|
||||
k_bull *= 1.3
|
||||
if is_bear_div:
|
||||
self._intp_sell_sma *= 1.3
|
||||
k_bear *= 1.3
|
||||
|
||||
is_bull, is_bear = self._detect_trend(close)
|
||||
if is_bull:
|
||||
self._intp_buy_sma *= 1.15
|
||||
k_bull *= 1.15
|
||||
if is_bear:
|
||||
self._intp_sell_sma *= 1.15
|
||||
k_bear *= 1.15
|
||||
|
||||
wmacd = self._wmacd()
|
||||
if wmacd > 0:
|
||||
k_bull += wmacd * 0.5
|
||||
elif wmacd < 0:
|
||||
k_bear += abs(wmacd) * 0.5
|
||||
|
||||
if qtb_score > self._max_qtb_score * 0.7:
|
||||
pass
|
||||
elif qtb_score < 3 and qtb_score > 1:
|
||||
k_bull *= 0.85
|
||||
k_bear *= 0.85
|
||||
|
||||
# ─── 信号分类 ───
|
||||
max_k = max(abs(k_bull), abs(k_bear))
|
||||
if max_k > 0:
|
||||
buy_score = ((k_bull + max_k) / (2 * max_k)) * 100
|
||||
sell_score = ((k_bear + max_k) / (2 * max_k)) * 100
|
||||
else:
|
||||
buy_score = sell_score = 50
|
||||
|
||||
bull_t = buy_score > 70 and result < 90
|
||||
bear_t = sell_score > 70 and result > 10
|
||||
k_cci = cci / 300
|
||||
boll_mid = self._boll_mid()
|
||||
|
||||
is_bull_t = (
|
||||
bull_t
|
||||
and k_bull > k_cci
|
||||
and close < boll_mid
|
||||
and (
|
||||
(result > 65 and result < 85 and k_bull > 0 and k_bear > 0 and (k_bear - k_bull < 1.5 or result > 75))
|
||||
or (result < 35 and result > 15 and k_bear > 0 and k_bull > 0 and (k_bull - k_bear < 1.5 or result < 25))
|
||||
)
|
||||
)
|
||||
is_bear_t = (
|
||||
bear_t
|
||||
and k_bear > k_cci
|
||||
and close > boll_mid
|
||||
and (
|
||||
(result > 65 and result < 85 and k_bull > 0 and k_bear > 0 and (k_bear - k_bull < 1.5 or result > 75))
|
||||
or (result < 35 and result > 15 and k_bear > 0 and k_bull > 0 and (k_bull - k_bear < 1.5 or result < 25))
|
||||
)
|
||||
)
|
||||
|
||||
if is_bull_t:
|
||||
self._bull_count += 1
|
||||
self._bear_count = 0
|
||||
self._last_bull_idx = self._frame_idx
|
||||
elif is_bear_t:
|
||||
self._bear_count += 1
|
||||
self._bull_count = 0
|
||||
self._last_bear_idx = self._frame_idx
|
||||
else:
|
||||
self._bull_count = max(self._bull_count - 1, 0)
|
||||
self._bear_count = max(self._bear_count - 1, 0)
|
||||
|
||||
# ─── 信号输出 ───
|
||||
sig_strength = 1.0 + max(0, (self._bull_count - 3) * 0.1) + max(0, (self._bear_count - 3) * 0.1)
|
||||
|
||||
strength = (
|
||||
"极强" if sig_strength >= 1.7
|
||||
else "强" if sig_strength >= 1.4
|
||||
else "中" if sig_strength >= 1.1
|
||||
else "弱"
|
||||
)
|
||||
|
||||
if buy_score >= sell_score:
|
||||
signal = f"买{strength}"
|
||||
else:
|
||||
signal = f"卖{strength}"
|
||||
|
||||
# ─── 市场状态 ───
|
||||
if abs(buy_score - sell_score) < 10:
|
||||
status = "中性震荡"
|
||||
elif buy_score > sell_score:
|
||||
if self._bull_count >= 3:
|
||||
status = "强势上涨"
|
||||
elif result > self.ob_threshold:
|
||||
status = "高位企稳"
|
||||
else:
|
||||
status = "温和上涨"
|
||||
else:
|
||||
if self._bear_count >= 3:
|
||||
status = "强势下跌"
|
||||
elif result < self.os_threshold:
|
||||
status = "低位企稳"
|
||||
else:
|
||||
status = "温和下跌"
|
||||
|
||||
# ─── 距离 ───
|
||||
boll_len = boll_upper - boll_lower
|
||||
if boll_len > 0:
|
||||
dist_ratio = (close - boll_lower) / boll_len * 100
|
||||
else:
|
||||
dist_ratio = 50
|
||||
|
||||
if dist_ratio < 50 - self.dist_extreme:
|
||||
dist = "极端超卖"
|
||||
elif dist_ratio < 50 - self.dist_far:
|
||||
dist = "远离"
|
||||
elif dist_ratio < 50 - self.dist_mid:
|
||||
dist = "偏离"
|
||||
elif dist_ratio < 50 + self.dist_mid:
|
||||
dist = "接近"
|
||||
elif dist_ratio < 50 + self.dist_far:
|
||||
dist = "靠近"
|
||||
elif dist_ratio < 50 + self.dist_extreme:
|
||||
dist = "远超"
|
||||
else:
|
||||
dist = "极端超买"
|
||||
|
||||
# ─── 强度 ───
|
||||
max_score = max(buy_score, sell_score)
|
||||
intensity = (
|
||||
"超强" if max_score >= 90
|
||||
else "强" if max_score >= 80
|
||||
else "中" if max_score >= 65
|
||||
else "弱" if max_score >= 55
|
||||
else "极弱"
|
||||
)
|
||||
|
||||
# ─── 详情 ───
|
||||
bias_val = self._ema_bias()
|
||||
bbp_val = self._boll_pct_b(close, boll_upper, boll_lower)
|
||||
detail = (
|
||||
f"前量:{percent:.1f} 数量:{int(amplitude):03d} 百分比:{bbp_val:.1f} "
|
||||
f"正:{k_bull:.1f} 负:{k_bear:.1f} 连买:{self._bull_count} 连卖:{self._bear_count} "
|
||||
f"误差:{bias_val:.1f}"
|
||||
)
|
||||
|
||||
self._frame_idx += 1
|
||||
return status, signal, intensity, detail
|
||||
|
||||
# ═══════════════════════════════════════════════════
|
||||
# 指标因子(全部基于实时数据,无回看窗口)
|
||||
# ═══════════════════════════════════════════════════
|
||||
|
||||
def _k_macd_factor(self, k: float, macd_val: float, pmacd: float) -> float:
|
||||
is_ob = k > self.ob_threshold
|
||||
is_os = k < self.os_threshold
|
||||
k_macd = 0.0
|
||||
if is_ob or is_os:
|
||||
if macd_val < 0:
|
||||
if is_os and k < 30 and pmacd > 0 and pmacd <= 10 and macd_val > 1.5:
|
||||
k_macd = 3.5
|
||||
elif is_ob and k > 80 and macd_val > 3 and abs(pmacd) < 5:
|
||||
k_macd = -3.5
|
||||
elif pmacd < 0 and macd_val < 0:
|
||||
if abs(pmacd) > 15 and macd_val >= -0.5:
|
||||
k_macd = 3.5
|
||||
elif 5 < abs(pmacd) < 15 and macd_val > 0.7:
|
||||
k_macd = 3.5
|
||||
elif pmacd > 0 and macd_val > 0:
|
||||
if pmacd >= 15 and macd_val < 0.5:
|
||||
k_macd = -3.5
|
||||
elif 5 < pmacd < 15 and macd_val < -0.7:
|
||||
k_macd = -3.5
|
||||
elif macd_val >= 3:
|
||||
k_macd = macd_val * 1.5
|
||||
elif macd_val <= -3:
|
||||
k_macd = macd_val * 1.5
|
||||
return k_macd
|
||||
|
||||
def _k_di_factor(self, dmk: float, amplitude: float, close: float) -> float:
|
||||
if len(self._close_buf) < 20:
|
||||
return 0.0
|
||||
k_close = np.array(self._close_buf, dtype=float)
|
||||
period = 14
|
||||
if len(k_close) < period + 1:
|
||||
return 0.0
|
||||
dx_list = []
|
||||
for i in range(1, min(period + 1, len(k_close))):
|
||||
diff = k_close[-i] - k_close[-i - 1]
|
||||
dx_list.append(diff)
|
||||
if not dx_list:
|
||||
return 0.0
|
||||
last_diff = dx_list[0]
|
||||
adx_val = abs(dmk) * 0.5
|
||||
|
||||
k_di = 0.0
|
||||
if adx_val < 20:
|
||||
return 0.0
|
||||
if dmk > 0 and len(dx_list) > 5:
|
||||
gains = [d for d in dx_list[:5] if d > 0]
|
||||
if len(gains) >= 3 and last_diff > 0:
|
||||
k_di = min(adx_val / 5, 6.0)
|
||||
elif dmk < 0 and len(dx_list) > 5:
|
||||
losses = [d for d in dx_list[:5] if d < 0]
|
||||
if len(losses) >= 3 and last_diff < 0:
|
||||
k_di = -min(adx_val / 5, 6.0)
|
||||
return k_di
|
||||
|
||||
def _k_aroon_factor(self, high: float, low: float, close: float) -> float:
|
||||
period = 14
|
||||
if len(self._high_buf) < period:
|
||||
return 0.0
|
||||
highs = self._high_buf[-period:]
|
||||
lows = self._low_buf[-period:]
|
||||
highest = max(highs)
|
||||
lowest = min(lows)
|
||||
rng = highest - lowest
|
||||
if rng == 0:
|
||||
return 0.0
|
||||
k_aroon = 0.0
|
||||
pct = (close - lowest) / rng * 100
|
||||
if pct >= self.aroon_ob:
|
||||
if close >= highest * 0.995:
|
||||
k_aroon = -2.0
|
||||
else:
|
||||
k_aroon = 2.0
|
||||
elif pct <= self.aroon_os:
|
||||
if close <= lowest * 1.005:
|
||||
k_aroon = 2.0
|
||||
else:
|
||||
k_aroon = -2.0
|
||||
else:
|
||||
k_aroon = (pct - 50) / 50 * 1.2
|
||||
return k_aroon
|
||||
|
||||
def _k_williams_factor(self, wr: float) -> float:
|
||||
k_wr = 0.0
|
||||
if wr > self.williams_ob:
|
||||
if wr > -10:
|
||||
k_wr = -1.2
|
||||
else:
|
||||
k_wr = -0.8
|
||||
elif wr < self.williams_os:
|
||||
if wr < -90:
|
||||
k_wr = 1.2
|
||||
else:
|
||||
k_wr = 0.8
|
||||
return k_wr
|
||||
|
||||
def _k_result_factor(self, result: float) -> float:
|
||||
k_result = 0.0
|
||||
is_ob = result > self.ob_threshold
|
||||
is_os = result < self.os_threshold
|
||||
if is_os and result < 10:
|
||||
k_result = 1.5
|
||||
elif is_ob and result > 90:
|
||||
k_result = -1.5
|
||||
return k_result
|
||||
|
||||
def _k_bias_factor(self, bias: float) -> float:
|
||||
k_bias = 0.0
|
||||
if bias < self.bias_os and bias < -3:
|
||||
k_bias = min(abs(bias) / 5, 2.5)
|
||||
elif bias > self.bias_ob and bias > 3:
|
||||
k_bias = -min(abs(bias) / 5, 2.5)
|
||||
return k_bias
|
||||
|
||||
def _k_trix_factor(self, close: float) -> float:
|
||||
ema3 = self._ema_val(self._close_buf, 3)
|
||||
ema9 = self._ema_val(self._close_buf, 9)
|
||||
if ema9 == 0:
|
||||
return 0.0
|
||||
trix = (ema3 - ema9) / ema9 * 100
|
||||
k_trix = 0.0
|
||||
if trix > 0:
|
||||
k_trix = min(trix / 2, 3.0)
|
||||
elif trix < 0:
|
||||
k_trix = max(trix / 2, -3.0)
|
||||
return k_trix
|
||||
|
||||
def _k_ema_factor(self, close: float) -> float:
|
||||
ema9 = self._ema_val(self._close_buf, 9)
|
||||
if ema9 == 0:
|
||||
return 0.0
|
||||
bias = (close - ema9) / ema9 * 100
|
||||
k_ema = 0.0
|
||||
if bias < -2:
|
||||
k_ema = min(abs(bias) * 0.3, 2.0)
|
||||
elif bias > 2:
|
||||
k_ema = -min(abs(bias) * 0.3, 2.0)
|
||||
return k_ema
|
||||
|
||||
def _k_amplitude_factor(self, amplitude: float) -> float:
|
||||
if len(self._amplitude_buf) < 10:
|
||||
return 0.0
|
||||
buf = self._amplitude_buf[-10:]
|
||||
mean = sum(buf) / len(buf)
|
||||
if mean == 0:
|
||||
return 0.0
|
||||
ratio = (amplitude - mean) / mean
|
||||
k_amp = 0.0
|
||||
if ratio > 0.5:
|
||||
k_amp = min(ratio * 1.5, 3.0)
|
||||
elif ratio < -0.3:
|
||||
k_amp = max(ratio * 1.5, -3.0)
|
||||
return k_amp
|
||||
|
||||
def _detect_divergence(self, close: float, result: float) -> Tuple[bool, bool]:
|
||||
"""简化背离检测(基于累计计数)"""
|
||||
is_bull_div = False
|
||||
is_bear_div = False
|
||||
if len(self._close_buf) > 30:
|
||||
c30 = self._close_buf[-30]
|
||||
if close > c30 * 1.05 and result < 50:
|
||||
is_bull_div = True
|
||||
elif close < c30 * 0.95 and result > 50:
|
||||
is_bear_div = True
|
||||
return is_bull_div, is_bear_div
|
||||
|
||||
def _detect_trend(self, close: float) -> Tuple[bool, bool]:
|
||||
"""简化趋势确认"""
|
||||
is_bull = False
|
||||
is_bear = False
|
||||
if len(self._close_buf) > 20:
|
||||
c20 = self._close_buf[-20]
|
||||
if close > c20 * 1.05:
|
||||
is_bull = True
|
||||
elif close < c20 * 0.95:
|
||||
is_bear = True
|
||||
return is_bull, is_bear
|
||||
|
||||
def _wmacd(self) -> float:
|
||||
"""简化加权MACD(基于缓冲区)"""
|
||||
if len(self._close_buf) < 12:
|
||||
return 0.0
|
||||
ema12 = self._ema_val(self._close_buf, 12)
|
||||
ema26 = self._ema_val(self._close_buf, 26)
|
||||
return ema12 - ema26
|
||||
|
||||
def _boll_mid(self) -> float:
|
||||
if len(self._close_buf) < 20:
|
||||
return self._close_buf[-1] if self._close_buf else 0.0
|
||||
return sum(self._close_buf[-20:]) / 20
|
||||
|
||||
def _ema_bias(self) -> float:
|
||||
if not self._close_buf:
|
||||
return 0.0
|
||||
ema5 = self._ema_val(self._close_buf, 5)
|
||||
ema10 = self._ema_val(self._close_buf, 10)
|
||||
if ema10 == 0:
|
||||
return 0.0
|
||||
return (ema5 - ema10) / ema10 * 1000
|
||||
|
||||
def _boll_pct_b(self, close: float, upper: float, lower: float) -> float:
|
||||
boll_len = upper - lower
|
||||
if boll_len == 0:
|
||||
return 50.0
|
||||
return (close - lower) / boll_len * 100
|
||||
|
||||
|
||||
def get_signals(indicator: Indicator) -> Tuple[str, str, str, str]:
|
||||
"""
|
||||
基于技术指标生成交易信号(逐帧调用版)
|
||||
|
||||
参数:
|
||||
indicator: Indicator 对象,包含所有实时指标值
|
||||
|
||||
返回:
|
||||
tuple: (market_status, signal_type, intensity, detail)
|
||||
"""
|
||||
# ─── 指标提取 ───
|
||||
bbi = indicator.BBI
|
||||
amplitude = indicator.AMPLITUDE
|
||||
cci = indicator.CCI
|
||||
close = indicator.CLOSE
|
||||
dmk = indicator.DMK
|
||||
high = indicator.HIGH
|
||||
k = indicator.K
|
||||
low = indicator.LOW
|
||||
macd_val = indicator.MACD
|
||||
ob = indicator.OB
|
||||
os_ = indicator.OS
|
||||
ovs = indicator.OVS
|
||||
ovc = indicator.OVC
|
||||
result = indicator.RESULT
|
||||
wr = indicator.WR
|
||||
percent = indicator.PERCENT
|
||||
v0 = indicator.V0
|
||||
boll_upper = indicator.BOLL_UP
|
||||
boll_lower = indicator.BOLL_LO
|
||||
bias = indicator.BIAS
|
||||
|
||||
# ─── 指标阈值 ───
|
||||
ob_threshold = ob if ob > 0 else 80
|
||||
os_threshold = os_ if os_ > 0 else 20
|
||||
dist_extreme = ovc if ovc > 0 else 5
|
||||
dist_far = ovs if ovs > 0 else 15
|
||||
dist_mid = 30
|
||||
macd_th = 0.3
|
||||
rsi_ob = ovc if ovc > 0 else 70
|
||||
rsi_os = ovs if ovs > 0 else 30
|
||||
di_gap_bull = ovc if ovc > 0 else 15
|
||||
di_gap_bear = -di_gap_bull
|
||||
aroon_ob = ob_threshold
|
||||
aroon_os = os_threshold
|
||||
williams_ob = -20
|
||||
williams_os = -80
|
||||
bias_ob = 5
|
||||
bias_os = -5
|
||||
|
||||
# ─── 指标因子 ───
|
||||
pmacd = getattr(indicator, 'PMACD', macd_val)
|
||||
|
||||
k_macd = _k_macd_factor(ob_threshold, os_threshold, k, macd_val, pmacd)
|
||||
k_di = _k_di_factor(dmk, amplitude, close)
|
||||
k_aroon = _k_aroon_factor(aroon_ob, aroon_os, high, low, close)
|
||||
k_williams = _k_williams_factor(williams_ob, williams_os, wr)
|
||||
k_result = _k_result_factor(ob_threshold, os_threshold, result)
|
||||
k_bias = _k_bias_factor(bias_ob, bias_os, bias)
|
||||
|
||||
# ─── K值累计 ───
|
||||
k_bull = k_macd + k_di + k_aroon + k_williams + k_result + k_bias
|
||||
k_bear = k_macd + k_di + k_aroon + k_williams + k_result + k_bias
|
||||
|
||||
if result > ob_threshold and k_bull > 0 and result >= 90:
|
||||
k_bull *= 1.5
|
||||
|
||||
# ─── 强度计算 ───
|
||||
max_k = max(abs(k_bull), abs(k_bear))
|
||||
if max_k > 0:
|
||||
buy_score = ((k_bull + max_k) / (2 * max_k)) * 100
|
||||
sell_score = ((k_bear + max_k) / (2 * max_k)) * 100
|
||||
else:
|
||||
buy_score = sell_score = 50
|
||||
|
||||
# ─── 信号判断 ───
|
||||
bull_t = buy_score > 70 and result < 90
|
||||
bear_t = sell_score > 70 and result > 10
|
||||
|
||||
k_cci = cci / 300
|
||||
boll_mid = indicator.BOLL_MID if hasattr(indicator, 'BOLL_MID') else (boll_upper + boll_lower) / 2
|
||||
boll_len = boll_upper - boll_lower
|
||||
|
||||
is_bull_t = (
|
||||
bull_t
|
||||
and k_bull > k_cci
|
||||
and close < boll_mid
|
||||
and (
|
||||
(result > 65 and result < 85 and k_bull > 0 and k_bear > 0 and (k_bear - k_bull < 1.5 or result > 75))
|
||||
or (result < 35 and result > 15 and k_bear > 0 and k_bull > 0 and (k_bull - k_bear < 1.5 or result < 25))
|
||||
)
|
||||
)
|
||||
is_bear_t = (
|
||||
bear_t
|
||||
and k_bear > k_cci
|
||||
and close > boll_mid
|
||||
and (
|
||||
(result > 65 and result < 85 and k_bull > 0 and k_bear > 0 and (k_bear - k_bull < 1.5 or result > 75))
|
||||
or (result < 35 and result > 15 and k_bear > 0 and k_bull > 0 and (k_bull - k_bear < 1.5 or result < 25))
|
||||
)
|
||||
)
|
||||
|
||||
# ─── 信号强度 ───
|
||||
sig_strength = 1.0
|
||||
if is_bull_t:
|
||||
sig_strength += 0.3 + max(0, (result - 70) / 30)
|
||||
elif is_bear_t:
|
||||
sig_strength += 0.3 + max(0, (30 - result) / 30)
|
||||
|
||||
strength = (
|
||||
"极强" if sig_strength >= 1.7
|
||||
else "强" if sig_strength >= 1.4
|
||||
else "中" if sig_strength >= 1.1
|
||||
else "弱"
|
||||
)
|
||||
|
||||
# ─── 信号类型 ───
|
||||
if is_bull_t:
|
||||
signal = f"买{strength}"
|
||||
elif is_bear_t:
|
||||
signal = f"卖{strength}"
|
||||
else:
|
||||
signal = "观望"
|
||||
|
||||
# ─── 市场状态 ───
|
||||
if abs(buy_score - sell_score) < 10:
|
||||
status = "中性震荡"
|
||||
elif buy_score > sell_score:
|
||||
if result > ob_threshold:
|
||||
status = "高位企稳"
|
||||
else:
|
||||
status = "温和上涨"
|
||||
else:
|
||||
if result < os_threshold:
|
||||
status = "低位企稳"
|
||||
else:
|
||||
status = "温和下跌"
|
||||
|
||||
# ─── 距离 ───
|
||||
if boll_len > 0:
|
||||
dist_ratio = (close - boll_lower) / boll_len * 100
|
||||
else:
|
||||
dist_ratio = 50
|
||||
|
||||
if dist_ratio < 50 - dist_extreme:
|
||||
dist = "极端超卖"
|
||||
elif dist_ratio < 50 - dist_far:
|
||||
dist = "远离"
|
||||
elif dist_ratio < 50 - dist_mid:
|
||||
dist = "偏离"
|
||||
elif dist_ratio < 50 + dist_mid:
|
||||
dist = "接近"
|
||||
elif dist_ratio < 50 + dist_far:
|
||||
dist = "靠近"
|
||||
elif dist_ratio < 50 + dist_extreme:
|
||||
dist = "远超"
|
||||
else:
|
||||
dist = "极端超买"
|
||||
|
||||
# ─── 强度标签 ───
|
||||
max_score = max(buy_score, sell_score)
|
||||
intensity = (
|
||||
"超强" if max_score >= 90
|
||||
else "强" if max_score >= 80
|
||||
else "中" if max_score >= 65
|
||||
else "弱" if max_score >= 55
|
||||
else "极弱"
|
||||
)
|
||||
|
||||
# ─── 详情 ───
|
||||
ema5 = indicator.EMA5 if hasattr(indicator, 'EMA5') else close
|
||||
ema10 = indicator.EMA10 if hasattr(indicator, 'EMA10') else close
|
||||
ema20 = indicator.EMA20 if hasattr(indicator, 'EMA20') else close
|
||||
bias_val = (ema5 - ema10) / ema10 * 1000 if ema10 != 0 else 0
|
||||
|
||||
bbp_val = (close - boll_lower) / boll_len * 100 if boll_len > 0 else 50
|
||||
|
||||
detail = (
|
||||
f"前量:{percent:.1f} 数量:{int(amplitude):03d} 百分比:{bbp_val:.1f} "
|
||||
f"正:{k_bull:.1f} 负:{k_bear:.1f}"
|
||||
)
|
||||
|
||||
return status, signal, intensity, detail
|
||||
Reference in New Issue
Block a user