@@ -346,6 +346,24 @@ Public Class WinNUT
346346 End If
347347 End Sub
348348
349+ Private Sub UPS_Lostconnect() Handles UPS_Device.Lost_Connect
350+ LogFile.LogTracing( "Notify user of lost connection" , LogLvl.LOG_ERROR, Me ,
351+ String .Format(StrLog.Item(AppResxStr.STR_MAIN_LOSTCONNECT), UPS_Device.Nut_Config.Host, UPS_Device.Nut_Config.Port))
352+ ' UPSDisconnect()
353+
354+ ReInitDisplayValues()
355+ If UPS_Device.Nut_Config.AutoReconnect And UPS_Retry <= UPS_MaxRetry Then
356+ ActualAppIconIdx = AppIconIdx.IDX_ICO_RETRY
357+ Else
358+ ActualAppIconIdx = AppIconIdx.IDX_ICO_OFFLINE
359+ End If
360+
361+ UpdateIcon_NotifyIcon()
362+ RaiseEvent UpdateNotifyIconStr( "Lost Connect" , Nothing )
363+ RaiseEvent UpdateBatteryState( "Lost Connect" )
364+ LogFile.LogTracing( "Update Icon" , LogLvl.LOG_DEBUG, Me )
365+ End Sub
366+
349367 ''' <summary>
350368 ''' Perform final actions to wrap up a disconnected UPS.
351369 ''' </summary>
@@ -587,24 +605,6 @@ Public Class WinNUT
587605 HasFocus = False
588606 End Sub
589607
590- Private Sub UPS_Lostconnect() Handles UPS_Device.Lost_Connect
591- LogFile.LogTracing( "Notify user of lost connection" , LogLvl.LOG_ERROR, Me ,
592- String .Format(StrLog.Item(AppResxStr.STR_MAIN_LOSTCONNECT), UPS_Device.Nut_Config.Host, UPS_Device.Nut_Config.Port))
593- ' UPSDisconnect()
594-
595- 'ReInitDisplayValues()
596- If UPS_Device.Nut_Config.AutoReconnect And UPS_Retry <= UPS_MaxRetry Then
597- ActualAppIconIdx = AppIconIdx.IDX_ICO_RETRY
598- Else
599- ActualAppIconIdx = AppIconIdx.IDX_ICO_OFFLINE
600- End If
601-
602- UpdateIcon_NotifyIcon()
603- RaiseEvent UpdateNotifyIconStr( "Lost Connect" , Nothing )
604- RaiseEvent UpdateBatteryState( "Lost Connect" )
605- LogFile.LogTracing( "Update Icon" , LogLvl.LOG_DEBUG, Me )
606- End Sub
607-
608608 Public Shared Sub Event_ChangeStatus() Handles Me .On_Battery, Me .On_Line,
609609 UPS_Device.Lost_Connect, UPS_Device.Connected, UPS_Device.Disconnected, UPS_Device.New_Retry, UPS_Device.ReConnected
610610 ', UPS_Device.Unknown_UPS
0 commit comments