Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(geneactive): trim whitespace when parsing header #38

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/actipy/GENEActivReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -218,17 +218,17 @@ private static int parseBinFileHeader(
}
// read axes calibration lines for gain and offset values
// data like -> x gain:25548 \n x offset:574 ... Volts:300 \n Lux:800
gainVals[0] = Double.parseDouble(readLine(reader).split(":")[1]); // xGain
offsetVals[0] = Integer.parseInt(readLine(reader).split(":")[1]); // xOffset
gainVals[1] = Double.parseDouble(readLine(reader).split(":")[1]); // y
offsetVals[1] = Integer.parseInt(readLine(reader).split(":")[1]); // y
gainVals[2] = Double.parseDouble(readLine(reader).split(":")[1]); // z
offsetVals[2] = Integer.parseInt(readLine(reader).split(":")[1]); // z
int volts = Integer.parseInt(readLine(reader).split(":")[1]); // volts
int lux = Integer.parseInt(readLine(reader).split(":")[1]); // lux
gainVals[0] = Double.parseDouble(readLine(reader).split(":")[1].trim()); // xGain
offsetVals[0] = Integer.parseInt(readLine(reader).split(":")[1].trim()); // xOffset
gainVals[1] = Double.parseDouble(readLine(reader).split(":")[1].trim()); // y
offsetVals[1] = Integer.parseInt(readLine(reader).split(":")[1].trim()); // y
gainVals[2] = Double.parseDouble(readLine(reader).split(":")[1].trim()); // z
offsetVals[2] = Integer.parseInt(readLine(reader).split(":")[1].trim()); // z
int volts = Integer.parseInt(readLine(reader).split(":")[1].trim()); // volts
int lux = Integer.parseInt(readLine(reader).split(":")[1].trim()); // lux
readLine(reader); // 9 blank
readLine(reader); // 10 memory status header
int numBlocksTotal = Integer.parseInt(readLine(reader).split(":")[1]); // 11
int numBlocksTotal = Integer.parseInt(readLine(reader).split(":")[1].trim()); // 11

// ignore remaining header lines in bin file
for (int i = 0; i < fileHeaderSize - linesToAxesCalibration - 11; i++) {
Expand Down
Loading