Skip to content

Commit eacb6e4

Browse files
committed
Finish project
1 parent a14df7a commit eacb6e4

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

scripts/main.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def changeTheme():
2424
fg_color=text_radius_color, bg_color=color_bg, corner_radius=20)
2525
github_link = ctk.CTkLabel(root, text="GitHub", text_color=color_text, cursor="hand2",
2626
fg_color=text_radius_color, bg_color=color_bg, corner_radius=20)
27-
instagram_link.place(x=20, y=root.winfo_height() - 80)
27+
instagram_link.place(x=20, y=root.winfo_height() - 84)
2828
github_link.place(x=20, y=root.winfo_height() - 50)
2929
open_new_page()
3030
else:
@@ -36,7 +36,7 @@ def changeTheme():
3636
fg_color=text_radius_color, corner_radius=20)
3737
github_link = ctk.CTkLabel(root, text="GitHub", text_color=color_text, cursor="hand2",
3838
fg_color=text_radius_color, corner_radius=20)
39-
instagram_link.place(x=20, y=root.winfo_height() - 80)
39+
instagram_link.place(x=20, y=root.winfo_height() - 84)
4040
github_link.place(x=20, y=root.winfo_height() - 50)
4141
open_new_page()
4242

@@ -119,6 +119,10 @@ def open_new_page():
119119
wraplength=400, bg_color=color_bg, compound="left")
120120
main_label9.place(x=10, y=220)
121121

122+
main_label10 = ctk.CTkLabel(configures_tab, text=f"Aberto: {Arduino(selected_port.get()).is_open}",
123+
wraplength=400, bg_color=color_bg, compound="left")
124+
main_label10.place(x=10, y=245)
125+
122126
about_label = ctk.CTkLabel(about_tab,
123127
text="PyHolofotes é um programa Python para controlar um sistema Arduino RELE, "
124128
"injetando pulsos em superfícies para análises térmicas de defeitos não "
@@ -135,7 +139,7 @@ def open_new_page():
135139
instagram_link.bind("<Button-1>", lambda e: callback("https://www.instagram.com/veras_programmer"))
136140
github_link.bind("<Button-1>", lambda e: callback("https://www.github.com/Veras-D"))
137141

138-
instagram_link.place(x=20, y=root.winfo_height()-80)
142+
instagram_link.place(x=20, y=root.winfo_height()-84)
139143
github_link.place(x=20, y=root.winfo_height()-50)
140144

141145
else:
@@ -167,6 +171,7 @@ def pulso_unico():
167171
def led_pulse():
168172
if tempo1_entry.get().strip() != "":
169173
led(porta=selected_port.get(), opc=1, tempo1=float(tempo1_entry.get()))
174+
tempo1_entry.delete(0, END)
170175
open_new_page()
171176
else:
172177
port_error = ctk.CTkToplevel(root)
@@ -210,6 +215,9 @@ def led_pulse():
210215
if tempo1_entry.get().strip() != "" and tempo2_entry.get().strip() != "" and num_pulse_entry.get().strip() != "":
211216
led(porta=selected_port.get(), opc=2, tempo1=float(tempo1_entry.get()),
212217
tempo2=float(tempo2_entry.get()), num_pulse=int(num_pulse_entry.get()))
218+
tempo1_entry.delete(0, END)
219+
tempo2_entry.delete(0, END)
220+
num_pulse_entry.delete(0, END)
213221
open_new_page()
214222
else:
215223
port_error = ctk.CTkToplevel(root)

scripts/utilities.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
from serial import *
21
import serial.tools.list_ports
32
import customtkinter as ctk
43
import webbrowser
5-
# import base64
64

75

86
arduino = None
@@ -21,11 +19,6 @@ def callback(url):
2119
webbrowser.open_new_tab(url)
2220

2321

24-
# def get_base64_encoded_image(image_path):
25-
# with open(image_path, "rb") as img_file:
26-
# return base64.b64encode(img_file.read()).decode('utf-8')
27-
28-
2922
def find_arduino():
3023
arduino_ports = serial.tools.list_ports.comports()
3124
ports = ["Selecione a porta"]
@@ -40,7 +33,7 @@ def arduino_conected(portas):
4033
arduino = serial.Serial(portas, 115200, timeout=1)
4134
print("Arduino está conectado.")
4235
except serial.SerialException:
43-
print("Não foi possível conectar ao Arduino. Verifique a conexão e tente novamente.") # Fazer esses textos aparecerem no programa
36+
print("Não foi possível conectar ao Arduino. Verifique a conexão e tente novamente.")
4437
pass
4538

4639

0 commit comments

Comments
 (0)