Exemplo n.º 1
0
 public double[] GetRampData()
 {
     double[] temp = new double[AIData.GetLength(1)];
     for (int i = 0; i < AIData.GetLength(1); i++)
     {
         temp[i] = AIData[0, i];
     }
     return(temp);
 }
Exemplo n.º 2
0
        public double[] GetLaserData(string laser)
        {
            double[] temp    = new double[AIData.GetLength(1)];
            int      channel = AIChannelsLookup[laser];

            for (int i = 0; i < AIData.GetLength(1); i++)
            {
                temp[i] = AIData[channel, i];
            }
            return(temp);
        }
Exemplo n.º 3
0
        private void averageRampData(int numAverages)
        {
            double[,] updatedOldRampData;
            if (oldRampData != null)
            {
                int oldRampDataNumRecords        = oldRampData.GetLength(2);
                int updatedOldRampDataNumRecords = oldRampData.GetLength(2) >= numAverages ? numAverages : oldRampDataNumRecords + 1;
                updatedOldRampData = new double[updatedOldRampDataNumRecords, AIData.GetLength(1)];
                for (int record = 0; record < updatedOldRampDataNumRecords - 1; record++)
                {
                    for (int i = 0; i < updatedOldRampData.GetLength(1); i++)
                    {
                        updatedOldRampData[record, i] = oldRampData[record, i + 1];
                    }
                }
                for (int i = 0; i < updatedOldRampData.GetLength(1) - 1; i++)
                {
                    updatedOldRampData[updatedOldRampDataNumRecords - 1, i] = AIData[0, i];
                }

                double[] averageRampData = new double[updatedOldRampData.GetLength(1)];
                for (int i = 0; i < updatedOldRampData.GetLength(1) - 1; i++)
                {
                    double total = 0;
                    for (int record = 0; record < updatedOldRampDataNumRecords - 1; record++)
                    {
                        total += updatedOldRampData[record, i];
                    }
                    AIData[0, i] = total / updatedOldRampDataNumRecords;
                }
            }
            else
            {
                updatedOldRampData = new double[1, AIData.GetLength(1)];
                for (int i = 0; i < updatedOldRampData.GetLength(1) - 1; i++)
                {
                    updatedOldRampData[0, i] = AIData[0, i];
                }
            }
        }