-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrecoletar.py
85 lines (73 loc) · 2.87 KB
/
recoletar.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import os
import json
import modulos.gps
import time
os.system("clear")
logo="""
EJECUTANDOSE
"""
menu = """
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Bienvenido al modulo de gestión
██████╗██████╗███████╗
██╔════╝██╔══████╔════╝
██║ █████████╔███████╗
██║ ████╔═══╝╚════██║
╚██████╔██║ ███████║
╚═════╝╚═╝ ╚══════╝
Julian Guillermo Zapata Rugeles $no_kEy_mann$
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1) Iniciar Pruebas
2) Instrucciones Uso
3) Autor
4) Salir
"""
MENU_ITEMS = ["1","2","3","4"]
# recuerde que dependiendo de la ubicación y cobertura el sensor GPS puede tardar más tiempo
# obtener los datos satelitales
def iniciar_recoleccion():
# Seleccion de tiempo
global logo
TEST_SUCESS=0 # no const
TEST_FAILED=0 # no const -->
TIME_ELAPSE_ERROR=0
TIME_ELAPSE = 5 # representa el tiempo en el que se intentará obtener posición gps
try:
TIME_ELAPSE=float(input("Tiempo entre pruebas : "))
except Exception as e:
print("Por defecto {} segundos entre prueba".format(TIME_ELAPSE))
#INICIO DEL PROGRAMA , SE CREA UN OBJETO DE GpsTelemtry
registrador = mod_gps.gps.GpsTelemtry()
while True:
print(logo)
print("**********************************************************")
print("EJECUTANDOSE ...\n")
print("INTERVALO TIEMPO :",TIME_ELAPSE,"SEGUNDOS\n")
print("PRUEBAS EXITOSAS : {} <-> FALLIDAS {}".format(TEST_SUCESS,TEST_FAILED))
print("**********************************************************")
status=registrador.get_telemetry()
if status==True:
registrador.get_information()
registrador.save_information("telemetria.csv") # se guarda toda la información o se elige .
TEST_SUCESS+=1
time.sleep(TIME_ELAPSE)
else:
#------------------------------------------------------------------------------------
print("NO SE OBTUVO INFORMACIÓN DEL SATÉLITE")
time.sleep(TIME_ELAPSE_ERROR)
TEST_FAILED+=1
time.sleep(TIME_ELAPSE_ERROR)
os.system("clear")
if __name__ == '__main__':
while True:
os.system("clear")
print(menu)
iniciar=str(input("Eleccion : "))
if iniciar not in MENU_ITEMS:
exit()
if iniciar=="1":
iniciar_recoleccion()
elif iniciar=="2":
os.system("clear")
print(open("menu/m_instrucciones.txt").read())
continuar=str(input("Enter para continuar "))