mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Update ReadSector and ReadSectors methods to include sector status output
This commit is contained in:
@@ -224,8 +224,8 @@ public sealed partial class ImageChecksumViewModel : ViewModelBase
|
||||
[SuppressMessage("ReSharper", "AsyncVoidMethod")]
|
||||
async void DoWork()
|
||||
{
|
||||
var opticalMediaImage = _inputFormat as IOpticalMediaImage;
|
||||
bool formatHasTracks = false;
|
||||
var opticalMediaImage = _inputFormat as IOpticalMediaImage;
|
||||
var formatHasTracks = false;
|
||||
|
||||
if(opticalMediaImage != null)
|
||||
{
|
||||
@@ -321,7 +321,7 @@ public sealed partial class ImageChecksumViewModel : ViewModelBase
|
||||
Progress2Text = $"Hashing track-less sector {sector}";
|
||||
});
|
||||
|
||||
errno = opticalMediaImage.ReadSector(i, out byte[] hiddenSector);
|
||||
errno = opticalMediaImage.ReadSector(i, out byte[] hiddenSector, out _);
|
||||
|
||||
if(errno != ErrorNumber.NoError)
|
||||
{
|
||||
@@ -368,7 +368,8 @@ public sealed partial class ImageChecksumViewModel : ViewModelBase
|
||||
errno = opticalMediaImage.ReadSectors(doneSectors,
|
||||
SECTORS_TO_READ,
|
||||
currentTrack.Sequence,
|
||||
out sector);
|
||||
out sector,
|
||||
out _);
|
||||
|
||||
if(errno != ErrorNumber.NoError)
|
||||
{
|
||||
@@ -398,7 +399,8 @@ public sealed partial class ImageChecksumViewModel : ViewModelBase
|
||||
errno = opticalMediaImage.ReadSectors(doneSectors,
|
||||
(uint)(sectors - doneSectors),
|
||||
currentTrack.Sequence,
|
||||
out sector);
|
||||
out sector,
|
||||
out _);
|
||||
|
||||
if(errno != ErrorNumber.NoError)
|
||||
{
|
||||
@@ -462,7 +464,7 @@ public sealed partial class ImageChecksumViewModel : ViewModelBase
|
||||
Progress2Text = $"Hashing track-less sector {sector}";
|
||||
});
|
||||
|
||||
errno = opticalMediaImage.ReadSector(i, out byte[] hiddenSector);
|
||||
errno = opticalMediaImage.ReadSector(i, out byte[] hiddenSector, out _);
|
||||
|
||||
if(errno != ErrorNumber.NoError)
|
||||
{
|
||||
@@ -524,7 +526,7 @@ public sealed partial class ImageChecksumViewModel : ViewModelBase
|
||||
|
||||
if(_inputFormat.Info.Sectors - doneSectors >= SECTORS_TO_READ)
|
||||
{
|
||||
errno = _inputFormat.ReadSectors(doneSectors, SECTORS_TO_READ, out sector);
|
||||
errno = _inputFormat.ReadSectors(doneSectors, SECTORS_TO_READ, out sector, out _);
|
||||
|
||||
if(errno != ErrorNumber.NoError)
|
||||
{
|
||||
@@ -554,7 +556,8 @@ public sealed partial class ImageChecksumViewModel : ViewModelBase
|
||||
{
|
||||
errno = _inputFormat.ReadSectors(doneSectors,
|
||||
(uint)(_inputFormat.Info.Sectors - doneSectors),
|
||||
out sector);
|
||||
out sector,
|
||||
out _);
|
||||
|
||||
if(errno != ErrorNumber.NoError)
|
||||
{
|
||||
|
||||
@@ -746,8 +746,8 @@ public sealed partial class ImageConvertViewModel : ViewModelBase
|
||||
if(useLong)
|
||||
{
|
||||
errno = sectorsToDo == 1
|
||||
? _inputFormat.ReadSectorLong(doneSectors, out sector)
|
||||
: _inputFormat.ReadSectorsLong(doneSectors, sectorsToDo, out sector);
|
||||
? _inputFormat.ReadSectorLong(doneSectors, out sector, out _)
|
||||
: _inputFormat.ReadSectorsLong(doneSectors, sectorsToDo, out sector, out _);
|
||||
|
||||
if(errno == ErrorNumber.NoError)
|
||||
{
|
||||
@@ -786,8 +786,8 @@ public sealed partial class ImageConvertViewModel : ViewModelBase
|
||||
else
|
||||
{
|
||||
errno = sectorsToDo == 1
|
||||
? _inputFormat.ReadSector(doneSectors, out sector)
|
||||
: _inputFormat.ReadSectors(doneSectors, sectorsToDo, out sector);
|
||||
? _inputFormat.ReadSector(doneSectors, out sector, out _)
|
||||
: _inputFormat.ReadSectors(doneSectors, sectorsToDo, out sector, out _);
|
||||
|
||||
if(errno == ErrorNumber.NoError)
|
||||
{
|
||||
@@ -1205,10 +1205,11 @@ public sealed partial class ImageConvertViewModel : ViewModelBase
|
||||
if(useLong)
|
||||
{
|
||||
errno = sectorsToDo == 1
|
||||
? _inputFormat.ReadSectorLong(doneSectors + track.StartSector, out sector)
|
||||
? _inputFormat.ReadSectorLong(doneSectors + track.StartSector, out sector, out _)
|
||||
: _inputFormat.ReadSectorsLong(doneSectors + track.StartSector,
|
||||
sectorsToDo,
|
||||
out sector);
|
||||
out sector,
|
||||
out _);
|
||||
|
||||
if(errno == ErrorNumber.NoError)
|
||||
{
|
||||
@@ -1247,10 +1248,11 @@ public sealed partial class ImageConvertViewModel : ViewModelBase
|
||||
else
|
||||
{
|
||||
errno = sectorsToDo == 1
|
||||
? _inputFormat.ReadSector(doneSectors + track.StartSector, out sector)
|
||||
? _inputFormat.ReadSector(doneSectors + track.StartSector, out sector, out _)
|
||||
: _inputFormat.ReadSectors(doneSectors + track.StartSector,
|
||||
sectorsToDo,
|
||||
out sector);
|
||||
out sector,
|
||||
out _);
|
||||
|
||||
if(errno == ErrorNumber.NoError)
|
||||
{
|
||||
|
||||
@@ -55,11 +55,12 @@ public sealed partial class ViewSectorViewModel : ViewModelBase
|
||||
[ObservableProperty]
|
||||
string _totalSectorsText;
|
||||
|
||||
// TODO: Show message when sector was not dumped
|
||||
public ViewSectorViewModel([NotNull] IMediaImage inputFormat)
|
||||
{
|
||||
_inputFormat = inputFormat;
|
||||
|
||||
ErrorNumber errno = inputFormat.ReadSectorLong(0, out _);
|
||||
ErrorNumber errno = inputFormat.ReadSectorLong(0, out _, out _);
|
||||
|
||||
if(errno == ErrorNumber.NoError)
|
||||
LongSectorChecked = true;
|
||||
@@ -82,8 +83,8 @@ public sealed partial class ViewSectorViewModel : ViewModelBase
|
||||
SetProperty(ref _sectorNumber, value);
|
||||
|
||||
ErrorNumber errno = LongSectorChecked
|
||||
? _inputFormat.ReadSectorLong((ulong)SectorNumber, out byte[] sector)
|
||||
: _inputFormat.ReadSector((ulong)SectorNumber, out sector);
|
||||
? _inputFormat.ReadSectorLong((ulong)SectorNumber, out byte[] sector, out _)
|
||||
: _inputFormat.ReadSector((ulong)SectorNumber, out sector, out _);
|
||||
|
||||
if(errno == ErrorNumber.NoError) PrintHexText = PrintHex.ByteArrayToHexArrayString(sector, HEX_COLUMNS);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user