mirror of
https://github.com/KeymonSoft/Monitor-Keymon.git
synced 2026-04-18 05:09:21 +00:00
- VERSION 5.04.22
- Se agregó que guarde en base de datos el estatus de "Activo", asi si se desactiva el servicio, cuando se reinicia, o el sistema lo mata y luego reinicia, mantiene el estatus seleccionado.
This commit is contained in:
@@ -14,16 +14,18 @@ Sub Process_Globals
|
||||
Dim rp As ReplyAuto
|
||||
Dim activo As Boolean = True
|
||||
Dim ultimaNoti As String
|
||||
Dim s As C_Subs
|
||||
End Sub
|
||||
|
||||
Sub Service_Create
|
||||
' Log(963)
|
||||
s.Initialize
|
||||
rp.Initialize("MonitorKeymon")
|
||||
If Starter.logger Then Log("**************** Iniciamos Monitor Keymon ***********************")
|
||||
End Sub
|
||||
|
||||
Sub Service_Start (StartingIntent As Intent)
|
||||
if starter.logger then Log("Monitor - NotificationService Start")
|
||||
If Starter.logger Then Log("Monitor - NotificationService Start")
|
||||
If rp.HandleIntent(StartingIntent) Then Return
|
||||
DateTime.DateFormat = "mm"
|
||||
ultimaNoti = DateTime.Date(DateTime.now)
|
||||
@@ -34,22 +36,25 @@ Sub Service_Destroy
|
||||
|
||||
End Sub
|
||||
|
||||
' Cuando entre una notificación, revisamos que el servicio del monitor este funcionando, si no esta funcionando
|
||||
' y "monitorActivo" es verdadero, entonces lo iniciamos.
|
||||
Sub MonitorKeymon_NotificationPosted (SBN As StatusBarNotification)
|
||||
' Log("|" & ultimaNoti & "|")
|
||||
Private logger As Boolean = False
|
||||
If ultimaNoti = "" Then ultimaNoti = 0
|
||||
DateTime.DateFormat = "mm"
|
||||
Private estaNoti As String = DateTime.Date(DateTime.now)
|
||||
' Log("|" & estaNoti & "|")
|
||||
If estaNoti > 60 Then estaNoti = estaNoti - 60
|
||||
' Log("|" & estaNoti & "|")
|
||||
If Starter.logger Then LogColor("Diferencia de tiempo entre notis = " & (estaNoti - ultimaNoti), Colors.blue)
|
||||
If Starter.logger Then LogColor($"Esta noti en el minuto ${DateTime.Date(DateTime.now)}, ultima noti = ${ultimaNoti}"$, Colors.green)
|
||||
If Starter.logger Then Log(SBN.PackageName)
|
||||
If logger Then LogColor("Diferencia de tiempo entre notis = " & (estaNoti - ultimaNoti), Colors.blue)
|
||||
If logger Then LogColor($"Esta noti en el minuto ${DateTime.Date(DateTime.now)}, ultima noti = ${ultimaNoti}"$, Colors.green)
|
||||
If logger Then Log(SBN.PackageName)
|
||||
If (ultimaNoti + 2) < estaNoti Then '3 minutos
|
||||
If Starter.logger Then LogColor($"******** Revisamos el Monitor *******"$, Colors.red)
|
||||
If logger Then LogColor($"******** Revisamos el Monitor *******"$, Colors.red)
|
||||
ultimaNoti = estaNoti
|
||||
If Starter.logger Then Log($"Monitor activo: ${Not(IsPaused(Monitor))}"$)
|
||||
If IsPaused(Monitor) Then StartService(Monitor)
|
||||
If logger Then Log($"Monitor activo: ${Not(IsPaused(Monitor))}"$)
|
||||
If IsPaused(Monitor) And s.traeActivo Then StartService(Monitor)
|
||||
End If
|
||||
If Starter.logger Then LogColor("Monitor inicializado: " & Monitor.Timer1.IsInitialized, Colors.Magenta)
|
||||
If logger Then LogColor("Monitor inicializado: " & Monitor.Timer1.IsInitialized, Colors.Magenta)
|
||||
End Sub
|
||||
|
||||
Reference in New Issue
Block a user