Exemplo n.º 1
0
        private byte[] AdjustCycleDataAngle(byte[] cycleData)
        {
            (float antennaAngle, int angleInt) = AzimuthCell.GetAngleFromCycleData(cycleData);
            antennaAngle = Tools.ReverAngleDirection(antennaAngle);
            antennaAngle = Tools.StandardAngle(antennaAngle - AzAdjustment);
            int         angleI  = (int)(antennaAngle * 65535 / 360);
            byte        azHigh  = (byte)((angleI >> 8) & 0xff);
            byte        azLow   = (byte)angleI;
            List <byte> newData = new List <byte>(cycleData)
            {
                [28] = azHigh,
                [29] = azLow,
                [44] = azHigh,
                [45] = azLow
            };

            return(newData.ToArray());
        }
Exemplo n.º 2
0
        public int CompareTo(object obj)
        {
            if (obj == null)
            {
                return(1);
            }

            AzimuthCell otherCell = (AzimuthCell)obj;

            if (Tools.FloatEquals(Angle, otherCell.Angle))
            {
                return(0);
            }
            if (Angle > otherCell.Angle)
            {
                return(1);
            }
            return(-1);
        }
Exemplo n.º 3
0
        public AzimuthCell CreateAzimuthCell(byte[] data)
        {
            int index = 0;
            int pos   = 0;

            //计算方位单元编号
            for (int i = 0; i < AzimuthCell.HeadLength; i++)
            {
                index  = index << 8;
                index += data[pos++];
            }
            AzimuthCell azCell = new AzimuthCell(index);

            for (int i = 0; i < AzimuthCell.ElevationCellsCount; i++)
            {
                ElevationCell elCell = CreateElevationCell(data, pos);
                azCell.AddElevationCell(elCell);
                pos += ElevationCell.TotalLength;
            }

            return(azCell);
        }