mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Use output plugin when dumpìng SSC.
This commit is contained in:
@@ -199,10 +199,13 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ssc();
|
if(outputPlugin is IWritableTapeImage) Ssc();
|
||||||
|
else
|
||||||
|
StoppingErrorMessage
|
||||||
|
?.Invoke("The specified plugin does not support storing streaming tape images.");
|
||||||
return;
|
return;
|
||||||
case PeripheralDeviceTypes.MultiMediaDevice:
|
case PeripheralDeviceTypes.MultiMediaDevice:
|
||||||
if(outputPlugin is IWritableOpticalImage opticalPlugin) Mmc(ref dskType);
|
if(outputPlugin is IWritableOpticalImage) Mmc(ref dskType);
|
||||||
else
|
else
|
||||||
StoppingErrorMessage
|
StoppingErrorMessage
|
||||||
?.Invoke("The specified plugin does not support storing optical disc images.");
|
?.Invoke("The specified plugin does not support storing optical disc images.");
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ using Version = DiscImageChef.CommonTypes.Metadata.Version;
|
|||||||
|
|
||||||
namespace DiscImageChef.Core.Devices.Dumping
|
namespace DiscImageChef.Core.Devices.Dumping
|
||||||
{
|
{
|
||||||
// TODO: Add support for images
|
|
||||||
partial class Dump
|
partial class Dump
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -397,10 +396,21 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ret = outputPlugin.Create(outputPath, dskType, formatOptions, 0, 0);
|
||||||
|
|
||||||
|
// Cannot create image
|
||||||
|
if(!ret)
|
||||||
|
{
|
||||||
|
dumpLog.WriteLine("Error creating output image, not continuing.");
|
||||||
|
dumpLog.WriteLine(outputPlugin.ErrorMessage);
|
||||||
|
StoppingErrorMessage?.Invoke("Error creating output image, not continuing." + Environment.NewLine +
|
||||||
|
outputPlugin.ErrorMessage);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
List<TapePartitionType> partitions = new List<TapePartitionType>();
|
List<TapePartitionType> partitions = new List<TapePartitionType>();
|
||||||
List<TapeFileType> files = new List<TapeFileType>();
|
List<TapeFileType> files = new List<TapeFileType>();
|
||||||
|
|
||||||
DataFile dumpFile = new DataFile(outputPrefix + ".bin");
|
|
||||||
Checksum dataChk = new Checksum();
|
Checksum dataChk = new Checksum();
|
||||||
start = DateTime.UtcNow;
|
start = DateTime.UtcNow;
|
||||||
MhddLog mhddLog = new MhddLog(outputPrefix + ".mhddlog.bin", dev, blocks, blockSize, 1);
|
MhddLog mhddLog = new MhddLog(outputPrefix + ".mhddlog.bin", dev, blocks, blockSize, 1);
|
||||||
@@ -535,7 +545,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
StoppingErrorMessage?.Invoke("Drive could not go back one block. Sense follows..." +
|
StoppingErrorMessage?.Invoke("Drive could not go back one block. Sense follows..." +
|
||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
strSense);
|
strSense);
|
||||||
dumpFile.Close();
|
outputPlugin.Close();
|
||||||
dumpLog.WriteLine("Drive could not go back one block. Sense follows...");
|
dumpLog.WriteLine("Drive could not go back one block. Sense follows...");
|
||||||
dumpLog.WriteLine("Device not ready. Sense {0}h ASC {1:X2}h ASCQ {2:X2}h",
|
dumpLog.WriteLine("Device not ready. Sense {0}h ASC {1:X2}h ASCQ {2:X2}h",
|
||||||
fxSense.Value.SenseKey, fxSense.Value.ASC, fxSense.Value.ASCQ);
|
fxSense.Value.SenseKey, fxSense.Value.ASC, fxSense.Value.ASCQ);
|
||||||
@@ -549,7 +559,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
{
|
{
|
||||||
case SenseKeys.BlankCheck when currentBlock == 0:
|
case SenseKeys.BlankCheck when currentBlock == 0:
|
||||||
StoppingErrorMessage?.Invoke("Cannot dump a blank tape...");
|
StoppingErrorMessage?.Invoke("Cannot dump a blank tape...");
|
||||||
dumpFile.Close();
|
outputPlugin.Close();
|
||||||
dumpLog.WriteLine("Cannot dump a blank tape...");
|
dumpLog.WriteLine("Cannot dump a blank tape...");
|
||||||
return;
|
return;
|
||||||
// For sure this is an end-of-tape/partition
|
// For sure this is an end-of-tape/partition
|
||||||
@@ -622,7 +632,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
|
|
||||||
mhddLog.Write(currentBlock, duration);
|
mhddLog.Write(currentBlock, duration);
|
||||||
ibgLog.Write(currentBlock, currentSpeed * 1024);
|
ibgLog.Write(currentBlock, currentSpeed * 1024);
|
||||||
dumpFile.Write(cmdBuf);
|
outputPlugin.WriteSector(cmdBuf, currentBlock);
|
||||||
|
|
||||||
DateTime chkStart = DateTime.UtcNow;
|
DateTime chkStart = DateTime.UtcNow;
|
||||||
dataChk.Update(cmdBuf);
|
dataChk.Update(cmdBuf);
|
||||||
@@ -648,6 +658,14 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
|
|
||||||
EndProgress?.Invoke();
|
EndProgress?.Invoke();
|
||||||
|
|
||||||
|
dumpLog.WriteLine("Closing output file.");
|
||||||
|
UpdateStatus?.Invoke("Closing output file.");
|
||||||
|
DateTime closeStart = DateTime.Now;
|
||||||
|
outputPlugin.Close();
|
||||||
|
DateTime closeEnd = DateTime.Now;
|
||||||
|
UpdateStatus?.Invoke($"Closed in {(closeEnd - closeStart).TotalSeconds} seconds.");
|
||||||
|
dumpLog.WriteLine("Closed in {0} seconds.", (closeEnd - closeStart).TotalSeconds);
|
||||||
|
|
||||||
blocks = currentBlock + 1;
|
blocks = currentBlock + 1;
|
||||||
end = DateTime.UtcNow;
|
end = DateTime.UtcNow;
|
||||||
mhddLog.Close();
|
mhddLog.Close();
|
||||||
|
|||||||
Reference in New Issue
Block a user