Uses external MongoDB, uses dates instead of strings for timestamps
This commit is contained in:
@@ -48,20 +48,23 @@ public class IOControl implements Runnable {
|
||||
}
|
||||
|
||||
public void run() {
|
||||
if (startBtn.read() == 1) startWell();
|
||||
if (stopBtn.read() == 1) stopWell();
|
||||
if (startBtn.read() == 1 && stopBtn.read() == 1) {
|
||||
exitPOC();
|
||||
System.out.println("Running the IOControl Loop");
|
||||
for (;;) {
|
||||
if (startBtn.read() == 1) startWell();
|
||||
if (stopBtn.read() == 1) stopWell();
|
||||
if (startBtn.read() == 1 && stopBtn.read() == 1) {
|
||||
exitPOC();
|
||||
}
|
||||
|
||||
pos = poc.thisWell.getCurrentSurfacePosition();
|
||||
runStatus = poc.thisWell.getRunStatus();
|
||||
led2.write(pos > 20.0 ? 1 : 0);
|
||||
led3.write(pos > 40.0 ? 1 : 0);
|
||||
led4.write(pos > 60.0 ? 1 : 0);
|
||||
led5.write(pos > 80.0 ? 1 : 0);
|
||||
|
||||
runningIndicator.write(runStatus == Well.RUNSTATUS_RUNNING ? 1 : 0);
|
||||
runCommand.write((runStatus == Well.RUNSTATUS_RUNNING || runStatus == Well.RUNSTATUS_STARTING) ? 1 : 0);
|
||||
}
|
||||
|
||||
pos = poc.thisWell.getCurrentSurfacePosition();
|
||||
runStatus = poc.thisWell.getRunStatus();
|
||||
led2.write(pos > 20.0 ? 1 : 0);
|
||||
led3.write(pos > 40.0 ? 1 : 0);
|
||||
led4.write(pos > 60.0 ? 1 : 0);
|
||||
led5.write(pos > 80.0 ? 1 : 0);
|
||||
|
||||
runningIndicator.write(runStatus==Well.RUNSTATUS_RUNNING ? 1 : 0);
|
||||
runCommand.write((runStatus == Well.RUNSTATUS_RUNNING || runStatus == Well.RUNSTATUS_STARTING) ? 1: 0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user