Skip to content

Commit

Permalink
Bugfixes and consistifying.
Browse files Browse the repository at this point in the history
  • Loading branch information
Colby Skeggs committed Apr 28, 2015
1 parent 6485e7e commit 7b3d7ab
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
7 changes: 4 additions & 3 deletions CCRE_Igneous_cRIO/src/ccre/igneous/IgneousLauncherImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -437,16 +437,17 @@ public boolean get() {
public BooleanInputPoll getIsAutonomous() {
return new BooleanInputPoll() {
public boolean get() {
DriverStation is = DriverStation.getInstance();
return is.isAutonomous() && !is.isTest();
DriverStation ds = DriverStation.getInstance();
return ds.isEnabled() && ds.isAutonomous() && !ds.isTest();
}
};
}

public BooleanInputPoll getIsTest() {
return new BooleanInputPoll() {
public boolean get() {
return DriverStation.getInstance().isTest();
DriverStation ds = DriverStation.getInstance();
return ds.isEnabled() && ds.isTest();
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public RobotModeDevice() {
public BooleanInputPoll getIsMode(final RobotMode mode) {
return mode == RobotMode.DISABLED ? BooleanMixing.invert((BooleanInputPoll) enabled) : new BooleanInputPoll() {
public boolean get() {
return selectedMode == mode;
return enabled.get() && selectedMode == mode;
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,10 @@ public CluckUnitTestComponent(int cx, int cy) {

@Override
public void render(Graphics2D g, int screenWidth, int screenHeight, FontMetrics fontMetrics, int mouseX, int mouseY) {
if (tester == null) {
tester = new CluckUnitTesterWorker("Cluck-Unit-Tester", true);
}
Rendering.drawBody(bodyColor, g, this);
g.setColor(Color.BLACK);
int baseY = centerY - halfHeight / 2 + fontMetrics.getAscent();
String str = tester.isDoingWork() ? "Testing: " + tester.ctr + "/" + CluckUnitTesterWorker.MAX_CTR : "Ready";
String str = tester != null && tester.isDoingWork() ? "Testing: " + tester.ctr + "/" + CluckUnitTesterWorker.MAX_CTR : "Ready";
g.drawString(str, centerX - g.getFontMetrics().stringWidth(str) / 2, baseY);
}

Expand Down

0 comments on commit 7b3d7ab

Please sign in to comment.