Esempio n. 1
0
        public override void ProcessPausingResult(DirectiveData data, CommunicationEventArgs comEventArgs)
        {
            comEventArgs.DeviceStatus = DeviceStatusEnum.Running;
            comEventArgs.Description  = IdleDesc.Paused.ToString();;
            SetStatus(DeviceStatusEnum.Running);

            StopEvent.TrySetResult(new DeviceIOResult(true));

            OnCommunicationChange(comEventArgs);
        }
Esempio n. 2
0
        public override void ProcessPausingResult(DirectiveData data, CommunicationEventArgs comEventArgs)
        {
            var ret = data as PumpDirectiveData;

            if (ret != null && ret.FlowRate <= 0)
            {
                comEventArgs.DeviceStatus = DeviceStatusEnum.Idle;
                comEventArgs.Description  = IdleDesc.Paused.ToString();;

                this.SetStatus(DeviceStatusEnum.Idle);

                StopEvent.TrySetResult(new DeviceIOResult(true));
                StopTime            = DateTime.Now;
                PreUnfinishedVolume = CalcPreUnfinishedVolume();
                LogFactory.Create().Info($"device{Device.DeviceId} PreUnfinishedVolume is {PreUnfinishedVolume}");
                OnCommunicationChange(comEventArgs);
            }
            else
            {
                comEventArgs.DeviceStatus = DeviceStatusEnum.Pausing;
                StartPauseLoop();
            }
        }