-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathATA.cs
106 lines (90 loc) · 3.8 KB
/
ATA.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : ATA.cs
// Author(s) : Natalia Portillo <[email protected]>
//
// Component : Aaru device testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2024 Natalia Portillo
// ****************************************************************************/
using Aaru.Console;
using Aaru.Devices;
using Aaru.Tests.Devices.ATA;
namespace Aaru.Tests.Devices;
static partial class MainClass
{
public static void Ata(string devPath, Device dev)
{
while(true)
{
System.Console.Clear();
AaruConsole.WriteLine(Localization.Device_0, devPath);
AaruConsole.WriteLine(Localization.Send_an_ATA_command_to_the_device);
AaruConsole.WriteLine(Localization.Send_a_CHS_ATA_command_to_the_device);
AaruConsole.WriteLine(Localization.Send_a_28_bit_ATA_command_to_the_device);
AaruConsole.WriteLine(Localization.Send_a_48_bit_ATA_command_to_the_device);
AaruConsole.WriteLine(Localization.Send_an_ATAPI_command_to_the_device);
AaruConsole.WriteLine(Localization.Send_a_CompactFlash_command_to_the_device);
AaruConsole.WriteLine(Localization.Send_a_Media_Card_Pass_Through_command_to_the_device);
AaruConsole.WriteLine(Localization.Send_a_SMART_command_to_the_device);
AaruConsole.WriteLine(Localization.Return_to_command_class_menu);
AaruConsole.Write(Localization.Choose);
string strDev = System.Console.ReadLine();
if(!int.TryParse(strDev, out int item))
{
AaruConsole.WriteLine(Localization.Not_a_number_Press_any_key_to_continue);
System.Console.ReadKey();
continue;
}
switch(item)
{
case 0:
AaruConsole.WriteLine(Localization.Returning_to_command_class_menu);
return;
case 1:
AtaChs.Menu(devPath, dev);
continue;
case 2:
Ata28.Menu(devPath, dev);
continue;
case 3:
Ata48.Menu(devPath, dev);
continue;
case 4:
Atapi.Menu(devPath, dev);
continue;
case 5:
Cfa.Menu(devPath, dev);
continue;
case 6:
Mcpt.Menu(devPath, dev);
continue;
case 7:
Smart.Menu(devPath, dev);
continue;
default:
AaruConsole.WriteLine(Localization.Incorrect_option_Press_any_key_to_continue);
System.Console.ReadKey();
continue;
}
}
}
}