src/utilities.js
function buildSample (sampleNumber, rawData, sendCounts) {
  let sample;
  if (sendCounts) {
    sample = newSampleNoScale(sampleNumber);
    sample.channelDataCounts = rawData;
  } else {
    sample = newSample(sampleNumber);
    for (let j = 0; j < k.OBCINumberOfChannelsGanglion; j++) {
      sample.channelData.push(rawData[j] * k.OBCIGanglionScaleFactorPerCountVolts);
    }
  }
  sample.timestamp = Date.now();
  return sample;
}
function buildSample (sampleNumber, rawData, sendCounts) {
  let sample;
  if (sendCounts) {
    sample = newSampleNoScale(sampleNumber);
    sample.channelDataCounts = rawData;
  } else {
    sample = newSample(sampleNumber);
    for (let j = 0; j < k.OBCINumberOfChannelsGanglion; j++) {
      sample.channelData.push(rawData[j] * k.OBCIGanglionScaleFactorPerCountVolts);
    }
  }
  sample.timestamp = Date.now();
  return sample;
}
function buildSample ( sampleNumber , rawData , sendCounts ) { let sample ; if ( sendCounts ) { sample = newSampleNoScale ( sampleNumber ) ; sample . channelDataCounts = rawData ; } else { sample = newSample ( sampleNumber ) ; for ( let j = 0 ; j < k . OBCINumberOfChannelsGanglion ; j ++ ) { sample . channelData . push ( rawData [ j ] * k . OBCIGanglionScaleFactorPerCountVolts ) ; } } sample . timestamp = Date . now ( ) ; return sample ; }
Builds a sample object from an array and sample number.
@param o {RawDataToSample} - Used to hold data and configuration settings
@return {Array}
@private
Builds a sample object from an array and sample number .