Showing 1 of 2 files from the diff.
Other files ignored by Codecov
inst/NEWS.Rd has changed.

@@ -113,7 +113,7 @@
Loading
113 113
      # sensorConfig = readBin(fid, raw(), size = 1) #offset 35
114 114
      # sample rate and dynamic range accelerometer
115 115
      samplerate_dynrange = readBin(fid, integer(), size = 1) #offset 36
116 -
      frequency = round( 3200 / bitwShiftL(1, 15 - bitwAnd(samplerate_dynrange, 15)))
116 +
      frequency_header = round( 3200 / bitwShiftL(1, 15 - bitwAnd(samplerate_dynrange, 15)))
117 117
      accrange = bitwShiftR(16,(bitwShiftR(samplerate_dynrange,6)))
118 118
      suppressWarnings(readChar(fid, 4, useBytes = TRUE)) #offset 37..40
119 119
      version = readBin(fid, integer(), size = 1) #offset 41
@@ -124,9 +124,9 @@
Loading
124 124
      if (is.null(datas)){
125 125
        stop("Error in the first data block reading")
126 126
      }
127 -
      if (frequency != datas$frequency){
127 +
      if (frequency_header != datas$frequency){
128 128
        warning("Inconsistent value of measurement frequency: there is ",
129 -
                frequency, " in header and ", datas$frequency, " in the first data block ")
129 +
                frequency_header, " in header and ", datas$frequency, " in the first data block ")
130 130
      }
131 131
    } else {
132 132
      return(invisible(NULL))
@@ -135,7 +135,7 @@
Loading
135 135
    start = as.POSIXct(datas$start, origin = "1970-01-01", tz=desiredtz)
136 136
    
137 137
    returnobject = list(
138 -
      uniqueSerialCode = uniqueSerialCode, frequency = frequency,
138 +
      uniqueSerialCode = uniqueSerialCode, frequency = frequency_header,
139 139
      start = start,
140 140
      device = "Axivity", firmwareVersion = version, blocks = numDBlocks,
141 141
      accrange = accrange, hardwareType=hardwareType
@@ -260,7 +260,7 @@
Loading
260 260
        # If tsOffset is not null then timestamp offset was artificially
261 261
        # modified for backwards-compatibility ... therefore undo this...
262 262
        if (bitwAnd(tsOffset, 0x8000L) != 0) {
263 -
          frequency = round( 3200 / bitwShiftL(1, 15 - bitwAnd(samplerate_dynrange, 15)))
263 +
          frequency_data = round( 3200 / bitwShiftL(1, 15 - bitwAnd(samplerate_dynrange, 15)))
264 264
          accrange = bitwShiftR(16,(bitwShiftR(samplerate_dynrange,6)))
265 265
          # Need to undo backwards-compatible shim:
266 266
          # Take into account how many whole samples the fractional part
@@ -274,11 +274,13 @@
Loading
274 274
          # use 15-bits as 16-bit fractional time
275 275
          fractional = bitwShiftL(bitwAnd(tsOffset, 0x7fffL), 1);
276 276
          # frequency is truncated to int in firmware
277 -
          shift = shift + bitwShiftR((fractional * frequency), 16);
277 +
          shift = shift + bitwShiftR((fractional * frequency_data), 16);
278 +
        } else if (bitwAnd(tsOffset, 0x8000L) == 0) { # & class(frequency_data) ==  "function") {
279 +
          frequency_data = round( 3200 / bitwShiftL(1, 15 - bitwAnd(samplerate_dynrange, 15)))
278 280
        }
279 281
      } else {
280 282
        #Very old format, where offset 26 contains frequency
281 -
        frequency = temp
283 +
        frequency_data = temp
282 284
      }
283 285
      # Read data if necessary
284 286
      if (complete){
@@ -317,8 +319,8 @@
Loading
317 319
        suppressWarnings(readChar(fid, 482, useBytes = TRUE))
318 320
      }
319 321
      l = list(
320 -
        frequency = frequency,
321 -
        start = timestampDecoder(timeStamp, fractional,-shift / frequency),
322 +
        frequency = frequency_data,
323 +
        start = timestampDecoder(timeStamp, fractional,-shift / frequency_data),
322 324
        temperature = temperature,
323 325
        battery = battery,
324 326
        light = light,
Files Coverage
R 74.03%
src 100.00%
Project Totals (78 files) 74.14%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading