fix bugs and change end sign
This commit is contained in:
parent
4f85e5b1f2
commit
736a2a2506
|
@ -124,10 +124,10 @@ class App(ctk.CTk):
|
||||||
slider.configure(button_color="grey")
|
slider.configure(button_color="grey")
|
||||||
slider.configure(state="disabled")
|
slider.configure(state="disabled")
|
||||||
else:
|
else:
|
||||||
self.gain_values[i] = slider.get()
|
|
||||||
|
|
||||||
value.set(f"{self.gain_values_store[i]:.2f}")
|
value.set(f"{self.gain_values_store[i]:.2f}")
|
||||||
slider.set(self.gain_values_store[i])
|
slider.set(self.gain_values_store[i])
|
||||||
|
self.gain_values[i] = slider.get()
|
||||||
|
|
||||||
slider.configure(button_color="#1f538d")
|
slider.configure(button_color="#1f538d")
|
||||||
slider.configure(state="normal")
|
slider.configure(state="normal")
|
||||||
return None
|
return None
|
||||||
|
@ -351,7 +351,8 @@ class App(ctk.CTk):
|
||||||
bytes = list(map(lambda x: ord(x), list(switchSign(i))))
|
bytes = list(map(lambda x: ord(x), list(switchSign(i))))
|
||||||
bytes.append(int(self.gain_values[i]))
|
bytes.append(int(self.gain_values[i]))
|
||||||
bytes.append(int(self.gain_values[i] % 1 * 256))
|
bytes.append(int(self.gain_values[i] % 1 * 256))
|
||||||
bytes.append(0)
|
bytes.append(ord('e'))
|
||||||
|
bytes.append(ord('d'))
|
||||||
print(f"Send:{bytes} \t Hex:0x" + f"{hex(int( self.gain_values[i] * 256 )).replace('0x', '')}".zfill(4))
|
print(f"Send:{bytes} \t Hex:0x" + f"{hex(int( self.gain_values[i] * 256 )).replace('0x', '')}".zfill(4))
|
||||||
self.serial.write(bytes)
|
self.serial.write(bytes)
|
||||||
else:
|
else:
|
||||||
|
@ -360,7 +361,7 @@ class App(ctk.CTk):
|
||||||
|
|
||||||
def setvideo(self, video: int) -> None:
|
def setvideo(self, video: int) -> None:
|
||||||
try:
|
try:
|
||||||
is_open = self.serial.is_open()
|
is_open = self.serial.is_open
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
messagebox.showError("Please Connect to Serial")
|
messagebox.showError("Please Connect to Serial")
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue