コード例 #1
0
        public SOAPResponseCmd <List <IVMSTreeListViewModel> > GetDeviceTreeList(string userName, string pwd, uint line = 1)
        {
            //定义返回值
            var resultList = new SOAPResponseCmd <List <IVMSTreeListViewModel> >();

            resultList.Data = new List <IVMSTreeListViewModel>();
            //调用服务
            var treeInfo = devService.GetDevTreeInfo(userName, pwd, line);

            resultList.ErrorCode = treeInfo.ErrorCode;
            resultList.Message   = treeInfo.Message;
            if (!"200".Equals(resultList.ErrorCode))
            {
                //失败
                return(resultList);
            }
            InitOrg(treeInfo.Data, resultList.Data);
            return(resultList);
        }
コード例 #2
0
        private static SOAPResponseCmd <DevTreeInfo> GetData(IVMS7200.DevTreeInfoResult result)
        {
            SOAPResponseCmd <DevTreeInfo> devList = new SOAPResponseCmd <DevTreeInfo>();

            devList.Data      = new DevTreeInfo();
            devList.Message   = result.message;
            devList.ErrorCode = result.messageCode.ToString();

            foreach (var item in result.areaList)
            {
                var areaModel = new Area()
                {
                    AreaId       = item.areaId.ToString(),
                    AreaName     = item.areaName,
                    ParentAreaId = item.parentAreaId.ToString(),
                    Type         = item.type.ToString()
                };
                devList.Data.AreaList.Add(areaModel);
            }

            foreach (var item in result.deviceNodeList)
            {
                var deviceModel = new DeviceNode()
                {
                    AlarmIp        = item.alarmIp,
                    AlarmPort      = item.alarmPort.ToString(),
                    Deviceaccount  = item.deviceaccount,
                    Deviceid       = item.deviceid.ToString(),
                    Devicename     = item.devicename,
                    Deviceuse      = item.deviceuse.ToString(),
                    ParentNodeId   = item.parentNodeId.ToString(),
                    Phonenum       = item.phonenum,
                    PpvsIp         = item.ppvsIp,
                    PpvsPort       = item.ppvsPort.ToString(),
                    RsmIp          = item.rsmIp,
                    RsmPort        = item.rsmPort.ToString(),
                    Serverroute    = item.serverroute.ToString(),
                    Streamtype     = item.streamtype.ToString(),
                    Streamusertype = item.streamusertype.ToString(),
                    Transmitmode   = item.transmitmode.ToString()
                };

                foreach (var item1 in item.channels)
                {
                    var channelModel = new Channel()
                    {
                        Channelname = item1.channelname,
                        Channenum   = item1.channenum.ToString()
                    };
                    deviceModel.Channels.Add(channelModel);
                }

                deviceModel.ChannelsName     = StatusConveter.ChannelsName(deviceModel.Channels);
                deviceModel.TransmitmodeName = StatusConveter.TransmitmodeName(deviceModel.Transmitmode);
                deviceModel.StreamTypeName   = StatusConveter.StreamTypeName(deviceModel.Streamtype);
                deviceModel.DeviceuseName    = StatusConveter.DeviceuseName(deviceModel.Deviceuse);

                devList.Data.DeviceNodeList.Add(deviceModel);
            }

            return(devList);
        }