mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Add PulseProgress event to ATA dumper.
This commit is contained in:
@@ -352,7 +352,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
DicConsole.Write("\rTrimming sector {0}", badSector);
|
PulseProgress?.Invoke($"\rTrimming sector {badSector}");
|
||||||
|
|
||||||
bool error = ataReader.ReadBlock(out cmdBuf, badSector, out duration);
|
bool error = ataReader.ReadBlock(out cmdBuf, badSector, out duration);
|
||||||
|
|
||||||
@@ -390,9 +390,9 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
DicConsole.Write("\rRetrying sector {0}, pass {1}, {3}{2}", badSector, pass,
|
PulseProgress?.Invoke(string.Format("\rRetrying sector {0}, pass {1}, {3}{2}",
|
||||||
forward ? "forward" : "reverse",
|
badSector, pass, forward ? "forward" : "reverse",
|
||||||
persistent ? "recovering partial data, " : "");
|
persistent ? "recovering partial data, " : ""));
|
||||||
|
|
||||||
bool error = ataReader.ReadBlock(out cmdBuf, badSector, out duration);
|
bool error = ataReader.ReadBlock(out cmdBuf, badSector, out duration);
|
||||||
|
|
||||||
@@ -452,8 +452,8 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
if(currentSpeed < minSpeed && currentSpeed != 0) minSpeed = currentSpeed;
|
if(currentSpeed < minSpeed && currentSpeed != 0) minSpeed = currentSpeed;
|
||||||
#pragma warning restore RECS0018 // Comparison of floating point numbers with equality operator
|
#pragma warning restore RECS0018 // Comparison of floating point numbers with equality operator
|
||||||
|
|
||||||
DicConsole.Write("\rReading cylinder {0} head {1} sector {2} ({3:F3} MiB/sec.)", cy,
|
PulseProgress
|
||||||
hd, sc, currentSpeed);
|
?.Invoke($"\rReading cylinder {cy} head {hd} sector {sc} ({currentSpeed:F3} MiB/sec.)");
|
||||||
|
|
||||||
bool error = ataReader.ReadChs(out cmdBuf, cy, hd, sc, out duration);
|
bool error = ataReader.ReadChs(out cmdBuf, cy, hd, sc, out duration);
|
||||||
|
|
||||||
|
|||||||
@@ -6,5 +6,6 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
public event ErrorMessageHandler ErrorMessage;
|
public event ErrorMessageHandler ErrorMessage;
|
||||||
public event ErrorMessageHandler StoppingErrorMessage;
|
public event ErrorMessageHandler StoppingErrorMessage;
|
||||||
public event UpdateProgressHandler UpdateProgress;
|
public event UpdateProgressHandler UpdateProgress;
|
||||||
|
public event PulseProgressHandler PulseProgress;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -300,6 +300,7 @@ namespace DiscImageChef.Commands
|
|||||||
dumper.ErrorMessage += Progress.ErrorMessage;
|
dumper.ErrorMessage += Progress.ErrorMessage;
|
||||||
dumper.StoppingErrorMessage += Progress.ErrorMessage;
|
dumper.StoppingErrorMessage += Progress.ErrorMessage;
|
||||||
dumper.UpdateProgress += Progress.UpdateProgress;
|
dumper.UpdateProgress += Progress.UpdateProgress;
|
||||||
|
dumper.PulseProgress += Progress.PulseProgress;
|
||||||
|
|
||||||
if(dev.IsUsb && dev.UsbVendorId == 0x054C &&
|
if(dev.IsUsb && dev.UsbVendorId == 0x054C &&
|
||||||
(dev.UsbProductId == 0x01C8 || dev.UsbProductId == 0x01C9 || dev.UsbProductId == 0x02D2))
|
(dev.UsbProductId == 0x01C8 || dev.UsbProductId == 0x01C9 || dev.UsbProductId == 0x02D2))
|
||||||
|
|||||||
@@ -48,6 +48,11 @@ namespace DiscImageChef
|
|||||||
DicConsole.Write("\r" + text);
|
DicConsole.Write("\r" + text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal static void PulseProgress(string text)
|
||||||
|
{
|
||||||
|
DicConsole.Write("\r" + text);
|
||||||
|
}
|
||||||
|
|
||||||
internal static void InitProgress2() { }
|
internal static void InitProgress2() { }
|
||||||
|
|
||||||
internal static void EndProgress2()
|
internal static void EndProgress2()
|
||||||
|
|||||||
Reference in New Issue
Block a user