From 8515b26c3744b272d45de1edb957f60a001b9d4a Mon Sep 17 00:00:00 2001 From: Varun Date: Mon, 24 Mar 2025 12:11:19 +0530 Subject: [PATCH 1/4] changes --- src/controllers/tanksController.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/controllers/tanksController.js b/src/controllers/tanksController.js index b575b40a..8d433fd4 100644 --- a/src/controllers/tanksController.js +++ b/src/controllers/tanksController.js @@ -2975,6 +2975,7 @@ exports.motorAction = async (req, reply) => { motorIntervals[motorId] = setInterval(async () => { console.log(motorId,"interval created") const supplierTank = await Tank.findOne({ customerId, tankName: req.body.from, tankLocation: req.body.from_type.toLowerCase() }); +console.log(parseInt(supplierTank.waterlevel, 10),"parseInt(supplierTank.waterlevel, 10)") const currentWaterLevel = parseInt(supplierTank.waterlevel, 10); const currentWaterPercentage = (currentWaterLevel / parseInt(supplierTank.capacity.replace(/,/g, ''), 10)) * 100; const notificationTracker = new Map(); From 407370d26fd28e878177e988b47953b7dc81d987 Mon Sep 17 00:00:00 2001 From: Varun Date: Mon, 24 Mar 2025 12:14:47 +0530 Subject: [PATCH 2/4] changes --- src/controllers/tanksController.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/controllers/tanksController.js b/src/controllers/tanksController.js index 8d433fd4..8884904d 100644 --- a/src/controllers/tanksController.js +++ b/src/controllers/tanksController.js @@ -2975,7 +2975,8 @@ exports.motorAction = async (req, reply) => { motorIntervals[motorId] = setInterval(async () => { console.log(motorId,"interval created") const supplierTank = await Tank.findOne({ customerId, tankName: req.body.from, tankLocation: req.body.from_type.toLowerCase() }); -console.log(parseInt(supplierTank.waterlevel, 10),"parseInt(supplierTank.waterlevel, 10)") +console.log("up") + console.log(supplierTank.waterlevel,"parseInt(supplierTank.waterlevel, 10)") const currentWaterLevel = parseInt(supplierTank.waterlevel, 10); const currentWaterPercentage = (currentWaterLevel / parseInt(supplierTank.capacity.replace(/,/g, ''), 10)) * 100; const notificationTracker = new Map(); From c442cbf52db4917004af14594acb313b1d8a1442 Mon Sep 17 00:00:00 2001 From: Varun Date: Mon, 24 Mar 2025 12:16:41 +0530 Subject: [PATCH 3/4] changes --- src/controllers/tanksController.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/tanksController.js b/src/controllers/tanksController.js index 8884904d..d8f11d50 100644 --- a/src/controllers/tanksController.js +++ b/src/controllers/tanksController.js @@ -2975,7 +2975,7 @@ exports.motorAction = async (req, reply) => { motorIntervals[motorId] = setInterval(async () => { console.log(motorId,"interval created") const supplierTank = await Tank.findOne({ customerId, tankName: req.body.from, tankLocation: req.body.from_type.toLowerCase() }); -console.log("up") +console.log("up",supplierTank) console.log(supplierTank.waterlevel,"parseInt(supplierTank.waterlevel, 10)") const currentWaterLevel = parseInt(supplierTank.waterlevel, 10); const currentWaterPercentage = (currentWaterLevel / parseInt(supplierTank.capacity.replace(/,/g, ''), 10)) * 100; From 7c5f7d59bb29d0ba5767b47f78379b940d342874 Mon Sep 17 00:00:00 2001 From: Varun Date: Mon, 24 Mar 2025 12:21:22 +0530 Subject: [PATCH 4/4] chnages --- src/controllers/tanksController.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/controllers/tanksController.js b/src/controllers/tanksController.js index d8f11d50..90200406 100644 --- a/src/controllers/tanksController.js +++ b/src/controllers/tanksController.js @@ -2974,6 +2974,7 @@ exports.motorAction = async (req, reply) => { motorIntervals[motorId] = setInterval(async () => { console.log(motorId,"interval created") + console.log(customerId,req.body.from,req.body.from_type.toLowerCase()) const supplierTank = await Tank.findOne({ customerId, tankName: req.body.from, tankLocation: req.body.from_type.toLowerCase() }); console.log("up",supplierTank) console.log(supplierTank.waterlevel,"parseInt(supplierTank.waterlevel, 10)")