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.
 
 

50 lines
1.4 KiB

using EC.Entity.Video;
using ECMonitor.Code.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ECMonitor.Code
{
public class ShowVideoManager
{
public int UCVideoIndex = 0;
public List<VideoShowModel> UCVideoList = new List<VideoShowModel>();
public VideoShowModel CreateVideoShowModel(string cameraIp)
{
VideoShowModel ucVideoShowModel = new VideoShowModel();
ucVideoShowModel.CameraIp = cameraIp;
ucVideoShowModel.UCName = "UCRegVideo" + UCVideoIndex++;
MonitorCamera camera = CameraManager.GetCamera(cameraIp);
if (camera != null)
{
ucVideoShowModel.Camera = camera;
}
else {
ucVideoShowModel.Message = "没有视频";
}
UCVideoList.Add(ucVideoShowModel);
return ucVideoShowModel;
}
/// <summary>
/// 获取显示模块
/// </summary>
/// <param name="cameraIp"></param>
/// <returns></returns>
public VideoShowModel GetVideoShowModel(string cameraIp)
{
return UCVideoList.Find(c => c.CameraIp == cameraIp);
}
internal void Remove(VideoShowModel videoShow)
{
UCVideoList.Remove(videoShow);
}
}
}