优化代码
This commit is contained in:
@@ -49,10 +49,18 @@ class Processor:
|
||||
|
||||
# 根据指令类型,分发到不同的业务处理方法
|
||||
if 'raw_485_command' in instruction:
|
||||
self._process_exec_command(instruction['raw_485_command'])
|
||||
cmd = instruction['raw_485_command']
|
||||
if cmd:
|
||||
self._process_exec_command(cmd)
|
||||
else:
|
||||
log("警告:'raw_485_command' 指令内容为空。")
|
||||
|
||||
elif 'batch_collect_command' in instruction:
|
||||
self._process_collect_command(instruction['batch_collect_command'])
|
||||
cmd = instruction['batch_collect_command']
|
||||
if cmd:
|
||||
self._process_collect_command(cmd)
|
||||
else:
|
||||
log("警告:'batch_collect_command' 指令内容为空。")
|
||||
|
||||
else:
|
||||
log(f"警告:收到未知或不适用于此设备的指令类型: {instruction}")
|
||||
|
||||
Reference in New Issue
Block a user