예제 #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);
        }
예제 #2
0
        public static TurntableStateData GetTurntableStateData(Guid?VideoGuid)
        {
            TurntableStateData tmpTurntableStateData = new TurntableStateData();

            tmpTurntableStateData = ControlBusinessData.GetTurntableState(VideoGuid);
            return(tmpTurntableStateData);
        }
예제 #3
0
 public static void Init()
 {
     ControlBusinessData.Init();             //初始化转台/云台基本数据
     SerialCOMInit.SerialCOMEquipmentInit(); //初始化串口设备
     //CHCNetSDKInterface.HK_EquipmentInit(); //初始化HK网络设备
     ////////////自动获取UPS数据///////////////////
     UPSDataInterface();
     IRProtect();
 }
예제 #4
0
        public static string SuperiorGetTurntableStateData(Guid?VideoGuid)
        {
            string             tmpData;
            TurntableStateData tmpTurntableStateData = new TurntableStateData();

            tmpTurntableStateData = ControlBusinessData.GetTurntableState(VideoGuid);
            tmpData = tmpTurntableStateData.VideoGuid.ToString() + "," + tmpTurntableStateData.iHorizontalData.ToString() + "," +
                      tmpTurntableStateData.iVerticalData.ToString() + "," + tmpTurntableStateData.iDepth + "," + tmpTurntableStateData.iFocus.ToString();
            return(tmpData);
        }
예제 #5
0
        /// <summary>
        /// 红外控制
        /// </summary>
        /// <param name="tmp_ControlData"></param>
        /// <returns></returns>
        public static string SetIRControl_Business(ControlData tmp_ControlData)
        {
            string strIRControlState = "";

            tmp_StaticDataT = new StaticDataOfTurntable();
            tmp_StaticDataT = ControlBusinessData.GetStaticDataOfTurntable(tmp_ControlData.VideoGuid);
            if (tmp_StaticDataT.GuidDeviceID != null)
            {
                SetIR(tmp_StaticDataT, tmp_ControlData.iAction, tmp_ControlData.iSpeed, tmp_ControlData.Parameter);
            }
            return(strIRControlState);
        }
예제 #6
0
        /// <summary>
        /// 扇扫结束
        /// </summary>
        /// <param name="tmpSectorScanData"></param>
        /// <returns></returns>
        public static string SectorScanControlOff_Business(SectorScanData tmpSectorScanData)
        {
            string strSectorScanControl = "";

            tmp_StaticDataT = new StaticDataOfTurntable();
            tmp_StaticDataT = ControlBusinessData.GetStaticDataOfTurntable(tmpSectorScanData.VideoGuid);
            if (tmp_StaticDataT.GuidDeviceID != null)
            {
                SectorScanControlOff(tmp_StaticDataT);
            }
            return(strSectorScanControl);
        }
예제 #7
0
        /// <summary>
        /// 扇扫开启
        /// </summary>
        /// <param name="tmpSectorScanData"></param>
        /// <returns></returns>
        public static string SectorScanControlOpen_Business(SectorScanData tmpSectorScanData)
        {
            string strSectorScanControl = "";

            tmp_StaticDataT = new StaticDataOfTurntable();
            tmp_StaticDataT = ControlBusinessData.GetStaticDataOfTurntable(tmpSectorScanData.VideoGuid);
            if (tmp_StaticDataT.GuidDeviceID != null)
            {
                SectorScanControlOpen(tmp_StaticDataT, tmpSectorScanData.i_HorizontalSt, tmpSectorScanData.i_HorizontalEnd, tmpSectorScanData.i_Hspeed,
                                      tmpSectorScanData.i_VerticalSt, tmpSectorScanData.i_VerticalEnd, tmpSectorScanData.i_Vspeed);
            }
            return(strSectorScanControl);
        }
예제 #8
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);
        }
예제 #9
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;
                    }
                }
            }
        }
예제 #10
0
        /// <summary>
        /// UPS信息
        /// </summary>
        /// <returns></returns>
        public static List <DynamicDataOfUps3onedata> UpsGet()
        {
            List <DynamicDataOfUps3onedata> tmpUpsData = ControlBusinessData.GetUpsData();

            return(tmpUpsData);
        }