WIP: RevHubTestSuite: Fixed not correctly advancing test stages.

This commit is contained in:
2023-10-08 10:31:24 -05:00
parent b8ae610362
commit 4d9d4256e4
7 changed files with 19 additions and 7 deletions

View File

@@ -25,14 +25,12 @@ public class RevHubTestSuiteEngine extends CyberarmEngine {
addState(new RevHubTestSuiteHubSelectionState(robot));
// addState(new RevHubTestSuiteMotorTestsState(robot));
// addState(new RevHubTestSuiteServoTestsState(robot));
// addState(new RevHubTestSuiteAnalogTestsState(robot));
// addState(new RevHubTestSuiteDigitalTestsState(robot));
addState(new RevHubTestSuiteMotorTestsState(robot));
addState(new RevHubTestSuiteServoTestsState(robot));
addState(new RevHubTestSuiteAnalogTestsState(robot));
addState(new RevHubTestSuiteDigitalTestsState(robot));
addState(new RevHubTestSuiteI2CTestsState(robot));
// robot.stage = RevTestSuiteTestState.STAGE.ANALOG_SENSOR;
robot.stage = RevTestSuiteTestState.STAGE.I2C_SENSOR;
}
@Override

View File

@@ -1,5 +1,7 @@
package org.timecrafters.diagnostics.rev_hub_test_suite.states;
import android.util.Log;
import com.qualcomm.robotcore.hardware.AnalogInput;
import com.qualcomm.robotcore.hardware.Gamepad;
@@ -19,6 +21,7 @@ public class RevHubTestSuiteAnalogTestsState extends RevTestSuiteTestState {
super.start();
sensors = robot.testingControlHub ? robot.controlHubAnalogSensors : robot.expansionHubAnalogSensors;
robot.stage = STAGE.ANALOG_SENSOR;
}
@Override

View File

@@ -20,6 +20,7 @@ public class RevHubTestSuiteDigitalTestsState extends RevTestSuiteTestState {
super.start();
sensors = robot.testingControlHub ? robot.controlHubDigitalSensors : robot.expansionHubDigitalSensors;
robot.stage = STAGE.DIGITAL_SENSOR;
}
@Override

View File

@@ -23,6 +23,7 @@ public class RevHubTestSuiteI2CTestsState extends RevTestSuiteTestState {
super.start();
sensors = robot.testingControlHub ? robot.controlHubI2cSensors : robot.expansionHubI2cSensors;
robot.stage = STAGE.I2C_SENSOR;
}
@Override

View File

@@ -33,7 +33,7 @@ public class RevHubTestSuiteMotorTestsState extends RevTestSuiteTestState {
motors = robot.testingControlHub ? robot.controlHubMotors : robot.expansionHubMotors;
lastMonitorTime = runTime();
nextStage();
robot.stage = STAGE.MOTOR_ENCODER_STEADY;
}
@Override

View File

@@ -23,6 +23,8 @@ public class RevHubTestSuiteServoTestsState extends RevTestSuiteTestState {
servos = robot.testingControlHub ? robot.controlHubServos : robot.expansionHubServos;
lastMonitorTime = runTime();
robot.stage = STAGE.SERVO_SWEEP;
}
@Override

View File

@@ -79,4 +79,11 @@ public class RevTestSuiteTestState extends CyberarmState {
}
}
}
@Override
public void setHasFinished(boolean value) {
Log.i(TAG, "finished state: " + this.getClass() +", stage: " + robot.stage.toString());
super.setHasFinished(value);
}
}