/// <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); }
/// <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); }