|
|
@@ -182,6 +182,45 @@ class RemoteControlV2(BaseClass):
|
|
|
self.windows.playsound.tips_type = tip
|
|
|
self.windows.playsound.start()
|
|
|
|
|
|
+ def handlerAction(self, button_value):
|
|
|
+ '''处理拍照动作按键[左 右]'''
|
|
|
+ control_program = "执行左脚程序" if button_value == 1 else "执行右脚程序"
|
|
|
+ if self.goods_art_no == None or self.goods_art_no =="":
|
|
|
+ input_data = {
|
|
|
+ "data": {
|
|
|
+ "action": control_program,
|
|
|
+ "goods_art_no": "",
|
|
|
+ },
|
|
|
+ "type": "run_mcu",
|
|
|
+ }
|
|
|
+ self.msg_type = "blue_tooth_scan"
|
|
|
+ self.sendSocketMessage(
|
|
|
+ code=0,
|
|
|
+ msg=f"准备执行[{control_program}]",
|
|
|
+ data=input_data,
|
|
|
+ device_status=2,
|
|
|
+ )
|
|
|
+ self.msg_type = "blue_tooth"
|
|
|
+ return
|
|
|
+ input_data = {
|
|
|
+ "data": {
|
|
|
+ "action": control_program,
|
|
|
+ "goods_art_no": self.goods_art_no,
|
|
|
+ },
|
|
|
+ "type": "run_mcu",
|
|
|
+ }
|
|
|
+ self.msg_type = "blue_tooth_scan"
|
|
|
+ self.sendSocketMessage(
|
|
|
+ code=0,
|
|
|
+ msg=f"准备执行[{control_program}]",
|
|
|
+ data=input_data,
|
|
|
+ device_status=2,
|
|
|
+ )
|
|
|
+ self.goods_art_no = None
|
|
|
+ self.msg_type = "blue_tooth"
|
|
|
+ def handlerTakePhoto(self):
|
|
|
+ """处理单独拍照"""
|
|
|
+ pass
|
|
|
def analysis_received_data(self):
|
|
|
if not self.connect_state:
|
|
|
return
|
|
|
@@ -222,29 +261,11 @@ class RemoteControlV2(BaseClass):
|
|
|
if button_value in [1,2]:
|
|
|
# 扫描货号
|
|
|
print("收到货号信息", self.goods_art_no)
|
|
|
- if self.goods_art_no == None or self.goods_art_no =="":
|
|
|
- self.sendSocketMessage(
|
|
|
- code=1, msg="货号信息不能为空", data=None, device_status=-1
|
|
|
- )
|
|
|
- return
|
|
|
- control_program = (
|
|
|
- "执行左脚程序" if button_value == 1 else "执行右脚程序"
|
|
|
- )
|
|
|
- input_data = {
|
|
|
- "data": {
|
|
|
- "action": control_program,
|
|
|
- "goods_art_no": self.goods_art_no,
|
|
|
- },
|
|
|
- "type": "run_mcu",
|
|
|
- }
|
|
|
- self.msg_type = "blue_tooth_scan"
|
|
|
- self.sendSocketMessage(
|
|
|
- code=0,
|
|
|
- msg=f"准备执行[{control_program}]",
|
|
|
- data=input_data,
|
|
|
- device_status=2,
|
|
|
- )
|
|
|
- self.msg_type = "blue_tooth"
|
|
|
+ self.handlerAction(button_value)
|
|
|
+ if button_value in [3]:
|
|
|
+ # 处理单拍
|
|
|
+ print("收到货号信息", self.goods_art_no)
|
|
|
+ self.handlerTakePhoto()
|
|
|
self.sendSocketMessage(code=0, msg="", data=message, device_status=2)
|
|
|
if settings.IS_DEBUG:
|
|
|
print("收到按键", button_value)
|