A few fixes for keeping things private
This commit is contained in:
@@ -40,47 +40,43 @@ public class AnalogIn {
|
|||||||
this.euMin = euMin;
|
this.euMin = euMin;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getHistory(int pointIndex) {
|
double getHistory(int pointIndex) {
|
||||||
return history[pointIndex];
|
return history[pointIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
public long readRaw(){
|
private long readRaw(){
|
||||||
return gpioPin.read();
|
return gpioPin.read();
|
||||||
}
|
}
|
||||||
|
|
||||||
public double readScaled(){
|
double readScaled(){
|
||||||
double pv = ((euMax - euMin)/(rawMax - rawMin)) * gpioPin.read() + (euMax - ((euMax - euMin)/(rawMax - rawMin)) * rawMax);
|
double pv = ((euMax - euMin)/(rawMax - rawMin)) * readRaw() + (euMax - ((euMax - euMin)/(rawMax - rawMin)) * rawMax);
|
||||||
lastValue = pv;
|
lastValue = pv;
|
||||||
for(int i = 98; i >= 0; i--){
|
System.arraycopy(history, 0, history,1, history.length - 1);
|
||||||
history[i+1] = history[i];
|
|
||||||
}
|
|
||||||
history[0] = lastValue;
|
history[0] = lastValue;
|
||||||
return pv;
|
return pv;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double readScaledSim(double simRaw){
|
double readScaledSim(double simRaw){
|
||||||
double pv = ((euMax - euMin)/(rawMax - rawMin)) * simRaw + (euMax - ((euMax - euMin)/(rawMax - rawMin)) * rawMax);
|
double pv = ((euMax - euMin)/(rawMax - rawMin)) * simRaw + (euMax - ((euMax - euMin)/(rawMax - rawMin)) * rawMax);
|
||||||
lastValue = pv;
|
lastValue = pv;
|
||||||
for(int i = 98; i >= 0; i--){
|
System.arraycopy(history, 0, history,1, history.length - 1);
|
||||||
history[i+1] = history[i];
|
|
||||||
}
|
|
||||||
history[0] = lastValue;
|
history[0] = lastValue;
|
||||||
return pv;
|
return pv;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args){
|
public static void main(String[] args){
|
||||||
System.out.println("Testing Analog Inputs Inputs...");
|
System.out.println("Testing Analog Inputs Inputs...");
|
||||||
boolean forceEnd = false;
|
|
||||||
AnalogIn testIn0 = new AnalogIn(0, 0, 1020, 0, 4.6);
|
AnalogIn testIn0 = new AnalogIn(0, 0, 1020, 0, 4.6);
|
||||||
|
int loops = 0;
|
||||||
do {
|
while(loops < 60) {
|
||||||
try{
|
try {
|
||||||
System.out.println("Raw = " + testIn0.readRaw());
|
System.out.println("Raw = " + testIn0.readRaw());
|
||||||
System.out.println("Scaled = " + testIn0.readScaled());
|
System.out.println("Scaled = " + testIn0.readScaled());
|
||||||
sleep(500);
|
sleep(500);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
} while (!forceEnd);
|
loops++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
15
src/main/java/com/henrypump/poc/FluidShot.java
Normal file
15
src/main/java/com/henrypump/poc/FluidShot.java
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
package com.henrypump.poc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by patrickjmcd on 2/10/17.
|
||||||
|
*/
|
||||||
|
public class FluidShot {
|
||||||
|
private double fluidLevel;
|
||||||
|
private double frictionEstimate;
|
||||||
|
private double pumpIntakePressure;
|
||||||
|
|
||||||
|
|
||||||
|
FluidShot(double fluidLevel){
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,7 +16,7 @@ public class WellTest {
|
|||||||
private double kFactor, oilRatio, waterRatio, gasMCFRatio;
|
private double kFactor, oilRatio, waterRatio, gasMCFRatio;
|
||||||
|
|
||||||
|
|
||||||
public WellTest(ZonedDateTime testStart, double testHours, double totalFluidBBL, double testOilBBL, double testWaterBBL, double testGasMCF, double prevDailyTotal) {
|
WellTest(ZonedDateTime testStart, double testHours, double totalFluidBBL, double testOilBBL, double testWaterBBL, double testGasMCF, double prevDailyTotal) {
|
||||||
this.testStart = testStart;
|
this.testStart = testStart;
|
||||||
this.testHours = testHours;
|
this.testHours = testHours;
|
||||||
this.totalFluidBBL = totalFluidBBL;
|
this.totalFluidBBL = totalFluidBBL;
|
||||||
|
|||||||
Reference in New Issue
Block a user