Ejemplo n.º 1
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;
                    }
                }
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 扇扫 关
 /// </summary>
 /// <param name="tmpSectorScanData"></param>
 public static void SectorScanOff(SectorScanData tmpSectorScanData)
 {
     ProtocolBusinessLogic.SectorScanControlOff_Business(tmpSectorScanData);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 红外控制
 /// </summary>
 /// <param name="tmp_ControlData"></param>
 public static void IRControlInterface(ControlData tmp_ControlData)
 {
     ProtocolBusinessLogic.SetIRControl_Business(tmp_ControlData);
 }
Ejemplo n.º 4
0
 public void Protect()
 {
     while (true)
     {
         for (int i = 0; i < _ListLensProtection.Count; i++)
         {
             if (string.IsNullOrEmpty(_ListLensProtection[i].SummerMonth) || string.IsNullOrEmpty(_ListLensProtection[i].WinterMonth))
             {
                 return;
             }
             //获取夏时令的开始月份与结束月份
             int str1 = int.Parse(_ListLensProtection[i].SummerMonth.Split(new char[] { '-' })[0]);
             int str2 = int.Parse(_ListLensProtection[i].SummerMonth.Split(new char[] { '-' })[1]);
             //获取冬时令的开始月份月结束月份
             int str3 = int.Parse(_ListLensProtection[i].WinterMonth.Split(new char[] { '-' })[0]);
             int str4 = int.Parse(_ListLensProtection[i].WinterMonth.Split(new char[] { '-' })[1]);
             month = DateTime.Now.Month;
             if (str1 < str2)
             {
                 if (str1.CompareTo(month) <= 0 && str2.CompareTo(month) >= 0)
                 {
                     if (DateTime.Now.ToString("HH:mm") == _ListLensProtection[i].SummerTimeBegin)
                     {
                         if (_ListLensProtection[i].SummerDetermine == (int)VideoProtectType.Protect_Off)
                         {
                             //关闭设备 进入保护状态
                             //_ListLensProtection[i].Camera_DeviceID;
                             foreach (CameraList mc in ControlBusinessData.CameraList_Dictionary.Values)
                             {
                                 int iVideoType = Convert.ToInt32(mc.VideoType);
                                 if (iVideoType == (int)VideoCommandType.VideoIR)
                                 {
                                     ControlData tmp_ControlData = new ControlData();
                                     tmp_ControlData.VideoGuid = mc.DeviceID;
                                     tmp_ControlData.iAction   = (int)IRCommand.IR_Off;
                                     ProtocolBusinessLogic.SetIRControl_Business(tmp_ControlData);
                                 }
                             }
                         }
                     }
                     else if (DateTime.Now.ToString("HH:mm") == _ListLensProtection[i].SummerTimeEnd)
                     {
                         if (_ListLensProtection[i].SummerDetermine == (int)VideoProtectType.Protect_Open)
                         {
                             //开启设备 退出保护状态
                             foreach (CameraList mc in ControlBusinessData.CameraList_Dictionary.Values)
                             {
                                 int iVideoType = Convert.ToInt32(mc.VideoType);
                                 if (iVideoType == (int)VideoCommandType.VideoIR)
                                 {
                                     ControlData tmp_ControlData = new ControlData();
                                     tmp_ControlData.VideoGuid = mc.DeviceID;
                                     tmp_ControlData.iAction   = (int)IRCommand.IR_Open;
                                     ProtocolBusinessLogic.SetIRControl_Business(tmp_ControlData);
                                 }
                             }
                         }
                     }
                 }
                 else
                 {
                     if (DateTime.Now.ToString("HH:mm") == _ListLensProtection[i].WinterTimeBegin)
                     {
                         if (_ListLensProtection[i].SummerDetermine == (int)VideoProtectType.Protect_Off)
                         {
                             //关闭设备 进入保护状态
                             //_ListLensProtection[i].Camera_DeviceID;
                             foreach (CameraList mc in ControlBusinessData.CameraList_Dictionary.Values)
                             {
                                 int iVideoType = Convert.ToInt32(mc.VideoType);
                                 if (iVideoType == (int)VideoCommandType.VideoIR)
                                 {
                                     ControlData tmp_ControlData = new ControlData();
                                     tmp_ControlData.VideoGuid = mc.DeviceID;
                                     tmp_ControlData.iAction   = (int)IRCommand.IR_Off;
                                     ProtocolBusinessLogic.SetIRControl_Business(tmp_ControlData);
                                 }
                             }
                         }
                     }
                     else if (DateTime.Now.ToString("HH:mm") == _ListLensProtection[i].WinterTimeEnd)
                     {
                         if (_ListLensProtection[i].SummerDetermine == (int)VideoProtectType.Protect_Open)
                         {
                             //开启设备 退出保护状态
                             foreach (CameraList mc in ControlBusinessData.CameraList_Dictionary.Values)
                             {
                                 int iVideoType = Convert.ToInt32(mc.VideoType);
                                 if (iVideoType == (int)VideoCommandType.VideoIR)
                                 {
                                     ControlData tmp_ControlData = new ControlData();
                                     tmp_ControlData.VideoGuid = mc.DeviceID;
                                     tmp_ControlData.iAction   = (int)IRCommand.IR_Open;
                                     ProtocolBusinessLogic.SetIRControl_Business(tmp_ControlData);
                                 }
                             }
                         }
                     }
                 }
             }
             else
             {
                 if (str3.CompareTo(month) <= 0 && str4.CompareTo(month) >= 0)
                 {
                     if (DateTime.Now.ToString("HH:mm") == _ListLensProtection[i].WinterTimeBegin)
                     {
                         if (_ListLensProtection[i].WinterDetermine == (int)VideoProtectType.Protect_Off)
                         {
                             //关闭设备 进入保护状态
                             foreach (CameraList mc in ControlBusinessData.CameraList_Dictionary.Values)
                             {
                                 int iVideoType = Convert.ToInt32(mc.VideoType);
                                 if (iVideoType == (int)VideoCommandType.VideoIR)
                                 {
                                     ControlData tmp_ControlData = new ControlData();
                                     tmp_ControlData.VideoGuid = mc.DeviceID;
                                     tmp_ControlData.iAction   = (int)IRCommand.IR_Off;
                                     ProtocolBusinessLogic.SetIRControl_Business(tmp_ControlData);
                                 }
                             }
                         }
                     }
                     else if (DateTime.Now.ToString("HH:mm") == _ListLensProtection[i].WinterTimeEnd)
                     {
                         if (_ListLensProtection[i].WinterDetermine == (int)VideoProtectType.Protect_Open)
                         {
                             //开启设备 退出保护状态
                             foreach (CameraList mc in ControlBusinessData.CameraList_Dictionary.Values)
                             {
                                 int iVideoType = Convert.ToInt32(mc.VideoType);
                                 if (iVideoType == (int)VideoCommandType.VideoIR)
                                 {
                                     ControlData tmp_ControlData = new ControlData();
                                     tmp_ControlData.VideoGuid = mc.DeviceID;
                                     tmp_ControlData.iAction   = (int)IRCommand.IR_Open;
                                     ProtocolBusinessLogic.SetIRControl_Business(tmp_ControlData);
                                 }
                             }
                         }
                     }
                 }
                 else
                 {
                     if (DateTime.Now.ToString("HH:mm") == _ListLensProtection[i].SummerTimeBegin)
                     {
                         if (_ListLensProtection[i].WinterDetermine == (int)VideoProtectType.Protect_Off)
                         {
                             //关闭设备 进入保护状态
                             foreach (CameraList mc in ControlBusinessData.CameraList_Dictionary.Values)
                             {
                                 int iVideoType = Convert.ToInt32(mc.VideoType);
                                 if (iVideoType == (int)VideoCommandType.VideoIR)
                                 {
                                     ControlData tmp_ControlData = new ControlData();
                                     tmp_ControlData.VideoGuid = mc.DeviceID;
                                     tmp_ControlData.iAction   = (int)IRCommand.IR_Off;
                                     ProtocolBusinessLogic.SetIRControl_Business(tmp_ControlData);
                                 }
                             }
                         }
                     }
                     else if (DateTime.Now.ToString("HH:mm") == _ListLensProtection[i].SummerTimeEnd)
                     {
                         if (_ListLensProtection[i].WinterDetermine == (int)VideoProtectType.Protect_Open)
                         {
                             //开启设备 退出保护状态
                             foreach (CameraList mc in ControlBusinessData.CameraList_Dictionary.Values)
                             {
                                 int iVideoType = Convert.ToInt32(mc.VideoType);
                                 if (iVideoType == (int)VideoCommandType.VideoIR)
                                 {
                                     ControlData tmp_ControlData = new ControlData();
                                     tmp_ControlData.VideoGuid = mc.DeviceID;
                                     tmp_ControlData.iAction   = (int)IRCommand.IR_Open;
                                     ProtocolBusinessLogic.SetIRControl_Business(tmp_ControlData);
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }