Skip to content

Commit

Permalink
Add BiBoard version V0_2 in Firmware uploader
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonWong08 committed Nov 8, 2023
1 parent b89a808 commit 55577b6
Show file tree
Hide file tree
Showing 20 changed files with 20 additions and 15 deletions.
22 changes: 10 additions & 12 deletions pyUI/FirmwareUploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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 != "":
Expand All @@ -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'])
Expand All @@ -463,16 +463,18 @@ 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
if not self.bFacReset:
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:
Expand All @@ -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()

Expand Down Expand Up @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion pyUI/UI.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 4 additions & 0 deletions pyUI/commonVar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/'
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions pyUI/translate.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
versionNum = '1.1.3'
dateStr = '2023-10-26'
versionNum = '1.1.4'
dateStr = '2023-11-08'

textEN = {
'lan':'English',
Expand Down

0 comments on commit 55577b6

Please sign in to comment.