-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathhardwareInfoForm.cs
98 lines (72 loc) · 2.46 KB
/
hardwareInfoForm.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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace opentuner
{
public partial class hardwareInfoForm : Form
{
private PicoTunerInterface ftdi_hw = null;
List<FTDIDevice> ftdi_devices = null;
public hardwareInfoForm(PicoTunerInterface ftdi_hardware)
{
InitializeComponent();
ftdi_hw = ftdi_hardware;
detect_display();
}
private void detect_display()
{
listBox1.Items.Clear();
ftdi_devices = ftdi_hw.detect_all_ftdi();
if (ftdi_devices.Count == 0)
{
MessageBox.Show("No FT2232 Devices Detected");
return;
}
for ( int c = 0; c < ftdi_devices.Count; c++ )
{
listBox1.Items.Add(ftdi_devices[c].device_serial_number + " - " + ftdi_devices[c].device_description);
}
if (listBox1.Items.Count > 0) { listBox1.SelectedIndex = 0; }
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
if (listBox1.SelectedIndex < 0)
return;
int item_index = listBox1.SelectedIndex;
lblDeviceIndex.Text = ftdi_devices[item_index].device_index.ToString();
lblDeviceSerialNumber.Text = ftdi_devices[item_index].device_serial_number.ToString();
lblDeviceDescription.Text = ftdi_devices[item_index].device_description.ToString();
}
private void button1_Click(object sender, EventArgs e)
{
detect_display();
}
private void label2_Click(object sender, EventArgs e)
{
}
private void lblDeviceSerialNumber_Click(object sender, EventArgs e)
{
}
private void lblDeviceIndex_Click(object sender, EventArgs e)
{
}
private void label5_Click(object sender, EventArgs e)
{
}
private void label4_Click(object sender, EventArgs e)
{
}
private void label3_Click(object sender, EventArgs e)
{
}
private void lblDeviceDescription_Click(object sender, EventArgs e)
{
}
}
}