Skip to content

Commit 87d810c

Browse files
committed
Guardar
1 parent 5eb8448 commit 87d810c

9 files changed

+32
-8
lines changed

server/src/Datos.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
"xonxoff": false,
88
"dsrdtr": false,
99
"rtscts": false,
10-
"timeout": 2,
10+
"timeout": 5,
1111
"write_timeout": null,
1212
"inter_byte_timeout": null
1313
},
1414
"Datos_Arduino": {
1515
"Tara": "20",
16-
"Peso Total": "2.70",
16+
"Peso Total": "10.00",
1717
"Radio llave": "10.50",
1818
"Suma Valores": "1.50",
1919
"Caudal Total": "1.60",
@@ -50,5 +50,6 @@
5050
0.0,
5151
0.0,
5252
0.0
53-
]
53+
],
54+
"Tiempo llenado": 0
5455
}

server/src/Ventanas.py

+6
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ def etiqueta_titulo_movible_main(self, nombre: str, posx: float, posy: float) ->
2828
label.place(relx=posx, rely=posy)
2929
return label
3030

31+
def etiqueta_titulo_movible_main2(self, nombre: str, posx: float, posy: float) -> tkinter.Label:
32+
label = tkinter.Label(self.ventana, text=nombre,
33+
font="Times 15 bold", bg=self.__color)
34+
label.place(relx=posx, rely=posy)
35+
return label
36+
3137
def etiqueta_titulo_movible_main_cambiar(self, posx: float, posy: float, color: str, var: tkinter.StringVar) -> tkinter.Label:
3238
variable = tkinter.Label(self.ventana, textvariable=var, font="Times 15")
3339
variable.config(bg = color)
241 Bytes
Binary file not shown.
Binary file not shown.

server/src/conectado_datos.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ def __init__(self, pantalla: Ventana, Dispostivo: Arduino, caja: tkinter.Listbox
2121
self.Estadistica: bool = True
2222

2323
def etiquetas(self) -> None:
24-
self.ventanas.etiqueta_titulo_movible_main(
25-
"Menu de Opciones", 0.8, 0.1)
24+
self.ventanas.etiqueta_titulo_movible_main2(
25+
"Menu de Opciones", 0.79, 0.1)
2626
self.etiqueta = tkinter.Entry(self.pantalla, textvariable=self.variable, width=80)
2727
self.etiqueta.place(relx=0.01, rely=0.9)
2828
self.etiqueta.config(state="disabled")
@@ -43,6 +43,7 @@ def opciones(self) -> None:
4343
self.estadistica()
4444
self.celdad_carga()
4545
self.cerrar_all()
46+
self.confi_regresion()
4647

4748
def ingrear_peso(self) -> None:
4849
boton = tkinter.Button(self.pantalla, text="Ing. Peso", command= lambda: self.__desactivar("peso"))
@@ -280,7 +281,12 @@ def cerrar_all(self) -> None:
280281
def cerrar_principal(self) -> None:
281282
if self.dispositivo.estado_conexion():
282283
self.dispositivo.escribir_datos("[false/5]")
283-
self.pantalla.after(1000, self.terminado)
284+
self.pantalla.after(500, self.terminado)
284285

285286
def terminado(self) -> None:
287+
self.dispositivo.desconectar()
286288
self.pantalla.destroy()
289+
290+
def confi_regresion(self) -> None:
291+
boton = tkinter.Button(self.pantalla, text= "Configuracion", command=lambda:print("Hola"), )
292+
boton.place(relx=0.83, rely=0.84)

server/src/module/Base_datos.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@ def __init__(self, configuracion : dict = {}) -> None:
2323
self.__datos_arduino : dict = {}
2424
self.__datos_estadisticos: list = []
2525
self.__guardar :dict = {}
26+
self.__tiempo_regr : float = 0
2627

2728
def Guardar_datos(self) -> None:
2829
self.__guardar = {
2930
"configuracion": self.__configuracion,
3031
"Datos_Arduino": self.__datos_arduino,
31-
"Estadistica": self.__datos_estadisticos
32+
"Estadistica": self.__datos_estadisticos,
33+
"Tiempo llenado": self.__tiempo_regr
3234
}
3335
with open(self.ruta_archivo, 'w') as archivo:
3436
json.dump(self.__guardar, archivo, indent=4)
@@ -39,6 +41,7 @@ def Cargar_datos(self) -> dict:
3941
self.__configuracion = self.__guardar.setdefault("configuracion")
4042
self.__datos_arduino = self.__guardar.setdefault("Datos_Arduino")
4143
self.__datos_estadisticos = self.__guardar.setdefault("Estadistica")
44+
self.__tiempo = self.__guardar.setdefault("Tiempo llenado")
4245
return self.__guardar
4346

4447
@property
@@ -65,6 +68,14 @@ def datos_estadisticos(self) -> list:
6568
def datos_estadisticos(self, diccionario: list) -> None:
6669
self.__datos_estadisticos = diccionario
6770

71+
@property
72+
def tiempo_regr(self) -> float:
73+
return self.__tiempo_regr
74+
75+
@tiempo_regr.setter
76+
def tiempo(self, valor_time: float) -> None:
77+
self.__tiempo_regr = valor_time
78+
6879
def __str__(self):
6980
aux : str = ""
7081
for key, value in self.__guardar.items():

server/src/module/Transfer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ def __stop_hilo(self):
109109
self.hilo = None
110110

111111
def desconectar(self):
112-
self.Arduino.close()
113112
self.__stop_hilo()
113+
self.Arduino.close()
114114

115115
def __call__(self) -> dict:
116116
return self.Arduino.get_settings()
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)