-
Notifications
You must be signed in to change notification settings - Fork 28
Re-activate stop actions system and status updates overhaul #36
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Gave it the FlagsAttribute, to indicate that multiple enums can be used together (as flags) - Removed manual value assignments in favor of compiler assignments - Added default None value
UPS_Status property is now a UPS_States type.
- Removed Shutdown_Condition and Stop_Shutdown events in favor of one StatusesChanged event - Rewrote the status updating portion of Retrieve_UPS_Datas to try and make it more efficient, and allow the client to handle changes in status. - Moved handling of status changes into WinNUT.vb, and reactivated disabled stop system.
Closed
Modify the logic for handling a UPS status update which will prevent the None status from always showing up. Also log the program version on startup.
Also updating how notification messages determine if the UPS is on line or not.
Relocated it to a regularly-called subroutine to shutdown conditions are always being checked while on battery.
Fix NRE error on initialization, and cleanup code.
- NutSocket should not try to gracefully disconnect if it isn't already connected - Also made NutSocket less chatty. Upper-level classes handle that. - Updated ConnectionError event in UPS to include the UPS object. - Propagated connection handling changes to WinNUT.vb - Removed some commented out code from the Globals file.
- Not sure why we're making a Windows API call for power state change requests when the call already exists in the Windows.Forms class. Using that instead (works for me (tm)) - Adding some additional log messages as well
Ran into a situation where my UPS was reporting DATA-STALE errors for all variables. I was able to cleanup code a bit to prevent crashes, but this still doesn't communicate the error to the user, and worse still substitutes default values when it shouldn't be. - Cleanup GetUPSVar and fix the DATA-STALE handling code so it runs properly. - Requesting ups.status variable defaults to "None" now.
Apparently, Windows is not very consistent with reporting PowerModeChanged events so we need to account for that. Suspend code now runs in the Shutdown action to keep WinNUT in a more consistent state between power mode changes.
WinNUT GUI shouldn't be making decisions about connection logic based on errors, since these errors can arise during reconnect attempts. Also make another attempt at useful debug output on PowerModeChangedEvent.
It appears that if WinNUT resumes operation from a suspended state and the computer's networking is not prepared for a connection, then WinNUT will only try reconnecting once and hard-fail without launching a reconnection timer. Connect_UPS has been modified so that it will launch the reconnection timer if required by the caller. - Reconnection interval is now 5 seconds regardless of compiler constants
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It looks like the stop action system was disabled during the client library changes. I've reactivated it.
I've also redone how UPS statuses are updated and processed, in the hopes of making program execution more efficient and bug-Closes #27