public double[] GetDoubleValues(ETcRealTags tag) { lock (dataLock) { dValueList.Clear(); if ((active == false) && (start != stop)) { if (start < stop) { for (int i = start; i < stop; i += recLength) { dValueList.Add((double)values[i + (int)tag]); } } else { for (int i = start; i < length; i += recLength) { dValueList.Add((double)values[i + (int)tag]); } for (int i = 0; i < stop; i += recLength) { dValueList.Add((double)values[i + (int)tag]); } } } } return(dValueList.ToArray()); }
/// <summary> /// Extract channel values from value array provided by TcDaqStorage /// </summary> /// <param name="daqValues">Multi-channel vector of sampled values</param> /// <param name="tag">Channel number to extract</param> /// <returns>Vector of extracted data</returns> static public double[] GetDoubleValues(float[] daqValues, ETcRealTags tag) { double[] da = new double[daqValues.Length / recLength]; List <double> lst = new List <double>(); for (int i = 0, j = 0; i < daqValues.Length; i += recLength, ++j) { da[j] = (double)daqValues[i + (int)tag]; } return(da); }
public double GetDoubleValue(ETcRealTags tag) { double value; lock (dataLock) { if (index == 0) { value = (double)values[(int)tag + length - recLength]; } else { value = (double)values[(int)tag + index - recLength]; } } return(value); }
public float GetFloatValue(ETcRealTags tag) { float value = 0; lock (dataLock) { if (index == 0) { value = values[(int)tag + length - recLength]; } else { value = values[(int)tag + index - recLength]; } } return(value); }