Draw a speed chart on media scan in GUI.

This commit is contained in:
2019-04-22 01:09:06 +01:00
parent 8ab5851570
commit 3e98e8ffda
7 changed files with 121 additions and 7 deletions

View File

@@ -117,7 +117,7 @@ namespace DiscImageChef.Core.Devices.Scanning
{
UpdateStatus?.Invoke($"Reading {blocksToRead} sectors at a time.");
InitBlockMap?.Invoke(results.Blocks, blockSize, blocksToRead);
InitBlockMap?.Invoke(results.Blocks, blockSize, blocksToRead, ATA_PROFILE);
mhddLog = new MhddLog(mhddLogPath, dev, results.Blocks, blockSize, blocksToRead);
ibgLog = new IbgLog(ibgLogPath, ATA_PROFILE);
@@ -151,12 +151,14 @@ namespace DiscImageChef.Core.Devices.Scanning
else results.A += blocksToRead;
ScanTime?.Invoke(i, duration);
ScanSpeed?.Invoke(i, currentSpeed * 1024);
mhddLog.Write(i, duration);
ibgLog.Write(i, currentSpeed * 1024);
}
else
{
ScanUnreadable?.Invoke(i);
ScanSpeed?.Invoke(i, 0);
results.Errored += blocksToRead;
for(ulong b = i; b < i + blocksToRead; b++) results.UnreadableSectors.Add(b);
@@ -208,7 +210,7 @@ namespace DiscImageChef.Core.Devices.Scanning
}
else
{
InitBlockMap?.Invoke(results.Blocks, blockSize, blocksToRead);
InitBlockMap?.Invoke(results.Blocks, blockSize, blocksToRead, ATA_PROFILE);
mhddLog = new MhddLog(mhddLogPath, dev, results.Blocks, blockSize, blocksToRead);
ibgLog = new IbgLog(ibgLogPath, ATA_PROFILE);
@@ -248,12 +250,14 @@ namespace DiscImageChef.Core.Devices.Scanning
else results.A += blocksToRead;
ScanTime?.Invoke(currentBlock, duration);
ScanSpeed?.Invoke(currentBlock, currentSpeed * 1024);
mhddLog.Write(currentBlock, duration);
ibgLog.Write(currentBlock, currentSpeed * 1024);
}
else
{
ScanUnreadable?.Invoke(currentBlock);
ScanSpeed?.Invoke(currentBlock, 0);
results.Errored += blocksToRead;
results.UnreadableSectors.Add(currentBlock);
mhddLog.Write(currentBlock, duration < 500 ? 65535 : duration);

View File

@@ -71,5 +71,6 @@ namespace DiscImageChef.Core.Devices.Scanning
public event ScanTimeHandler ScanTime;
public event ScanUnreadableHandler ScanUnreadable;
public event InitBlockMapHandler InitBlockMap;
public event ScanSpeedHandler ScanSpeed;
}
}

View File

@@ -278,7 +278,7 @@ namespace DiscImageChef.Core.Devices.Scanning
UpdateStatus?.Invoke($"Reading {blocksToRead} sectors at a time.");
InitBlockMap?.Invoke(results.Blocks, blockSize, blocksToRead);
InitBlockMap?.Invoke(results.Blocks, blockSize, blocksToRead, currentProfile);
mhddLog = new MhddLog(mhddLogPath, dev, results.Blocks, blockSize, blocksToRead);
ibgLog = new IbgLog(ibgLogPath, currentProfile);
DateTime timeSpeedStart = DateTime.UtcNow;
@@ -319,6 +319,7 @@ namespace DiscImageChef.Core.Devices.Scanning
else results.A += blocksToRead;
ScanTime?.Invoke(i, cmdDuration);
ScanSpeed?.Invoke(i, currentSpeed * 1024);
mhddLog.Write(i, cmdDuration);
ibgLog.Write(i, currentSpeed * 1024);
}
@@ -347,6 +348,7 @@ namespace DiscImageChef.Core.Devices.Scanning
else
{
ScanUnreadable?.Invoke(i);
ScanSpeed?.Invoke(i, 0);
results.Errored += blocksToRead;
for(ulong b = i; b < i + blocksToRead; b++) results.UnreadableSectors.Add(b);
@@ -380,7 +382,7 @@ namespace DiscImageChef.Core.Devices.Scanning
UpdateStatus?.Invoke($"Reading {blocksToRead} sectors at a time.");
InitBlockMap?.Invoke(results.Blocks, blockSize, blocksToRead);
InitBlockMap?.Invoke(results.Blocks, blockSize, blocksToRead, currentProfile);
mhddLog = new MhddLog(mhddLogPath, dev, results.Blocks, blockSize, blocksToRead);
ibgLog = new IbgLog(ibgLogPath, currentProfile);
DateTime timeSpeedStart = DateTime.UtcNow;
@@ -414,6 +416,7 @@ namespace DiscImageChef.Core.Devices.Scanning
else results.A += blocksToRead;
ScanTime?.Invoke(i, cmdDuration);
ScanSpeed?.Invoke(i, currentSpeed * 1024);
mhddLog.Write(i, cmdDuration);
ibgLog.Write(i, currentSpeed * 1024);
}
@@ -421,6 +424,7 @@ namespace DiscImageChef.Core.Devices.Scanning
else
{
ScanUnreadable?.Invoke(i);
ScanSpeed?.Invoke(i, 0);
results.Errored += blocksToRead;
for(ulong b = i; b < i + blocksToRead; b++) results.UnreadableSectors.Add(b);

View File

@@ -147,7 +147,7 @@ namespace DiscImageChef.Core.Devices.Scanning
UpdateStatus?.Invoke($"Reading {blocksToRead} sectors at a time.");
InitBlockMap?.Invoke(results.Blocks, blockSize, blocksToRead);
InitBlockMap?.Invoke(results.Blocks, blockSize, blocksToRead, SD_PROFILE);
MhddLog mhddLog = new MhddLog(mhddLogPath, dev, results.Blocks, blockSize, blocksToRead);
IbgLog ibgLog = new IbgLog(ibgLogPath, SD_PROFILE);
@@ -182,12 +182,14 @@ namespace DiscImageChef.Core.Devices.Scanning
else results.A += blocksToRead;
ScanTime?.Invoke(i, duration);
ScanSpeed?.Invoke(i, currentSpeed * 1024);
mhddLog.Write(i, duration);
ibgLog.Write(i, currentSpeed * 1024);
}
else
{
ScanUnreadable?.Invoke(i);
ScanSpeed?.Invoke(i, 0);
results.Errored += blocksToRead;
for(ulong b = i; b < i + blocksToRead; b++) results.UnreadableSectors.Add(b);