Beispiel #1
0
    private void FetchDataScan2(int bKey)
    {
        //Debug.Log("FetchDataScan2");
        int checkInLength = _jNode["updates"].AsArray.Count;

        //Debug.Log("checkInLength= "+checkInLength);

        for (int i = 0; i < checkInLength; i++)
        {
            string deviceId = _jNode["updates"][i]["device"].Value;
            string roomName = _jNode["updates"][i]["roomName"].Value;
            bool   isInroom = false;
            if (roomName == "160 Patient Room")            //Patient Room  160 Patient Room  Room 347
            {
                isInroom = true;
            }

            if (deviceId != null)
            {
                //Debug.Log("deviceId= " + deviceId+", roomName= "+roomName);
                EntryData tempEntry = new EntryData();
                if (_entryList.ContainsKey(deviceId))
                {
                    tempEntry        = _entryList[deviceId];
                    tempEntry.InRoom = isInroom;
                    if (isInroom)
                    {
                        headsUpDisplayCont.SendMessage("EnteredRoom", tempEntry, SendMessageOptions.DontRequireReceiver);
                        userCont.SendMessage("EnteredRoom", tempEntry, SendMessageOptions.DontRequireReceiver);
                        outPutLogCont.Log("Awarepoint: " + tempEntry.Name + " has entered the room");
                    }
                    else
                    {
                        if (machineCont.IsOut() && tempEntry.Type == "Equipment")
                        {
                            headsUpDisplayCont.SendMessage("LeftRoom", tempEntry, SendMessageOptions.DontRequireReceiver);
                            machineCont.ResetisOutStatus();
                        }
                        //userCont.SendMessage("LeftRoom",tempEntry, SendMessageOptions.DontRequireReceiver);
                        outPutLogCont.Log("Awarepoint: " + tempEntry.Name + " has left the room");
                    }
                }
                else
                {
                    tempEntry.ID   = deviceId;
                    tempEntry.Name = _preJSONData["saveData"][_idToIndex[deviceId]]["name"];
                    tempEntry.Type = _preJSONData["saveData"][_idToIndex[deviceId]]["type"];
                    if (tempEntry.Type == "Person")
                    {
                        tempEntry.Female    = _preJSONData["saveData"][_idToIndex[deviceId]]["gender"].AsBool;
                        tempEntry.JobTitle  = _preJSONData["saveData"][_idToIndex[deviceId]]["jobTitle"];
                        tempEntry.TasksList = _preJSONData["saveData"][_idToIndex[deviceId]]["TasksList"].AsArray;
                        tempEntry.ItemsList = _preJSONData["saveData"][_idToIndex[deviceId]]["ItemsList"].AsArray;
                    }
                    else if (tempEntry.Type == "Equipment")
                    {
                        tempEntry.typeOfEquipment = _preJSONData["saveData"][_idToIndex[deviceId]]["typeOfEquipment"];
                        tempEntry.JobTitle        = _preJSONData["saveData"][_idToIndex[deviceId]]["jobTitle"];
                    }
                    tempEntry.InRoom = isInroom;
                    _entryList.Add(deviceId, tempEntry);
                    if (isInroom)
                    {
                        headsUpDisplayCont.SendMessage("EnteredRoom", tempEntry, SendMessageOptions.DontRequireReceiver);
                        userCont.SendMessage("EnteredRoom", tempEntry, SendMessageOptions.DontRequireReceiver);
                        outPutLogCont.Log("Awarepoint: " + tempEntry.Name + " has entered the room");
                    }
                    else
                    {
                        //headsUpDisplayCont.SendMessage("LeftRoom",tempEntry, SendMessageOptions.DontRequireReceiver);
                        //userCont.SendMessage("LeftRoom",tempEntry, SendMessageOptions.DontRequireReceiver);
                        outPutLogCont.Log("Awarepoint: " + tempEntry.Name + " has left the room");
                    }
                }
            }
        }
    }