using EC.App.ThatService.Onvif.Impl; using EC.Onvif; using System.Threading.Tasks; namespace EC.App.ThatBLL.Onvif.Impl { public class ImagingBLL : IImagingBLL { private readonly OnvifClientService _ocService; public ImagingBLL(OnvifClientService onvifClientService) { _ocService = onvifClientService; } public bool IsConnected(string ip) { bool flag = _ocService.TryGet(ip, out OnvifClient onvifClient); bool ret = flag && onvifClient.IsImagingContected(); return ret; } public async Task FocusAbsoluteMove(string ip, float position) { bool flag = _ocService.TryGet(ip, out OnvifClient onvifClient); if (!flag) return false; await onvifClient.FocusStopMove(); return true; } public async Task FocusRelativeMove(string ip, float distance) { bool flag = _ocService.TryGet(ip, out OnvifClient onvifClient); if (!flag) return false; await onvifClient.FocusStopMove(); return true; } public async Task FocusContinuousMove(string ip, float speed) { bool flag = _ocService.TryGet(ip, out OnvifClient onvifClient); if (!flag) return false; await onvifClient.FocusStopMove(); return true; } public async Task FocusStopMove(string ip) { bool flag = _ocService.TryGet(ip, out OnvifClient onvifClient); if (!flag) return false; await onvifClient.FocusStopMove(); return true; } } }