Update media scan GUI block times via events.

This commit is contained in:
2019-04-21 01:42:38 +01:00
parent d31bd8117f
commit a800ddb0ab
7 changed files with 32 additions and 8 deletions

View File

@@ -104,9 +104,9 @@ namespace DiscImageChef.Core
public delegate void ErrorMessageHandler(string text);
/// <summary>
/// Updates lists of time taken on scanning the specified number of blocks
/// Updates lists of time taken on scanning the specified number of blocks
/// </summary>
/// <param name="time">Time in milliseconds</param>
/// <param name="blocks">Number of blocks scanned</param>
public delegate void ScanTime(double time, uint blocks);
public delegate void ScanTimeHandler(double time, uint blocks);
}

View File

@@ -149,6 +149,7 @@ namespace DiscImageChef.Core.Devices.Scanning
else if(duration >= 3) results.B += blocksToRead;
else results.A += blocksToRead;
ScanTime?.Invoke(duration, blocksToRead);
mhddLog.Write(i, duration);
ibgLog.Write(i, currentSpeed * 1024);
}
@@ -243,6 +244,7 @@ namespace DiscImageChef.Core.Devices.Scanning
else if(duration >= 3) results.B += blocksToRead;
else results.A += blocksToRead;
ScanTime?.Invoke(duration, blocksToRead);
mhddLog.Write(currentBlock, duration);
ibgLog.Write(currentBlock, currentSpeed * 1024);
}

View File

@@ -57,10 +57,6 @@ namespace DiscImageChef.Core.Devices.Scanning
/// </summary>
public event UpdateStatusHandler UpdateStatus;
/// <summary>
/// Event raised to report a non-fatal error
/// </summary>
public event ErrorMessageHandler ErrorMessage;
/// <summary>
/// Event raised to report a fatal error that stops the dumping operation and should call user's attention
/// </summary>
public event ErrorMessageHandler StoppingErrorMessage;
@@ -72,5 +68,6 @@ namespace DiscImageChef.Core.Devices.Scanning
/// Event raised to update the status of an undeterminate progress bar
/// </summary>
public event PulseProgressHandler PulseProgress;
public event ScanTimeHandler ScanTime;
}
}

View File

@@ -317,6 +317,7 @@ namespace DiscImageChef.Core.Devices.Scanning
else if(cmdDuration >= 3) results.B += blocksToRead;
else results.A += blocksToRead;
ScanTime?.Invoke(cmdDuration, blocksToRead);
mhddLog.Write(i, cmdDuration);
ibgLog.Write(i, currentSpeed * 1024);
}
@@ -409,6 +410,7 @@ namespace DiscImageChef.Core.Devices.Scanning
else if(cmdDuration >= 3) results.B += blocksToRead;
else results.A += blocksToRead;
ScanTime?.Invoke(cmdDuration, blocksToRead);
mhddLog.Write(i, cmdDuration);
ibgLog.Write(i, currentSpeed * 1024);
}

View File

@@ -180,6 +180,7 @@ namespace DiscImageChef.Core.Devices.Scanning
else if(duration >= 3) results.B += blocksToRead;
else results.A += blocksToRead;
ScanTime?.Invoke(duration, blocksToRead);
mhddLog.Write(i, duration);
ibgLog.Write(i, currentSpeed * 1024);
}