mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
General cleanup and refactor.
This commit is contained in:
@@ -30,13 +30,13 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Core.Devices.Scanning;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Aaru.CommonTypes.Structs.Devices.ATA;
|
||||
using Aaru.Core.Logging;
|
||||
|
||||
namespace Aaru.Core.Devices.Scanning;
|
||||
|
||||
/// <summary>Implements scanning the media from an ATA device</summary>
|
||||
public sealed partial class MediaScan
|
||||
{
|
||||
@@ -210,12 +210,12 @@ public sealed partial class MediaScan
|
||||
InitProgress?.Invoke();
|
||||
|
||||
if(ataReader.CanSeekLba && _seekTest)
|
||||
for(int i = 0; i < seekTimes; i++)
|
||||
for(var i = 0; i < seekTimes; i++)
|
||||
{
|
||||
if(_aborted)
|
||||
break;
|
||||
|
||||
uint seekPos = (uint)rnd.Next((int)results.Blocks);
|
||||
var seekPos = (uint)rnd.Next((int)results.Blocks);
|
||||
|
||||
PulseProgress?.Invoke($"Seeking to sector {seekPos}...\t\t");
|
||||
|
||||
@@ -326,17 +326,16 @@ public sealed partial class MediaScan
|
||||
InitProgress?.Invoke();
|
||||
|
||||
if(ataReader.CanSeek)
|
||||
for(int i = 0; i < seekTimes; i++)
|
||||
for(var i = 0; i < seekTimes; i++)
|
||||
{
|
||||
if(_aborted)
|
||||
break;
|
||||
|
||||
ushort seekCy = (ushort)rnd.Next(cylinders);
|
||||
byte seekHd = (byte)rnd.Next(heads);
|
||||
byte seekSc = (byte)rnd.Next(sectors);
|
||||
var seekCy = (ushort)rnd.Next(cylinders);
|
||||
var seekHd = (byte)rnd.Next(heads);
|
||||
var seekSc = (byte)rnd.Next(sectors);
|
||||
|
||||
PulseProgress?.
|
||||
Invoke($"\rSeeking to cylinder {seekCy}, head {seekHd}, sector {seekSc}...\t\t");
|
||||
PulseProgress?.Invoke($"\rSeeking to cylinder {seekCy}, head {seekHd}, sector {seekSc}...\t\t");
|
||||
|
||||
ataReader.SeekChs(seekCy, seekHd, seekSc, out seekCur);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user