存放路径修改

This commit is contained in:
zhaozilong12 2025-08-20 17:16:37 +08:00
parent 03127c843a
commit c572eee610
11 changed files with 15 additions and 3 deletions

1
.gitignore vendored
View File

@ -21418,3 +21418,4 @@ frontend/src/renderer/dist-electron/win-unpacked/resources/backend/BodyBalanceBa
backend/data/patients/202508060001/20250820102556/feet.mp4
frontend/src/renderer/src/services/api.js
frontend/src/renderer/src/services/api.js
frontend/src/renderer/src/services/api.js

View File

@ -17,6 +17,7 @@ import json
import base64
from pathlib import Path
from typing import Optional, Dict, Any
import sys
try:
from .camera_manager import CameraManager
@ -110,6 +111,11 @@ class RecordingManager:
self.recording_start_time = datetime.now()
# 创建存储目录
if getattr(sys, 'frozen', False):
# 打包后的exe文件路径
exe_dir = os.path.dirname(sys.executable)
base_path = os.path.join(exe_dir, 'data', 'patients', patient_id, session_id)
else:
base_path = os.path.join('data', 'patients', patient_id, session_id)
try:
os.makedirs(base_path, exist_ok=True)
@ -543,9 +549,14 @@ class RecordingManager:
"""
# 生成采集时间戳
timestamp = datetime.now().strftime('%Y%m%d_%H%M%S_%f')[:-3] # 精确到毫秒
# 创建数据存储目录
data_dir=""
if getattr(sys, 'frozen', False):
# 打包后的exe文件路径
exe_dir = os.path.dirname(sys.executable)
data_dir=(os.path.join(exe_dir, 'data/patients/{patient_id}/{session_id}/{timestamp}'))
else:
data_dir = Path(f'data/patients/{patient_id}/{session_id}/{timestamp}')
# 创建数据存储目录
data_dir.mkdir(parents=True, exist_ok=True)
# 设置目录权限为777完全权限

Binary file not shown.

Before

Width:  |  Height:  |  Size: 850 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 850 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 854 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 707 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 706 KiB