Merge commit '4c220c84bab78f9bc62605b7688c8da7329db8d4'
This commit is contained in:
commit
564e3eba64
7
dist/test.iss
vendored
7
dist/test.iss
vendored
@ -1,6 +1,6 @@
|
||||
; Script generated by the Inno Setup Script Wizard.
|
||||
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
||||
#define MyAppName "Kneron Academy"
|
||||
#define MyAppName "KNEO X"
|
||||
#define MyAppVersion "2.0"
|
||||
#define MyAppPublisher "Innovedus Inc."
|
||||
#define MyAppURL "https://www.example.com/"
|
||||
@ -35,9 +35,10 @@ Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{
|
||||
Name: "pair1"; Description: "Fire Detection";
|
||||
Name: "pair2"; Description: "Photo_quality";
|
||||
Name: "pair3"; Description: "Test Mode";
|
||||
Name: "pair4"; Description: "Object Detection";
|
||||
[Files]
|
||||
; 安裝主要執行檔到 {app} 目錄
|
||||
Source: "C:\Users\mason\Code\Kneron Academy 2.0\dist\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "C:\Users\mason\Downloads\Kneron-Academy\dist\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
|
||||
; 安裝 config.json 檔案 (不需使用者勾選)
|
||||
Source: "C:\Users\mason\AppData\Local\Kneron_Academy\utils\config.json"; DestDir: "{localappdata}\Kneron_Academy\utils"; Flags: ignoreversion
|
||||
; --- 配對1 ---
|
||||
@ -47,6 +48,8 @@ Source: "C:\Users\mason\AppData\Local\Kneron_Academy\utils\fire detection\yuan\*
|
||||
Source: "C:\Users\mason\AppData\Local\Kneron_Academy\utils\photo quality\ruby\*"; DestDir: "{localappdata}\Kneron_Academy\utils\photo quality\ruby"; Components: pair2; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||
; pair 3
|
||||
Source: "C:\Users\mason\AppData\Local\Kneron_Academy\utils\test mode\test\*"; DestDir: "{localappdata}\Kneron_Academy\utils\test mode\test"; Components: pair3; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||
; pair 4
|
||||
Source: "C:\Users\mason\AppData\Local\Kneron_Academy\utils\yolov5s\yolov5s\*"; DestDir: "{localappdata}\Kneron_Academy\utils\yolov5s\yolov5s"; Components: pair4; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||
[Dirs]
|
||||
; 如有需要隱藏這些資料夾,設定隱藏屬性
|
||||
Name: "{localappdata}\Kneron_Academy\utils\fire detection\yuan"; Attribs: hidden
|
||||
|
||||
@ -8,6 +8,7 @@ import kp
|
||||
from src.config import UXUI_ASSETS, WINDOW_SIZE, BACKGROUND_COLOR, DongleModelMap
|
||||
from src.controllers.device_controller import DeviceController
|
||||
from src.services.device_service import check_available_device
|
||||
from ..config import FW_DIR
|
||||
|
||||
class UtilitiesScreen(QWidget):
|
||||
# Signals for navigation
|
||||
@ -820,13 +821,55 @@ class UtilitiesScreen(QWidget):
|
||||
|
||||
def update_firmware(self):
|
||||
"""Update firmware for the selected device"""
|
||||
selected_rows = self.device_table.selectedItems()
|
||||
try:
|
||||
# 檢查是否有選擇設備
|
||||
selected_rows = self.device_table.selectionModel().selectedRows()
|
||||
if not selected_rows:
|
||||
QMessageBox.warning(self, "Warning", "Please select a device to update firmware")
|
||||
QMessageBox.warning(self, "警告", "請選擇要更新韌體的設備")
|
||||
return
|
||||
|
||||
# In a real application, you would implement the firmware update logic here
|
||||
QMessageBox.information(self, "Info", "Firmware update functionality will be implemented in a future update")
|
||||
# 獲取選擇的設備資訊
|
||||
row_index = selected_rows[0].row()
|
||||
device_model = self.device_table.item(row_index, 0).text() # 設備型號
|
||||
port_id = self.device_table.item(row_index, 1).text() # Port ID
|
||||
|
||||
# 顯示進度條
|
||||
self.show_progress(f"正在更新 {device_model} 的韌體...", 0)
|
||||
|
||||
# 連接設備
|
||||
device_group = kp.core.connect_devices(usb_port_ids=[int(port_id)])
|
||||
|
||||
# 構建韌體檔案路徑
|
||||
scpu_fw_path = os.path.join(FW_DIR, device_model, "fw_scpu.bin")
|
||||
ncpu_fw_path = os.path.join(FW_DIR, device_model, "fw_ncpu.bin")
|
||||
|
||||
# 檢查韌體檔案是否存在
|
||||
if not os.path.exists(scpu_fw_path) or not os.path.exists(ncpu_fw_path):
|
||||
self.hide_progress()
|
||||
QMessageBox.critical(self, "錯誤", f"找不到 {device_model} 的韌體檔案")
|
||||
return
|
||||
|
||||
# 更新進度
|
||||
self.update_progress(30)
|
||||
|
||||
# 載入韌體
|
||||
kp.core.load_firmware_from_file(
|
||||
device_group=device_group,
|
||||
scpu_fw_path=scpu_fw_path,
|
||||
ncpu_fw_path=ncpu_fw_path
|
||||
)
|
||||
|
||||
# 更新進度
|
||||
self.update_progress(100)
|
||||
|
||||
# 顯示成功訊息
|
||||
QMessageBox.information(self, "成功", f"{device_model} 的韌體已成功更新")
|
||||
|
||||
except Exception as e:
|
||||
self.hide_progress()
|
||||
QMessageBox.critical(self, "錯誤", f"更新韌體時發生錯誤: {str(e)}")
|
||||
finally:
|
||||
self.hide_progress()
|
||||
|
||||
def install_drivers(self):
|
||||
"""Install drivers for all supported Kneron devices"""
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user