Adds well name to config file. Option to startup with external DB
This commit is contained in:
@@ -173,9 +173,9 @@ public class Well {
|
||||
private Measurement surfaceStrokeLength;
|
||||
private Measurement tubingMovement;
|
||||
|
||||
Well(String wellName, int inclinometerChannel, int loadCellChannel, int runCommandChannel){
|
||||
Well(String dbHostname, int inclinometerChannel, int loadCellChannel, int runCommandChannel){
|
||||
this.wellName = wellName;
|
||||
db = new Database();
|
||||
db = new Database(dbHostname);
|
||||
strokesLifetime = db.getLastStrokeNum() + 1;
|
||||
currentCard = new Card(strokesLifetime);
|
||||
inclinometer = new AnalogIn(inclinometerChannel, 0, 100, 0, 100);
|
||||
@@ -184,10 +184,10 @@ public class Well {
|
||||
initializeMeasurements();
|
||||
}
|
||||
|
||||
Well(String wellName, String simFileName, int inclinometerChannel, int loadCellChannel, int runCommandChannel){
|
||||
Well(String dbHostname, String simFileName, int inclinometerChannel, int loadCellChannel, int runCommandChannel){
|
||||
this.wellName = wellName;
|
||||
sim = new Simulation(simFileName);
|
||||
db = new Database();
|
||||
db = new Database(dbHostname);
|
||||
strokesLifetime = db.getLastStrokeNum() + 1;
|
||||
currentCard = new Card(strokesLifetime);
|
||||
inclinometer = new AnalogIn(inclinometerChannel, 0, 100, 0, 100);
|
||||
@@ -357,6 +357,10 @@ public class Well {
|
||||
this.structuralRating = structuralRating;
|
||||
}
|
||||
|
||||
public void setWellName(String wellName) {
|
||||
this.wellName = wellName;
|
||||
}
|
||||
|
||||
public String getWellName() {
|
||||
return wellName;
|
||||
}
|
||||
@@ -534,6 +538,9 @@ public class Well {
|
||||
Object obj = parser.parse(new FileReader(jsonFilename));
|
||||
JSONObject well = (JSONObject) obj;
|
||||
|
||||
Object newWellName = well.get("wellName");
|
||||
if (newWellName != null) wellName = (String) newWellName;
|
||||
|
||||
Object newDeltaT = well.get("deltaT");
|
||||
if (newDeltaT != null) dt = (Double) newDeltaT;
|
||||
|
||||
@@ -1069,7 +1076,7 @@ public class Well {
|
||||
|
||||
|
||||
public static void main( String[] args ){
|
||||
Well thisWell = new Well("Barney", args[1], 99, 99, 99);
|
||||
Well thisWell = new Well(args[1], 99, 99, 99);
|
||||
thisWell.parseJSONFile(args[0]);
|
||||
thisWell.printTapers();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user