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

Preserve rates as ints rather than doubles to make header parsing robust #1346

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ public class AnnotatedMotion extends Storage {
private double unitConversion = 1.0;
private boolean boundingBoxComputed=false;
private double[] currentRotations = new double[]{0., 0., 0.};
private double frameRate=0.;
private double cameraRate=0.;
private double dataRate=0.;
private int frameRate=0;
private int cameraRate=0;
private int dataRate=0;
private MotionDisplayer motionDisplayer;
private double displayForceScale = .001;
private String displayForceShape = "arrow";
Expand Down Expand Up @@ -455,27 +455,27 @@ private void saveAsTRC(String newFile, Vec3 eulerAngles) throws FileNotFoundExce
writer.close();
}

public void setDataRate(double d) {
public void setDataRate(int d) {
this.dataRate = d;
}

public void setCameraRate(double d) {
public void setCameraRate(int d) {
this.cameraRate = d;
}

public double getFrameRate() {
public int getFrameRate() {
return frameRate;
}

public void setFrameRate(double frameRate) {
public void setFrameRate(int frameRate) {
this.frameRate = frameRate;
}

public double getCameraRate() {
public int getCameraRate() {
return cameraRate;
}

public double getDataRate() {
public int getDataRate() {
return dataRate;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ public void performAction() {
AnnotatedMotion amot = new AnnotatedMotion(newStorage, markerData.getMarkerNames());
amot.setUnitConversion(markerData.getUnits().convertTo(Units.UnitType.Meters));
amot.setName(new File(fileName).getName());
amot.setDataRate(markerData.getDataRate());
amot.setCameraRate(markerData.getCameraRate());
amot.setDataRate((int)markerData.getDataRate());
amot.setCameraRate((int)markerData.getCameraRate());
amot.setUnits(markerData.getUnits());
// Add the visuals to support it
ModelForExperimentalData modelForDataImport = new ModelForExperimentalData(nextNumber++, amot);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ else if (fileName.toLowerCase().endsWith(".trc")){
AnnotatedMotion amot = new AnnotatedMotion(newStorage, markerData.getMarkerNames());
amot.setUnitConversion(markerData.getUnits().convertTo(Units.UnitType.Meters));
amot.setName(new File(fileName).getName());
amot.setDataRate(markerData.getDataRate());
amot.setCameraRate(markerData.getCameraRate());
amot.setDataRate((int)markerData.getDataRate());
amot.setCameraRate((int)markerData.getCameraRate());
storage = amot;
amot.setModel(node.getModelForNode());
}
Expand Down