-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Configurator.vb
executable file
·3016 lines (2790 loc) · 122 KB
/
Configurator.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Imports System.ComponentModel
Imports System.Runtime.CompilerServices
Imports System.Runtime.InteropServices
Imports System.Reflection
Imports System.Net
Imports System.Net.NetworkInformation
Imports System.Net.Sockets
Imports System.Threading
Imports System.Formats.Tar
Imports System.IO
Imports System.Text.Json
Imports System.Net.WebRequestMethods
Imports File = System.IO.File
Imports System.IO.Compression
Public Class Configurator
Public OpenIPCIP As String
Public NVRIP As String
Public RadxaIP As String
Public WithEvents downloader As WebClient
Public Sub DownloadStart()
downloader = New WebClient
If cmbVersion.Text = "ssc338q_fpv_emax-wyvern-link-nor" Or cmbVersion.Text = "ssc338q_fpv_openipc-mario-aio-nor" Or cmbVersion.Text = "ssc338q_fpv_openipc-urllc-aio-nor" Or cmbVersion.Text = "ssc338q_fpv_runcam-wifilink-nor" Then
downloader.DownloadFileAsync(New Uri("https://github.com/OpenIPC/builder/releases/download/latest/" + cmbVersion.Text + ".tgz"), cmbVersion.Text + ".tgz")
Else
downloader.DownloadFileAsync(New Uri("https://github.com/OpenIPC/firmware/releases/download/latest/" + cmbVersion.Text + ".tgz"), cmbVersion.Text + ".tgz")
End If
End Sub
Private Sub downloader_DownloadProgressChanged(sender As Object, e As DownloadProgressChangedEventArgs) Handles downloader.DownloadProgressChanged
Dim extern = "extern.bat"
If Not File.Exists(extern) Then
MsgBox("File " + extern + " not found!")
Return
End If
ProgressBar1.Value = e.ProgressPercentage
If ProgressBar1.Value = 100 Then
With New Process()
.StartInfo.UseShellExecute = False
.StartInfo.FileName = extern
.StartInfo.Arguments = "offlinefw " + String.Format("{0}", txtIP.Text) + " " + txtPassword.Text + " " + cmbVersion.Text + " " + txtSOC.Text
.StartInfo.RedirectStandardOutput = False
.Start()
End With
End If
End Sub
Private Sub btnGet_Click(sender As Object, e As EventArgs) Handles btnGet.Click
Dim settingsconf As String = "settings.conf"
If Not IO.File.Exists(settingsconf) Then
System.IO.File.Create(settingsconf).Dispose()
Dim fileExists As Boolean = File.Exists(settingsconf)
Using sw As New StreamWriter(File.Open(settingsconf, FileMode.OpenOrCreate))
sw.WriteLine("openipc:192.168.0.1")
sw.WriteLine("nvr:192.168.0.1")
sw.WriteLine("radxa:192.168.0.1")
End Using
MsgBox("File " + settingsconf + " not found and default created!")
End If
Dim x As Integer
Dim SettingsfilePath = settingsconf
Dim extern = "extern.bat"
If Not IO.File.Exists(extern) Then
MsgBox("File " + extern + " not found!")
Return
End If
If IsValidIP(txtIP.Text) Then
With New Process()
.StartInfo.UseShellExecute = False
.StartInfo.FileName = extern
Dim lines = IO.File.ReadAllLines(SettingsfilePath)
For x = 0 To lines.Count() - 1
If rBtnNVR.Checked Then
If lines(x).StartsWith("nvr:") Then
lines(x) = "nvr:" + txtIP.Text
End If
.StartInfo.Arguments = "dlvrx " + String.Format("{0}", txtIP.Text) + " " + txtPassword.Text
ElseIf rBtnRadxaZero3w.Checked Then
If lines(x).StartsWith("radxa:") Then
lines(x) = "radxa:" + txtIP.Text
End If
.StartInfo.Arguments = "dlwfbng " + String.Format("{0}", txtIP.Text) + " " + txtPassword.Text
Else
If lines(x).StartsWith("openipc:") Then
lines(x) = "openipc:" + txtIP.Text
End If
.StartInfo.Arguments = "dl " + String.Format("{0}", txtIP.Text) + " " + txtPassword.Text
End If
Next
IO.File.WriteAllLines(SettingsfilePath, lines)
.StartInfo.RedirectStandardOutput = False
.Start()
End With
Else
MsgBox("Please enter a valid IP address")
End If
End Sub
Private Sub btnSend_Click(sender As Object, e As EventArgs)
Dim extern = "extern.bat"
If Not File.Exists(extern) Then
MsgBox("File " + extern + " not found!")
Return
End If
If IsValidIP(txtIP.Text) Then
With New Process()
.StartInfo.UseShellExecute = False
.StartInfo.FileName = extern
If rBtnNVR.Checked Then
.StartInfo.Arguments = "ulvrx " + String.Format("{0}", txtIP.Text) + " " + txtPassword.Text
ElseIf rBtnRadxaZero3w.Checked Then
.StartInfo.Arguments = "ulwfbng " + String.Format("{0}", txtIP.Text) + " " + txtPassword.Text
Else
.StartInfo.Arguments = "ul " + String.Format("{0}", txtIP.Text) + " " + txtPassword.Text
End If
.StartInfo.RedirectStandardOutput = False
.Start()
End With
Else
MsgBox("Please enter a valid IP address")
End If
End Sub
Public Function ReadLine(lineNumber As Integer, lines As List(Of String)) As String
On Error GoTo err1
Return lines(lineNumber - 1)
Exit Function
err1:
End Function
Private Sub btnRead_Click(sender As Object, e As EventArgs) Handles btnRead.Click
Dim settingsconf As String = "settings.conf"
If Not IO.File.Exists(settingsconf) Then
System.IO.File.Create(settingsconf).Dispose()
Dim fileExists As Boolean = File.Exists(settingsconf)
Using sw As New StreamWriter(File.Open(settingsconf, FileMode.OpenOrCreate))
sw.WriteLine("openipc:192.168.0.1")
sw.WriteLine("nvr:192.168.0.1")
sw.WriteLine("radxa:192.168.0.1")
End Using
MsgBox("File " + settingsconf + " not found and default created!")
End If
Dim x As Integer
Dim SettingsfilePath = settingsconf
Dim extern = "extern.bat"
If Not IO.File.Exists(extern) Then
MsgBox("File " + extern + " not found!")
Return
End If
If IsValidIP(txtIP.Text) Then
With New Process()
.StartInfo.UseShellExecute = False
.StartInfo.FileName = extern
Dim lines = IO.File.ReadAllLines(SettingsfilePath)
For x = 0 To lines.Count() - 1
If rBtnNVR.Checked Then
If lines(x).StartsWith("nvr:") Then
lines(x) = "nvr:" + txtIP.Text
End If
.StartInfo.Arguments = "dlvrx " + String.Format("{0}", txtIP.Text) + " " + txtPassword.Text
ElseIf rBtnRadxaZero3w.Checked Then
If lines(x).StartsWith("radxa:") Then
lines(x) = "radxa:" + txtIP.Text
End If
.StartInfo.Arguments = "dlwfbng " + String.Format("{0}", txtIP.Text) + " " + txtPassword.Text
Else
If lines(x).StartsWith("openipc:") Then
lines(x) = "openipc:" + txtIP.Text
End If
.StartInfo.Arguments = "dl " + String.Format("{0}", txtIP.Text) + " " + txtPassword.Text
End If
Next
IO.File.WriteAllLines(SettingsfilePath, lines)
.StartInfo.RedirectStandardOutput = False
.Start()
End With
Else
MsgBox("Please enter a valid IP address")
Return
End If
txtResolution.Text = ""
txtFPS.Text = ""
txtEncode.Text = ""
txtBitrate.Text = ""
txtExposure.Text = ""
txtContrast.Text = ""
txtSaturation.Text = ""
txtHue.Text = ""
txtLuminance.Text = ""
txtFlip.Text = ""
txtMirror.Text = ""
txtSensor.Text = ""
txtSerial.Text = ""
txtBaud.Text = ""
txtRouter.Text = ""
txtMCSTLM.Text = ""
txtAggregate.Text = ""
txtRC_CHANNEL.Text = ""
txtFrequency.Text = ""
txtPower.Text = ""
txtFreq24.Text = ""
txtPower24.Text = ""
txtMCS.Text = ""
txtSTBC.Text = ""
txtLDPC.Text = ""
txtFECK.Text = ""
txtFECN.Text = ""
Threading.Thread.Sleep(3000)
Dim wfbconf = "wfb.conf"
If Not System.IO.File.Exists(wfbconf) Then
MsgBox("File " + wfbconf + " not found!" + vbCrLf + "Install the latest version of Putty and try again.")
Return
End If
Dim WFBreader As New IO.StreamReader(wfbconf)
Dim WFBallLines = New List(Of String)
Do While Not WFBreader.EndOfStream
WFBallLines.Add(WFBreader.ReadLine)
Loop
WFBreader.Close()
If rBtnNVR.Checked Then
txtFrequency.Text = ReadLine(7, WFBallLines)
txtPower.Text = ReadLine(10, WFBallLines)
txtFreq24.Text = ReadLine(8, WFBallLines)
txtPower24.Text = ReadLine(9, WFBallLines)
txtMCS.Text = ReadLine(14, WFBallLines)
txtSTBC.Text = ReadLine(15, WFBallLines)
ElseIf rBtnRadxaZero3w.Checked Then
Dim wfbng = "wifibroadcast.cfg"
If Not System.IO.File.Exists(wfbng) Then
MsgBox("File " + wfbng + " not found!" + vbCrLf + "Install the latest version of Putty and try again.")
Return
End If
Dim WFBngreader As New IO.StreamReader(wfbng)
Dim WFBngallLines = New List(Of String)
Do While Not WFBngreader.EndOfStream
WFBngallLines.Add(WFBngreader.ReadLine)
Loop
WFBngreader.Close()
txtFrequency.Text = ReadLine(2, WFBngallLines)
If rBtnCam.Checked Then txtPower.Text = ReadLine(6, WFBallLines)
For x = 0 To WFBallLines.Count() - 1
If WFBallLines(x).StartsWith("options 88XXau_wfb ") Then txtPower.Text = ReadLine(x + 1, WFBallLines)
Next x
txtMCS.Text = ReadLine(8, WFBngallLines)
txtSTBC.Text = ReadLine(12, WFBngallLines)
Else
txtFrequency.Text = ReadLine(7, WFBallLines)
txtPower.Text = ReadLine(10, WFBallLines)
txtFreq24.Text = ReadLine(8, WFBallLines)
txtPower24.Text = ReadLine(9, WFBallLines)
txtMCS.Text = ReadLine(14, WFBallLines)
txtSTBC.Text = ReadLine(12, WFBallLines)
txtLDPC.Text = ReadLine(13, WFBallLines)
txtFECK.Text = ReadLine(20, WFBallLines)
txtFECN.Text = ReadLine(21, WFBallLines)
End If
If rBtnNVR.Checked Or rBtnCam.Checked Then
Dim telemetry = "telemetry.conf"
If Not System.IO.File.Exists(telemetry) Then
MsgBox("File " + telemetry + " not found!" + vbCrLf + "Install the latest version of Putty and try again.")
Return
End If
Dim TLMreader As New IO.StreamReader(telemetry)
Dim TLMallLines = New List(Of String)
Do While Not TLMreader.EndOfStream
TLMallLines.Add(TLMreader.ReadLine)
Loop
TLMreader.Close()
txtSerial.Text = ReadLine(4, TLMallLines)
txtBaud.Text = ReadLine(5, TLMallLines)
txtRouter.Text = ReadLine(8, TLMallLines)
txtMCSTLM.Text = ReadLine(14, TLMallLines)
txtAggregate.Text = ReadLine(26, TLMallLines)
txtRC_CHANNEL.Text = ReadLine(29, TLMallLines)
If rBtnNVR.Checked Then
Dim vdec = "vdec.conf"
If Not System.IO.File.Exists(vdec) Then
MsgBox("File " + vdec + " not found!" + vbCrLf + "Install the latest version of Putty and try again.")
Return
End If
Dim VDECreader As New IO.StreamReader(vdec)
Dim VDECallLines = New List(Of String)
Do While Not VDECreader.EndOfStream
VDECallLines.Add(VDECreader.ReadLine)
Loop
VDECreader.Close()
txtResolutionVRX.Text = ReadLine(22, VDECallLines)
txtCodecVRX.Text = ReadLine(7, VDECallLines)
txtFormat.Text = ReadLine(11, VDECallLines)
txtPortVRX.Text = ReadLine(3, VDECallLines)
txtMavlinkVRX.Text = ReadLine(26, VDECallLines)
txtOSD.Text = ReadLine(30, VDECallLines)
txtExtras.Text = ReadLine(52, VDECallLines)
Dim line As String = ReadLine(53, VDECallLines)
Dim value2 As String = line.Replace("""", "")
Dim separators() As String = {"-osd_ele", "x", "y"}
Dim result() As String
result = value2.Split(separators, StringSplitOptions.RemoveEmptyEntries)
RadioButton1.Left = result(2) / 2.5
RadioButton1.Top = result(4) / 2.5
RadioButton2.Left = result(6) / 2.5
RadioButton2.Top = result(8) / 2.5
RadioButton3.Left = result(10) / 2.5
RadioButton3.Top = result(12) / 2.5
RadioButton4.Left = result(14) / 2.5
RadioButton4.Top = result(16) / 2.5
RadioButton5.Left = result(18) / 2.5
RadioButton5.Top = result(20) / 2.5
RadioButton6.Left = result(22) / 2.5
RadioButton6.Top = result(24) / 2.5
RadioButton7.Left = result(26) / 2.5
RadioButton7.Top = result(28) / 2.5
RadioButton8.Left = result(30) / 2.5
RadioButton8.Top = result(32) / 2.5
RadioButton9.Left = result(34) / 2.5
RadioButton9.Top = result(36) / 2.5
RadioButton10.Left = result(38) / 2.5
RadioButton10.Top = result(40) / 2.5
RadioButton11.Left = result(42) / 2.5
RadioButton11.Top = result(44) / 2.5
RadioButton12.Left = result(46) / 2.5
RadioButton12.Top = result(48) / 2.5
RadioButton13.Left = result(50) / 2.5
RadioButton13.Top = result(52) / 2.5
RadioButton14.Left = result(54) / 2.5
RadioButton14.Top = result(56) / 2.5
RadioButton15.Left = result(58) / 2.5
RadioButton15.Top = result(60) / 2.5
RadioButton16.Left = result(62) / 2.5
RadioButton16.Top = result(64) / 2.5
RadioButton17.Left = result(66) / 2.5
RadioButton17.Top = result(68) / 2.5
RadioButton18.Left = 128 + (result(70) / 2.5)
RadioButton18.Top = 124 + (result(72) / 2.5)
Else
Dim majestic = "majestic.yaml"
If Not System.IO.File.Exists(majestic) Then
MsgBox("File " + majestic + " not found!" + vbCrLf + "Install the latest version of Putty and try again.")
Return
End If
Dim Camreader As New IO.StreamReader(majestic)
Dim CamallLines = New List(Of String)
Do While Not Camreader.EndOfStream
CamallLines.Add(Camreader.ReadLine)
Loop
Camreader.Close()
For x = 0 To CamallLines.Count() - 1
If CamallLines(x).StartsWith(" size:") And txtResolution.Text = "" Then txtResolution.Text = ReadLine(x + 1, CamallLines)
If CamallLines(x).StartsWith(" fps:") And txtFPS.Text = "" Then txtFPS.Text = ReadLine(x + 1, CamallLines)
If CamallLines(x).StartsWith(" codec: h26") Then txtEncode.Text = ReadLine(x + 1, CamallLines)
If CamallLines(x).StartsWith(" bitrate:") Then txtBitrate.Text = ReadLine(x + 1, CamallLines)
If CamallLines(x).StartsWith(" exposure:") Then txtExposure.Text = ReadLine(x + 1, CamallLines)
If CamallLines(x).StartsWith(" contrast:") Then txtContrast.Text = ReadLine(x + 1, CamallLines)
If CamallLines(x).StartsWith(" hue:") Then txtHue.Text = ReadLine(x + 1, CamallLines)
If CamallLines(x).StartsWith(" saturation:") Then txtSaturation.Text = ReadLine(x + 1, CamallLines)
If CamallLines(x).StartsWith(" luminance:") Then txtLuminance.Text = ReadLine(x + 1, CamallLines)
If CamallLines(x).StartsWith(" flip:") Then txtFlip.Text = ReadLine(x + 1, CamallLines)
If CamallLines(x).StartsWith(" mirror:") Then txtMirror.Text = ReadLine(x + 1, CamallLines)
If CamallLines(x).StartsWith(" sensorConfig:") Then txtSensor.Text = ReadLine(x + 1, CamallLines)
Next
End If
Else
Dim setdisplay = "screen-mode"
If Not System.IO.File.Exists(setdisplay) Then
MsgBox("File " + setdisplay + " not found!" + vbCrLf + "Install the latest version of Putty and try again.")
Return
End If
Dim DisplayReader As New IO.StreamReader(setdisplay)
Dim DisplayReaderallLines = New List(Of String)
Do While Not DisplayReader.EndOfStream
DisplayReaderallLines.Add(DisplayReader.ReadLine)
Loop
DisplayReader.Close()
Dim LineOfText As String
Dim array() As String
LineOfText = ReadLine(1, DisplayReaderallLines)
array = LineOfText.Split("@")
txtResolutionVRX.Text = array(0)
txtCodecVRX.Text = array(1)
Dim stream = "wifibroadcast"
If Not System.IO.File.Exists(stream) Then
MsgBox("File " + stream + " not found!" + vbCrLf + "Install the latest version of Putty and try again.")
Return
End If
Dim streamReader As New IO.StreamReader(stream)
Dim streamReaderallLines = New List(Of String)
Do While Not streamReader.EndOfStream
streamReaderallLines.Add(streamReader.ReadLine)
Loop
streamReader.Close()
Dim streamOfText As String
Dim sArray() As String
streamOfText = ReadLine(1, streamReaderallLines)
sArray = streamOfText.Split("=")
txtExtras.Text = sArray(1).Replace("""", "")
End If
btnSaveReboot.Enabled = True
btnReboot.Enabled = True
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim IPsettings As String = "settings.conf"
If Not IO.File.Exists(IPsettings) Then
System.IO.File.Create(IPsettings).Dispose()
Dim fileExists As Boolean = File.Exists(IPsettings)
Using sw As New StreamWriter(File.Open(IPsettings, FileMode.OpenOrCreate))
sw.WriteLine("openipc:192.168.0.1")
sw.WriteLine("nvr:192.168.0.1")
sw.WriteLine("radxa:192.168.0.1")
End Using
MsgBox("File " + IPsettings + " not found and default created!")
End If
Dim IPsettingsReader As New IO.StreamReader(IPsettings)
Dim IPsettingsReaderallLines = New List(Of String)
Do While Not IPsettingsReader.EndOfStream
IPsettingsReaderallLines.Add(IPsettingsReader.ReadLine)
Loop
IPsettingsReader.Close()
Dim value1 As String
Dim value2 As String
Dim value3 As String
value1 = ReadLine(1, IPsettingsReaderallLines)
value2 = ReadLine(2, IPsettingsReaderallLines)
value3 = ReadLine(3, IPsettingsReaderallLines)
OpenIPCIP = value1.Split(":")(1)
NVRIP = value2.Split(":")(1)
RadxaIP = value3.Split(":")(1)
txtIP.Text = OpenIPCIP
ComboBox1.Items.Clear()
ComboBox1.Items.Add("5180 MHz [36]")
ComboBox1.Items.Add("5200 MHz [40]")
ComboBox1.Items.Add("5220 MHz [44]")
ComboBox1.Items.Add("5240 MHz [48]")
ComboBox1.Items.Add("5260 MHz [52]")
ComboBox1.Items.Add("5280 MHz [56]")
ComboBox1.Items.Add("5300 MHz [60]")
ComboBox1.Items.Add("5320 MHz [64]")
ComboBox1.Items.Add("5500 MHz [100]")
ComboBox1.Items.Add("5520 MHz [104]")
ComboBox1.Items.Add("5540 MHz [108]")
ComboBox1.Items.Add("5560 MHz [112]")
ComboBox1.Items.Add("5580 MHz [116]")
ComboBox1.Items.Add("5600 MHz [120]")
ComboBox1.Items.Add("5620 MHz [124]")
ComboBox1.Items.Add("5640 MHz [128]")
ComboBox1.Items.Add("5660 MHz [132]")
ComboBox1.Items.Add("5680 MHz [136]")
ComboBox1.Items.Add("5700 MHz [140]")
ComboBox1.Items.Add("5720 MHz [144]")
ComboBox1.Items.Add("5745 MHz [149]")
ComboBox1.Items.Add("5765 MHz [153]")
ComboBox1.Items.Add("5785 MHz [157]")
ComboBox1.Items.Add("5805 MHz [161]")
ComboBox1.Items.Add("5825 MHz [165]")
ComboBox1.Items.Add("5845 MHz [169]")
ComboBox1.Items.Add("5865 MHz [173]")
ComboBox1.Items.Add("5885 MHz [177]")
ComboBox1.Text = "Select 5.8GHz Frequency"
ComboBox2.Items.Clear()
ComboBox2.Items.Add("1")
ComboBox2.Items.Add("2")
ComboBox2.Items.Add("3")
ComboBox2.Items.Add("4")
ComboBox2.Items.Add("5")
ComboBox2.Items.Add("6")
ComboBox2.Items.Add("7")
ComboBox2.Items.Add("8")
ComboBox2.Items.Add("9")
ComboBox2.Items.Add("10")
ComboBox2.Items.Add("11")
ComboBox2.Items.Add("12")
ComboBox2.Items.Add("13")
ComboBox2.Items.Add("14")
ComboBox2.Items.Add("15")
ComboBox2.Items.Add("16")
ComboBox2.Items.Add("17")
ComboBox2.Items.Add("18")
ComboBox2.Items.Add("19")
ComboBox2.Items.Add("20")
ComboBox2.Items.Add("25")
ComboBox2.Items.Add("30")
ComboBox2.Items.Add("35")
ComboBox2.Items.Add("40")
ComboBox2.Items.Add("45")
ComboBox2.Items.Add("50")
ComboBox2.Items.Add("55")
ComboBox2.Items.Add("58")
ComboBox2.Items.Add("60")
ComboBox2.Items.Add("63")
ComboBox2.Text = "Select 5.8GHz TX Power"
ComboBox3.Items.Clear()
ComboBox3.Items.Add("2412 MHz [1]")
ComboBox3.Items.Add("2417 MHz [2]")
ComboBox3.Items.Add("2422 MHz [3]")
ComboBox3.Items.Add("2427 MHz [4]")
ComboBox3.Items.Add("2432 MHz [5]")
ComboBox3.Items.Add("2437 MHz [6]")
ComboBox3.Items.Add("2442 MHz [7]")
ComboBox3.Items.Add("2447 MHz [8]")
ComboBox3.Items.Add("2452 MHz [9]")
ComboBox3.Items.Add("2457 MHz [10]")
ComboBox3.Items.Add("2462 MHz [11]")
ComboBox3.Items.Add("2467 MHz [12]")
ComboBox3.Items.Add("2472 MHz [13]")
ComboBox3.Items.Add("2484 MHz [14]")
ComboBox3.Text = "Select 2.4GHz Frequency"
ComboBox4.Items.Clear()
ComboBox4.Items.Add("20")
ComboBox4.Items.Add("25")
ComboBox4.Items.Add("30")
ComboBox4.Items.Add("35")
ComboBox4.Items.Add("40")
ComboBox4.Items.Add("45")
ComboBox4.Items.Add("50")
ComboBox4.Items.Add("55")
ComboBox4.Items.Add("58")
ComboBox4.Text = "Select 2.4GHz TX Power"
ComboBox5.Items.Clear()
ComboBox5.Items.Add("0")
ComboBox5.Items.Add("1")
ComboBox5.Items.Add("2")
ComboBox5.Items.Add("3")
ComboBox5.Items.Add("4")
ComboBox5.Items.Add("5")
ComboBox5.Items.Add("6")
ComboBox5.Items.Add("7")
ComboBox5.Items.Add("8")
ComboBox5.Items.Add("9")
ComboBox5.Items.Add("10")
ComboBox5.Items.Add("11")
ComboBox5.Items.Add("12")
ComboBox5.Items.Add("13")
ComboBox5.Items.Add("14")
ComboBox5.Items.Add("15")
ComboBox5.Items.Add("16")
ComboBox5.Items.Add("17")
ComboBox5.Items.Add("18")
ComboBox5.Items.Add("19")
ComboBox5.Items.Add("20")
ComboBox5.Items.Add("21")
ComboBox5.Items.Add("22")
ComboBox5.Items.Add("23")
ComboBox5.Items.Add("24")
ComboBox5.Items.Add("25")
ComboBox5.Items.Add("26")
ComboBox5.Items.Add("27")
ComboBox5.Items.Add("28")
ComboBox5.Items.Add("29")
ComboBox5.Items.Add("30")
ComboBox5.Items.Add("31")
ComboBox5.Text = "Select MCS INDEX"
ComboBox6.Items.Clear()
ComboBox6.Items.Add("0")
ComboBox6.Items.Add("1")
ComboBox6.Text = "Select STBC"
ComboBox7.Items.Clear()
ComboBox7.Items.Add("0")
ComboBox7.Items.Add("1")
ComboBox7.Text = "Select LDPC"
ComboBox8.Items.Clear()
ComboBox8.Items.Add("1")
ComboBox8.Items.Add("2")
ComboBox8.Items.Add("3")
ComboBox8.Items.Add("4")
ComboBox8.Items.Add("5")
ComboBox8.Items.Add("6")
ComboBox8.Items.Add("7")
ComboBox8.Items.Add("8")
ComboBox8.Items.Add("9")
ComboBox8.Items.Add("10")
ComboBox8.Items.Add("11")
ComboBox8.Items.Add("12")
ComboBox8.Items.Add("13")
ComboBox8.Items.Add("14")
ComboBox8.Items.Add("15")
ComboBox8.Text = "Select FEC K"
ComboBox9.Items.Clear()
ComboBox9.Items.Add("1")
ComboBox9.Items.Add("2")
ComboBox9.Items.Add("3")
ComboBox9.Items.Add("4")
ComboBox9.Items.Add("5")
ComboBox9.Items.Add("6")
ComboBox9.Items.Add("7")
ComboBox9.Items.Add("8")
ComboBox9.Items.Add("9")
ComboBox9.Items.Add("10")
ComboBox9.Items.Add("11")
ComboBox9.Items.Add("12")
ComboBox9.Items.Add("13")
ComboBox9.Items.Add("14")
ComboBox9.Items.Add("15")
ComboBox9.Text = "Select FEC N"
cmbResolution.Items.Clear()
cmbResolution.Items.Add("1280x720")
cmbResolution.Items.Add("1456x816")
cmbResolution.Items.Add("1920x1080")
cmbResolution.Items.Add("2104x1184")
cmbResolution.Items.Add("2208x1248")
cmbResolution.Items.Add("2240x1264")
cmbResolution.Items.Add("2312x1304")
cmbResolution.Items.Add("2512x1416")
cmbResolution.Items.Add("2560x1440")
cmbResolution.Items.Add("2560x1920")
cmbResolution.Items.Add("3200x1800")
cmbResolution.Items.Add("3840x2160")
cmbResolution.Text = "Select Resolution"
cmbOSD.Items.Clear()
cmbOSD.Items.Add("simple")
cmbOSD.Items.Add("none")
cmbOSD.Text = "Select OSD"
cmbFormat.Items.Clear()
cmbFormat.Items.Add("frame")
cmbFormat.Items.Add("stream")
cmbFormat.Text = "Select Format"
cmbResolutionVRX.Items.Clear()
cmbResolutionVRX.Items.Add("720p60")
cmbResolutionVRX.Items.Add("1080p60")
cmbResolutionVRX.Items.Add("1024x768x60")
cmbResolutionVRX.Items.Add("1366x768x60")
cmbResolutionVRX.Items.Add("1280x1024x60")
cmbResolutionVRX.Items.Add("1600x1200x60")
cmbResolutionVRX.Items.Add("2560x1440x30")
cmbResolutionVRX.Text = "Select Resolution"
cmbFPS.Items.Clear()
cmbFPS.Items.Add("20")
cmbFPS.Items.Add("30")
cmbFPS.Items.Add("40")
cmbFPS.Items.Add("50")
cmbFPS.Items.Add("60")
cmbFPS.Items.Add("70")
cmbFPS.Items.Add("80")
cmbFPS.Items.Add("90")
cmbFPS.Items.Add("100")
cmbFPS.Items.Add("110")
cmbFPS.Items.Add("120")
cmbFPS.Text = "Select FPS"
cmbCodec.Items.Clear()
cmbCodec.Items.Add("h264")
cmbCodec.Items.Add("h265")
cmbCodec.Text = "Select Codec"
cmbCodecVRX.Items.Clear()
cmbCodecVRX.Items.Add("h264")
cmbCodecVRX.Items.Add("h265")
cmbCodecVRX.Text = "Select Codec"
cmbBitrate.Items.Clear()
cmbBitrate.Items.Add("1024")
cmbBitrate.Items.Add("2048")
cmbBitrate.Items.Add("3072")
cmbBitrate.Items.Add("4096")
cmbBitrate.Items.Add("5120")
cmbBitrate.Items.Add("6144")
cmbBitrate.Items.Add("7168")
cmbBitrate.Items.Add("8192")
cmbBitrate.Items.Add("9216")
cmbBitrate.Items.Add("10240")
cmbBitrate.Items.Add("11264")
cmbBitrate.Items.Add("12288")
cmbBitrate.Items.Add("13312")
cmbBitrate.Items.Add("14336")
cmbBitrate.Items.Add("15360")
cmbBitrate.Items.Add("16384")
cmbBitrate.Items.Add("17408")
cmbBitrate.Items.Add("18432")
cmbBitrate.Items.Add("19456")
cmbBitrate.Items.Add("19968")
cmbBitrate.Text = "Select Bitrate"
cmbExposure.Items.Clear()
cmbExposure.Items.Add("5")
cmbExposure.Items.Add("6")
cmbExposure.Items.Add("8")
cmbExposure.Items.Add("10")
cmbExposure.Items.Add("11")
cmbExposure.Items.Add("12")
cmbExposure.Items.Add("14")
cmbExposure.Items.Add("16")
cmbExposure.Items.Add("33")
cmbExposure.Items.Add("50")
cmbExposure.Text = "Select Exposure"
cmbContrast.Items.Clear()
cmbContrast.Items.Add("1")
cmbContrast.Items.Add("5")
cmbContrast.Items.Add("10")
cmbContrast.Items.Add("20")
cmbContrast.Items.Add("30")
cmbContrast.Items.Add("40")
cmbContrast.Items.Add("50")
cmbContrast.Items.Add("60")
cmbContrast.Items.Add("70")
cmbContrast.Items.Add("80")
cmbContrast.Items.Add("90")
cmbContrast.Items.Add("100")
cmbContrast.Text = "Select Contrast"
cmbHue.Items.Clear()
cmbHue.Items.Add("1")
cmbHue.Items.Add("5")
cmbHue.Items.Add("10")
cmbHue.Items.Add("20")
cmbHue.Items.Add("30")
cmbHue.Items.Add("40")
cmbHue.Items.Add("50")
cmbHue.Items.Add("60")
cmbHue.Items.Add("70")
cmbHue.Items.Add("80")
cmbHue.Items.Add("90")
cmbHue.Items.Add("100")
cmbHue.Text = "Select Hue"
cmbSaturation.Items.Clear()
cmbSaturation.Items.Add("1")
cmbSaturation.Items.Add("5")
cmbSaturation.Items.Add("10")
cmbSaturation.Items.Add("20")
cmbSaturation.Items.Add("30")
cmbSaturation.Items.Add("40")
cmbSaturation.Items.Add("50")
cmbSaturation.Items.Add("60")
cmbSaturation.Items.Add("70")
cmbSaturation.Items.Add("80")
cmbSaturation.Items.Add("90")
cmbSaturation.Items.Add("100")
cmbSaturation.Text = "Select Saturation"
cmbLuminance.Items.Clear()
cmbLuminance.Items.Add("1")
cmbLuminance.Items.Add("5")
cmbLuminance.Items.Add("10")
cmbLuminance.Items.Add("20")
cmbLuminance.Items.Add("30")
cmbLuminance.Items.Add("40")
cmbLuminance.Items.Add("50")
cmbLuminance.Items.Add("60")
cmbLuminance.Items.Add("70")
cmbLuminance.Items.Add("80")
cmbLuminance.Items.Add("90")
cmbLuminance.Items.Add("100")
cmbLuminance.Text = "Select Luminance"
cmbFlip.Items.Clear()
cmbFlip.Items.Add("true")
cmbFlip.Items.Add("false")
cmbFlip.Text = "Select Flip"
cmbMirror.Items.Clear()
cmbMirror.Items.Add("true")
cmbMirror.Items.Add("false")
cmbMirror.Text = "Select Mirror"
cmbSerial.Items.Clear()
cmbSerial.Items.Add("/dev/ttyS0")
cmbSerial.Items.Add("/dev/ttyS1")
cmbSerial.Items.Add("/dev/ttyS2")
cmbSerial.Text = "Select Serial Port"
cmbBaud.Items.Clear()
cmbBaud.Items.Add("4800")
cmbBaud.Items.Add("9600")
cmbBaud.Items.Add("19200")
cmbBaud.Items.Add("38400")
cmbBaud.Items.Add("57600")
cmbBaud.Items.Add("115200")
cmbBaud.Text = "Select Baud Rate"
cmbRouter.Items.Clear()
cmbRouter.Items.Add("MAVFWD")
cmbRouter.Items.Add("MAVLINK-ROUTER")
cmbRouter.Items.Add("MSPOSD")
cmbRouter.Text = "Select Router"
cmbMCSTLM.Items.Clear()
cmbMCSTLM.Items.Add("0")
cmbMCSTLM.Items.Add("1")
cmbMCSTLM.Items.Add("2")
cmbMCSTLM.Items.Add("3")
cmbMCSTLM.Items.Add("4")
cmbMCSTLM.Items.Add("5")
cmbMCSTLM.Items.Add("6")
cmbMCSTLM.Items.Add("7")
cmbMCSTLM.Items.Add("8")
cmbMCSTLM.Items.Add("9")
cmbMCSTLM.Text = "Select MCS INDEX"
cmbAggregate.Items.Clear()
cmbAggregate.Items.Add("0")
cmbAggregate.Items.Add("1")
cmbAggregate.Items.Add("2")
cmbAggregate.Items.Add("4")
cmbAggregate.Items.Add("6")
cmbAggregate.Items.Add("8")
cmbAggregate.Items.Add("10")
cmbAggregate.Items.Add("12")
cmbAggregate.Items.Add("14")
cmbAggregate.Items.Add("15")
cmbAggregate.Text = "Select Aggregate"
cmbRC_Channel.Items.Clear()
cmbRC_Channel.Items.Add("1")
cmbRC_Channel.Items.Add("2")
cmbRC_Channel.Items.Add("3")
cmbRC_Channel.Items.Add("4")
cmbRC_Channel.Items.Add("5")
cmbRC_Channel.Items.Add("6")
cmbRC_Channel.Items.Add("7")
cmbRC_Channel.Items.Add("8")
cmbRC_Channel.Text = "Select RC Channel"
Dim dir = "sensors\"
For Each file As String In System.IO.Directory.GetFiles(dir)
cmbSensor.Items.Add(System.IO.Path.GetFileNameWithoutExtension(file))
Next
cmbSensor.Text = "Select Sensor"
cmbVersion.Items.Clear()
cmbVersion.Items.Add("ssc338q_fpv_emax-wyvern-link-nor")
cmbVersion.Items.Add("ssc338q_fpv_openipc-mario-aio-nor")
cmbVersion.Items.Add("ssc338q_fpv_openipc-urllc-aio-nor")
cmbVersion.Items.Add("ssc338q_fpv_runcam-wifilink-nor")
cmbVersion.Items.Add("openipc.ssc338q-nor-fpv")
cmbVersion.Items.Add("openipc.ssc338q-nor-rubyfpv")
cmbVersion.Items.Add("openipc.ssc338q-nand-fpv")
cmbVersion.Items.Add("openipc.ssc338q-nand-rubyfpv")
cmbVersion.Items.Add("openipc.ssc30kq-nor-fpv")
cmbVersion.Items.Add("openipc.ssc30kq-nor-rubyfpv")
cmbVersion.Items.Add("openipc.hi3536dv100-nor-fpv")
cmbVersion.Items.Add("openipc.gk7205v200-nor-fpv")
cmbVersion.Items.Add("openipc.gk7205v200-nor-rubyfpv")
cmbVersion.Items.Add("openipc.gk7205v210-nor-fpv")
cmbVersion.Items.Add("openipc.gk7205v210-nor-rubyfpv")
cmbVersion.Items.Add("openipc.gk7205v300-nor-fpv")
cmbVersion.Items.Add("openipc.gk7205v300-nor-rubyfpv")
cmbVersion.Items.Add("openipc.hi3516ev300-nor-fpv")
cmbVersion.Items.Add("openipc.hi3516ev200-nor-fpv")
cmbVersion.Text = "Select OpenIPC Version"
rBtnCam.BackColor = Color.Gold
rBtnCam.ForeColor = Color.Black
End Sub
Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
Dim sInput = ComboBox1.SelectedItem.ToString
Dim last4Letter = sInput.Substring(sInput.Length - 4).Replace("]", "").Replace("[", "")
If rBtnRadxaZero3w.Checked Then
txtFrequency.Text = "wifi_channel = " & last4Letter
Else
txtFrequency.Text = "channel=" & last4Letter
txtFreq24.Text = "frequency="
End If
End Sub
Private Sub ComboBox2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox2.SelectedIndexChanged
If rBtnRadxaZero3w.Checked Then
txtPower.Text = "options 88XXau_wfb rtw_tx_pwr_idx_override=" & ComboBox2.SelectedItem.ToString
Else
txtPower.Text = "driver_txpower_override=" & ComboBox2.SelectedItem.ToString
End If
End Sub
Private Sub ComboBox3_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox3.SelectedIndexChanged
Dim sInput = ComboBox3.SelectedItem.ToString
Dim last3Letter = sInput.Substring(sInput.Length - 3).Replace("]", "").Replace("[", "")
txtFrequency.Text = "channel="
txtFreq24.Text = "frequency=" & last3Letter
End Sub
Private Sub ComboBox4_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox4.SelectedIndexChanged
txtPower24.Text = "txpower=" & ComboBox4.SelectedItem.ToString
End Sub
Private Sub ComboBox5_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox5.SelectedIndexChanged
txtMCS.Text = "mcs_index=" & ComboBox5.SelectedItem.ToString
End Sub
Private Sub ComboBox6_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox6.SelectedIndexChanged
txtSTBC.Text = "stbc=" & ComboBox6.SelectedItem.ToString
End Sub
Private Sub ComboBox7_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox7.SelectedIndexChanged
txtLDPC.Text = "ldpc=" & ComboBox7.SelectedItem.ToString
End Sub
Private Sub ComboBox8_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox8.SelectedIndexChanged
txtFECK.Text = "fec_k=" & ComboBox8.SelectedItem.ToString
End Sub
Private Sub ComboBox9_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox9.SelectedIndexChanged
txtFECN.Text = "fec_n=" & ComboBox9.SelectedItem.ToString
End Sub
Private Sub cmbResolution_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbResolution.SelectedIndexChanged
txtResolution.Text = " size: " & cmbResolution.SelectedItem.ToString
If cmbResolution.SelectedItem = "1280x720" Then
txtFPS.Text = " fps: 120"
cmbFPS.Text = "120"
txtExposure.Text = " exposure: 8"
cmbExposure.Text = "8"
ElseIf cmbResolution.SelectedItem = "1456x816" Then
txtFPS.Text = " fps: 120"
cmbFPS.Text = "120"
txtExposure.Text = " exposure: 8"
cmbExposure.Text = "8"
ElseIf cmbResolution.SelectedItem = "2208x1248" Then
txtFPS.Text = " fps: 90"
cmbFPS.Text = "90"
txtExposure.Text = " exposure: 11"
cmbExposure.Text = "11"
ElseIf cmbResolution.SelectedItem = "1920x1080" Then
txtFPS.Text = " fps: 90"
cmbFPS.Text = "90"
txtExposure.Text = " exposure: 11"
cmbExposure.Text = "11"
ElseIf cmbResolution.SelectedItem = "2104x1184" Then
txtFPS.Text = " fps: 100"
cmbFPS.Text = "100"
txtExposure.Text = " exposure: 10"
cmbExposure.Text = "10"
ElseIf cmbResolution.SelectedItem = "2240x1264" Then
txtFPS.Text = " fps: 60"
cmbFPS.Text = "60"
txtExposure.Text = " exposure: 16"
cmbExposure.Text = "16"
ElseIf cmbResolution.SelectedItem = "2512x1416" Then
txtFPS.Text = " fps: 70"
cmbFPS.Text = "70"
txtExposure.Text = " exposure: 14"
cmbExposure.Text = "14"
ElseIf cmbResolution.SelectedItem = "2312x1304" Then
txtFPS.Text = " fps: 80"
cmbFPS.Text = "80"
txtExposure.Text = " exposure: 12"
cmbExposure.Text = "12"
ElseIf cmbResolution.SelectedItem = "2560x1440" Then
txtFPS.Text = " fps: 60"
cmbFPS.Text = "60"
txtExposure.Text = " exposure: 16"
cmbExposure.Text = "16"
ElseIf cmbResolution.SelectedItem = "2560x1920" Then
txtFPS.Text = " fps: 30"
cmbFPS.Text = "30"
txtExposure.Text = " exposure: 33"
cmbExposure.Text = "33"
ElseIf cmbResolution.SelectedItem = "3200x1800" Then
txtFPS.Text = " fps: 30"
cmbFPS.Text = "30"
txtExposure.Text = " exposure: 33"
cmbExposure.Text = "33"
ElseIf cmbResolution.SelectedItem = "3840x2160" Then
txtFPS.Text = " fps: 20"
cmbFPS.Text = "20"
txtExposure.Text = " exposure: 50"
cmbExposure.Text = "50"
End If
End Sub
Private Sub cmbFPS_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbFPS.SelectedIndexChanged
txtFPS.Text = " fps: " & cmbFPS.SelectedItem.ToString
txtExposure.Text = " exposure: " & Math.Floor(1000 / CInt(cmbFPS.SelectedItem.ToString))