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.

56 lines
1.4 KiB

3 years ago
using EC.App.ThatBLL.Onvif.Intf;
using EC.App.ThatService.Onvif;
3 years ago
using EC.Onvif;
using System.Threading.Tasks;
3 years ago
namespace EC.App.ThatBLL.Onvif
3 years ago
{
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;
3 years ago
await onvifClient.FocusAbsoluteMove(position);
3 years ago
return true;
}
public async Task<bool> FocusRelativeMove(string ip, float distance)
{
bool flag = _ocService.TryGet(ip, out OnvifClient onvifClient);
if (!flag) return false;
3 years ago
await onvifClient.FocusRelativeMove(distance);
3 years ago
return true;
}
public async Task<bool> FocusContinuousMove(string ip, float speed)
{
bool flag = _ocService.TryGet(ip, out OnvifClient onvifClient);
if (!flag) return false;
3 years ago
await onvifClient.FocusContinuousMove(speed);
3 years ago
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;
}
}
}