diff --git a/B4A/B4XMainPage.bas b/B4A/B4XMainPage.bas index b2dc630..3501c78 100644 --- a/B4A/B4XMainPage.bas +++ b/B4A/B4XMainPage.bas @@ -104,8 +104,10 @@ Private Sub B4XPage_CloseRequest As ResumableSub Sleep(0) If p_engrane.Visible Then p_engrane.Visible = False + Return False + Else + Return True End If - Return False End Sub 'Revisa si la aplicación tiene permiso para acceder a las notificaciones. @@ -137,7 +139,6 @@ Private Sub b_monitorActivo_Click b_monitorActivo.Text = "Monitor Activo" l_status.Text = "Monitor Activo" CallSubDelayed(Monitor, "Timer1_Tick") - Starter.monitorActivo = False Starter.monitorActivo = True End If End Sub diff --git a/B4A/C_Subs.bas b/B4A/C_Subs.bas index f2da875..110004d 100644 --- a/B4A/C_Subs.bas +++ b/B4A/C_Subs.bas @@ -399,9 +399,9 @@ Sub traeIntervaloDeBD As String 'ignore Return intrvl End Sub -'Regresa el timeout desde la base de datos o "1250" si no existe. +'Regresa el timeout desde la base de datos o "9000" si no existe. Sub traeTimeoutDeBD As String 'ignore - Dim tmout As String = "1250" + Dim tmout As String = "9000" Dim rs As ResultSet = Starter.skmt.ExecQuery("select valor from cat_variables where nombre = 'timeout'") If rs.RowCount > 0 Then rs.NextRow diff --git a/B4A/Tester.b4a b/B4A/Tester.b4a index 98a8e51..74a70eb 100644 --- a/B4A/Tester.b4a +++ b/B4A/Tester.b4a @@ -36,7 +36,7 @@ Version=12.2 #Region Project Attributes #ApplicationLabel: Monitor Keymon #VersionCode: 1 - #VersionName: 3.09.09 + #VersionName: 3.09.10 'SupportedOrientations possible values: unspecified, landscape or portrait. #SupportedOrientations: portrait #CanInstallToExternalStorage: False diff --git a/B4A/monitor.bas b/B4A/monitor.bas index 8ce285c..f50177f 100644 --- a/B4A/monitor.bas +++ b/B4A/monitor.bas @@ -19,7 +19,7 @@ Sub Process_Globals Dim Interval As Int Dim s As C_Subs Dim nid As Int = 51043 - Dim monitorActivo As Boolean = True +' Dim monitorActivo As Boolean = True Dim InternetOk As Boolean = True Dim DBReqServerOk As Boolean = True Dim DBOk As Boolean = True @@ -55,9 +55,11 @@ End Sub Sub Timer1_Tick ' Log("Next run " & DateTime.Time(DateTime.Now + Interval * 1000)) - DateTime.DateFormat = "dd/MM HH:mm:ss" - If B4XPages.IsInitialized Then B4XPages.MainPage.l_ultimoPing.Text = $"Último ping: ${DateTime.Date(DateTime.now)}"$ - If monitorActivo Then probamosConexion + If Starter.monitorActivo Then + DateTime.DateFormat = "dd/MM HH:mm:ss" + If B4XPages.IsInitialized Then B4XPages.MainPage.l_ultimoPing.Text = $"Último ping: ${DateTime.Date(DateTime.now)}"$ + probamosConexion + End If End Sub Sub probamosConexion @@ -108,11 +110,11 @@ Sub JobDone(Job As HttpJob) Dim cd1 As ColorDrawable cd1.Initialize(Colors.Red, 10dip) - B4XPages.MainPage.b_ping.Background = cd1 - B4XPages.MainPage.b_ping.Text = "DBReqServer KO" + If B4XPages.IsInitialized Then B4XPages.MainPage.b_ping.Background = cd1 + If B4XPages.IsInitialized Then B4XPages.MainPage.b_ping.Text = "DBReqServer KO" s.notiHigh("Con internet", $"El servidor ${Starter.DBReqServer} NO responde!!"$, nid, Main) If Job.ErrorMessage.Contains("failed to connect") Or Job.ErrorMessage.Contains("Failed to connect") Then - ToastMessageShow("¡Hubo un error contactando al servidor, por favor revise su conexión!", True) +' ToastMessageShow("¡Hubo un error contactando al servidor, por favor revise su conexión!", True) End If Else If Job.JobName = "DBRequest" Then DBReqServerOk = True