Skip to content

Commit

Permalink
added accessor in RunnableExecuter, classes implement Serializable
Browse files Browse the repository at this point in the history
  • Loading branch information
LoadingPleaseWait committed Jan 4, 2015
1 parent ae5cbe6 commit ea234e4
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 9 deletions.
8 changes: 6 additions & 2 deletions src/org/_2585robophiles/lib2585/DoubleSolenoid.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
package org._2585robophiles.lib2585;

import java.io.Serializable;

import edu.wpi.first.wpilibj.Relay;
import edu.wpi.first.wpilibj.SensorBase;

/**
* Solenoid with relays going in opposite directions
*/
public class DoubleSolenoid extends SensorBase {
public class DoubleSolenoid extends SensorBase implements Serializable {

private Relay relayOne, relayTwo;
private static final long serialVersionUID = 3161366075688287541L;

private transient Relay relayOne, relayTwo;
private boolean defaultState = true;

/**
Expand Down
8 changes: 6 additions & 2 deletions src/org/_2585robophiles/lib2585/ExecuterBasedRobot.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
package org._2585robophiles.lib2585;

import java.io.Serializable;

import edu.wpi.first.wpilibj.IterativeRobot;

/**
* Robot that uses executers This is the equivelant of a main class in WPILib.
*/
public abstract class ExecuterBasedRobot extends IterativeRobot {
public abstract class ExecuterBasedRobot extends IterativeRobot implements Serializable {

private Executer executer;
private static final long serialVersionUID = 2220871954112107703L;

private transient Executer executer;

/*
* (non-Javadoc)
Expand Down
8 changes: 6 additions & 2 deletions src/org/_2585robophiles/lib2585/MultiMotor.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
package org._2585robophiles.lib2585;

import java.io.Serializable;

import edu.wpi.first.wpilibj.SensorBase;
import edu.wpi.first.wpilibj.SpeedController;

/**
* This class can be used to control multiple motors which are working together as one.
*/
public class MultiMotor extends SensorBase implements SpeedController {
public class MultiMotor extends SensorBase implements SpeedController, Serializable {

private SpeedController[] motors;
private static final long serialVersionUID = 6048538258446457916L;

private transient SpeedController[] motors;

/**
* @param motors SpeedController array
Expand Down
8 changes: 6 additions & 2 deletions src/org/_2585robophiles/lib2585/RobotEnvironment.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
package org._2585robophiles.lib2585;

import java.io.Serializable;

import edu.wpi.first.wpilibj.RobotBase;

/**
* This class represents the environment of the robot. Subclasses should contain the systems.
*/
public abstract class RobotEnvironment implements Destroyable {
public abstract class RobotEnvironment implements Destroyable, Serializable {

private RobotBase robot;
private static final long serialVersionUID = 5958899478403442774L;

private transient RobotBase robot;

/**
* Just a default constructor that does nothing
Expand Down
12 changes: 11 additions & 1 deletion src/org/_2585robophiles/lib2585/RunnableExecuter.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package org._2585robophiles.lib2585;

import java.io.Serializable;
import java.util.Vector;

/**
* Executer that executes runnables
*/
public abstract class RunnableExecuter implements Executer {
public abstract class RunnableExecuter implements Executer, Serializable {

private static final long serialVersionUID = -7700534735844195641L;

private final Vector runnables = new Vector();

Expand All @@ -20,4 +23,11 @@ public void execute() {
}
}

/**
* @return the runnables
*/
public synchronized Vector getRunnables() {
return runnables;
}

}

0 comments on commit ea234e4

Please sign in to comment.