mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Use a more precise mechanism to measure elapsed times in operations.
This commit is contained in:
@@ -96,17 +96,14 @@ public partial class Dump
|
||||
|
||||
if(ataIdNullable != null)
|
||||
{
|
||||
Identify.IdentifyDevice ataId = ataIdNullable.Value;
|
||||
byte[] ataIdentify = cmdBuf;
|
||||
Identify.IdentifyDevice ataId = ataIdNullable.Value;
|
||||
byte[] ataIdentify = cmdBuf;
|
||||
double totalDuration = 0;
|
||||
double currentSpeed = 0;
|
||||
double maxSpeed = double.MinValue;
|
||||
double minSpeed = double.MaxValue;
|
||||
cmdBuf = Array.Empty<byte>();
|
||||
|
||||
DateTime start;
|
||||
DateTime end;
|
||||
double totalDuration = 0;
|
||||
double currentSpeed = 0;
|
||||
double maxSpeed = double.MinValue;
|
||||
double minSpeed = double.MaxValue;
|
||||
|
||||
// Initialize reader
|
||||
UpdateStatus?.Invoke(Localization.Core.Initializing_reader);
|
||||
_dumpLog.WriteLine(Localization.Core.Initializing_reader);
|
||||
@@ -298,8 +295,8 @@ public partial class Dump
|
||||
|
||||
bool newTrim = false;
|
||||
|
||||
start = DateTime.UtcNow;
|
||||
DateTime timeSpeedStart = DateTime.UtcNow;
|
||||
_dumpStopwatch.Restart();
|
||||
_speedStopwatch.Restart();
|
||||
ulong sectorSpeedStart = 0;
|
||||
InitProgress?.Invoke();
|
||||
|
||||
@@ -331,13 +328,13 @@ public partial class Dump
|
||||
|
||||
bool error = ataReader.ReadBlocks(out cmdBuf, i, blocksToRead, out duration, out _, out _);
|
||||
|
||||
_writeStopwatch.Restart();
|
||||
if(!error)
|
||||
{
|
||||
mhddLog.Write(i, duration, blocksToRead);
|
||||
ibgLog.Write(i, currentSpeed * 1024);
|
||||
DateTime writeStart = DateTime.Now;
|
||||
outputFormat.WriteSectors(cmdBuf, i, blocksToRead);
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
extents.Add(i, blocksToRead, true);
|
||||
_mediaGraph?.PaintSectorsGood(i, blocksToRead);
|
||||
}
|
||||
@@ -352,38 +349,41 @@ public partial class Dump
|
||||
mhddLog.Write(i, duration < 500 ? 65535 : duration, _skip);
|
||||
|
||||
ibgLog.Write(i, 0);
|
||||
DateTime writeStart = DateTime.Now;
|
||||
outputFormat.WriteSectors(new byte[blockSize * _skip], i, _skip);
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
_dumpLog.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
||||
i += _skip - blocksToRead;
|
||||
newTrim = true;
|
||||
}
|
||||
|
||||
_writeStopwatch.Stop();
|
||||
|
||||
sectorSpeedStart += blocksToRead;
|
||||
_resume.NextBlock = i + blocksToRead;
|
||||
|
||||
double elapsed = (DateTime.UtcNow - timeSpeedStart).TotalSeconds;
|
||||
double elapsed = _speedStopwatch.Elapsed.TotalSeconds;
|
||||
|
||||
if(elapsed <= 0)
|
||||
continue;
|
||||
|
||||
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed);
|
||||
sectorSpeedStart = 0;
|
||||
timeSpeedStart = DateTime.UtcNow;
|
||||
_speedStopwatch.Restart();
|
||||
}
|
||||
|
||||
_speedStopwatch.Stop();
|
||||
|
||||
_resume.BadBlocks = _resume.BadBlocks.Distinct().ToList();
|
||||
|
||||
end = DateTime.Now;
|
||||
_dumpStopwatch.Stop();
|
||||
EndProgress?.Invoke();
|
||||
mhddLog.Close();
|
||||
|
||||
ibgLog.Close(_dev, blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
|
||||
ibgLog.Close(_dev, blocks, blockSize, _dumpStopwatch.Elapsed.TotalSeconds, currentSpeed * 1024,
|
||||
blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000), _devicePath);
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Dump_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_dump_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
@@ -394,7 +394,7 @@ public partial class Dump
|
||||
Per(imageWriteDuration.Seconds())));
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Dump_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Average_dump_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).Per(totalDuration.Milliseconds()).
|
||||
@@ -410,7 +410,7 @@ public partial class Dump
|
||||
_trim &&
|
||||
newTrim)
|
||||
{
|
||||
start = DateTime.UtcNow;
|
||||
_trimStopwatch.Restart();
|
||||
UpdateStatus?.Invoke(Localization.Core.Trimming_skipped_sectors);
|
||||
_dumpLog.WriteLine(Localization.Core.Trimming_skipped_sectors);
|
||||
|
||||
@@ -445,13 +445,13 @@ public partial class Dump
|
||||
}
|
||||
|
||||
EndProgress?.Invoke();
|
||||
end = DateTime.UtcNow;
|
||||
_trimStopwatch.Stop();
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Trimming_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Trimming_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
}
|
||||
#endregion Trimming
|
||||
|
||||
@@ -563,8 +563,8 @@ public partial class Dump
|
||||
|
||||
ulong currentBlock = 0;
|
||||
blocks = (ulong)(cylinders * heads * sectors);
|
||||
start = DateTime.UtcNow;
|
||||
DateTime timeSpeedStart = DateTime.UtcNow;
|
||||
_dumpStopwatch.Restart();
|
||||
_speedStopwatch.Restart();
|
||||
ulong sectorSpeedStart = 0;
|
||||
InitProgress?.Invoke();
|
||||
|
||||
@@ -602,16 +602,17 @@ public partial class Dump
|
||||
|
||||
totalDuration += duration;
|
||||
|
||||
_writeStopwatch.Restart();
|
||||
|
||||
if(!error || recoveredError)
|
||||
{
|
||||
mhddLog.Write(currentBlock, duration);
|
||||
ibgLog.Write(currentBlock, currentSpeed * 1024);
|
||||
DateTime writeStart = DateTime.Now;
|
||||
|
||||
outputFormat.WriteSector(cmdBuf,
|
||||
(ulong)((((cy * heads) + hd) * sectors) + (sc - 1)));
|
||||
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
extents.Add(currentBlock);
|
||||
_mediaGraph?.PaintSectorGood((ulong)((((cy * heads) + hd) * sectors) + (sc - 1)));
|
||||
|
||||
@@ -624,40 +625,42 @@ public partial class Dump
|
||||
mhddLog.Write(currentBlock, duration < 500 ? 65535 : duration);
|
||||
|
||||
ibgLog.Write(currentBlock, 0);
|
||||
DateTime writeStart = DateTime.Now;
|
||||
|
||||
outputFormat.WriteSector(new byte[blockSize],
|
||||
(ulong)((((cy * heads) + hd) * sectors) + (sc - 1)));
|
||||
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
}
|
||||
|
||||
_writeStopwatch.Stop();
|
||||
|
||||
sectorSpeedStart++;
|
||||
currentBlock++;
|
||||
|
||||
double elapsed = (DateTime.UtcNow - timeSpeedStart).TotalSeconds;
|
||||
double elapsed = _speedStopwatch.Elapsed.TotalSeconds;
|
||||
|
||||
if(elapsed <= 0)
|
||||
continue;
|
||||
|
||||
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed);
|
||||
sectorSpeedStart = 0;
|
||||
timeSpeedStart = DateTime.UtcNow;
|
||||
_speedStopwatch.Restart();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_speedStopwatch.Stop();
|
||||
_resume.BadBlocks = _resume.BadBlocks.Distinct().ToList();
|
||||
|
||||
end = DateTime.Now;
|
||||
_dumpStopwatch.Stop();
|
||||
EndProgress?.Invoke();
|
||||
mhddLog.Close();
|
||||
|
||||
ibgLog.Close(_dev, blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
|
||||
ibgLog.Close(_dev, blocks, blockSize, _dumpStopwatch.Elapsed.TotalSeconds, currentSpeed * 1024,
|
||||
blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000), _devicePath);
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Dump_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_dump_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
@@ -668,7 +671,7 @@ public partial class Dump
|
||||
Per(imageWriteDuration.Seconds())));
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Dump_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Average_dump_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).Per(totalDuration.Milliseconds()).
|
||||
@@ -700,15 +703,15 @@ public partial class Dump
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Closing_output_file);
|
||||
UpdateStatus?.Invoke(Localization.Core.Closing_output_file);
|
||||
DateTime closeStart = DateTime.Now;
|
||||
_imageCloseStopwatch.Restart();
|
||||
outputFormat.Close();
|
||||
DateTime closeEnd = DateTime.Now;
|
||||
_imageCloseStopwatch.Stop();
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Closed_in_0,
|
||||
(closeEnd - closeStart).Humanize(minUnit: TimeUnit.Second)));
|
||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Closed_in_0,
|
||||
(closeEnd - closeStart).Humanize(minUnit: TimeUnit.Second));
|
||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
||||
|
||||
if(_aborted)
|
||||
{
|
||||
@@ -747,7 +750,7 @@ public partial class Dump
|
||||
return;
|
||||
}
|
||||
|
||||
DateTime chkStart = DateTime.UtcNow;
|
||||
_sidecarStopwatch.Restart();
|
||||
|
||||
_sidecarClass = new Sidecar(inputPlugin, _outputPath, filter.Id, _encoding);
|
||||
|
||||
@@ -856,19 +859,20 @@ public partial class Dump
|
||||
}
|
||||
};
|
||||
|
||||
DateTime chkEnd = DateTime.UtcNow;
|
||||
_sidecarStopwatch.Stop();
|
||||
|
||||
totalChkDuration = (chkEnd - chkStart).TotalMilliseconds;
|
||||
totalChkDuration = _sidecarStopwatch.Elapsed.TotalMilliseconds;
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Sidecar_created_in_0,
|
||||
(chkEnd - chkStart).Humanize(minUnit: TimeUnit.Second)));
|
||||
_sidecarStopwatch.Elapsed.
|
||||
Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_checksum_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
Per(totalChkDuration.Milliseconds())));
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Sidecar_created_in_0,
|
||||
(chkEnd - chkStart).Humanize(minUnit: TimeUnit.Second));
|
||||
_sidecarStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Average_checksum_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
@@ -938,11 +942,11 @@ public partial class Dump
|
||||
|
||||
UpdateStatus?.
|
||||
Invoke(string.Format(Localization.Core.Took_a_total_of_0_1_processing_commands_2_checksumming_3_writing_4_closing,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second),
|
||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second),
|
||||
totalDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
|
||||
totalChkDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
|
||||
imageWriteDuration.Seconds().Humanize(minUnit: TimeUnit.Second),
|
||||
(closeEnd - closeStart).Humanize(minUnit: TimeUnit.Second)));
|
||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
|
||||
@@ -157,7 +157,6 @@ partial class Dump
|
||||
Dictionary<byte, int> smallestPregapLbaPerTrack)
|
||||
{
|
||||
ulong sectorSpeedStart = 0; // Used to calculate correct speed
|
||||
DateTime timeSpeedStart = DateTime.UtcNow; // Time of start for speed calculation
|
||||
bool sense; // Sense indicator
|
||||
byte[] cmdBuf; // Data buffer
|
||||
byte[] senseBuf; // Sense buffer
|
||||
@@ -247,7 +246,7 @@ partial class Dump
|
||||
mhddLog.Write(i + r, cmdDuration);
|
||||
ibgLog.Write(i + r, currentSpeed * 1024);
|
||||
extents.Add(i + r, 1, true);
|
||||
DateTime writeStart = DateTime.Now;
|
||||
_writeStopwatch.Restart();
|
||||
|
||||
if(cdiReadyReadAsAudio)
|
||||
FixOffsetData(offsetBytes, sectorSize, sectorsForOffset, supportedSubchannel,
|
||||
@@ -285,7 +284,7 @@ partial class Dump
|
||||
else
|
||||
outputOptical.WriteSectorsLong(cmdBuf, i + r, 1);
|
||||
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
|
||||
_mediaGraph?.PaintSectorGood(i + r);
|
||||
}
|
||||
@@ -305,20 +304,23 @@ partial class Dump
|
||||
break;
|
||||
}
|
||||
|
||||
_writeStopwatch.Stop();
|
||||
sectorSpeedStart += r;
|
||||
|
||||
_resume.NextBlock = i + r;
|
||||
|
||||
elapsed = (DateTime.UtcNow - timeSpeedStart).TotalSeconds;
|
||||
elapsed = _speedStopwatch.Elapsed.TotalSeconds;
|
||||
|
||||
if(elapsed <= 0)
|
||||
continue;
|
||||
|
||||
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed);
|
||||
sectorSpeedStart = 0;
|
||||
timeSpeedStart = DateTime.UtcNow;
|
||||
_speedStopwatch.Restart();
|
||||
}
|
||||
|
||||
_speedStopwatch.Restart();
|
||||
|
||||
if(!sense &&
|
||||
!_dev.Error)
|
||||
{
|
||||
@@ -329,7 +331,7 @@ partial class Dump
|
||||
mhddLog.Write(i, cmdDuration);
|
||||
ibgLog.Write(i, currentSpeed * 1024);
|
||||
extents.Add(i, blocksToRead, true);
|
||||
DateTime writeStart = DateTime.Now;
|
||||
_writeStopwatch.Restart();
|
||||
|
||||
if(supportedSubchannel != MmcSubchannel.None)
|
||||
{
|
||||
@@ -398,7 +400,7 @@ partial class Dump
|
||||
outputOptical.WriteSectorsLong(cmdBuf, i, blocksToRead);
|
||||
}
|
||||
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
|
||||
_mediaGraph?.PaintSectorsGood(i, blocksToRead);
|
||||
}
|
||||
@@ -411,20 +413,22 @@ partial class Dump
|
||||
break;
|
||||
}
|
||||
|
||||
_writeStopwatch.Stop();
|
||||
sectorSpeedStart += blocksToRead;
|
||||
|
||||
_resume.NextBlock = i + blocksToRead;
|
||||
|
||||
elapsed = (DateTime.UtcNow - timeSpeedStart).TotalSeconds;
|
||||
elapsed = _speedStopwatch.Elapsed.TotalSeconds;
|
||||
|
||||
if(elapsed <= 0)
|
||||
continue;
|
||||
|
||||
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed);
|
||||
sectorSpeedStart = 0;
|
||||
timeSpeedStart = DateTime.UtcNow;
|
||||
_speedStopwatch.Restart();
|
||||
}
|
||||
|
||||
_speedStopwatch.Stop();
|
||||
EndProgress?.Invoke();
|
||||
}
|
||||
}
|
||||
@@ -101,7 +101,6 @@ partial class Dump
|
||||
Dictionary<byte, int> smallestPregapLbaPerTrack)
|
||||
{
|
||||
ulong sectorSpeedStart = 0; // Used to calculate correct speed
|
||||
DateTime timeSpeedStart = DateTime.UtcNow; // Time of start for speed calculation
|
||||
uint blocksToRead; // How many sectors to read at once
|
||||
bool sense = true; // Sense indicator
|
||||
byte[] cmdBuf = null; // Data buffer
|
||||
@@ -129,6 +128,8 @@ partial class Dump
|
||||
|
||||
for(ulong i = _resume.NextBlock; (long)i <= lastSector; i += blocksToRead)
|
||||
{
|
||||
_speedStopwatch.Restart();
|
||||
|
||||
if(_aborted)
|
||||
{
|
||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||
@@ -422,6 +423,8 @@ partial class Dump
|
||||
!nextData &&
|
||||
sense)
|
||||
{
|
||||
_speedStopwatch.Restart();
|
||||
|
||||
for(uint r = 0; r < blocksToRead; r++)
|
||||
{
|
||||
UpdateProgress?.
|
||||
@@ -481,7 +484,7 @@ partial class Dump
|
||||
mhddLog.Write(i + r, cmdDuration);
|
||||
ibgLog.Write(i + r, currentSpeed * 1024);
|
||||
extents.Add(i + r, 1, true);
|
||||
DateTime writeStart = DateTime.Now;
|
||||
_writeStopwatch.Restart();
|
||||
|
||||
if(supportedSubchannel != MmcSubchannel.None)
|
||||
{
|
||||
@@ -559,14 +562,14 @@ partial class Dump
|
||||
|
||||
_mediaGraph?.PaintSectorGood(i + r);
|
||||
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
}
|
||||
else
|
||||
{
|
||||
_errorLog?.WriteLine(i + r, _dev.Error, _dev.LastError, senseBuf);
|
||||
|
||||
// Write empty data
|
||||
DateTime writeStart = DateTime.Now;
|
||||
_writeStopwatch.Restart();
|
||||
|
||||
if(supportedSubchannel != MmcSubchannel.None)
|
||||
{
|
||||
@@ -589,7 +592,7 @@ partial class Dump
|
||||
}
|
||||
}
|
||||
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
|
||||
_mediaGraph?.PaintSectorBad(i + r);
|
||||
|
||||
@@ -605,18 +608,20 @@ partial class Dump
|
||||
newTrim = true;
|
||||
}
|
||||
|
||||
_writeStopwatch.Stop();
|
||||
|
||||
sectorSpeedStart += r;
|
||||
|
||||
_resume.NextBlock = i + r;
|
||||
|
||||
elapsed = (DateTime.UtcNow - timeSpeedStart).TotalSeconds;
|
||||
elapsed = _speedStopwatch.Elapsed.TotalSeconds;
|
||||
|
||||
if(elapsed <= 0)
|
||||
continue;
|
||||
|
||||
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed);
|
||||
sectorSpeedStart = 0;
|
||||
timeSpeedStart = DateTime.UtcNow;
|
||||
_speedStopwatch.Restart();
|
||||
}
|
||||
|
||||
continue;
|
||||
@@ -641,7 +646,7 @@ partial class Dump
|
||||
mhddLog.Write(i, cmdDuration, blocksToRead);
|
||||
ibgLog.Write(i, currentSpeed * 1024);
|
||||
extents.Add(i, blocksToRead, true);
|
||||
DateTime writeStart = DateTime.Now;
|
||||
_writeStopwatch.Restart();
|
||||
|
||||
if(supportedSubchannel != MmcSubchannel.None)
|
||||
{
|
||||
@@ -722,7 +727,7 @@ partial class Dump
|
||||
|
||||
_mediaGraph?.PaintSectorsGood(i, blocksToRead);
|
||||
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -747,7 +752,7 @@ partial class Dump
|
||||
_skip = (uint)(blocks - i);
|
||||
|
||||
// Write empty data
|
||||
DateTime writeStart = DateTime.Now;
|
||||
_writeStopwatch.Restart();
|
||||
|
||||
if(supportedSubchannel != MmcSubchannel.None)
|
||||
{
|
||||
@@ -770,7 +775,7 @@ partial class Dump
|
||||
}
|
||||
}
|
||||
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
|
||||
for(ulong b = i; b < i + _skip; b++)
|
||||
_resume.BadBlocks.Add(b);
|
||||
@@ -784,20 +789,23 @@ partial class Dump
|
||||
newTrim = true;
|
||||
}
|
||||
|
||||
_writeStopwatch.Stop();
|
||||
|
||||
sectorSpeedStart += blocksToRead;
|
||||
|
||||
_resume.NextBlock = i + blocksToRead;
|
||||
|
||||
elapsed = (DateTime.UtcNow - timeSpeedStart).TotalSeconds;
|
||||
elapsed = _speedStopwatch.Elapsed.TotalSeconds;
|
||||
|
||||
if(elapsed <= 0)
|
||||
continue;
|
||||
|
||||
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed);
|
||||
sectorSpeedStart = 0;
|
||||
timeSpeedStart = DateTime.UtcNow;
|
||||
_speedStopwatch.Restart();
|
||||
}
|
||||
|
||||
_speedStopwatch.Stop();
|
||||
EndProgress?.Invoke();
|
||||
|
||||
_resume.BadBlocks = _resume.BadBlocks.Distinct().ToList();
|
||||
|
||||
@@ -75,9 +75,7 @@ sealed partial class Dump
|
||||
DumpHardware currentTry = null; // Current dump hardware try
|
||||
double currentSpeed = 0; // Current read speed
|
||||
int? discOffset = null; // Disc write offset
|
||||
DateTime dumpStart = DateTime.UtcNow; // Time of dump start
|
||||
DateTime end; // Time of operation end
|
||||
ExtentsULong extents = null; // Extents
|
||||
ExtentsULong extents = null; // Extents
|
||||
bool hiddenData; // Hidden track is data
|
||||
IbgLog ibgLog; // IMGBurn log
|
||||
double imageWriteDuration = 0; // Duration of image write
|
||||
@@ -99,7 +97,6 @@ sealed partial class Dump
|
||||
int sectorsForOffset = 0; // Sectors needed to fix offset
|
||||
bool sense = true; // Sense indicator
|
||||
int sessions; // Number of sessions in disc
|
||||
DateTime start; // Start of operation
|
||||
SubchannelLog subLog = null; // Subchannel log
|
||||
uint subSize = 0; // Subchannel size in bytes
|
||||
TrackSubchannelType subType = TrackSubchannelType.None; // Track subchannel type
|
||||
@@ -1167,7 +1164,7 @@ sealed partial class Dump
|
||||
}
|
||||
|
||||
// Start reading
|
||||
start = DateTime.UtcNow;
|
||||
_dumpStopwatch.Restart();
|
||||
|
||||
if(dskType == MediaType.CDIREADY || cdiWithHiddenTrack1)
|
||||
{
|
||||
@@ -1289,14 +1286,14 @@ sealed partial class Dump
|
||||
smallestPregapLbaPerTrack);
|
||||
*/
|
||||
|
||||
end = DateTime.UtcNow;
|
||||
_dumpStopwatch.Stop();
|
||||
mhddLog.Close();
|
||||
|
||||
ibgLog.Close(_dev, blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
|
||||
ibgLog.Close(_dev, blocks, blockSize, _dumpStopwatch.Elapsed.TotalSeconds, currentSpeed * 1024,
|
||||
blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000), _devicePath);
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Dump_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_dump_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
@@ -1307,7 +1304,7 @@ sealed partial class Dump
|
||||
Per(imageWriteDuration.Seconds())));
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Dump_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Average_dump_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
@@ -1439,12 +1436,12 @@ sealed partial class Dump
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Closing_output_file);
|
||||
UpdateStatus?.Invoke(Localization.Core.Closing_output_file);
|
||||
DateTime closeStart = DateTime.Now;
|
||||
_imageCloseStopwatch.Restart();
|
||||
outputOptical.Close();
|
||||
DateTime closeEnd = DateTime.Now;
|
||||
_imageCloseStopwatch.Stop();
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Closed_in_0,
|
||||
(closeEnd - closeStart).Humanize(minUnit: TimeUnit.Second)));
|
||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
subLog?.Close();
|
||||
|
||||
@@ -1461,16 +1458,16 @@ sealed partial class Dump
|
||||
WriteOpticalSidecar(blockSize, blocks, dskType, null, mediaTags, sessions, out totalChkDuration,
|
||||
discOffset);
|
||||
|
||||
end = DateTime.UtcNow;
|
||||
_dumpStopwatch.Stop();
|
||||
UpdateStatus?.Invoke("");
|
||||
|
||||
UpdateStatus?.
|
||||
Invoke(string.Format(Localization.Core.Took_a_total_of_0_1_processing_commands_2_checksumming_3_writing_4_closing,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second),
|
||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second),
|
||||
totalDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
|
||||
totalChkDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
|
||||
imageWriteDuration.Seconds().Humanize(minUnit: TimeUnit.Second),
|
||||
(closeEnd - closeStart).Humanize(minUnit: TimeUnit.Second)));
|
||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
|
||||
@@ -151,7 +151,7 @@ partial class Dump
|
||||
ibgLog.Write(i, currentSpeed * 1024);
|
||||
extents.Add(i, _maximumReadable, true);
|
||||
leadOutExtents.Remove(i);
|
||||
DateTime writeStart = DateTime.Now;
|
||||
_writeStopwatch.Restart();
|
||||
|
||||
if(supportedSubchannel != MmcSubchannel.None)
|
||||
{
|
||||
@@ -184,7 +184,7 @@ partial class Dump
|
||||
else
|
||||
outputOptical.WriteSectors(cmdBuf, i, _maximumReadable);
|
||||
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -195,7 +195,7 @@ partial class Dump
|
||||
return; // TODO: Return more cleanly
|
||||
|
||||
// Write empty data
|
||||
DateTime writeStart = DateTime.Now;
|
||||
_writeStopwatch.Restart();
|
||||
|
||||
if(supportedSubchannel != MmcSubchannel.None)
|
||||
{
|
||||
@@ -207,13 +207,14 @@ partial class Dump
|
||||
else
|
||||
outputOptical.WriteSectors(new byte[blockSize * _skip], i, 1);
|
||||
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
|
||||
mhddLog.Write(i, cmdDuration < 500 ? 65535 : cmdDuration, _skip);
|
||||
|
||||
ibgLog.Write(i, 0);
|
||||
}
|
||||
|
||||
_writeStopwatch.Stop();
|
||||
double newSpeed = (double)blockSize * _maximumReadable / 1048576 / (cmdDuration / 1000);
|
||||
|
||||
if(!double.IsInfinity(newSpeed))
|
||||
@@ -323,7 +324,7 @@ partial class Dump
|
||||
ibgLog.Write(i, currentSpeed * 1024);
|
||||
extents.Add(i, _maximumReadable, true);
|
||||
leadOutExtents.Remove(i);
|
||||
DateTime writeStart = DateTime.Now;
|
||||
_writeStopwatch.Restart();
|
||||
|
||||
if(supportedSubchannel != MmcSubchannel.None)
|
||||
{
|
||||
@@ -356,7 +357,7 @@ partial class Dump
|
||||
else
|
||||
outputOptical.WriteSectors(cmdBuf, i, _maximumReadable);
|
||||
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -367,7 +368,7 @@ partial class Dump
|
||||
return; // TODO: Return more cleanly
|
||||
|
||||
// Write empty data
|
||||
DateTime writeStart = DateTime.Now;
|
||||
_writeStopwatch.Restart();
|
||||
|
||||
if(supportedSubchannel != MmcSubchannel.None)
|
||||
{
|
||||
@@ -380,13 +381,14 @@ partial class Dump
|
||||
else
|
||||
outputOptical.WriteSectors(new byte[blockSize * _skip], i, 1);
|
||||
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
|
||||
mhddLog.Write(i, cmdDuration < 500 ? 65535 : cmdDuration);
|
||||
|
||||
ibgLog.Write(i, 0);
|
||||
}
|
||||
|
||||
_writeStopwatch.Stop();
|
||||
double newSpeed = (double)blockSize * _maximumReadable / 1048576 / (cmdDuration / 1000);
|
||||
|
||||
if(!double.IsInfinity(newSpeed))
|
||||
|
||||
@@ -65,7 +65,6 @@ partial class Dump
|
||||
bool sense; // Sense indicator
|
||||
byte[] cmdBuf; // Data buffer
|
||||
double cmdDuration; // Command execution time
|
||||
DateTime timeSpeedStart; // Time of start for speed calculation
|
||||
ulong sectorSpeedStart = 0; // Used to calculate correct speed
|
||||
bool gotFirstTrackPregap = false;
|
||||
int firstTrackPregapSectorsGood = 0;
|
||||
@@ -74,7 +73,7 @@ partial class Dump
|
||||
_dumpLog.WriteLine(Localization.Core.Reading_first_track_pregap);
|
||||
UpdateStatus?.Invoke(Localization.Core.Reading_first_track_pregap);
|
||||
InitProgress?.Invoke();
|
||||
timeSpeedStart = DateTime.UtcNow;
|
||||
_speedStopwatch.Restart();
|
||||
|
||||
for(int firstTrackPregapBlock = -150; firstTrackPregapBlock < 0 && _resume.NextBlock == 0;
|
||||
firstTrackPregapBlock++)
|
||||
@@ -115,16 +114,18 @@ partial class Dump
|
||||
|
||||
sectorSpeedStart++;
|
||||
|
||||
double elapsed = (DateTime.UtcNow - timeSpeedStart).TotalSeconds;
|
||||
double elapsed = _speedStopwatch.Elapsed.TotalSeconds;
|
||||
|
||||
if(elapsed <= 0)
|
||||
continue;
|
||||
|
||||
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed);
|
||||
sectorSpeedStart = 0;
|
||||
timeSpeedStart = DateTime.UtcNow;
|
||||
_speedStopwatch.Restart();
|
||||
}
|
||||
|
||||
_speedStopwatch.Stop();
|
||||
|
||||
if(firstTrackPregapSectorsGood > 0)
|
||||
mediaTags.Add(MediaTagType.CD_FirstTrackPregap, firstTrackPregapMs.ToArray());
|
||||
|
||||
|
||||
@@ -83,8 +83,6 @@ partial class Dump
|
||||
Dictionary<byte, string> isrcs, ref string mcn, HashSet<int> subchannelExtents,
|
||||
Dictionary<byte, int> smallestPregapLbaPerTrack)
|
||||
{
|
||||
DateTime start;
|
||||
DateTime end;
|
||||
bool sense = true; // Sense indicator
|
||||
byte[] cmdBuf = null; // Data buffer
|
||||
double cmdDuration = 0; // Command execution time
|
||||
@@ -107,10 +105,10 @@ partial class Dump
|
||||
!newTrim)
|
||||
return;
|
||||
|
||||
start = DateTime.UtcNow;
|
||||
UpdateStatus?.Invoke(Localization.Core.Trimming_skipped_sectors);
|
||||
_dumpLog.WriteLine(Localization.Core.Trimming_skipped_sectors);
|
||||
InitProgress?.Invoke();
|
||||
_trimStopwatch.Restart();
|
||||
|
||||
trimStart:
|
||||
ulong[] tmpArray = _resume.BadBlocks.ToArray();
|
||||
@@ -292,13 +290,13 @@ partial class Dump
|
||||
outputOptical.WriteSector(Sector.GetUserData(cmdBuf), badSector);
|
||||
}
|
||||
|
||||
_trimStopwatch.Stop();
|
||||
EndProgress?.Invoke();
|
||||
end = DateTime.UtcNow;
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Trimming_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Trimming_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -115,6 +115,12 @@ public partial class Dump
|
||||
bool _supportsPlextorD8;
|
||||
bool _useBufferedReads;
|
||||
static readonly TimeSpan _oneSecond = 1.Seconds();
|
||||
readonly Stopwatch _dumpStopwatch;
|
||||
readonly Stopwatch _sidecarStopwatch;
|
||||
readonly Stopwatch _speedStopwatch;
|
||||
readonly Stopwatch _trimStopwatch;
|
||||
readonly Stopwatch _writeStopwatch;
|
||||
readonly Stopwatch _imageCloseStopwatch;
|
||||
|
||||
/// <summary>Initializes dumpers</summary>
|
||||
/// <param name="doResume">Should resume?</param>
|
||||
@@ -207,6 +213,12 @@ public partial class Dump
|
||||
_ignoreCdrRunOuts = ignoreCdrRunOuts;
|
||||
_createGraph = createGraph;
|
||||
_dimensions = dimensions;
|
||||
_dumpStopwatch = new Stopwatch();
|
||||
_sidecarStopwatch = new Stopwatch();
|
||||
_speedStopwatch = new Stopwatch();
|
||||
_trimStopwatch = new Stopwatch();
|
||||
_writeStopwatch = new Stopwatch();
|
||||
_imageCloseStopwatch = new Stopwatch();
|
||||
}
|
||||
|
||||
/// <summary>Starts dumping with the established fields and autodetecting the device type</summary>
|
||||
|
||||
@@ -292,10 +292,10 @@ public partial class Dump
|
||||
if(_createGraph)
|
||||
_mediaGraph = new BlockMap((int)_dimensions, (int)_dimensions, romSectors);
|
||||
|
||||
DateTime start = DateTime.UtcNow;
|
||||
_dumpStopwatch.Restart();
|
||||
double imageWriteDuration = 0;
|
||||
|
||||
DateTime timeSpeedStart = DateTime.UtcNow;
|
||||
_speedStopwatch.Restart();
|
||||
ulong sectorSpeedStart = 0;
|
||||
InitProgress?.Invoke();
|
||||
|
||||
@@ -329,12 +329,13 @@ public partial class Dump
|
||||
|
||||
totalDuration += cmdDuration;
|
||||
|
||||
_writeStopwatch.Restart();
|
||||
|
||||
if(!sense &&
|
||||
!_dev.Error)
|
||||
{
|
||||
DateTime writeStart = DateTime.Now;
|
||||
outputBai.WriteBytes(readBuffer, 0, readBuffer.Length, out _);
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
_mediaGraph.PaintSectorsGood(i, blocksToRead);
|
||||
}
|
||||
else
|
||||
@@ -349,18 +350,22 @@ public partial class Dump
|
||||
i += _skip - blocksToRead;
|
||||
}
|
||||
|
||||
_writeStopwatch.Stop();
|
||||
|
||||
sectorSpeedStart += blocksToRead;
|
||||
|
||||
double elapsed = (DateTime.UtcNow - timeSpeedStart).TotalSeconds;
|
||||
double elapsed = _speedStopwatch.Elapsed.TotalSeconds;
|
||||
|
||||
if(elapsed <= 0)
|
||||
continue;
|
||||
|
||||
currentSpeed = sectorSpeedStart * 512 / (1048576 * elapsed);
|
||||
sectorSpeedStart = 0;
|
||||
timeSpeedStart = DateTime.UtcNow;
|
||||
_speedStopwatch.Restart();
|
||||
}
|
||||
|
||||
_speedStopwatch.Stop();
|
||||
|
||||
if(romRemaining > 0 &&
|
||||
!_aborted)
|
||||
{
|
||||
@@ -384,9 +389,10 @@ public partial class Dump
|
||||
if(!sense &&
|
||||
!_dev.Error)
|
||||
{
|
||||
DateTime writeStart = DateTime.Now;
|
||||
_writeStopwatch.Restart();
|
||||
outputBai.WriteBytes(readBuffer, 0, (int)romRemaining, out _);
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
_writeStopwatch.Stop();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -401,10 +407,10 @@ public partial class Dump
|
||||
}
|
||||
}
|
||||
|
||||
DateTime end = DateTime.UtcNow;
|
||||
EndProgress?.Invoke();
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Dump_finished_in_0, (end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Dump_finished_in_0,
|
||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_dump_speed_0,
|
||||
ByteSize.FromBytes(512 * (romSectors + 1)).
|
||||
@@ -414,7 +420,8 @@ public partial class Dump
|
||||
ByteSize.FromBytes(512 * (romSectors + 1)).
|
||||
Per(imageWriteDuration.Seconds())));
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Dump_finished_in_0, (end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Dump_finished_in_0,
|
||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Average_dump_speed_0,
|
||||
ByteSize.FromBytes(512 * (romSectors + 1)).Per(totalDuration.Milliseconds()).
|
||||
@@ -442,10 +449,12 @@ public partial class Dump
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Closing_output_file);
|
||||
UpdateStatus?.Invoke(Localization.Core.Closing_output_file);
|
||||
DateTime closeStart = DateTime.Now;
|
||||
_imageCloseStopwatch.Restart();
|
||||
outputBai.Close();
|
||||
DateTime closeEnd = DateTime.Now;
|
||||
_dumpLog.WriteLine(Localization.Core.Closed_in_0, (closeEnd - closeStart).Humanize(minUnit: TimeUnit.Second));
|
||||
_imageCloseStopwatch.Stop();
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Closed_in_0,
|
||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
||||
|
||||
if(_aborted)
|
||||
{
|
||||
@@ -465,11 +474,11 @@ public partial class Dump
|
||||
|
||||
UpdateStatus?.
|
||||
Invoke(string.Format(Localization.Core.Took_a_total_of_0_1_processing_commands_2_checksumming_3_writing_4_closing,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second),
|
||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second),
|
||||
totalDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
|
||||
totalChkDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
|
||||
imageWriteDuration.Seconds().Humanize(minUnit: TimeUnit.Second),
|
||||
(closeEnd - closeStart).Humanize(minUnit: TimeUnit.Second)));
|
||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_speed_0,
|
||||
ByteSize.FromBytes(512 * (romSectors + 1)).Per(totalDuration.Milliseconds()).
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@@ -81,7 +80,7 @@ partial class Dump
|
||||
return;
|
||||
}
|
||||
|
||||
DateTime chkStart = DateTime.UtcNow;
|
||||
_sidecarStopwatch.Restart();
|
||||
|
||||
// ReSharper disable once UseObjectOrCollectionInitializer
|
||||
_sidecarClass = new Sidecar(inputPlugin, _outputPath, filter.Id, _encoding);
|
||||
@@ -93,13 +92,15 @@ partial class Dump
|
||||
_sidecarClass.EndProgressEvent2 += EndProgress2;
|
||||
_sidecarClass.UpdateStatusEvent += UpdateStatus;
|
||||
Metadata sidecar = _sidecarClass.Create();
|
||||
DateTime end = DateTime.UtcNow;
|
||||
_sidecarStopwatch.Stop();
|
||||
|
||||
if(_aborted)
|
||||
return;
|
||||
|
||||
totalChkDuration = (end - chkStart).TotalMilliseconds;
|
||||
_dumpLog.WriteLine(Localization.Core.Sidecar_created_in_0, (end - chkStart).Humanize(minUnit: TimeUnit.Second));
|
||||
totalChkDuration = _sidecarStopwatch.Elapsed.TotalMilliseconds;
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Sidecar_created_in_0,
|
||||
_sidecarStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Average_checksum_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).Per(totalChkDuration.Milliseconds()).
|
||||
|
||||
@@ -63,12 +63,10 @@ partial class Dump
|
||||
bool sense;
|
||||
byte scsiMediumType = 0;
|
||||
const ushort sbcProfile = 0x0001;
|
||||
DateTime start;
|
||||
DateTime end;
|
||||
double totalDuration = 0;
|
||||
double currentSpeed = 0;
|
||||
double maxSpeed = double.MinValue;
|
||||
double minSpeed = double.MaxValue;
|
||||
double totalDuration = 0;
|
||||
double currentSpeed = 0;
|
||||
double maxSpeed = double.MinValue;
|
||||
double minSpeed = double.MaxValue;
|
||||
byte[] readBuffer;
|
||||
Modes.DecodedMode? decMode = null;
|
||||
Dictionary<MediaTagType, byte[]> mediaTags = new();
|
||||
@@ -250,7 +248,7 @@ partial class Dump
|
||||
return;
|
||||
}
|
||||
|
||||
start = DateTime.UtcNow;
|
||||
_dumpStopwatch.Restart();
|
||||
double imageWriteDuration = 0;
|
||||
|
||||
if(decMode?.Pages != null)
|
||||
@@ -351,7 +349,7 @@ partial class Dump
|
||||
}
|
||||
|
||||
bool newTrim = false;
|
||||
DateTime timeSpeedStart = DateTime.UtcNow;
|
||||
_speedStopwatch.Restart();
|
||||
ulong sectorSpeedStart = 0;
|
||||
InitProgress?.Invoke();
|
||||
|
||||
@@ -391,9 +389,9 @@ partial class Dump
|
||||
{
|
||||
mhddLog.Write(i, cmdDuration, blocksToRead);
|
||||
ibgLog.Write(i, currentSpeed * 1024);
|
||||
DateTime writeStart = DateTime.Now;
|
||||
_writeStopwatch.Restart();
|
||||
outputFormat.WriteSectors(readBuffer, i, blocksToRead);
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
extents.Add(i, blocksToRead, true);
|
||||
_mediaGraph?.PaintSectorsGood(i, blocksToRead);
|
||||
}
|
||||
@@ -407,9 +405,9 @@ partial class Dump
|
||||
_skip = (uint)(blocks - i);
|
||||
|
||||
// Write empty data
|
||||
DateTime writeStart = DateTime.Now;
|
||||
_writeStopwatch.Restart();
|
||||
outputFormat.WriteSectors(new byte[blockSize * _skip], i, _skip);
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
|
||||
for(ulong b = i; b < i + _skip; b++)
|
||||
_resume.BadBlocks.Add(b);
|
||||
@@ -422,30 +420,32 @@ partial class Dump
|
||||
newTrim = true;
|
||||
}
|
||||
|
||||
_writeStopwatch.Stop();
|
||||
sectorSpeedStart += blocksToRead;
|
||||
_resume.NextBlock = i + blocksToRead;
|
||||
|
||||
double elapsed = (DateTime.UtcNow - timeSpeedStart).TotalSeconds;
|
||||
double elapsed = _speedStopwatch.Elapsed.TotalSeconds;
|
||||
|
||||
if(elapsed <= 0)
|
||||
continue;
|
||||
|
||||
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed);
|
||||
sectorSpeedStart = 0;
|
||||
timeSpeedStart = DateTime.UtcNow;
|
||||
_speedStopwatch.Restart();
|
||||
}
|
||||
|
||||
_speedStopwatch.Stop();
|
||||
_resume.BadBlocks = _resume.BadBlocks.Distinct().ToList();
|
||||
|
||||
end = DateTime.UtcNow;
|
||||
_dumpStopwatch.Stop();
|
||||
EndProgress?.Invoke();
|
||||
mhddLog.Close();
|
||||
|
||||
ibgLog.Close(_dev, blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
|
||||
ibgLog.Close(_dev, blocks, blockSize, _dumpStopwatch.Elapsed.TotalSeconds, currentSpeed * 1024,
|
||||
blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000), _devicePath);
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Dump_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_dump_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
@@ -456,7 +456,7 @@ partial class Dump
|
||||
Per(imageWriteDuration.Seconds())));
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Dump_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Average_dump_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
@@ -472,7 +472,7 @@ partial class Dump
|
||||
_trim &&
|
||||
newTrim)
|
||||
{
|
||||
start = DateTime.UtcNow;
|
||||
_trimStopwatch.Restart();
|
||||
UpdateStatus?.Invoke(Localization.Core.Trimming_skipped_sectors);
|
||||
_dumpLog.WriteLine(Localization.Core.Trimming_skipped_sectors);
|
||||
|
||||
@@ -504,13 +504,13 @@ partial class Dump
|
||||
}
|
||||
|
||||
EndProgress?.Invoke();
|
||||
end = DateTime.UtcNow;
|
||||
_trimStopwatch.Stop();
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Trimming_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Trimming_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
}
|
||||
#endregion Trimming
|
||||
|
||||
@@ -727,14 +727,15 @@ partial class Dump
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Closing_output_file);
|
||||
UpdateStatus?.Invoke(Localization.Core.Closing_output_file);
|
||||
DateTime closeStart = DateTime.Now;
|
||||
_imageCloseStopwatch.Restart();
|
||||
outputFormat.Close();
|
||||
DateTime closeEnd = DateTime.Now;
|
||||
_imageCloseStopwatch.Stop();
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Closed_in_0,
|
||||
(closeEnd - closeStart).Humanize(minUnit: TimeUnit.Second)));
|
||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Closed_in_0, (closeEnd - closeStart).Humanize(minUnit: TimeUnit.Second));
|
||||
_dumpLog.WriteLine(Localization.Core.Closed_in_0,
|
||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
||||
|
||||
if(_aborted)
|
||||
{
|
||||
@@ -762,7 +763,7 @@ partial class Dump
|
||||
return;
|
||||
}
|
||||
|
||||
DateTime chkStart = DateTime.UtcNow;
|
||||
_sidecarStopwatch.Restart();
|
||||
_sidecarClass = new Sidecar(inputPlugin, _outputPath, filter.Id, _encoding);
|
||||
_sidecarClass.InitProgressEvent += InitProgress;
|
||||
_sidecarClass.UpdateProgressEvent += UpdateProgress;
|
||||
@@ -772,21 +773,21 @@ partial class Dump
|
||||
_sidecarClass.EndProgressEvent2 += EndProgress2;
|
||||
_sidecarClass.UpdateStatusEvent += UpdateStatus;
|
||||
Metadata sidecar = _sidecarClass.Create();
|
||||
end = DateTime.UtcNow;
|
||||
_sidecarStopwatch.Stop();
|
||||
|
||||
if(!_aborted)
|
||||
{
|
||||
totalChkDuration = (end - chkStart).TotalMilliseconds;
|
||||
totalChkDuration = _sidecarStopwatch.Elapsed.TotalMilliseconds;
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Sidecar_created_in_0,
|
||||
(end - chkStart).Humanize(minUnit: TimeUnit.Second)));
|
||||
_sidecarStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_checksum_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
Per(totalChkDuration.Milliseconds())));
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Sidecar_created_in_0,
|
||||
(end - chkStart).Humanize(minUnit: TimeUnit.Second));
|
||||
_sidecarStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Average_checksum_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).Per(totalChkDuration.Milliseconds()).
|
||||
@@ -866,11 +867,11 @@ partial class Dump
|
||||
|
||||
UpdateStatus?.
|
||||
Invoke(string.Format(Localization.Core.Took_a_total_of_0_1_processing_commands_2_checksumming_3_writing_4_closing,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second),
|
||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second),
|
||||
totalDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
|
||||
totalChkDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
|
||||
imageWriteDuration.Seconds().Humanize(minUnit: TimeUnit.Second),
|
||||
(closeEnd - closeStart).Humanize(minUnit: TimeUnit.Second)));
|
||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
|
||||
@@ -66,8 +66,6 @@ public partial class Dump
|
||||
double maxSpeed = double.MinValue;
|
||||
double minSpeed = double.MaxValue;
|
||||
uint blocksToRead = 64;
|
||||
DateTime start;
|
||||
DateTime end;
|
||||
MediaType dskType;
|
||||
bool sense;
|
||||
byte[] senseBuf;
|
||||
@@ -145,7 +143,7 @@ public partial class Dump
|
||||
return;
|
||||
}
|
||||
|
||||
start = DateTime.UtcNow;
|
||||
_dumpStopwatch.Restart();
|
||||
double imageWriteDuration = 0;
|
||||
|
||||
DumpHardware currentTry = null;
|
||||
@@ -184,7 +182,7 @@ public partial class Dump
|
||||
|
||||
bool newTrim = false;
|
||||
|
||||
DateTime timeSpeedStart = DateTime.UtcNow;
|
||||
_speedStopwatch.Restart();
|
||||
ulong sectorSpeedStart = 0;
|
||||
InitProgress?.Invoke();
|
||||
|
||||
@@ -224,9 +222,9 @@ public partial class Dump
|
||||
{
|
||||
mhddLog.Write(i, cmdDuration, blocksToRead);
|
||||
ibgLog.Write(i, currentSpeed * 1024);
|
||||
DateTime writeStart = DateTime.Now;
|
||||
_writeStopwatch.Restart();
|
||||
outputFormat.WriteSectors(readBuffer, i, blocksToRead);
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
extents.Add(i, blocksToRead, true);
|
||||
_mediaGraph?.PaintSectorsGood(i, blocksToRead);
|
||||
}
|
||||
@@ -242,9 +240,9 @@ public partial class Dump
|
||||
_skip = (uint)(blocks - i);
|
||||
|
||||
// Write empty data
|
||||
DateTime writeStart = DateTime.Now;
|
||||
_writeStopwatch.Restart();
|
||||
outputFormat.WriteSectors(new byte[blockSize * _skip], i, _skip);
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
|
||||
for(ulong b = i; b < i + _skip; b++)
|
||||
_resume.BadBlocks.Add(b);
|
||||
@@ -257,30 +255,32 @@ public partial class Dump
|
||||
newTrim = true;
|
||||
}
|
||||
|
||||
_writeStopwatch.Stop();
|
||||
sectorSpeedStart += blocksToRead;
|
||||
_resume.NextBlock = i + blocksToRead;
|
||||
|
||||
double elapsed = (DateTime.UtcNow - timeSpeedStart).TotalSeconds;
|
||||
double elapsed = _speedStopwatch.Elapsed.TotalSeconds;
|
||||
|
||||
if(elapsed <= 0)
|
||||
continue;
|
||||
|
||||
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed);
|
||||
sectorSpeedStart = 0;
|
||||
timeSpeedStart = DateTime.UtcNow;
|
||||
_speedStopwatch.Restart();
|
||||
}
|
||||
|
||||
_speedStopwatch.Stop();
|
||||
_resume.BadBlocks = _resume.BadBlocks.Distinct().ToList();
|
||||
|
||||
end = DateTime.UtcNow;
|
||||
_dumpStopwatch.Stop();
|
||||
EndProgress?.Invoke();
|
||||
mhddLog.Close();
|
||||
|
||||
ibgLog.Close(_dev, blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
|
||||
ibgLog.Close(_dev, blocks, blockSize, _dumpStopwatch.Elapsed.TotalSeconds, currentSpeed * 1024,
|
||||
blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000), _devicePath);
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Dump_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_dump_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
@@ -291,7 +291,7 @@ public partial class Dump
|
||||
Per(imageWriteDuration.Seconds())));
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Dump_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Average_dump_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
@@ -307,7 +307,7 @@ public partial class Dump
|
||||
_trim &&
|
||||
newTrim)
|
||||
{
|
||||
start = DateTime.UtcNow;
|
||||
_trimStopwatch.Restart();
|
||||
UpdateStatus?.Invoke(Localization.Core.Trimming_skipped_sectors);
|
||||
_dumpLog.WriteLine(Localization.Core.Trimming_skipped_sectors);
|
||||
|
||||
@@ -344,10 +344,10 @@ public partial class Dump
|
||||
}
|
||||
|
||||
EndProgress?.Invoke();
|
||||
end = DateTime.UtcNow;
|
||||
_trimStopwatch.Stop();
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Trimming_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
}
|
||||
#endregion Trimming
|
||||
|
||||
@@ -581,14 +581,15 @@ public partial class Dump
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Closing_output_file);
|
||||
UpdateStatus?.Invoke(Localization.Core.Closing_output_file);
|
||||
DateTime closeStart = DateTime.Now;
|
||||
_imageCloseStopwatch.Restart();
|
||||
outputFormat.Close();
|
||||
DateTime closeEnd = DateTime.Now;
|
||||
_imageCloseStopwatch.Stop();
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Closed_in_0,
|
||||
(closeEnd - closeStart).Humanize(minUnit: TimeUnit.Second)));
|
||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Closed_in_0, (closeEnd - closeStart).Humanize(minUnit: TimeUnit.Second));
|
||||
_dumpLog.WriteLine(Localization.Core.Closed_in_0,
|
||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
||||
|
||||
if(_aborted)
|
||||
{
|
||||
@@ -616,7 +617,7 @@ public partial class Dump
|
||||
return;
|
||||
}
|
||||
|
||||
DateTime chkStart = DateTime.UtcNow;
|
||||
_sidecarStopwatch.Restart();
|
||||
_sidecarClass = new Sidecar(inputPlugin, _outputPath, filter.Id, _encoding);
|
||||
_sidecarClass.InitProgressEvent += InitProgress;
|
||||
_sidecarClass.UpdateProgressEvent += UpdateProgress;
|
||||
@@ -626,21 +627,21 @@ public partial class Dump
|
||||
_sidecarClass.EndProgressEvent2 += EndProgress2;
|
||||
_sidecarClass.UpdateStatusEvent += UpdateStatus;
|
||||
Metadata sidecar = _sidecarClass.Create();
|
||||
end = DateTime.UtcNow;
|
||||
_sidecarStopwatch.Stop();
|
||||
|
||||
if(!_aborted)
|
||||
{
|
||||
totalChkDuration = (end - chkStart).TotalMilliseconds;
|
||||
totalChkDuration = _sidecarStopwatch.Elapsed.TotalMilliseconds;
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Sidecar_created_in_0,
|
||||
(end - chkStart).Humanize(minUnit: TimeUnit.Second)));
|
||||
_sidecarStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_checksum_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
Per(totalChkDuration.Milliseconds())));
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Sidecar_created_in_0,
|
||||
(end - chkStart).Humanize(minUnit: TimeUnit.Second));
|
||||
_sidecarStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Average_checksum_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).Per(totalChkDuration.Milliseconds()).
|
||||
@@ -709,11 +710,11 @@ public partial class Dump
|
||||
|
||||
UpdateStatus?.
|
||||
Invoke(string.Format(Localization.Core.Took_a_total_of_0_1_processing_commands_2_checksumming_3_writing_4_closing,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second),
|
||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second),
|
||||
totalDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
|
||||
totalChkDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
|
||||
imageWriteDuration.Seconds().Humanize(minUnit: TimeUnit.Second),
|
||||
(closeEnd - closeStart).Humanize(minUnit: TimeUnit.Second)));
|
||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
|
||||
@@ -66,8 +66,6 @@ public partial class Dump
|
||||
double currentSpeed = 0;
|
||||
double maxSpeed = double.MinValue;
|
||||
double minSpeed = double.MaxValue;
|
||||
DateTime start;
|
||||
DateTime end;
|
||||
byte[] senseBuf;
|
||||
|
||||
if(_outputPlugin is not IWritableOpticalImage outputOptical)
|
||||
@@ -153,7 +151,7 @@ public partial class Dump
|
||||
return;
|
||||
}
|
||||
|
||||
start = DateTime.UtcNow;
|
||||
_dumpStopwatch.Restart();
|
||||
double imageWriteDuration = 0;
|
||||
|
||||
outputOptical.SetTracks(new List<Track>
|
||||
@@ -206,7 +204,7 @@ public partial class Dump
|
||||
|
||||
bool newTrim = false;
|
||||
|
||||
DateTime timeSpeedStart = DateTime.UtcNow;
|
||||
_speedStopwatch.Restart();
|
||||
ulong sectorSpeedStart = 0;
|
||||
InitProgress?.Invoke();
|
||||
|
||||
@@ -241,14 +239,15 @@ public partial class Dump
|
||||
|
||||
totalDuration += cmdDuration;
|
||||
|
||||
_writeStopwatch.Restart();
|
||||
|
||||
if(!sense &&
|
||||
!_dev.Error)
|
||||
{
|
||||
mhddLog.Write(i, cmdDuration, blocksToRead);
|
||||
ibgLog.Write(i, currentSpeed * 1024);
|
||||
DateTime writeStart = DateTime.Now;
|
||||
outputOptical.WriteSectors(readBuffer, i, blocksToRead);
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
extents.Add(i, blocksToRead, true);
|
||||
_mediaGraph?.PaintSectorsGood(i, blocksToRead);
|
||||
}
|
||||
@@ -264,9 +263,8 @@ public partial class Dump
|
||||
_skip = (uint)(blocks - i);
|
||||
|
||||
// Write empty data
|
||||
DateTime writeStart = DateTime.Now;
|
||||
outputOptical.WriteSectors(new byte[blockSize * _skip], i, _skip);
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
|
||||
for(ulong b = i; b < i + _skip; b++)
|
||||
_resume.BadBlocks.Add(b);
|
||||
@@ -279,30 +277,31 @@ public partial class Dump
|
||||
newTrim = true;
|
||||
}
|
||||
|
||||
_writeStopwatch.Stop();
|
||||
sectorSpeedStart += blocksToRead;
|
||||
_resume.NextBlock = i + blocksToRead;
|
||||
|
||||
double elapsed = (DateTime.UtcNow - timeSpeedStart).TotalSeconds;
|
||||
double elapsed = _speedStopwatch.Elapsed.TotalSeconds;
|
||||
|
||||
if(elapsed <= 0)
|
||||
continue;
|
||||
|
||||
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed);
|
||||
sectorSpeedStart = 0;
|
||||
timeSpeedStart = DateTime.UtcNow;
|
||||
_speedStopwatch.Restart();
|
||||
}
|
||||
|
||||
_resume.BadBlocks = _resume.BadBlocks.Distinct().ToList();
|
||||
|
||||
end = DateTime.UtcNow;
|
||||
_dumpStopwatch.Stop();
|
||||
EndProgress?.Invoke();
|
||||
mhddLog.Close();
|
||||
|
||||
ibgLog.Close(_dev, blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
|
||||
ibgLog.Close(_dev, blocks, blockSize, _dumpStopwatch.Elapsed.TotalSeconds, currentSpeed * 1024,
|
||||
blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000), _devicePath);
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Dump_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_dump_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
@@ -313,7 +312,7 @@ public partial class Dump
|
||||
Per(imageWriteDuration.Seconds())));
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Dump_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Average_dump_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
@@ -329,7 +328,7 @@ public partial class Dump
|
||||
_trim &&
|
||||
newTrim)
|
||||
{
|
||||
start = DateTime.UtcNow;
|
||||
_trimStopwatch.Restart();
|
||||
_dumpLog.WriteLine(Localization.Core.Trimming_skipped_sectors);
|
||||
|
||||
ulong[] tmpArray = _resume.BadBlocks.ToArray();
|
||||
@@ -364,10 +363,10 @@ public partial class Dump
|
||||
}
|
||||
|
||||
EndProgress?.Invoke();
|
||||
end = DateTime.UtcNow;
|
||||
_trimStopwatch.Stop();
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Trimming_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
}
|
||||
#endregion Trimming
|
||||
|
||||
@@ -587,10 +586,12 @@ public partial class Dump
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Closing_output_file);
|
||||
UpdateStatus?.Invoke(Localization.Core.Closing_output_file);
|
||||
DateTime closeStart = DateTime.Now;
|
||||
_imageCloseStopwatch.Restart();
|
||||
outputOptical.Close();
|
||||
DateTime closeEnd = DateTime.Now;
|
||||
_dumpLog.WriteLine(Localization.Core.Closed_in_0, (closeEnd - closeStart).Humanize(minUnit: TimeUnit.Second));
|
||||
_imageCloseStopwatch.Stop();
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Closed_in_0,
|
||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
||||
|
||||
if(_aborted)
|
||||
{
|
||||
@@ -609,11 +610,11 @@ public partial class Dump
|
||||
|
||||
UpdateStatus?.
|
||||
Invoke(string.Format(Localization.Core.Took_a_total_of_0_1_processing_commands_2_checksumming_3_writing_4_closing,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second),
|
||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second),
|
||||
totalDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
|
||||
totalChkDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
|
||||
imageWriteDuration.Seconds().Humanize(minUnit: TimeUnit.Second),
|
||||
(closeEnd - closeStart).Humanize(minUnit: TimeUnit.Second)));
|
||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
|
||||
@@ -67,8 +67,6 @@ partial class Dump
|
||||
uint blockSize;
|
||||
ulong blocks = 0;
|
||||
MediaType dskType;
|
||||
DateTime start;
|
||||
DateTime end;
|
||||
double totalDuration = 0;
|
||||
double currentSpeed = 0;
|
||||
double maxSpeed = double.MinValue;
|
||||
@@ -796,7 +794,7 @@ partial class Dump
|
||||
return;
|
||||
}
|
||||
|
||||
start = DateTime.UtcNow;
|
||||
_dumpStopwatch.Restart();
|
||||
var mhddLog = new MhddLog(_outputPrefix + ".mhddlog.bin", _dev, blocks, blockSize, 1, _private);
|
||||
var ibgLog = new IbgLog(_outputPrefix + ".ibg", 0x0008);
|
||||
|
||||
@@ -832,12 +830,13 @@ partial class Dump
|
||||
if(mode10Data != null)
|
||||
outputTape.WriteMediaTag(mode10Data, MediaTagType.SCSI_MODESENSE_10);
|
||||
|
||||
DateTime timeSpeedStart = DateTime.UtcNow;
|
||||
ulong currentSpeedSize = 0;
|
||||
double imageWriteDuration = 0;
|
||||
|
||||
InitProgress?.Invoke();
|
||||
|
||||
_speedStopwatch.Restart();
|
||||
|
||||
while(currentPartition < totalPartitions)
|
||||
{
|
||||
if(_aborted)
|
||||
@@ -1053,9 +1052,9 @@ partial class Dump
|
||||
return; // TODO: Return more cleanly
|
||||
|
||||
// Write empty data
|
||||
DateTime writeStart = DateTime.Now;
|
||||
_writeStopwatch.Restart();
|
||||
outputTape.WriteSector(new byte[blockSize], currentBlock);
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
|
||||
mhddLog.Write(currentBlock, duration < 500 ? 65535 : duration);
|
||||
ibgLog.Write(currentBlock, 0);
|
||||
@@ -1065,29 +1064,31 @@ partial class Dump
|
||||
{
|
||||
mhddLog.Write(currentBlock, duration);
|
||||
ibgLog.Write(currentBlock, currentSpeed * 1024);
|
||||
DateTime writeStart = DateTime.Now;
|
||||
_writeStopwatch.Restart();
|
||||
outputTape.WriteSector(cmdBuf, currentBlock);
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
extents.Add(currentBlock, 1, true);
|
||||
}
|
||||
|
||||
_writeStopwatch.Stop();
|
||||
currentBlock++;
|
||||
_resume.NextBlock++;
|
||||
currentSpeedSize += blockSize;
|
||||
|
||||
double elapsed = (DateTime.UtcNow - timeSpeedStart).TotalSeconds;
|
||||
double elapsed = _speedStopwatch.Elapsed.TotalSeconds;
|
||||
|
||||
if(elapsed <= 0)
|
||||
continue;
|
||||
|
||||
currentSpeed = currentSpeedSize / (1048576 * elapsed);
|
||||
currentSpeedSize = 0;
|
||||
timeSpeedStart = DateTime.UtcNow;
|
||||
_speedStopwatch.Restart();
|
||||
}
|
||||
|
||||
_resume.BadBlocks = _resume.BadBlocks.Distinct().ToList();
|
||||
blocks = currentBlock + 1;
|
||||
end = DateTime.UtcNow;
|
||||
_speedStopwatch.Stop();
|
||||
_dumpStopwatch.Stop();
|
||||
|
||||
// If not aborted this is added at the end of medium
|
||||
if(_aborted)
|
||||
@@ -1102,11 +1103,11 @@ partial class Dump
|
||||
EndProgress?.Invoke();
|
||||
mhddLog.Close();
|
||||
|
||||
ibgLog.Close(_dev, blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
|
||||
ibgLog.Close(_dev, blocks, blockSize, _dumpStopwatch.Elapsed.TotalSeconds, currentSpeed * 1024,
|
||||
blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000), _devicePath);
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Dump_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_dump_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
@@ -1117,7 +1118,7 @@ partial class Dump
|
||||
Per(imageWriteDuration.Seconds())));
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Dump_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Average_dump_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
@@ -1323,14 +1324,15 @@ partial class Dump
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Closing_output_file);
|
||||
UpdateStatus?.Invoke(Localization.Core.Closing_output_file);
|
||||
DateTime closeStart = DateTime.Now;
|
||||
_imageCloseStopwatch.Restart();
|
||||
outputTape.Close();
|
||||
DateTime closeEnd = DateTime.Now;
|
||||
_imageCloseStopwatch.Stop();
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Closed_in_0,
|
||||
(closeEnd - closeStart).Humanize(minUnit: TimeUnit.Second)));
|
||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Closed_in_0, (closeEnd - closeStart).Humanize(minUnit: TimeUnit.Second));
|
||||
_dumpLog.WriteLine(Localization.Core.Closed_in_0,
|
||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
||||
|
||||
if(_aborted)
|
||||
{
|
||||
@@ -1366,7 +1368,7 @@ partial class Dump
|
||||
return;
|
||||
}
|
||||
|
||||
DateTime chkStart = DateTime.UtcNow;
|
||||
_sidecarStopwatch.Restart();
|
||||
_sidecarClass = new Sidecar(inputPlugin, _outputPath, filter.Id, _encoding);
|
||||
_sidecarClass.InitProgressEvent += InitProgress;
|
||||
_sidecarClass.UpdateProgressEvent += UpdateProgress;
|
||||
@@ -1376,21 +1378,21 @@ partial class Dump
|
||||
_sidecarClass.EndProgressEvent2 += EndProgress2;
|
||||
_sidecarClass.UpdateStatusEvent += UpdateStatus;
|
||||
Metadata sidecar = _sidecarClass.Create();
|
||||
end = DateTime.UtcNow;
|
||||
_sidecarStopwatch.Stop();
|
||||
|
||||
if(!_aborted)
|
||||
{
|
||||
totalChkDuration = (end - chkStart).TotalMilliseconds;
|
||||
totalChkDuration = _sidecarStopwatch.ElapsedMilliseconds;
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Sidecar_created_in_0,
|
||||
(end - chkStart).Humanize(minUnit: TimeUnit.Second)));
|
||||
_sidecarStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_checksum_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
Per(totalChkDuration.Milliseconds())));
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Sidecar_created_in_0,
|
||||
(end - chkStart).Humanize(minUnit: TimeUnit.Second));
|
||||
_sidecarStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Average_checksum_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).Per(totalChkDuration.Milliseconds()).
|
||||
@@ -1471,11 +1473,11 @@ partial class Dump
|
||||
|
||||
UpdateStatus?.
|
||||
Invoke(string.Format(Localization.Core.Took_a_total_of_0_1_processing_commands_2_checksumming_3_writing_4_closing,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second),
|
||||
_sidecarStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second),
|
||||
totalDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
|
||||
totalChkDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
|
||||
imageWriteDuration.Seconds().Humanize(minUnit: TimeUnit.Second),
|
||||
(closeEnd - closeStart).Humanize(minUnit: TimeUnit.Second)));
|
||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
// Copyright © 2020-2023 Rebecca Wallander
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
@@ -71,7 +70,6 @@ partial class Dump
|
||||
{
|
||||
ulong sectorSpeedStart = 0;
|
||||
bool sense;
|
||||
DateTime timeSpeedStart = DateTime.UtcNow;
|
||||
byte[] buffer;
|
||||
uint blocksToRead = maxBlocksToRead;
|
||||
var outputFormat = _outputPlugin as IWritableImage;
|
||||
@@ -212,9 +210,9 @@ partial class Dump
|
||||
|
||||
mhddLog.Write(i, cmdDuration, blocksToRead);
|
||||
ibgLog.Write(i, currentSpeed * 1024);
|
||||
DateTime writeStart = DateTime.Now;
|
||||
_writeStopwatch.Restart();
|
||||
outputFormat.WriteSectors(buffer, i, blocksToRead);
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
extents.Add(i, blocksToRead, true);
|
||||
_mediaGraph?.PaintSectorsGood(i, blocksToRead);
|
||||
}
|
||||
@@ -244,9 +242,9 @@ partial class Dump
|
||||
_skip = (uint)(blocks - i);
|
||||
|
||||
// Write empty data
|
||||
DateTime writeStart = DateTime.Now;
|
||||
_writeStopwatch.Restart();
|
||||
outputFormat.WriteSectors(new byte[blockSize * _skip], i, _skip);
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
|
||||
for(ulong b = i; b < i + _skip; b++)
|
||||
_resume.BadBlocks.Add(b);
|
||||
@@ -259,19 +257,21 @@ partial class Dump
|
||||
newTrim = true;
|
||||
}
|
||||
|
||||
_writeStopwatch.Stop();
|
||||
sectorSpeedStart += blocksToRead;
|
||||
_resume.NextBlock = i + blocksToRead;
|
||||
|
||||
double elapsed = (DateTime.UtcNow - timeSpeedStart).TotalSeconds;
|
||||
double elapsed = _speedStopwatch.Elapsed.TotalSeconds;
|
||||
|
||||
if(elapsed <= 0)
|
||||
continue;
|
||||
|
||||
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed);
|
||||
sectorSpeedStart = 0;
|
||||
timeSpeedStart = DateTime.UtcNow;
|
||||
_speedStopwatch.Restart();
|
||||
}
|
||||
|
||||
_speedStopwatch.Stop();
|
||||
_resume.BadBlocks = _resume.BadBlocks.Distinct().ToList();
|
||||
|
||||
EndProgress?.Invoke();
|
||||
|
||||
@@ -80,13 +80,11 @@ partial class Dump
|
||||
byte scsiDensityCode = 0;
|
||||
bool containsFloppyPage = false;
|
||||
const ushort sbcProfile = 0x0001;
|
||||
DateTime start;
|
||||
DateTime end;
|
||||
double totalDuration = 0;
|
||||
double currentSpeed = 0;
|
||||
double maxSpeed = double.MinValue;
|
||||
double minSpeed = double.MaxValue;
|
||||
Modes.DecodedMode? decMode = null;
|
||||
double totalDuration = 0;
|
||||
double currentSpeed = 0;
|
||||
double maxSpeed = double.MinValue;
|
||||
double minSpeed = double.MaxValue;
|
||||
Modes.DecodedMode? decMode = null;
|
||||
bool ret;
|
||||
ExtentsULong blankExtents = null;
|
||||
var outputFormat = _outputPlugin as IWritableImage;
|
||||
@@ -363,7 +361,7 @@ partial class Dump
|
||||
imageCreated = true;
|
||||
}
|
||||
|
||||
start = DateTime.UtcNow;
|
||||
_dumpStopwatch.Restart();
|
||||
double imageWriteDuration = 0;
|
||||
bool writeSingleOpticalTrack = true;
|
||||
|
||||
@@ -759,14 +757,14 @@ partial class Dump
|
||||
mediaTags.ContainsKey(MediaTagType.DVD_DiscKey_Decrypted)
|
||||
? mediaTags[MediaTagType.DVD_DiscKey_Decrypted] : null);
|
||||
|
||||
end = DateTime.UtcNow;
|
||||
_dumpStopwatch.Stop();
|
||||
mhddLog.Close();
|
||||
|
||||
ibgLog.Close(_dev, blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
|
||||
ibgLog.Close(_dev, blocks, blockSize, _dumpStopwatch.Elapsed.TotalSeconds, currentSpeed * 1024,
|
||||
blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000), _devicePath);
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Dump_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_dump_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
@@ -777,7 +775,7 @@ partial class Dump
|
||||
Per(imageWriteDuration.Seconds())));
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Dump_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Average_dump_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
@@ -793,7 +791,7 @@ partial class Dump
|
||||
_trim &&
|
||||
newTrim)
|
||||
{
|
||||
start = DateTime.UtcNow;
|
||||
_trimStopwatch.Restart();
|
||||
UpdateStatus?.Invoke(Localization.Core.Trimming_skipped_sectors);
|
||||
_dumpLog.WriteLine(Localization.Core.Trimming_skipped_sectors);
|
||||
|
||||
@@ -802,13 +800,15 @@ partial class Dump
|
||||
TrimSbcData(scsiReader, extents, currentTry, blankExtents);
|
||||
|
||||
EndProgress?.Invoke();
|
||||
end = DateTime.UtcNow;
|
||||
_trimStopwatch.Stop();
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Trimming_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Trimming_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
_trimStopwatch.Stop();
|
||||
}
|
||||
#endregion Trimming
|
||||
|
||||
@@ -1010,14 +1010,15 @@ partial class Dump
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Closing_output_file);
|
||||
UpdateStatus?.Invoke(Localization.Core.Closing_output_file);
|
||||
DateTime closeStart = DateTime.Now;
|
||||
_imageCloseStopwatch.Restart();
|
||||
outputFormat.Close();
|
||||
DateTime closeEnd = DateTime.Now;
|
||||
_imageCloseStopwatch.Stop();
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Closed_in_0,
|
||||
(closeEnd - closeStart).Humanize(minUnit: TimeUnit.Second)));
|
||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Closed_in_0, (closeEnd - closeStart).Humanize(minUnit: TimeUnit.Second));
|
||||
_dumpLog.WriteLine(Localization.Core.Closed_in_0,
|
||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
||||
|
||||
if(_aborted)
|
||||
{
|
||||
@@ -1051,7 +1052,7 @@ partial class Dump
|
||||
return;
|
||||
}
|
||||
|
||||
DateTime chkStart = DateTime.UtcNow;
|
||||
_sidecarStopwatch.Restart();
|
||||
_sidecarClass = new Sidecar(inputPlugin, _outputPath, filter.Id, _encoding);
|
||||
_sidecarClass.InitProgressEvent += InitProgress;
|
||||
_sidecarClass.UpdateProgressEvent += UpdateProgress;
|
||||
@@ -1061,21 +1062,21 @@ partial class Dump
|
||||
_sidecarClass.EndProgressEvent2 += EndProgress2;
|
||||
_sidecarClass.UpdateStatusEvent += UpdateStatus;
|
||||
Metadata sidecar = _sidecarClass.Create();
|
||||
end = DateTime.UtcNow;
|
||||
_sidecarStopwatch.Stop();
|
||||
|
||||
if(!_aborted)
|
||||
{
|
||||
totalChkDuration = (end - chkStart).TotalMilliseconds;
|
||||
totalChkDuration = _sidecarStopwatch.Elapsed.TotalMilliseconds;
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Sidecar_created_in_0,
|
||||
(end - chkStart).Humanize(minUnit: TimeUnit.Second)));
|
||||
_sidecarStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_checksum_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
Per(totalChkDuration.Milliseconds())));
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Sidecar_created_in_0,
|
||||
(end - chkStart).Humanize(minUnit: TimeUnit.Second));
|
||||
_sidecarStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Average_checksum_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
@@ -1295,11 +1296,11 @@ partial class Dump
|
||||
|
||||
UpdateStatus?.
|
||||
Invoke(string.Format(Localization.Core.Took_a_total_of_0_1_processing_commands_2_checksumming_3_writing_4_closing,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second),
|
||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second),
|
||||
totalDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
|
||||
totalChkDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
|
||||
imageWriteDuration.Seconds().Humanize(minUnit: TimeUnit.Second),
|
||||
(closeEnd - closeStart).Humanize(minUnit: TimeUnit.Second)));
|
||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
|
||||
@@ -53,7 +53,6 @@ partial class Dump
|
||||
bool sense;
|
||||
byte[] buffer;
|
||||
ulong sectorSpeedStart = 0;
|
||||
DateTime timeSpeedStart = DateTime.UtcNow;
|
||||
bool canMediumScan = true;
|
||||
var outputFormat = _outputPlugin as IWritableImage;
|
||||
|
||||
@@ -185,6 +184,8 @@ partial class Dump
|
||||
if(extent.Item1 < _resume.NextBlock)
|
||||
nextBlock = (uint)_resume.NextBlock;
|
||||
|
||||
_speedStopwatch.Restart();
|
||||
|
||||
for(ulong i = nextBlock; i <= extent.Item2; i += blocksToRead)
|
||||
{
|
||||
if(_aborted)
|
||||
@@ -219,9 +220,9 @@ partial class Dump
|
||||
{
|
||||
mhddLog.Write(i, cmdDuration, blocksToRead);
|
||||
ibgLog.Write(i, currentSpeed * 1024);
|
||||
DateTime writeStart = DateTime.Now;
|
||||
_writeStopwatch.Restart();
|
||||
outputFormat.WriteSectors(buffer, i, blocksToRead);
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
extents.Add(i, blocksToRead, true);
|
||||
}
|
||||
else
|
||||
@@ -234,9 +235,9 @@ partial class Dump
|
||||
_skip = (uint)(extent.Item2 + 1 - i);
|
||||
|
||||
// Write empty data
|
||||
DateTime writeStart = DateTime.Now;
|
||||
_writeStopwatch.Restart();
|
||||
outputFormat.WriteSectors(new byte[blockSize * _skip], i, _skip);
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
|
||||
for(ulong b = i; b < i + _skip; b++)
|
||||
_resume.BadBlocks.Add(b);
|
||||
@@ -249,20 +250,22 @@ partial class Dump
|
||||
newTrim = true;
|
||||
}
|
||||
|
||||
_writeStopwatch.Stop();
|
||||
sectorSpeedStart += blocksToRead;
|
||||
_resume.NextBlock = i + blocksToRead;
|
||||
|
||||
double elapsed = (DateTime.UtcNow - timeSpeedStart).TotalSeconds;
|
||||
double elapsed = _speedStopwatch.Elapsed.TotalSeconds;
|
||||
|
||||
if(elapsed <= 0)
|
||||
continue;
|
||||
|
||||
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed);
|
||||
sectorSpeedStart = 0;
|
||||
timeSpeedStart = DateTime.UtcNow;
|
||||
_speedStopwatch.Restart();
|
||||
}
|
||||
}
|
||||
|
||||
_speedStopwatch.Stop();
|
||||
_resume.BadBlocks = _resume.BadBlocks.Distinct().ToList();
|
||||
|
||||
EndProgress?.Invoke();
|
||||
|
||||
@@ -248,8 +248,6 @@ public partial class Dump
|
||||
else
|
||||
mediaTags.Add(_dev.Type == DeviceType.SecureDigital ? MediaTagType.SD_CID : MediaTagType.MMC_CID, null);
|
||||
|
||||
DateTime start;
|
||||
DateTime end;
|
||||
double totalDuration = 0;
|
||||
double currentSpeed = 0;
|
||||
double maxSpeed = double.MinValue;
|
||||
@@ -620,10 +618,10 @@ public partial class Dump
|
||||
_mediaGraph?.PaintSectorsBad(_resume.BadBlocks);
|
||||
}
|
||||
|
||||
start = DateTime.UtcNow;
|
||||
_dumpStopwatch.Restart();
|
||||
_speedStopwatch.Restart();
|
||||
double imageWriteDuration = 0;
|
||||
bool newTrim = false;
|
||||
DateTime timeSpeedStart = DateTime.UtcNow;
|
||||
ulong sectorSpeedStart = 0;
|
||||
|
||||
InitProgress?.Invoke();
|
||||
@@ -670,9 +668,9 @@ public partial class Dump
|
||||
{
|
||||
mhddLog.Write(i, duration, blocksToRead);
|
||||
ibgLog.Write(i, currentSpeed * 1024);
|
||||
DateTime writeStart = DateTime.Now;
|
||||
_writeStopwatch.Restart();
|
||||
outputFormat.WriteSectors(cmdBuf, i, blocksToRead);
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
extents.Add(i, blocksToRead, true);
|
||||
_mediaGraph?.PaintSectorsGood(i, blocksToRead);
|
||||
}
|
||||
@@ -689,38 +687,40 @@ public partial class Dump
|
||||
mhddLog.Write(i, duration < 500 ? 65535 : duration, _skip);
|
||||
|
||||
ibgLog.Write(i, 0);
|
||||
DateTime writeStart = DateTime.Now;
|
||||
_writeStopwatch.Restart();
|
||||
outputFormat.WriteSectors(new byte[blockSize * _skip], i, _skip);
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
_dumpLog.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
||||
i += _skip - blocksToRead;
|
||||
newTrim = true;
|
||||
}
|
||||
|
||||
_writeStopwatch.Stop();
|
||||
sectorSpeedStart += blocksToRead;
|
||||
_resume.NextBlock = i + blocksToRead;
|
||||
|
||||
double elapsed = (DateTime.UtcNow - timeSpeedStart).TotalSeconds;
|
||||
double elapsed = _speedStopwatch.Elapsed.TotalSeconds;
|
||||
|
||||
if(elapsed <= 0)
|
||||
continue;
|
||||
|
||||
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed);
|
||||
sectorSpeedStart = 0;
|
||||
timeSpeedStart = DateTime.UtcNow;
|
||||
_speedStopwatch.Restart();
|
||||
}
|
||||
|
||||
_resume.BadBlocks = _resume.BadBlocks.Distinct().ToList();
|
||||
|
||||
end = DateTime.Now;
|
||||
_speedStopwatch.Stop();
|
||||
_dumpStopwatch.Stop();
|
||||
EndProgress?.Invoke();
|
||||
mhddLog.Close();
|
||||
|
||||
ibgLog.Close(_dev, blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
|
||||
ibgLog.Close(_dev, blocks, blockSize, _dumpStopwatch.Elapsed.TotalSeconds, currentSpeed * 1024,
|
||||
blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000), _devicePath);
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Dump_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_dump_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
@@ -731,7 +731,7 @@ public partial class Dump
|
||||
Per(imageWriteDuration.Seconds())));
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Dump_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Average_dump_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
@@ -747,7 +747,7 @@ public partial class Dump
|
||||
_trim &&
|
||||
newTrim)
|
||||
{
|
||||
start = DateTime.UtcNow;
|
||||
_trimStopwatch.Restart();
|
||||
UpdateStatus?.Invoke(Localization.Core.Trimming_skipped_sectors);
|
||||
_dumpLog.WriteLine(Localization.Core.Trimming_skipped_sectors);
|
||||
|
||||
@@ -786,13 +786,13 @@ public partial class Dump
|
||||
}
|
||||
|
||||
EndProgress?.Invoke();
|
||||
end = DateTime.UtcNow;
|
||||
_trimStopwatch.Stop();
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Trimming_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Trimming_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
}
|
||||
#endregion Trimming
|
||||
|
||||
@@ -886,14 +886,15 @@ public partial class Dump
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Closing_output_file);
|
||||
UpdateStatus?.Invoke(Localization.Core.Closing_output_file);
|
||||
DateTime closeStart = DateTime.Now;
|
||||
_imageCloseStopwatch.Restart();
|
||||
outputFormat.Close();
|
||||
DateTime closeEnd = DateTime.Now;
|
||||
_imageCloseStopwatch.Stop();
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Closed_in_0,
|
||||
(closeEnd - closeStart).Humanize(minUnit: TimeUnit.Second)));
|
||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Closed_in_0, (closeEnd - closeStart).Humanize(minUnit: TimeUnit.Second));
|
||||
_dumpLog.WriteLine(Localization.Core.Closed_in_0,
|
||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
||||
|
||||
if(_aborted)
|
||||
{
|
||||
@@ -917,7 +918,7 @@ public partial class Dump
|
||||
if(opened != ErrorNumber.NoError)
|
||||
StoppingErrorMessage?.Invoke(string.Format(Localization.Core.Error_0_opening_created_image, opened));
|
||||
|
||||
DateTime chkStart = DateTime.UtcNow;
|
||||
_sidecarStopwatch.Restart();
|
||||
_sidecarClass = new Sidecar(inputPlugin, _outputPath, filter.Id, _encoding);
|
||||
_sidecarClass.InitProgressEvent += InitProgress;
|
||||
_sidecarClass.UpdateProgressEvent += UpdateProgress;
|
||||
@@ -927,6 +928,7 @@ public partial class Dump
|
||||
_sidecarClass.EndProgressEvent2 += EndProgress2;
|
||||
_sidecarClass.UpdateStatusEvent += UpdateStatus;
|
||||
Metadata sidecar = _sidecarClass.Create();
|
||||
_sidecarStopwatch.Stop();
|
||||
|
||||
if(!_aborted)
|
||||
{
|
||||
@@ -936,19 +938,17 @@ public partial class Dump
|
||||
sidecar = _preSidecar;
|
||||
}
|
||||
|
||||
end = DateTime.UtcNow;
|
||||
|
||||
totalChkDuration = (end - chkStart).TotalMilliseconds;
|
||||
totalChkDuration = _sidecarStopwatch.Elapsed.TotalMilliseconds;
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Sidecar_created_in_0,
|
||||
(end - chkStart).Humanize(minUnit: TimeUnit.Second)));
|
||||
_sidecarStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_checksum_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
Per(totalChkDuration.Milliseconds())));
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Sidecar_created_in_0,
|
||||
(end - chkStart).Humanize(minUnit: TimeUnit.Second));
|
||||
_sidecarStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Average_checksum_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).Per(totalChkDuration.Milliseconds()).
|
||||
@@ -1004,11 +1004,11 @@ public partial class Dump
|
||||
|
||||
UpdateStatus?.
|
||||
Invoke(string.Format(Localization.Core.Took_a_total_of_0_1_processing_commands_2_checksumming_3_writing_4_closing,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second),
|
||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second),
|
||||
totalDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
|
||||
totalChkDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
|
||||
imageWriteDuration.Seconds().Humanize(minUnit: TimeUnit.Second),
|
||||
(closeEnd - closeStart).Humanize(minUnit: TimeUnit.Second)));
|
||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
|
||||
@@ -72,8 +72,6 @@ partial class Dump
|
||||
bool sense;
|
||||
const uint blockSize = 2048;
|
||||
uint blocksToRead = 64;
|
||||
DateTime start;
|
||||
DateTime end;
|
||||
double totalDuration = 0;
|
||||
double currentSpeed = 0;
|
||||
double maxSpeed = double.MinValue;
|
||||
@@ -520,7 +518,7 @@ partial class Dump
|
||||
return;
|
||||
}
|
||||
|
||||
start = DateTime.UtcNow;
|
||||
_dumpStopwatch.Restart();
|
||||
double imageWriteDuration = 0;
|
||||
|
||||
double cmdDuration = 0;
|
||||
@@ -577,7 +575,7 @@ partial class Dump
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Reading_game_partition);
|
||||
UpdateStatus?.Invoke(Localization.Core.Reading_game_partition);
|
||||
DateTime timeSpeedStart = DateTime.UtcNow;
|
||||
_speedStopwatch.Restart();
|
||||
ulong sectorSpeedStart = 0;
|
||||
InitProgress?.Invoke();
|
||||
|
||||
@@ -662,9 +660,9 @@ partial class Dump
|
||||
{
|
||||
mhddLog.Write(i, cmdDuration, blocksToRead);
|
||||
ibgLog.Write(i, currentSpeed * 1024);
|
||||
DateTime writeStart = DateTime.Now;
|
||||
_writeStopwatch.Restart();
|
||||
outputFormat.WriteSectors(readBuffer, i, blocksToRead);
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
extents.Add(i, blocksToRead, true);
|
||||
_mediaGraph?.PaintSectorsGood(i, blocksToRead);
|
||||
}
|
||||
@@ -680,9 +678,9 @@ partial class Dump
|
||||
_skip = (uint)(blocks - i);
|
||||
|
||||
// Write empty data
|
||||
DateTime writeStart = DateTime.Now;
|
||||
_writeStopwatch.Restart();
|
||||
outputFormat.WriteSectors(new byte[blockSize * _skip], i, _skip);
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
|
||||
for(ulong b = i; b < i + _skip; b++)
|
||||
_resume.BadBlocks.Add(b);
|
||||
@@ -708,21 +706,24 @@ partial class Dump
|
||||
newTrim = true;
|
||||
}
|
||||
|
||||
_writeStopwatch.Stop();
|
||||
blocksToRead = saveBlocksToRead;
|
||||
currentSector = i + 1;
|
||||
_resume.NextBlock = currentSector;
|
||||
sectorSpeedStart += blocksToRead;
|
||||
|
||||
double elapsed = (DateTime.UtcNow - timeSpeedStart).TotalSeconds;
|
||||
double elapsed = _speedStopwatch.Elapsed.TotalSeconds;
|
||||
|
||||
if(elapsed <= 0)
|
||||
continue;
|
||||
|
||||
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed);
|
||||
sectorSpeedStart = 0;
|
||||
timeSpeedStart = DateTime.UtcNow;
|
||||
_speedStopwatch.Restart();
|
||||
}
|
||||
|
||||
_speedStopwatch.Stop();
|
||||
|
||||
for(ulong i = extentStart; i <= extentEnd; i += blocksToRead)
|
||||
{
|
||||
saveBlocksToRead = blocksToRead;
|
||||
@@ -743,9 +744,9 @@ partial class Dump
|
||||
ibgLog.Write(i, currentSpeed * 1024);
|
||||
|
||||
// Write empty data
|
||||
DateTime writeStart = DateTime.Now;
|
||||
_writeStopwatch.Restart();
|
||||
outputFormat.WriteSectors(new byte[blockSize * blocksToRead], i, blocksToRead);
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
blocksToRead = saveBlocksToRead;
|
||||
extents.Add(i, blocksToRead, true);
|
||||
currentSector = i + 1;
|
||||
@@ -757,6 +758,7 @@ partial class Dump
|
||||
currentSector = extentEnd + 1;
|
||||
}
|
||||
|
||||
_writeStopwatch.Stop();
|
||||
_resume.BadBlocks = _resume.BadBlocks.Distinct().ToList();
|
||||
|
||||
EndProgress?.Invoke();
|
||||
@@ -788,10 +790,11 @@ partial class Dump
|
||||
ibgLog.Write(middle + currentSector, currentSpeed * 1024);
|
||||
|
||||
// Write empty data
|
||||
DateTime writeStart = DateTime.Now;
|
||||
_writeStopwatch.Restart();
|
||||
outputFormat.WriteSectors(new byte[blockSize * blocksToRead], middle + currentSector, blocksToRead);
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
extents.Add(currentSector, blocksToRead, true);
|
||||
_writeStopwatch.Stop();
|
||||
|
||||
currentSector += blocksToRead;
|
||||
_resume.NextBlock = currentSector;
|
||||
@@ -863,9 +866,9 @@ partial class Dump
|
||||
{
|
||||
mhddLog.Write(currentSector, cmdDuration, blocksToRead);
|
||||
ibgLog.Write(currentSector, currentSpeed * 1024);
|
||||
DateTime writeStart = DateTime.Now;
|
||||
_writeStopwatch.Restart();
|
||||
outputFormat.WriteSectors(readBuffer, currentSector, blocksToRead);
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
extents.Add(currentSector, blocksToRead, true);
|
||||
_mediaGraph?.PaintSectorsGood(currentSector, blocksToRead);
|
||||
}
|
||||
@@ -878,9 +881,9 @@ partial class Dump
|
||||
return; // TODO: Return more cleanly
|
||||
|
||||
// Write empty data
|
||||
DateTime writeStart = DateTime.Now;
|
||||
_writeStopwatch.Restart();
|
||||
outputFormat.WriteSectors(new byte[blockSize * _skip], currentSector, _skip);
|
||||
imageWriteDuration += (DateTime.Now - writeStart).TotalSeconds;
|
||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||
|
||||
// TODO: Handle errors in video partition
|
||||
//errored += blocksToRead;
|
||||
@@ -901,18 +904,20 @@ partial class Dump
|
||||
_dumpLog.WriteLine(senseLine);
|
||||
}
|
||||
|
||||
_writeStopwatch.Stop();
|
||||
|
||||
currentSector += blocksToRead;
|
||||
_resume.NextBlock = currentSector;
|
||||
sectorSpeedStart += blocksToRead;
|
||||
|
||||
double elapsed = (DateTime.UtcNow - timeSpeedStart).TotalSeconds;
|
||||
double elapsed = _speedStopwatch.Elapsed.TotalSeconds;
|
||||
|
||||
if(elapsed <= 0)
|
||||
continue;
|
||||
|
||||
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed);
|
||||
sectorSpeedStart = 0;
|
||||
timeSpeedStart = DateTime.UtcNow;
|
||||
_speedStopwatch.Restart();
|
||||
}
|
||||
|
||||
EndProgress?.Invoke();
|
||||
@@ -939,15 +944,15 @@ partial class Dump
|
||||
return;
|
||||
}
|
||||
|
||||
end = DateTime.UtcNow;
|
||||
_dumpStopwatch.Stop();
|
||||
AaruConsole.WriteLine();
|
||||
mhddLog.Close();
|
||||
|
||||
ibgLog.Close(_dev, blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
|
||||
ibgLog.Close(_dev, blocks, blockSize, _dumpStopwatch.Elapsed.TotalSeconds, currentSpeed * 1024,
|
||||
blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000), _devicePath);
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Dump_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_dump_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
@@ -958,7 +963,7 @@ partial class Dump
|
||||
Per(imageWriteDuration.Seconds())));
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Dump_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Average_dump_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
@@ -974,7 +979,7 @@ partial class Dump
|
||||
_trim &&
|
||||
newTrim)
|
||||
{
|
||||
start = DateTime.UtcNow;
|
||||
_trimStopwatch.Restart();
|
||||
UpdateStatus?.Invoke(Localization.Core.Trimming_skipped_sectors);
|
||||
_dumpLog.WriteLine(Localization.Core.Trimming_skipped_sectors);
|
||||
|
||||
@@ -1012,13 +1017,13 @@ partial class Dump
|
||||
}
|
||||
|
||||
EndProgress?.Invoke();
|
||||
end = DateTime.UtcNow;
|
||||
_trimStopwatch.Stop();
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Trimming_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
_dumpLog.WriteLine(string.Format(Localization.Core.Trimming_finished_in_0,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second)));
|
||||
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
}
|
||||
#endregion Trimming
|
||||
|
||||
@@ -1284,14 +1289,15 @@ partial class Dump
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Closing_output_file);
|
||||
UpdateStatus?.Invoke(Localization.Core.Closing_output_file);
|
||||
DateTime closeStart = DateTime.Now;
|
||||
_imageCloseStopwatch.Restart();
|
||||
outputFormat.Close();
|
||||
DateTime closeEnd = DateTime.Now;
|
||||
_imageCloseStopwatch.Stop();
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Closed_in_0,
|
||||
(closeEnd - closeStart).Humanize(minUnit: TimeUnit.Second)));
|
||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
_dumpLog.WriteLine(Localization.Core.Closed_in_0, (closeEnd - closeStart).Humanize(minUnit: TimeUnit.Second));
|
||||
_dumpLog.WriteLine(Localization.Core.Closed_in_0,
|
||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
||||
|
||||
if(_aborted)
|
||||
{
|
||||
@@ -1324,11 +1330,11 @@ partial class Dump
|
||||
|
||||
UpdateStatus?.
|
||||
Invoke(string.Format(Localization.Core.Took_a_total_of_0_1_processing_commands_2_checksumming_3_writing_4_closing,
|
||||
(end - start).Humanize(minUnit: TimeUnit.Second),
|
||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second),
|
||||
totalDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
|
||||
totalChkDuration.Milliseconds().Humanize(minUnit: TimeUnit.Second),
|
||||
imageWriteDuration.Seconds().Humanize(minUnit: TimeUnit.Second),
|
||||
(closeEnd - closeStart).Humanize(minUnit: TimeUnit.Second)));
|
||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||
|
||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_speed_0,
|
||||
ByteSize.FromBytes(blockSize * (blocks + 1)).
|
||||
|
||||
Reference in New Issue
Block a user