Skip to content
Snippets Groups Projects
Commit b55ef5c2 authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Make LimitReason part of the status.

parent 81596e45
No related branches found
No related tags found
No related merge requests found
......@@ -419,8 +419,8 @@ namespace AutoTx
// all parameters within valid ranges, so set the state to "Running":
if (string.IsNullOrEmpty(limitReason)) {
_serviceSuspended = false;
if (!string.IsNullOrEmpty(_lastLimitReason)) {
_lastLimitReason = ""; // reset to force a message on next service suspend
if (!string.IsNullOrEmpty(_status.LimitReason)) {
_status.LimitReason = ""; // reset to force a message on next service suspend
writeLog("Service resuming operation (all parameters in valid ranges).");
}
return;
......@@ -429,8 +429,8 @@ namespace AutoTx
// set state to "Running" if no-one is logged on:
if (NoUserIsLoggedOn()) {
_serviceSuspended = false;
if (!string.IsNullOrEmpty(_lastLimitReason)) {
_lastLimitReason = ""; // reset to force a message on next service suspend
if (!string.IsNullOrEmpty(_status.LimitReason)) {
_status.LimitReason = ""; // reset to force a message on next service suspend
writeLog("Service resuming operation (no user logged on).");
}
return;
......@@ -438,10 +438,10 @@ namespace AutoTx
// by reaching this point we know the service should be suspended:
_serviceSuspended = true;
if (limitReason == _lastLimitReason)
if (limitReason == _status.LimitReason)
return;
writeLog("Service suspended due to limitiations [" + limitReason + "].");
_lastLimitReason = limitReason;
_status.LimitReason = limitReason;
}
/// <summary>
......
......@@ -9,7 +9,6 @@ namespace AutoTx
{
#region global variables
private string _lastLimitReason; // TODO: this should be part of _status!
private bool _serviceSuspended; // TODO: this should be part of _status!
#endregion
......
......@@ -122,6 +122,7 @@ namespace AutoTx
private DateTime _lastStorageNotification;
private DateTime _lastAdminNotification;
private string _limitReason;
string _currentTransferSrc;
string _currentTargetTmp;
......@@ -154,6 +155,15 @@ namespace AutoTx
}
}
public string LimitReason {
get { return _limitReason; }
set {
_limitReason = value;
log("LimitReason was updated (" + value + "), calling Serialize()...");
Serialize();
}
}
public string CurrentTransferSrc {
get { return _currentTransferSrc; }
set {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment