Exemple #1
0
        /// <summary>
        /// 扇扫开启
        /// </summary>
        /// <param name="strAddr"></param>
        /// <returns></returns>
        static public string SetSanScan_Open(int iAddr, int iHorizontlSt, int iHorizontlEnd, int iSpeed_H, int iVerticalSt,
                                             int iVerticalEnd, int iSpeed_V, Guid?CommunicationGuid, string CommunicationType)
        {
            string strSanScanResult = "";

            //
            byte[] tmp_HSt = Protocol209sSR.PrePointSend_Horizontal(iAddr, iHorizontlSt);
            CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_HSt);
            byte[] tmp_VSt = Protocol209sSR.PrePointSend_Vertical(iAddr, iVerticalSt);
            CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_VSt);

            byte[] tmp_Origins = Protocol209sSR.SanScan_Origins(iAddr);
            CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_Origins);
            Thread.Sleep(50);
            byte[] tmp_HEnd = Protocol209sSR.PrePointSend_Horizontal(iAddr, iHorizontlEnd);
            CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_HEnd);
            byte[] tmp_VEnd = Protocol209sSR.PrePointSend_Vertical(iAddr, iVerticalEnd);
            CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_VEnd);
            byte[] tmp_Destinations = Protocol209sSR.SanScan_Destinations(iAddr);
            CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_Destinations);
            Thread.Sleep(50);
            byte[] tmp_Open = Protocol209sSR.SanScan_Open(iAddr);
            CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_Open);
            return(strSanScanResult);
        }
        static public string SetIR(int iAction, string strAddr, int iSpeed, int iValue, Guid?CommunicationGuid, string CommunicationType)
        {
            string strIRResult = "";

            byte[] tmp_IR = Protocol211_OT11.Protocol_IR(iAction, Convert.ToInt32(strAddr), iSpeed, iValue);
            CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_IR);
            return(strIRResult);
        }
        /// <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 = Protocol211_OT11.Protocol_Turntable(iAction, Convert.ToInt32(strAddr), iSpeed);
            CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
            return(strTurntableResult);
        }
Exemple #4
0
        /// <summary>
        /// 白光预置位
        /// </summary>
        /// <param name="strAddr"></param>
        /// <param name="iDepth"></param>
        /// <param name="iFocus"></param>
        /// <returns></returns>
        static public string SetPresetCCD(string strAddr, int iDepth, int iFocus, Guid?CommunicationGuid, string CommunicationType)
        {
            string strCCDResult = "";

            byte[] tmp_D_F = Protocol209sRY.PrePointSend_DepthFocus(Convert.ToInt32(strAddr), iDepth, iFocus);
            CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_D_F);
            return(strCCDResult);
        }
Exemple #5
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 = Protocol209sRY.Protocol_CCD(iAction, Convert.ToInt32(strAddr), iSpeed, iValue);
            CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
            return(strCCDResult);
        }
Exemple #6
0
        /// <summary>
        /// 扇扫关闭
        /// </summary>
        /// <param name="strAddr"></param>
        /// <returns></returns>
        static public string SetSanScan_Off(int iAddr, Guid?CommunicationGuid, string CommunicationType)
        {
            string strSanScanResult = "";

            byte[] tmpSanScan_Off = Protocol209sRY.SanScan_Off(iAddr);
            CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmpSanScan_Off);
            return(strSanScanResult);
        }
        static public string SetPresetTurntable(string strAddr, int iHorizontal, int iVertical, Guid?CommunicationGuid, string CommunicationType)
        {
            string strTurntableResult = "";

            byte[] tmp_HV = Protocol368s.PrePointSend_HorizontalVertical(Convert.ToInt32(strAddr), iHorizontal, iVertical);
            CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_HV);
            return(strTurntableResult);
        }
Exemple #8
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 #9
0
        static public string GetUPSData(Guid?CommunicationGuid, string CommunicationType)
        {
            string tmpData         = null;
            string UPSProtocolData = ProtocolUPS_3onedata.GetUpsData();

            //CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, UPSProtocolData);
            CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, UPSProtocolData);
            return(tmpData);
        }
        /// <summary>
        /// 扇扫开启
        /// </summary>
        /// <param name="strAddr"></param>
        /// <returns></returns>
        static public string SetSanScan_Open(int iAddr, int iHorizontlSt, int iHorizontlEnd, int iSpeed_H, int iVerticalSt, int iVerticalEnd, int iSpeed_V, Guid?CommunicationGuid, string CommunicationType)
        {
            string strSanScanResult = "";

            byte[] tmp_SanScan_OpenH = Protocol368s.SanScan_Horizontl(iAddr, iHorizontlSt, iHorizontlEnd, iSpeed_H);
            CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_SanScan_OpenH);
            byte[] tmp_SanScan_OpenV = Protocol368s.SanScan_Vertical(iAddr, iVerticalSt, iVerticalEnd, iSpeed_V);
            CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_SanScan_OpenV);
            return(strSanScanResult);
        }
        /// <summary>
        /// 扇扫关闭
        /// </summary>
        /// <param name="strAddr"></param>
        /// <returns></returns>
        static public string SetSanScan_Off(int iAddr, Guid?CommunicationGuid, string CommunicationType)
        {
            string strSanScanResult = "";

            byte[] tmpSanScan_Off_V = Protocol209sPT100.Protocol_Turntable(125, iAddr, 0);
            CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmpSanScan_Off_V);
            Thread.Sleep(50);
            byte[] tmpSanScan_Off_H = Protocol209sPT100.Protocol_Turntable(114, iAddr, 0);
            CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmpSanScan_Off_H);
            return(strSanScanResult);
        }
Exemple #12
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);
        }
        /// <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 = "";

            if (iAction == (int)CCDCommand.CCD_Autofocus)
            {
                byte[] tmp_byte = Protocol209sPT100.Protocol_CCD((int)CCDCommand.CCD_AutofocusOpen, Convert.ToInt32(strAddr), iSpeed, iValue);
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
            }
            else
            {
                byte[] tmp_byte = Protocol209sPT100.Protocol_CCD(iAction, Convert.ToInt32(strAddr), iSpeed, iValue);
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
            }


            return(strCCDResult);
        }
        /// <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, int iValue)
        {
            string strTurntableResult = "";

            byte[] tmp_byte;
            if (iAction == (int)HDCommand.InitialPoint)//复位
            {
                tmp_byte = Protocol209sPT100.Protocol_Turntable(101, Convert.ToInt32(strAddr), iSpeed);
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
                Thread.Sleep(50);
                tmp_byte = Protocol209sPT100.Protocol_Turntable(128, Convert.ToInt32(strAddr), iSpeed);
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
            }
            else if (iAction == (int)HDCommand.MotorOpen)                                               /**电机开*/
            {
                tmp_byte = Protocol209sPT100.Protocol_Turntable(102, Convert.ToInt32(strAddr), iSpeed); /**水平-电机开*/
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
                Thread.Sleep(50);
                tmp_byte = Protocol209sPT100.Protocol_Turntable(126, Convert.ToInt32(strAddr), iSpeed);/**俯仰-电机开*/
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
            }
            else if (iAction == (int)HDCommand.MotorOpen)                                               /**电机关*/
            {
                tmp_byte = Protocol209sPT100.Protocol_Turntable(103, Convert.ToInt32(strAddr), iSpeed); /**水平-电机关*/
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
                Thread.Sleep(50);
                tmp_byte = Protocol209sPT100.Protocol_Turntable(127, Convert.ToInt32(strAddr), iSpeed);/**俯仰-电机关*/
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
            }
            else if (iAction == (int)HDCommand.DirectionStop)                                           /**停*/
            {
                tmp_byte = Protocol209sPT100.Protocol_Turntable(114, Convert.ToInt32(strAddr), iSpeed); /**水平-停*/
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
                Thread.Sleep(50);
                tmp_byte = Protocol209sPT100.Protocol_Turntable(125, Convert.ToInt32(strAddr), iSpeed);/**俯仰-停*/
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
                Thread.Sleep(50);
                tmp_byte = Protocol209sPT100.Protocol_Turntable(123, Convert.ToInt32(strAddr), iSpeed);/**水平-查询*/
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
                Thread.Sleep(50);
                tmp_byte = Protocol209sPT100.Protocol_Turntable(124, Convert.ToInt32(strAddr), iSpeed);/**俯仰-查询*/
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
            }
            else if (iAction == (int)HDCommand.LeftUp)                                                                /**左上*/
            {
                tmp_byte = Protocol209sPT100.Protocol_Turntable((int)HDCommand.Up, Convert.ToInt32(strAddr), iSpeed); /**水平控制*/
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
                Thread.Sleep(50);
                tmp_byte = Protocol209sPT100.Protocol_Turntable((int)HDCommand.Left, Convert.ToInt32(strAddr), iSpeed);/**俯仰控制*/
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
            }
            else if (iAction == (int)HDCommand.LeftDown)                                                                /**左下*/
            {
                tmp_byte = Protocol209sPT100.Protocol_Turntable((int)HDCommand.Down, Convert.ToInt32(strAddr), iSpeed); /**水平控制*/
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
                Thread.Sleep(50);
                tmp_byte = Protocol209sPT100.Protocol_Turntable((int)HDCommand.Left, Convert.ToInt32(strAddr), iSpeed);/**俯仰控制*/
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
            }
            else if (iAction == (int)HDCommand.RightUp)                                                               /**右上*/
            {
                tmp_byte = Protocol209sPT100.Protocol_Turntable((int)HDCommand.Up, Convert.ToInt32(strAddr), iSpeed); /**水平控制*/
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
                Thread.Sleep(50);
                tmp_byte = Protocol209sPT100.Protocol_Turntable((int)HDCommand.Right, Convert.ToInt32(strAddr), iSpeed);/**俯仰控制*/
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
            }
            else if (iAction == (int)HDCommand.RightDown)                                                               /**右下*/
            {
                tmp_byte = Protocol209sPT100.Protocol_Turntable((int)HDCommand.Down, Convert.ToInt32(strAddr), iSpeed); /**水平控制*/
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
                Thread.Sleep(50);
                tmp_byte = Protocol209sPT100.Protocol_Turntable((int)HDCommand.Right, Convert.ToInt32(strAddr), iSpeed);/**俯仰控制*/
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
            }
            else if (iAction == (int)HDCommand.HorizontalQuery || iAction == (int)HDCommand.VerticalQuery) /**获取转台方位、俯仰*/
            {
                tmp_byte = Protocol209sPT100.Protocol_Turntable(123, Convert.ToInt32(strAddr), iSpeed);    /**水平-查询*/
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
                Thread.Sleep(50);
                tmp_byte = Protocol209sPT100.Protocol_Turntable(124, Convert.ToInt32(strAddr), iSpeed);/**俯仰-查询*/
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
            }
            else
            {
                tmp_byte = Protocol209sPT100.Protocol_Turntable(iAction, Convert.ToInt32(strAddr), iSpeed);
                CommunicationTransmission.CommunicationWrite(CommunicationGuid, CommunicationType, tmp_byte);
            }
            return(strTurntableResult);
        }