Exemple #1
0
        /// <summary>
        /// 白光控制
        /// </summary>
        /// <param name="iAction"></param>
        /// <param name="strAddr"></param>
        /// <param name="iSpeed"></param>
        /// <param name="iValue"></param>
        /// <param name="strCommunicationID"></param>
        /// <returns></returns>
        static public string SetCCD(int iAction, string strAddr, int iSpeed, int iValue, Guid?CommunicationGuid, string CommunicationType)
        {
            string strCCDResult = "";

            byte[] tmp_byte = ProtocolPelcoD.Protocol_CCD(iAction, Convert.ToInt32(strAddr), iSpeed, iValue);
            CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
            return(strCCDResult);
        }
Exemple #2
0
        static public string DelPreset(string strAddr, int iPresetNum, Guid?CommunicationGuid, string CommunicationType)
        {
            string strTurntableResult = "";

            byte[] tmp_byte = ProtocolPelcoD.DelPreset(Convert.ToInt32(strAddr), iPresetNum);
            CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
            return(strTurntableResult);
        }
Exemple #3
0
        /// <summary>
        /// 扇扫关闭
        /// </summary>
        /// <param name="strAddr"></param>
        /// <returns></returns>
        static public string SetSanScan_Off(string strAddr, Guid?GuidCommunicationID, string strCommunicationType)
        {
            string strSanScanResult = "";

            byte[] tmpSanScan_Off_V = ProtocolPelcoD.Protocol_Turntable(125, Convert.ToInt32(strAddr), 0);
            Thread.Sleep(50);
            byte[] tmpSanScan_Off_H = ProtocolPelcoD.Protocol_Turntable(114, Convert.ToInt32(strAddr), 0);

            return(strSanScanResult);
        }
Exemple #4
0
        /// <summary>
        /// 转台控制
        /// </summary>
        /// <param name="iAction">动作</param>
        /// <param name="iAddr">地址</param>
        /// <param name="iSpeed">速度</param>
        /// <param name="iCommunicationID">通信ID</param>
        /// <returns></returns>
        static public string SetTurntable(int iAction, string strAddr, int iSpeed, Guid?CommunicationGuid, string CommunicationType)
        {
            string strTurntableResult = "";

            byte[] tmp_byte;
            if (iAction == 1)                                                                        /**左上*/
            {
                tmp_byte = ProtocolPelcoD.Protocol_Turntable(108, Convert.ToInt32(strAddr), iSpeed); /**水平控制*/
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
                Thread.Sleep(50);
                tmp_byte = ProtocolPelcoD.Protocol_Turntable(106, Convert.ToInt32(strAddr), iSpeed);/**俯仰控制*/
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
            }
            else if (iAction == 1)                                                                   /**左下*/
            {
                tmp_byte = ProtocolPelcoD.Protocol_Turntable(108, Convert.ToInt32(strAddr), iSpeed); /**水平控制*/
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
                Thread.Sleep(50);
                tmp_byte = ProtocolPelcoD.Protocol_Turntable(107, Convert.ToInt32(strAddr), iSpeed);/**俯仰控制*/
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
            }
            else if (iAction == 1)                                                                   /**右上*/
            {
                tmp_byte = ProtocolPelcoD.Protocol_Turntable(109, Convert.ToInt32(strAddr), iSpeed); /**水平控制*/
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
                Thread.Sleep(50);
                tmp_byte = ProtocolPelcoD.Protocol_Turntable(106, Convert.ToInt32(strAddr), iSpeed);/**俯仰控制*/
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
            }
            else if (iAction == 1)                                                                   /**右下*/
            {
                tmp_byte = ProtocolPelcoD.Protocol_Turntable(109, Convert.ToInt32(strAddr), iSpeed); /**水平控制*/
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
                Thread.Sleep(50);
                tmp_byte = ProtocolPelcoD.Protocol_Turntable(107, Convert.ToInt32(strAddr), iSpeed);/**俯仰控制*/
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
            }
            else if (iAction == 1)                                                                   /**获取转台方位、俯仰*/
            {
                tmp_byte = ProtocolPelcoD.Protocol_Turntable(123, Convert.ToInt32(strAddr), iSpeed); /**水平-查询*/
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
                Thread.Sleep(50);
                tmp_byte = ProtocolPelcoD.Protocol_Turntable(124, Convert.ToInt32(strAddr), iSpeed);/**俯仰-查询*/
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
            }
            else
            {
                tmp_byte = ProtocolPelcoD.Protocol_Turntable(iAction, Convert.ToInt32(strAddr), iSpeed);
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
            }
            return(strTurntableResult);
        }