存放路径修改
This commit is contained in:
parent
03127c843a
commit
c572eee610
1
.gitignore
vendored
1
.gitignore
vendored
@ -21418,3 +21418,4 @@ frontend/src/renderer/dist-electron/win-unpacked/resources/backend/BodyBalanceBa
|
|||||||
backend/data/patients/202508060001/20250820102556/feet.mp4
|
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
|
frontend/src/renderer/src/services/api.js
|
||||||
|
frontend/src/renderer/src/services/api.js
|
||||||
|
@ -17,6 +17,7 @@ import json
|
|||||||
import base64
|
import base64
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Optional, Dict, Any
|
from typing import Optional, Dict, Any
|
||||||
|
import sys
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from .camera_manager import CameraManager
|
from .camera_manager import CameraManager
|
||||||
@ -110,7 +111,12 @@ class RecordingManager:
|
|||||||
self.recording_start_time = datetime.now()
|
self.recording_start_time = datetime.now()
|
||||||
|
|
||||||
# 创建存储目录
|
# 创建存储目录
|
||||||
base_path = os.path.join('data', 'patients', patient_id, session_id)
|
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:
|
try:
|
||||||
os.makedirs(base_path, exist_ok=True)
|
os.makedirs(base_path, exist_ok=True)
|
||||||
self.logger.info(f'录制目录创建成功: {base_path}')
|
self.logger.info(f'录制目录创建成功: {base_path}')
|
||||||
@ -543,9 +549,14 @@ class RecordingManager:
|
|||||||
"""
|
"""
|
||||||
# 生成采集时间戳
|
# 生成采集时间戳
|
||||||
timestamp = datetime.now().strftime('%Y%m%d_%H%M%S_%f')[:-3] # 精确到毫秒
|
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 = Path(f'data/patients/{patient_id}/{session_id}/{timestamp}')
|
|
||||||
data_dir.mkdir(parents=True, exist_ok=True)
|
data_dir.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
# 设置目录权限为777(完全权限)
|
# 设置目录权限为777(完全权限)
|
||||||
|
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 850 KiB |
Binary file not shown.
Before Width: | Height: | Size: 850 KiB |
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 854 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 707 KiB |
Binary file not shown.
Before Width: | Height: | Size: 706 KiB |
Loading…
Reference in New Issue
Block a user