예제 #1
0
        /// <summary>
        /// 获取所有测点的实时值
        /// </summary>
        /// <returns>返回格式:测点号,实时值,设备状态,数据状态值,是否报警(1:报警,0:不报警),数据状态文本,设备状态文本,人员定位设备是否呼叫(1:井上呼叫,2,井下呼叫,3,井上和惊吓呼叫,0:不呼叫)</returns>
        private void setAllPointSsz()
        {
            _rwLocker.AcquireWriterLock(-1);
            try
            {
                PointSsz.Clear();
                string pointssz = string.Empty;

                //修改为从实时缓存中读取数据
                DataTable pointsdt = PointInMap;

                var       pointResponse = graphicsbaseinfService.GetDefPointInformationInCache();
                DataTable pointsszdt    = ObjectConverter.ToDataTable <Jc_DefInfo>(pointResponse.Data);

                var       masResponse = graphicsbaseinfService.GetSwitchInformationInCache();
                DataTable dt_ip       = ObjectConverter.ToDataTable <Jc_MacInfo>(masResponse.Data);

                //应急联动配置
                var SysEmergencyLinkageInfos = sysEmergencyLinkageService.GetAllSysEmergencyLinkageList().Data;

                //大数据分析模型
                var largeDataAnalysisInfos = largeDataAnalysisCacheClientService.GetAllLargeDataAnalysisConfigCache(new LargeDataAnalysisCacheClientGetAllRequest()).Data;

                //人员定位
                var prealinfos = prealSerive.GetAllPrealCacheList(new RPrealCacheGetAllRequest()).Data;
                var rdefinfos  = rdefService.GetAllPointDefineCache().Data;
                if (prealinfos == null)
                {
                    prealinfos = new List <R_PrealInfo>();
                }
                var rcallinfos = rcallService.GetAllRCallCache(new RCallCacheGetAllRequest()).Data;

                //视频
                var videoinfos = vdefService.GetAllVideoDefCache().Data;
                //广播
                var bdefinfos = _bdefService.GetAllPointDefineCache().Data;

                //当前应急联动配置
                var currSysEmergencyLinkageInfo = SysEmergencyLinkageInfos.FirstOrDefault(o => o.Id == SysEmergencyLinkageInfoId);
                //应急联动呼叫关联MasterId
                var masterid = "";
                if (currSysEmergencyLinkageInfo != null)
                {
                    masterid = currSysEmergencyLinkageInfo.Type == 2 ? currSysEmergencyLinkageInfo.MasterModelId : currSysEmergencyLinkageInfo.Id;
                }

                dt_ip.Columns.Add("ssz");
                dt_ip.Columns.Add("type");
                DataView dv = pointsszdt.DefaultView;
                dv.Sort    = "alarm Asc";
                pointsszdt = dv.ToTable();
                foreach (DataRow tmpdr in dt_ip.Rows)
                {
                    DataRow drtemp = pointsszdt.NewRow();
                    drtemp["state"]     = tmpdr["state"];
                    drtemp["datastate"] = tmpdr["state"];
                    drtemp["Point"]     = tmpdr["IP"];
                    drtemp["ID"]        = tmpdr["ID"];
                    DataRow[] drstateIP = dtStateVal.Select("lngEnumValue='" + tmpdr["state"].ToString() + "'");
                    if (drstateIP.Length > 0)
                    {
                        drtemp["ssz"]   = drstateIP[0]["strEnumDisplay"].ToString();
                        drtemp["alarm"] = "0";
                    }
                    else
                    {
                        drtemp["ssz"]   = "未知";
                        drtemp["alarm"] = "0";
                    }
                    pointsszdt.Rows.InsertAt(drtemp, 0);
                }

                for (int i = 0; i < pointsdt.Rows.Count; i++)
                {
                    pointssz = "";
                    string callstate = "0";
                    pointssz += pointsdt.Rows[i]["Point"].ToString() + ",";

                    int sysid = Convert.ToInt32(pointsdt.Rows[i]["SysId"].ToString());
                    switch (sysid)
                    {
                    case 0:
                    case (int)SystemEnum.Security:
                        pointssz += SecurityHandle(pointsdt, i, pointsszdt);
                        break;

                    case (int)SystemEnum.Broadcast:
                        pointssz += BroadCastHandle(pointsdt, i, bdefinfos);
                        break;

                    case (int)SystemEnum.Personnel:
                        pointssz += PersonnelHandle(pointsdt, i, pointsszdt, rdefinfos, rcallinfos, prealinfos, masterid, ref callstate);
                        break;

                    case (int)SystemEnum.Video:
                        pointssz += VideoHandle(pointsdt, i, videoinfos, currSysEmergencyLinkageInfo, SysEmergencyLinkageInfos);
                        break;

                    case -1:
                        pointssz += AnalysisConfigHandle(pointsdt, i, largeDataAnalysisInfos);
                        break;

                    default:
                        pointssz += "无数据,0,46,0,未知,未知";
                        break;
                    }

                    pointssz += "," + callstate;
                    PointSsz.Add(pointssz);
                }

                isConnLose = false;
            }
            catch (Exception ex)
            {
                LogHelper.Error("RefPointSsz-setAllPointSsz" + ex.Message + ex.StackTrace);
                isConnLose = true;
            }
            finally
            {
                _rwLocker.ReleaseWriterLock();
            }
        }
예제 #2
0
 public Basic.Framework.Web.BasicResponse <List <Sys.Safety.DataContract.V_DefInfo> > GetAllVideoDefCache()
 {
     return(_vdeftService.GetAllVideoDefCache());
 }