removes control IO from the Well class, creates threaded IOControl class

This commit is contained in:
Patrick McDonagh
2017-02-10 10:26:45 -06:00
parent 419f42cf17
commit 062771a1e9
4 changed files with 72 additions and 79 deletions

View File

@@ -33,7 +33,6 @@ public class Well {
/* IO */
AnalogIn inclinometer;
AnalogIn loadCell;
DigitalOut runCommand;
private double currentSurfacePosition;
private double currentSurfaceLoad;
private double currentDownholePosition;
@@ -181,7 +180,6 @@ public class Well {
currentCard = new Card(strokesLifetime);
inclinometer = new AnalogIn(inclinometerChannel, 0, 100, 0, 100);
loadCell = new AnalogIn(loadCellChannel, 0, 50000, 0, 50000);
runCommand = new DigitalOut(runCommandChannel, 0);
strokeSpeed = new Measurement("Stroke Speed", true, db, 0.5, 600);
downholeGrossStroke = new Measurement("Downhole Gross Stroke", true, db, 0.5, 600);
@@ -212,7 +210,6 @@ public class Well {
currentCard = new Card(strokesLifetime);
inclinometer = new AnalogIn(inclinometerChannel, 0, 100, 0, 100);
loadCell = new AnalogIn(loadCellChannel, 0, 50000, 0, 50000);
runCommand = new DigitalOut(runCommandChannel, 0);
strokeSpeed = new Measurement("Stroke Speed", true, db, 0.5, 600);
downholeGrossStroke = new Measurement("Downhole Gross Stroke", true, db, 0.5, 600);
@@ -987,12 +984,6 @@ public class Well {
pointCounter++;
}
if (runStatus == RUNSTATUS_RUNNING || runStatus == RUNSTATUS_STARTING){
runCommand.write(1);
} else {
runCommand.write(0);
}
if(isNewDay()){
strokeSpeed.endOfDay();
downholeGrossStroke.endOfDay();
@@ -1048,12 +1039,6 @@ public class Well {
pointCounter++;
}
if (runStatus == RUNSTATUS_RUNNING || runStatus == RUNSTATUS_STARTING){
runCommand.write(1);
} else {
runCommand.write(0);
}
if(isNewDay()){
strokeSpeed.endOfDay();
downholeGrossStroke.endOfDay();
@@ -1107,9 +1092,6 @@ public class Well {
System.out.println();
}
public void allOutputsOff(){
runCommand.write(0, true);
}
public static void main( String[] args ){
Well thisWell = new Well("Barney", args[1], 99, 99, 99);