Compare commits

..

No commits in common. "72231203481e206208277502c500050518e4074f" and "69b25f89e20fcb19d2fa4c94816da2121332b6ce" have entirely different histories.

6 changed files with 30 additions and 35 deletions

4
.gitignore vendored
View File

@ -45,7 +45,3 @@ win_driver/
claude.md claude.md
src/services/__pycache__/device_service.cpython-312.pyc src/services/__pycache__/device_service.cpython-312.pyc
src/__pycache__/config.cpython-312.pyc src/__pycache__/config.cpython-312.pyc
# Autoflow Agent由 autoflow-agent init 自動產生)
.claude/
.autoflow/CLAUDE.md.backup.*

52
env.txt
View File

@ -2,16 +2,16 @@ absl-py==2.2.2
altgraph==0.17.4 altgraph==0.17.4
astunparse==1.6.3 astunparse==1.6.3
audioread==3.0.1 audioread==3.0.1
Brotli Brotli @ file:///C:/b/abs_3d36mno480/croot/brotli-split_1714483178642/work
certifi certifi @ file:///C:/b/abs_1fw_exq1si/croot/certifi_1725551736618/work/certifi
cffi==1.17.1 cffi==1.17.1
charset-normalizer charset-normalizer @ file:///croot/charset-normalizer_1721748349566/work
colorama==0.4.6 colorama==0.4.6
coloredlogs==15.0.1 coloredlogs==15.0.1
contourpy==1.3.0 contourpy==1.3.0
cycler==0.12.1 cycler==0.12.1
decorator==5.1.1 decorator==5.1.1
filelock filelock @ file:///C:/Users/dev-admin/perseverance-python-buildout/croot/filelock_1701807523603/work
flatbuffers==24.3.25 flatbuffers==24.3.25
fonttools==4.54.1 fonttools==4.54.1
fsspec==2025.3.2 fsspec==2025.3.2
@ -20,12 +20,12 @@ google-pasta==0.2.0
grpcio==1.71.0 grpcio==1.71.0
h5py==3.13.0 h5py==3.13.0
humanfriendly==10.0 humanfriendly==10.0
idna idna @ file:///C:/b/abs_aad84bnnw5/croot/idna_1714398896795/work
Jinja2 Jinja2 @ file:///C:/b/abs_92fccttino/croot/jinja2_1716993447201/work
joblib==1.4.2 joblib==1.4.2
keras keras==3.9.2
kiwisolver kiwisolver==1.4.7
KneronPLUS @ file:///C:/Users/sungs/Downloads/kneron_plus_v3.1.2/kneron_plus/python/package/windows/KneronPLUS-3.1.2-py3-none-any.whl#sha256=826c6765c4b05080ddb39a6a3144021364fb19a12fbe160c4a31141de30063a8 KneronPLUS @ file:///C:/Users/mason/Downloads/kneron_plus_v3.1.1/kneron_plus/python/package/windows/KneronPLUS-3.1.1-py3-none-any.whl#sha256=d31be87c9e565cab5590859c8a1ae6fabf96e7e153ad464442d1f613c29c1235
lazy_loader==0.4 lazy_loader==0.4
libclang==18.1.1 libclang==18.1.1
librosa==0.10.2.post1 librosa==0.10.2.post1
@ -33,21 +33,21 @@ llvmlite==0.43.0
lz4==4.4.4 lz4==4.4.4
Markdown==3.8 Markdown==3.8
markdown-it-py==3.0.0 markdown-it-py==3.0.0
MarkupSafe MarkupSafe @ file:///C:/Users/dev-admin/perseverance-python-buildout/croot/markupsafe_1707425732791/work
matplotlib matplotlib==3.9.2
mdurl==0.1.2 mdurl==0.1.2
mkl-service mkl-service==2.4.0
mkl_fft mkl_fft @ file:///C:/b/abs_f55mv94vyg/croot/mkl_fft_1725370278455/work
mkl_random mkl_random @ file:///C:/b/abs_21ydbzdu8d/croot/mkl_random_1725370276095/work
ml_dtypes==0.5.1 ml_dtypes==0.5.1
mpmath mpmath @ file:///C:/Users/dev-admin/perseverance-python-buildout/croot/mpmath_1699484863771/work
msgpack==1.1.0 msgpack==1.1.0
mtcnn==1.0.0 mtcnn==1.0.0
namex==0.0.9 namex==0.0.9
networkx networkx @ file:///C:/b/abs_3bxnu56g9d/croot/networkx_1717597507456/work
Nuitka==2.6.7 Nuitka==2.6.7
numba==0.60.0 numba==0.60.0
numpy numpy==2.1.3
onnx==1.17.0 onnx==1.17.0
onnxruntime==1.19.2 onnxruntime==1.19.2
opencv-python==4.10.0.84 opencv-python==4.10.0.84
@ -56,7 +56,7 @@ optree==0.15.0
ordered-set==4.1.0 ordered-set==4.1.0
packaging==24.1 packaging==24.1
pefile==2023.2.7 pefile==2023.2.7
pillow pillow @ file:///C:/b/abs_32o8er3uqp/croot/pillow_1721059447598/work
platformdirs==4.3.6 platformdirs==4.3.6
pooch==1.8.2 pooch==1.8.2
protobuf==5.28.2 protobuf==5.28.2
@ -72,11 +72,11 @@ PyQt5==5.15.11
PyQt5-Qt5==5.15.2 PyQt5-Qt5==5.15.2
PyQt5_sip==12.15.0 PyQt5_sip==12.15.0
pyreadline3==3.5.4 pyreadline3==3.5.4
PySocks PySocks @ file:///C:/Users/dev-admin/perseverance-python-buildout/croot/pysocks_1699473336188/work
python-dateutil==2.9.0.post0 python-dateutil==2.9.0.post0
pywin32-ctypes==0.2.3 pywin32-ctypes==0.2.3
PyYAML PyYAML @ file:///C:/b/abs_14xkfs39bx/croot/pyyaml_1728657968772/work
requests requests @ file:///C:/b/abs_9frifg92q2/croot/requests_1721410901096/work
rich==14.0.0 rich==14.0.0
scikit-learn==1.5.2 scikit-learn==1.5.2
scipy==1.14.1 scipy==1.14.1
@ -88,18 +88,18 @@ soxr==0.5.0.post1
sympy==1.13.1 sympy==1.13.1
tensorboard==2.19.0 tensorboard==2.19.0
tensorboard-data-server==0.7.2 tensorboard-data-server==0.7.2
tensorflow tensorflow==2.19.0
termcolor==3.1.0 termcolor==3.1.0
threadpoolctl==3.5.0 threadpoolctl==3.5.0
torch torch==2.5.0
torchaudio==2.5.0 torchaudio==2.5.0
torchvision==0.20.0 torchvision==0.20.0
tqdm==4.66.5 tqdm==4.66.5
typing_extensions typing_extensions @ file:///C:/b/abs_0as9mdbkfl/croot/typing_extensions_1715268906610/work
urllib3 urllib3 @ file:///C:/b/abs_9a_f8h_bn2/croot/urllib3_1727769836930/work
utils==1.0.2 utils==1.0.2
Werkzeug==3.1.3 Werkzeug==3.1.3
wheel==0.44.0 wheel==0.44.0
win-inet-pton win-inet-pton @ file:///C:/Users/dev-admin/perseverance-python-buildout/croot/win_inet_pton_1699472992992/work
wrapt==1.17.2 wrapt==1.17.2
zstandard==0.23.0 zstandard==0.23.0

View File

@ -9,6 +9,7 @@ from PyQt5.QtWidgets import QWidget, QListWidgetItem
from PyQt5.QtGui import QPixmap, QIcon from PyQt5.QtGui import QPixmap, QIcon
from PyQt5.QtCore import Qt from PyQt5.QtCore import Qt
import os import os
import kp
from src.services.device_service import check_available_device from src.services.device_service import check_available_device
from src.config import UXUI_ASSETS, DongleModelMap, DongleIconMap, FW_DIR from src.config import UXUI_ASSETS, DongleModelMap, DongleIconMap, FW_DIR
@ -244,7 +245,6 @@ class DeviceController:
return False return False
# Connect to device # Connect to device
import kp
print('[Connecting device]') print('[Connecting device]')
self.device_group = kp.core.connect_devices(usb_port_ids=[usb_port_id]) self.device_group = kp.core.connect_devices(usb_port_ids=[usb_port_id])
print(' - Connection successful') print(' - Connection successful')
@ -279,7 +279,6 @@ class DeviceController:
""" """
if self.device_group: if self.device_group:
try: try:
import kp
print('[Disconnecting device]') print('[Disconnecting device]')
kp.core.disconnect_devices(device_group=self.device_group) kp.core.disconnect_devices(device_group=self.device_group)
print(' - Disconnected') print(' - Disconnected')

View File

@ -5,6 +5,7 @@ This module provides device scanning functionality with timeout mechanism
for detecting connected Kneron devices. for detecting connected Kneron devices.
""" """
import kp
import threading import threading
@ -21,12 +22,12 @@ class EmptyDescriptor:
self.device_descriptor_list = [] self.device_descriptor_list = []
def check_available_device(timeout=5.0): def check_available_device(timeout=0.5):
""" """
Scan for available Kneron devices with timeout mechanism. Scan for available Kneron devices with timeout mechanism.
Args: Args:
timeout (float): Timeout in seconds (default 5.0). timeout (float): Timeout in seconds (default 0.5).
Returns: Returns:
Device descriptor object containing found devices, Device descriptor object containing found devices,
@ -37,7 +38,6 @@ def check_available_device(timeout=5.0):
def scan_devices(): def scan_devices():
try: try:
import kp
result[0] = kp.core.scan_devices() result[0] = kp.core.scan_devices()
except Exception as e: except Exception as e:
error[0] = e error[0] = e