mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Move PCMCIA device reporting to non-static class and its UI to CLI.
This commit is contained in:
@@ -58,8 +58,6 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
|
||||
const uint TIMEOUT = 5;
|
||||
|
||||
if(dev.IsPcmcia) Pcmcia.Report(dev, ref report);
|
||||
|
||||
DicConsole.WriteLine("Querying ATA IDENTIFY...");
|
||||
|
||||
dev.AtaIdentify(out byte[] buffer, out _, TIMEOUT, out _);
|
||||
|
||||
@@ -32,25 +32,22 @@
|
||||
|
||||
using DiscImageChef.CommonTypes.Metadata;
|
||||
using DiscImageChef.Decoders.PCMCIA;
|
||||
using DiscImageChef.Devices;
|
||||
|
||||
namespace DiscImageChef.Core.Devices.Report
|
||||
{
|
||||
/// <summary>
|
||||
/// Implements creating a report for a PCMCIA device
|
||||
/// </summary>
|
||||
static class Pcmcia
|
||||
public partial class DeviceReport
|
||||
{
|
||||
/// <summary>
|
||||
/// Fills a device report with parameters specific to a PCMCIA device
|
||||
/// </summary>
|
||||
/// <param name="dev">Device</param>
|
||||
/// <param name="report">Device report</param>
|
||||
internal static void Report(Device dev, ref DeviceReportV2 report)
|
||||
public Pcmcia PcmciaReport()
|
||||
{
|
||||
report.PCMCIA = new CommonTypes.Metadata.Pcmcia {CIS = dev.Cis};
|
||||
Tuple[] tuples = CIS.GetTuples(dev.Cis);
|
||||
if(tuples == null) return;
|
||||
Pcmcia pcmciaReport = new Pcmcia {CIS = dev.Cis};
|
||||
Tuple[] tuples = CIS.GetTuples(dev.Cis);
|
||||
if(tuples == null) return pcmciaReport;
|
||||
|
||||
foreach(Tuple tuple in tuples)
|
||||
switch(tuple.Code)
|
||||
@@ -60,8 +57,8 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
|
||||
if(manfid != null)
|
||||
{
|
||||
report.PCMCIA.ManufacturerCode = manfid.ManufacturerID;
|
||||
report.PCMCIA.CardCode = manfid.CardID;
|
||||
pcmciaReport.ManufacturerCode = manfid.ManufacturerID;
|
||||
pcmciaReport.CardCode = manfid.CardID;
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -70,14 +67,16 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
|
||||
if(vers != null)
|
||||
{
|
||||
report.PCMCIA.Manufacturer = vers.Manufacturer;
|
||||
report.PCMCIA.ProductName = vers.Product;
|
||||
report.PCMCIA.Compliance = $"{vers.MajorVersion}.{vers.MinorVersion}";
|
||||
report.PCMCIA.AdditionalInformation = vers.AdditionalInformation;
|
||||
pcmciaReport.Manufacturer = vers.Manufacturer;
|
||||
pcmciaReport.ProductName = vers.Product;
|
||||
pcmciaReport.Compliance = $"{vers.MajorVersion}.{vers.MinorVersion}";
|
||||
pcmciaReport.AdditionalInformation = vers.AdditionalInformation;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return pcmciaReport;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -63,8 +63,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
const uint TIMEOUT = 5;
|
||||
ConsoleKeyInfo pressedKey;
|
||||
|
||||
if(dev.IsPcmcia) Pcmcia.Report(dev, ref report);
|
||||
|
||||
if(!dev.IsUsb && !dev.IsFireWire && dev.IsRemovable)
|
||||
{
|
||||
pressedKey = new ConsoleKeyInfo();
|
||||
|
||||
@@ -133,6 +133,8 @@ namespace DiscImageChef.Commands
|
||||
}
|
||||
}
|
||||
|
||||
if(dev.IsPcmcia) report.PCMCIA = reporter.PcmciaReport();
|
||||
|
||||
switch(dev.Type)
|
||||
{
|
||||
case DeviceType.ATA:
|
||||
|
||||
Reference in New Issue
Block a user