Exemplo n.º 1
0
        private void fillPageWithFall(FallObj fo)
        {
            FallTime = fo.Date + " " + fo.Time;


            MyEventFall?.Invoke(fo.xValue, fo.yValue);
        }
Exemplo n.º 2
0
        private void fillList()
        {
            RoomsDetection roomsDetection = new RoomsDetection();

            if (_context.Akcelerometers.Any())
            {
                var FallValueList = _context.Akcelerometers.ToList();

                foreach (var fallValue in FallValueList)
                {
                    DateTime convertedDate = DateTime.Parse(fallValue.TimeStamp);

                    Izby   izba     = null;
                    String izbaName = "";
                    try
                    {
                        izba     = roomsDetection.findRoomByCoord(fallValue.Xhodnota, fallValue.Yhodnota);
                        izbaName = izba.Nazov;
                    }
                    catch (Exception e)
                    {
                        izbaName = "Vonku";
                    }

                    FallObj fallObj = new FallObj
                    {
                        FallId   = fallValue.AkcelerometerID,
                        RoomName = izbaName,
                        xValue   = fallValue.Xhodnota,
                        yValue   = fallValue.Yhodnota,
                        Date     = convertedDate.ToShortDateString(),
                        Time     = convertedDate.ToLongTimeString()
                    };

                    FallList.Add(fallObj);
                }
                fillPageWithFall(FallList.First());
            }
            else
            {
                FallTime = "Neexistuje žiadna sekvencia";
            }

            FallList = new ObservableCollection <FallObj>(FallList.Reverse());
        }