|
|
@@ -9,8 +9,6 @@ from mcu.capture.smart_shooter_class import SmartShooter
|
|
|
from models import RecordUpdate
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
# socket消息发送逻辑处理方法
|
|
|
async def handlerSend(
|
|
|
manager: ConnectionManager,
|
|
|
@@ -27,7 +25,6 @@ async def handlerSend(
|
|
|
msg = receiveData.get("msg")
|
|
|
data = receiveData.get("data")
|
|
|
|
|
|
-
|
|
|
match jsonType:
|
|
|
case "ping":
|
|
|
"""发送心跳"""
|
|
|
@@ -127,7 +124,7 @@ async def handlerSend(
|
|
|
data = manager.jsonMessage(code=1, msg="当前没有可用配置")
|
|
|
await manager.send_personal_message(data, websocket, msg_type=msg_type)
|
|
|
return
|
|
|
- action_list = [device.model_dump() for device in all_devices]
|
|
|
+ action_list = [dict(device.__dict__) for device in all_devices]
|
|
|
print("handl send smart_shooter", smart_shooter)
|
|
|
device_ctrl = DeviceControl(
|
|
|
websocket_manager=manager, smart_shooter=smart_shooter
|
|
|
@@ -176,12 +173,13 @@ async def handlerSend(
|
|
|
crud = CRUD(DeviceConfig)
|
|
|
condtions = {"id": action_id}
|
|
|
device_action = crud.read(session, conditions=condtions)
|
|
|
+ result_dict = dict(device_action.__dict__)
|
|
|
+ print("device_action打印输出====>>>", result_dict)
|
|
|
if device_action == None:
|
|
|
# 判断是否有可用配置
|
|
|
data = manager.jsonMessage(code=1, msg="当前没有可用配置")
|
|
|
await manager.send_personal_message(data, websocket, msg_type=msg_type)
|
|
|
return
|
|
|
- print("device_action", device_action)
|
|
|
# 清除图片记录,执行重拍
|
|
|
reset_data = {"image_path": None}
|
|
|
photoRecord.update(session, record_id, **reset_data)
|
|
|
@@ -190,7 +188,7 @@ async def handlerSend(
|
|
|
)
|
|
|
loop.create_task(
|
|
|
device_ctrl.run_mcu_config_single(
|
|
|
- device_action.model_dump(),
|
|
|
+ result_dict,
|
|
|
goods_art_no,
|
|
|
msg_type=msg_type,
|
|
|
image_index=image_index,
|