- VERSION 4.07.28

- Se agregó el nuevo ruteo dinamico
This commit is contained in:
Jose Alberto Guerra Ugalde
2024-07-30 01:11:14 -06:00
parent 2500ffea11
commit 42d6e32f32
9 changed files with 221 additions and 42 deletions

View File

@@ -154,7 +154,8 @@ Private Sub B4XPage_Created (Root1 As B4XView)
Starter.skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS RUTAA (RUTAA TEXT)")
Starter.skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS wayPoints (codigo TEXT, indice INT)")
' Dim server As String = "http://187.189.244.154:1781"
Dim server As String = "http://11.0.0.168:1781"
' Dim server As String = "http://11.0.0.168:1781"
Dim server As String = "http://keymon.lat:9000"
' server = "http://10.0.0.205:1782"
' server = "http://11.0.0.44:1782"
reqManager.Initialize(Me, B4XPages.MainPage.server)
@@ -266,7 +267,28 @@ Sub JobDone(Job As HttpJob)
Next
End If
End If
If Job.JobName = "DBRequest" Then
Dim result As DBResult = reqManager.HandleJob(Job)
If result.Tag = "coords_almacen" Then 'query tag
For Each records() As Object In result.Rows
Log("Coordenadas del almacen: " & records(result.Columns.Get("CAT_AL_LATITUD")) & "," & records(result.Columns.Get("CAT_AL_LONGITUD")))
Private lat, lon As Double
lat = 0.0
lon = 0.0
If IsNumber(records(result.Columns.Get("CAT_AL_LATITUD"))) And IsNumber(records(result.Columns.Get("CAT_AL_LONGITUD"))) Then
lat = records(result.Columns.Get("CAT_AL_LATITUD"))
lon = records(result.Columns.Get("CAT_AL_LONGITUD"))
End If
Starter.cedisLocation.Latitude = lat
Starter.cedisLocation.Longitude = lon
Starter.skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?", Array As Object ("COORDS_ALMACEN"))
Starter.skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("COORDS_ALMACEN",lon&","&lat))
'19.48118148992086,-99.15295579261536
Next
End If
End If
If Job.JobName = "DBRequest" Then
Dim result As DBResult = reqManager.HandleJob(Job)
If result.Tag = "usuario" Then 'query tag

View File

@@ -33,6 +33,7 @@ Sub Class_Globals
Dim listaWayPoints As List
Dim lv1Top As String
Private b_limpiarRuta As Button
Dim rutaGenerada As Boolean = False
End Sub
'You can add more parameters here.
@@ -90,7 +91,7 @@ Sub B4XPage_Appear
cs2.Initialize
' t1 = Starter.waypointsOrdered.Get(k)
' c.GetString("codigo")
Log(c.GetString("indice"))
' Log(c.GetString("indice"))
ListView1.AddTwoLines(cs.Color(Colors.RGB(100,149,237)).Append(c.GetString("codigo")).PopAll, cs2.append(c.GetString("CAT_CL_NOMBRE")).Color(Colors.RGB(100,149,237)).Append(" Calle: ").Pop.Append(c.GetString("CAT_CL_CALLE").Trim & " " & c.GetString("CAT_CL_NOEXT")).PopAll )
Next
Else
@@ -105,11 +106,36 @@ Sub B4XPage_Appear
Subs.centraEtiqueta(lfila, Root.Width)
b_getRutaInfo.Visible = True
b_getRutaInfo.BringToFront
If Starter.cedisLocation.Latitude = "0" Then
Private x As Cursor = Starter.skmt.ExecQuery("select * from CAT_VARIABLES where CAT_VA_DESCRIPCION = 'COORDS_ALMACEN'")
If x.RowCount > 0 Then
x.Position = 0
Private y() As String
Starter.cedisLocation.Latitude = Regex.Split(",", x.GetString("CAT_VA_VALOR"))(1)
Starter.cedisLocation.Longitude = Regex.Split(",", x.GetString("CAT_VA_VALOR"))(0)
End If
End If
Log(Starter.cedisLocation)
End Sub
Private Sub B4XPage_CloseRequest As ResumableSub
' BACK key pressed
'Return True to close, False to cancel
Log(entro)
If rutaGenerada Or entro = 3 Then ' Si ya generamos el ruteo o entramos a una de las rutas, nos regresamos!
b_limpiarRuta_Click
l_rutaInfo.Text = ""
rutaGenerada = False
else if entro = 2 Then ' Si estamos mostrando las rutas, nos regresamos a la principal.
B4XPages.ShowPage("Principal")
End If
Return False
End Sub
Sub ListView1_ItemClick (Position As Int, Value As Object)
' Log($"Entro= ${entro}"$)
Log(Value)
ListView1.Clear
Sleep(50)
Subs.SetDivider(ListView1, Colors.LightGray, 2)
@@ -121,14 +147,14 @@ Sub ListView1_ItemClick (Position As Int, Value As Object)
l_rutaInfo.Visible = False
b_GetDirs.Visible = False
If entro = "2" Then
b_GetDirs.Visible = True
img_getDirs.Visible = True
b_getRutaInfo.Visible = False
' b_GetDirs.Visible = True
' img_getDirs.Visible = True
' b_getRutaInfo.Visible = False
Private lrt As String
lrt = Value
laRuta = lrt.SubString(6) 'Quitamos el texto "Ruta: " para obtener el numero de la ruta.
' Log($"Original: ${Value} - Mod: |${lrt.SubString(6)}| - laRuta: ${laRuta}"$)
c2=Starter.skmt.ExecQuery2("select CAT_CL_NOMBRE, CAT_CL_CALLE, CAT_CL_CODIGO, CAT_CL_LAT, CAT_CL_LONG from kmt_info where CAT_CL_RUTA = ? and gestion = 0 order by CAT_CL_NOMBRE ", Array As String(laRuta))
c2 = Starter.skmt.ExecQuery2("select CAT_CL_NOMBRE, CAT_CL_CALLE, CAT_CL_CODIGO, CAT_CL_LAT, CAT_CL_LONG from kmt_info where CAT_CL_RUTA = ? and gestion = 0 order by CAT_CL_NOMBRE ", Array As String(laRuta))
Private thisLoc As Location
Private label1 As Label
Private label2 As Label
@@ -138,14 +164,14 @@ Sub ListView1_ItemClick (Position As Int, Value As Object)
label2 = ListView1.TwoLinesLayout.SecondLabel
label2.TextSize = 15
label2.TextColor = Colors.black
label2.Height = 38dip
label2.Height = 57dip
thisLoc.Initialize
If entro = 2 Then ListView1.TwoLinesLayout.ItemHeight = 75dip
If entro = 2 Then ListView1.TwoLinesLayout.ItemHeight = 90dip
lfila.text = "Nombre y Calle"
distOrderedMap.Initialize
If c2.RowCount>0 Then
For i=0 To c2.RowCount -1 'Generamos mapa de clientes
c2.Position=i
If c2.RowCount > 0 Then
For i = 0 To c2.RowCount -1 'Generamos mapa de clientes
c2.Position = i
thisLoc.Latitude = c2.GetString("CAT_CL_LAT")
thisLoc.Longitude = c2.GetString("CAT_CL_LONG")
' Log(Tracker.UUGCoords)
@@ -159,12 +185,14 @@ Sub ListView1_ItemClick (Position As Int, Value As Object)
For Each k As Object In distOrderedMap.Keys 'Generamos el listView con el mapa ordenada.
m1 = distOrderedMap.Get(k)
m1.Get("codigo")
Log(m1.Get("nomDirDist"))
ListView1.AddTwoLines(m1.Get("codigo"), m1.Get("nomDirDist"))
Next
End If
c2.Close
entro = "3"
Else If entro = "3" Then
' LogColor("Guardamos CLIENTE " & Value, Colors.red)
Starter.skmt.ExecNonQuery("delete from CUENTAA")
Starter.skmt.ExecNonQuery2("INSERT INTO CUENTAA VALUES (?)", Array As Object(Value))
B4XPages.ShowPage("Cliente")
@@ -407,12 +435,14 @@ Sub traeRutaDia(aVisitar As B4XOrderedMap)
Private r As Int = 1
Private r1, wps As Map
Starter.skmt.ExecNonQuery("delete from waypoints")
Log("BORRAMOS WAYPOINTS")
For Each k As Object In clientesMapaO.Keys 'Guardamos en la BD el orden de los waypoints para luego generar el listview.
If listaWayPoints.Size > 0 Then
r1 = clientesMapaO.Get(k)
r1.Get("codigo")
Log(listaWayPoints.Get(r) & "|" & r1.Get("coords") & "|" & r1.Get("calle"))
wps = listaWayPoints.Get(r)
Starter.skmt.ExecNonQuery($"update kmt_info set SECUENCIA = ${wps.get("waypoint_index")} where CAT_CL_CODIGO = '${r1.Get("codigo")}'"$)
Starter.skmt.ExecNonQuery2("insert into waypoints values (?,?)", Array As Object(r1.Get("codigo"), wps.get("waypoint_index")))
r = r + 1
End If
@@ -546,7 +576,8 @@ End Sub
'Traemos la ruta de visitas via el API de OSRM usando el sub "traeRutaDia(traeTodosAVisitar)".
Private Sub b_getRutaInfo_Click
traeRutaDia(traeTodosAVisitar)
' traeRutaDia(traeTodosAVisitar)
caculaRutaGPS(todosAVisitar)
End Sub
'Mostramos u ocultamos el boton para borrar los waypoints de la ruta.
@@ -563,4 +594,96 @@ Private Sub b_limpiarRuta_Click
Starter.skmt.ExecNonQuery("delete from waypoints")
b_limpiarRuta.Visible = False
B4XPage_Appear
End Sub
End Sub
Sub caculaRutaGPS(coords As List)
Private tmpList As List
Dim cs, cs2 As CSBuilder
tmpList.Initialize
tmpList.AddAll(Array As String("ACTUAL", Tracker.UUGCoords.Longitude, Tracker.UUGCoords.Latitude))
coords.InsertAt(0,tmpList)
Log("=================================")
' Log(coords)
Private coordsStr As String = ""
For Each tienda As List In coords
' Log(tienda)
If coordsStr = "" Then
coordsStr = $"${tienda.get(0)},${tienda.get(1)},${tienda.get(2)}"$
Else
coordsStr = $"${coordsStr};${tienda.get(0)},${tienda.get(1)},${tienda.get(2)}"$
End If
Next
Log(coordsStr)
ProgressDialogShow2("Calculando distancia y tiempo, un momento por favor.", False)
Dim j As HttpJob
j.Initialize("trip", Me) 'Calculamos el resto de la ruta.
j.Download($"http://keymon.lat:9002/ruteador?m=OSRM&r=${Subs.traeRutaReparto}&a=${Subs.traeAlmacen}&f=CEDIS,${Starter.cedisLocation.Longitude},${Starter.cedisLocation.Latitude}&c=${coordsStr}"$)
Log($"http://keymon.lat:9002/ruteador?m=OSRM&r=${Subs.traeRutaReparto}&a=${Subs.traeAlmacen}&f=CEDIS,${Starter.cedisLocation.Longitude},${Starter.cedisLocation.Latitude}&c=${coordsStr}"$)
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
Dim jp As JSONParser
jp.Initialize(j.GetString)
Dim m As Map = jp.NextObject
Log(m)
If m.Get("code") = "OK" Then
Log("===== OK")
rutaGenerada = True
Dim puntos As Int = m.Get("puntos")
Private coords As List = m.Get("coords")
Private duration As String = m.Get("duration")
Private distance As String = m.Get("distance")
Private mensaje As String = m.Get("mensaje")
Starter.skmt.ExecNonQuery("delete from waypoints")
Starter.skmt.ExecNonQuery("update kmt_info set SECUENCIA = 0")
For i = 0 To coords.Size - 1
Private ti As Map = coords.Get(i)
Starter.skmt.ExecNonQuery($"update kmt_info set SECUENCIA = ${ti.Get("pos")} where CAT_CL_CODIGO = '${ti.Get("id").As(String).SubString(1)}'"$) ' Ponemos la secuencia con el orden del ruteo para poder verla en el mapa.
Starter.skmt.ExecNonQuery($"insert into waypoints (codigo, indice) values ('${ti.Get("id").As(String).SubString(1)}', '${ti.Get("pos")}')"$)
Next
c = Starter.skmt.ExecQuery("select codigo, indice, CAT_CL_NOMBRE, CAT_CL_CALLE, CAT_CL_NOEXT from waypoints inner join kmt_info on waypoints.codigo = kmt_info.CAT_CL_CODIGO where gestion = 0 order by indice")
If c.RowCount > 0 Then 'Ya hay waypoints en la base de datos.
c.Position = 0
conMapa = True
ListView1.Clear
Dim cs, cs2 As CSBuilder
entro = 3
For i=0 To c.RowCount -1 'Generamos el listView con la lista ordenada.
c.Position = i
cs.Initialize
cs2.Initialize
ListView1.AddTwoLines(cs.Color(Colors.RGB(100,149,237)).Append(c.GetString("codigo")).PopAll, cs2.append(c.GetString("CAT_CL_NOMBRE")).Color(Colors.RGB(100,149,237)).Append(" Calle: ").Pop.Append(c.GetString("CAT_CL_CALLE").Trim & " " & c.GetString("CAT_CL_NOEXT")).PopAll )
Next
End If
c.Close
Log($"Distancia total: $1.1{distance/1000} kms, tiempo aprox: $1.1{duration/60} mins. ($1.1{duration/60/60} hrs)"$)
l_rutaInfo.Text = $"Distancia: $1.1{distance/1000} kms, tiempo aprox: $1.1{duration/60/60} hrs${CRLF}Visitas restantes: ${puntos - 1}"$
l_rutaInfo.Width = Root.Width * 0.9
Subs.centraEtiqueta(l_rutaInfo, Root.Width)
l_rutaInfo.Visible = True
l_rutaInfo.BringToFront
ListView1.Top = lv1Top + 100
End If
Else
LogColor("**************** Error! ******************", Colors.red)
End If
j.Release
ProgressDialogHide
End Sub
'Regresa lista de los clientes a visitar y sus coordenadas, iniciando con el cedis.
Sub todosAVisitar As List
Log(laRuta)
Log(entro)
Private sqlDeRuta As String = ""
If entro = 3 Then sqlDeRuta = $"and CAT_CL_RUTA = '${laRuta}'"$
Private aVisitar, tmpList As List
aVisitar.Initialize
Private coords As ResultSet = Starter.skmt.ExecQuery($"select CAT_CL_CODIGO, CAT_CL_LAT, CAT_CL_LONG from kmt_info where gestion = 0 ${sqlDeRuta}"$)
Do While coords.NextRow
tmpList.Initialize
tmpList.AddAll(Array As String(coords.GetString("CAT_CL_CODIGO"), coords.GetString("CAT_CL_LONG"), coords.GetString("CAT_CL_LAT")))
aVisitar.Add(tmpList)
Loop
Log(aVisitar)
Return aVisitar
End Sub

View File

@@ -599,8 +599,6 @@ Sub Subir_Click
End Sub
Sub cargar_Click
Dim pedidodiaanterior As Boolean = False
Dim cp As Cursor = Starter.skmt.ExecQuery("select * from NOVENTA")
If cp.RowCount > 0 Then
@@ -689,6 +687,11 @@ Sub cargar_Click
Log($"Pedimos hist_datos"$)
reqs.Add("hist_datos")
cmd.Initialize
cmd.Name = "select_coords_almacen_Marquez"
cmd.Parameters = Array As Object(ALMACEN)
reqManager.ExecuteQuery(cmd , 0, "coords_almacen")
' c=Starter.skmt.ExecQuery("SELECT REP_CLIENTE, REP_PRONOMBRE, REP_CANT, REP_COSTO_TOT, REP_FECHA FROM REPARTO")
' If c.RowCount > 0 Then
' For i=0 To c.RowCount -1
@@ -1122,6 +1125,8 @@ Sub JobDone(Job As HttpJob)
End If
Starter.cedisLocation.Latitude = lat
Starter.cedisLocation.Longitude = lon
Starter.skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?", Array As Object ("COORDS_ALMACEN"))
Starter.skmt.ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)", Array As Object ("COORDS_ALMACEN",lon&","&lat))
'19.48118148992086,-99.15295579261536
Next
End If

Binary file not shown.

View File

@@ -113,14 +113,8 @@ Sub Activity_Create(FirstTime As Boolean)
End Sub
Sub MapFragment1_Ready
' Msgbox("111","AVISO")
gmap = MapFragment1.GetMap
gmap.IsInitialized
'todos= 1
'permisos
' Msgbox("11","AVISO")
rp.CheckAndRequest(rp.PERMISSION_ACCESS_FINE_LOCATION)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
gmap.MyLocationEnabled = Result
@@ -128,16 +122,12 @@ Sub MapFragment1_Ready
Dim JavaMapsObject As JavaObject
JavaMapsObject = gmap.GetUiSettings
JavaMapsObject.RunMethod("setMapToolbarEnabled", Array As Object(True))
' Msgbox("12","AVISO")
'''''''----------------------------MARKER AZUL - POR ENTREGAR
Private esteAzul As Int = 0
Private esteAzul2 As String
If azul = 1 Or todos = 1 Then
c.IsInitialized
c=Starter.skmt.ExecQuery("select CAT_CL_CODIGO, SECUENCIA, CAT_CL_NOMBRE, CAT_CL_LAT, CAT_CL_LONG, CAT_CL_RUTA from kmt_info where gestion = 0 and CAT_CL_LAT is not null and CAT_CL_LONG is not null and CAT_CL_LAT <> 0 and CAT_CL_LONG <> 0 order by CAT_CL_RUTA")
' Msgbox("2","AVISO")
c = Starter.skmt.ExecQuery("select CAT_CL_CODIGO, SECUENCIA, CAT_CL_NOMBRE, CAT_CL_LAT, CAT_CL_LONG, CAT_CL_RUTA from kmt_info where gestion = 0 and CAT_CL_LAT is not null and CAT_CL_LONG is not null and CAT_CL_LAT <> 0 and CAT_CL_LONG <> 0 order by CAT_CL_RUTA")
rutaAnt = ""
For i = 0 To c.RowCount -1
c.Position = i
@@ -147,14 +137,19 @@ Sub MapFragment1_Ready
Tienda= c.GetString("CAT_CL_NOMBRE")
ruta = c.GetString("CAT_CL_RUTA")
NumSerie = c.GetString("SECUENCIA")
Private s As Cursor = Starter.skmt.ExecQuery($"select indice from waypoints where codigo = '${CODIGO}'"$)
If s.RowCount > 0 Then
s.Position = 0
NumSerie = s.GetString("indice")
End If
If rutaAnt <> ruta Then esteAzul = esteAzul + 1
If esteAzul = 1 Then esteAzul2= NumSerie&"maker-azul.png"
If esteAzul = 2 Then esteAzul2= NumSerie&"maker-azul1.png"
If esteAzul = 3 Then esteAzul2= NumSerie&"maker-azul2.png"
If esteAzul = 4 Then esteAzul2= NumSerie&"maker-azul3.png"
If esteAzul = 5 Then esteAzul2= NumSerie&"maker-azul4.png"
Log(ruta & "|" & esteAzul & "|" & esteAzul2)
Log(NumSerie&" "& Tienda&" --------"& esteAzul2&" --------"&esteAzul)
' Log(ruta & "|" & esteAzul & "|" & esteAzul2)
MARK_AZUL = gmap.AddMarker3(LatitudRu,LongitudRU,CODIGO,LoadBitmap(File.DirAssets, esteAzul2))
MARK_AZUL.Snippet = "R: " & ruta & " - " & Tienda
rutaAnt = ruta
@@ -162,9 +157,7 @@ Sub MapFragment1_Ready
c .Close
If MARK_AZUL.IsInitialized Then LIST_AZUL.Add(MARK_AZUL)
End If
' Msgbox("3","AVISO")
'''''''----------------------------MARKER VERDE- ENTREGADO
If verde = 1 Or todos = 1 Then
rutaAnt = ""
c2.IsInitialized
@@ -177,6 +170,11 @@ Sub MapFragment1_Ready
Tienda= c2.GetString("CAT_CL_NOMBRE")
ruta = c2.GetString("CAT_CL_RUTA")
NumSerie = c2.GetString("SECUENCIA")
Private s As Cursor = Starter.skmt.ExecQuery($"select indice from waypoints where codigo = '${CODIGO}'"$)
If s.RowCount > 0 Then
s.Position = 0
NumSerie = s.GetString("indice")
End If
MARK_VERDE = gmap.AddMarker3(LatitudRu,LongitudRU,CODIGO,LoadBitmap(File.DirAssets, NumSerie&"marker-verde.png"))
MARK_VERDE.Snippet = "R:" & ruta & ", " & Tienda
Next
@@ -199,7 +197,6 @@ Sub MapFragment1_Ready
If MARK_VERDE.IsInitialized Then LIST_VERDE.Add(MARK_VERDE)
End If
End If
' '''''''----------------------------MARKER ROJO - NO ENTREGADO
Private esteRojo As Int = 0
Private esteRojo2 As String
@@ -215,6 +212,11 @@ Sub MapFragment1_Ready
ruta = c3.GetString("CAT_CL_RUTA")
CODIGO=c3.GetString("CAT_CL_CODIGO")
NumSerie = c3.GetString("SECUENCIA")
Private s As Cursor = Starter.skmt.ExecQuery($"select indice from waypoints where codigo = '${CODIGO}'"$)
If s.RowCount > 0 Then
s.Position = 0
NumSerie = s.GetString("indice")
End If
MARK_ROJO = gmap.AddMarker3(LatitudRu,LongitudRU,CODIGO,LoadBitmap(File.DirAssets, NumSerie&"marker-rojo.png"))
MARK_ROJO.Snippet= "R:" & ruta & ", " & Tienda
Next
@@ -253,7 +255,6 @@ Sub MapFragment1_Ready
End Sub
''''-------------------------- PRUEBA CON MARKER _CLICK
Sub OnInfoWindowClickListener1_click(Marker1 As Marker)
Starter.skmt.ExecNonQuery("delete from CUENTAA")
Starter.skmt.ExecNonQuery2("INSERT INTO CUENTAA VALUES (?) ", Array As Object(Marker1.Title))

View File

@@ -2969,7 +2969,7 @@ Module16=C_Principal
Module17=C_Productos
Module18=C_tabulador
Module19=C_TicketsDia
Module2=|relative|..\B4XMainPage
Module2=B4XMainPage
Module20=C_UpdateAvailable
Module21=CameraExClass
Module22=DBRequestManager
@@ -2995,7 +2995,7 @@ Version=12.8
#Region Project Attributes
#ApplicationLabel: Marquez Reparto
#VersionCode: 1
#VersionName: 4.01.10
#VersionName: 4.07.28
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait
#CanInstallToExternalStorage: False

View File

@@ -66,7 +66,7 @@ ModuleClosedNodes12=
ModuleClosedNodes13=
ModuleClosedNodes14=
ModuleClosedNodes15=
ModuleClosedNodes16=
ModuleClosedNodes16=1
ModuleClosedNodes17=
ModuleClosedNodes18=
ModuleClosedNodes19=
@@ -77,7 +77,7 @@ ModuleClosedNodes22=
ModuleClosedNodes23=
ModuleClosedNodes24=
ModuleClosedNodes25=
ModuleClosedNodes26=
ModuleClosedNodes26=3
ModuleClosedNodes27=
ModuleClosedNodes28=
ModuleClosedNodes29=
@@ -85,9 +85,9 @@ ModuleClosedNodes3=
ModuleClosedNodes4=
ModuleClosedNodes5=
ModuleClosedNodes6=
ModuleClosedNodes7=
ModuleClosedNodes7=7,8,9,10,11,14,16,17
ModuleClosedNodes8=
ModuleClosedNodes9=
NavigationStack=C_Principal,t1_tick,1247,0,C_Principal,e_ruta_EnterPressed,1239,0,C_Principal,B4XPage_Appear,314,0,C_Principal,Subir_Click,500,3,C_Principal,JobDone,899,0,C_Principal,cargar_Click,655,0,C_Cheklist,b_guardar_Click,598,0,B4XMainPage,B4XPage_Appear,188,0,B4XMainPage,B4XPage_Created,150,0,Starter,Process_Globals,29,0
NavigationStack=C_Clientes,B4XPage_Appear,72,2,C_Clientes,traeRutaDia,431,5,C_Clientes,B4XPage_CloseRequest,120,6,C_Clientes,b_limpiarRuta_Click,591,0,C_Clientes,todosAVisitar,669,0,MAPA_RUTAS,Activity_Resume,285,4,C_Cliente,gest_Click,199,0,C_Clientes,b_getRutaInfo_Click,573,0,MAPA_RUTAS,MapFragment1_Ready,108,0,C_Clientes,caculaRutaGPS,633,6
SelectedBuild=0
VisibleModules=1,2,3,4,5,6,7,8,9,10,27
VisibleModules=27,2,16,6,7,26,28

View File

@@ -33,7 +33,8 @@ Sub Process_Globals
Dim cedisLocation As Location
Dim reqManager As DBRequestManager
' Dim server As String = "http://187.189.244.154:1781"
Dim server As String = "http://11.0.0.168:1781"
' Dim server As String = "http://11.0.0.168:1781"
Dim server As String = "http://keymon.lat:9000"
Dim muestraProgreso = 0
Dim c As Cursor
End Sub
@@ -63,8 +64,10 @@ Sub Service_Create
Timer1.Enabled = True
SharedFolder = rp.GetSafeDirDefaultExternal("")
cedisLocation.Initialize
cedisLocation.Latitude = "19.48118148992086"
cedisLocation.Longitude = "-99.15295579261536"
' cedisLocation.Latitude = "19.48118148992086"
' cedisLocation.Longitude = "-99.15295579261536"
cedisLocation.Latitude = "0"
cedisLocation.Longitude = "0"
End Sub
Sub Service_Start (StartingIntent As Intent)

View File

@@ -870,4 +870,29 @@ Sub agregaColumna(tabla As String, columna As String, tipo As String)
Log(LastException)
End Try
End Try
End Sub
'Regresa la ruta actual de la base de datos.
Sub traeRutaReparto As String 'ignore
Private c As Cursor
Private r As String
c=Starter.skmt.ExecQuery("select RUTAA from RUTAA")
r = "0"
If c.RowCount > 0 Then
c.Position=0
r = c.GetString("RUTAA")
End If
c.Close
Return r
End Sub
'Regresa el almacen actual de la base de datos.
Sub traeAlmacen As String 'ignore
Private c As Cursor
Private a As String
c = Starter.skmt.ExecQuery("select ID_ALMACEN from CAT_ALMACEN")
c.Position = 0
a = C.GetString("ID_ALMACEN")
c.Close
Return a
End Sub