[modify] textbox color, nagative value

This commit is contained in:
gitea 2024-05-31 18:33:36 +08:00
parent 14c72fe080
commit cc1463b166
2 changed files with 3 additions and 1 deletions

View File

@ -215,6 +215,7 @@ class App(customtkinter.CTk):
def write2textbox(self, text, wait=0, exitcode=0): def write2textbox(self, text, wait=0, exitcode=0):
if wait != 0: if wait != 0:
self.textbox.configure(text_color='blue')
self.textbox.insert(index='end', text=text) self.textbox.insert(index='end', text=text)
self.textbox.update() self.textbox.update()
self.textbox.see('end') self.textbox.see('end')
@ -225,6 +226,7 @@ class App(customtkinter.CTk):
self.textbox.see('end') self.textbox.see('end')
raise Exception(f"Error code: {exitcode}") raise Exception(f"Error code: {exitcode}")
else: else:
self.textbox.configure(text_color='blue')
self.textbox.insert(index='end', text=text + '\n') self.textbox.insert(index='end', text=text + '\n')
self.textbox.update() self.textbox.update()
self.textbox.see('end') self.textbox.see('end')

View File

@ -226,7 +226,7 @@ def find_row_start(data_file, df, conditions, av, rr, axis, vel, w2t, rpm):
threshold, step = get_threshold_step(data_file, axis) threshold, step = get_threshold_step(data_file, axis)
while row_start > step+1: while row_start > step+1:
speed = df.iloc[row_start, vel-1] * rpm speed = abs(df.iloc[row_start, vel-1] * rpm)
if int(speed) < 1: if int(speed) < 1:
row_start -= 50 row_start -= 50
continue continue