Uses external MongoDB, uses dates instead of strings for timestamps

This commit is contained in:
Patrick McDonagh
2017-02-13 12:23:03 -06:00
parent e2d5771a0c
commit fe60ba2292
3 changed files with 30 additions and 26 deletions

View File

@@ -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);
}
}