using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static IStation.Model.Camera;
namespace IStation.Application
{
///
///
///
public class CameraLogicDto
{
///
///
///
public CameraLogicDto() { }
///
///
///
public CameraLogicDto(Model.Product rhs)
{
this.ID = rhs.ID;
this.NO = rhs.NO;
this.Name = rhs.Name;
this.Code = rhs.Code;
this.Specification = rhs.Specification;
this.ProviderType = rhs.RatedParas.ProviderType;
this.SeriesNO = rhs.RatedParas.SeriesNO;
this.VerificationCode = rhs.RatedParas.VerificationCode;
this.Pixel = rhs.RatedParas.Pixel;
this.StorageCode = rhs.RatedParas.StorageCode;
this.StorageMode = rhs.RatedParas.StorageMode;
this.WaterproofGrade = rhs.RatedParas.WaterproofGrade;
this.NightType = rhs.RatedParas.NightType;
this.FocalDistance = rhs.RatedParas.FocalDistance;
this.IsZoomble = rhs.RatedParas.IsZoomble;
this.IsRotateAble = rhs.RatedParas.IsRotateAble;
if (this.ProviderType == eProviderType.Hik)
{
var account = Model.CameraHikAccount.ToModel(rhs.RatedParas.Account);
var channel = Model.CameraHikChannel.ToModel(rhs.RatedParas.Channel);
var hikTokenInfo = new HikTokenInfoDto();
hikTokenInfo.AppKey = account.AppKey;
hikTokenInfo.AppSecret = account.AppSecret;
hikTokenInfo.ChannelNo = channel.ChannelNo;
hikTokenInfo.ChannelName = channel.ChannelName;
hikTokenInfo.ViewToken = Ys7Helper.GetAccessToken(account.AppKey, account.AppSecret);
hikTokenInfo.LiveUrl = Ys7Helper.GetLiveUrl(account.AppKey, account.AppSecret, this.VerificationCode, this.SeriesNO, channel.ChannelNo);
this.TokenInfo = hikTokenInfo;
}
}
///
/// 标识
///
public long ID { get; set; }
///
/// 编号
///
public string NO { get; set; }
///
/// 名称
///
public string Name { get; set; }
///
/// 型号
///
public string Code { get; set; }
///
/// 规格
///
public string Specification { get; set; }
///
/// 提供者类型
///
public eProviderType ProviderType { get; set; }
///
/// 设备序列号
///
public string SeriesNO { get; set; }
///
/// 设备验证码
///
public string VerificationCode { get; set; }
///
/// 像素
///
public string Pixel { get; set; }
///
/// 存储编码
///
public string StorageCode { get; set; }
///
/// 存储方式
///
public eStorageMode StorageMode { get; set; }
///
/// 防水等级
///
public eWaterproofGrade WaterproofGrade { get; set; }
///
/// 夜视类型
///
public eNightType NightType { get; set; }
///
/// 焦距 mm
///
public int FocalDistance { get; set; }
///
/// 可变焦
///
public bool IsZoomble { get; set; }
///
/// 可旋转
///
public bool IsRotateAble { get; set; }
///
/// Token信息
///
public object TokenInfo { get; set; }
}
}