Main ViewModel
controller.presentation.view_models.main_view_model
主视图模型 - 整合所有子视图模型
MainViewModel
MainViewModel(serial_vm: SerialViewModel, display_vm: DisplayViewModel, control_vm: ControlViewModel, status_vm: StatusViewModel, effector_vm: EffectorViewModel, trajectory_vm: TrajectoryViewModel, dynamics_vm: DynamicsViewModel, camera_vm: CameraViewModel, motion_planning_vm: MotionPlanningViewModel, tools_vm: ToolsViewModel, parent=None)
Bases: BaseViewModel
主视图模型。
整合所有子视图模型,并管理它们之间的信号交互。
属性:
| 名称 | 类型 | 描述 |
|---|---|---|
connection_status_changed |
pyqtSignal
|
串口连接状态信号。 |
status_message_changed |
pyqtSignal
|
状态消息变更信号。 |
progress_changed |
pyqtSignal
|
进度变更信号。 |
serial_vm |
SerialViewModel
|
串口视图模型。 |
display_vm |
DisplayViewModel
|
显示视图模型。 |
control_vm |
ControlViewModel
|
控制视图模型。 |
status_vm |
StatusViewModel
|
状态视图模型。 |
effector_vm |
EffectorViewModel
|
末端执行器视图模型。 |
trajectory_vm |
TrajectoryViewModel
|
轨迹视图模型。 |
dynamics_vm |
DynamicsViewModel
|
动力学视图模型。 |
camera_vm |
CameraViewModel
|
相机视图模型。 |
motion_planning_vm |
MotionPlanningViewModel
|
运动规划视图模型。 |
tools_vm |
ToolsViewModel
|
工具视图模型。 |
初始化主视图模型。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
serial_vm
|
SerialViewModel
|
注入的串口 VM。 |
必需 |
display_vm
|
DisplayViewModel
|
注入的显示 VM。 |
必需 |
control_vm
|
ControlViewModel
|
注入的控制 VM。 |
必需 |
status_vm
|
StatusViewModel
|
注入的状态 VM。 |
必需 |
effector_vm
|
EffectorViewModel
|
注入的末端 VM。 |
必需 |
trajectory_vm
|
TrajectoryViewModel
|
注入的轨迹 VM。 |
必需 |
dynamics_vm
|
DynamicsViewModel
|
注入的动力学 VM。 |
必需 |
camera_vm
|
CameraViewModel
|
注入的相机 VM。 |
必需 |
motion_planning_vm
|
MotionPlanningViewModel
|
注入的规划 VM。 |
必需 |
tools_vm
|
ToolsViewModel
|
注入的工具 VM。 |
必需 |
parent
|
QObject
|
父对象. Defaults to None. |
None
|
源代码位于: src/controller/controller/presentation/view_models/main_view_model.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | |
cleanup
cleanup()
清理资源。
调用所有子 ViewModel 的 cleanup 方法,确保资源释放。
源代码位于: src/controller/controller/presentation/view_models/main_view_model.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | |