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 ...@@ -419,8 +419,8 @@ namespace AutoTx
// all parameters within valid ranges, so set the state to "Running": // all parameters within valid ranges, so set the state to "Running":
if (string.IsNullOrEmpty(limitReason)) { if (string.IsNullOrEmpty(limitReason)) {
_serviceSuspended = false; _serviceSuspended = false;
if (!string.IsNullOrEmpty(_lastLimitReason)) { if (!string.IsNullOrEmpty(_status.LimitReason)) {
_lastLimitReason = ""; // reset to force a message on next service suspend _status.LimitReason = ""; // reset to force a message on next service suspend
writeLog("Service resuming operation (all parameters in valid ranges)."); writeLog("Service resuming operation (all parameters in valid ranges).");
} }
return; return;
...@@ -429,8 +429,8 @@ namespace AutoTx ...@@ -429,8 +429,8 @@ namespace AutoTx
// set state to "Running" if no-one is logged on: // set state to "Running" if no-one is logged on:
if (NoUserIsLoggedOn()) { if (NoUserIsLoggedOn()) {
_serviceSuspended = false; _serviceSuspended = false;
if (!string.IsNullOrEmpty(_lastLimitReason)) { if (!string.IsNullOrEmpty(_status.LimitReason)) {
_lastLimitReason = ""; // reset to force a message on next service suspend _status.LimitReason = ""; // reset to force a message on next service suspend
writeLog("Service resuming operation (no user logged on)."); writeLog("Service resuming operation (no user logged on).");
} }
return; return;
...@@ -438,10 +438,10 @@ namespace AutoTx ...@@ -438,10 +438,10 @@ namespace AutoTx
// by reaching this point we know the service should be suspended: // by reaching this point we know the service should be suspended:
_serviceSuspended = true; _serviceSuspended = true;
if (limitReason == _lastLimitReason) if (limitReason == _status.LimitReason)
return; return;
writeLog("Service suspended due to limitiations [" + limitReason + "]."); writeLog("Service suspended due to limitiations [" + limitReason + "].");
_lastLimitReason = limitReason; _status.LimitReason = limitReason;
} }
/// <summary> /// <summary>
......
...@@ -9,7 +9,6 @@ namespace AutoTx ...@@ -9,7 +9,6 @@ namespace AutoTx
{ {
#region global variables #region global variables
private string _lastLimitReason; // TODO: this should be part of _status!
private bool _serviceSuspended; // TODO: this should be part of _status! private bool _serviceSuspended; // TODO: this should be part of _status!
#endregion #endregion
......
...@@ -122,6 +122,7 @@ namespace AutoTx ...@@ -122,6 +122,7 @@ namespace AutoTx
private DateTime _lastStorageNotification; private DateTime _lastStorageNotification;
private DateTime _lastAdminNotification; private DateTime _lastAdminNotification;
private string _limitReason;
string _currentTransferSrc; string _currentTransferSrc;
string _currentTargetTmp; string _currentTargetTmp;
...@@ -154,6 +155,15 @@ namespace AutoTx ...@@ -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 { public string CurrentTransferSrc {
get { return _currentTransferSrc; } get { return _currentTransferSrc; }
set { 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