Private Sub WebSocket_Connected (WebSocket1 As WebSocket)
Log("Connected")
ws = WebSocket1
If ABMShared.NeedsAuthorization Then
If ws.Session.GetAttribute2("IsAuthorized", "") = "" Then
ABMShared.NavigateToPage(ws, "../")
Return
End If
End If
' connect our page with the websocket
page.SetWebSocket(ws)
' Prepare the page IMPORTANT!
page.Prepare
CaricaGriglia
End Sub
Sub CaricaGriglia()
Dim list1 As ABMList = page.Component(2,1,"list1")
Dim ll As List
Try
ll = ws.Session.GetAttributesNames
Dim ii As Int
For ii = 0 To ll.Size -1
Dim s As String
s = ll.Get (ii)
If s.StartsWith("$$") Then
Dim lstmez As List = ws.Session.GetAttribute (s)
Dim jj As Int
For jj = 0 To lstmez.Size -1
Dim sl() As String
Dim tll As String
tll = lstmez.Get (jj)
sl = Regex.Split ("\|",tll)
Dim quando As String
quando = sl(8)
' 20151117090830
quando = quando.SubString2 (6 ,8) & "/" & quando.SubString2(4,6) & "/" & quando.SubString2(0,4)& " " & quando.SubString2(8,10) & ":" & quando.SubString2(10,12)
list1.AddSubItem("H1", sl(2), BuildSimpleItem( sl(3), "","{B}" & sl(2) & "{/B} - " & quando & "{BR}{B}T1:{/B}" & Round2( sl(4),1) & "°C" & " - {B}T2:{/B}:" & Round2(sl(5),1) & "°C" & " - {B}T3:{/B}:" & Round2(sl(6),1) & "°C" & " - {B}T4:{/B}:" & Round2(sl(7),1) & "°C"))
Log(sl(2))
Next
End If
Next
list1.Refresh
page.Refresh
Catch
Log(LastException)
End Try
End Sub