Public Sub RMDigi_Message(Data As Map)
Try
RMDigiMessage(Data)
Catch
Log("Error Ev_RMDigiMessage: " & LastException)
End Try
End Sub
Public Sub RMDigiMessage(Data As Map)
Dim RmID As String
Dim RmMesg As String
Dim RWMesg As String
Dim RzMesg As String
Dim mZone As Int
Dim mQueue As Int
Dim RouteID As String
Dim RouteStr As String
mText = Data.Get("message")
id = "RMDigi"
mType = Utils.str.SplitGetWord(mText, ",", 1)
mBase = Utils.str.SplitGetWord(mText, ",", 2)
RmID = Utils.str.SplitGetWord(mText, ",", 3)
If RmID <> "PING" Then
If RmID <> "MGU" Then
RmMesg = Utils.str.SplitGetWord(mText, ",", 4)
End If
Select Case RmID
Case "QQ"
RouteID = Utils.str.SplitGetWord(RmMesg, ";", 1)
RouteStr = Utils.str.SplitGetWord(RmMesg, ";", 2)
Dim RObj As RouteObj
RObj.Initialize(RouteID,RouteStr)
Case Else
Select Case mType
Case 2
RWMesg = Utils.str.SplitGetWord(RmMesg, ";", 1)
Select Case RWMesg
Case "RT","CL","Z","ZD","RC","RR", _
"021","022","023","024","03", _
"PN","MM","PE","RZ","MSG"
CallSubDelayed3(PushShared, "SendWebClientMessage", RmMesg, RmID)
Case "WZ"
CallSubDelayed3(PushShared, "SendDirectMessage", RmMesg, RmID)
Case "MGP"
RzMesg = Utils.str.SplitGetWord(RmMesg, ";", 3)
RouteID = Utils.str.SplitGetWord(RmMesg, ";", 2)
CallSubDelayed3(PushShared, "SendWebClientMessage", RWMesg & ";" & RzMesg, RmID)
Dim OSQL As SQL = Main.oPool.GetConnection
Dim stations As List = DBUtils.ExecuteMemoryTable(OSQL, "SELECT CD_AIR FROM exchg_master WHERE ACTIVE > 0 AND TABLET_EXEC = 1 AND CD_AIR <> ? AND CD_AIR IN (?,?,?,?,?)",Array As String(RmID,"21Α","45Α","35Α","59Α","55Α"),0)
OSQL.Close
For Each row() As String In stations
CallSubDelayed3(PushShared, "SendWebClientMessage", "ANN;" & RouteID & " ΠΡΟΣ " & RmID & " " & DateUtils.TicksToString(DateTime.Now) & ";" & RzMesg, row(0))
Next
End Select
Case 3
RWMesg = Utils.str.SplitGetWord(RmMesg, ";", 1)
If RWMesg <> "WZ" Then
CallSubDelayed3(PushShared, "SendWebClientMessage", RmMesg, RmID)
Else
CallSubDelayed3(PushShared, "SendDirectMessage", RmMesg, RmID)
End If
End Select
End Select
End If
ws.Flush
End Sub