You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.4 KiB
55 lines
1.4 KiB
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<bool> 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<bool> 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<bool> 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<bool> FocusStopMove(string ip)
|
|
{
|
|
bool flag = _ocService.TryGet(ip, out OnvifClient onvifClient);
|
|
if (!flag) return false;
|
|
await onvifClient.FocusStopMove();
|
|
return true;
|
|
}
|
|
}
|
|
}
|