Control ViewModel
controller.presentation.view_models.control_view_model
ControlViewModel
ControlViewModel(command_hub_service: CommandHubService, parent=None)
Bases: BaseViewModel
控制视图模型。
负责处理用户输入的控制命令,并分发到命令中心服务。
属性:
| 名称 | 类型 | 描述 |
|---|---|---|
command_hub_service |
CommandHubService
|
命令中心服务。 |
初始化控制视图模型。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
command_hub_service
|
CommandHubService
|
命令中心服务。 |
必需 |
parent
|
QObject
|
父对象. Defaults to None. |
None
|
源代码位于: src/controller/controller/presentation/view_models/control_view_model.py
15 16 17 18 19 20 21 22 23 | |
send_command
send_command(config_dict: dict)
发送控制命令。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
config_dict
|
dict
|
命令配置字典,包含控制参数。 |
必需 |
源代码位于: src/controller/controller/presentation/view_models/control_view_model.py
25 26 27 28 29 30 31 | |