Beispiel #1
0
        // Method to populate list of dataPoint objects (dataPoints), including metadata
        // Integer x tells which number spectrum (e.g. 0(first), 1(second)) in file to use
        private void constructDataPoints(int x)
        {
            dataPoint dataPointTemp;        // dataPoint object used in loop
            int       frequency = new int();

            if (startLength != 0)
            {
                frequency = startLength;
            }
            else
            {
                frequency = startFrequency + currentWindowStep * stepSize;
            }

            // Loop through list of data elements, but only create a new dataPoint object for each frequency
            for (int i = 0; i < fullData[x].Count; i += repeats)     //JOE CHECK HERE THIS MIGHT BE CAUSING No REPEATS ERROR (HAVE NOW CHANGED - CHECK THIS BUGFIX)
            {
                // Create new instance of dataPoint
                dataPointTemp = new dataPoint(ref fullData[x], i, repeats);

                // Set metadata (nb. repeats already set in constructor)
                dataPointTemp.setFreq(frequency);

                // Add to the list
                dataPoints[x].Add(dataPointTemp);
                frequency += stepSize;
            }
        }
Beispiel #2
0
        // Method to populate list of dataPoint objects (dataPoints), including metadata
        // Integer x tells which number spectrum (e.g. 0(first), 1(second)) in file to use
        private void constructDataPoints(int x)
        {
            dataPoint dataPointTemp;        // dataPoint object used in loop
            int frequency = new int();
            if (startLength != 0 || metadata[1] == "Fixed")
            {
                frequency = startLength;
            }
            else frequency = startFrequency + currentWindowStep * stepSize;

            // Loop through list of data elements, but only create a new dataPoint object for each frequency
            for (int i = 0; i < fullData[x].Count; i += repeats)     //JOE CHECK HERE THIS MIGHT BE CAUSING No REPEATS ERROR (HAVE NOW CHANGED - CHECK THIS BUGFIX)
            {
                // Create new instance of dataPoint
                dataPointTemp = new dataPoint(ref fullData[x], i, repeats);

                // Set metadata (nb. repeats already set in constructor)
                dataPointTemp.setFreq(frequency);

                // Add to the list
                dataPoints[x].Add(dataPointTemp);    
                frequency += stepSize;
            }

        }