예제 #1
0
        public ActionResult Index()
        {
            TemperatureChartViewModel temperatureChartViewModel = _presentationService.GetTemperatureChartModel(Period, true);

            temperatureChartViewModel.RemoveLastButtons(2);
            temperatureChartViewModel.SelectedButtonIndex = 2;

            DeviceStateLogViewModel deviceStateLogViewModel = _presentationService.GetDeviceStateLogViewModel(Period);
            ControlPanelViewModel   controlPanelViewModel   = _controlPanelPresentationService.GetControlPanelViewModel();

            object[] lastTempData = temperatureChartViewModel.Data.LastOrDefault();

            CurrentStateViewModel currentState = _presentationService.GetCurrentStateViewModel((decimal?)lastTempData?[1] ?? 0);

            var model = new DashboardViewModel
            {
                CurrentState      = currentState,
                TemperatureChart  = temperatureChartViewModel,
                DeviceStates      = deviceStateLogViewModel,
                SwitchableDevices = _switchableDevices,
                ControlPanel      = controlPanelViewModel
            };

            return(View(model));
        }
예제 #2
0
        public ActionResult DeviceStateLogSection()
        {
            DeviceStateLogViewModel viewModel = _presentationService.GetDeviceStateLogViewModel(Period);

            return(PartialView("_DeviceStateLogSection", viewModel));
        }
예제 #3
0
        public ActionResult DeviceStateLog()
        {
            DeviceStateLogViewModel viewModel = _presentationService.GetDeviceStateLogViewModel(_deviceStateLogPeriod);

            return(View(viewModel));
        }