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:
@@ -117,6 +117,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, ATA_PROFILE);
|
||||
|
||||
@@ -149,13 +150,13 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
else if(duration >= 3) results.B += blocksToRead;
|
||||
else results.A += blocksToRead;
|
||||
|
||||
ScanTime?.Invoke(duration, blocksToRead);
|
||||
ScanTime?.Invoke(i, duration);
|
||||
mhddLog.Write(i, duration);
|
||||
ibgLog.Write(i, currentSpeed * 1024);
|
||||
}
|
||||
else
|
||||
{
|
||||
ScanUnreadable?.Invoke(blocksToRead);
|
||||
ScanUnreadable?.Invoke(i);
|
||||
results.Errored += blocksToRead;
|
||||
for(ulong b = i; b < i + blocksToRead; b++) results.UnreadableSectors.Add(b);
|
||||
|
||||
@@ -207,6 +208,7 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
}
|
||||
else
|
||||
{
|
||||
InitBlockMap?.Invoke(results.Blocks, blockSize, blocksToRead);
|
||||
mhddLog = new MhddLog(mhddLogPath, dev, results.Blocks, blockSize, blocksToRead);
|
||||
ibgLog = new IbgLog(ibgLogPath, ATA_PROFILE);
|
||||
|
||||
@@ -245,13 +247,13 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
else if(duration >= 3) results.B += blocksToRead;
|
||||
else results.A += blocksToRead;
|
||||
|
||||
ScanTime?.Invoke(duration, blocksToRead);
|
||||
ScanTime?.Invoke(currentBlock, duration);
|
||||
mhddLog.Write(currentBlock, duration);
|
||||
ibgLog.Write(currentBlock, currentSpeed * 1024);
|
||||
}
|
||||
else
|
||||
{
|
||||
ScanUnreadable?.Invoke(blocksToRead);
|
||||
ScanUnreadable?.Invoke(currentBlock);
|
||||
results.Errored += blocksToRead;
|
||||
results.UnreadableSectors.Add(currentBlock);
|
||||
mhddLog.Write(currentBlock, duration < 500 ? 65535 : duration);
|
||||
|
||||
@@ -70,5 +70,6 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
public event PulseProgressHandler PulseProgress;
|
||||
public event ScanTimeHandler ScanTime;
|
||||
public event ScanUnreadableHandler ScanUnreadable;
|
||||
public event InitBlockMapHandler InitBlockMap;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -147,6 +147,7 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
|
||||
UpdateStatus?.Invoke($"Reading {blocksToRead} sectors at a time.");
|
||||
|
||||
InitBlockMap?.Invoke(results.Blocks, blockSize, blocksToRead);
|
||||
MhddLog mhddLog = new MhddLog(mhddLogPath, dev, results.Blocks, blockSize, blocksToRead);
|
||||
IbgLog ibgLog = new IbgLog(ibgLogPath, SD_PROFILE);
|
||||
|
||||
@@ -180,13 +181,13 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
else if(duration >= 3) results.B += blocksToRead;
|
||||
else results.A += blocksToRead;
|
||||
|
||||
ScanTime?.Invoke(duration, blocksToRead);
|
||||
ScanTime?.Invoke(i, duration);
|
||||
mhddLog.Write(i, duration);
|
||||
ibgLog.Write(i, currentSpeed * 1024);
|
||||
}
|
||||
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