This commit is contained in:
Javier
2025-11-04 10:25:09 -06:00
parent 5fc486d742
commit 3f23591294
10 changed files with 501 additions and 159 deletions

View File

@@ -462,6 +462,33 @@ Public Sub StopFLP
End If
End Sub
Public Sub StartFLP2
Private logger As Boolean = True
If logger Then Log("StartFLP2 - flpStarted="&flpStarted)
Do While FLP.IsConnected = False
Sleep(500)
If logger Then Log("kll - sleeping")
Loop
dameUltimaUbicacionConocida 'Regresamos ultima ubicacion conocida
FLP.RequestLocationUpdates(CreateLocationRequest2) 'Buscamos ubicacion 2 peticiones
If logger Then LogColor("Buscamos ubicacion (movimientoMinimo = "&actualLR.GetSmallestDisplacement&")", Colors.Magenta)
' If logger Then Log(actualLR.GetSmallestDisplacement)
End Sub
Private Sub CreateLocationRequest2 As LocationRequest
Private logger As Boolean = True
If logger Then Log("Iniciamos CreateLocationRequest2")
Dim lr As LocationRequest
lr.Initialize
lr.SetInterval(1000) 'Intervalo deseado para actualizaciones de ubicacion
lr.SetFastestInterval(lr.GetInterval / 2) 'Intervalo minimo para actualizaciones de ubicacion
lr.setNumUpdates(2) 'Solicitamos solo 2 actualizaciones con estos parametros
lr.SetSmallestDisplacement(1) 'Solo registra cambio de ubicacion si es mayor a XX mts
lr.SetPriority(lr.Priority.PRIORITY_HIGH_ACCURACY)
actualLR=lr
Return lr
End Sub
Sub flp_LocationChanged (Location1 As Location)
' ToastMessageShow("Loc changed", False)
' Log($"Loc changed:${Location1.Longitude},${Location1.Latitude}"$)
@@ -497,7 +524,7 @@ Sub flp_LocationChanged (Location1 As Location)
End If
CallSub2(Starter, "GPS_LocationChanged", Location1)
' CallSub2(B4XPages.MainPage.cliente, "GPS_LocationChanged", Location1)
CallSub2(B4XPages.MainPage.cliente, "GPS_LocationChanged", Location1)
' CallSub2(gestion, "GPS_LocationChanged", Location1)
If B4XPages.MainPage.cliente.IsInitialized Then
CallSub2(B4XPages.GetPage("Cliente"), "GPS_LocationChanged", Location1)