converted from Maven to Gradle
This commit is contained in:
@@ -82,18 +82,18 @@ public class Database {
|
||||
}
|
||||
|
||||
public long newMeasurement(Measurement inpMeasurement){
|
||||
String df = new SimpleDateFormat("yyyy-MM-dd_HH-mm-ss").format(new Date());
|
||||
MongoCollection<Document> collection = database.getCollection("wellData");
|
||||
Document doc = new Document("tagname", inpMeasurement.getTagName())
|
||||
.append("currentValue", inpMeasurement.getCurrentValue())
|
||||
.append("maxDailyValue", inpMeasurement.getDailyMax())
|
||||
.append("minDailyValue", inpMeasurement.getDailyMin())
|
||||
.append("dailyAverage", inpMeasurement.getAverage())
|
||||
.append("dailyTotal", inpMeasurement.getTotal())
|
||||
.append("timestamp", df);
|
||||
collection.insertOne(doc);
|
||||
return collection.count();
|
||||
|
||||
// String df = new SimpleDateFormat("yyyy-MM-dd_HH-mm-ss").format(new Date());
|
||||
// MongoCollection<Document> collection = database.getCollection("wellData");
|
||||
// Document doc = new Document("tagname", inpMeasurement.getTagName())
|
||||
//// .append("currentValue", inpMeasurement.getCurrentValue())
|
||||
//// .append("maxDailyValue", inpMeasurement.getDailyMax())
|
||||
//// .append("minDailyValue", inpMeasurement.getDailyMin())
|
||||
//// .append("dailyAverage", inpMeasurement.getAverage())
|
||||
//// .append("dailyTotal", inpMeasurement.getTotal())
|
||||
// .append("timestamp", df);
|
||||
// collection.insertOne(doc);
|
||||
// return collection.count();
|
||||
return 1;
|
||||
}
|
||||
|
||||
public long newDailyTotal(Measurement inpMeasurement){
|
||||
|
||||
@@ -99,7 +99,7 @@ public class Measurement {
|
||||
if(storeInDatabase){
|
||||
if(abs(currentValue - lastSentValue) > sendDelta ||
|
||||
currentTimestamp - lastSentTimestamp > (sendTimeDelta * 1000)){
|
||||
db.newMeasurement(this);
|
||||
long l = db.newMeasurement(this);
|
||||
lastSentValue = currentValue;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user