mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
REFACTOR: Reformat code.
This commit is contained in:
@@ -86,7 +86,7 @@ namespace DiscImageChef.Tests.Devices.SCSI
|
||||
string strDev;
|
||||
int item;
|
||||
|
||||
parameters:
|
||||
parameters:
|
||||
while(true)
|
||||
{
|
||||
System.Console.Clear();
|
||||
@@ -122,24 +122,26 @@ namespace DiscImageChef.Tests.Devices.SCSI
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
case 2:
|
||||
goto start;
|
||||
case 2: goto start;
|
||||
}
|
||||
}
|
||||
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.KreonExtractSS(out byte[] buffer, out byte[] senseBuffer, dev.Timeout, out double duration, requestNumber);
|
||||
bool sense = dev.KreonExtractSS(out byte[] buffer, out byte[] senseBuffer, dev.Timeout, out double duration,
|
||||
requestNumber);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending EXTRACT SS to the device:");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
DicConsole.WriteLine("Sense is {0}.", sense);
|
||||
DicConsole.WriteLine("Buffer is {0} bytes.", buffer == null ? "null" : buffer.Length.ToString());
|
||||
DicConsole.WriteLine("Buffer is null or empty? {0}", ArrayHelpers.ArrayIsNullOrEmpty(buffer));
|
||||
DicConsole.WriteLine("Sense buffer is {0} bytes.", senseBuffer == null ? "null" : senseBuffer.Length.ToString());
|
||||
DicConsole.WriteLine("Sense buffer is {0} bytes.",
|
||||
senseBuffer == null ? "null" : senseBuffer.Length.ToString());
|
||||
DicConsole.WriteLine("Sense buffer is null or empty? {0}", ArrayHelpers.ArrayIsNullOrEmpty(senseBuffer));
|
||||
DicConsole.WriteLine();
|
||||
DicConsole.WriteLine("Choose what to do:");
|
||||
@@ -169,8 +171,7 @@ namespace DiscImageChef.Tests.Devices.SCSI
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("EXTRACT SS response:");
|
||||
if(buffer != null)
|
||||
PrintHex.PrintHexArray(buffer, 64);
|
||||
if(buffer != null) PrintHex.PrintHexArray(buffer, 64);
|
||||
DicConsole.WriteLine("Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
System.Console.Clear();
|
||||
@@ -180,8 +181,7 @@ namespace DiscImageChef.Tests.Devices.SCSI
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("EXTRACT SS sense:");
|
||||
if(senseBuffer != null)
|
||||
PrintHex.PrintHexArray(senseBuffer, 64);
|
||||
if(senseBuffer != null) PrintHex.PrintHexArray(senseBuffer, 64);
|
||||
DicConsole.WriteLine("Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
System.Console.Clear();
|
||||
@@ -197,10 +197,8 @@ namespace DiscImageChef.Tests.Devices.SCSI
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
goto menu;
|
||||
case 4:
|
||||
goto start;
|
||||
case 5:
|
||||
goto parameters;
|
||||
case 4: goto start;
|
||||
case 5: goto parameters;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -211,16 +209,18 @@ namespace DiscImageChef.Tests.Devices.SCSI
|
||||
|
||||
static void GetFeatureList(string devPath, Device dev)
|
||||
{
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.KreonGetFeatureList(out byte[] senseBuffer, out KreonFeatures features, dev.Timeout, out double duration);
|
||||
bool sense = dev.KreonGetFeatureList(out byte[] senseBuffer, out KreonFeatures features, dev.Timeout,
|
||||
out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending GET FEATURE LIST to the device:");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
DicConsole.WriteLine("Sense is {0}.", sense);
|
||||
DicConsole.WriteLine("Sense buffer is {0} bytes.", senseBuffer == null ? "null" : senseBuffer.Length.ToString());
|
||||
DicConsole.WriteLine("Sense buffer is {0} bytes.",
|
||||
senseBuffer == null ? "null" : senseBuffer.Length.ToString());
|
||||
DicConsole.WriteLine("Sense buffer is null or empty? {0}", ArrayHelpers.ArrayIsNullOrEmpty(senseBuffer));
|
||||
DicConsole.WriteLine("Features: {0}.", features);
|
||||
DicConsole.WriteLine("GET FEATURE LIST decoded sense:");
|
||||
@@ -250,15 +250,13 @@ namespace DiscImageChef.Tests.Devices.SCSI
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("GET FEATURE LIST sense:");
|
||||
if(senseBuffer != null)
|
||||
PrintHex.PrintHexArray(senseBuffer, 64);
|
||||
if(senseBuffer != null) PrintHex.PrintHexArray(senseBuffer, 64);
|
||||
DicConsole.WriteLine("Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
goto menu;
|
||||
case 2:
|
||||
goto start;
|
||||
case 2: goto start;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -273,7 +271,7 @@ namespace DiscImageChef.Tests.Devices.SCSI
|
||||
string strDev;
|
||||
int item;
|
||||
|
||||
parameters:
|
||||
parameters:
|
||||
while(true)
|
||||
{
|
||||
System.Console.Clear();
|
||||
@@ -301,7 +299,8 @@ namespace DiscImageChef.Tests.Devices.SCSI
|
||||
return;
|
||||
case 1:
|
||||
DicConsole.WriteLine("Lock state");
|
||||
DicConsole.WriteLine("Available values: {0} {1} {2}", KreonLockStates.Locked, KreonLockStates.Wxripper, KreonLockStates.Xtreme);
|
||||
DicConsole.WriteLine("Available values: {0} {1} {2}", KreonLockStates.Locked,
|
||||
KreonLockStates.Wxripper, KreonLockStates.Xtreme);
|
||||
DicConsole.Write("Choose?: ");
|
||||
strDev = System.Console.ReadLine();
|
||||
if(!System.Enum.TryParse(strDev, true, out state))
|
||||
@@ -311,17 +310,17 @@ namespace DiscImageChef.Tests.Devices.SCSI
|
||||
System.Console.ReadKey();
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
case 2:
|
||||
goto start;
|
||||
case 2: goto start;
|
||||
}
|
||||
}
|
||||
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.KreonSetLockState(out byte[] senseBuffer, state, dev.Timeout, out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending SET LOCK STATE to the device:");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
@@ -349,10 +348,8 @@ namespace DiscImageChef.Tests.Devices.SCSI
|
||||
case 0:
|
||||
DicConsole.WriteLine("Returning to Kreon vendor commands menu...");
|
||||
return;
|
||||
case 1:
|
||||
goto start;
|
||||
case 2:
|
||||
goto parameters;
|
||||
case 1: goto start;
|
||||
case 2: goto parameters;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -363,16 +360,17 @@ namespace DiscImageChef.Tests.Devices.SCSI
|
||||
|
||||
static void Unlock(string devPath, Device dev)
|
||||
{
|
||||
start:
|
||||
start:
|
||||
System.Console.Clear();
|
||||
bool sense = dev.KreonDeprecatedUnlock(out byte[] senseBuffer, dev.Timeout, out double duration);
|
||||
|
||||
menu:
|
||||
menu:
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("Sending UNLOCK to the device:");
|
||||
DicConsole.WriteLine("Command took {0} ms.", duration);
|
||||
DicConsole.WriteLine("Sense is {0}.", sense);
|
||||
DicConsole.WriteLine("Sense buffer is {0} bytes.", senseBuffer == null ? "null" : senseBuffer.Length.ToString());
|
||||
DicConsole.WriteLine("Sense buffer is {0} bytes.",
|
||||
senseBuffer == null ? "null" : senseBuffer.Length.ToString());
|
||||
DicConsole.WriteLine("Sense buffer is null or empty? {0}", ArrayHelpers.ArrayIsNullOrEmpty(senseBuffer));
|
||||
DicConsole.WriteLine("UNLOCK decoded sense:");
|
||||
DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer));
|
||||
@@ -401,15 +399,13 @@ namespace DiscImageChef.Tests.Devices.SCSI
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
DicConsole.WriteLine("UNLOCK sense:");
|
||||
if(senseBuffer != null)
|
||||
PrintHex.PrintHexArray(senseBuffer, 64);
|
||||
if(senseBuffer != null) PrintHex.PrintHexArray(senseBuffer, 64);
|
||||
DicConsole.WriteLine("Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
System.Console.Clear();
|
||||
DicConsole.WriteLine("Device: {0}", devPath);
|
||||
goto menu;
|
||||
case 2:
|
||||
goto start;
|
||||
case 2: goto start;
|
||||
default:
|
||||
DicConsole.WriteLine("Incorrect option. Press any key to continue...");
|
||||
System.Console.ReadKey();
|
||||
@@ -418,4 +414,4 @@ namespace DiscImageChef.Tests.Devices.SCSI
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user