Пример #1
0
        public ActionResult Analytics()
        {
            var service = RestFetcher.Instance;
            var model   = new HomeModel();

            model.Braslets = new List <BrasletModel>();

            foreach (var device in devices)
            {
                var healthData   = service.FetchHealhData(_authCookie, device);
                var alarmData    = service.GetAlarmData(_authCookie, device);
                var brasletModel = new BrasletModel();
                brasletModel.Person = new PersonModel();
                if (healthData != null)
                {
                    brasletModel.Person = healthData;
                }


                if (alarmData != null)
                {
                    brasletModel.Alarms = alarmData;
                }

                model.Braslets.Add(brasletModel);
            }
            ViewBag.AnalyticActive = "active";
            return(View(model));
        }
Пример #2
0
        public ActionResult Incidents()
        {
            ViewBag.AnalyticIncidents = "active";
            var service = RestFetcher.Instance;
            var model   = new HomeModel();

            model.Braslets = new List <BrasletModel>();

            foreach (var device in devices)
            {
                var alarmData    = service.GetAlarmData(_authCookie, device);
                var brasletModel = new BrasletModel();
                brasletModel.Person = new PersonModel();

                if (alarmData != null)
                {
                    brasletModel.Alarms = alarmData;
                    foreach (var alarm in brasletModel.Alarms)
                    {
                        if (alarm.ExceptionType == "Offline Alarm")
                        {
                            alarm.ExceptionType = "Нет связи";
                        }
                        if (alarm.ExceptionType == "Exit geofence")
                        {
                            alarm.ExceptionType = "Уход с машрута";
                        }
                        if (alarm.ExceptionType == "Abnormal blood pressure")
                        {
                            alarm.ExceptionType = "Отклонение кровяного давления";
                        }
                        if (alarm.ExceptionType == "Enter geofence")
                        {
                            alarm.ExceptionType = "Возвращение на маршрут";
                        }
                        if (alarm.ExceptionType == "SOS alarm")
                        {
                            alarm.ExceptionType = "SOS";
                        }
                    }
                }

                model.Braslets.Add(brasletModel);
            }
            ViewBag.IncidentsActive = "active";
            return(View(model));
        }
Пример #3
0
        public ActionResult Ways()
        {
            var service = RestFetcher.Instance;
            var model   = new HomeModel();

            model.Braslets = new List <BrasletModel>();
            foreach (var device in devices)
            {
                var coordinates = service.FetchLocationData(_authCookie, device);

                var brasletModel = new BrasletModel();
                brasletModel.LocationInfo = new LocationInfoModel();
                if (coordinates != null)
                {
                    brasletModel.LocationInfo = coordinates;
                }

                model.Braslets.Add(brasletModel);
            }

            ViewBag.WaysActive = "active";
            return(View(model));
        }