Esempio n. 1
0
        /// <summary>
        /// 添加预置位
        /// </summary>
        /// <param name="tmpTurntablePresetData"></param>
        /// <returns></returns>
        static public Guid?AddrPreset(TurntablePresetData tmpTurntablePresetData)
        {
            Guid?strAddrPresetType = null;
            PresetListRepository tmpPresetListRepository = new PresetListRepository();
            PresetList           entityToInsert          = null;
            Guid tmpTurntableGuid;

            if (ControlBusinessData.CameraList_Dictionary[tmpTurntablePresetData.VideoGuid.ToString()].Turntable_PTZ_DeviceID != null)
            {
                tmpTurntableGuid = ControlBusinessData.CameraList_Dictionary[tmpTurntablePresetData.VideoGuid.ToString()].Turntable_PTZ_DeviceID.Value;
                int VideoType = ControlBusinessData.GetCameraVideoType(tmpTurntablePresetData.VideoGuid);
                switch (VideoType)
                {
                case (int)VideoCommandType.VideoCCD:
                {
                    entityToInsert                 = new PresetList();
                    entityToInsert.PresetName      = tmpTurntablePresetData.PresetName;
                    entityToInsert.CameraDeviceID  = tmpTurntablePresetData.VideoGuid.Value;
                    entityToInsert.PresetType      = 0;
                    entityToInsert.Horizontal_Data = ControlBusinessData.DynamicDataOfTurntable_Dictionary[tmpTurntableGuid].Horizontal_Data.ToString();    /**水平-原始数据*/
                    entityToInsert.Vertical_Data   = ControlBusinessData.DynamicDataOfTurntable_Dictionary[tmpTurntableGuid].Vertical_Data.ToString();      /**俯仰-原始数据*/
                    entityToInsert.CCDorIR_Depth   = ControlBusinessData.DynamicDataOfTurntable_Dictionary[tmpTurntableGuid].CCD_Depth_Data.ToString();     /**白光变倍-原始数据*/
                    entityToInsert.CCDorIR_Focus   = ControlBusinessData.DynamicDataOfTurntable_Dictionary[tmpTurntableGuid].CCD_Focus_Data.ToString();     /**白光聚焦-原始数据*/
                    strAddrPresetType              = tmpPresetListRepository.Insert(entityToInsert);
                }
                break;

                case (int)VideoCommandType.VideoIR:
                {
                    entityToInsert                 = new PresetList();
                    entityToInsert.PresetName      = tmpTurntablePresetData.PresetName;
                    entityToInsert.CameraDeviceID  = tmpTurntablePresetData.VideoGuid.Value;
                    entityToInsert.PresetType      = 0;
                    entityToInsert.Horizontal_Data = ControlBusinessData.DynamicDataOfTurntable_Dictionary[tmpTurntableGuid].Horizontal_Data.ToString();    /**水平-原始数据*/
                    entityToInsert.Vertical_Data   = ControlBusinessData.DynamicDataOfTurntable_Dictionary[tmpTurntableGuid].Vertical_Data.ToString();      /**俯仰-原始数据*/
                    entityToInsert.CCDorIR_Depth   = ControlBusinessData.DynamicDataOfTurntable_Dictionary[tmpTurntableGuid].IR_Depth_Data.ToString();      /**红外变倍-原始数据*/
                    entityToInsert.CCDorIR_Focus   = ControlBusinessData.DynamicDataOfTurntable_Dictionary[tmpTurntableGuid].IR_Focus_Data.ToString();      /**红外聚焦-原始数据*/
                    strAddrPresetType              = tmpPresetListRepository.Insert(entityToInsert);
                }
                break;

                case (int)VideoCommandType.VideoPTZ:
                {
                    entityToInsert = new PresetList();
                    entityToInsert.CameraDeviceID = tmpTurntablePresetData.VideoGuid.Value;
                    entityToInsert.PresetName     = tmpTurntablePresetData.PresetName;
                    entityToInsert.PresetType     = 0;
                    entityToInsert.PresetNo       = 1;
                    //ProtocolBusinessLogic
                    strAddrPresetType = tmpPresetListRepository.Insert(entityToInsert);
                }
                break;
                }
            }
            else
            {
            }

            return(strAddrPresetType);
        }
Esempio n. 2
0
        /// <summary>
        /// 获取预置位
        /// </summary>
        /// <param name="tmp_TurntablePresetData"></param>
        /// <returns></returns>
        public static List <TurntablePresetData> GetPreset(Guid?VideoGuid)//,string[] strPresetName)
        {
            List <TurntablePresetData> tmpGetPreset            = new List <TurntablePresetData>();
            PresetListRepository       tmpPresetListRepository = new PresetListRepository();
            List <PresetList>          tmp_PresetList          = tmpPresetListRepository.GetList();

            if (tmp_PresetList.Count > 0 && VideoGuid != null)
            {
                for (int i = 0; i < tmp_PresetList.Count; i++)
                {
                    if (tmp_PresetList[i].CameraDeviceID == VideoGuid)
                    {
                        TurntablePresetData tmp = new TurntablePresetData();
                        tmp.VideoGuid  = tmp_PresetList[i].CameraDeviceID;
                        tmp.PresetGuid = tmp_PresetList[i].PresetID;
                        tmp.PresetName = tmp_PresetList[i].PresetName;
                        tmpGetPreset.Add(tmp);
                    }
                }
            }
            else if (VideoGuid != null)
            {
                TurntablePresetData tmp = new TurntablePresetData();
                tmp.VideoGuid  = VideoGuid;
                tmp.PresetGuid = null;
                tmp.PresetName = "";
                tmp.AlarmType  = -1;
                tmpGetPreset.Add(tmp);
            }
            return(tmpGetPreset);
        }
Esempio n. 3
0
        /// <summary>
        /// 报警联动预置位
        /// </summary>
        /// <param name="VideoGuid"></param>
        /// <param name="PresetName"></param>
        /// <param name="UserGuid"></param>
        public static void PresetAlarmSetInterface(Guid VideoGuid, string PresetName, Guid?UserGuid)
        {
            TurntablePresetData tmp_TurntablePresetData = new TurntablePresetData();

            tmp_TurntablePresetData.VideoGuid  = VideoGuid;
            tmp_TurntablePresetData.PresetName = PresetName;
            PresetData.SetPreset(tmp_TurntablePresetData);
        }
Esempio n. 4
0
        /// <summary>
        /// 删除预置位
        /// </summary>
        /// <param name="tmpTurntablePresetData"></param>
        /// <returns></returns>
        static public string DelPreset(TurntablePresetData tmpTurntablePresetData)
        {
            string strDelPreset = "";
            PresetListRepository tmpPresetListRepository = new PresetListRepository();
            //List<PresetList> tmp = tmpPresetListRepository.GetList();
            int  VideoType  = ControlBusinessData.GetCameraVideoType(tmpTurntablePresetData.VideoGuid);
            Guid PresetGuid = GetPresetGuid(tmpTurntablePresetData.VideoGuid, tmpTurntablePresetData.PresetName);

            if (VideoType == (int)VideoCommandType.VideoCCD || VideoType == (int)VideoCommandType.VideoIR)
            {
                tmpPresetListRepository.Delete(PresetGuid);
            }
            else
            {
                tmpPresetListRepository.Delete(PresetGuid);
            }
            return(strDelPreset);
        }
Esempio n. 5
0
        /// <summary>
        /// 调用预置位
        /// </summary>
        /// <param name="tmpTurntablePresetData"></param>
        static public void SetPreset(TurntablePresetData tmpTurntablePresetData)
        {
            tmp_StaticDataT = new StaticDataOfTurntable();
            tmp_StaticDataT = ControlBusinessData.GetStaticDataOfTurntable(tmpTurntablePresetData.VideoGuid);

            PresetListRepository tmpPresetListRepository = new PresetListRepository();
            List <PresetList>    tmp = tmpPresetListRepository.GetList();

            if (tmp.Count > 0)
            {
                for (int i = 0; i < tmp.Count; i++)
                {
                    if (tmp[i].PresetName == tmpTurntablePresetData.PresetName && tmp[i].CameraDeviceID == tmpTurntablePresetData.VideoGuid)
                    {
                        ProtocolBusinessLogic.SetPreset_Business(tmp_StaticDataT, tmp[i]);
                        break;
                    }
                }
            }
        }
Esempio n. 6
0
 /// <summary>
 /// 预置位调用
 /// </summary>
 /// <param name="tmp_TurntablePresetData"></param>
 public static void PresetSetInterface(TurntablePresetData tmp_TurntablePresetData)
 {
     PresetData.SetPreset(tmp_TurntablePresetData);
 }
Esempio n. 7
0
 /// <summary>
 /// 预置位删除
 /// </summary>
 /// <param name="tmp_TurntablePresetData"></param>
 public static void PresetDelInterface(TurntablePresetData tmp_TurntablePresetData)
 {
     PresetData.DelPreset(tmp_TurntablePresetData);
 }
Esempio n. 8
0
 /// <summary>
 /// 预置位修改
 /// </summary>
 /// <param name="tmp_TurntablePresetData"></param>
 public static void PresetUpdateInterface(TurntablePresetData tmp_TurntablePresetData)
 {
     PresetData.UpdatePreset(tmp_TurntablePresetData);
 }
Esempio n. 9
0
 /// <summary>
 /// 预置位添加
 /// </summary>
 /// <param name="tmp_TurntablePresetData"></param>
 public static void PresetAddInterface(TurntablePresetData tmp_TurntablePresetData)
 {
     PresetData.AddrPreset(tmp_TurntablePresetData);
 }