Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="ComGuid"></param>
        /// <param name="tmpData"></param>
        /// <returns></returns>
        public string AnalysisSR(Guid ComGuid, byte[] tmpData)
        {
            string m_AnalysisSR = "";
            //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            //byte[] temData = new byte[(tmp_length * 2)];
            //for (int i = 0; i < (tmp_length * 2); i += 2)
            //{
            //    temData[(i / 2)] = (byte)Convert.ToInt32(tmp_XX.Substring(i, 2), 16);
            //}
            //MessageBox(_T("近程!!!"), _T("提示"));
            //8E 01 87 F3 28 84 00 0F 00 01 A5 08 78 02 6D CB E8
            //00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16

            //03:方位低 04:方位高
            //05:俯仰低 06:俯仰高
            //07:白光变倍高 08:白光变倍低
            //09:白光聚焦高 10:白光聚焦低
            //11:红外变倍高 12:红外变倍低
            //13:红外聚焦高 14:红外聚焦低
            byte dirLB, dirHB, pitchLB, pitchHB;//方位,俯仰
            int  CCD_Depth, CCD_Focus, n_H, n_V, IR_Depth, IR_Focus;

            CCD_Depth = 0;
            CCD_Focus = 0;
            n_H       = 0;
            n_V       = 0;
            IR_Depth  = 0;
            IR_Focus  = 0;

            //方位低 方位高
            dirLB = tmpData[3];
            dirHB = tmpData[4];

            //俯仰低 俯仰高
            pitchLB = tmpData[5];
            pitchHB = tmpData[6];

            byte CDD_DepthLB, CDD_DepthHB, CDD_FocusLB, CDD_FocusHB;//变倍 聚焦

            //变倍高 变倍低
            CDD_DepthHB = tmpData[7];
            CDD_DepthLB = tmpData[8];

            //聚焦高 聚焦低
            CDD_FocusHB = tmpData[9];
            CDD_FocusLB = tmpData[10];

            byte IR_DepthLB, IR_DepthHB, IR_FocusLB, IR_FocusHB;//变倍 聚焦

            //11:红外变倍高 12:红外变倍低
            IR_DepthHB = tmpData[11];
            IR_DepthLB = tmpData[12];
            //13:红外聚焦高 14:红外聚焦低
            IR_FocusHB = tmpData[13];
            IR_FocusLB = tmpData[14];

            byte byte_tempCCD, byte_tempSXJ, byte_tempIR;

            byte_tempCCD = 0;
            byte_tempSXJ = 0;
            byte_tempIR  = 0;

            bool dirsign, pitchsign;

            dirsign = pitchsign = true;
            if (dirHB >= 0x80)
            {
                dirsign = false;
            }
            if (pitchHB >= 0x80)
            {
                pitchsign = false;
            }
            //返回
            n_H       = (dirHB * 256 + dirLB);
            n_V       = (pitchHB * 256 + pitchLB);
            CCD_Depth = (CDD_DepthHB * 256 + CDD_DepthLB);

            CCD_Focus = (CDD_FocusHB * 256 + CDD_FocusLB);

            IR_Depth = (IR_DepthHB * 256 + IR_DepthLB);

            IR_Focus = (IR_FocusHB * 256 + IR_FocusLB);

            tmp_BusinessData.Preservation_All(ComGuid, n_H, n_H, n_V, n_V, CCD_Depth, CCD_Depth, CCD_Focus, CCD_Focus, IR_Depth, IR_Depth, IR_Focus, IR_Focus);
            /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            //n_H:方位;n_V:俯仰; Depth:白光视场; Focus:白光聚焦; IR_Depth:红外视场;IR_Focus:红外聚焦;
            //byte_tempCCD:CCD温度; byte_tempSXJ:摄像机温度; byte_tempIR:红外温度;
            m_AnalysisSR = n_H.ToString() + "_" + n_V.ToString() + "_" + CCD_Depth.ToString() + "_" + CCD_Focus.ToString() + "_" + IR_Depth.ToString()
                           + "_" + IR_Focus.ToString() + "_" + byte_tempCCD.ToString() + "_" + byte_tempSXJ.ToString() + "_" + byte_tempIR.ToString();
            return(m_AnalysisSR);
        }
Exemple #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="ComGuid"></param>
        /// <param name="tmpData"></param>
        /// <returns></returns>
        public string Analysis209s(Guid ComGuid, byte[] tmpData)
        {
            string m_Analysis209s = "";
            byte   dirLB, dirHB, pitchLB, pitchHB;      //方位,俯仰o
            int    CCD_Depth, CCD_Focus, n_H, n_V, IR_Depth, IR_Focus;
            bool   dirsign, pitchsign;

            dirsign   = true;
            pitchsign = true;

            dirLB   = tmpData[3];
            dirHB   = tmpData[4];
            pitchLB = tmpData[5];
            pitchHB = tmpData[6];

            CCD_Depth = tmpData[8];             // 焦距
            CCD_Focus = tmpData[10];            // 聚焦

            byte byte_tempCCD, byte_tempSXJ, byte_tempIR;

            byte_tempCCD = tmpData[15];    //白光镜头温度
            byte_tempSXJ = tmpData[16];    //摄像机温度
            byte_tempIR  = tmpData[17];    //红外温度

            IR_Depth = 0;
            IR_Focus = 0;
            if (dirHB >= 128)
            {
                dirsign = false;
            }

            if (pitchHB >= 128)
            {
                pitchsign = false;
            }
            //水平 正负值
            if (dirsign)
            {
                n_H = (dirHB * 256 + dirLB);
            }
            else
            {
                int tmpno222;
                tmpno222 = (dirHB * 256 + dirLB);
                tmpno222 = (65535 - tmpno222) + 1;
                n_H      = -(tmpno222);
            }

            //俯仰 正负值
            if (pitchsign)
            {
                n_V = (pitchHB * 256 + pitchLB);
            }
            else
            {
                int tmpno11;
                tmpno11 = (pitchHB * 256 + pitchLB);
                tmpno11 = (65535 - tmpno11) + 1;
                n_V     = -(tmpno11);//俯仰
            }
            tmp_BusinessData.Preservation_All(ComGuid, n_H, n_H, n_V, n_V, CCD_Depth, CCD_Depth, CCD_Focus, CCD_Focus, IR_Depth, IR_Depth, IR_Focus, IR_Focus);
            //n_H:方位;n_V:俯仰; Depth:白光视场; Focus:白光聚焦; IR_Depth:红外视场;IR_Focus:红外聚焦;
            //byte_tempCCD:CCD温度; byte_tempSXJ:摄像机温度; byte_tempIR:红外温度;
            m_Analysis209s = n_H.ToString() + "_" + n_V.ToString() + "_" + CCD_Depth.ToString() + "_" + CCD_Focus.ToString() + "_" + IR_Depth.ToString()
                             + "_" + IR_Focus.ToString() + "_" + byte_tempCCD.ToString() + "_" + byte_tempSXJ.ToString() + "_" + byte_tempIR.ToString();

            return(m_Analysis209s);
        }