- May 3, 2007
- 18,069
- Pool Size
- 20000
- Surface
- Plaster
- Chlorine
- Salt Water Generator
- SWG Type
- Hayward Aqua Rite (T-15)
Has anyone had success running through the settings menu to change any values?
I just tried it and it does not seem to work at all and crashes in the code conversion with even a different byte (\xb3).
I just remembered that for the apps that I initially developed, I had to write a separate piece of code to convert the bytes into a string. The reason is that they add 128 to the byte value when the text is supposed to blink in the display which is not a standard conversion. I convert the blinks into [Text] to signify the current editing text. There are also other characters than need to be filtered out and changed.
Here is the code converted to python and I tested it out as well and seems to work although I have not gone through all of the menus either. I also updated core.py in github. Using switches for the menu buttons is less than ideal as well.
I just tried it and it does not seem to work at all and crashes in the code conversion with even a different byte (\xb3).
I just remembered that for the apps that I initially developed, I had to write a separate piece of code to convert the bytes into a string. The reason is that they add 128 to the byte value when the text is supposed to blink in the display which is not a standard conversion. I convert the blinks into [Text] to signify the current editing text. There are also other characters than need to be filtered out and changed.
Here is the code converted to python and I tested it out as well and seems to work although I have not gone through all of the menus either. I also updated core.py in github. Using switches for the menu buttons is less than ideal as well.
Code:
import string
def Byte2string(self, frame):
tStr = ""
bStr = ""
slen = len(frame)
isplt = slen // 2
for i in range(0, slen-1):
if frame[i] == 0:
break
cc = chr(frame[i] - 128) if frame[i] >= 128 else chr(frame[i])
if i < isplt:
tStr += cc
else:
if frame[i] != 186 and (i == 0 or frame[i-1] != 186):
if frame[i] >= 128 and (i == 0 or frame[i-1] < 128):
bStr += "["
elif frame[i] < 128 and (i == 0 or frame[i-1] >= 128):
bStr += "]"
bStr += cc
if "[" in bStr and "]" not in bStr:
bStr += "]"
result = (tStr.strip() + "\n" + bStr.strip())
return result.replace(" ", " ").replace(" ", " ").replace("_", "°").replace(" :", ":").replace("[ ", "[").replace(" ]", "]").strip()