Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Connection handling & Logging, Power State handling #11

Merged
merged 9 commits into from
Aug 6, 2022

Commits on Aug 2, 2022

  1. Handle UPS disconnect logic

    - WinNUT.vb: Added common logic for handling a disconnection from the UPS, as far as the application as a whole is concerned. This should hopefully fix a few bugs or at least add some stability.
    gbakeman committed Aug 2, 2022
    Configuration menu
    Copy the full SHA
    1a94ed2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    14fc4f5 View commit details
    Browse the repository at this point in the history
  3. Fixing my own attempt at OOP

    - I shouldn't have put the Logger in the Globals module, IMO it belongs in the main client and passed as necessary to other objects.
    - Remove user data from client library project.
    gbakeman committed Aug 2, 2022
    Configuration menu
    Copy the full SHA
    3b84ffa View commit details
    Browse the repository at this point in the history
  4. - Add ToString method for Nut_Parameters

    - Modified Socket parameters, hoping this will help with IPv6 support
    gbakeman committed Aug 2, 2022
    Configuration menu
    Copy the full SHA
    515e1c5 View commit details
    Browse the repository at this point in the history
  5. Connection streamlining and debugging

    - Socket ConnectionStatus is derived from Socket directly
    - Bring Logger object into Socket
    - Create_Socket is turned into a subroutine; utilizing Events and Exceptions for communication
    - Attempted to make AuthLogin failures non-critical
    - Removed ReConnect subroutine from UPS_Device
    - Additional bits of logging sprinkled everywhere
    - Tried implementing Connection event for WinNUT to prevent hanging main thread, needs work
    - No longer attempt to connect immediatly at start up
    - Breakout UPS connection login into a seperate subroutine
    - Tweak disconnection subroutine
    - Reconnect menu now disconnects and connects again
    - Uncomment part of prefs_changed, now disconnect and connect UPS again.
    gbakeman committed Aug 2, 2022
    Configuration menu
    Copy the full SHA
    eae2a4d View commit details
    Browse the repository at this point in the history

Commits on Aug 4, 2022

  1. - Moving _Socket and _Parameter variables into their proper classes f…

    …or proper OOP
    
    - Disabled auto-connecting to UPS on first start since it locks the GUI thread on a slow connection
    - Cleaned up UPS_Connect subroutine for readability, improved log messages, and add a handler for lost_connection events
    - Cleaned up UPSDisconnect function: Handlers removed, modified to be reactive in the UI rather than controlling the backend
    - Disallowed changing config on the fly from external sources (a Nut_Socket object instead could be considered immutable, and must be destroyed if needing to change settings. Hopefully prevents unexpected bugs)
    - Add a dedicated disconnect subroutine to the Socket class.
    - Fixed underlying socket not being connected
    - Removed dedicated ConnectionStatus variable; not quite sure what its purpose was (might regret this...)
    - Made UPS_Device the dedicated object for handling connection monitoring logic (was competing with _Socket before)
    gbakeman committed Aug 4, 2022
    Configuration menu
    Copy the full SHA
    a5be907 View commit details
    Browse the repository at this point in the history

Commits on Aug 6, 2022

  1. Connection, watchdog and data logic changes

    - Disabled building installer in Debug mode
    - Disabled WatchDog functionality throughout program, since regular data updating acts as a watchdog in and of its self.
    - Modified Nut_Exception to carry the Nut_Exception_Value as a property
    - Slightly reduced some Logging spam, and added a whole lot more.
    
    Socket:
    - Reorganized some functions/subroutines
    - Removed some fatal exceptions when a bad authentication occurs, since basic operations can still occur.
    - Removed exception handling from Query_Data so that exceptions are handled further up the stack.
    
    UPS_Device:
    - Connection events provide the UPS_Device as sender
    - Data polling is now handled inside the class rather than in the Form, and the Form must access the data from the UPS_Device object rather than getting its own copy.
    - Added Disconnect subroutine to handle shutting down a connection, from the UPS_Device.
    - Added subroutine to handle NUT exceptions thrown from the socket. Not sure what to do with these yet.
    
    WinNUT:
    - Relocated data updating responsibility to UPS_Device
    - Any attempts to disconnect now go through the UPS_Device
    - Created a new subroutine UPSReady that fires when the UPS indicated it's ready to start receiving data.
    gbakeman committed Aug 6, 2022
    Configuration menu
    Copy the full SHA
    645e06b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    fcef9b5 View commit details
    Browse the repository at this point in the history
  3. Version 2.2.8253

    Updating changelog and preparing pre-release upload
    gbakeman committed Aug 6, 2022
    Configuration menu
    Copy the full SHA
    8bfb0dc View commit details
    Browse the repository at this point in the history