Fix byte speed rates not being properly "humanized".

This commit is contained in:
2023-09-26 10:51:43 +01:00
parent 25c5cbaae5
commit 8786474169
22 changed files with 110 additions and 87 deletions

View File

@@ -233,7 +233,7 @@ public partial class Dump
minSpeed = currentSpeed;
UpdateProgress?.
Invoke(string.Format(Localization.Core.Reading_sector_0_of_1_2, i, blocks, ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond)),
Invoke(string.Format(Localization.Core.Reading_sector_0_of_1_2, i, blocks, ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()),
(long)i, (long)blocks);
sense = _dev.Read12(out readBuffer, out senseBuf, 0, false, true, false, false, (uint)(umdStart + (i * 4)),
@@ -396,7 +396,7 @@ public partial class Dump
if(dcMode6.HasValue)
foreach(Modes.ModePage modePage in dcMode6.Value.Pages.Where(modePage =>
modePage is { Page: 0x01, Subpage: 0x00 }))
modePage is { Page: 0x01, Subpage: 0x00 }))
currentModePage = modePage;
}
@@ -617,14 +617,15 @@ public partial class Dump
UpdateStatus?.Invoke(string.Format(Localization.Core.Average_speed_0,
ByteSize.FromBytes(blockSize * (blocks + 1)).
Per(totalDuration.Milliseconds())));
Per(totalDuration.Milliseconds()).Humanize()));
if(maxSpeed > 0)
UpdateStatus?.Invoke(string.Format(Localization.Core.Fastest_speed_burst_0, ByteSize.FromMegabytes(maxSpeed).Per(_oneSecond)));
UpdateStatus?.Invoke(string.Format(Localization.Core.Fastest_speed_burst_0,
ByteSize.FromMegabytes(maxSpeed).Per(_oneSecond).Humanize()));
if(minSpeed is > 0 and < double.MaxValue)
UpdateStatus?.Invoke(string.Format(Localization.Core.Slowest_speed_burst_0,
ByteSize.FromMegabytes(minSpeed).Per(_oneSecond)));
ByteSize.FromMegabytes(minSpeed).Per(_oneSecond).Humanize()));
UpdateStatus?.Invoke(string.Format(Localization.Core._0_sectors_could_not_be_read, _resume.BadBlocks.Count));
UpdateStatus?.Invoke("");