diff --git a/DiscImageChef.Core/Devices/Report/ATA.cs b/DiscImageChef.Core/Devices/Report/ATA.cs index 0e724818b..eebb972fd 100644 --- a/DiscImageChef.Core/Devices/Report/ATA.cs +++ b/DiscImageChef.Core/Devices/Report/ATA.cs @@ -58,8 +58,6 @@ namespace DiscImageChef.Core.Devices.Report const uint TIMEOUT = 5; - if(dev.IsFireWire) FireWire.Report(dev, ref report, ref removable); - if(dev.IsPcmcia) Pcmcia.Report(dev, ref report); DicConsole.WriteLine("Querying ATA IDENTIFY..."); diff --git a/DiscImageChef.Core/Devices/Report/FireWire.cs b/DiscImageChef.Core/Devices/Report/FireWire.cs index a241a463d..ed27508d2 100644 --- a/DiscImageChef.Core/Devices/Report/FireWire.cs +++ b/DiscImageChef.Core/Devices/Report/FireWire.cs @@ -30,56 +30,25 @@ // Copyright © 2011-2018 Natalia Portillo // ****************************************************************************/ -using System; using DiscImageChef.CommonTypes.Metadata; -using DiscImageChef.Console; -using DiscImageChef.Devices; namespace DiscImageChef.Core.Devices.Report { /// /// Implements creating a report for a FireWire device /// - static class FireWire + public partial class DeviceReport { /// /// Fills a device report with parameters specific to a FireWire device /// - /// Device - /// Device report - /// If device is removable - internal static void Report(Device dev, ref DeviceReportV2 report, ref bool removable) - { - if(report == null) return; - - ConsoleKeyInfo pressedKey = new ConsoleKeyInfo(); - while(pressedKey.Key != ConsoleKey.Y && pressedKey.Key != ConsoleKey.N) - { - DicConsole.Write("Is the device natively FireWire (in case of doubt, press Y)? (Y/N): "); - pressedKey = System.Console.ReadKey(); - DicConsole.WriteLine(); - } - - if(pressedKey.Key != ConsoleKey.Y) return; - - report.FireWire = new CommonTypes.Metadata.FireWire + public FireWire FireWireReport() => + new FireWire { Manufacturer = dev.FireWireVendorName, Product = dev.FireWireModelName, ProductID = dev.FireWireModel, VendorID = dev.FireWireVendor }; - - pressedKey = new ConsoleKeyInfo(); - while(pressedKey.Key != ConsoleKey.Y && pressedKey.Key != ConsoleKey.N) - { - DicConsole.Write("Is the media removable from the reading/writing elements? (Y/N): "); - pressedKey = System.Console.ReadKey(); - DicConsole.WriteLine(); - } - - report.FireWire.RemovableMedia = pressedKey.Key == ConsoleKey.Y; - removable = report.FireWire.RemovableMedia; - } } } \ No newline at end of file diff --git a/DiscImageChef.Core/Devices/Report/SCSI/General.cs b/DiscImageChef.Core/Devices/Report/SCSI/General.cs index 68b36016f..0a2f10609 100644 --- a/DiscImageChef.Core/Devices/Report/SCSI/General.cs +++ b/DiscImageChef.Core/Devices/Report/SCSI/General.cs @@ -63,8 +63,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI const uint TIMEOUT = 5; ConsoleKeyInfo pressedKey; - if(dev.IsFireWire) FireWire.Report(dev, ref report, ref removable); - if(dev.IsPcmcia) Pcmcia.Report(dev, ref report); if(!dev.IsUsb && !dev.IsFireWire && dev.IsRemovable) diff --git a/DiscImageChef/Commands/DeviceReport.cs b/DiscImageChef/Commands/DeviceReport.cs index 256cfd5b5..570edaec8 100644 --- a/DiscImageChef/Commands/DeviceReport.cs +++ b/DiscImageChef/Commands/DeviceReport.cs @@ -106,6 +106,33 @@ namespace DiscImageChef.Commands } } + if(dev.IsFireWire) + { + ConsoleKeyInfo pressedKey = new ConsoleKeyInfo(); + while(pressedKey.Key != ConsoleKey.Y && pressedKey.Key != ConsoleKey.N) + { + DicConsole.Write("Is the device natively FireWire (in case of doubt, press Y)? (Y/N): "); + pressedKey = System.Console.ReadKey(); + DicConsole.WriteLine(); + } + + if(pressedKey.Key != ConsoleKey.Y) + { + report.FireWire = reporter.FireWireReport(); + + pressedKey = new ConsoleKeyInfo(); + while(pressedKey.Key != ConsoleKey.Y && pressedKey.Key != ConsoleKey.N) + { + DicConsole.Write("Is the media removable from the reading/writing elements? (Y/N): "); + pressedKey = System.Console.ReadKey(); + DicConsole.WriteLine(); + } + + report.FireWire.RemovableMedia = pressedKey.Key == ConsoleKey.Y; + removable = report.FireWire.RemovableMedia; + } + } + switch(dev.Type) { case DeviceType.ATA: