管壳码全0判断
This commit is contained in:
@@ -146,10 +146,9 @@ def arr_from_int(num:int):
|
||||
# 提取方案中的范围数据, 先max后min
|
||||
def scheme_get_task_range(j:json):
|
||||
t=bytearray()
|
||||
return_count=j["ReturnCount"]
|
||||
t+=j["TaskID"]
|
||||
t+=j["TaskIndex"]
|
||||
t+=arr_from_int(return_count)
|
||||
t+=arr_from_int(j["TaskID"])
|
||||
t+=arr_from_int(j["TaskIndex"])
|
||||
t+=arr_from_int(j["ReturnCount"])
|
||||
t+=arr_from_int(j["ExecuteErrCode"])
|
||||
index=0
|
||||
for i in j["TestStandard"]:
|
||||
@@ -438,18 +437,32 @@ class protu(QObject):
|
||||
# print("len=",len(d),d.hex(","))
|
||||
# send_file("COM5",0x32,f.name.split('/')[-1],f.read())
|
||||
|
||||
|
||||
|
||||
def int2str(num:int):
|
||||
s=str(num//100)
|
||||
s=s+str(num%100//10)
|
||||
s=s+str(num%10)
|
||||
return s
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
u=protu()
|
||||
# u.init("utcp:7777")
|
||||
# u.send_file(0xee,"file/JQ_JCXB_V54.bin")
|
||||
# u.send_file(0xed,"../Objects/checker_gen1_app_20230602.bin")
|
||||
u.cmd=0x34
|
||||
print(u.encode(bytearray([0x0a,0x00])).hex(' '))
|
||||
# with open("file/EX三码绑定测试2023-07-3.json","rb") as f:
|
||||
u.cmd=0x30
|
||||
u.cmd_no=0x15|(0xaf<<8)
|
||||
print(u.encode(bytearray([0x00])).hex(' '))
|
||||
# with open("file/EX_Coder_Test_2023-07-6.json","rb") as f:
|
||||
# json_obj=json.loads(f.read())
|
||||
# d=scheme_to_byte(json_obj)
|
||||
# print("len=",len(d),d.hex(","))
|
||||
# d+=scheme_to_host(json_obj)
|
||||
|
||||
print(int2str(20))
|
||||
s="{d:03d}".format(d=2)
|
||||
print(s)
|
||||
|
||||
|
||||
# 开始检测
|
||||
|
Reference in New Issue
Block a user