-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSetupDialogForm.vb
46 lines (40 loc) · 1.81 KB
/
SetupDialogForm.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
Option Infer On
Option Strict On
Imports MetroFramework
<ComVisible(False)>
Public Class SimpleSQM
Private Sub OK_Button_Click(sender As Object, e As EventArgs) Handles OK_Button.Click
ObservingConditions.comPort = ComboBoxComPort.SelectedItem.ToString()
ObservingConditions.debug = debugToggle.Checked
ObservingConditions.limitMag = limitMagSpinner.Value
DialogResult = DialogResult.OK
Close()
End Sub
Private Sub Cancel_Button_Click(sender As Object, ByVal e As EventArgs) Handles Cancel_Button.Click
DialogResult = DialogResult.Cancel
Close()
End Sub
Private Sub ShowAscomWebPage(sender As Object, e As EventArgs) Handles PictureBox1.DoubleClick, PictureBox1.Click
Try
Process.Start("https://ascom-standards.org/")
Catch ex As Exception
MetroMessageBox.Show(Me, "Error! " + ex.Message, "SimpleSQM", MessageBoxButtons.OK, MessageBoxIcon.Error, 80)
End Try
End Sub
Private Sub LinkLabel_Click(sender As Object, e As EventArgs) Handles linkLabel.Click
Try
Process.Start("https://marcocipriani01.github.io/")
Catch ex As Exception
MetroMessageBox.Show(Me, "Error! " + ex.Message, "SimpleSQM", MessageBoxButtons.OK, MessageBoxIcon.Error, 80)
End Try
End Sub
Private Sub SetupDialogForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
ComboBoxComPort.Items.Clear()
ComboBoxComPort.Items.AddRange(IO.Ports.SerialPort.GetPortNames())
If ComboBoxComPort.Items.Contains(ObservingConditions.comPort) Then
ComboBoxComPort.SelectedItem = ObservingConditions.comPort
End If
debugToggle.Checked = ObservingConditions.debug
limitMagSpinner.Value = CDec(ObservingConditions.limitMag)
End Sub
End Class