diff --git a/pyUI/FirmwareUploader.py b/pyUI/FirmwareUploader.py index ee9cc56c..c312d51a 100644 --- a/pyUI/FirmwareUploader.py +++ b/pyUI/FirmwareUploader.py @@ -17,7 +17,7 @@ regularW = 14 language = languageList['English'] NyBoard_version_list = ['NyBoard_V1_0', 'NyBoard_V1_1', 'NyBoard_V1_2'] -BiBoard_version_list = ['BiBoard_V0'] +BiBoard_version_list = ['BiBoard_V0_1', 'BiBoard_V0_2'] def txt(key): return language.get(key, textEN[key]) @@ -408,7 +408,7 @@ def encode(self, in_str, encoding='utf-8'): return in_str.encode(encoding) def WriteInstinctPrompts(self, port): - ser = Communication(port, 115200, 0.5) + serObj = Communication(port, 115200, 0.5) logger.info(f"Connect to usb serial port: {port}.") strSoftwareVersion = self.strSoftwareVersion.get() promptJointCalib = { @@ -439,8 +439,8 @@ def WriteInstinctPrompts(self, port): prompStr = "" while True: time.sleep(0.01) - if ser.main_engine.in_waiting > 0: - x = str(ser.main_engine.readline()) + if serObj.main_engine.in_waiting > 0: + x = str(serObj.main_engine.readline()) prompStr = x[2:-1] logger.debug(f"new line:{x}") if x != "": @@ -454,7 +454,7 @@ def WriteInstinctPrompts(self, port): elif x.find("Calibrate") != -1: prompt = promptIMU elif x.find("assurance") != -1: # for BiBoard it need to be modified later - ser.Send_data(self.encode("n")) + serObj.Send_data(self.encode("n")) continue if progress > 0 and retMsg == True: self.strStatus.set(promptList[progress-1]['result']) @@ -463,9 +463,9 @@ def WriteInstinctPrompts(self, port): if retMsg: self.strStatus.set(prompt['operating']) self.statusBar.update() - ser.Send_data(self.encode("Y")) + serObj.Send_data(self.encode("Y")) else: - ser.Send_data(self.encode("n")) + serObj.Send_data(self.encode("n")) if progress == len(promptList) - 1: break progress += 1 @@ -473,6 +473,8 @@ def WriteInstinctPrompts(self, port): if x.find("sent to mpu.setXAccelOffset") != -1 or x.find("Ready!") != -1: self.strStatus.set(promptIMU['result']) self.statusBar.update() + if strBoardVersion in NyBoard_version_list: + messagebox.showinfo(title=None, message=txt('parameterFinish')) break else: if x.find("sent to mpu.setXAccelOffset") != -1 or x.find("Ready!") != -1: @@ -491,7 +493,7 @@ def WriteInstinctPrompts(self, port): if counter == 10: break - ser.Close_Engine() + serObj.Close_Engine() logger.info("close the serial port.") self.force_focus() @@ -603,10 +605,6 @@ def autoupload(self): if s == 0: self.WriteInstinctPrompts(port) - if not self.bFacReset: - messagebox.showinfo(title=None, message=txt('parameterFinish')) - else: - pass else: pass elif strBoardVersion in BiBoard_version_list: diff --git a/pyUI/UI.py b/pyUI/UI.py index f6a783fa..de839793 100755 --- a/pyUI/UI.py +++ b/pyUI/UI.py @@ -35,7 +35,10 @@ def __init__(self): model = lines[1] self.defaultPath = lines[2] self.defaultSwVer = lines[3] - self.defaultBdVer = lines[4] + if lines[4] == "BiBoard_V0": + self.defaultBdVer = "BiBoard_V0_1" + else: + self.defaultBdVer = lines[4] self.defaultMode = lines[5] if len(lines) >= 8: self.defaultCreator = lines[6] diff --git a/pyUI/commonVar.py b/pyUI/commonVar.py index 75fb309d..af8c5621 100644 --- a/pyUI/commonVar.py +++ b/pyUI/commonVar.py @@ -5,6 +5,10 @@ sys.path.append('..\\serialMaster\\') resourcePath = '.\\resources\\' releasePath = '.\\release\\' +elif platform.system() == "Linux": # for Linux + sys.path.append('/usr/share/petoi-opencat/serialMaster/') + resourcePath = '/usr/share/petoi-opencat/resources/' + releasePath = '/usr/share/petoi-opencat/release/' else: sys.path.append('../serialMaster/') resourcePath = './resources/' diff --git a/pyUI/release/2.0/Bittle/BiBoard_V0_1/OpenCatEsp32Standard.ino.bin b/pyUI/release/2.0/Bittle/BiBoard_V0_1/OpenCatEsp32Standard.ino.bin new file mode 100644 index 00000000..a62e9dd7 Binary files /dev/null and b/pyUI/release/2.0/Bittle/BiBoard_V0_1/OpenCatEsp32Standard.ino.bin differ diff --git a/pyUI/release/2.0/Bittle/BiBoard_V0/OpenCatEsp32Standard.ino.bootloader.bin b/pyUI/release/2.0/Bittle/BiBoard_V0_1/OpenCatEsp32Standard.ino.bootloader.bin similarity index 100% rename from pyUI/release/2.0/Bittle/BiBoard_V0/OpenCatEsp32Standard.ino.bootloader.bin rename to pyUI/release/2.0/Bittle/BiBoard_V0_1/OpenCatEsp32Standard.ino.bootloader.bin diff --git a/pyUI/release/2.0/Bittle/BiBoard_V0/OpenCatEsp32Standard.ino.partitions.bin b/pyUI/release/2.0/Bittle/BiBoard_V0_1/OpenCatEsp32Standard.ino.partitions.bin similarity index 100% rename from pyUI/release/2.0/Bittle/BiBoard_V0/OpenCatEsp32Standard.ino.partitions.bin rename to pyUI/release/2.0/Bittle/BiBoard_V0_1/OpenCatEsp32Standard.ino.partitions.bin diff --git a/pyUI/release/2.0/Bittle/BiBoard_V0/boot_app0.bin b/pyUI/release/2.0/Bittle/BiBoard_V0_1/boot_app0.bin similarity index 100% rename from pyUI/release/2.0/Bittle/BiBoard_V0/boot_app0.bin rename to pyUI/release/2.0/Bittle/BiBoard_V0_1/boot_app0.bin diff --git a/pyUI/release/2.0/Bittle/BiBoard_V0/OpenCatEsp32Standard.ino.bin b/pyUI/release/2.0/Bittle/BiBoard_V0_2/OpenCatEsp32Standard.ino.bin similarity index 52% rename from pyUI/release/2.0/Bittle/BiBoard_V0/OpenCatEsp32Standard.ino.bin rename to pyUI/release/2.0/Bittle/BiBoard_V0_2/OpenCatEsp32Standard.ino.bin index 96ae02a2..424355bf 100644 Binary files a/pyUI/release/2.0/Bittle/BiBoard_V0/OpenCatEsp32Standard.ino.bin and b/pyUI/release/2.0/Bittle/BiBoard_V0_2/OpenCatEsp32Standard.ino.bin differ diff --git a/pyUI/release/2.0/Nybble/BiBoard_V0/OpenCatEsp32Standard.ino.bootloader.bin b/pyUI/release/2.0/Bittle/BiBoard_V0_2/OpenCatEsp32Standard.ino.bootloader.bin similarity index 100% rename from pyUI/release/2.0/Nybble/BiBoard_V0/OpenCatEsp32Standard.ino.bootloader.bin rename to pyUI/release/2.0/Bittle/BiBoard_V0_2/OpenCatEsp32Standard.ino.bootloader.bin diff --git a/pyUI/release/2.0/Nybble/BiBoard_V0/OpenCatEsp32Standard.ino.partitions.bin b/pyUI/release/2.0/Bittle/BiBoard_V0_2/OpenCatEsp32Standard.ino.partitions.bin similarity index 100% rename from pyUI/release/2.0/Nybble/BiBoard_V0/OpenCatEsp32Standard.ino.partitions.bin rename to pyUI/release/2.0/Bittle/BiBoard_V0_2/OpenCatEsp32Standard.ino.partitions.bin diff --git a/pyUI/release/2.0/Nybble/BiBoard_V0/boot_app0.bin b/pyUI/release/2.0/Bittle/BiBoard_V0_2/boot_app0.bin similarity index 100% rename from pyUI/release/2.0/Nybble/BiBoard_V0/boot_app0.bin rename to pyUI/release/2.0/Bittle/BiBoard_V0_2/boot_app0.bin diff --git a/pyUI/release/2.0/Nybble/BiBoard_V0/OpenCatEsp32Standard.ino.bin b/pyUI/release/2.0/Nybble/BiBoard_V0_1/OpenCatEsp32Standard.ino.bin similarity index 52% rename from pyUI/release/2.0/Nybble/BiBoard_V0/OpenCatEsp32Standard.ino.bin rename to pyUI/release/2.0/Nybble/BiBoard_V0_1/OpenCatEsp32Standard.ino.bin index babdc01a..41d309ce 100644 Binary files a/pyUI/release/2.0/Nybble/BiBoard_V0/OpenCatEsp32Standard.ino.bin and b/pyUI/release/2.0/Nybble/BiBoard_V0_1/OpenCatEsp32Standard.ino.bin differ diff --git a/pyUI/release/2.0/Nybble/BiBoard_V0_1/OpenCatEsp32Standard.ino.bootloader.bin b/pyUI/release/2.0/Nybble/BiBoard_V0_1/OpenCatEsp32Standard.ino.bootloader.bin new file mode 100644 index 00000000..03dbcf35 Binary files /dev/null and b/pyUI/release/2.0/Nybble/BiBoard_V0_1/OpenCatEsp32Standard.ino.bootloader.bin differ diff --git a/pyUI/release/2.0/Nybble/BiBoard_V0_1/OpenCatEsp32Standard.ino.partitions.bin b/pyUI/release/2.0/Nybble/BiBoard_V0_1/OpenCatEsp32Standard.ino.partitions.bin new file mode 100644 index 00000000..e6075803 Binary files /dev/null and b/pyUI/release/2.0/Nybble/BiBoard_V0_1/OpenCatEsp32Standard.ino.partitions.bin differ diff --git a/pyUI/release/2.0/Nybble/BiBoard_V0_1/boot_app0.bin b/pyUI/release/2.0/Nybble/BiBoard_V0_1/boot_app0.bin new file mode 100644 index 00000000..13562cab Binary files /dev/null and b/pyUI/release/2.0/Nybble/BiBoard_V0_1/boot_app0.bin differ diff --git a/pyUI/release/2.0/Nybble/BiBoard_V0_2/OpenCatEsp32Standard.ino.bin b/pyUI/release/2.0/Nybble/BiBoard_V0_2/OpenCatEsp32Standard.ino.bin new file mode 100644 index 00000000..402422e1 Binary files /dev/null and b/pyUI/release/2.0/Nybble/BiBoard_V0_2/OpenCatEsp32Standard.ino.bin differ diff --git a/pyUI/release/2.0/Nybble/BiBoard_V0_2/OpenCatEsp32Standard.ino.bootloader.bin b/pyUI/release/2.0/Nybble/BiBoard_V0_2/OpenCatEsp32Standard.ino.bootloader.bin new file mode 100644 index 00000000..03dbcf35 Binary files /dev/null and b/pyUI/release/2.0/Nybble/BiBoard_V0_2/OpenCatEsp32Standard.ino.bootloader.bin differ diff --git a/pyUI/release/2.0/Nybble/BiBoard_V0_2/OpenCatEsp32Standard.ino.partitions.bin b/pyUI/release/2.0/Nybble/BiBoard_V0_2/OpenCatEsp32Standard.ino.partitions.bin new file mode 100644 index 00000000..e6075803 Binary files /dev/null and b/pyUI/release/2.0/Nybble/BiBoard_V0_2/OpenCatEsp32Standard.ino.partitions.bin differ diff --git a/pyUI/release/2.0/Nybble/BiBoard_V0_2/boot_app0.bin b/pyUI/release/2.0/Nybble/BiBoard_V0_2/boot_app0.bin new file mode 100644 index 00000000..13562cab Binary files /dev/null and b/pyUI/release/2.0/Nybble/BiBoard_V0_2/boot_app0.bin differ diff --git a/pyUI/translate.py b/pyUI/translate.py index d3f43daa..45fa3ee7 100644 --- a/pyUI/translate.py +++ b/pyUI/translate.py @@ -1,5 +1,5 @@ -versionNum = '1.1.3' -dateStr = '2023-10-26' +versionNum = '1.1.4' +dateStr = '2023-11-08' textEN = { 'lan':'English',