Skip to content

Commit

Permalink
Tuned bowl detection parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
jayrajroshan committed Sep 7, 2020
1 parent cfef434 commit 1366081
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions report.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ function myFun() {
console.log(Lastid)
sensor3 = sensorQuery3.rows[0];
console.log(sensor3.speed);
console.log("Last speed");
console.log(LastSpeed);
var id = sensor3.serial_no;
var sensor_id = sensor3.id;
var speed = sensor3.speed;
Expand Down Expand Up @@ -160,29 +162,32 @@ function myFun() {
avg31 = Math.abs(avg3)


if (id > Lastid) {
DelSpeed = LastSpeed - speed;
if (DelSpeed > 6) {
BowlCount += 1;
DelSpeed = LastSpeed - speed;
if (DelSpeed > 6) {
BowlCount += 1;

console.log(BowlCount)
pool.query(
'INSERT INTO bowl_result (id,rotation,hyper_extension,posteriorly_rotated,feed_time,speed) VALUES ($1,$2,$3,$4,$5,$6)', [sensor_id, avg1, avg2, avg3, formattedDate, LastSpeed],
(error, results) => {
if (error) {
throw error
}
console.log("DelSpeed")
console.log(DelSpeed)
console.log("BowlCount")
console.log(BowlCount)

console.log("New bowl added")
pool.query(
'INSERT INTO bowl_result (id,rotation,hyper_extenstion,posteriorly_rotated,feed_time,speed) VALUES ($1,$2,$3,$4,$5,$6)', [sensor_id, avg1, avg2, avg3, formattedDate, LastSpeed],
(error, results) => {
if (error) {
throw error
}

},
console.log("New bowl added")

},

);

);
}
}

Lastid = null
LastSpeed = null
// Lastid = null
// LastSpeed = null
Lastid = id
LastSpeed = speed
console.log(Lastid)
Expand Down

0 comments on commit 1366081

Please sign in to comment.