-
Notifications
You must be signed in to change notification settings - Fork 1
/
DevicesForm.vb
84 lines (48 loc) · 2.29 KB
/
DevicesForm.vb
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
Imports IODevices
Namespace IODeviceForms 'internal namespace (used within assembly to access devices and message forms)
Friend Class DevicesForm
Private enableupdate As Boolean = True
Private Sub updatelist()
'update list
Dim sl() As String
Dim details As Boolean = chk_gpibcmd.Checked
sl = IODevice.GetDeviceList(details)
lblstatus.Text = IODevice.statusmsg
If Not sl Is Nothing Then
txt_list.Lines = sl
End If
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If enableupdate And Not IODevice.updated Then
updatelist()
IODevice.updated = True
End If
End Sub
Private Sub lb_gpib_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub DevicesForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Interval = 50
Timer1.Enabled = True
' Set Dock mode checkbox on startup
chk_dock.Checked = My.Settings.dataDock
End Sub
Private Sub Label2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblstatus.Click
End Sub
Private Sub DevicesForm_Resize(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Resize
txt_list.Height = Height - 100
txt_list.Width = Width - 40
lblstatus.Top = Height - 60
End Sub
Private Sub txt_list_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles txt_list.MouseDown
enableupdate = False
End Sub
Private Sub txt_list_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles txt_list.MouseUp
enableupdate = True
End Sub
Private Sub chk_dock_CheckedChanged(sender As Object, e As EventArgs) Handles chk_dock.CheckedChanged
' Update the dock mode setting
My.Settings.dataDock = chk_dock.Checked
My.Settings.Save()
End Sub
End Class
End Namespace