Ejemplo n.º 1
0
        private void ExtractVisiCoefficient(byte[] coefInfo, ref double[,] coefficient, int lineIndex, int channelIndex)
        {
            byte[] coef = new byte[4];
            for (int j = 0; j < 5; j++)
            {
                for (int i = 0; i < 4; i++)
                {
                    coef[i] = coefInfo[i + j * 4];
                }
                if (_d1bdHeader.IsBigEndian)
                {
                    switch (j)
                    {
                    case 0:
                    case 2:
                        coefficient[lineIndex, j + channelIndex * 5] = (float)ToLocalEndian_Core.ToInt32FromBig(coef) / Math.Pow(10, 10);
                        break;

                    case 1:
                    case 3:
                        coefficient[lineIndex, j + channelIndex * 5] = (float)ToLocalEndian_Core.ToInt32FromBig(coef) / Math.Pow(10, 7);
                        break;

                    case 4:
                        coefficient[lineIndex, j + channelIndex * 5] = (float)ToLocalEndian_Core.ToInt32FromBig(coef);
                        break;
                    }
                }
                else
                {
                    switch (j)
                    {
                    case 0:
                    case 2:
                        coefficient[lineIndex, j + channelIndex * 5] = (float)ToLocalEndian_Core.ToInt32FromLittle(coef) / Math.Pow(10, 10);
                        break;

                    case 1:
                    case 3:
                        coefficient[lineIndex, j + channelIndex * 5] = (float)ToLocalEndian_Core.ToInt32FromLittle(coef) / Math.Pow(10, 7);
                        break;

                    case 4:
                        coefficient[lineIndex, j + channelIndex * 5] = (float)ToLocalEndian_Core.ToInt32FromLittle(coef);
                        break;
                    }
                }
            }
        }
Ejemplo n.º 2
0
 private void ExtractIRCoefficient(byte[] coefInfo, ref double[,] coefficient, int lineIndex, int channelIndex)
 {
     byte[] coef = new byte[4];
     for (int j = 0; j < 3; j++)
     {
         for (int i = 0; i < 4; i++)
         {
             coef[i] = coefInfo[i + j * 4];
         }
         if (_d1bdHeader.IsBigEndian)
         {
             coefficient[lineIndex, j + channelIndex * 3] = (float)ToLocalEndian_Core.ToInt32FromBig(coef) / Math.Pow(10, 6);
         }
         else
         {
             coefficient[lineIndex, j + channelIndex * 3] = (float)ToLocalEndian_Core.ToInt32FromLittle(coef) / Math.Pow(10, 6);
         }
     }
 }