Exemple #1
0
 public TModel.Location.AreaAndDev.Dev_CameraInfo GetCameraInfoByDevInfo(Location.TModel.Location.AreaAndDev.DevInfo dev)
 {
     if (dev == null)
     {
         return(null);
     }
     TModel.Location.AreaAndDev.Dev_CameraInfo cameraInfo = db.Dev_CameraInfos.DbSet.FirstOrDefault(item => item.DevInfoId == dev.Id).ToTModel();
     if (cameraInfo != null && DbModel.AppSetting.ParkName == "中山嘉明电厂")
     {
         //dev.Abutment_DevID
         //string status = getOnlineState(dev.Abutment_DevID);
         string m3u8Url = "";
         m3u8Url = getM3u8Url(dev.Abutment_DevID);
         //if (status == "1")
         //{
         //    m3u8Url = getM3u8Url(dev.Abutment_DevID);
         //}
         //else if (status == "2")
         //{
         //    m3u8Url = "不在线";
         //}
         cameraInfo.RtspUrl = m3u8Url;
     }
     return(cameraInfo);
 }
Exemple #2
0
        public TModel.Location.AreaAndDev.Dev_CameraInfo AddCameraInfo(TModel.Location.AreaAndDev.Dev_CameraInfo cameraInfo)
        {
            DbModel.Location.AreaAndDev.Dev_CameraInfo dbCamera = cameraInfo.ToDbModel();
            var result = CameraInfoSet.Add(dbCamera);

            return(result ? dbCamera.ToTModel() : null);
        }
Exemple #3
0
        public Dev_CameraInfo Clone()
        {
            Dev_CameraInfo copy = new Dev_CameraInfo();

            copy = this.CloneObjectByBinary();
            if (this.DevInfo != null)
            {
                copy.DevInfo = this.DevInfo;
            }
            return(copy);
        }
Exemple #4
0
        public TModel.Location.AreaAndDev.Dev_CameraInfo ModifyCameraInfo(TModel.Location.AreaAndDev.Dev_CameraInfo camInfo)
        {
            camInfo.AutoGenerateRtsp();
            var dbModel = camInfo.ToDbModel();

            if (db.Dev_CameraInfos.Edit(dbModel))
            {
                return(camInfo);
            }
            else
            {
                return(null);
            }
        }
 public TModel.Location.AreaAndDev.Dev_CameraInfo ModifyCameraInfo(TModel.Location.AreaAndDev.Dev_CameraInfo camInfo)
 {
     return(service.ModifyCameraInfo(camInfo));
 }
 public TModel.Location.AreaAndDev.Dev_CameraInfo AddCameraInfo(TModel.Location.AreaAndDev.Dev_CameraInfo cameraInfo)
 {
     return(service.AddCameraInfo(cameraInfo));
 }
Exemple #7
0
 public TModel.Location.AreaAndDev.Dev_CameraInfo GetCameraInfoByIp(string ip)
 {
     TModel.Location.AreaAndDev.Dev_CameraInfo cameraInfo = db.Dev_CameraInfos.DbSet.FirstOrDefault(item => !(string.IsNullOrEmpty(item.Ip)) && item.Ip == ip).ToTModel();
     return(cameraInfo);
 }