|
@@ -16,7 +16,7 @@ softwareIconPath = r'D:\PycharmProjects\Scan\ScanUtils\pic\scan.png'
|
|
|
# softwareIconPath = r':pic/scan.png'
|
|
|
|
|
|
folderName = 'material'
|
|
|
-VERSION = '2.2'
|
|
|
+VERSION = '2.4'
|
|
|
|
|
|
# class MySlot(QObject):
|
|
|
# def get(self,msg):
|
|
@@ -68,7 +68,7 @@ class VersionSet(QWidget):
|
|
|
paramDict['起爆电容品牌'] = (('试验品牌', 0), ('AVX', 1), ('Vishay', 2), ('Sunlord', 3), ('永铭', 4), ('丰宾', 5), ('米朗', 6))#3位
|
|
|
|
|
|
paramDict['引火件形式'] = (('无', 0), ('焊接刚性药头', 1), ('贴片刚性药头', 2), ('贴片发热电阻', 3), ('碗状电阻器', 4))#3位
|
|
|
- paramDict['桥丝规格'] = (('16um(7.9~8.6欧)', 0), ('2欧姆', 1), ('8欧姆', 2), ('20um', 3), ('22um', 4), ('25um', 5), ('30um', 6))#5位
|
|
|
+ paramDict['桥丝规格'] = (('16um(7.9~8.6欧)', 0), ('2欧姆', 1), ('8欧姆', 2), ('20um', 3), ('22um', 4), ('25um', 5), ('30um', 6),('试验规格', 7), ('40um', 8))#5位
|
|
|
paramDict['脚线焊接方式'] = (('无孔焊接', 0), ('有孔焊接', 1), ('铭威铆接', 2), ('创德铆接', 3))#4位
|
|
|
paramDict['PCB供应商'] = (('丰达兴', 0), ('闽威', 1), ('镓锐', 2), ('联宇宏', 3))
|
|
|
else:#旧规则
|
|
@@ -346,6 +346,7 @@ class VersionSet(QWidget):
|
|
|
if content == item[0]:
|
|
|
return item[1]
|
|
|
return None
|
|
|
+
|
|
|
def paramValue2Str(self, value, paramList):
|
|
|
for item in paramList:
|
|
|
if value == item[1]:
|
|
@@ -417,14 +418,15 @@ class VersionSet(QWidget):
|
|
|
|
|
|
U64Value |= (lineType & 0x07) << 41 #脚线焊接方式共3位 ,bit41-43
|
|
|
|
|
|
-
|
|
|
-
|
|
|
U64Value |= (((productDate.year()-2020)*12 + (productDate.month()-1)) & 0x7F) << 44 # 发料日期中的年月共7位 ,bit44-50
|
|
|
-
|
|
|
+ # print(bin((((productDate.year()-2020)*12 + (productDate.month()-1)) & 0x7F) << 44))
|
|
|
+ # print(bin(U64Value))
|
|
|
|
|
|
U64Value |= (productDate.day() & 0x1F) << 51 # 发料日期中的日共5位 ,bit51-55
|
|
|
-
|
|
|
+ # print(bin((productDate.day() & 0x1F) << 51))
|
|
|
# print(hex(U64Value))
|
|
|
+ # print("aaaaa")
|
|
|
+ # print(bin(U64Value))
|
|
|
|
|
|
|
|
|
Bytes_0 = U64Value & 0xFF
|
|
@@ -434,10 +436,18 @@ class VersionSet(QWidget):
|
|
|
Bytes_4 = (U64Value >> 32) & 0xFF
|
|
|
Bytes_5 = (U64Value >> 40) & 0xFF
|
|
|
Bytes_6 = (U64Value >> 48) & 0xFF
|
|
|
+ # print(Bytes_0,Bytes_1,Bytes_2)
|
|
|
|
|
|
hexStr = '%02X%02X%02X%02X%02X%02X%02X' % (Bytes_0, Bytes_1, Bytes_2, Bytes_3, Bytes_4, Bytes_5, Bytes_6)
|
|
|
- hexStr += '%02X' % ((~CRC8.getCrc8(bytearray.fromhex(hexStr))) & 0xFF)
|
|
|
+ # # 53861410004043
|
|
|
+ # print(hexStr)
|
|
|
+ # print(bytearray.fromhex(hexStr))
|
|
|
|
|
|
+ # print(bin(CRC8.getCrc8(bytearray.fromhex(hexStr))))
|
|
|
+ hexStr += '%02X' % ((~CRC8.getCrc8(bytearray.fromhex(hexStr))) & 0xFF)
|
|
|
+ # print(hexStr)
|
|
|
+ data = bytearray([0x01]) # 示例数据,转换为字节数组
|
|
|
+ # print((CRC8.getCrc8(data)))
|
|
|
return hexStr
|
|
|
|
|
|
def updateStatus(self, param= None):
|