mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Use a block map in media scan in the GUI.
This commit is contained in:
@@ -278,6 +278,7 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
|
||||
UpdateStatus?.Invoke($"Reading {blocksToRead} sectors at a time.");
|
||||
|
||||
InitBlockMap?.Invoke(results.Blocks, blockSize, blocksToRead);
|
||||
mhddLog = new MhddLog(mhddLogPath, dev, results.Blocks, blockSize, blocksToRead);
|
||||
ibgLog = new IbgLog(ibgLogPath, currentProfile);
|
||||
DateTime timeSpeedStart = DateTime.UtcNow;
|
||||
@@ -317,7 +318,7 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
else if(cmdDuration >= 3) results.B += blocksToRead;
|
||||
else results.A += blocksToRead;
|
||||
|
||||
ScanTime?.Invoke(cmdDuration, blocksToRead);
|
||||
ScanTime?.Invoke(i, cmdDuration);
|
||||
mhddLog.Write(i, cmdDuration);
|
||||
ibgLog.Write(i, currentSpeed * 1024);
|
||||
}
|
||||
@@ -345,7 +346,7 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
}
|
||||
else
|
||||
{
|
||||
ScanUnreadable?.Invoke(blocksToRead);
|
||||
ScanUnreadable?.Invoke(i);
|
||||
results.Errored += blocksToRead;
|
||||
for(ulong b = i; b < i + blocksToRead; b++) results.UnreadableSectors.Add(b);
|
||||
|
||||
@@ -379,6 +380,7 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
|
||||
UpdateStatus?.Invoke($"Reading {blocksToRead} sectors at a time.");
|
||||
|
||||
InitBlockMap?.Invoke(results.Blocks, blockSize, blocksToRead);
|
||||
mhddLog = new MhddLog(mhddLogPath, dev, results.Blocks, blockSize, blocksToRead);
|
||||
ibgLog = new IbgLog(ibgLogPath, currentProfile);
|
||||
DateTime timeSpeedStart = DateTime.UtcNow;
|
||||
@@ -411,14 +413,14 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
else if(cmdDuration >= 3) results.B += blocksToRead;
|
||||
else results.A += blocksToRead;
|
||||
|
||||
ScanTime?.Invoke(cmdDuration, blocksToRead);
|
||||
ScanTime?.Invoke(i, cmdDuration);
|
||||
mhddLog.Write(i, cmdDuration);
|
||||
ibgLog.Write(i, currentSpeed * 1024);
|
||||
}
|
||||
// TODO: Separate errors on kind of errors.
|
||||
else
|
||||
{
|
||||
ScanUnreadable?.Invoke(blocksToRead);
|
||||
ScanUnreadable?.Invoke(i);
|
||||
results.Errored += blocksToRead;
|
||||
for(ulong b = i; b < i + blocksToRead; b++) results.UnreadableSectors.Add(b);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user