Sub chart_chartitemclicked(Message As String)
Dim sb As ABMSideBar = page.GetSideBar("SideBar")
Dim cn As ABMContainer = sb.Content.Component("cnt1")
Dim us As ABMCheckbox = cn.Component("btnshowus")
DateTime.TimeFormat = "HH:mm:ss"
ListFindOther.Initialize
Dim mark As List
mark.Initialize
Dim mes As String = Message
' Log(" chart clicked "&Message)
Log(" ECM File SIze: "&ListECM.Size)
Dim idx As Int = Message.IndexOf("row:")
' Log(" row at: "&idx)
mes = mes.Replace("row:","")
Dim idx As Int = mes.IndexOf(",")
Dim val As String =""
If idx > 0 Then
val = mes.SubString2(1, idx)
Log(" rec to get: "&val)
Else
Log(" no index > 0")
End If
If IsNumber(val) Then
Dim val0 As Int = val - 60 '20
If val0 < 0 Then
val0 = 1
End If
Dim val1 As Int = val + 60 '20
If val1 > ListECM.Size Then
val1 = ListECM.Size
End If
gm1.RemoveMarkers
gm1.RemovePolygons
Log(" Number of select recs: "&(val1-val0) )
Dim xpp As Map
xpp.Initialize
Dim xpp As Map = ListECM.Get(0)
' Dim tlt As Double = xpp.Get("501") '+ 0.0009
Dim tln As Double = xpp.Get("502") ' - 0.0005
For i = val0 To val1
Dim mpp As Map = ListECM.Get(i)
ListFindOther.Add(mpp)
Dim lt As Double = mpp.Get("501") '+ 0.0009
Dim ln As Double = mpp.Get("502") + 0.0005
If ln < tln Then
Log("IF ln: "&ln&" tln: "&tln)
Else
Log("else ln: "&ln&" tln: "&tln)
Dim tln As Double = mpp.Get("502")' - 0.0005
End If
If (i = val1) Then
mark.Add(lt)
If ln < tln Then
Dim temp As Double
temp = (tln - ln) + .005
mark.Add(tln - (temp))
Log("Subtracting: "&ln&" tln: "&tln)
Else
Log("Adding "&ln&" tln: "&tln)
mark.Add(tln + (0.305))
End If
Else
mark.Add(lt)
mark.Add(ln)
End If
Dim lat As String = mpp.Get("501")
Dim lon As String = mpp.Get("502")
Dim sp As String = mpp.GetDefault("2",0)
Dim tm As String = mpp.GetDefault("1",0)
Dim rp As String = mpp.GetDefault("4",0)
If us.State Then
sp = NumberFormat2(sp * 0.62137 ,1,1,1,False)
End If
Dim dt As String = DateTime.Time(tm)
Dim legend As String = " {B} Time: "&" "&dt&" {BR}"
legend = legend&" Speed: "&" "&sp&" {BR}"
legend = legend&" RPM: "&" "&rp&" {/B} {BR}"
If i = val Then
gm1.AddMarker( "mk"&i,lat,lon, ABM.COLOR_RED ,"Speed: "&sp&" Time: "&" "&dt&" ", legend)
Else
gm1.AddMarker( "mk"&i,lat,lon, ABM.COLOR_Blue ,"Speed: "&sp&" Time: "&" "&dt&" ",legend)
End If
Next
gm1.SetLocation( lat,lon)
gm1.Refresh
End If
gm1.AddPolygon( "p1" , mark , ABM.COLOR_DEEPORANGE, ABM.INTENSITY_NORMAL, 1.0, 5, ABM.COLOR_CYAN, ABM.INTENSITY_NORMAL, 0.3)
End Sub