pymammotion 0.5.69__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pymammotion/__init__.py +53 -0
- pymammotion/agora/__init__.py +0 -0
- pymammotion/agora/agora_api.py +755 -0
- pymammotion/agora/agora_rtc_capabilities.py +748 -0
- pymammotion/agora/agora_websockets.py +1175 -0
- pymammotion/aliyun/__init__.py +1 -0
- pymammotion/aliyun/client.py +235 -0
- pymammotion/aliyun/cloud_gateway.py +982 -0
- pymammotion/aliyun/model/aep_response.py +21 -0
- pymammotion/aliyun/model/connect_response.py +51 -0
- pymammotion/aliyun/model/dev_by_account_response.py +195 -0
- pymammotion/aliyun/model/login_by_oauth_response.py +64 -0
- pymammotion/aliyun/model/regions_response.py +29 -0
- pymammotion/aliyun/model/session_by_authcode_response.py +19 -0
- pymammotion/aliyun/model/thing_response.py +12 -0
- pymammotion/aliyun/regions.py +62 -0
- pymammotion/aliyun/tea/core.py +297 -0
- pymammotion/aliyun/tmp_constant.py +171 -0
- pymammotion/bluetooth/__init__.py +1 -0
- pymammotion/bluetooth/ble.py +62 -0
- pymammotion/bluetooth/ble_message.py +676 -0
- pymammotion/bluetooth/const.py +27 -0
- pymammotion/bluetooth/data/__init__.py +0 -0
- pymammotion/bluetooth/data/convert.py +25 -0
- pymammotion/bluetooth/data/framectrldata.py +40 -0
- pymammotion/bluetooth/data/notifydata.py +62 -0
- pymammotion/bluetooth/model/__init__.py +0 -0
- pymammotion/bluetooth/model/atomic_integer.py +54 -0
- pymammotion/const.py +13 -0
- pymammotion/data/__init__.py +0 -0
- pymammotion/data/model/__init__.py +8 -0
- pymammotion/data/model/account.py +8 -0
- pymammotion/data/model/device.py +192 -0
- pymammotion/data/model/device_config.py +72 -0
- pymammotion/data/model/device_info.py +60 -0
- pymammotion/data/model/device_limits.py +49 -0
- pymammotion/data/model/enums.py +77 -0
- pymammotion/data/model/errors.py +12 -0
- pymammotion/data/model/events.py +14 -0
- pymammotion/data/model/generate_geojson.py +565 -0
- pymammotion/data/model/generate_route_information.py +26 -0
- pymammotion/data/model/hash_list.py +475 -0
- pymammotion/data/model/location.py +36 -0
- pymammotion/data/model/mowing_modes.py +77 -0
- pymammotion/data/model/rapid_state.py +45 -0
- pymammotion/data/model/raw_data.py +215 -0
- pymammotion/data/model/region_data.py +102 -0
- pymammotion/data/model/report_info.py +182 -0
- pymammotion/data/model/work.py +27 -0
- pymammotion/data/mower_state_manager.py +369 -0
- pymammotion/data/mqtt/__init__.py +1 -0
- pymammotion/data/mqtt/event.py +227 -0
- pymammotion/data/mqtt/mammotion_properties.py +276 -0
- pymammotion/data/mqtt/properties.py +203 -0
- pymammotion/data/mqtt/status.py +57 -0
- pymammotion/event/__init__.py +6 -0
- pymammotion/event/event.py +96 -0
- pymammotion/homeassistant/__init__.py +3 -0
- pymammotion/homeassistant/mower_api.py +514 -0
- pymammotion/homeassistant/rtk_api.py +54 -0
- pymammotion/http/__init__.py +0 -0
- pymammotion/http/encryption.py +220 -0
- pymammotion/http/http.py +673 -0
- pymammotion/http/model/__init__.py +0 -0
- pymammotion/http/model/camera_stream.py +31 -0
- pymammotion/http/model/http.py +249 -0
- pymammotion/http/model/response_factory.py +61 -0
- pymammotion/http/model/rtk.py +16 -0
- pymammotion/mammotion/__init__.py +0 -0
- pymammotion/mammotion/commands/__init__.py +0 -0
- pymammotion/mammotion/commands/abstract_message.py +24 -0
- pymammotion/mammotion/commands/mammotion_command.py +81 -0
- pymammotion/mammotion/commands/messages/__init__.py +0 -0
- pymammotion/mammotion/commands/messages/basestation.py +43 -0
- pymammotion/mammotion/commands/messages/driver.py +122 -0
- pymammotion/mammotion/commands/messages/media.py +87 -0
- pymammotion/mammotion/commands/messages/navigation.py +564 -0
- pymammotion/mammotion/commands/messages/network.py +205 -0
- pymammotion/mammotion/commands/messages/ota.py +38 -0
- pymammotion/mammotion/commands/messages/system.py +330 -0
- pymammotion/mammotion/commands/messages/video.py +33 -0
- pymammotion/mammotion/control/__init__.py +0 -0
- pymammotion/mammotion/control/joystick.py +145 -0
- pymammotion/mammotion/devices/__init__.py +29 -0
- pymammotion/mammotion/devices/base.py +163 -0
- pymammotion/mammotion/devices/mammotion.py +571 -0
- pymammotion/mammotion/devices/mammotion_bluetooth.py +496 -0
- pymammotion/mammotion/devices/mammotion_cloud.py +355 -0
- pymammotion/mammotion/devices/mammotion_mower_ble.py +48 -0
- pymammotion/mammotion/devices/mammotion_mower_cloud.py +39 -0
- pymammotion/mammotion/devices/managers/managers.py +81 -0
- pymammotion/mammotion/devices/mower_device.py +120 -0
- pymammotion/mammotion/devices/mower_manager.py +107 -0
- pymammotion/mammotion/devices/rtk_ble.py +89 -0
- pymammotion/mammotion/devices/rtk_cloud.py +115 -0
- pymammotion/mammotion/devices/rtk_device.py +50 -0
- pymammotion/mammotion/devices/rtk_manager.py +125 -0
- pymammotion/mqtt/__init__.py +6 -0
- pymammotion/mqtt/aliyun_mqtt.py +237 -0
- pymammotion/mqtt/linkkit/__init__.py +5 -0
- pymammotion/mqtt/linkkit/h2client.py +585 -0
- pymammotion/mqtt/linkkit/linkkit.py +3025 -0
- pymammotion/mqtt/mammotion_future.py +26 -0
- pymammotion/mqtt/mammotion_mqtt.py +214 -0
- pymammotion/mqtt/mqtt_models.py +66 -0
- pymammotion/proto/__init__.py +4841 -0
- pymammotion/proto/basestation.proto +51 -0
- pymammotion/proto/basestation_pb2.py +35 -0
- pymammotion/proto/basestation_pb2.pyi +89 -0
- pymammotion/proto/common.proto +7 -0
- pymammotion/proto/common_pb2.py +25 -0
- pymammotion/proto/common_pb2.pyi +13 -0
- pymammotion/proto/dev_net.proto +321 -0
- pymammotion/proto/dev_net_pb2.py +111 -0
- pymammotion/proto/dev_net_pb2.pyi +515 -0
- pymammotion/proto/luba_msg.proto +76 -0
- pymammotion/proto/luba_msg_pb2.py +41 -0
- pymammotion/proto/luba_msg_pb2.pyi +97 -0
- pymammotion/proto/luba_mul.proto +129 -0
- pymammotion/proto/luba_mul_pb2.py +61 -0
- pymammotion/proto/luba_mul_pb2.pyi +178 -0
- pymammotion/proto/mctrl_driver.proto +107 -0
- pymammotion/proto/mctrl_driver_pb2.py +57 -0
- pymammotion/proto/mctrl_driver_pb2.pyi +167 -0
- pymammotion/proto/mctrl_nav.proto +591 -0
- pymammotion/proto/mctrl_nav_pb2.py +136 -0
- pymammotion/proto/mctrl_nav_pb2.pyi +1067 -0
- pymammotion/proto/mctrl_ota.proto +80 -0
- pymammotion/proto/mctrl_ota_pb2.py +45 -0
- pymammotion/proto/mctrl_ota_pb2.pyi +128 -0
- pymammotion/proto/mctrl_pept.proto +34 -0
- pymammotion/proto/mctrl_pept_pb2.py +33 -0
- pymammotion/proto/mctrl_pept_pb2.pyi +58 -0
- pymammotion/proto/mctrl_sys.proto +741 -0
- pymammotion/proto/mctrl_sys_pb2.py +206 -0
- pymammotion/proto/mctrl_sys_pb2.pyi +1213 -0
- pymammotion/proto/message_pool.py +3 -0
- pymammotion/proto/py.typed +0 -0
- pymammotion/py.typed +0 -0
- pymammotion/utility/constant/__init__.py +3 -0
- pymammotion/utility/constant/device_constant.py +315 -0
- pymammotion/utility/conversions.py +5 -0
- pymammotion/utility/datatype_converter.py +124 -0
- pymammotion/utility/device_config.py +755 -0
- pymammotion/utility/device_type.py +489 -0
- pymammotion/utility/map.py +259 -0
- pymammotion/utility/movement.py +18 -0
- pymammotion/utility/mur_mur_hash.py +159 -0
- pymammotion/utility/periodic.py +106 -0
- pymammotion/utility/rocker_util.py +194 -0
- pymammotion-0.5.69.dist-info/METADATA +93 -0
- pymammotion-0.5.69.dist-info/RECORD +154 -0
- pymammotion-0.5.69.dist-info/WHEEL +4 -0
- pymammotion-0.5.69.dist-info/licenses/LICENSE +674 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# === sendOrderMsg_Media ===
|
|
2
|
+
from abc import ABC
|
|
3
|
+
|
|
4
|
+
from pymammotion.mammotion.commands.abstract_message import AbstractMessage
|
|
5
|
+
from pymammotion.proto import (
|
|
6
|
+
GetHeadlamp,
|
|
7
|
+
LampCtrlSta,
|
|
8
|
+
LampManualCtrlSta,
|
|
9
|
+
LubaMsg,
|
|
10
|
+
MsgAttr,
|
|
11
|
+
MsgCmdType,
|
|
12
|
+
MsgDevice,
|
|
13
|
+
MulLanguage,
|
|
14
|
+
MulSetAudio,
|
|
15
|
+
MulSetWiper,
|
|
16
|
+
MulSex,
|
|
17
|
+
SetHeadlamp,
|
|
18
|
+
SocMul,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class MessageMedia(AbstractMessage, ABC):
|
|
23
|
+
def send_order_msg_media(self, mul):
|
|
24
|
+
luba_msg = LubaMsg(
|
|
25
|
+
msgtype=MsgCmdType.MUL,
|
|
26
|
+
sender=MsgDevice.DEV_MOBILEAPP,
|
|
27
|
+
rcver=self.get_msg_device(MsgCmdType.MUL, MsgDevice.SOC_MODULE_MULTIMEDIA),
|
|
28
|
+
msgattr=MsgAttr.REQ,
|
|
29
|
+
seqs=self.seqs.increment_and_get() & 255,
|
|
30
|
+
version=1,
|
|
31
|
+
subtype=self.user_account,
|
|
32
|
+
mul=mul,
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
return luba_msg.SerializeToString()
|
|
36
|
+
|
|
37
|
+
def set_car_volume(self, volume: int):
|
|
38
|
+
"""Set the car volume. 0 - 100"""
|
|
39
|
+
return self.send_order_msg_media(SocMul(set_audio=MulSetAudio(at_switch=volume)))
|
|
40
|
+
|
|
41
|
+
def set_car_voice_language(self, language_type: MulLanguage | str | None):
|
|
42
|
+
return self.send_order_msg_media(SocMul(set_audio=MulSetAudio(au_language=language_type)))
|
|
43
|
+
|
|
44
|
+
def set_car_volume_sex(self, sex: MulSex):
|
|
45
|
+
return self.send_order_msg_media(SocMul(set_audio=MulSetAudio(sex=sex)))
|
|
46
|
+
|
|
47
|
+
def set_car_wiper(self, round_num: int):
|
|
48
|
+
"""Set mower wiper."""
|
|
49
|
+
# 2
|
|
50
|
+
return self.send_order_msg_media(SocMul(set_wiper=MulSetWiper(round=round_num)))
|
|
51
|
+
|
|
52
|
+
def get_car_light(self, ids: int):
|
|
53
|
+
"""Get mower light settings.
|
|
54
|
+
1126 for manual
|
|
55
|
+
1123 for night time settings
|
|
56
|
+
"""
|
|
57
|
+
return self.send_order_msg_media(SocMul(get_lamp=GetHeadlamp(get_ids=ids)))
|
|
58
|
+
|
|
59
|
+
def set_car_light(self, on_off: bool = False):
|
|
60
|
+
"""Set mower light.
|
|
61
|
+
|
|
62
|
+
set whether light is on during the night during mowing
|
|
63
|
+
auto night on true, id=1121, power_ctrl=1
|
|
64
|
+
auto night off false, id=1121, power_ctrl=1
|
|
65
|
+
"""
|
|
66
|
+
|
|
67
|
+
ctrl_state = LampCtrlSta.power_ctrl_on if on_off else LampCtrlSta.power_off
|
|
68
|
+
return self.send_order_msg_media(
|
|
69
|
+
SocMul(
|
|
70
|
+
set_lamp=SetHeadlamp(
|
|
71
|
+
set_ids=1121, lamp_power_ctrl=1, lamp_ctrl=ctrl_state, ctrl_lamp_bright=False, lamp_bright=0
|
|
72
|
+
)
|
|
73
|
+
)
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
def set_car_manual_light(self, manual_ctrl: bool = False):
|
|
77
|
+
"""Set mower light.
|
|
78
|
+
|
|
79
|
+
set whether light is on manually
|
|
80
|
+
manual on: true, id=1125, power_ctrl=2
|
|
81
|
+
manual off: false, id=1127, power_ctrl=2
|
|
82
|
+
"""
|
|
83
|
+
ids = 1125 if manual_ctrl else 1127
|
|
84
|
+
manual_light_ctrl = LampManualCtrlSta.manual_power_on if manual_ctrl else LampManualCtrlSta.manual_power_off
|
|
85
|
+
return self.send_order_msg_media(
|
|
86
|
+
SocMul(set_lamp=SetHeadlamp(set_ids=ids, lamp_power_ctrl=2, lamp_manual_ctrl=manual_light_ctrl))
|
|
87
|
+
)
|
|
@@ -0,0 +1,564 @@
|
|
|
1
|
+
# === sendOrderMsg_Nav ===
|
|
2
|
+
from abc import ABC
|
|
3
|
+
import logging
|
|
4
|
+
import time
|
|
5
|
+
|
|
6
|
+
from pymammotion.data.model import GenerateRouteInformation
|
|
7
|
+
from pymammotion.data.model.hash_list import Plan, SvgMessage
|
|
8
|
+
from pymammotion.data.model.region_data import RegionData
|
|
9
|
+
from pymammotion.mammotion.commands.abstract_message import AbstractMessage
|
|
10
|
+
from pymammotion.proto import (
|
|
11
|
+
AppRequestCoverPathsT,
|
|
12
|
+
LubaMsg,
|
|
13
|
+
MctlNav,
|
|
14
|
+
MsgAttr,
|
|
15
|
+
MsgCmdType,
|
|
16
|
+
MsgDevice,
|
|
17
|
+
NavGetCommData,
|
|
18
|
+
NavGetHashList,
|
|
19
|
+
NavMapNameMsg,
|
|
20
|
+
NavPlanJobSet,
|
|
21
|
+
NavPlanTaskExecute,
|
|
22
|
+
NavReqCoverPath,
|
|
23
|
+
NavSysParamMsg,
|
|
24
|
+
NavTaskCtrl,
|
|
25
|
+
NavUnableTimeSet,
|
|
26
|
+
NavUploadZigZagResultAck,
|
|
27
|
+
SimulationCmdData,
|
|
28
|
+
SvgMessageAckT,
|
|
29
|
+
SvgMessageT,
|
|
30
|
+
WorkReportCmdData,
|
|
31
|
+
WorkReportUpdateCmd,
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
logger = logging.getLogger(__name__)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class MessageNavigation(AbstractMessage, ABC):
|
|
38
|
+
def send_order_msg_nav(self, build: MctlNav) -> bytes:
|
|
39
|
+
luba_msg = LubaMsg(
|
|
40
|
+
msgtype=MsgCmdType.NAV,
|
|
41
|
+
sender=MsgDevice.DEV_MOBILEAPP,
|
|
42
|
+
rcver=self.get_msg_device(MsgCmdType.NAV, MsgDevice.DEV_MAINCTL),
|
|
43
|
+
msgattr=MsgAttr.REQ,
|
|
44
|
+
seqs=self.seqs.increment_and_get() & 255,
|
|
45
|
+
version=1,
|
|
46
|
+
subtype=self.user_account,
|
|
47
|
+
nav=build,
|
|
48
|
+
timestamp=round(time.time() * 1000),
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
return luba_msg.SerializeToString()
|
|
52
|
+
|
|
53
|
+
def allpowerfull_rw_adapter_x3(self, rw_id: int, context: int, rw: int) -> bytes:
|
|
54
|
+
build = MctlNav(nav_sys_param_cmd=NavSysParamMsg(id=rw_id, context=context, rw=rw))
|
|
55
|
+
logger.debug(f"Send command--x3 general read and write command id={rw_id}, context={context}, rw={rw}")
|
|
56
|
+
return self.send_order_msg_nav(build)
|
|
57
|
+
|
|
58
|
+
def along_border(self) -> bytes:
|
|
59
|
+
build = MctlNav(todev_edgecmd=1)
|
|
60
|
+
logger.debug("Send command--along the edge command")
|
|
61
|
+
return self.send_order_msg_nav(build)
|
|
62
|
+
|
|
63
|
+
def start_draw_border(self) -> bytes:
|
|
64
|
+
build = MctlNav(todev_get_commondata=NavGetCommData(pver=1, action=0, type=0))
|
|
65
|
+
logger.debug("Send command--Start drawing boundary command")
|
|
66
|
+
return self.send_order_msg_nav(build)
|
|
67
|
+
|
|
68
|
+
def enter_dumping_status(self) -> bytes:
|
|
69
|
+
build = MctlNav(todev_get_commondata=NavGetCommData(pver=1, action=14, type=12))
|
|
70
|
+
logger.debug("Send command--Enter grass collection status")
|
|
71
|
+
return self.send_order_msg_nav(build)
|
|
72
|
+
|
|
73
|
+
def add_dump_point(self) -> bytes:
|
|
74
|
+
build = MctlNav(todev_get_commondata=NavGetCommData(pver=1, action=0, type=12))
|
|
75
|
+
logger.debug("Send command--Add grass collection point")
|
|
76
|
+
return self.send_order_msg_nav(build)
|
|
77
|
+
|
|
78
|
+
def revoke_dump_point(self) -> bytes:
|
|
79
|
+
build = MctlNav(todev_get_commondata=NavGetCommData(pver=1, action=6, type=12))
|
|
80
|
+
logger.debug("Send command--Revoke grass collection point")
|
|
81
|
+
return self.send_order_msg_nav(build)
|
|
82
|
+
|
|
83
|
+
def exit_dumping_status(self) -> bytes:
|
|
84
|
+
build = MctlNav(todev_get_commondata=NavGetCommData(pver=1, action=1, type=12))
|
|
85
|
+
logger.debug("Send command--Exit grass collection setting status")
|
|
86
|
+
return self.send_order_msg_nav(build)
|
|
87
|
+
|
|
88
|
+
def out_drop_dumping_add(self) -> bytes:
|
|
89
|
+
build = MctlNav(todev_get_commondata=NavGetCommData(pver=1, action=15, type=12))
|
|
90
|
+
logger.debug("Send command--Complete external grass collection point marking operation")
|
|
91
|
+
return self.send_order_msg_nav(build)
|
|
92
|
+
|
|
93
|
+
def recover_dumping(self) -> bytes:
|
|
94
|
+
build = MctlNav(todev_get_commondata=NavGetCommData(pver=1, action=12, type=12))
|
|
95
|
+
logger.debug("Send command--Recover grass collection operation")
|
|
96
|
+
return self.send_order_msg_nav(build)
|
|
97
|
+
|
|
98
|
+
def start_draw_barrier(self) -> bytes:
|
|
99
|
+
build = MctlNav(todev_get_commondata=NavGetCommData(pver=1, action=0, type=1))
|
|
100
|
+
logger.debug("Sending command - Draw obstacle command")
|
|
101
|
+
return self.send_order_msg_nav(build)
|
|
102
|
+
|
|
103
|
+
def start_erase(self) -> bytes:
|
|
104
|
+
build = MctlNav(todev_get_commondata=NavGetCommData(pver=1, action=4, type=0))
|
|
105
|
+
logger.debug("Sending command - Start erase command - Bluetooth")
|
|
106
|
+
return self.send_order_msg_nav(build)
|
|
107
|
+
|
|
108
|
+
def end_erase(self) -> bytes:
|
|
109
|
+
build = MctlNav(todev_get_commondata=NavGetCommData(pver=1, action=5, type=0))
|
|
110
|
+
logger.debug("Sending command - End erase command")
|
|
111
|
+
return self.send_order_msg_nav(build)
|
|
112
|
+
|
|
113
|
+
def cancel_erase(self) -> bytes:
|
|
114
|
+
build = MctlNav(todev_get_commondata=NavGetCommData(pver=1, action=7, type=0))
|
|
115
|
+
logger.debug("Sending command - Cancel erase command")
|
|
116
|
+
return self.send_order_msg_nav(build)
|
|
117
|
+
|
|
118
|
+
def start_channel_line(self) -> bytes:
|
|
119
|
+
build = MctlNav(todev_get_commondata=NavGetCommData(pver=1, action=0, type=2))
|
|
120
|
+
logger.debug("Sending command - Start drawing channel line command")
|
|
121
|
+
return self.send_order_msg_nav(build)
|
|
122
|
+
|
|
123
|
+
def save_task(self) -> bytes:
|
|
124
|
+
build = MctlNav(todev_save_task=1)
|
|
125
|
+
logger.debug("Sending command - Save task command")
|
|
126
|
+
return self.send_order_msg_nav(build)
|
|
127
|
+
|
|
128
|
+
def set_edit_boundary(self, action: int) -> bytes:
|
|
129
|
+
build = MctlNav(todev_get_commondata=NavGetCommData(pver=1, action=action, type=0))
|
|
130
|
+
logger.debug(f"Sending secondary editing command action={action}")
|
|
131
|
+
return self.send_order_msg_nav(build)
|
|
132
|
+
|
|
133
|
+
def set_data_synchronization(self, type: int) -> bytes:
|
|
134
|
+
logger.debug(f"Sync data ==================== Sending ============ Restore command: {type}")
|
|
135
|
+
build = MctlNav(todev_get_commondata=NavGetCommData(pver=1, action=12, type=type))
|
|
136
|
+
logger.debug("Sync data ==================== Sending ============ Restore command")
|
|
137
|
+
return self.send_order_msg_nav(build)
|
|
138
|
+
|
|
139
|
+
def send_plan(self, plan_bean: Plan) -> bytes:
|
|
140
|
+
build = MctlNav(
|
|
141
|
+
todev_planjob_set=NavPlanJobSet(
|
|
142
|
+
pver=plan_bean.pver,
|
|
143
|
+
sub_cmd=plan_bean.sub_cmd,
|
|
144
|
+
area=plan_bean.area,
|
|
145
|
+
work_time=plan_bean.work_time,
|
|
146
|
+
version=plan_bean.version,
|
|
147
|
+
id=plan_bean.id,
|
|
148
|
+
user_id=plan_bean.user_id,
|
|
149
|
+
device_id=plan_bean.device_id,
|
|
150
|
+
plan_id=plan_bean.plan_id,
|
|
151
|
+
task_id=plan_bean.task_id,
|
|
152
|
+
job_id=plan_bean.job_id,
|
|
153
|
+
start_time=plan_bean.start_time,
|
|
154
|
+
end_time=plan_bean.end_time,
|
|
155
|
+
week=plan_bean.week,
|
|
156
|
+
knife_height=plan_bean.knife_height,
|
|
157
|
+
model=plan_bean.model,
|
|
158
|
+
edge_mode=plan_bean.edge_mode,
|
|
159
|
+
required_time=plan_bean.required_time,
|
|
160
|
+
route_angle=plan_bean.route_angle,
|
|
161
|
+
route_model=plan_bean.route_model,
|
|
162
|
+
route_spacing=plan_bean.route_spacing,
|
|
163
|
+
ultrasonic_barrier=plan_bean.ultrasonic_barrier,
|
|
164
|
+
total_plan_num=plan_bean.total_plan_num,
|
|
165
|
+
plan_index=plan_bean.plan_index,
|
|
166
|
+
result=plan_bean.result,
|
|
167
|
+
speed=plan_bean.speed,
|
|
168
|
+
task_name=plan_bean.task_name,
|
|
169
|
+
job_name=plan_bean.job_name,
|
|
170
|
+
zone_hashs=plan_bean.zone_hashs,
|
|
171
|
+
reserved=plan_bean.reserved,
|
|
172
|
+
)
|
|
173
|
+
)
|
|
174
|
+
logger.debug(f"Send read job plan command planBean={plan_bean}")
|
|
175
|
+
return self.send_order_msg_nav(build)
|
|
176
|
+
|
|
177
|
+
def send_schedule(self, plan_bean: Plan) -> bytes:
|
|
178
|
+
build = NavPlanJobSet(
|
|
179
|
+
pver=plan_bean.pver,
|
|
180
|
+
sub_cmd=plan_bean.sub_cmd,
|
|
181
|
+
area=plan_bean.area,
|
|
182
|
+
device_id=plan_bean.device_id,
|
|
183
|
+
work_time=plan_bean.work_time,
|
|
184
|
+
version=plan_bean.version,
|
|
185
|
+
id=plan_bean.id,
|
|
186
|
+
user_id=plan_bean.user_id,
|
|
187
|
+
plan_id=plan_bean.plan_id,
|
|
188
|
+
task_id=plan_bean.task_id,
|
|
189
|
+
job_id=plan_bean.job_id,
|
|
190
|
+
start_time=plan_bean.start_time,
|
|
191
|
+
end_time=plan_bean.end_time,
|
|
192
|
+
week=plan_bean.week,
|
|
193
|
+
knife_height=plan_bean.knife_height,
|
|
194
|
+
model=plan_bean.model,
|
|
195
|
+
edge_mode=plan_bean.edge_mode,
|
|
196
|
+
required_time=plan_bean.required_time,
|
|
197
|
+
route_angle=plan_bean.route_angle,
|
|
198
|
+
route_model=plan_bean.route_model,
|
|
199
|
+
route_spacing=plan_bean.route_spacing,
|
|
200
|
+
ultrasonic_barrier=plan_bean.ultrasonic_barrier,
|
|
201
|
+
total_plan_num=plan_bean.total_plan_num,
|
|
202
|
+
plan_index=plan_bean.plan_index,
|
|
203
|
+
result=plan_bean.result,
|
|
204
|
+
speed=plan_bean.speed,
|
|
205
|
+
task_name=plan_bean.task_name,
|
|
206
|
+
job_name=plan_bean.job_name,
|
|
207
|
+
zone_hashs=plan_bean.zone_hashs,
|
|
208
|
+
reserved=plan_bean.reserved,
|
|
209
|
+
weeks=plan_bean.weeks,
|
|
210
|
+
start_date=plan_bean.start_date,
|
|
211
|
+
trigger_type=plan_bean.trigger_type,
|
|
212
|
+
day=plan_bean.day,
|
|
213
|
+
toward_included_angle=plan_bean.toward_included_angle,
|
|
214
|
+
toward_mode=0,
|
|
215
|
+
)
|
|
216
|
+
logger.debug(f"Send read job plan command planBean={plan_bean}")
|
|
217
|
+
return self.send_order_msg_nav(MctlNav(todev_planjob_set=build))
|
|
218
|
+
|
|
219
|
+
def single_schedule(self, plan_id: str) -> bytes:
|
|
220
|
+
return self.send_order_msg_nav(MctlNav(plan_task_execute=NavPlanTaskExecute(sub_cmd=1, id=plan_id)))
|
|
221
|
+
|
|
222
|
+
def read_plan(self, sub_cmd: int, plan_index: int = 0) -> bytes:
|
|
223
|
+
build = MctlNav(todev_planjob_set=NavPlanJobSet(sub_cmd=sub_cmd, plan_index=plan_index))
|
|
224
|
+
logger.debug(f"Send read job plan command cmd={sub_cmd} PlanIndex = {plan_index}")
|
|
225
|
+
return self.send_order_msg_nav(build)
|
|
226
|
+
|
|
227
|
+
def delete_plan(self, sub_cmd: int, plan_id: str) -> bytes:
|
|
228
|
+
build = MctlNav(todev_planjob_set=NavPlanJobSet(sub_cmd=sub_cmd, plan_id=plan_id))
|
|
229
|
+
logger.debug(f"Send command--Send delete job plan command cmd={sub_cmd} planId = {plan_id}")
|
|
230
|
+
return self.send_order_msg_nav(build)
|
|
231
|
+
|
|
232
|
+
def set_plan_unable_time(self, sub_cmd: int, device_id: str, unable_end_time: str, unable_start_time: str) -> bytes:
|
|
233
|
+
build = NavUnableTimeSet(
|
|
234
|
+
sub_cmd=sub_cmd,
|
|
235
|
+
device_id=device_id,
|
|
236
|
+
unable_end_time=unable_end_time,
|
|
237
|
+
result=0,
|
|
238
|
+
reserved="0",
|
|
239
|
+
unable_start_time=unable_start_time,
|
|
240
|
+
)
|
|
241
|
+
logger.debug(f"{self.get_device_name()} Set forbidden time===={build}")
|
|
242
|
+
return self.send_order_msg_nav(MctlNav(todev_unable_time_set=build))
|
|
243
|
+
|
|
244
|
+
def read_plan_unable_time(self, sub_cmd: int) -> bytes:
|
|
245
|
+
build = NavUnableTimeSet(sub_cmd=sub_cmd)
|
|
246
|
+
build2 = MctlNav(todev_unable_time_set=build)
|
|
247
|
+
logger.debug(f"Send command--Read plan time {sub_cmd}")
|
|
248
|
+
return self.send_order_msg_nav(build2)
|
|
249
|
+
|
|
250
|
+
def read_job_not_not_disturb(self) -> bytes:
|
|
251
|
+
build = NavUnableTimeSet(sub_cmd=2)
|
|
252
|
+
build2 = MctlNav(todev_unable_time_set=build)
|
|
253
|
+
logger.debug(f"Send command--Read job dnd {2}")
|
|
254
|
+
return self.send_order_msg_nav(build2)
|
|
255
|
+
|
|
256
|
+
def job_animal_protect_read(self) -> bytes:
|
|
257
|
+
"""Read animal protection settings."""
|
|
258
|
+
build = NavUnableTimeSet(sub_cmd=2, trigger=99)
|
|
259
|
+
build2 = MctlNav(todev_unable_time_set=build)
|
|
260
|
+
logger.debug(f"Send command - Read job do not disturb time subCmd2 {build}")
|
|
261
|
+
return self.send_order_msg_nav(build2)
|
|
262
|
+
|
|
263
|
+
def job_do_not_disturb(self, unable_start_time: str, unable_end_time: str) -> bytes:
|
|
264
|
+
"""Set do not disturb time period."""
|
|
265
|
+
build = MctlNav(
|
|
266
|
+
todev_unable_time_set=NavUnableTimeSet(
|
|
267
|
+
sub_cmd=1, trigger=1, unable_start_time=unable_start_time, unable_end_time=unable_end_time
|
|
268
|
+
)
|
|
269
|
+
)
|
|
270
|
+
logger.debug(f"Send command - Set job do not disturb time: {unable_start_time} - {unable_end_time}")
|
|
271
|
+
return self.send_order_msg_nav(build)
|
|
272
|
+
|
|
273
|
+
def job_do_not_disturb_del(self) -> bytes:
|
|
274
|
+
"""Delete do not disturb settings."""
|
|
275
|
+
build = MctlNav(todev_unable_time_set=NavUnableTimeSet(sub_cmd=1, trigger=0))
|
|
276
|
+
logger.debug("Send command - Turn off do not disturb time")
|
|
277
|
+
return self.send_order_msg_nav(build)
|
|
278
|
+
|
|
279
|
+
def query_job_history(self) -> bytes:
|
|
280
|
+
return self.send_order_msg_nav(MctlNav(todev_work_report_update_cmd=WorkReportUpdateCmd(sub_cmd=1)))
|
|
281
|
+
|
|
282
|
+
def request_job_history(self, num: int) -> bytes:
|
|
283
|
+
return self.send_order_msg_nav(MctlNav(todev_work_report_cmd=WorkReportCmdData(sub_cmd=1, get_info_num=num)))
|
|
284
|
+
|
|
285
|
+
def leave_dock(self) -> bytes:
|
|
286
|
+
build = MctlNav(todev_one_touch_leave_pile=1)
|
|
287
|
+
logger.debug("Send command--One-click automatic undocking")
|
|
288
|
+
return self.send_order_msg_nav(build)
|
|
289
|
+
|
|
290
|
+
def get_area_name_list(self, device_id: str) -> bytes:
|
|
291
|
+
# Build the NavMapNameMsg with the specified parameters
|
|
292
|
+
mctl_nav = MctlNav(
|
|
293
|
+
toapp_map_name_msg=NavMapNameMsg(
|
|
294
|
+
hash=0,
|
|
295
|
+
result=0,
|
|
296
|
+
device_id=device_id, # iot_id
|
|
297
|
+
rw=0,
|
|
298
|
+
)
|
|
299
|
+
)
|
|
300
|
+
|
|
301
|
+
# Send the message with the specified ID and acknowledge flag
|
|
302
|
+
logger.debug("Send command--Get area name list")
|
|
303
|
+
return self.send_order_msg_nav(mctl_nav)
|
|
304
|
+
|
|
305
|
+
def set_area_name(self, device_id: str, hash_id: int, name: str) -> bytes:
|
|
306
|
+
# Build the NavMapNameMsg with the specified parameters
|
|
307
|
+
mctl_nav = MctlNav(
|
|
308
|
+
toapp_map_name_msg=NavMapNameMsg(hash=hash_id, name=name, result=0, device_id=device_id, rw=1)
|
|
309
|
+
)
|
|
310
|
+
|
|
311
|
+
# Send the message with the specified ID and acknowledge flag
|
|
312
|
+
logger.debug("Send command--Get area name list")
|
|
313
|
+
return self.send_order_msg_nav(mctl_nav)
|
|
314
|
+
|
|
315
|
+
def get_all_boundary_hash_list(self, sub_cmd: int) -> bytes:
|
|
316
|
+
build = MctlNav(todev_gethash=NavGetHashList(pver=1, sub_cmd=sub_cmd))
|
|
317
|
+
logger.debug(f"Area loading=====================:Get area hash list:{sub_cmd}")
|
|
318
|
+
return self.send_order_msg_nav(build)
|
|
319
|
+
|
|
320
|
+
def get_hash_response(self, total_frame: int, current_frame: int) -> bytes:
|
|
321
|
+
build = MctlNav(
|
|
322
|
+
todev_gethash=NavGetHashList(pver=1, sub_cmd=2, current_frame=current_frame, total_frame=total_frame)
|
|
323
|
+
)
|
|
324
|
+
logger.debug(
|
|
325
|
+
f"Send command--208 Response hash list command totalFrame={total_frame},currentFrame={current_frame}"
|
|
326
|
+
)
|
|
327
|
+
return self.send_order_msg_nav(build)
|
|
328
|
+
|
|
329
|
+
def synchronize_hash_data(self, hash_num: int) -> bytes:
|
|
330
|
+
build = MctlNav(todev_get_commondata=NavGetCommData(pver=1, action=8, hash=hash_num, sub_cmd=1))
|
|
331
|
+
logger.debug(f"Send command--209,hash synchronize area data hash:{hash_num}")
|
|
332
|
+
return self.send_order_msg_nav(build)
|
|
333
|
+
|
|
334
|
+
def get_area_to_be_transferred(self) -> bytes:
|
|
335
|
+
build = MctlNav(todev_get_commondata=NavGetCommData(pver=1, action=8, sub_cmd=1, type=3))
|
|
336
|
+
logger.debug("Send command--Get transfer area before charging pile")
|
|
337
|
+
return self.send_order_msg_nav(build)
|
|
338
|
+
|
|
339
|
+
def get_regional_data(self, regional_data: RegionData) -> bytes:
|
|
340
|
+
build = MctlNav(
|
|
341
|
+
todev_get_commondata=NavGetCommData(
|
|
342
|
+
pver=1,
|
|
343
|
+
action=regional_data.action,
|
|
344
|
+
type=regional_data.type,
|
|
345
|
+
hash=regional_data.hash,
|
|
346
|
+
total_frame=regional_data.total_frame,
|
|
347
|
+
current_frame=regional_data.current_frame,
|
|
348
|
+
sub_cmd=2,
|
|
349
|
+
)
|
|
350
|
+
)
|
|
351
|
+
logger.debug("Area loading=====================:Response area data")
|
|
352
|
+
return self.send_order_msg_nav(build)
|
|
353
|
+
|
|
354
|
+
def indoor_simulation(self, flag: int) -> bytes:
|
|
355
|
+
build = MctlNav(simulation_cmd=SimulationCmdData(sub_cmd=flag))
|
|
356
|
+
logger.debug(f"Send command--Send indoor simulation command flag={flag}")
|
|
357
|
+
return self.send_order_msg_nav(build)
|
|
358
|
+
|
|
359
|
+
def send_tools_order(self, param_id: int, values: list[int]) -> bytes:
|
|
360
|
+
build = MctlNav(simulation_cmd=SimulationCmdData(sub_cmd=2, param_id=param_id, param_value=values))
|
|
361
|
+
logger.debug(f"Send command--Send tool command id={param_id},values={values}")
|
|
362
|
+
return self.send_order_msg_nav(build)
|
|
363
|
+
|
|
364
|
+
def end_draw_border(self, type: int) -> bytes | None:
|
|
365
|
+
if type == -1:
|
|
366
|
+
return None
|
|
367
|
+
build = MctlNav(todev_get_commondata=NavGetCommData(pver=1, action=1, type=type))
|
|
368
|
+
logger.debug(f"Send command--End drawing boundary, obstacle, channel command type={type}")
|
|
369
|
+
return self.send_order_msg_nav(build)
|
|
370
|
+
|
|
371
|
+
def cancel_current_record(self) -> bytes:
|
|
372
|
+
build = MctlNav(todev_get_commondata=NavGetCommData(pver=1, action=7, sub_cmd=0))
|
|
373
|
+
logger.debug("Send command--Cancel current recording (boundary, obstacle)")
|
|
374
|
+
return self.send_order_msg_nav(build)
|
|
375
|
+
|
|
376
|
+
def delete_map_elements(self, type: int, hash_num: int) -> bytes | None:
|
|
377
|
+
if type == -1:
|
|
378
|
+
return None
|
|
379
|
+
build = MctlNav(todev_get_commondata=NavGetCommData(pver=1, action=6, type=type, hash=hash_num))
|
|
380
|
+
logger.debug(f"Send command--Delete boundary or obstacle or channel command type={type},hash={hash}")
|
|
381
|
+
return self.send_order_msg_nav(build)
|
|
382
|
+
|
|
383
|
+
def delete_charge_point(self) -> bytes:
|
|
384
|
+
logger.debug("Delete charging pile")
|
|
385
|
+
build = MctlNav(todev_get_commondata=NavGetCommData(pver=1, action=6, type=5))
|
|
386
|
+
logger.debug("Send command--Delete charging pile location and reset")
|
|
387
|
+
return self.send_order_msg_nav(build)
|
|
388
|
+
|
|
389
|
+
def confirm_base_station(self) -> bytes:
|
|
390
|
+
logger.debug("Reset base station")
|
|
391
|
+
build = MctlNav(todev_get_commondata=NavGetCommData(pver=1, action=2, type=7))
|
|
392
|
+
logger.debug("Send command--Confirm no modification to base station")
|
|
393
|
+
return self.send_order_msg_nav(build)
|
|
394
|
+
|
|
395
|
+
def delete_all(self) -> bytes:
|
|
396
|
+
build = MctlNav(todev_get_commondata=NavGetCommData(pver=1, action=6, type=6))
|
|
397
|
+
logger.debug("Send command--Clear job data")
|
|
398
|
+
return self.send_order_msg_nav(build)
|
|
399
|
+
|
|
400
|
+
def generate_route_information(self, generate_route_information: GenerateRouteInformation) -> bytes:
|
|
401
|
+
logger.debug(f"Generate route data source:{generate_route_information}")
|
|
402
|
+
|
|
403
|
+
build = NavReqCoverPath(
|
|
404
|
+
pver=1,
|
|
405
|
+
sub_cmd=0,
|
|
406
|
+
zone_hashs=generate_route_information.one_hashs,
|
|
407
|
+
job_mode=int(generate_route_information.job_mode),
|
|
408
|
+
edge_mode=int(generate_route_information.edge_mode),
|
|
409
|
+
knife_height=int(generate_route_information.blade_height),
|
|
410
|
+
speed=float(generate_route_information.speed),
|
|
411
|
+
ultra_wave=int(generate_route_information.ultra_wave),
|
|
412
|
+
channel_width=int(generate_route_information.channel_width),
|
|
413
|
+
channel_mode=int(generate_route_information.channel_mode),
|
|
414
|
+
toward=int(generate_route_information.toward),
|
|
415
|
+
toward_included_angle=int(generate_route_information.toward_included_angle), # luba 2 yuka only
|
|
416
|
+
toward_mode=int(generate_route_information.toward_mode), # luba 2 yuka only
|
|
417
|
+
reserved=generate_route_information.path_order,
|
|
418
|
+
)
|
|
419
|
+
logger.debug(f"{self.get_device_name()}Generate route====={build}")
|
|
420
|
+
logger.debug(f"Send command--Generate route information generateRouteInformation={
|
|
421
|
+
generate_route_information}")
|
|
422
|
+
return self.send_order_msg_nav(MctlNav(bidire_reqconver_path=build))
|
|
423
|
+
|
|
424
|
+
def modify_route_information(self, generate_route_information: GenerateRouteInformation) -> bytes:
|
|
425
|
+
logger.debug(f"Generate route data source: {generate_route_information}")
|
|
426
|
+
build = NavReqCoverPath(
|
|
427
|
+
pver=1,
|
|
428
|
+
sub_cmd=3,
|
|
429
|
+
zone_hashs=generate_route_information.one_hashs,
|
|
430
|
+
job_mode=int(generate_route_information.job_mode),
|
|
431
|
+
edge_mode=int(generate_route_information.edge_mode),
|
|
432
|
+
knife_height=int(generate_route_information.blade_height),
|
|
433
|
+
speed=float(generate_route_information.speed),
|
|
434
|
+
ultra_wave=int(generate_route_information.ultra_wave),
|
|
435
|
+
channel_width=int(generate_route_information.channel_width),
|
|
436
|
+
channel_mode=int(generate_route_information.channel_mode),
|
|
437
|
+
toward=int(generate_route_information.toward),
|
|
438
|
+
reserved=generate_route_information.path_order,
|
|
439
|
+
)
|
|
440
|
+
logger.debug(f"{self.get_device_name()} Generate route ===== {build}")
|
|
441
|
+
logger.debug(f"Send command -- Modify route parameters generate_route_information={
|
|
442
|
+
generate_route_information}")
|
|
443
|
+
return self.send_order_msg_nav(MctlNav(bidire_reqconver_path=build))
|
|
444
|
+
|
|
445
|
+
def end_generate_route_information(self) -> bytes:
|
|
446
|
+
build = NavReqCoverPath(pver=1, sub_cmd=9)
|
|
447
|
+
logger.debug(f"{self.get_device_name()} Generate route ===== {build}")
|
|
448
|
+
build2 = MctlNav(bidire_reqconver_path=build)
|
|
449
|
+
logger.debug("Send command -- End generating route information generate_route_information=")
|
|
450
|
+
return self.send_order_msg_nav(build2)
|
|
451
|
+
|
|
452
|
+
def query_generate_route_information(self) -> bytes:
|
|
453
|
+
build = NavReqCoverPath(pver=1, sub_cmd=2)
|
|
454
|
+
logger.debug(f"{self.get_device_name(
|
|
455
|
+
)} Send command -- Get route configuration information generate_route_information={build}")
|
|
456
|
+
build2 = MctlNav(bidire_reqconver_path=build)
|
|
457
|
+
return self.send_order_msg_nav(build2)
|
|
458
|
+
|
|
459
|
+
def get_line_info(self, current_hash: int) -> bytes:
|
|
460
|
+
logger.debug(f"Sending==========Get route command: {current_hash}")
|
|
461
|
+
build = MctlNav(todev_zigzag_ack=NavUploadZigZagResultAck(pver=1, current_hash=current_hash, sub_cmd=0))
|
|
462
|
+
logger.debug(f"Sending command--Get route data corresponding to hash={current_hash}")
|
|
463
|
+
return self.send_order_msg_nav(build)
|
|
464
|
+
|
|
465
|
+
def get_line_info_list(self, hash_list: list[int], transaction_id: int) -> bytes:
|
|
466
|
+
"""Get route information (mow path) corresponding to the specified hash list based on time.
|
|
467
|
+
e.g transaction_id = int(time.time() * 1000)
|
|
468
|
+
"""
|
|
469
|
+
logger.debug(f"Sending==========Get route command: {hash_list}")
|
|
470
|
+
|
|
471
|
+
build = MctlNav(
|
|
472
|
+
app_request_cover_paths=AppRequestCoverPathsT(
|
|
473
|
+
pver=1, hash_list=hash_list, transaction_id=transaction_id, sub_cmd=0
|
|
474
|
+
)
|
|
475
|
+
)
|
|
476
|
+
logger.debug(f"Sending command--Get route data corresponding to hash={hash_list}")
|
|
477
|
+
return self.send_order_msg_nav(build)
|
|
478
|
+
|
|
479
|
+
def start_job(self) -> bytes:
|
|
480
|
+
logger.debug("Sending==========Start job command")
|
|
481
|
+
build = MctlNav(todev_taskctrl=NavTaskCtrl(type=1, action=1, result=0))
|
|
482
|
+
logger.debug("Sending command--Start job")
|
|
483
|
+
return self.send_order_msg_nav(build)
|
|
484
|
+
|
|
485
|
+
def cancel_return_to_dock(self) -> bytes:
|
|
486
|
+
build = MctlNav(todev_taskctrl=NavTaskCtrl(type=1, action=12, result=0))
|
|
487
|
+
logger.debug("Send command - Cancel return to charge")
|
|
488
|
+
return self.send_order_msg_nav(build)
|
|
489
|
+
|
|
490
|
+
def cancel_job(self) -> bytes:
|
|
491
|
+
build = MctlNav(todev_taskctrl=NavTaskCtrl(type=1, action=4, result=0))
|
|
492
|
+
logger.debug("Send command - End job")
|
|
493
|
+
return self.send_order_msg_nav(build)
|
|
494
|
+
|
|
495
|
+
def return_to_dock(self) -> bytes:
|
|
496
|
+
build = MctlNav(todev_taskctrl=NavTaskCtrl(type=1, action=5, result=0))
|
|
497
|
+
logger.debug("Send command - Return to charge command")
|
|
498
|
+
return self.send_order_msg_nav(build)
|
|
499
|
+
|
|
500
|
+
def pause_execute_task(self) -> bytes:
|
|
501
|
+
build = MctlNav(todev_taskctrl=NavTaskCtrl(type=1, action=2, result=0))
|
|
502
|
+
logger.debug("Send command - Pause command")
|
|
503
|
+
return self.send_order_msg_nav(build)
|
|
504
|
+
|
|
505
|
+
def re_charge_test(self) -> bytes:
|
|
506
|
+
build = MctlNav(todev_taskctrl=NavTaskCtrl(type=1, action=10, result=0))
|
|
507
|
+
logger.debug("Send command - Return to charge test command")
|
|
508
|
+
return self.send_order_msg_nav(build)
|
|
509
|
+
|
|
510
|
+
def fast_aotu_test(self, action: int) -> bytes:
|
|
511
|
+
build = MctlNav(todev_taskctrl=NavTaskCtrl(type=1, action=action, result=0))
|
|
512
|
+
logger.debug("Send command - One-click automation test")
|
|
513
|
+
return self.send_order_msg_nav(build)
|
|
514
|
+
|
|
515
|
+
def resume_execute_task(self) -> bytes:
|
|
516
|
+
build = MctlNav(todev_taskctrl=NavTaskCtrl(type=1, action=3, result=0))
|
|
517
|
+
logger.debug("Send command - Cancel pause command")
|
|
518
|
+
return self.send_order_msg_nav(build)
|
|
519
|
+
|
|
520
|
+
def break_point_continue(self) -> bytes:
|
|
521
|
+
build = MctlNav(todev_taskctrl=NavTaskCtrl(type=1, action=7, result=0))
|
|
522
|
+
logger.debug("Send command - Continue from breakpoint")
|
|
523
|
+
return self.send_order_msg_nav(build)
|
|
524
|
+
|
|
525
|
+
def break_point_anywhere_continue(self) -> bytes:
|
|
526
|
+
build = MctlNav(todev_taskctrl=NavTaskCtrl(type=1, action=9, result=0))
|
|
527
|
+
logger.debug("Send command - Continue from current vehicle position")
|
|
528
|
+
return self.send_order_msg_nav(build)
|
|
529
|
+
|
|
530
|
+
def reset_base_station(self) -> bytes:
|
|
531
|
+
build = MctlNav(todev_taskctrl=NavTaskCtrl(type=3, action=1, result=0))
|
|
532
|
+
logger.debug("Send command - Reset charging pile, base station position")
|
|
533
|
+
return self.send_order_msg_nav(build)
|
|
534
|
+
|
|
535
|
+
def send_svg_data(self, svg_message: SvgMessage) -> bytes:
|
|
536
|
+
"""Send SVG data to the device."""
|
|
537
|
+
build = MctlNav(
|
|
538
|
+
todev_svg_msg=SvgMessageAckT(
|
|
539
|
+
pver=1,
|
|
540
|
+
sub_cmd=svg_message.sub_cmd,
|
|
541
|
+
total_frame=svg_message.total_frame,
|
|
542
|
+
current_frame=svg_message.current_frame,
|
|
543
|
+
data_hash=svg_message.data_hash,
|
|
544
|
+
paternal_hash_a=svg_message.paternal_hash_a,
|
|
545
|
+
result=svg_message.result,
|
|
546
|
+
svg_message=SvgMessageT(
|
|
547
|
+
hide_svg=svg_message.svg_message.hide_svg,
|
|
548
|
+
svg_file_data=svg_message.svg_message.svg_file_data,
|
|
549
|
+
svg_file_name=svg_message.svg_message.svg_file_name,
|
|
550
|
+
data_count=svg_message.svg_message.data_count,
|
|
551
|
+
name_count=svg_message.svg_message.name_count,
|
|
552
|
+
base_height_m=svg_message.svg_message.base_height_m,
|
|
553
|
+
base_width_m=svg_message.svg_message.base_width_m,
|
|
554
|
+
base_width_pix=svg_message.svg_message.base_width_pix,
|
|
555
|
+
base_height_pix=svg_message.svg_message.base_height_pix,
|
|
556
|
+
x_move=svg_message.svg_message.x_move,
|
|
557
|
+
y_move=svg_message.svg_message.y_move,
|
|
558
|
+
scale=svg_message.svg_message.scale,
|
|
559
|
+
rotate=svg_message.svg_message.rotate,
|
|
560
|
+
),
|
|
561
|
+
)
|
|
562
|
+
)
|
|
563
|
+
|
|
564
|
+
return self.send_order_msg_nav(build)
|