15/9/23 - Espacios y detalles sin importancia.

This commit is contained in:
2023-09-15 15:34:11 -06:00
parent ab9e048e11
commit f8b16f4673
7 changed files with 261 additions and 265 deletions

View File

@@ -9,30 +9,38 @@ Sub Class_Globals
'These variables can be accessed from all modules.
' Public GZip As GZipStrings 'Usa la libreria CompressStrings
' Private su As StringUtils 'Usa la libreria StringUtils
Private EventName As String 'ignore
Private CallBack As Object 'ignore
Dim phn As Phone
Dim db As SQL
Dim devModel As String
Dim kmt, errorLog As SQL 'Requiere la libreria "SQL" 'ignore
Dim db, kmt, errorLog As SQL 'Requiere la libreria "SQL" 'ignore
' Dim wifi As MLwifi
Dim ssid As String 'ignore
' Dim rutaMaxPoints As Int = 3000
' Dim rutaHrsAtras As Int = 48
' Dim rutaInicioHoy As String = ""
Private subsLogs As Boolean = False
End Sub
'You can add more parameters here.
Public Sub Initialize As Object
Public Sub Initialize (vCallback As Object, vEventName As String) As Object
EventName = vEventName
CallBack = vCallback
Return Me
End Sub
'Inicializa la BD con "kmt.db" en File.DirInternal, si el archivo no existe, lo copia desde File.DirAssets.
'Dispara el evento "dbOk" cuando termina.
Sub dbInit As SQL
If File.Exists(File.DirInternal, "kmt.db") = False Then File.Copy(File.DirAssets, "kmt.db", File.DirInternal, "kmt.db")
db.Initialize(File.DirInternal,"kmt.db", True)
dbOk(True)
Return db
End Sub
Sub dbOk(Success As Boolean)
If SubExists(CallBack, EventName & "_dbOk") Then
CallSub2(CallBack, EventName & "_dbOk", Success)
End If
End Sub
'Pone el valor de phn.Model en la variable global "devModel"
Sub getPhnId As String 'ignore
'Requiere la libreria "Phone"
@@ -64,34 +72,6 @@ Sub fechaKMT(fecha As String) As String 'ignore
Return nuevaFecha
End Sub
'Genera una notificacion con importancia alta
'Sub notiHigh(title As String, body As String, activity As Object) 'ignore
' Private notif As Notification
' notif.Initialize2(notif.IMPORTANCE_HIGH)
' notif.Icon = "icon"
' notif.Vibrate = False
' notif.Sound = False
' notif.AutoCancel = True
' Log("notiHigh: "&title)
' notif.SetInfo(title, body, activity)
'' Log("notiHigh SetInfo")
' notif.Notify(777)
'End Sub
'Regresa el objeto de una notificacion con importancia baja
'Sub notiLowReturn(title As String, Body As String, id As Int) As Notification 'ignore
' Private notification As Notification
' notification.Initialize2(notification.IMPORTANCE_LOW)
' Log("notiLowReturn: "&title)
' notification.Icon = "icon"
' notification.Sound = False
' notification.Vibrate = False
' notification.SetInfo(title, Body, Main)
' notification.Notify(id)
'' Log("notiLowReturn SetInfo")
' Return notification
'End Sub
'Escribimos las coordenadas y fecha a un archivo de texto
Sub guardaInfoEnArchivo(coords As String) 'ignore
' Cambiamos el formato de la hora
@@ -135,7 +115,6 @@ Sub deleteErrorLog_DB 'ignore
ToastMessageShow("BD Errores Borrada", False)
End Sub
'Mandamos "coords" en un mensaje a "Sprvsr"
'Sub mandamosLoc(coords As String) 'ignore
'' Log("Iniciamos mandamosLoc "&coords)
@@ -256,7 +235,7 @@ Sub InstallAPK(dir As String, apk As String) 'ignore
End If
End Sub
'Copia la base de datos del almacenamiento interno al externo en el directorio kmts
'Copia la base de datos del almacenamiento interno al externo en el directorio kmts.
Sub copiaDB(result As Boolean) 'ignore
ToastMessageShow("copiaDB", False)
If result Then
@@ -290,7 +269,7 @@ Sub copiaDB(result As Boolean) 'ignore
End If
End Sub
'Hace visible y trae al frente el panel con los parametros "Top" y "Left" dados
'Hace visible y trae al frente el panel con los parametros "Top" y "Left" dados.
Sub panelVisible(panel As Panel, top As Int, left As Int) 'ignore
panel.BringToFront
panel.Visible = True
@@ -298,22 +277,22 @@ Sub panelVisible(panel As Panel, top As Int, left As Int) 'ignore
panel.Left = left
End Sub
'Centra una etiqueta dentro de un elemento superior
'Centra una etiqueta dentro de un elemento superior.
Sub centraEtiqueta(elemento As Label, anchoElementoSuperior As Int) 'ignore
elemento.Left = Round(anchoElementoSuperior/2)-(elemento.Width/2)
End Sub
'Centra un panel horizontalmente dentro de un elemento superior
'Centra un panel horizontalmente dentro de un elemento superior.
Sub centraPanel(elemento As Panel, anchoElementoSuperior As Int) 'ignore
elemento.Left = Round(anchoElementoSuperior/2)-(elemento.Width/2)
End Sub
'Centra un panel verticalmente dentro de un elemento superior
'Centra un panel verticalmente dentro de un elemento superior.
Sub centraPanelV(elemento As Panel, altoElementoSuperior As Int) 'ignore
elemento.Top = Round(altoElementoSuperior/2)-(elemento.Height/2)
End Sub
'Centra una barra de progreso dentro de un elemento superior
'Centra una barra de progreso dentro de un elemento superior.
Sub centraProgressBar(elemento As ProgressBar, anchoElementoSuperior As Int) 'ignore
elemento.Left = Round(anchoElementoSuperior/2)-(elemento.Width/2)
End Sub
@@ -328,10 +307,11 @@ Sub buscaDBUsuario As String 'ignore
Return usuario
End Sub
'Regresa la fecha en el formato "MM/dd/yyyy"
Sub traeFecha As String 'ignore
DateTime.DateFormat = "MM/dd/yyyy"
Private sDate As String =DateTime.Date(DateTime.Now)
Private sTime As String =DateTime.Time(DateTime.Now)
Private sDate As String = DateTime.Date(DateTime.Now)
Private sTime As String = DateTime.Time(DateTime.Now)
Return sDate & sTime
End Sub
@@ -352,7 +332,7 @@ Sub logJobDoneResultados(resultado As DBResult) 'ignore
Next
End Sub
'Regresa la base de datos espscificada ya inicializada.
'Regresa la base de datos especificada ya inicializada.
Sub inicializaBD(ruta As String, BDName As String) As SQL
Dim skmt As SQL
If File.Exists(ruta, BDName) = False Then
@@ -384,7 +364,7 @@ Sub agregaColumna(tabla As String, columna As String, tipo As String) 'ignore
End Try
End Sub
'Regresa el el DBReqServer desde la base de datos o "N/A" si no existe.
'Regresa el DBReqServer desde CAT_VARIABLES o "N/A" si no existe.
Sub traeDBReqServerDeBD As String 'ignore
Dim srvr As String = "N/A"
Dim rs As ResultSet = Starter.db.ExecQuery("select valor from cat_variables where nombre = 'servidor'")
@@ -395,7 +375,7 @@ Sub traeDBReqServerDeBD As String 'ignore
Return srvr
End Sub
'Regresa el el intervalo desde la base de datos o "30" si no existe.
'Regresa el valor de intervalo desde CAT_VARIABLES o "30" si no existe.
Sub traeIntervaloDeBD As String 'ignore
Dim intrvl As String = "30"
Dim rs As ResultSet = Starter.db.ExecQuery("select valor from cat_variables where nombre = 'intervalo'")
@@ -406,7 +386,7 @@ Sub traeIntervaloDeBD As String 'ignore
Return intrvl
End Sub
'Regresa el timeout desde la base de datos o "9000" si no existe.
'Regresa el valor timeout desde CAT_VARIABLES o "9000" si no existe.
Sub traeTimeoutDeBD As String 'ignore
Dim tmout As String = "9000"
Dim rs As ResultSet = Starter.db.ExecQuery("select valor from cat_variables where nombre = 'timeout'")
@@ -417,6 +397,7 @@ Sub traeTimeoutDeBD As String 'ignore
Return tmout
End Sub
'Crea una notificación con el "body" dado y regresa el objeto.
Sub CreateNotification (Body As String) As Notification
Dim notification As Notification
notification.Initialize2(notification.IMPORTANCE_LOW)