Sub JobDone (job As HttpJob)
If job.Success = True Then
Select job.JobName
Case "Job8"
'Dim Markers As List
t=job8.GetString2("GREEK").trim
If t.IndexOf("PASTA")>-1 Then
'ToastMessageShow("no admin", True)
Log("oux")
ExitApplication
Else
If fs=False Then
'MapPane1.RemoveMapMarker(Marker1)
Else
'MarkersOverlay1.Initialize(MapView1, "MarkersOverlay1")
'MarkersOverlay1.Initialize("Icon", Icon, 41.08805, 23.549323)
'MarkersOverlay1.SetCursor(fx.Cursors.HAND)
'MapView1.AddOverlay(MarkersOverlay1)
'Log("ok")
'MapPane1.AddMapOverlay(MarkersOverlay1)
End If
'Markers.Initialize
'here i am parsing... the vehicles alive...
Dim car As String, llat As String, llng As String, lspeed As String, lmsg As String
Dim lllat As Float, lllng As Float, lllspeed As Float
Dim hx As Long, gx As Long, wp As Long
hx=0
gx = 1
wp = 0
Do While hx<t.Length
If gx<=5 Then
Select Case gx
Case 1
wp=wp+1
car = t.SubString2(hx,t.IndexOf2("|",hx)).trim
hx = t.IndexOf2("|",hx)+1
Case 2
llat = t.SubString2(hx,t.IndexOf2("|",hx)).trim
hx = t.IndexOf2("|",hx)+1
Case 3
llng= t.SubString2(hx,t.IndexOf2("|",hx)).trim
hx = t.IndexOf2("|",hx)+1
Case 4
lspeed= t.SubString2(hx,t.IndexOf2("|",hx)).trim
hx = t.IndexOf2("|",hx)+1
Case 5
lmsg = t.SubString2(hx, t.IndexOf2("/",hx)).trim
gx = 0
hx=t.IndexOf2("/",hx)+1
lllat = llat.Replace(",",".")
lllng = llng.Replace(",",".")
lllspeed = lspeed.Replace(",",".")
If lllat > 0 AND lllng > 0 Then
If seecar.Trim="" Then
speed=lllspeed
Else
speed = lllspeed * 3.6
'MapView1.AnimateTo (lllat, lllng)
End If
xspeed = speed
thecar = car.trim
If lmsg.trim = "SOS" Then
If Marker1(thecar).IsInitialized=False Then
Marker1(thecar).Initialize2("car" , Icon2, lllat, lllng,0)
Marker1(thecar).SetCursor(fx.Cursors.HAND)
Marker1(thecar).Tag = "No." & car.trim & " - speed: " & xspeed & "χλμ/ω"
MapPane1.AddMapMarker(Marker1(thecar))
Else
Marker1(thecar).Tag = "No." & car.trim & " - speed: " & xspeed & "χλμ/ω"
Marker1(thecar).SetLat(lllat)
Marker1(thecar).setlon(lllng)
MapPane1.AddMapMarker(Marker1(thecar))
End If
Else
If Marker1(thecar).IsInitialized=False Then
Marker1(thecar).Initialize2("car" , Icon, lllat, lllng,0)
Marker1(thecar).SetCursor(fx.Cursors.HAND)
Marker1(thecar).Tag = "No." & car.trim & " - speed: " & xspeed & "χλμ/ω"
MapPane1.AddMapMarker(Marker1(thecar))
Else
Marker1(thecar).Tag = "No." & car.trim & " - speed: " & xspeed & "χλμ/ω"
Marker1(thecar).SetLat(lllat)
Marker1(thecar).setlon(lllng)
MapPane1.AddMapMarker(Marker1(thecar))
End If
End If
'Markers.Add(Marker1)
'here i ll ve the calculation of distance... with the previous point (lat,lon)
'+here i ll have the sql add new record + some other features / will have asyncronous i will helped...
End If
End Select
gx=gx+1
End If
'here i was hoping for doevents
Loop
'here i was hoping for doevents + here making more light...
'MapPane1.AddMapMarker(Marker1)
'MarkersOverlay1.AddMarkers(Markers)
If fs Then
'TileSource="Mapnik"
'MapPane1.SetDisplayToFitMapMarkers'FitMapToBoundingBox(MarkersOverlay1.GetBoundingBox)
fs=False
'MapPane1.SetZoom(ZoomLevel)
'MapPane1.SetDisplayPosition(41.086662,23.547206,ZoomLevel)
Else
'MapView1.FitMapToBoundingBox(MarkersOverlay1.GetBoundingBox)
'MapPane1.SetDisplayToFitMapMarkers
'MapPane1.SetZoom(ZoomLevel)
'MapView1.Zoom=ZoomLevel
End If
End If
End Select
End If
job.Release
timer3.Enabled = True
End Sub
Sub download
'this will replaced because i want to have it from local sql / will be better if read from SQL directly - here i am parsing it... for remote monitoring..
job8.Initialize("Job8", Me)
job8.download("http://" & serversite & "/livecheckall.asp?car=" & username & "&password=" & pass)
end sub
Sub Timer3_Tick
timer3.Enabled = False
download
End Sub