Ejemplo n.º 1
0
        public frmVideoPreview(string videoId)
        {
            InitializeComponent();

            if (!string.IsNullOrEmpty(videoId))
            {
                currentDefInfo = _vdefService.GetDefById(new DefGetRequest {
                    Id = videoId
                }).Data;
                if (currentDefInfo != null)
                {
                    this.txtip.Text   = currentDefInfo.IPAddress;
                    this.txtname.Text = currentDefInfo.Devname;

                    //初始化海康SDK
                    m_bInitSDK = HK32ChCNetSDK.NET_DVR_Init();

                    //初始化大华SDK
                    disConnect = new fDisConnectCallBack(DisConnectEvent);
                    blnInit    = NETClient.Init(disConnect, IntPtr.Zero, null);

                    m_RealDataCallBack           = new fRealDataCallBackEx(RealDataCallBack);                   //instance realdata callback.
                    m_RealPlayDisConnectCallBack = new fRealPlayDisConnectCallBack(RealPlayDisConnectCallBack); //instance realplay disconnect
                    m_SnapRevCallBack            = new fSnapRevCallBack(SnapRevCallBack);

                    videoLogin();
                }
            }
            else
            {
                this.StaticMsg.Caption = "没有找到相应的视频信息!";
            }
        }
Ejemplo n.º 2
0
 public Basic.Framework.Web.BasicResponse <Sys.Safety.DataContract.V_DefInfo> GetDefById(Sys.Safety.Request.Def.DefGetRequest defRequest)
 {
     return(_vdeftService.GetDefById(defRequest));
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 获取应急联动实时主控和被控测点
        /// </summary>
        private string RefreshRealPoint()
        {
            try
            {
                string jsonStr = string.Empty;
                if (!string.IsNullOrEmpty(selectid))
                {
                    var selectSysEmergencyLinkageInfo = SysEmergencyLinkageInfos.FirstOrDefault(o => o.Id == selectid);

                    //获取选中应急联动配置的主控测点
                    SysEmergencyLinkageGetRequest getrequest = new SysEmergencyLinkageGetRequest();
                    getrequest.Id = selectid;
                    var masterpoints = sysEmergencyLinkageService.GetAllMasterPointsById(getrequest).Data;
                    //如果不存在主控测点,则获取关联大数据分析模型配置
                    if (masterpoints.Count > 0)
                    {
                        masterpoints.ForEach(o =>
                        {
                            jsonStr += o.Point + "|";
                        });
                    }
                    else if (!string.IsNullOrEmpty(selectSysEmergencyLinkageInfo.MasterModelId))
                    {
                        var analysisConfigs = largedataAnalysisConfigCacheService.GetAllLargeDataAnalysisConfigCache(new Sys.Safety.Request.LargeDataAnalysisCacheClientGetAllRequest()).Data;
                        if (analysisConfigs != null && analysisConfigs.Count > 0)
                        {
                            var analysisConfig = analysisConfigs.FirstOrDefault(o => o.Id == selectSysEmergencyLinkageInfo.MasterModelId);
                            if (analysisConfig != null)
                            {
                                jsonStr += analysisConfig.Name + "|";
                            }
                        }
                    }

                    //获取选中应急联动配置的被控测点
                    //如果应急联动配置存在被控区域,则获取此区域的人员设备和广播设备
                    if (selectSysEmergencyLinkageInfo.PassiveAreas.Count > 0)
                    {
                        selectSysEmergencyLinkageInfo.PassiveAreas.ForEach(area =>
                        {
                            //处理区域广播呼叫
                            var bdefinforesponse = bdefService.GetAllPointDefineCache();
                            if (bdefinforesponse.IsSuccess)
                            {
                                var areabdefinfos = bdefinforesponse.Data.Where(b => b.Areaid == area.AreaId).ToList();
                                areabdefinfos.ForEach(def => jsonStr += def.Point + "|");
                            }

                            //处理区域人员呼叫
                            var rdefinforesponse = rdefService.GetAllPointDefineCache();
                            if (rdefinforesponse.IsSuccess)
                            {
                                var areardefinfos = rdefinforesponse.Data.Where(b => b.Areaid == area.AreaId).ToList();
                                areardefinfos.ForEach(def => jsonStr += def.Point + "|");
                            }
                        });
                    }

                    //如果应急联动配置存在被控人员,则获取被控人员实时识别器列表
                    if (selectSysEmergencyLinkageInfo.PassivePersons.Count > 0)
                    {
                        var prealinfos = prealService.GetAllPrealCacheList(new RPrealCacheGetAllRequest()).Data;

                        if (prealinfos != null)
                        {
                            selectSysEmergencyLinkageInfo.PassivePersons.ForEach(p =>
                            {
                                var personreponse = personinfoService.GetAllDefinedPersonInfoCache(new BasicRequest());
                                if (personreponse.IsSuccess)
                                {
                                    var person = personinfoService.GetPersoninfCache(new R_PersoninfGetRequest()
                                    {
                                        Id = p.PersonId
                                    }).Data;
                                    var preal = prealinfos.FirstOrDefault(pr => pr.Bh == person.Bh);

                                    if (preal != null)
                                    {
                                        var persondef = rdefService.GetPointDefineCacheByPointID(new PointDefineGetByPointIDRequest {
                                            PointID = preal.Pointid
                                        }).Data;
                                        if (persondef != null && !jsonStr.Contains(persondef.Point))
                                        {
                                            jsonStr += persondef.Point + "|";
                                        }
                                    }
                                }
                            });
                        }
                    }

                    //如果应急联动配置存在被控设备,则根据类型获取被控测点
                    if (selectSysEmergencyLinkageInfo.PassivePoints.Count > 0)
                    {
                        selectSysEmergencyLinkageInfo.PassivePoints.ForEach(p =>
                        {
                            //人员定位
                            if (p.Sysid == (int)SystemEnum.Personnel)
                            {
                                var rdef = rdefService.GetPointDefineCacheByPointID(new PointDefineGetByPointIDRequest {
                                    PointID = p.PointId
                                }).Data;
                                if (rdef != null && !jsonStr.Contains(rdef.Point))
                                {
                                    jsonStr += rdef.Point + "|";
                                }
                            }
                            //广播
                            else if (p.Sysid == (int)SystemEnum.Broadcast)
                            {
                                var bdef = bdefService.GetPointDefineCacheByPointID(new PointDefineGetByPointIDRequest {
                                    PointID = p.PointId
                                }).Data;

                                var bdefpoints = jsonStr.Split('|');
                                if (bdef != null && !bdefpoints.Contains(bdef.Point))
                                {
                                    jsonStr += bdef.Point + "|";
                                }
                            }
                            //视频
                            else if (p.Sysid == (int)SystemEnum.Video)
                            {
                                var vdef = vdefService.GetDefById(new Sys.Safety.Request.Def.DefGetRequest {
                                    Id = p.PointId
                                }).Data;
                                if (vdef != null && !jsonStr.Contains(vdef.IPAddress))
                                {
                                    jsonStr += vdef.IPAddress + "|";
                                }
                            }
                        });
                    }

                    if (jsonStr.LastIndexOf('|') > 0)
                    {
                        jsonStr = jsonStr.Substring(0, jsonStr.Length - 1);
                    }
                }

                return(jsonStr);
            }
            catch (Exception ex)
            {
                LogHelper.Info("获取应急联动配置主控被控测点出错:" + ex.Message);
                return(string.Empty);
            }
        }