示例#1
0
        /// <summary>
        /// 初始化修改通道信息
        /// </summary>
        /// <param name="_ChannelCfg"></param>
        public void SetChannelInfo(MyChannelCfg _ChannelCfg)
        {
            try
            {
                btnChannelNumGeneration.IsEnabled = false;
                cIViewModel.Title               = "修改通道";
                cIViewModel.ChannelId           = _ChannelCfg.TcChaneelID;
                cIViewModel.ChannelName         = _ChannelCfg.Name;
                cIViewModel.SelectedChannelType = _ChannelCfg.ChannelType;
                cIViewModel.Remark              = _ChannelCfg.TcDescription;

                cIViewModel.CaptureAddr         = _ChannelCfg.Addr;
                cIViewModel.CapturePort         = "" + _ChannelCfg.Port;
                cIViewModel.SelectedType        = _ChannelCfg.CaptureCfg.NCaptureType;
                cIViewModel.VideoAddr           = _ChannelCfg.CaptureCfg.TcAddr;
                cIViewModel.UID                 = _ChannelCfg.CaptureCfg.TcUID;
                cIViewModel.PSW                 = _ChannelCfg.CaptureCfg.TcPSW;
                cIViewModel.VideoPort           = "" + _ChannelCfg.CaptureCfg.NPort;
                cIViewModel.MinFace             = "" + _ChannelCfg.CatchFaceCfg.NMinFace;
                cIViewModel.MinQuality          = "" + _ChannelCfg.CatchFaceCfg.NMinQuality;
                cIViewModel.MinCapDistance      = "" + _ChannelCfg.CatchFaceCfg.NMinCapDistance;
                cIViewModel.MaxFaceSaveDistance = "" + _ChannelCfg.CatchFaceCfg.NMaxFaceSaveDistance;
                cIViewModel.Yaw                 = "" + _ChannelCfg.CatchFaceCfg.NYaw;
                cIViewModel.Pitch               = "" + _ChannelCfg.CatchFaceCfg.NPitch;
                cIViewModel.Yoll                = "" + _ChannelCfg.CatchFaceCfg.NYoll;
                cIViewModel.Channel_address     = _ChannelCfg.Channel_address;
                cIViewModel.Latitude            = _ChannelCfg.Latitude;
                cIViewModel.Longitude           = _ChannelCfg.Longitude;

                try
                {
                    ObservableCollection <PointLatLngImg> points = new ObservableCollection <PointLatLngImg>();
                    PointLatLngImg point = new PointLatLngImg();
                    point.Point         = new PointLatLng(Convert.ToDouble(_ChannelCfg.Latitude ?? "0"), Convert.ToDouble(_ChannelCfg.Longitude ?? "0"));
                    point.Id            = _ChannelCfg.TcChaneelID;
                    point.Img           = ImageConvert.ToImageSource("pack://application:,,,/Images/home-icon-bluecamera.png");
                    point.ImgVisibility = Visibility.Visible;
                    points.Add(point);

                    MainMap.Points          = points;
                    MainMap.CurrentPosition = point.Point;
                }
                catch (Exception ex)
                {
                    Logger <ChannelInfo> .Log.Error("SetChannelInfo", ex);
                }
            }
            catch (Exception ex)
            {
                Logger <ChannelInfo> .Log.Error("SetChannelInfo", ex);
            }
        }
 /// <summary>
 /// 初始化修改通道信息
 /// </summary>
 /// <param name="_ChannelCfg"></param>
 public void SetChannelInfo(MyChannelCfg _ChannelCfg)
 {
     btnChannelNumGeneration.IsEnabled = false;
     cIViewModel.Title               = "修改通道";
     cIViewModel.ChannelId           = _ChannelCfg.TcChaneelID;
     cIViewModel.ChannelName         = _ChannelCfg.Name;
     cIViewModel.Remark              = _ChannelCfg.TcDescription;
     cIViewModel.CaptureAddr         = _ChannelCfg.Addr;
     cIViewModel.CapturePort         = "" + _ChannelCfg.Port;
     cIViewModel.SelectedType        = _ChannelCfg.CaptureCfg.NCaptureType;
     cIViewModel.VideoAddr           = _ChannelCfg.CaptureCfg.TcAddr;
     cIViewModel.UID                 = _ChannelCfg.CaptureCfg.TcUID;
     cIViewModel.PSW                 = _ChannelCfg.CaptureCfg.TcPSW;
     cIViewModel.VideoPort           = "" + _ChannelCfg.CaptureCfg.NPort;
     cIViewModel.MinFace             = "" + _ChannelCfg.CatchFaceCfg.NMinFace;
     cIViewModel.MinQuality          = "" + _ChannelCfg.CatchFaceCfg.NMinQuality;
     cIViewModel.MinCapDistance      = "" + _ChannelCfg.CatchFaceCfg.NMinCapDistance;
     cIViewModel.MaxFaceSaveDistance = "" + _ChannelCfg.CatchFaceCfg.NMaxFaceSaveDistance;
     cIViewModel.Yaw                 = "" + _ChannelCfg.CatchFaceCfg.NYaw;
     cIViewModel.Pitch               = "" + _ChannelCfg.CatchFaceCfg.NPitch;
     cIViewModel.Yoll                = "" + _ChannelCfg.CatchFaceCfg.NYoll;
 }