Code:
For Each line1 As String In File.ReadLines(LocalFileName)
If MyLocalExit = False Then
If Pause = False Then
If line1.Contains("$GPRMC") Then
Dim valueLine() As String = line1.Split(",")
' MsgBox(valueLine(7))
LocalMapLat = valueLine(7).Substring(0, 2) & "°"
LocalMapLat = LocalMapLat & valueLine(7).Substring(2) & """"
LocalMapLat = LocalMapLat & valueLine(8)
LocalMapLatMinutes = (CSng(Mid(valueLine(7), 3, 7)) / 60)
LocalMapsngLatitude = CSng(VB.Left(valueLine(7), 2)) + LocalMapLatMinutes
LocalMapLat = CStr(LocalMapsngLatitude)
LocalMapLatDecimal = CDbl(Val(LocalMapsngLatitude))
LocalMapLng = valueLine(9).Substring(0, 3) & "°"
LocalMapLng = LocalMapLng & valueLine(9).Substring(3) & """"
LocalMapLng = LocalMapLng & valueLine(10)
LocalMapLngMinutes = (CSng(Mid(valueLine(9), 4, 7)) / 60)
LocalMapsngLongitude = CSng(VB.Left(valueLine(9), 3)) + LocalMapLngMinutes
LocalMapLng = CStr(LocalMapsngLongitude)
LocalMapLngDecimal = CDbl(Val(LocalMapsngLongitude))
Dim MyLocalDate = valueLine(1).Substring(0, 10)
TextBox4.Text = MyLocalDate
Dim MyLocalTime = valueLine(2).Substring(0, 12)
TextBox5.Text = MyLocalTime
LocalMapsngLongitude = (LocalMapsngLongitude * -1)
tLoc = tMap.GetLocation(LocalMapLatDecimal, LocalMapLngDecimal, 0.0)
tLoc.GoTo()
TextBox2.Text = ("Latitude " & LocalMapsngLatitude & " Longitude " & LocalMapsngLongitude)
Car = tMap.AddPushpin(tLoc)
Car.Symbol = 30
Car.BalloonState = GeoBalloonState.geoDisplayNone
Wait(100)
End If
If line1.Contains("Score") Then
ScoreCCount = ScoreCCount + 1
TextBox9.Text = ScoreCCount
Dim valueLine() As String = line1.Split(",")
Dim Score = valueLine(4).Substring(35, 4)
Dim OffSet = valueLine(5).Substring(0, 32)
TextBox3.Text = (OffSet)
Dim MyScore = valueLine(4).Substring(11, 28)
TextBox6.Text = MyScore
Dim ScoreFail = valueLine(4).Substring(35, 5)
If ScoreFail <= 2.499 Then
ScoreFailCount = ScoreFailCount + 1
TextBox11.Text = ScoreFailCount
I = I + 1
result = (ScoreFailCount / I) * 100
TextBox10.Text = result & (" %")
End If
If ScoreFail >= 2.5 Then
I = I + 1
result = (ScoreFailCount / I) * 100
TextBox10.Text = result & (" %")
End If
tLoc = tMap.GetLocation(LocalMapLatDecimal, LocalMapLngDecimal, 0.0)
tLoc.GoTo()
If Score < 2.5 Then
Smiley = tMap.AddPushpin(tLoc)
Smiley.Symbol = 65
Smiley.BalloonState = GeoBalloonState.geoDisplayNone
Else
Smiley = tMap.AddPushpin(tLoc)
Smiley.Symbol = 70
Smiley.BalloonState = GeoBalloonState.geoDisplayNone
End If
Smiley.Note = "Score " & Score
If CheckBox2.Checked = True Then
Smiley.BalloonState = GeoBalloonState.geoDisplayBalloon
Else
Smiley.BalloonState = GeoBalloonState.geoDisplayNone
End If
End If
If line1.Contains("HW On") Then
OvalShape1.BackColor = Color.Red
ElseIf line1.Contains("HW Off") Then
OvalShape1.BackColor = Color.Lime
End If
If line1.Contains("BEGIN") Then
OvalShape2.BackColor = Color.Yellow
ElseIf line1.Contains("END") Then
OvalShape2.BackColor = Color.Lime
End If
Dim MyWait As Integer
MyWait = ComboBox1.SelectedItem
Wait(MyWait)
' System.Threading.Thread.Sleep(1000)
System.Windows.Forms.Application.DoEvents()
If line1.Contains("Com") Then
Dim valueLine() As String = line1.Split(",")
Dim ComPort = valueLine(0).Substring(14, 2)
TextBox7.Text = ComPort
End If
If line1.Contains("HW") Then
Dim valueLine() As String = line1.Split(",")
Dim RADPort = valueLine(0).Substring(14, 2)
TextBox8.Text = HWPort
End If
End If
End If
Next line1
System.Threading.Thread.Sleep(1000)
System.Windows.Forms.Application.DoEvents()
For Each line2 As String In File.ReadLines(DistantFileName)
If MyDistantExit = False Then
If Pause = False Then
If line2.Contains("$GPRMC") Then
Dim valueLine() As String = line2.Split(",")
' MsgBox(valueLine(7))
DistantMapLat = valueLine(7).Substring(0, 2) & "°"
DistantMapLat = DistantMapLat & valueLine(7).Substring(2) & """"
DistantMapLat = DistantMapLat & valueLine(8)
DistantMapLatMinutes = (CSng(Mid(valueLine(7), 3, 7)) / 60)
DistantMapsngLatitude = CSng(VB.Left(valueLine(7), 2)) + DistantMapLatMinutes
DistantMapLat = CStr(DistantMapsngLatitude)
DistantMapLatDecimal = CDbl(Val(DistantMapsngLatitude))
DistantMapLng = valueLine(9).Substring(0, 3) & "°"
DistantMapLng = DistantMapLng & valueLine(9).Substring(3) & """"
DistantMapLng = DistantMapLng & valueLine(10)
DistantMapLngMinutes = (CSng(Mid(valueLine(9), 4, 7)) / 60)
DistantMapsngLongitude = CSng(VB.Left(valueLine(9), 3)) + DistantMapLngMinutes
DistantMapLng = CStr(DistantMapsngLongitude)
DistantMapLngDecimal = CDbl(Val(DistantMapsngLongitude))
Dim MyDistantDate = valueLine(1).Substring(0, 10)
TextBox17.Text = MyDistantDate
Dim MyDistantTime = valueLine(2).Substring(0, 12)
TextBox16.Text = MyDistantTime
Wait(100)
DistantMapsngLongitude = (DistantMapsngLongitude * -1)
TextBox14.Text = ("Latitude " & DistantMapsngLatitude & " Longitude " & DistantMapsngLongitude)
End If
If line2.Contains("Score") Then
ScoreCCount = ScoreCCount + 1
TextBox22.Text = ScoreCCount
Dim valueLine() As String = line2.Split(",")
Dim Score = valueLine(4).Substring(35, 4)
Dim OffSet = valueLine(5).Substring(0, 32)
TextBox18.Text = (OffSet)
Dim MyScore = valueLine(4).Substring(11, 28)
TextBox15.Text = MyScore
Dim ScoreFail = valueLine(4).Substring(35, 5)
If ScoreFail <= 2.499 Then
ScoreFailCount = ScoreFailCount + 1
TextBox20.Text = ScoreFailCount
I = I + 1
result = (ScoreFailCount / I) * 100
TextBox21.Text = result & (" %")
End If
If ScoreFail >= 2.5 Then
I = I + 1
result = (ScoreFailCount / I) * 100
TextBox21.Text = result & (" %")
End If
End If
If line2.Contains("HW On") Then
OvalShape4.BackColor = Color.Red
ElseIf line2.Contains("HW Off") Then
OvalShape4.BackColor = Color.Lime
End If
If line2.Contains("BEGIN") Then
OvalShape3.BackColor = Color.Yellow
ElseIf line2.Contains("END") Then
OvalShape3.BackColor = Color.Lime
End If
System.Windows.Forms.Application.DoEvents()
If line2.Contains("Com") Then
Dim valueLine() As String = line2.Split(",")
Dim ComPort = valueLine(0).Substring(14, 2)
TextBox19.Text = ComPort
End If
End If
End If
Next line2