Stores well test and gets latest kFactor

This commit is contained in:
Patrick McDonagh
2017-02-07 19:02:10 -06:00
parent 1699b82067
commit 2a13a25f06
16 changed files with 1125 additions and 355 deletions

View File

@@ -7,6 +7,8 @@ package com.henrypump.poc;
*/
import java.awt.*;
import java.awt.event.*;
import java.time.Instant;
import java.util.Date;
public class POC implements Runnable{
protected Well thisWell;
@@ -91,8 +93,9 @@ public class POC implements Runnable{
public void run(){
int loopCounter = 0, loopLimit = simLoops, led2out, led3out, led4out,led5out;
double pos;
boolean newWellTest = true;
long sleepMilliseconds = (long) (thisWell.getDt() * 1000);
thisWell.setupFluidRatio(0.25, 0.75, 1.12);
thisWell.setupFluidRatio(0.50, 0.50, 1.12);
thisWell.checkSafeties();
while (true) {
while (loopCounter < loopLimit && (thisWell.getRunStatus() == Well.RUNSTATUS_RUNNING || thisWell.getRunStatus() == Well.RUNSTATUS_STARTING)) {
@@ -123,6 +126,20 @@ public class POC implements Runnable{
loopCounter++;
}
if (newWellTest){
System.out.println("Previous kFactor = " + thisWell.db.getLatestKFactor());
Date nowDate = Date.from(Instant.now());
thisWell.wellTest = new WellTest(nowDate, 24.0, .35, .20, .15, 1.25, thisWell);
thisWell.db.newWellTest(thisWell.wellTest);
System.out.println("Well Test @ " + nowDate.toString());
System.out.println("kFactor: " + thisWell.wellTest.getkFactor());
System.out.println("oilRatio: " + thisWell.wellTest.getOilRatio());
System.out.println("waterRatio: " + thisWell.wellTest.getWaterRatio());
System.out.println("gasRatio: " + thisWell.wellTest.getGasMCFRatio());
newWellTest = false;
System.out.println("Last kFactor = " + thisWell.db.getLatestKFactor());
}
if (startBtn.read() == 1) thisWell.start("startbutton");
if (stopBtn.read() == 1) thisWell.stop("stopbutton");