diff --git a/Aaru.Core/Devices/ReaderSCSI.cs b/Aaru.Core/Devices/ReaderSCSI.cs index 78a84575f..b8c47d117 100644 --- a/Aaru.Core/Devices/ReaderSCSI.cs +++ b/Aaru.Core/Devices/ReaderSCSI.cs @@ -612,26 +612,27 @@ sealed partial class Reader if(CanReadRaw) { if(_readLong16) - AaruLogging.WriteLine(Localization.Core.Using_SCSI_READ_LONG_16_command); + AaruLogging.WriteLine($"[slateblue1]{Localization.Core.Using_SCSI_READ_LONG_16_command}[/]"); else if(_readLong10 || _readLongDvd) - AaruLogging.WriteLine(Localization.Core.Using_SCSI_READ_LONG_10_command); + AaruLogging.WriteLine($"[slateblue1]{Localization.Core.Using_SCSI_READ_LONG_10_command}[/]"); else if(_syqReadLong10) - AaruLogging.WriteLine(Localization.Core.Using_SyQuest_READ_LONG_10_command); + AaruLogging.WriteLine($"[slateblue1]{Localization.Core.Using_SyQuest_READ_LONG_10_command}[/]"); else if(_syqReadLong6) - AaruLogging.WriteLine(Localization.Core.Using_SyQuest_READ_LONG_6_command); + AaruLogging.WriteLine($"[slateblue1]{Localization.Core.Using_SyQuest_READ_LONG_6_command}[/]"); else if(HldtstReadRaw) - AaruLogging.WriteLine(Localization.Core.Using_HL_DT_ST_raw_DVD_reading); + AaruLogging.WriteLine($"[slateblue1]{Localization.Core.Using_HL_DT_ST_raw_DVD_reading}[/]"); else if(_plextorReadRaw) - AaruLogging.WriteLine(Localization.Core.Using_Plextor_raw_DVD_reading); - else if(LiteOnReadRaw) AaruLogging.WriteLine(Localization.Core.Using_Lite_On_raw_DVD_reading); + AaruLogging.WriteLine($"[slateblue1]{Localization.Core.Using_Plextor_raw_DVD_reading}[/]"); + else if(LiteOnReadRaw) + AaruLogging.WriteLine($"[slateblue1]{Localization.Core.Using_Lite_On_raw_DVD_reading}[/]"); } else if(_read6) - AaruLogging.WriteLine(Localization.Core.Using_SCSI_READ_6_command); + AaruLogging.WriteLine($"[slateblue1]{Localization.Core.Using_SCSI_READ_6_command}[/]"); else if(_read10) - AaruLogging.WriteLine(Localization.Core.Using_SCSI_READ_10_command); + AaruLogging.WriteLine($"[slateblue1]{Localization.Core.Using_SCSI_READ_10_command}[/]"); else if(_read12) - AaruLogging.WriteLine(Localization.Core.Using_SCSI_READ_12_command); - else if(_read16) AaruLogging.WriteLine(Localization.Core.Using_SCSI_READ_16_command); + AaruLogging.WriteLine($"[slateblue1]{Localization.Core.Using_SCSI_READ_12_command}[/]"); + else if(_read16) AaruLogging.WriteLine($"[slateblue1]{Localization.Core.Using_SCSI_READ_16_command}[/]"); return false; } diff --git a/Aaru.Core/Devices/Scanning/SCSI.cs b/Aaru.Core/Devices/Scanning/SCSI.cs index 4bc6a2469..068eac356 100644 --- a/Aaru.Core/Devices/Scanning/SCSI.cs +++ b/Aaru.Core/Devices/Scanning/SCSI.cs @@ -80,7 +80,9 @@ public sealed partial class MediaScan while(leftRetries > 0) { - PulseProgress?.Invoke(Localization.Core.Waiting_for_drive_to_become_ready); + PulseProgress + ?.Invoke($"[olive]{Localization.Core.Waiting_for_drive_to_become_ready}[/]"); + Thread.Sleep(2000); sense = _dev.ScsiTestUnitReady(out senseBuf, _dev.Timeout, out _); @@ -104,7 +106,9 @@ public sealed partial class MediaScan while(leftRetries > 0) { - PulseProgress?.Invoke(Localization.Core.Waiting_for_drive_to_become_ready); + PulseProgress + ?.Invoke($"[olive]{Localization.Core.Waiting_for_drive_to_become_ready}[/]"); + Thread.Sleep(2000); sense = _dev.ScsiTestUnitReady(out senseBuf, _dev.Timeout, out _); @@ -132,7 +136,9 @@ public sealed partial class MediaScan while(leftRetries > 0) { - PulseProgress?.Invoke(Localization.Core.Waiting_for_drive_to_become_ready); + PulseProgress + ?.Invoke($"[olive]{Localization.Core.Waiting_for_drive_to_become_ready}[/]"); + Thread.Sleep(2000); sense = _dev.ScsiTestUnitReady(out senseBuf, _dev.Timeout, out _); @@ -197,12 +203,12 @@ public sealed partial class MediaScan { results.Blocks++; - UpdateStatus?.Invoke(string.Format(Localization.Core - .Media_has_0_blocks_of_1_bytes_each_for_a_total_of_2, - results.Blocks, - blockSize, - ByteSize.FromBytes(results.Blocks * blockSize) - .ToString("0.000"))); + UpdateStatus?.Invoke(string.Format($"[slateblue1]{Localization.Core + .Media_has_0_blocks_of_1_bytes_each_for_a_total_of_2}[/]", + $"[violet]{results.Blocks}[/]", + $"[lime]{blockSize}[/]", + $"[lime]{ByteSize.FromBytes(results.Blocks * blockSize) + .ToString("0.000")}[/]")); } break; @@ -314,7 +320,7 @@ public sealed partial class MediaScan out _); if(readcd) - UpdateStatus?.Invoke(Localization.Core.Using_MMC_READ_CD_command); + UpdateStatus?.Invoke($"[slateblue1]{Localization.Core.Using_MMC_READ_CD_command}[/]"); else if(!foundReadCommand) { StoppingErrorMessage?.Invoke(Localization.Core.Unable_to_read_medium); @@ -360,7 +366,8 @@ public sealed partial class MediaScan return results; } - UpdateStatus?.Invoke(string.Format(Localization.Core.Reading_0_sectors_at_a_time, blocksToRead)); + UpdateStatus?.Invoke(string.Format($"[slateblue1]{Localization.Core.Reading_0_sectors_at_a_time}[/]", + $"[violet]{blocksToRead}[/]")); InitBlockMap?.Invoke(results.Blocks, blockSize, blocksToRead, currentProfile); mhddLog = new MhddLog(_mhddLogPath, _dev, results.Blocks, blockSize, blocksToRead, false); @@ -382,10 +389,10 @@ public sealed partial class MediaScan if(currentSpeed < results.MinSpeed && currentSpeed > 0) results.MinSpeed = currentSpeed; - UpdateProgress?.Invoke(string.Format(Localization.Core.Reading_sector_0_of_1_2, - i, - results.Blocks, - ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()), + UpdateProgress?.Invoke(string.Format($"[slateblue1]{Localization.Core.Reading_sector_0_of_1_2}[/]", + $"[lima]{i}[/]", + $"[violet]{results.Blocks}[/]", + $"[aqua]{ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()}[/]"), (long)i, (long)results.Blocks); @@ -454,8 +461,8 @@ public sealed partial class MediaScan if(readcd) { AaruLogging.Debug(MODULE_NAME, - Localization.Core.READ_CD_error_0, - Sense.PrettifySense(senseBuf)); + Localization.Core.READ_CD_error_0, + Sense.PrettifySense(senseBuf)); senseDecoded = Sense.Decode(senseBuf); @@ -532,7 +539,8 @@ public sealed partial class MediaScan { _scanStopwatch.Restart(); - UpdateStatus?.Invoke(string.Format(Localization.Core.Reading_0_sectors_at_a_time, scsiReader.BlocksToRead)); + UpdateStatus?.Invoke(string.Format($"[slateblue1]{Localization.Core.Reading_0_sectors_at_a_time}[/]", + $"[violet]{scsiReader.BlocksToRead}[/]")); InitBlockMap?.Invoke(results.Blocks, blockSize, scsiReader.BlocksToRead, currentProfile); mhddLog = new MhddLog(_mhddLogPath, _dev, results.Blocks, blockSize, scsiReader.BlocksToRead, false); @@ -554,10 +562,10 @@ public sealed partial class MediaScan if(currentSpeed < results.MinSpeed && currentSpeed > 0) results.MinSpeed = currentSpeed; - UpdateProgress?.Invoke(string.Format(Localization.Core.Reading_sector_0_of_1_2, - i, - results.Blocks, - ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()), + UpdateProgress?.Invoke(string.Format($"[slateblue1]{Localization.Core.Reading_sector_0_of_1_2}[/]", + $"[lime]{i}[/]", + $"[violet]{results.Blocks}[/]", + $"[aqua]{ByteSize.FromMegabytes(currentSpeed).Per(_oneSecond).Humanize()}[/]"), (long)i, (long)results.Blocks); @@ -652,7 +660,8 @@ public sealed partial class MediaScan uint seekPos = (uint)rnd.Next((int)results.Blocks); - PulseProgress?.Invoke(string.Format(Localization.Core.Seeking_to_sector_0, seekPos)); + PulseProgress?.Invoke(string.Format($"[slateblue1]{Localization.Core.Seeking_to_sector_0}[/]", + $"[lime]{seekPos}[/]")); double seekCur; diff --git a/Aaru.Localization/Core.resx b/Aaru.Localization/Core.resx index 95f9d595c..4f39e308f 100644 --- a/Aaru.Localization/Core.resx +++ b/Aaru.Localization/Core.resx @@ -2322,7 +2322,7 @@ It has no sense to do it, and it will put too much strain on the tape. Error trying to decode TOC... - Using MMC READ CD command. + Using [fuchsia]MMC READ CD[/] command. READ CD error: @@ -2350,34 +2350,34 @@ It has no sense to do it, and it will put too much strain on the tape. Device needs CHS commands but I can't issue them... Aborting. - Using ATA READ DMA EXT command. + Using [fuchsia]ATA READ DMA EXT[/] command. - Using ATA READ EXT command. + Using [fuchsia]ATA READ EXT[/] command. - Using ATA READ DMA command with retries (LBA). + Using [fuchsia]ATA READ DMA[/] command with retries (LBA). - Using ATA READ DMA command (LBA). + Using [fuchsia]ATA READ DMA[/] command (LBA). - Using ATA READ command with retries (LBA). + Using [fuchsia]ATA READ[/] command with retries (LBA). - Using ATA READ command (LBA). + Using [fuchsia]ATA READ[/] command (LBA). - Using ATA READ DMA command with retries (CHS). + Using [fuchsia]ATA READ DMA[/] command with retries (CHS). - Using ATA READ DMA command (CHS). + Using [fuchsia]ATA READ DMA[/] command (CHS). - Using ATA READ command with retries (CHS). + Using [fuchsia]ATA READ[/] command with retries (CHS). - Using ATA READ command (CHS). + Using [fuchsia]ATA READ[/] command (CHS). Could not get a working read command! @@ -2392,31 +2392,31 @@ It has no sense to do it, and it will put too much strain on the tape. Device only supports SCSI READ (10) but has more than {0} blocks ({1} blocks total) - Using SCSI READ LONG (16) command. + Using [fuchsia]SCSI READ LONG (16)[/] command. - Using SCSI READ LONG (10) command. + Using [fuchsia]SCSI READ LONG (10)[/] command. - Using SyQuest READ LONG (10) command. + Using [fuchsia]SyQuest READ LONG (10)[/] command. - Using SyQuest READ LONG (6) command. + Using [fuchsia]SyQuest READ LONG (6)[/] command. - Using HL-DT-ST raw DVD reading. + Using [fuchsia]HL-DT-ST raw DVD[/] reading. - Using Plextor raw DVD reading. + Using [fuchsia]Plextor raw DVD[/] reading. - Using SCSI READ (6) command. + Using [fuchsia]SCSI READ (6)[/] command. - Using SCSI READ (10) command. + Using [fuchsia]SCSI READ (10)[/] command. - Using SCSI READ (16) command. + Using [fuchsia]SCSI READ (16)[/] command. Unable to get media capacity diff --git a/Aaru/Commands/Media/Scan.cs b/Aaru/Commands/Media/Scan.cs index 968449633..dffb3f46e 100644 --- a/Aaru/Commands/Media/Scan.cs +++ b/Aaru/Commands/Media/Scan.cs @@ -111,17 +111,14 @@ sealed class MediaScanCommand : Command .Columns(new TaskDescriptionColumn(), new ProgressBarColumn(), new PercentageColumn()) .Start(ctx => { - scanner.UpdateStatus += text => { AaruLogging.WriteLine(Markup.Escape(text)); }; + scanner.UpdateStatus += text => { AaruLogging.WriteLine(text); }; - scanner.StoppingErrorMessage += text => - { - AaruLogging.Error($"[red]{Markup.Escape(text)}[/]"); - }; + scanner.StoppingErrorMessage += text => { AaruLogging.Error(text); }; scanner.UpdateProgress += (text, current, maximum) => { _progressTask1 ??= ctx.AddTask("Progress"); - _progressTask1.Description = Markup.Escape(text); + _progressTask1.Description = text; _progressTask1.Value = current; _progressTask1.MaxValue = maximum; }; @@ -129,10 +126,10 @@ sealed class MediaScanCommand : Command scanner.PulseProgress += text => { if(_progressTask1 is null) - ctx.AddTask(Markup.Escape(text)).IsIndeterminate(); + ctx.AddTask(text).IsIndeterminate(); else { - _progressTask1.Description = Markup.Escape(text); + _progressTask1.Description = text; _progressTask1.IsIndeterminate = true; } }; @@ -154,18 +151,18 @@ sealed class MediaScanCommand : Command results = scanner.Scan(); }); - AaruLogging.WriteLine(Localization.Core.Took_a_total_of_0_1_processing_commands, - results.TotalTime.Seconds().Humanize(minUnit: TimeUnit.Second), - results.ProcessingTime.Seconds().Humanize(minUnit: TimeUnit.Second)); + AaruLogging.WriteLine($"[slateblue1]{Localization.Core.Took_a_total_of_0_1_processing_commands}[/]", + $"[teal]{results.TotalTime.Seconds().Humanize(minUnit: TimeUnit.Second)}[/]", + $"[teal]{results.ProcessingTime.Seconds().Humanize(minUnit: TimeUnit.Second)}[/]"); - AaruLogging.WriteLine(Localization.Core.Average_speed_0, - ByteSize.FromBytes(results.AvgSpeed).Per(1.Seconds()).Humanize()); + AaruLogging.WriteLine($"[slateblue1]{Localization.Core.Average_speed_0}[/]", + $"[aqua]{ByteSize.FromBytes(results.AvgSpeed).Per(1.Seconds()).Humanize()}[/]"); - AaruLogging.WriteLine(Localization.Core.Fastest_speed_burst_0, - ByteSize.FromBytes(results.MaxSpeed).Per(1.Seconds()).Humanize()); + AaruLogging.WriteLine($"[slateblue1]{Localization.Core.Fastest_speed_burst_0}[/]", + $"[aqua]{ByteSize.FromBytes(results.MaxSpeed).Per(1.Seconds()).Humanize()}[/]"); - AaruLogging.WriteLine(Localization.Core.Slowest_speed_burst_0, - ByteSize.FromBytes(results.MinSpeed).Per(1.Seconds()).Humanize()); + AaruLogging.WriteLine($"[slateblue1]{Localization.Core.Slowest_speed_burst_0}[/]", + $"[aqua]{ByteSize.FromBytes(results.MinSpeed).Per(1.Seconds()).Humanize()}[/]"); AaruLogging.WriteLine(); AaruLogging.WriteLine($"[bold]{Localization.Core.Summary}:[/]"); @@ -185,19 +182,19 @@ sealed class MediaScanCommand : Command results.UnreadableSectors.Count)}[/]"); foreach(ulong bad in results.UnreadableSectors) - AaruLogging.WriteLine(Localization.Core.Sector_0_could_not_be_read, bad); + AaruLogging.WriteLine($"[red]{Localization.Core.Sector_0_could_not_be_read}[/]", $"[teal]{bad}[/]"); AaruLogging.WriteLine(); if(results.SeekTotal > 0 || results.SeekMin < double.MaxValue || results.SeekMax > double.MinValue) { - AaruLogging.WriteLine(Localization.Core - .Testing_0_seeks_longest_seek_took_1_ms_fastest_one_took_2_ms_3_ms_average, - results.SeekTimes, - results.SeekMax, - results.SeekMin, - results.SeekTotal / 1000); + AaruLogging.WriteLine($"[slateblue1]{Localization.Core + .Testing_0_seeks_longest_seek_took_1_ms_fastest_one_took_2_ms_3_ms_average}[/]", + $"[aqua]{results.SeekTimes}[/]", + $"[aqua]{results.SeekMax}[/]", + $"[aqua]{results.SeekMin}[/]", + $"[aqua]{results.SeekTotal / 1000}[/]"); } dev.Close();