Skip to content

Commit

Permalink
Merge pull request #71 from JasonWong08/main
Browse files Browse the repository at this point in the history
release the version 1.1.6
  • Loading branch information
borntoleave committed Jan 10, 2024
2 parents e4da94f + 7f0374c commit 9019546
Show file tree
Hide file tree
Showing 19 changed files with 8,457 additions and 8,383 deletions.
137 changes: 97 additions & 40 deletions pyUI/FirmwareUploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def __init__(self,model,lan):
self.win.resizable(False, False)
self.bParaUpload = True
self.bFacReset = False
self.bModPara = False
Grid.rowconfigure(self.win, 0, weight=1)
Grid.columnconfigure(self.win, 0, weight=1)
self.strProduct = StringVar()
Expand All @@ -52,7 +53,6 @@ def __init__(self,model,lan):
self.inv_txt = {v: k for k, v in language.items()}
self.initWidgets()
if self.strProduct.get() == 'Bittle X':
self.strBoardVersion.set(BiBoard_version_list[0])
board_version_list = BiBoard_version_list
else:
board_version_list = NyBoard_version_list + BiBoard_version_list
Expand Down Expand Up @@ -194,6 +194,8 @@ def initWidgets(self):
self.cbBoardVersion.set(self.lastSetting[3])
# set list for Combobox
if self.strProduct.get() == 'Bittle X':
if self.lastSetting[3] in NyBoard_version_list:
self.cbBoardVersion.set(BiBoard_version_list[0])
board_version_list = BiBoard_version_list
else:
board_version_list = NyBoard_version_list + BiBoard_version_list
Expand Down Expand Up @@ -279,6 +281,7 @@ def initWidgets(self):
def uploadeModeOnly(self):
self.bParaUpload = False
self.bFacReset = False
self.bModPara = False
self.autoupload()

def factoryReset(self):
Expand All @@ -289,6 +292,7 @@ def factoryReset(self):
def upgrade(self):
self.bParaUpload = True
self.bFacReset = False
self.bModPara = True
self.autoupload()

def updatePortlist(self):
Expand Down Expand Up @@ -434,8 +438,9 @@ def WriteInstinctPrompts(self, port):
strBoardVersion = self.strBoardVersion.get()

progress = 0
bCount = False
bResetMode = False
retMsg = False
counter = 0
prompStr = ""
while True:
time.sleep(0.01)
Expand All @@ -444,59 +449,111 @@ def WriteInstinctPrompts(self, port):
prompStr = x[2:-1]
logger.debug(f"new line:{x}")
if x != "":
print(x[2:-1])
print(prompStr)
questionMark = "Y/n"
if x.find(questionMark) != -1:
if x.find("joint") != -1:
prompt = promptJointCalib
elif x.find("Instinct") != -1:
prompt = promptInstinct
elif x.find("Calibrate") != -1:
prompt = promptIMU
elif x.find("assurance") != -1: # for BiBoard it need to be modified later
serObj.Send_data(self.encode("n"))
if self.bFacReset and strBoardVersion in BiBoard_version_list: # for BiBoard Factory reset
newBoardMark = "Set up the new board"
if prompStr.find(newBoardMark) != -1:
bResetMode = True

if not bResetMode and (prompStr.find("Ready!") != -1):
time.sleep(1)
serObj.Send_data(self.encode("!"))
continue
if progress > 0 and retMsg == True:
self.strStatus.set(promptList[progress-1]['result'])
self.statusBar.update()
retMsg = messagebox.askyesno(txt('Warning'), prompt['message'])
if retMsg:
self.strStatus.set(prompt['operating'])
self.statusBar.update()
serObj.Send_data(self.encode("Y"))
else:
serObj.Send_data(self.encode("n"))
if progress == len(promptList) - 1:

if bResetMode:
if prompStr.find(questionMark) != -1:
if progress > 0:
self.strStatus.set(promptList[progress-1]['result'])
self.statusBar.update()

if prompStr.find("assurance") != -1: # for BiBoard
serObj.Send_data(self.encode("n"))
elif (prompStr.find("joint") != -1):
prompt = promptJointCalib
serObj.Send_data(self.encode("Y"))
self.strStatus.set(prompt['operating'])
self.statusBar.update()
elif (prompStr.find("Calibrate") != -1):
prompt = promptIMU
serObj.Send_data(self.encode("Y"))
self.strStatus.set(prompt['operating'])
self.statusBar.update()
progress += 1

if prompStr.find("Ready!") != -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:
self.strStatus.set(promptIMU['result'])
self.statusBar.update()
if strBoardVersion in BiBoard_version_list: # for BiBoard it need to be modified later
if prompStr.find(questionMark) != -1:
if self.bModPara: # for NyBoard and BiBoard upgrade firmware
if progress > 0 and retMsg:
self.strStatus.set(promptList[progress-1]['result'])
self.statusBar.update()
if prompStr.find("joint") != -1:
prompt = promptJointCalib
elif prompStr.find("Instinct") != -1:
prompt = promptInstinct
elif prompStr.find("Calibrate") != -1:
prompt = promptIMU
elif prompStr.find("assurance") != -1:
serObj.Send_data(self.encode("n"))
continue
retMsg = messagebox.askyesno(txt('Warning'), prompt['message'])
if retMsg:
self.strStatus.set(prompt['operating'])
self.statusBar.update()
serObj.Send_data(self.encode("Y"))
else:
serObj.Send_data(self.encode("n"))
progress += 1
else: # for BiBoard update mode only
if prompStr.find("joint") != -1:
prompt = promptJointCalib
serObj.Send_data(self.encode("n"))
elif prompStr.find("Instinct") != -1:
prompt = promptInstinct
serObj.Send_data(self.encode("n"))
elif prompStr.find("Calibrate") != -1:
prompt = promptIMU
serObj.Send_data(self.encode("n"))
elif prompStr.find("assurance") != -1:
serObj.Send_data(self.encode("n"))
continue
if prompStr.find("sent to mpu.setXAccelOffset") != -1 or prompStr.find("Ready!") != -1:
if strBoardVersion in NyBoard_version_list:
if retMsg:
self.strStatus.set(promptList[progress - 1]['result'])
self.statusBar.update()
if strSoftwareVersion == '2.0':
continue
else:
break
else:
break
elif x.find("Calibrated:") != -1:
elif prompStr.find("Calibrated:") != -1:
self.strStatus.set(txt('9685 Calibrated'))
self.statusBar.update()
break
else:
if self.bFacReset:
if prompStr.find("Optional: Connect PWM 3") != -1:
counter += 1
if counter == 10:
if self.bFacReset: # for NyBoard Factory reset
if strBoardVersion in NyBoard_version_list:
if prompStr.find("Optional: Connect PWM 3") != -1 and (not bCount):
bCount = True
start = time.time()
logger.info(f"start timer")
if bCount and (time.time() - start > 5):
break
else: # for NyBoard upgrade firmware
if (strBoardVersion in NyBoard_version_list) and (prompStr.find("Optional: Connect PWM 3") != -1):
break

serObj.Close_Engine()
logger.info("close the serial port.")
self.force_focus()

if not self.bFacReset and strBoardVersion in NyBoard_version_list:
messagebox.showinfo(title=None, message=txt('parameterFinish'))


def saveConfigToFile(self,filename):
if len(self.configuration) == 6:
Expand Down
8 changes: 4 additions & 4 deletions pyUI/commonVar.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +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/'
# elif platform.system() == "Linux": # for Linux OS already installed the desktop app
# 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.
82 changes: 41 additions & 41 deletions pyUI/release/2.0/Bittle/NyBoard_V1/OpenCatCamera.ino.hex
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
:100280006E697469616C697A652074686520636160
:100290006D65726121004D5520696E697469616CEC
:1002A000697A656420617420307835300052656168
:1002B000647921004E5F3233313230360042697446
:1002B000647921004E5F3233313232380042697442
:1002C000746C65000A2A205374617274202A004CF1
:1002D0006F7720706F7765723A00540073637268AD
:1002E00000636B0070656500707500686900737469
Expand All @@ -52,7 +52,7 @@
:10033000007461626C652074656E6E6973004F565F
:10034000462120576F6E2774207361766521006106
:10035000626F72746564007361766564004E5F322B
:10036000333132303600426974746C650000761D9A
:10036000333132323800426974746C650000761D96
:10037000363011241FBECFEFD8E0DEBFCDBF12E074
:10038000A0E0B1E0ECE4F1E702C005900D92AC30E2
:10039000B107D9F727E0ACE0B2E001C01D92AB3362
Expand Down Expand Up @@ -1127,9 +1127,9 @@
:1046600080913A03803751F080911A01811106C080
:1046700081E080931A0180E70E949F0C10913A0319
:10468000E1ECE10FE53308F029C70E2E000CFF0B1B
:10469000E45BFC4D0C948E37662A6E2A6E2A5E2DE2
:1046A0006E2A6E2A6E2A6E2A252B6E2AC52C6E2A39
:1046B000BF2D4E2DC52C6E2A6E2A6E2A6E2A6E2AAA
:10469000E45BFC4D0C948E37662A6E2A6E2A702DD0
:1046A0006E2A6E2A6E2A6E2A252B6E2AD72C6E2A27
:1046B000BF2D602DD72C6E2A6E2A6E2A6E2A6E2A86
:1046C0006E2AA92D6E2A6E2A6E2A6E2A6E2A6E2AEC
:1046D0006E2A6E2A6E2A6E2A6E2A6E2AEA2B012C08
:1046E000012C4C2E6E2A6E2A252B6E2A012C3E2B75
Expand Down Expand Up @@ -1426,40 +1426,40 @@
:10591000E08291E090933B038D3609F080C340E034
:1059200050E060E070E4C5010E94A91178C3F12C39
:10593000E12C10E000E0912C812CD1CF91E09093EC
:105940001C03EACF823609F06AC3E114F10409F4BA
:1059500066C388EE93E0B7010E947A37072E000CE9
:10596000880B990B0E94A9323B014C01B801110F21
:10597000880B990B0E94A932EE24E39410E000E01A
:10598000A40193010E949B174AC380912D0390911B
:105990002E0302970CF43DCF10921C0390901B0134
:1059A000AFE1EA2EA1E0FA2EFE0131965F01BCEDD7
:1059B000CB2EB2E0DB2E8F01D7016D917D917D0161
:1059C000072E000C880B990B0E94A93220E030E0D2
:1059D000A901992029F0F60120813181428153816A
:1059E0000E9476340E945A35D5016D937D935D01F6
:1059F000B4E0CB0ED11CEFE3EE16E1E0FE06E1F6DB
:105A0000FEE3EF2EF3E0FF2EDD24D39420912D034F
:105A100030912E03C7018E5393408217930764F58C
:105A2000D7014C914031B0F411962C91022E000C0C
:105A3000330B842F880F990BF801E80FF91F31837E
:105A400020834430B4F48C529D4FFC013183208379
:105A5000D0923B0380913A038D3439F440E050E01A
:105A600060E070E4C8010E94A911F2E0EF0EF11CA1
:105A7000CDCFD0921C03EECF80911C03811105C0C5
:105A800080912F038B3609F429CD40E050E060E887
:105A900070E4C8010E94A911C801DCC2609119011B
:105AA00070E090E080E00E94A7329B01AC0100E032
:105AB00061E08EE393E00E94211310CDC0902D038E
:105AC000D0902E0322E0C216D1049CF1D594C79445
:105AD000F12C8F2D90E08C159D050CF0C4C2880F21
:105AE000991F8C01025C1C4FD80111966C91062EF7
:105AF000000C770B88EE93E00E947A37072E000C9B
:105B0000880B990B0E94A9324B015C01F80160815E
:105B1000062E000C770B880B990B0E94A932EE24FD
:105B2000E39410E000E0A50194010E949B17F39418
:105B3000D0CF8AE191E00E94640F2AE131E03A83FC
:105B4000298361E0811160E0CE0101960E94240F5B
:105B5000C5CC86E191E00E9464100E94680A0E9410
:105940001C03EACF823609F06AC3892881F48AE110
:1059500091E00E94640F2AE131E03AA329A361E0BB
:10596000811160E0CE0181960E94240F58C3E1149A
:10597000F10409F454C388EE93E0B7010E947A372A
:10598000072E000C880B990B0E94A9323B014C0199
:10599000B801110F880B990B0E94A932EE24E394F1
:1059A00010E000E0A40193010E949B1738C380918E
:1059B0002D0390912E0302970CF42BCF10921C0311
:1059C00090901B01AFE1EA2EA1E0FA2EFE01319684
:1059D0005F01BCEDCB2EB2E0DB2E8F01D7016D91C4
:1059E0007D917D01072E000C880B990B0E94A93236
:1059F00020E030E0A901992029F0F60120813181D1
:105A0000428153810E9476340E945A35D5016D93AC
:105A10007D935D01B4E0CB0ED11CEFE3EE16E1E027
:105A2000FE06E1F6FEE3EF2EF3E0FF2EDD24D39435
:105A300020912D0330912E03C7018E53934082177E
:105A4000930764F5D7014C914031B0F411962C9135
:105A5000022E000C330B842F880F990BF801E80FEE
:105A6000F91F318320834430B4F48C529D4FFC01E4
:105A700031832083D0923B0380913A038D3439F4F3
:105A800040E050E060E070E4C8010E94A911F2E03B
:105A9000EF0EF11CCDCFD0921C03EECF80911C03F2
:105AA000811105C080912F038B3609F417CD40E09A
:105AB00050E060E870E4C8010E94A911C801CAC2A0
:105AC0006091190170E090E080E00E94A7329B0194
:105AD000AC0100E061E08EE393E00E942113FECC74
:105AE000F12C2F2D30E080912D0390912E0397FD06
:105AF000019695958795281739070CF0B2C2220FA9
:105B0000331F8901025C1C4FD80111966C91062E3F
:105B1000000C770B88EE93E00E947A37072E000C7A
:105B2000880B990B0E94A9324B015C01F80160813E
:105B3000062E000C770B880B990B0E94A932EE24DD
:105B4000E39410E000E0A50194010E949B17F394F8
:105B5000C8CF86E191E00E9464100E94680A0E940A
:105B6000C31480913A030E949F0C8BE680933A0302
:105B700063E072E08EE393E00E948438AFCC86E16C
:105B800091E00E9464107C0180913E038093160591
Expand All @@ -1478,7 +1478,7 @@
:105C50000E94880866E070E080E090E00E94DA042C
:105C60007501BACF6EE373E084E991E00E947B385E
:105C7000892B69F06EE373E089EC92E00E947B3837
:105C8000892B29F48091160582300CF0EAC18EE34D
:105C8000892B29F48091160582300CF0EDC18EE34A
:105C900093E00E94D81422CC67E072E08EE393E098
:105CA0000E9484388EE393E00E94D8140E94190A5F
:105CB00010921B0110923B0387E60E949F0C0ECCB2
Expand Down Expand Up @@ -1540,7 +1540,7 @@
:1060300055CA80911C03811105C080912F038B36B6
:1060400009F44CCA40E050E060E870E4C5010E94E9
:10605000A911C5010E946C0241CA109131030C9430
:10606000EC22812F3FCA80913A0340CA80E197E039
:10606000EC2280913A0342CA812F3CCA80E197E03A
:106070000E94E30D8AE097E00E94E30D8DE297E035
:106080000C94E30D0F931F93CF93DF938230910510
:1060900010F482E090E0E0913907F0913A0730E0A7
Expand Down
Loading

0 comments on commit 9019546

Please sign in to comment.