Rename Aaru.Console project to Aaru.Logging.

This commit is contained in:
2025-08-17 05:50:25 +01:00
parent 1a6f7a02c6
commit 02ec8a05d8
365 changed files with 5465 additions and 5347 deletions

View File

@@ -32,9 +32,9 @@
using System;
using Aaru.CommonTypes.Metadata;
using Aaru.Console;
using Aaru.Decoders.ATA;
using Aaru.Devices;
using Aaru.Logging;
using Spectre.Console;
using Identify = Aaru.CommonTypes.Structs.Devices.ATA.Identify;
@@ -46,7 +46,7 @@ public sealed partial class DeviceReport
/// <returns>Media report</returns>
public TestedMedia ReportAtaMedia()
{
var sense = true;
bool sense = true;
AtaErrorRegistersChs errorChs = new();
AtaErrorRegistersLba28 errorLba = new();
AtaErrorRegistersLba48 errorLba48 = new();
@@ -181,7 +181,7 @@ public sealed partial class DeviceReport
mediaTest.Manufacturer = ataId.MediaManufacturer;
}
var checkCorrectRead = BitConverter.ToUInt64(buffer, 0);
ulong checkCorrectRead = BitConverter.ToUInt64(buffer, 0);
Spectre.ProgressSingleSpinner(ctx =>
{
@@ -535,7 +535,7 @@ public sealed partial class DeviceReport
/// <summary>Creates a report of an ATA device</summary>
public TestedMedia ReportAta(Identify.IdentifyDevice ataId)
{
var sense = true;
bool sense = true;
byte[] readBuf = [];
AtaErrorRegistersChs errorChs = new();
AtaErrorRegistersLba28 errorLba = new();
@@ -998,7 +998,7 @@ public sealed partial class DeviceReport
/// <returns>IDENTIFY ATA DEVICE response without the private fields</returns>
public static byte[] ClearIdentify(byte[] buffer)
{
var empty = new byte[512];
byte[] empty = new byte[512];
Array.Copy(empty, 0, buffer, 20, 20);
Array.Copy(empty, 0, buffer, 216, 8);

View File

@@ -36,10 +36,10 @@ using System;
using System.Linq;
using System.Threading;
using Aaru.CommonTypes.Metadata;
using Aaru.Console;
using Aaru.Decoders.CD;
using Aaru.Decoders.SCSI;
using Aaru.Devices;
using Aaru.Logging;
namespace Aaru.Core.Devices.Report;
@@ -58,7 +58,7 @@ public sealed partial class DeviceReport
AaruConsole.Write(Localization.Core
.Have_you_previously_tried_with_a_GD_ROM_disc_and_did_the_computer_hang_or_crash_Q);
pressedKey = System.Console.ReadKey();
pressedKey = Console.ReadKey();
AaruConsole.WriteLine();
}
@@ -76,11 +76,11 @@ public sealed partial class DeviceReport
AaruConsole.WriteLine(Localization.Core.Please_insert_trap_disc_inside);
AaruConsole.WriteLine(Localization.Core.Press_any_key_to_continue);
System.Console.ReadLine();
Console.ReadLine();
AaruConsole.WriteLine(Localization.Core.Sending_READ_FULL_TOC_to_the_device);
var retries = 0;
int retries = 0;
bool sense;
byte[] buffer;
byte[] senseBuffer;
@@ -139,8 +139,8 @@ public sealed partial class DeviceReport
return;
}
int min = 0, sec, frame;
var tocIsNotBcd = false;
int min = 0, sec, frame;
bool tocIsNotBcd = false;
report.GdRomSwapDiscCapabilities.SwapDiscLeadOutPMIN = leadOutTrack.PMIN;
report.GdRomSwapDiscCapabilities.SwapDiscLeadOutPSEC = leadOutTrack.PSEC;
@@ -194,7 +194,7 @@ public sealed partial class DeviceReport
AaruConsole.WriteLine(Localization.Core.Please_MANUALLY_get_the_trap_disc_out_and_put_the_GD_ROM_disc_inside);
AaruConsole.WriteLine(Localization.Core.Press_any_key_to_continue);
System.Console.ReadLine();
Console.ReadLine();
AaruConsole.WriteLine(Localization.Core.Waiting_5_seconds);
Thread.Sleep(5000);
@@ -1743,16 +1743,16 @@ public sealed partial class DeviceReport
? Localization.Core.Success
: Localization.Core.FAIL);
if(report.GdRomSwapDiscCapabilities.Lba45000Readable == false &&
report.GdRomSwapDiscCapabilities.Lba50000Readable == false &&
report.GdRomSwapDiscCapabilities.Lba100000Readable == false &&
report.GdRomSwapDiscCapabilities.Lba400000Readable == false &&
report.GdRomSwapDiscCapabilities.Lba450000Readable == false &&
report.GdRomSwapDiscCapabilities.Lba45000AudioReadable == false &&
report.GdRomSwapDiscCapabilities.Lba50000AudioReadable == false &&
report.GdRomSwapDiscCapabilities.Lba100000AudioReadable == false &&
report.GdRomSwapDiscCapabilities.Lba400000AudioReadable == false &&
report.GdRomSwapDiscCapabilities.Lba450000AudioReadable == false)
if(!report.GdRomSwapDiscCapabilities.Lba45000Readable &&
!report.GdRomSwapDiscCapabilities.Lba50000Readable &&
!report.GdRomSwapDiscCapabilities.Lba100000Readable &&
!report.GdRomSwapDiscCapabilities.Lba400000Readable &&
!report.GdRomSwapDiscCapabilities.Lba450000Readable &&
!report.GdRomSwapDiscCapabilities.Lba45000AudioReadable &&
!report.GdRomSwapDiscCapabilities.Lba50000AudioReadable &&
!report.GdRomSwapDiscCapabilities.Lba100000AudioReadable &&
!report.GdRomSwapDiscCapabilities.Lba400000AudioReadable &&
!report.GdRomSwapDiscCapabilities.Lba450000AudioReadable)
return;
pressedKey = new ConsoleKeyInfo();
@@ -1761,19 +1761,19 @@ public sealed partial class DeviceReport
{
AaruConsole.Write(Localization.Core.Test_read_whole_high_density_area_proceed_Q);
pressedKey = System.Console.ReadKey();
pressedKey = Console.ReadKey();
AaruConsole.WriteLine();
}
if(pressedKey.Key == ConsoleKey.N) return;
uint startingSector = 45000;
var readAsAudio = false;
var aborted = false;
bool readAsAudio = false;
bool aborted = false;
MmcSubchannel subchannel = MmcSubchannel.None;
uint blockSize = 2352;
if(report.GdRomSwapDiscCapabilities.Lba45000Readable == false)
if(!report.GdRomSwapDiscCapabilities.Lba45000Readable)
{
startingSector = 45000;
readAsAudio = false;
@@ -1783,7 +1783,7 @@ public sealed partial class DeviceReport
subchannel = MmcSubchannel.Raw;
else if(report.GdRomSwapDiscCapabilities.Lba45000PqReadable) subchannel = MmcSubchannel.Q16;
}
else if(report.GdRomSwapDiscCapabilities.Lba50000Readable == false)
else if(!report.GdRomSwapDiscCapabilities.Lba50000Readable)
{
startingSector = 50000;
readAsAudio = false;
@@ -1793,7 +1793,7 @@ public sealed partial class DeviceReport
subchannel = MmcSubchannel.Raw;
else if(report.GdRomSwapDiscCapabilities.Lba50000PqReadable) subchannel = MmcSubchannel.Q16;
}
else if(report.GdRomSwapDiscCapabilities.Lba100000Readable == false)
else if(!report.GdRomSwapDiscCapabilities.Lba100000Readable)
{
startingSector = 100000;
readAsAudio = false;
@@ -1803,7 +1803,7 @@ public sealed partial class DeviceReport
subchannel = MmcSubchannel.Raw;
else if(report.GdRomSwapDiscCapabilities.Lba100000PqReadable) subchannel = MmcSubchannel.Q16;
}
else if(report.GdRomSwapDiscCapabilities.Lba400000Readable == false)
else if(!report.GdRomSwapDiscCapabilities.Lba400000Readable)
{
startingSector = 400000;
readAsAudio = false;
@@ -1813,7 +1813,7 @@ public sealed partial class DeviceReport
subchannel = MmcSubchannel.Raw;
else if(report.GdRomSwapDiscCapabilities.Lba400000PqReadable) subchannel = MmcSubchannel.Q16;
}
else if(report.GdRomSwapDiscCapabilities.Lba450000Readable == false)
else if(!report.GdRomSwapDiscCapabilities.Lba450000Readable)
{
startingSector = 450000;
readAsAudio = false;
@@ -1823,7 +1823,7 @@ public sealed partial class DeviceReport
subchannel = MmcSubchannel.Raw;
else if(report.GdRomSwapDiscCapabilities.Lba450000PqReadable) subchannel = MmcSubchannel.Q16;
}
else if(report.GdRomSwapDiscCapabilities.Lba45000AudioReadable == false)
else if(!report.GdRomSwapDiscCapabilities.Lba45000AudioReadable)
{
startingSector = 45000;
readAsAudio = true;
@@ -1833,7 +1833,7 @@ public sealed partial class DeviceReport
subchannel = MmcSubchannel.Raw;
else if(report.GdRomSwapDiscCapabilities.Lba45000AudioPqReadable) subchannel = MmcSubchannel.Q16;
}
else if(report.GdRomSwapDiscCapabilities.Lba50000AudioReadable == false)
else if(!report.GdRomSwapDiscCapabilities.Lba50000AudioReadable)
{
startingSector = 50000;
readAsAudio = true;
@@ -1843,7 +1843,7 @@ public sealed partial class DeviceReport
subchannel = MmcSubchannel.Raw;
else if(report.GdRomSwapDiscCapabilities.Lba50000AudioPqReadable) subchannel = MmcSubchannel.Q16;
}
else if(report.GdRomSwapDiscCapabilities.Lba100000AudioReadable == false)
else if(!report.GdRomSwapDiscCapabilities.Lba100000AudioReadable)
{
startingSector = 100000;
readAsAudio = true;
@@ -1853,7 +1853,7 @@ public sealed partial class DeviceReport
subchannel = MmcSubchannel.Raw;
else if(report.GdRomSwapDiscCapabilities.Lba100000AudioPqReadable) subchannel = MmcSubchannel.Q16;
}
else if(report.GdRomSwapDiscCapabilities.Lba400000AudioReadable == false)
else if(!report.GdRomSwapDiscCapabilities.Lba400000AudioReadable)
{
startingSector = 400000;
readAsAudio = true;
@@ -1863,7 +1863,7 @@ public sealed partial class DeviceReport
subchannel = MmcSubchannel.Raw;
else if(report.GdRomSwapDiscCapabilities.Lba400000AudioPqReadable) subchannel = MmcSubchannel.Q16;
}
else if(report.GdRomSwapDiscCapabilities.Lba450000AudioReadable == false)
else if(!report.GdRomSwapDiscCapabilities.Lba450000AudioReadable)
{
startingSector = 450000;
readAsAudio = true;
@@ -1874,7 +1874,7 @@ public sealed partial class DeviceReport
else if(report.GdRomSwapDiscCapabilities.Lba450000AudioPqReadable) subchannel = MmcSubchannel.Q16;
}
System.Console.CancelKeyPress += (_, e) =>
Console.CancelKeyPress += (_, e) =>
{
e.Cancel = true;
aborted = true;
@@ -1896,7 +1896,7 @@ public sealed partial class DeviceReport
byte[] lastSuccessfulPq = null;
byte[] lastSuccessfulRw = null;
var trackModeChange = false;
bool trackModeChange = false;
AaruConsole.WriteLine();

View File

@@ -34,12 +34,12 @@ using System;
using System.Linq;
using System.Text;
using Aaru.CommonTypes.Metadata;
using Aaru.Console;
using Aaru.Decoders.CD;
using Aaru.Decoders.SCSI;
using Aaru.Decoders.SCSI.MMC;
using Aaru.Devices;
using Aaru.Helpers;
using Aaru.Logging;
using Spectre.Console;
namespace Aaru.Core.Devices.Report;
@@ -52,8 +52,8 @@ public sealed partial class DeviceReport
while(offset + 4 < response.Length)
{
var code = (ushort)((response[offset + 0] << 8) + response[offset + 1]);
var data = new byte[response[offset + 3] + 4];
ushort code = (ushort)((response[offset + 0] << 8) + response[offset + 1]);
byte[] data = new byte[response[offset + 3] + 4];
if(code != 0x0108)
{
@@ -75,7 +75,7 @@ public sealed partial class DeviceReport
/// <returns>MMC features report</returns>
public MmcFeatures ReportMmcFeatures()
{
var sense = true;
bool sense = true;
byte[] buffer = [];
Spectre.ProgressSingleSpinner(ctx =>
@@ -477,7 +477,7 @@ public sealed partial class DeviceReport
if(ftr010C.HasValue)
{
var temp = new byte[4];
byte[] temp = new byte[4];
temp[0] = (byte)((ftr010C.Value.Century & 0xFF00) >> 8);
temp[1] = (byte)(ftr010C.Value.Century & 0xFF);
temp[2] = (byte)((ftr010C.Value.Year & 0xFF00) >> 8);
@@ -579,7 +579,7 @@ public sealed partial class DeviceReport
public TestedMedia ReportMmcMedia(string mediaType, bool tryPlextor, bool tryPioneer, bool tryNec, bool tryHldtst,
bool tryMediaTekF106, bool tryLiteOn)
{
var sense = true;
bool sense = true;
byte[] buffer = [];
byte[] senseBuffer = [];
var mediaTest = new TestedMedia();
@@ -610,7 +610,7 @@ public sealed partial class DeviceReport
if(!sense && !_dev.Error)
{
mediaTest.SupportsReadCapacity16 = true;
var temp = new byte[8];
byte[] temp = new byte[8];
Array.Copy(buffer, 0, temp, 0, 8);
Array.Reverse(temp);
mediaTest.Blocks = BitConverter.ToUInt64(temp, 0) + 1;
@@ -2779,8 +2779,8 @@ public sealed partial class DeviceReport
if(tryMediaTekF106)
{
var triedLba0 = false;
var triedLeadOut = false;
bool triedLba0 = false;
bool triedLeadOut = false;
Spectre.ProgressSingleSpinner(ctx =>
{
@@ -3099,16 +3099,16 @@ public sealed partial class DeviceReport
secondSessionFirstTrack.PFRAME);
// Skip Lead-Out pre-gap
var firstSessionLeadOutLba = (uint)(firstSessionLeadOutTrack.PMIN * 60 * 75 +
firstSessionLeadOutTrack.PSEC * 75 +
firstSessionLeadOutTrack.PFRAME +
150);
uint firstSessionLeadOutLba = (uint)(firstSessionLeadOutTrack.PMIN * 60 * 75 +
firstSessionLeadOutTrack.PSEC * 75 +
firstSessionLeadOutTrack.PFRAME +
150);
// Skip second session track pre-gap
var secondSessionLeadInLba = (uint)(secondSessionFirstTrack.PMIN * 60 * 75 +
secondSessionFirstTrack.PSEC * 75 +
secondSessionFirstTrack.PFRAME -
300);
uint secondSessionLeadInLba = (uint)(secondSessionFirstTrack.PMIN * 60 * 75 +
secondSessionFirstTrack.PSEC * 75 +
secondSessionFirstTrack.PFRAME -
300);
Spectre.ProgressSingleSpinner(ctx =>
{

View File

@@ -35,10 +35,10 @@ using System.Collections.Generic;
using System.Linq;
using Aaru.CommonTypes.Metadata;
using Aaru.CommonTypes.Structs.Devices.SCSI;
using Aaru.Console;
using Aaru.Decoders.SCSI;
using Aaru.Devices;
using Aaru.Helpers;
using Aaru.Logging;
using Spectre.Console;
using Inquiry = Aaru.CommonTypes.Structs.Devices.SCSI.Inquiry;
@@ -50,7 +50,7 @@ public sealed partial class DeviceReport
/// <returns>SCSI report</returns>
public Scsi ReportScsiInquiry()
{
var sense = true;
bool sense = true;
byte[] buffer = [];
Spectre.ProgressSingleSpinner(ctx =>
@@ -85,7 +85,7 @@ public sealed partial class DeviceReport
return inquiry;
// Clear Seagate serial number
for(var i = 36; i <= 43; i++) inquiry[i] = 0;
for(int i = 36; i <= 43; i++) inquiry[i] = 0;
return inquiry;
}
@@ -95,7 +95,7 @@ public sealed partial class DeviceReport
/// <returns>List of decoded SCSI EVPD pages</returns>
public List<ScsiPage> ReportEvpdPages(string vendor)
{
var sense = false;
bool sense = false;
byte[] buffer = [];
Spectre.ProgressSingleSpinner(ctx =>
@@ -135,7 +135,7 @@ public sealed partial class DeviceReport
break;
case 0x80:
var identify = new byte[512];
byte[] identify = new byte[512];
Array.Copy(buffer, 60, identify, 0, 512);
identify = ClearIdentify(identify);
Array.Copy(identify, 0, buffer, 60, 512);
@@ -184,7 +184,7 @@ public sealed partial class DeviceReport
if(pageResponse.Length < 6) return null;
var position = 4;
int position = 4;
while(position < pageResponse.Length)
{
@@ -192,7 +192,7 @@ public sealed partial class DeviceReport
if(length + position + 4 >= pageResponse.Length) length = (byte)(pageResponse.Length - position - 4);
var empty = new byte[length];
byte[] empty = new byte[length];
Array.Copy(empty, 0, pageResponse, position + 4, length);
position += 4 + length;
@@ -226,7 +226,7 @@ public sealed partial class DeviceReport
ScsiModeSensePageControl.Changeable
})
{
var saveBuffer = false;
bool saveBuffer = false;
sense = _dev.ModeSense10(out byte[] mode10Buffer,
out _,
@@ -335,7 +335,7 @@ public sealed partial class DeviceReport
ScsiModeSensePageControl.Changeable
})
{
var saveBuffer = false;
bool saveBuffer = false;
sense = _dev.ModeSense6(out byte[] mode6Buffer,
out _,
@@ -511,7 +511,7 @@ public sealed partial class DeviceReport
public TestedMedia ReportScsiMedia()
{
var mediaTest = new TestedMedia();
var sense = true;
bool sense = true;
byte[] buffer = [];
byte[] senseBuffer = [];
@@ -541,7 +541,7 @@ public sealed partial class DeviceReport
if(!sense && !_dev.Error)
{
mediaTest.SupportsReadCapacity16 = true;
var temp = new byte[8];
byte[] temp = new byte[8];
Array.Copy(buffer, 0, temp, 0, 8);
Array.Reverse(temp);
mediaTest.Blocks = BitConverter.ToUInt64(temp, 0) + 1;
@@ -883,7 +883,7 @@ public sealed partial class DeviceReport
/// <returns>Media report</returns>
public TestedMedia ReportScsi()
{
var sense = true;
bool sense = true;
byte[] buffer = [];
byte[] senseBuffer = [];
@@ -918,7 +918,7 @@ public sealed partial class DeviceReport
if(!sense && !_dev.Error)
{
capabilities.SupportsReadCapacity16 = true;
var temp = new byte[8];
byte[] temp = new byte[8];
Array.Copy(buffer, 0, temp, 0, 8);
Array.Reverse(temp);
capabilities.Blocks = BitConverter.ToUInt64(temp, 0) + 1;

View File

@@ -32,7 +32,7 @@
using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Metadata;
using Aaru.Console;
using Aaru.Logging;
using Spectre.Console;
namespace Aaru.Core.Devices.Report;
@@ -44,7 +44,7 @@ public sealed partial class DeviceReport
public MmcSd MmcSdReport()
{
var report = new MmcSd();
var sense = true;
bool sense = true;
byte[] cid = [];
byte[] csd = [];
byte[] ecsd = [];