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

Rename FilecopyFinished to TransferInProgress and invert boolean.

parent ef210f24
No related branches found
No related tags found
No related merge requests found
...@@ -256,7 +256,7 @@ namespace AutoTx ...@@ -256,7 +256,7 @@ namespace AutoTx
writeLogDebug("------ Loaded status flags ------"); writeLogDebug("------ Loaded status flags ------");
writeLogDebug("CurrentTransferSrc: " + _status.CurrentTransferSrc); writeLogDebug("CurrentTransferSrc: " + _status.CurrentTransferSrc);
writeLogDebug("CurrentTargetTmp: " + _status.CurrentTargetTmp); writeLogDebug("CurrentTargetTmp: " + _status.CurrentTargetTmp);
writeLogDebug("FilecopyFinished: " + _status.FilecopyFinished); writeLogDebug("TransferInProgress: " + _status.TransferInProgress);
writeLogDebug("LastStorageNotification: " + writeLogDebug("LastStorageNotification: " +
_status.LastStorageNotification.ToString("yyyy-MM-dd HH:mm:ss")); _status.LastStorageNotification.ToString("yyyy-MM-dd HH:mm:ss"));
writeLogDebug("LastAdminNotification: " + writeLogDebug("LastAdminNotification: " +
...@@ -358,7 +358,7 @@ namespace AutoTx ...@@ -358,7 +358,7 @@ namespace AutoTx
catch (Exception ex) { catch (Exception ex) {
writeLog("Error terminating the RoboCopy process: " + ex.Message, true); writeLog("Error terminating the RoboCopy process: " + ex.Message, true);
} }
_status.FilecopyFinished = false; _status.TransferInProgress = true;
writeLog("Not all files were transferred - will resume upon next start"); writeLog("Not all files were transferred - will resume upon next start");
writeLogDebug("CurrentTransferSrc: " + _status.CurrentTransferSrc); writeLogDebug("CurrentTransferSrc: " + _status.CurrentTransferSrc);
// should we delete an incompletely transferred file on the target? // should we delete an incompletely transferred file on the target?
...@@ -654,7 +654,7 @@ namespace AutoTx ...@@ -654,7 +654,7 @@ namespace AutoTx
// only happens while all system parameters are within their valid ranges // only happens while all system parameters are within their valid ranges
// make sure the service is in an expected state before cleaning up: // make sure the service is in an expected state before cleaning up:
if (_transferState != TxState.Stopped || _status.FilecopyFinished != true) if (_transferState != TxState.Stopped || _status.TransferInProgress)
return; return;
if (_status.CurrentTargetTmp.Length > 0) { if (_status.CurrentTargetTmp.Length > 0) {
...@@ -684,10 +684,10 @@ namespace AutoTx ...@@ -684,10 +684,10 @@ namespace AutoTx
// CONDITIONS (a transfer has to be resumed): // CONDITIONS (a transfer has to be resumed):
// - CurrentTargetTmp has to be non-empty // - CurrentTargetTmp has to be non-empty
// - TransferState has to be "Stopped" // - TransferState has to be "Stopped"
// - FileCopyFinished must be false // - TransferInProgress must be true
if (_status.CurrentTargetTmp.Length <= 0 || if (_status.CurrentTargetTmp.Length <= 0 ||
_transferState != TxState.Stopped || _transferState != TxState.Stopped ||
_status.FilecopyFinished) _status.TransferInProgress == false)
return; return;
writeLogDebug("Resuming transfer from '" + _status.CurrentTransferSrc + writeLogDebug("Resuming transfer from '" + _status.CurrentTransferSrc +
......
...@@ -27,7 +27,7 @@ namespace AutoTx ...@@ -27,7 +27,7 @@ namespace AutoTx
CreateNewDirectory(ExpandCurrentTargetTmp(), false); CreateNewDirectory(ExpandCurrentTargetTmp(), false);
_transferState = TxState.Active; _transferState = TxState.Active;
_status.FilecopyFinished = false; _status.TransferInProgress = true;
try { try {
// events // events
_roboCommand.OnCopyProgressChanged += RsProgressChanged; _roboCommand.OnCopyProgressChanged += RsProgressChanged;
...@@ -136,7 +136,7 @@ namespace AutoTx ...@@ -136,7 +136,7 @@ namespace AutoTx
_transferState = TxState.Stopped; _transferState = TxState.Stopped;
_roboCommand.Dispose(); _roboCommand.Dispose();
_roboCommand = new RoboCommand(); _roboCommand = new RoboCommand();
_status.FilecopyFinished = true; _status.TransferInProgress = false;
} }
/// <summary> /// <summary>
......
...@@ -17,7 +17,7 @@ namespace AutoTx.XmlWrapper ...@@ -17,7 +17,7 @@ namespace AutoTx.XmlWrapper
string _currentTransferSrc; string _currentTransferSrc;
string _currentTargetTmp; string _currentTargetTmp;
bool _filecopyFinished; bool _transferInProgress;
private bool _serviceSuspended; private bool _serviceSuspended;
private bool _cleanShutdown; private bool _cleanShutdown;
...@@ -83,10 +83,10 @@ namespace AutoTx.XmlWrapper ...@@ -83,10 +83,10 @@ namespace AutoTx.XmlWrapper
} }
} }
public bool FilecopyFinished { public bool TransferInProgress {
get { return _filecopyFinished; } get { return _transferInProgress; }
set { set {
_filecopyFinished = value; _transferInProgress = value;
log("FilecopyFinished was updated (" + value + "), calling Serialize()..."); log("FilecopyFinished was updated (" + value + "), calling Serialize()...");
Serialize(); Serialize();
} }
...@@ -115,7 +115,7 @@ namespace AutoTx.XmlWrapper ...@@ -115,7 +115,7 @@ namespace AutoTx.XmlWrapper
public ServiceStatus() { public ServiceStatus() {
_currentTransferSrc = ""; _currentTransferSrc = "";
_currentTargetTmp = ""; _currentTargetTmp = "";
_filecopyFinished = true; _transferInProgress = false;
} }
public void Serialize() { public void Serialize() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment