예제 #1
0
 private void InvokeDelegate()
 {
     DeviceInfoReceived?.Invoke(RemSpray);
     DeviceInfoReceived?.Invoke(NextSprayCounter);
     DeviceInfoReceived?.Invoke(DaysLeft);
     DeviceInfoReceived?.Invoke(InitializeSpray);
 }
예제 #2
0
        public async Task <string> SetScheduleActiveInactiveStatusinVM(DeviceInfoRequest deviceInfoRequest)
        {
            var daysleft = await deviceService.GetDeviceInfo(deviceInfoRequest);

            var _DaysLeft = DeserializDeviceInfo(daysleft);

            DaysLeft = _DaysLeft;
            DeviceInfoReceived?.Invoke(DaysLeft);
            return(daysleft);
        }
예제 #3
0
        ////////////////////////////////////////////////
        ////////////////////////////////////////////////
        /////////////////Set device values//////////////
        ////////////////////////////////////////////////
        ////////////////////////////////////////////////



        public async Task <string> SetSchedulerinVM(string schedules)
        {
            var daysleft = await deviceService.SetScheduler(schedules);

            var _DaysLeft = DeserializDeviceInfo(daysleft);

            DaysLeft = _DaysLeft;
            DeviceInfoReceived?.Invoke(DaysLeft);
            return(daysleft);
        }
예제 #4
0
        /// <summary>
        /// GetInitilizeSprayCount(Input) Will return count from service
        /// </summary>
        public async Task <bool> GetInitilizeSprayCount()
        {
            DeviceInfoRequest deviceInfoRequest = new DeviceInfoRequest();

            deviceInfoRequest.request = "init";
            deviceInfoRequest.info    = "spray";
            var deviceRes = await deviceService.GetDeviceInfo(deviceInfoRequest);

            NetworkServiceUtil.Log("DeviceDetailsViewModel GetInitilizeSprayCount init spray: " + deviceRes);
            InitializeSpray = DeserializDeviceInfo(deviceRes);
            DeviceInfoReceived?.Invoke(InitializeSpray);
            return(true);
        }
예제 #5
0
        /// <summary>
        /// GetNextSprayCounterCount Will return count from service
        /// </summary>
        public async Task <bool> GetNextSprayCounterCount()
        {
            DeviceInfoRequest deviceInfoRequest = new DeviceInfoRequest();

            deviceInfoRequest.request = "get";
            deviceInfoRequest.info    = "spray_counter";
            var deviceRes = await deviceService.GetDeviceInfo(deviceInfoRequest);

            NetworkServiceUtil.Log("DeviceDetailsViewModel GetNextSprayCounterCount: " + deviceRes);
            NextSprayCounter = DeserializDeviceInfo(deviceRes);
            DeviceInfoReceived?.Invoke(NextSprayCounter);
            // CalculateRemainingDays();
            return(false);
        }
예제 #6
0
        public async Task <string> DeleteScheduleItem(string index)
        {
            NetworkServiceUtil.Log("DeleteScheduleItem ==> called");
            ScheduleIndex scheduleIndex = new ScheduleIndex();

            scheduleIndex.deleteindex = (Convert.ToInt32(index)).ToString();
            scheduleIndex.request     = "delete";
            scheduleIndex.info        = "scheduler";
            var deviceRes = await deviceService.DeleteScheduleIndex(scheduleIndex);

            var _DaysLeft = DeserializDeviceInfo(deviceRes);

            DaysLeft = _DaysLeft;
            DeviceInfoReceived?.Invoke(DaysLeft);
            return(deviceRes);
        }
예제 #7
0
        /// <summary>
        /// GetDaysLeftCount Will return count from service
        /// </summary>
        public async Task <bool> GetDaysLeftCount()
        {
            return(false);

            DeviceInfoRequest deviceInfoRequest = new DeviceInfoRequest();

            deviceInfoRequest.request = "get";
            deviceInfoRequest.info    = "days_left";
            var deviceRes = await deviceService.GetDeviceInfo(deviceInfoRequest);

            NetworkServiceUtil.Log("DeviceDetailsViewModel GetDaysLeftCount get spray: " + deviceRes);
            var _DaysLeft = DeserializDeviceInfo(deviceRes);

            DaysLeft = _DaysLeft;
            DeviceInfoReceived?.Invoke(DaysLeft);
            // CalculateRemainingDays();
            return(true);
        }