diff --git a/OmniRig_VB_DEMO/Form1.vb b/OmniRig_VB_DEMO/Form1.vb index cb6cdcf..321976c 100644 --- a/OmniRig_VB_DEMO/Form1.vb +++ b/OmniRig_VB_DEMO/Form1.vb @@ -56,9 +56,7 @@ RadioButton1.Checked = True - If (My.Settings.TransverterEnabled = True) Then - TransverterOffsetToolStripMenuItem.Checked = True - End If + TransverterOffsetToolStripMenuItem.Checked = My.Settings.TransverterEnabled StartOmniRig() End Sub @@ -135,17 +133,13 @@ Dim RadioName As String = "" - If RadioButton1.Checked Then - RadioName = "OmniRig 1" - Else - RadioName = "OmniRig 2" - End If + RadioName = Rig.RigType Dim myString As String = "{""radio"": """ + RadioName + """, ""frequency"": """ + newfreq.ToString + """, ""mode"": """ + Label6.Text + """, ""key"": """ + My.Settings.CloudlogAPIKey + """}" Try - Dim responsebytes = client.UploadString(My.Settings.CloudlogURL + "/index.php/api/radio", myString) - ToolStripStatusLabel1.Text = "Cloudlog Synced: " + DateTime.UtcNow + Dim responsebytes = client.UploadString(New Uri(New Uri(My.Settings.CloudlogURL), "index.php/api/radio").ToString(), myString) + ToolStripStatusLabel1.Text = "Cloudlog Synced: " + Date.UtcNow Catch ex As Exception ToolStripStatusLabel1.Text = "Cloudlog Synced: Failed, check URL/API" End Try @@ -163,15 +157,13 @@ OmniRigEngine = CreateObject("OmniRig.OmniRigX") ' we want OmniRig interface V.1.1 to 1.99 ' as V2.0 will likely be incompatible with 1.x - If OmniRigEngine.InterfaceVersion < &H101 Then GoTo Error1 - If OmniRigEngine.InterfaceVersion > &H299 Then GoTo Error1 + If OmniRigEngine.InterfaceVersion < &H101 Or OmniRigEngine.InterfaceVersion > &H299 Then + ' report problems + OmniRigEngine = Nothing + MsgBox("OmniRig Is Not installed Or has a wrong version number") + Exit Sub + End If SelectRig(1) - Exit Sub -Error1: - ' report problems - OmniRigEngine = Nothing - MsgBox("OmniRig Is Not installed Or has a wrong version number") - End Sub Private Sub StopOmniRig() diff --git a/OmniRig_VB_DEMO/Form2.Designer.vb b/OmniRig_VB_DEMO/Form2.Designer.vb index 90bef96..2ebeebd 100644 --- a/OmniRig_VB_DEMO/Form2.Designer.vb +++ b/OmniRig_VB_DEMO/Form2.Designer.vb @@ -27,6 +27,10 @@ Partial Class CloudlogSettingsForm Me.Button1 = New System.Windows.Forms.Button() Me.Label2 = New System.Windows.Forms.Label() Me.TextBox2 = New System.Windows.Forms.TextBox() + Me.Button2 = New System.Windows.Forms.Button() + Me.StatusStrip1 = New System.Windows.Forms.StatusStrip() + Me.ToolStripStatusLabel1 = New System.Windows.Forms.ToolStripStatusLabel() + Me.StatusStrip1.SuspendLayout() Me.SuspendLayout() ' 'Label1 @@ -47,7 +51,7 @@ Partial Class CloudlogSettingsForm ' 'Button1 ' - Me.Button1.Location = New System.Drawing.Point(253, 72) + Me.Button1.Location = New System.Drawing.Point(151, 72) Me.Button1.Name = "Button1" Me.Button1.Size = New System.Drawing.Size(104, 23) Me.Button1.TabIndex = 2 @@ -70,11 +74,36 @@ Partial Class CloudlogSettingsForm Me.TextBox2.Size = New System.Drawing.Size(206, 20) Me.TextBox2.TabIndex = 4 ' + 'Button2 + ' + Me.Button2.Location = New System.Drawing.Point(261, 72) + Me.Button2.Name = "Button2" + Me.Button2.Size = New System.Drawing.Size(96, 23) + Me.Button2.TabIndex = 5 + Me.Button2.Text = "Cancel" + Me.Button2.UseVisualStyleBackColor = True + ' + 'StatusStrip1 + ' + Me.StatusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripStatusLabel1}) + Me.StatusStrip1.Location = New System.Drawing.Point(0, 100) + Me.StatusStrip1.Name = "StatusStrip1" + Me.StatusStrip1.Size = New System.Drawing.Size(381, 22) + Me.StatusStrip1.TabIndex = 6 + Me.StatusStrip1.Text = "StatusStrip1" + ' + 'ToolStripStatusLabel1 + ' + Me.ToolStripStatusLabel1.Name = "ToolStripStatusLabel1" + Me.ToolStripStatusLabel1.Size = New System.Drawing.Size(0, 17) + ' 'CloudlogSettingsForm ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(381, 102) + Me.ClientSize = New System.Drawing.Size(381, 122) + Me.Controls.Add(Me.StatusStrip1) + Me.Controls.Add(Me.Button2) Me.Controls.Add(Me.TextBox2) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Button1) @@ -85,6 +114,8 @@ Partial Class CloudlogSettingsForm Me.Name = "CloudlogSettingsForm" Me.ShowIcon = False Me.Text = "Cloudlog Settings" + Me.StatusStrip1.ResumeLayout(False) + Me.StatusStrip1.PerformLayout() Me.ResumeLayout(False) Me.PerformLayout() @@ -95,4 +126,7 @@ Partial Class CloudlogSettingsForm Friend WithEvents Button1 As Button Friend WithEvents Label2 As Label Friend WithEvents TextBox2 As TextBox + Friend WithEvents Button2 As Button + Friend WithEvents StatusStrip1 As StatusStrip + Friend WithEvents ToolStripStatusLabel1 As ToolStripStatusLabel End Class diff --git a/OmniRig_VB_DEMO/Form2.resx b/OmniRig_VB_DEMO/Form2.resx index 1af7de1..7444364 100644 --- a/OmniRig_VB_DEMO/Form2.resx +++ b/OmniRig_VB_DEMO/Form2.resx @@ -117,4 +117,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + \ No newline at end of file diff --git a/OmniRig_VB_DEMO/Form2.vb b/OmniRig_VB_DEMO/Form2.vb index 8fe00b5..0cd9c52 100644 --- a/OmniRig_VB_DEMO/Form2.vb +++ b/OmniRig_VB_DEMO/Form2.vb @@ -5,8 +5,37 @@ Me.Close() End Sub + Private Function ValidateSettings() As Boolean + ToolStripStatusLabel1.Text = String.Empty + Try + Dim url = New Uri(TextBox1.Text) + If Not url.Scheme.ToUpper.StartsWith("HTTP") Then + Throw New UriFormatException("Need 'https://' or 'http://'") + End If + My.Settings.CloudlogURL = url.ToString() + Catch ex As UriFormatException + ToolStripStatusLabel1.Text = ex.Message + Return False + End Try + Return True + End Function + Private Sub CloudlogSettingsForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load TextBox1.Text = My.Settings.CloudlogURL TextBox2.Text = My.Settings.CloudlogAPIKey + StatusStrip1.Text = String.Empty + Button1.Enabled = ValidateSettings() + End Sub + + Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged + Button1.Enabled = ValidateSettings() + End Sub + + Private Sub TextBox2_TextChanged(sender As Object, e As EventArgs) Handles TextBox2.TextChanged + Button1.Enabled = ValidateSettings() + End Sub + + Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click + Me.Close() End Sub -End Class \ No newline at end of file +End Class diff --git a/OmniRig_VB_DEMO/obj/Debug/CloudlogCAT.TrustInfo.xml b/OmniRig_VB_DEMO/obj/Debug/CloudlogCAT.TrustInfo.xml deleted file mode 100644 index 7aaa723..0000000 --- a/OmniRig_VB_DEMO/obj/Debug/CloudlogCAT.TrustInfo.xml +++ /dev/null @@ -1,12 +0,0 @@ - \ No newline at end of file diff --git a/OmniRig_VB_DEMO/obj/Debug/CloudlogCAT.application b/OmniRig_VB_DEMO/obj/Debug/CloudlogCAT.application deleted file mode 100644 index e2301c9..0000000 --- a/OmniRig_VB_DEMO/obj/Debug/CloudlogCAT.application +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - lJZaO8tSPCCvJvWpfK2iargf1grFLkGJE4oCWnwbRAg= - - - - \ No newline at end of file diff --git a/OmniRig_VB_DEMO/obj/Debug/CloudlogCAT.exe b/OmniRig_VB_DEMO/obj/Debug/CloudlogCAT.exe deleted file mode 100644 index 0e084ea..0000000 Binary files a/OmniRig_VB_DEMO/obj/Debug/CloudlogCAT.exe and /dev/null differ diff --git a/OmniRig_VB_DEMO/obj/Debug/CloudlogCAT.exe.manifest b/OmniRig_VB_DEMO/obj/Debug/CloudlogCAT.exe.manifest deleted file mode 100644 index 657295d..0000000 --- a/OmniRig_VB_DEMO/obj/Debug/CloudlogCAT.exe.manifest +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C75VVJvxDVVyVYjWlaF+wx4DsFOs+CIrPk+W7yPLOcA= - - - - - - - - - - t+YkUar7BQkecv0WXeIzZ08zzmX/bITAX+l62kmzD80= - - - - - - - - - 97ZF9x7UU/TAdsnUobeoZsDDrKK7sWqUT1DYfsGujMQ= - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/OmniRig_VB_DEMO/obj/Debug/CloudlogCAT.pdb b/OmniRig_VB_DEMO/obj/Debug/CloudlogCAT.pdb deleted file mode 100644 index c95172d..0000000 Binary files a/OmniRig_VB_DEMO/obj/Debug/CloudlogCAT.pdb and /dev/null differ diff --git a/OmniRig_VB_DEMO/obj/Debug/CloudlogCAT.vbproj.CoreCompileInputs.cache b/OmniRig_VB_DEMO/obj/Debug/CloudlogCAT.vbproj.CoreCompileInputs.cache deleted file mode 100644 index 5b48b12..0000000 --- a/OmniRig_VB_DEMO/obj/Debug/CloudlogCAT.vbproj.CoreCompileInputs.cache +++ /dev/null @@ -1 +0,0 @@ -a52852b2fe3aa3058580960897b7baca1d5a2ac0 diff --git a/OmniRig_VB_DEMO/obj/Debug/CloudlogCAT.vbproj.FileListAbsolute.txt b/OmniRig_VB_DEMO/obj/Debug/CloudlogCAT.vbproj.FileListAbsolute.txt deleted file mode 100644 index 6c81cd1..0000000 --- a/OmniRig_VB_DEMO/obj/Debug/CloudlogCAT.vbproj.FileListAbsolute.txt +++ /dev/null @@ -1,43 +0,0 @@ -C:\Users\peter\Documents\development\CloudlogCAT\OmniRig_VB_DEMO\obj\Debug\CloudlogCAT.vbprojAssemblyReference.cache -C:\Users\peter\Documents\development\CloudlogCAT\OmniRig_VB_DEMO\obj\Debug\Interop.OmniRig.dll -C:\Users\peter\Documents\development\CloudlogCAT\OmniRig_VB_DEMO\obj\Debug\CloudlogCAT.vbproj.ResolveComReference.cache -C:\Users\peter\Documents\development\CloudlogCAT\OmniRig_VB_DEMO\obj\Debug\CloudlogCAT.vbproj.GenerateResource.cache -C:\Users\peter\Documents\development\CloudlogCAT\OmniRig_VB_DEMO\obj\Debug\CloudlogCAT.vbproj.CoreCompileInputs.cache -C:\Users\peter\Documents\development\CloudlogCAT\OmniRig_VB_DEMO\obj\Debug\CloudlogCAT.Form1.resources -C:\Users\peter\Documents\development\CloudlogCAT\OmniRig_VB_DEMO\obj\Debug\CloudlogCAT.CloudlogSettingsForm.resources -C:\Users\peter\Documents\development\CloudlogCAT\OmniRig_VB_DEMO\obj\Debug\CloudlogCAT.Resources.resources -C:\Users\peter\Documents\development\CloudlogCAT\OmniRig_VB_DEMO\bin\Debug\CloudlogCAT.exe.config -C:\Users\peter\Documents\development\CloudlogCAT\OmniRig_VB_DEMO\bin\Debug\CloudlogCAT.exe -C:\Users\peter\Documents\development\CloudlogCAT\OmniRig_VB_DEMO\bin\Debug\CloudlogCAT.pdb -C:\Users\peter\Documents\development\CloudlogCAT\OmniRig_VB_DEMO\bin\Debug\CloudlogCAT.xml -C:\Users\peter\Documents\development\CloudlogCAT\OmniRig_VB_DEMO\obj\Debug\CloudlogCAT.exe -C:\Users\peter\Documents\development\CloudlogCAT\OmniRig_VB_DEMO\obj\Debug\CloudlogCAT.xml -C:\Users\peter\Documents\development\CloudlogCAT\OmniRig_VB_DEMO\obj\Debug\CloudlogCAT.pdb -C:\Users\peter\Documents\development\CloudlogCAT\OmniRig_VB_DEMO\obj\Debug\CloudlogCAT.AboutBox1.resources -C:\Users\peter\Documents\development\CloudlogCAT\OmniRig_VB_DEMO\bin\Debug\CloudlogCAT.exe.manifest -C:\Users\peter\Documents\development\CloudlogCAT\OmniRig_VB_DEMO\bin\Debug\CloudlogCAT.application -C:\Users\peter\Documents\development\CloudlogCAT\OmniRig_VB_DEMO\obj\Debug\CloudlogCAT.TrustInfo.xml -C:\Users\peter\Documents\development\CloudlogCAT\OmniRig_VB_DEMO\obj\Debug\CloudlogCAT.exe.manifest -C:\Users\peter\Documents\development\CloudlogCAT\OmniRig_VB_DEMO\obj\Debug\CloudlogCAT.application -C:\Users\peter\OneDrive\Documents\GitHub\CloudlogCAT\OmniRig_VB_DEMO\obj\Debug\CloudlogCAT.vbprojAssemblyReference.cache -C:\Users\peter\OneDrive\Documents\GitHub\CloudlogCAT\OmniRig_VB_DEMO\obj\Debug\Interop.OmniRig.dll -C:\Users\peter\OneDrive\Documents\GitHub\CloudlogCAT\OmniRig_VB_DEMO\obj\Debug\CloudlogCAT.vbproj.ResolveComReference.cache -C:\Users\peter\OneDrive\Documents\GitHub\CloudlogCAT\OmniRig_VB_DEMO\obj\Debug\CloudlogCAT.AboutBox1.resources -C:\Users\peter\OneDrive\Documents\GitHub\CloudlogCAT\OmniRig_VB_DEMO\obj\Debug\CloudlogCAT.Form1.resources -C:\Users\peter\OneDrive\Documents\GitHub\CloudlogCAT\OmniRig_VB_DEMO\obj\Debug\CloudlogCAT.CloudlogSettingsForm.resources -C:\Users\peter\OneDrive\Documents\GitHub\CloudlogCAT\OmniRig_VB_DEMO\obj\Debug\CloudlogCAT.Resources.resources -C:\Users\peter\OneDrive\Documents\GitHub\CloudlogCAT\OmniRig_VB_DEMO\obj\Debug\CloudlogCAT.vbproj.GenerateResource.cache -C:\Users\peter\OneDrive\Documents\GitHub\CloudlogCAT\OmniRig_VB_DEMO\obj\Debug\CloudlogCAT.vbproj.CoreCompileInputs.cache -C:\Users\peter\OneDrive\Documents\GitHub\CloudlogCAT\OmniRig_VB_DEMO\obj\Debug\CloudlogCAT.TrustInfo.xml -C:\Users\peter\OneDrive\Documents\GitHub\CloudlogCAT\OmniRig_VB_DEMO\obj\Debug\CloudlogCAT.exe -C:\Users\peter\OneDrive\Documents\GitHub\CloudlogCAT\OmniRig_VB_DEMO\obj\Debug\CloudlogCAT.xml -C:\Users\peter\OneDrive\Documents\GitHub\CloudlogCAT\OmniRig_VB_DEMO\obj\Debug\CloudlogCAT.pdb -C:\Users\peter\OneDrive\Documents\GitHub\CloudlogCAT\OmniRig_VB_DEMO\bin\Debug\CloudlogCAT.exe.config -C:\Users\peter\OneDrive\Documents\GitHub\CloudlogCAT\OmniRig_VB_DEMO\bin\Debug\CloudlogCAT.exe.manifest -C:\Users\peter\OneDrive\Documents\GitHub\CloudlogCAT\OmniRig_VB_DEMO\bin\Debug\CloudlogCAT.application -C:\Users\peter\OneDrive\Documents\GitHub\CloudlogCAT\OmniRig_VB_DEMO\bin\Debug\CloudlogCAT.exe -C:\Users\peter\OneDrive\Documents\GitHub\CloudlogCAT\OmniRig_VB_DEMO\bin\Debug\CloudlogCAT.pdb -C:\Users\peter\OneDrive\Documents\GitHub\CloudlogCAT\OmniRig_VB_DEMO\bin\Debug\CloudlogCAT.xml -C:\Users\peter\OneDrive\Documents\GitHub\CloudlogCAT\OmniRig_VB_DEMO\obj\Debug\CloudlogCAT.exe.manifest -C:\Users\peter\OneDrive\Documents\GitHub\CloudlogCAT\OmniRig_VB_DEMO\obj\Debug\CloudlogCAT.application -C:\Users\peter\OneDrive\Documents\GitHub\CloudlogCAT\OmniRig_VB_DEMO\obj\Debug\CloudlogCAT.Form3.resources diff --git a/OmniRig_VB_DEMO/obj/Debug/CloudlogCAT.vbproj.GenerateResource.cache b/OmniRig_VB_DEMO/obj/Debug/CloudlogCAT.vbproj.GenerateResource.cache deleted file mode 100644 index 171a5e1..0000000 Binary files a/OmniRig_VB_DEMO/obj/Debug/CloudlogCAT.vbproj.GenerateResource.cache and /dev/null differ diff --git a/OmniRig_VB_DEMO/obj/Debug/CloudlogCAT.vbproj.ResolveComReference.cache b/OmniRig_VB_DEMO/obj/Debug/CloudlogCAT.vbproj.ResolveComReference.cache deleted file mode 100644 index b825329..0000000 Binary files a/OmniRig_VB_DEMO/obj/Debug/CloudlogCAT.vbproj.ResolveComReference.cache and /dev/null differ diff --git a/OmniRig_VB_DEMO/obj/Debug/CloudlogCAT.vbprojAssemblyReference.cache b/OmniRig_VB_DEMO/obj/Debug/CloudlogCAT.vbprojAssemblyReference.cache deleted file mode 100644 index 5d77a9b..0000000 Binary files a/OmniRig_VB_DEMO/obj/Debug/CloudlogCAT.vbprojAssemblyReference.cache and /dev/null differ diff --git a/OmniRig_VB_DEMO/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/OmniRig_VB_DEMO/obj/Debug/DesignTimeResolveAssemblyReferences.cache deleted file mode 100644 index 5144866..0000000 Binary files a/OmniRig_VB_DEMO/obj/Debug/DesignTimeResolveAssemblyReferences.cache and /dev/null differ diff --git a/OmniRig_VB_DEMO/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/OmniRig_VB_DEMO/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache deleted file mode 100644 index 3835009..0000000 Binary files a/OmniRig_VB_DEMO/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache and /dev/null differ diff --git a/OmniRig_VB_DEMO/obj/Debug/Interop.OmniRig.dll b/OmniRig_VB_DEMO/obj/Debug/Interop.OmniRig.dll deleted file mode 100644 index 84d6a14..0000000 Binary files a/OmniRig_VB_DEMO/obj/Debug/Interop.OmniRig.dll and /dev/null differ