Somehow fixed the problem with the timer activating too soon by changing the timer start to when it is in the "inner process" of the main method

This commit is contained in:
cs-powell
2024-12-17 14:18:53 -05:00
parent 33a4b8eb7e
commit 0eafd83c5b
15 changed files with 267 additions and 75 deletions

View File

@@ -134,6 +134,11 @@ public class Model {
}
private void handleMotorAction(Action temp) {
/*
TODO: GoogleDoc Notes 12/11/24
*/
Motor tempM = (Motor) temp;
MotorType motorType = tempM.getMotorType();
float[] currentControls = null;
@@ -228,7 +233,7 @@ public class Model {
}
private void logProcess(){
private void logProcess() {
if(!logCreated) {
dataLogFile = new File("./dataLog/" + java.time.LocalDateTime.now() + ".csv");
logCreated = true;
@@ -246,15 +251,12 @@ public class Model {
String log = null;
try {
float[] ctrl1 = this.getCurrentControls();
//Labled Format
//Labeled Format
log = String.format("[Elevator: %2f] [Roll: %2f] [Yaw: %2f] [Throttle:%2f] [Flaps: %2f] \n",
ctrl1[0], ctrl1[1], ctrl1[2], ctrl1[3], ctrl1[5]);
//CSV Format
log = String.format("%2f, %2f, %2f, %2f, %2f\n",
ctrl1[0], ctrl1[1], ctrl1[2], ctrl1[3], ctrl1[5]);
FileWriter fw = new FileWriter(dataLogFile, true);
BufferedWriter br = new BufferedWriter(fw);
br.write(log);
@@ -266,7 +268,6 @@ public class Model {
}
}
public float[] getStoredVisionResult() {
return storedVisionResult;
}
@@ -274,4 +275,9 @@ public class Model {
public String getStoredVisionTarget() {
return storedVisionTarget;
}
public XPlaneConnect exportXPC() {
return xpc;
}
}